Git Product home page Git Product logo

ember-apply's Introduction

ember-apply

npm version CI

Automatic integration and configuration from the community.

See the Documentation.

This is a framework and ecosystem agnostic collection of recommended configurations, applied via automation, that is compatible with any kind of project, new and old.

Individual configurations may have conventions specific to a an ecosystem, but ember-apply, itself, can be used with Svelte, React, or whatever you want. The tools provided by ember-apply only require Node 16+.

Maybe most importantly, is that ember-apply can be used for any tool that wishes to use high-level project-management and transformation utilities. See #Public API.

npm (tag) npm (tag)

NOTE: this package is a slightly experimental and prone to some API or organizational changes -- but is committed to strictly following semver.

Usage

npx ember-apply <feature-name>

where <feature-name> is one of the options under #Features

Compatibility

  • Node 16 +
  • ESM

Features

typescript

npx ember-apply typescript

Automates setting up TypeScript for your V1 Addon or App.

  • correct dependencies
  • correct types
  • correct configs

volta

npx ember-apply volta

Automates setting up volta in a project, monorepo or solorepo.

  • root package.json defines node version
  • if monorepo, all other packages extend from the root package.json

tailwind

npx ember-apply tailwind

Automates the steps from Tailwind's installation docs

Known working capabilities:

  • JIT
  • Rebuilding during development

Assumptions

  • entrypoint for your app is located at app/index.html
  • entrypoint for your tests is located at tests/index.html
  • tailwind files are placed in config/tailwind/

tailwind-webpack

npx ember-apply tailwind-webpack

Automates the official Tailwind + Ember.js guide

  • Instead of placing postcss.config.js and tailwind.config.js into the project root, it places them to config/ directory.
  • Does not need any special command for building tailwind styles they will be built (and watched) together with npm start.

embroider

npx ember-apply embroider

Automates the embroider migration from the classic ember build system for maximum-compatibility mode. See the Embroider docs

ssr

implementation tbd (pr's welcome!)

npx ember-apply ssr

Known working capabilities:

  • tbd

any package with as ESM with a default export

when using a package name for the <feature-name>, an ESM version of the package will attempt to be loaded and used, invoking the default export.

npx ember-apply @scope/feature-name

Local scripts may also be used. An example of this is maybe in a private monorepo where some scripts or packages aren't published to npm.

npx ember-apply ../../path/to/some/script.js # ESM required
# or
npx ember-apply ../../path/to/some/script.mjs

Adding a new applyable to this repository

  • clone this repository
  • create a packages/<ecosystem>/<feature>/index.js file examples:
    • packages/ember/tailwind/index.js
    • packages/sveltekit/tailwind/index.js
  • have a function exported as the default export. within this function, you may import form ember-apply to use any of the utility functions. the only argument passed to this function is the working directory npx ember-apply was invoked from. how the <your-applyable> folder is managed is totally up to whomever implements and maintains that code.

For Transforming JS

JSCodeShift is used

For Transforming Ember Templates

ember-template-recast is used

For Transforming HTML

posthtml is used

Related Projects

  • preset GOAL (tbd): be compatible with npx apply

    • preset does not provide codemodding tools, but it does provide basic pattern-based transforming utilities, so it's a solid option. It also does not have built-in support for template transforms.
    • currently, preset forces the install of esbuild which fails due to having the security feature ignore-scripts enabled, so preset is a non-option for folks who care about security. (or who don't mind adding an allow-list for preset)

ember-apply's People

Contributors

dependabot[bot] avatar evoactivity avatar github-actions[bot] avatar jacobq avatar juice10 avatar michalbryxi avatar nullvoxpopuli avatar renovate-bot avatar renovate[bot] avatar semantic-release-bot avatar simonihmig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ember-apply's Issues

add util to the ember namespace that shows what % of an ember project is JS, HTML, and Ember

JS, things that are non-standard JS (in the broader ecosystem)

  • decorators
  • constructors of @glimmer/component
    • NOTE: you don't need constructors, so if you get rid of them, your "PLATFORM" score will be higher
  • routes
  • controllers

HTML, things that are non-standard HTML

  • curlies / control flow (angle bracket components are standard, so they'll count towards the HTML score, curlies against)
  • strings / text-nodes should probably be omitted from the calculation entirely, as they're noise (and would exist in both standard, and ember projects)

GJS/GTS

  • split in to JS/HTML for above heuristics

Sort dependencies after mutations

Would be nice to have all packageJson.add{Dev,Peer}Dependencies APIs sort the dependencies before writing back to disk, so you don't get any noise when e.g. a linter runs on those later and reshuffles them into order again.

Could not find @ember-apply/tailwind or tailwind on npm

I was trying to play with this + ember-cli template on stakblitz and I got this error: Could not find @ember-apply/tailwind or tailwind on npm.

Steps to reproduce

  1. GOTO: https://stackblitz.com/github/ember-cli/ember-new-output?
  2. Run:
~/projects/qgnivgjvn.github 1m 37s
npx ember-apply tailwind
warn verifyTree [email protected]: The engine "node" is incompatible with this
module. Expected version ">=16.0.0" found "v14.17.0".
success Install finished in 16.06s

ℹ Skypack unavailable, downloading from npm
✖ Could not find @ember-apply/tailwind or tailwind on npm
AssertionError [ERR_ASSERTION]: Could not find @ember-apply/tailwind or tailwind on npm
    at downloadFromNpm (file:///home/.turbo/npx/ff17AI/node_modules/ember-apply/src/cli/resolve.js:164:18)
    at async Module.resolveApplyable (file:///home/.turbo/npx/ff17AI/node_modules/ember-apply/src/cli/resolve.js:46:6)
    at async getApplyable (file:///home/.turbo/npx/ff17AI/node_modules/ember-apply/src/cli/index.js:87:25)
    at async run (file:///home/.turbo/npx/ff17AI/node_modules/ember-apply/src/cli/index.js:68:21)
    at async Object.eval [as handler] (file:///home/.turbo/npx/ff17AI/node_modules/ember-apply/src/cli/index.js:46:9) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: null,
  expected: true,
  operator: '=='
}

`npx ember-apply typescript` doesn't work in v1 addons

The documentation mentions that this automation should also work for v1 addons, but when I try it on this one I see the following console output:

Debugger attached.
ℹ Downloading from npm...
ℹ Applying: typescript
ℹ If there are any bugs with this applyable, feel free to report at https://github.com/NullVoxPopuli/ember-apply/issues
Could not determine where to enable TypeScripts in ember-cli-build.js. Please refer to the docs: https://github.com/emberjs/ember-cli-babel#enabling-typescript-transpilation
✖ ENOENT: no such file or directory, open 'types/global.d.ts'
[Error: ENOENT: no such file or directory, open 'types/global.d.ts'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'types/global.d.ts'
}

My guess is that this check fails because the ember-cli-build.js file for addons seems to contain const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); instead of what that check looks for.

HTML files getting mangled with `ember-apply tailwind`

I don't know if this is rehype or what, but:

-<!DOCTYPE html>
-<html>
-  <head>
+<!DOCTYPE html><html><head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <title>TmpApplyDummy</title>
+    <title></title>
     <meta name="description" content="">
     <meta name="viewport" content="width=device-width, initial-scale=1">
 
-    {{content-for "head"}}
+    </head><body>{{content-for "head"}}
 
-    <link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
+    <link integrity="" rel="stylesheet" href="{{rootURL}}assets/tailwind.css">
+<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
     <link integrity="" rel="stylesheet" href="{{rootURL}}assets/tmp-apply-dummy.css">
 
     {{content-for "head-footer"}}
-  </head>
-  <body>
+  
+  
     {{content-for "body"}}
 
     <script src="{{rootURL}}assets/vendor.js"></script>
     <script src="{{rootURL}}assets/tmp-apply-dummy.js"></script>
 
     {{content-for "body-footer"}}
-  </body>
-</html>
+  
+
+</body></html>

and:

-<!DOCTYPE html>
-<html>
-  <head>
+<!DOCTYPE html><html><head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <title>TmpApplyDummy Tests</title>
+    <title></title>
     <meta name="description" content="">
     <meta name="viewport" content="width=device-width, initial-scale=1">
 
-    {{content-for "head"}}
+    </head><body>{{content-for "head"}}
     {{content-for "test-head"}}
 
-    <link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
+    <link rel="stylesheet" href="{{rootURL}}assets/tailwind.css">
+<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
     <link rel="stylesheet" href="{{rootURL}}assets/tmp-apply-dummy.css">
     <link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
 
     {{content-for "head-footer"}}
     {{content-for "test-head-footer"}}
-  </head>
-  <body>
+  
+  
     {{content-for "body"}}
     {{content-for "test-body"}}
 
@@ -28,7 +27,7 @@
       </div>
     </div>
 
-    <script src="/testem.js" integrity="" data-embroider-ignore></script>
+    <script src="/testem.js" integrity="" data-embroider-ignore=""></script>
     <script src="{{rootURL}}assets/vendor.js"></script>
     <script src="{{rootURL}}assets/test-support.js"></script>
     <script src="{{rootURL}}assets/tmp-apply-dummy.js"></script>
@@ -36,5 +35,6 @@
 
     {{content-for "body-footer"}}
     {{content-for "test-body-footer"}}
-  </body>
-</html>
+  
+
+</body></html>

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • wyvox/action v1
  • wyvox/action v1
  • wyvox/action v1
  • wyvox/action v1
  • actions/upload-artifact v3
  • actions/download-artifact v3
  • cloudflare/pages-action v1.5.0
.github/workflows/deploy-preview.yml
  • actions/checkout v4
  • felixmosh/turborepo-gh-artifacts v3
  • NullVoxPopuli/action-setup-pnpm v2
  • actions/upload-artifact v3
  • actions/download-artifact v3
  • cloudflare/pages-action v1.5.0
  • marocchino/sticky-pull-request-comment v2
.github/workflows/plan-release.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/setup-node v4
  • pnpm/action-setup v2
  • peter-evans/create-pull-request v6
.github/workflows/publish.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/setup-node v4
  • pnpm/action-setup v2
npm
ember-apply/package.json
  • @babel/eslint-parser ^7.23.3
  • @nullvoxpopuli/eslint-configs ^3.2.2
  • @types/fs-extra ^11.0.4
  • @types/jscodeshift ^0.11.10
  • @types/node ^20.9.2
  • @types/pacote ^11.1.8
  • @types/semver ^7.5.5
  • @types/sort-object-keys ^1.1.3
  • @types/yargs ^17.0.31
  • @typescript-eslint/eslint-plugin ^6.11.0
  • @typescript-eslint/parser ^6.11.0
  • @vitest/coverage-v8 ^0.34.6
  • @vitest/ui ^0.34.6
  • c8 ^8.0.1
  • concurrently ^8.2.2
  • eslint ^8.54.0
  • eslint-plugin-decorator-position ^5.0.2
  • eslint-plugin-import ^2.29.0
  • eslint-plugin-node ^11.1.0
  • eslint-plugin-prettier ^5.0.1
  • prettier ^3.0.0
  • typescript 5.3.3
  • vite ^5.0.0
  • vitest ^0.34.6
package.json
  • release-plan ^0.6.0
  • turbo 1.11.3
  • node 20.11.1
  • pnpm 8.12.1
  • pnpm 8
packages/docs/package.json
  • typedoc ^0.25.3
  • typedoc-plugin-markdown ^3.17.1
  • typedoc-plugin-mdn-links ^3.1.4
  • typedoc-plugin-merge-modules ^5.1.0
  • typescript 5.3.3
packages/ember/embroider/package.json
  • @babel/eslint-parser ^7.23.3
  • @nullvoxpopuli/eslint-configs ^3.2.2
  • @typescript-eslint/eslint-plugin ^6.11.0
  • @typescript-eslint/parser ^6.11.0
  • @vitest/coverage-c8 ^0.33.0
  • @vitest/coverage-v8 ^0.34.6
  • autoprefixer ^10.4.16
  • c8 ^8.0.1
  • eslint ^8.54.0
  • eslint-plugin-decorator-position ^5.0.2
  • eslint-plugin-import ^2.29.0
  • eslint-plugin-node ^11.1.0
  • eslint-plugin-prettier ^5.0.1
  • postcss ^8.4.31
  • prettier ^3.1.0
  • typescript 5.3.3
  • vite ^5.0.0
  • vitest ^0.34.6
  • node 20.11.1
packages/ember/tailwind-webpack/package.json
  • @babel/eslint-parser ^7.23.3
  • @nullvoxpopuli/eslint-configs ^3.2.2
  • @typescript-eslint/eslint-plugin ^6.11.0
  • @typescript-eslint/parser ^6.11.0
  • @vitest/coverage-v8 ^0.34.6
  • c8 ^8.0.1
  • eslint ^8.54.0
  • eslint-plugin-decorator-position ^5.0.2
  • eslint-plugin-import ^2.29.0
  • eslint-plugin-node ^11.1.0
  • eslint-plugin-prettier ^5.0.1
  • execa ^8.0.1
  • fs-extra ^11.1.1
  • prettier ^3.1.0
  • typescript 5.3.3
  • vite ^5.0.0
  • vitest ^0.34.6
  • node 20.11.1
packages/ember/tailwind/package.json
  • @babel/eslint-parser ^7.23.3
  • @nullvoxpopuli/eslint-configs ^3.2.2
  • @typescript-eslint/eslint-plugin ^6.11.0
  • @typescript-eslint/parser ^6.11.0
  • @vitest/coverage-v8 ^0.34.6
  • c8 ^8.0.1
  • eslint ^8.54.0
  • eslint-plugin-decorator-position ^5.0.2
  • eslint-plugin-import ^2.29.0
  • eslint-plugin-node ^11.1.0
  • eslint-plugin-prettier ^5.0.1
  • prettier ^3.1.0
  • typescript 5.3.3
  • vite ^5.0.0
  • vitest ^0.34.6
  • node 20.11.1
packages/ember/typescript/package.json
  • @babel/eslint-parser ^7.23.3
  • @nullvoxpopuli/eslint-configs ^3.2.2
  • @types/common-tags ^1.8.4
  • @types/fs-extra ^11.0.4
  • @types/jscodeshift ^0.11.10
  • @typescript-eslint/eslint-plugin ^6.11.0
  • @typescript-eslint/parser ^6.11.0
  • @vitest/coverage-c8 ^0.33.0
  • @vitest/coverage-v8 ^0.34.6
  • ast-types ^0.14.2
  • autoprefixer ^10.4.16
  • c8 ^8.0.1
  • eslint ^8.54.0
  • eslint-plugin-decorator-position ^5.0.2
  • eslint-plugin-import ^2.29.0
  • eslint-plugin-node ^11.1.0
  • eslint-plugin-prettier ^5.0.1
  • jscodeshift ^0.15.1
  • postcss ^8.4.31
  • prettier ^3.1.0
  • typescript 5.3.3
  • vite ^5.0.0
  • vitest ^0.34.6
  • node 20.11.1
packages/ember/unstable-embroider/package.json
  • @babel/eslint-parser ^7.23.3
  • @nullvoxpopuli/eslint-configs ^3.2.2
  • @typescript-eslint/eslint-plugin ^6.11.0
  • @typescript-eslint/parser ^6.11.0
  • @vitest/coverage-c8 ^0.33.0
  • @vitest/coverage-v8 ^0.34.6
  • c8 ^8.0.1
  • eslint ^8.54.0
  • eslint-plugin-decorator-position ^5.0.2
  • eslint-plugin-import ^2.29.0
  • eslint-plugin-node ^11.1.0
  • eslint-plugin-prettier ^5.0.1
  • prettier ^3.1.0
  • typescript 5.3.3
  • vite ^5.0.0
  • vitest ^0.34.6
  • node 20.11.1
packages/volta/package.json
  • @babel/eslint-parser ^7.23.3
  • @nullvoxpopuli/eslint-configs ^3.2.2
  • @typescript-eslint/eslint-plugin ^6.11.0
  • @typescript-eslint/parser ^6.11.0
  • @vitest/coverage-c8 ^0.33.0
  • @vitest/coverage-v8 ^0.34.6
  • autoprefixer ^10.4.16
  • c8 ^8.0.1
  • eslint ^8.54.0
  • eslint-plugin-decorator-position ^5.0.2
  • eslint-plugin-import ^2.29.0
  • eslint-plugin-node ^11.1.0
  • eslint-plugin-prettier ^5.0.1
  • postcss ^8.4.31
  • prettier ^3.1.0
  • typescript 5.3.3
  • vite ^5.0.0
  • vitest ^0.34.6
  • node 20.11.1

  • Check this box to trigger a request for Renovate to run again on this repository

Is there a way to run`ember-apply tailwind` on an Ember addon('s dummy app)?

I was thinking of using the dummy app of an ember addon as a "live demo" (and maybe deploy on GitHub pages) so was going to spruce the appearance of it up a bit with tailwind. However, it looks like the base folder needs to have both package.json (would be in repo root) and app/index.html (would be in tests/dummy).

await files.applyFolder(path.join(__dirname, 'files'), 'config/tailwind');
await html.insertText('app/index.html', {
text: `<link integrity="" rel="stylesheet" href="{{rootURL}}assets/tailwind.css">\n`,
beforeFirst: 'link',
});
await html.insertText('tests/index.html', {
text: `<link rel="stylesheet" href="{{rootURL}}assets/tailwind.css">\n`,
beforeFirst: 'link',
});

suggestion: introduce debug flag to generate "patch" for modified file

In case of any issue, it will be great to have ability to generate "patch" for file for debug purposes (and be able to attach it to issue, if needed)

image

how it may looks like:

if user see fail with "ember-apply package-name", we could offer to add flag and specify glob to files to create patches for:

ember-apply tailwind --debug app/index.html

and patch file for changes on index.html should be created

New app and tailwind-webpack build problem

I'm having a problem with a new Ember app and applying the tailwind-webpack feature.

ember-cli: 5.4.1
node: 18.18.2
os: darwin x64
  1. Create a new Ember app:
    ember new ref-fun --typescript --pnpm --no-welcome --embroider

  2. Run ember-apply to add tailwind:
    npx ember-apply tailwind-webpack
    pnpm install

  3. Build and run app:
    pnpm start

This fails with an error importing the css from the app.ts file.

Module not found: Error: Can't resolve './app.css' in '/Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app'
resolve './app.css' in '/Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app'

I can't quite tell what is going on. Stack trace is below and a minimal reproduction repo is here: https://github.com/tcjr/ref-fun

This seems like it is probably not a problem with ember-apply because the generated/updated files all look good to my eye. But if that's the case, then the official Ember instructions on tailwind.com might need to be updated.

Any thoughts on what the problem is?

» pnpm start                                                                   

> [email protected] start /Users/tcjr/dev/tcjr/ref-fun
> ember serve

⠙ building... [@embroider/webpack]assets by chunk 2.1 MiB (id hint: vendors)
  asset assets/chunk.1e206c37d144aca9dd38.js 1.45 MiB [emitted] [immutable] [big] (id hint: vendors)
  asset assets/chunk.7f13c17815c192656f3c.js 667 KiB [emitted] [immutable] [big] (id hint: vendors)
asset assets/chunk.6eaf26d6acf46f482745.js 430 KiB [emitted] [immutable] [big]
asset assets/chunk.c5d3d377d88eccbe441e.js 313 KiB [emitted] [immutable] [big] (name: assets/test.js)
asset assets/chunk.d423d58ebbba6dc629ec.js 7.43 KiB [emitted] [immutable] (name: assets/ref-fun.js)
Entrypoint assets/ref-fun.js [big] 1.88 MiB = assets/chunk.1e206c37d144aca9dd38.js 1.45 MiB assets/chunk.6eaf26d6acf46f482745.js 430 KiB assets/chunk.d423d58ebbba6dc629ec.js 7.43 KiB
Entrypoint assets/test.js [big] 2.83 MiB = assets/chunk.1e206c37d144aca9dd38.js 1.45 MiB assets/chunk.7f13c17815c192656f3c.js 667 KiB assets/chunk.6eaf26d6acf46f482745.js 430 KiB assets/chunk.c5d3d377d88eccbe441e.js 313 KiB
runtime modules 6.77 KiB 14 modules
modules by path ../ 1.54 MiB
  modules by path ../rewritten-packages/ 1.23 MiB 174 modules
  modules by path ../../.pnpm/ 322 KiB 23 modules
modules by path ./ 7.03 KiB
  modules by path ./assets/*.js 3.2 KiB 2 modules
  modules by path ./tests/ 1.53 KiB 2 modules
  modules by path ./*.ts 1.2 KiB
    ./app.ts 699 bytes [built] [code generated]
    ./router.ts 533 bytes [built] [code generated]
  ./config/environment.js 549 bytes [built] [code generated]
  ./templates/application.hbs 573 bytes [built] [code generated]
+ 129 modules

ERROR in ./app.ts 6:0-25
Module not found: Error: Can't resolve './app.css' in '/Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app'
resolve './app.css' in '/Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app'
  using description file: /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/package.json (relative path: ./app.css)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css doesn't exist
      .wasm
        Field 'browser' doesn't contain a valid alias configuration
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css.wasm doesn't exist
      .mjs
        Field 'browser' doesn't contain a valid alias configuration
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css.mjs doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css.json doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css.ts doesn't exist
      .hbs
        Field 'browser' doesn't contain a valid alias configuration
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css.hbs doesn't exist
      .hbs.js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css.hbs.js doesn't exist
      as directory
        /Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.css doesn't exist
 @ ./assets/ref-fun.js 7:13-38 69:6-23

webpack 5.89.0 compiled with 1 error in 7750 ms
Build Error (PackagerRunner) in app.ts

Module not found: Error: Can't resolve './app.css' in '/Users/tcjr/dev/tcjr/ref-fun/node_modules/.embroider/rewritten-app/app.ts'


Stack Trace and Error Report: /var/folders/_d/3_dky5cs1h95dm39yvx6yhh80000gn/T/error.dump.961079fdd850c82d52fee2fc605ba014.log

tailwind-webpack issue

Whups :o)

npx ember-apply tailwind-webpack
ℹ Skypack unavailable, downloading from npm
ℹ Applying: tailwind-webpack
ℹ If there are any bugs with this applyable, feel free to report at https://github.com/NullVoxPopuli/ember-apply/issues
✖ `import` can only be used in `import()` or `import.meta`. (1:1)
SyntaxError: `import` can only be used in `import()` or `import.meta`. (1:1)
    at constructor (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:356:19)
    at TypeScriptParserMixin.raise (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:3223:19)
    at TypeScriptParserMixin.parseExprAtom (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:11101:16)
    at TypeScriptParserMixin.parseExprSubscripts (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:10857:23)
    at TypeScriptParserMixin.parseUpdate (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:10840:21)
    at TypeScriptParserMixin.parseMaybeUnary (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:10816:23)
    at TypeScriptParserMixin.parseMaybeUnary (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:9696:18)
    at TypeScriptParserMixin.parseMaybeUnaryOrPrivate (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:10654:61)
    at TypeScriptParserMixin.parseExprOps (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:10659:23)
    at TypeScriptParserMixin.parseMaybeConditional (/private/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/ember-apply-runtime---ULPxcP/node_modules/@babel/parser/lib/index.js:10636:23) {
  code: 'BABEL_PARSER_SYNTAX_ERROR',
  reasonCode: 'UnsupportedImport',
  loc: Position { line: 1, column: 1, index: 1 },
  pos: 1
}

No idea what is it complaining about?

Inconsistent test runs depending on the installed ember-cli version

I wanted to bump the embroider packages to v2 but noticed that the tests where failing locally before I even made a change.

It seems that during the tests a new ember app is generated, modified and then compared to the snapshots. It uses your globally installed ember-cli for that, so if the version doesn't match with the one that was used for generating the snapshots the tests will probably fail. This also means that the tests always fail if you don't have ember-cli installed globally. CI potentially has the same issue since the latest ember-cli version is installed globally (which might differ from the ones used for the snapshots).

Would it maybe be better to install ember-cli as a devDependency so the test runs are consistent? We can then update the snapshots when bumping the ember-cli version.

Volta isn't working with zsh

I tried running the volta applyable on a brand new ember project and it's failing with this stack trace:

~/dev/tcjr/my-app (main) » npx ember-apply volta                                                          
ℹ Downloading from npm...
ℹ Applying: volta
ℹ If there are any bugs with this applyable, feel free to report at https://github.com/NullVoxPopuli/ember-apply/issues
✖ Command failed with exit code 1: which volta
Error: Command failed with exit code 1: which volta
    at makeError (file:///private/var/folders/_d/3_dky5cs1h95dm39yvx6yhh80000gn/T/ember-apply-runtime---I7YzOk/node_modules/execa/lib/error.js:60:11)
    at handlePromise (file:///private/var/folders/_d/3_dky5cs1h95dm39yvx6yhh80000gn/T/ember-apply-runtime---I7YzOk/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async hasVolta (file:///private/var/folders/_d/3_dky5cs1h95dm39yvx6yhh80000gn/T/ember-apply-runtime---I7YzOk/index.js:34:16)
    at async run (file:///private/var/folders/_d/3_dky5cs1h95dm39yvx6yhh80000gn/T/ember-apply-runtime---I7YzOk/index.js:9:3)
    at async run (file:///Users/tcjr/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/index.js:77:3)
    at async Object.handler (file:///Users/tcjr/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/index.js:43:9) {
  shortMessage: 'Command failed with exit code 1: which volta',
  command: 'which volta',
  escapedCommand: 'which volta',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '',
  cwd: '/Users/tcjr/dev/tcjr/my-app',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Volta is installed and in the path, so it's not clear to me why it's failing.

~/dev/tcjr/my-app (main) » which volta
/Users/tcjr/.volta/bin/volta

~/dev/tcjr/my-app (main) » volta --version
1.1.1

Any ideas?

Location of css for tailwind

I get that the tailwind instructions say to put it into the main page, but I think they aren't thinking of long running and bigger projects. It adds to the clutter already in the root folder and you don't expect css to be there in an ember app.

I'd put it into app/styles or vendor folders.

Could not find @ember-apply/embroider or embroider on npm

Not sure where is the issue. But I believe this will be project agnostic?

❯ npx ember-apply embroider
ℹ Skypack unavailable, downloading from npm
✖ Could not find @ember-apply/embroider or embroider on npm
AssertionError [ERR_ASSERTION]: Could not find @ember-apply/embroider or embroider on npm
    at downloadFromNpm (file:///Users/michal/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/resolve.js:152:3)
    at async resolveApplyable (file:///Users/michal/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/resolve.js:34:6)
    at async getApplyable (file:///Users/michal/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/index.js:85:25)
    at async run (file:///Users/michal/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/index.js:66:21)
    at async Object.handler (file:///Users/michal/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/index.js:44:9) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: null,
  expected: true,
  operator: '=='
}

Tried on this repository.

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Manual testing falsely trips ERR_MODULE_NOT_FOUND rethrow logic?

It seems that manual testing with something like this:

node /some/path/ember-apply/src/cli/index.js tailwind

can cause this logic to fail:

if (error.code === 'ERR_MODULE_NOT_FOUND') {
/**
* If *we* make a mistake, don't swallow the error
*/
if (!error.message.includes('ember-apply/src/cli/')) {
throw error;
}
}

By "fail" I mean that the error should've been swallowed as it merely indicates that the module being imported was not a path.
e.g. In the case below (attempting to run local ember-apply script in ember-cli-plotly project dir) it failed because the stack trace included "tryResolve ... ember-apply/src/cli/resolve.js"

Cannot find module 'C:\Users\jacob\Documents\ember-cli-plotly\tailwind' imported from C:\Users\jacob\Documents\ember-apply\ember-apply\src\cli\resolve.js
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\jacob\Documents\ember-cli-plotly\tailwind' imported from C:\Users\jacob\Documents\ember-apply\ember-apply\src\cli\resolve.js
    at new NodeError (node:internal/errors:372:5)
    at finalizeResolution (node:internal/modules/esm/resolve:437:11)
    at moduleResolve (node:internal/modules/esm/resolve:1009:10)
    at defaultResolve (node:internal/modules/esm/resolve:1218:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ESMLoader.import (node:internal/modules/esm/loader:380:22)
    at importModuleDynamically (node:internal/modules/esm/translators:106:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
    at tryResolve (file:///C:/Users/jacob/Documents/ember-apply/ember-apply/src/cli/resolve.js:272:27) {
  code: 'ERR_MODULE_NOT_FOUND'
}

It's also admittedly possible that I broke something (I'm working off the fork in #262, which touched the resolve logic) or am doing something wrong.

Help users avoid careless typos in arguments

I realize that arguments are intentionally left open-ended, so they can't be fully validated, per se. However, I often make careless mistakes like confusing tailwind and tailwindcss, and, although it isn't too hard to figure it out, it would be nice to have a "Did you mean ___?" message in the event that there was an error and the argument provided was close to one of the "special cases" (e.g. as scored by something like https://github.com/axules/fuzzy-tools#match-in-list-of-strings)

$ npx ember-apply tailwindcss
Need to install the following packages:
  ember-apply
Ok to proceed? (y) y
ℹ Skypack unavailable, downloading from npm
✖ tailwindcss's package.json does not have an exports.import
AssertionError [ERR_ASSERTION]: tailwindcss's package.json does not have an exports.import
    at downloadFromNpm (file:///home/user/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/resolve.js:160:3)
    at async resolveApplyable (file:///home/user/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/resolve.js:34:6)
    at async getApplyable (file:///home/user/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/index.js:85:25)
    at async run (file:///home/user/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/index.js:66:21)
    at async Object.handler (file:///home/user/.npm/_npx/4a3d1908b81a92e4/node_modules/ember-apply/src/cli/index.js:44:9) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: true,
  operator: '=='
}

posthtml rewrites `data-embroider-ignore` as `data-embroider-ignore=""`

This doesn't seem to actually break anything (output is still valid), but it is annoying to have meaningless/noise changes introduced. I think we could fix this by using https://github.com/posthtml/posthtml-boolean-attributes

const recast = require('ember-template-recast');
const posthtml = require('posthtml');
const template = `<script src="/testem.js" integrity="" data-embroider-ignore></script>`;
console.log('recast', recast.print(recast.parse(template)));
posthtml([]).process(template).then((result) => {
  console.log('posthtml', result.html);
});
// Output:
// recast <script src="/testem.js" integrity="" data-embroider-ignore></script>
// posthtml <script src="/testem.js" integrity="" data-embroider-ignore=""></script>

+ <script src=\\"/testem.js\\" integrity=\\"\\" data-embroider-ignore=\\"\\"></script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.