From 9df767d54388848d1c426984215abd03339f5e27 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 10 May 2024 15:55:26 -0400 Subject: [PATCH 1/4] Reproduction --- test-apps/classic-app-2024-05/.editorconfig | 19 +++++ test-apps/classic-app-2024-05/.ember-cli | 15 ++++ test-apps/classic-app-2024-05/.eslintignore | 25 ++++++ test-apps/classic-app-2024-05/.eslintrc.js | 10 +++ .../.github/workflows/ci.yml | 47 +++++++++++ test-apps/classic-app-2024-05/.gitignore | 32 ++++++++ test-apps/classic-app-2024-05/.prettierignore | 25 ++++++ test-apps/classic-app-2024-05/.prettierrc.js | 12 +++ .../classic-app-2024-05/.template-lintrc.js | 5 ++ test-apps/classic-app-2024-05/.watchmanconfig | 3 + test-apps/classic-app-2024-05/README.md | 56 +++++++++++++ test-apps/classic-app-2024-05/app/app.js | 13 ++++ .../app/components/.gitkeep | 0 .../app/components/component-at-class.css | 3 + .../app/components/component-at-class.hbs | 1 + .../app/components/dynamic-attribute.css | 7 ++ .../app/components/dynamic-attribute.hbs | 3 + .../app/components/face.hbs | 3 + .../app/components/face.module.css | 3 + .../app/components/has-at-class.hbs | 1 + .../app/components/header.css | 3 + .../app/components/header.hbs | 4 + .../app/components/header.js | 6 ++ .../in-app/at-class-ts/calls-has-at-class.css | 3 + .../in-app/at-class-ts/calls-has-at-class.gts | 7 ++ .../in-app/at-class-ts/has-at-class.gts | 3 + .../app/components/scoped.css | 0 .../app/components/scoped.hbs | 6 ++ .../app/components/show-time.css | 3 + .../app/components/show-time.gjs | 3 + .../app/components/subexpression.css | 3 + .../app/components/subexpression.gjs | 5 ++ .../app/components/template-only.css | 3 + .../app/components/template-only.hbs | 1 + .../app/controllers/.gitkeep | 0 .../app/controllers/application.js | 5 ++ .../classic-app-2024-05/app/helpers/.gitkeep | 0 test-apps/classic-app-2024-05/app/index.html | 28 +++++++ .../classic-app-2024-05/app/models/.gitkeep | 0 test-apps/classic-app-2024-05/app/router.js | 10 +++ .../classic-app-2024-05/app/routes/.gitkeep | 0 .../classic-app-2024-05/app/styles/app.css | 7 ++ .../app/templates/application.hbs | 13 ++++ .../config/ember-cli-update.json | 18 +++++ .../classic-app-2024-05/config/environment.js | 48 ++++++++++++ .../config/optional-features.json | 6 ++ .../classic-app-2024-05/config/targets.js | 11 +++ .../classic-app-2024-05/ember-cli-build.js | 35 +++++++++ test-apps/classic-app-2024-05/package.json | 78 +++++++++++++++++++ .../classic-app-2024-05/public/robots.txt | 3 + test-apps/classic-app-2024-05/testem.js | 23 ++++++ .../tests/helpers/index.js | 42 ++++++++++ .../classic-app-2024-05/tests/index.html | 35 +++++++++ .../integration/components/at-class-test.gjs | 40 ++++++++++ .../components/dynamic-attribute-test.js | 30 +++++++ .../from-v2-addon-ts/at-class-test.gjs | 41 ++++++++++ .../from-v2-addon-ts/strict-class-test.gjs | 25 ++++++ .../from-v2-addon-ts/strict-test.gjs | 25 ++++++ .../v2-addon-ts-with-a-class-test.js | 26 +++++++ .../from-v2-addon/alert-from-v2-addon-test.js | 24 ++++++ .../from-v2-addon/at-class-test.gjs | 41 ++++++++++ .../integration/components/header-test.js | 21 +++++ .../components/in-app/at-class-test.gts | 19 +++++ .../integration/components/scoped-test.js | 18 +++++ .../integration/components/show-time-test.js | 16 ++++ .../components/subexpression-test.gjs | 34 ++++++++ .../components/template-only-test.js | 22 ++++++ .../classic-app-2024-05/tests/test-helper.js | 13 ++++ .../classic-app-2024-05/tests/unit/.gitkeep | 0 69 files changed, 1090 insertions(+) create mode 100644 test-apps/classic-app-2024-05/.editorconfig create mode 100644 test-apps/classic-app-2024-05/.ember-cli create mode 100644 test-apps/classic-app-2024-05/.eslintignore create mode 100644 test-apps/classic-app-2024-05/.eslintrc.js create mode 100644 test-apps/classic-app-2024-05/.github/workflows/ci.yml create mode 100644 test-apps/classic-app-2024-05/.gitignore create mode 100644 test-apps/classic-app-2024-05/.prettierignore create mode 100644 test-apps/classic-app-2024-05/.prettierrc.js create mode 100644 test-apps/classic-app-2024-05/.template-lintrc.js create mode 100644 test-apps/classic-app-2024-05/.watchmanconfig create mode 100644 test-apps/classic-app-2024-05/README.md create mode 100644 test-apps/classic-app-2024-05/app/app.js create mode 100644 test-apps/classic-app-2024-05/app/components/.gitkeep create mode 100644 test-apps/classic-app-2024-05/app/components/component-at-class.css create mode 100644 test-apps/classic-app-2024-05/app/components/component-at-class.hbs create mode 100644 test-apps/classic-app-2024-05/app/components/dynamic-attribute.css create mode 100644 test-apps/classic-app-2024-05/app/components/dynamic-attribute.hbs create mode 100644 test-apps/classic-app-2024-05/app/components/face.hbs create mode 100644 test-apps/classic-app-2024-05/app/components/face.module.css create mode 100644 test-apps/classic-app-2024-05/app/components/has-at-class.hbs create mode 100644 test-apps/classic-app-2024-05/app/components/header.css create mode 100644 test-apps/classic-app-2024-05/app/components/header.hbs create mode 100644 test-apps/classic-app-2024-05/app/components/header.js create mode 100644 test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.css create mode 100644 test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.gts create mode 100644 test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/has-at-class.gts create mode 100644 test-apps/classic-app-2024-05/app/components/scoped.css create mode 100644 test-apps/classic-app-2024-05/app/components/scoped.hbs create mode 100644 test-apps/classic-app-2024-05/app/components/show-time.css create mode 100644 test-apps/classic-app-2024-05/app/components/show-time.gjs create mode 100644 test-apps/classic-app-2024-05/app/components/subexpression.css create mode 100644 test-apps/classic-app-2024-05/app/components/subexpression.gjs create mode 100644 test-apps/classic-app-2024-05/app/components/template-only.css create mode 100644 test-apps/classic-app-2024-05/app/components/template-only.hbs create mode 100644 test-apps/classic-app-2024-05/app/controllers/.gitkeep create mode 100644 test-apps/classic-app-2024-05/app/controllers/application.js create mode 100644 test-apps/classic-app-2024-05/app/helpers/.gitkeep create mode 100644 test-apps/classic-app-2024-05/app/index.html create mode 100644 test-apps/classic-app-2024-05/app/models/.gitkeep create mode 100644 test-apps/classic-app-2024-05/app/router.js create mode 100644 test-apps/classic-app-2024-05/app/routes/.gitkeep create mode 100644 test-apps/classic-app-2024-05/app/styles/app.css create mode 100644 test-apps/classic-app-2024-05/app/templates/application.hbs create mode 100644 test-apps/classic-app-2024-05/config/ember-cli-update.json create mode 100644 test-apps/classic-app-2024-05/config/environment.js create mode 100644 test-apps/classic-app-2024-05/config/optional-features.json create mode 100644 test-apps/classic-app-2024-05/config/targets.js create mode 100644 test-apps/classic-app-2024-05/ember-cli-build.js create mode 100644 test-apps/classic-app-2024-05/package.json create mode 100644 test-apps/classic-app-2024-05/public/robots.txt create mode 100644 test-apps/classic-app-2024-05/testem.js create mode 100644 test-apps/classic-app-2024-05/tests/helpers/index.js create mode 100644 test-apps/classic-app-2024-05/tests/index.html create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/header-test.js create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs create mode 100644 test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js create mode 100644 test-apps/classic-app-2024-05/tests/test-helper.js create mode 100644 test-apps/classic-app-2024-05/tests/unit/.gitkeep diff --git a/test-apps/classic-app-2024-05/.editorconfig b/test-apps/classic-app-2024-05/.editorconfig new file mode 100644 index 00000000..c35a0024 --- /dev/null +++ b/test-apps/classic-app-2024-05/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.hbs] +insert_final_newline = false + +[*.{diff,md}] +trim_trailing_whitespace = false diff --git a/test-apps/classic-app-2024-05/.ember-cli b/test-apps/classic-app-2024-05/.ember-cli new file mode 100644 index 00000000..8c1812cf --- /dev/null +++ b/test-apps/classic-app-2024-05/.ember-cli @@ -0,0 +1,15 @@ +{ + /** + Ember CLI sends analytics information by default. The data is completely + anonymous, but there are times when you might want to disable this behavior. + + Setting `disableAnalytics` to true will prevent any data from being sent. + */ + "disableAnalytics": false, + + /** + Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript + rather than JavaScript by default, when a TypeScript version of a given blueprint is available. + */ + "isTypeScriptProject": false +} diff --git a/test-apps/classic-app-2024-05/.eslintignore b/test-apps/classic-app-2024-05/.eslintignore new file mode 100644 index 00000000..d474a40b --- /dev/null +++ b/test-apps/classic-app-2024-05/.eslintignore @@ -0,0 +1,25 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.*/ +.eslintcache + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try diff --git a/test-apps/classic-app-2024-05/.eslintrc.js b/test-apps/classic-app-2024-05/.eslintrc.js new file mode 100644 index 00000000..35b0e21d --- /dev/null +++ b/test-apps/classic-app-2024-05/.eslintrc.js @@ -0,0 +1,10 @@ +'use strict'; + +const { configs } = require('@nullvoxpopuli/eslint-configs'); + +const ember = configs.ember(); + +// accommodates: JS, TS, App, Addon, and V2 Addon +module.exports = { + overrides: [...ember.overrides], +}; diff --git a/test-apps/classic-app-2024-05/.github/workflows/ci.yml b/test-apps/classic-app-2024-05/.github/workflows/ci.yml new file mode 100644 index 00000000..e7266de6 --- /dev/null +++ b/test-apps/classic-app-2024-05/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + branches: + - main + - master + pull_request: {} + +concurrency: + group: ci-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: "Lint" + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: 14.x + cache: npm + - name: Install Dependencies + run: npm ci + - name: Lint + run: npm run lint + + test: + name: "Test" + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: 14.x + cache: npm + - name: Install Dependencies + run: npm ci + - name: Run Tests + run: npm test diff --git a/test-apps/classic-app-2024-05/.gitignore b/test-apps/classic-app-2024-05/.gitignore new file mode 100644 index 00000000..f1e859b2 --- /dev/null +++ b/test-apps/classic-app-2024-05/.gitignore @@ -0,0 +1,32 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/.env* +/.pnp* +/.sass-cache +/.eslintcache +/connect.lock +/coverage/ +/libpeerconnection.log +/npm-debug.log* +/testem.log +/yarn-error.log + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try + +# broccoli-debug +/DEBUG/ diff --git a/test-apps/classic-app-2024-05/.prettierignore b/test-apps/classic-app-2024-05/.prettierignore new file mode 100644 index 00000000..4178fd57 --- /dev/null +++ b/test-apps/classic-app-2024-05/.prettierignore @@ -0,0 +1,25 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.eslintcache +.lint-todo/ + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try diff --git a/test-apps/classic-app-2024-05/.prettierrc.js b/test-apps/classic-app-2024-05/.prettierrc.js new file mode 100644 index 00000000..324b444b --- /dev/null +++ b/test-apps/classic-app-2024-05/.prettierrc.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = { + overrides: [ + { + files: '*.{js,ts,cjs,mjs,mts,cts,gts.gjs}', + options: { + singleQuote: true, + }, + }, + ], +}; diff --git a/test-apps/classic-app-2024-05/.template-lintrc.js b/test-apps/classic-app-2024-05/.template-lintrc.js new file mode 100644 index 00000000..f35f61c7 --- /dev/null +++ b/test-apps/classic-app-2024-05/.template-lintrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + extends: 'recommended', +}; diff --git a/test-apps/classic-app-2024-05/.watchmanconfig b/test-apps/classic-app-2024-05/.watchmanconfig new file mode 100644 index 00000000..e7834e3e --- /dev/null +++ b/test-apps/classic-app-2024-05/.watchmanconfig @@ -0,0 +1,3 @@ +{ + "ignore_dirs": ["tmp", "dist"] +} diff --git a/test-apps/classic-app-2024-05/README.md b/test-apps/classic-app-2024-05/README.md new file mode 100644 index 00000000..3d92d98f --- /dev/null +++ b/test-apps/classic-app-2024-05/README.md @@ -0,0 +1,56 @@ +# classic-app + +This README outlines the details of collaborating on this Ember application. +A short introduction of this app could easily go here. + +## Prerequisites + +You will need the following things properly installed on your computer. + +- [Git](https://git-scm.com/) +- [Node.js](https://nodejs.org/) (with npm) +- [Ember CLI](https://cli.emberjs.com/release/) +- [Google Chrome](https://google.com/chrome/) + +## Installation + +- `git clone ` this repository +- `cd classic-app` +- `npm install` + +## Running / Development + +- `ember serve` +- Visit your app at [http://localhost:4200](http://localhost:4200). +- Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests). + +### Code Generators + +Make use of the many generators for code, try `ember help generate` for more details + +### Running Tests + +- `ember test` +- `ember test --server` + +### Linting + +- `npm run lint` +- `npm run lint:fix` + +### Building + +- `ember build` (development) +- `ember build --environment production` (production) + +### Deploying + +Specify what it takes to deploy your app. + +## Further Reading / Useful Links + +- [ember.js](https://emberjs.com/) +- [ember-cli](https://cli.emberjs.com/release/) +- Development Browser Extensions + - [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) + - [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) diff --git a/test-apps/classic-app-2024-05/app/app.js b/test-apps/classic-app-2024-05/app/app.js new file mode 100644 index 00000000..a4857677 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/app.js @@ -0,0 +1,13 @@ +import Application from '@ember/application'; + +import config from 'classic-app/config/environment'; +import loadInitializers from 'ember-load-initializers'; +import Resolver from 'ember-resolver'; + +export default class App extends Application { + modulePrefix = config.modulePrefix; + podModulePrefix = config.podModulePrefix; + Resolver = Resolver; +} + +loadInitializers(App, config.modulePrefix); diff --git a/test-apps/classic-app-2024-05/app/components/.gitkeep b/test-apps/classic-app-2024-05/app/components/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/test-apps/classic-app-2024-05/app/components/component-at-class.css b/test-apps/classic-app-2024-05/app/components/component-at-class.css new file mode 100644 index 00000000..989f5201 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/component-at-class.css @@ -0,0 +1,3 @@ +.text-color { + color: #0000ff !important; +} diff --git a/test-apps/classic-app-2024-05/app/components/component-at-class.hbs b/test-apps/classic-app-2024-05/app/components/component-at-class.hbs new file mode 100644 index 00000000..ab7bcd22 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/component-at-class.hbs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/dynamic-attribute.css b/test-apps/classic-app-2024-05/app/components/dynamic-attribute.css new file mode 100644 index 00000000..38274625 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/dynamic-attribute.css @@ -0,0 +1,7 @@ +.is-foo { + color: blue; +} + +.is-not-foo { + color: red; +} diff --git a/test-apps/classic-app-2024-05/app/components/dynamic-attribute.hbs b/test-apps/classic-app-2024-05/app/components/dynamic-attribute.hbs new file mode 100644 index 00000000..1ad6416d --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/dynamic-attribute.hbs @@ -0,0 +1,3 @@ +
+ dynamic attribute +
\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/face.hbs b/test-apps/classic-app-2024-05/app/components/face.hbs new file mode 100644 index 00000000..c9521fe0 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/face.hbs @@ -0,0 +1,3 @@ +

+ ember-css-modules +

\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/face.module.css b/test-apps/classic-app-2024-05/app/components/face.module.css new file mode 100644 index 00000000..b58cc07a --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/face.module.css @@ -0,0 +1,3 @@ +.some-class { + color: red; +} diff --git a/test-apps/classic-app-2024-05/app/components/has-at-class.hbs b/test-apps/classic-app-2024-05/app/components/has-at-class.hbs new file mode 100644 index 00000000..15c58269 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/has-at-class.hbs @@ -0,0 +1 @@ +

some text

\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/header.css b/test-apps/classic-app-2024-05/app/components/header.css new file mode 100644 index 00000000..aa8e210f --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/header.css @@ -0,0 +1,3 @@ +.test-header { + color: rgb(255, 0, 0); +} diff --git a/test-apps/classic-app-2024-05/app/components/header.hbs b/test-apps/classic-app-2024-05/app/components/header.hbs new file mode 100644 index 00000000..f23e7cbd --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/header.hbs @@ -0,0 +1,4 @@ +

+ ember-scoped-css + {{this.label}}.hbs +

\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/header.js b/test-apps/classic-app-2024-05/app/components/header.js new file mode 100644 index 00000000..2aa4d21f --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/header.js @@ -0,0 +1,6 @@ +import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; + +export default class Header extends Component { + @tracked label = 'header'; +} diff --git a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.css b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.css new file mode 100644 index 00000000..27feb503 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.css @@ -0,0 +1,3 @@ +.text-color { + color: #337 !important; +} diff --git a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.gts b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.gts new file mode 100644 index 00000000..83baad01 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.gts @@ -0,0 +1,7 @@ +import { scopedClass } from 'ember-scoped-css'; + +import HasAtClass from './has-at-class'; + + diff --git a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/has-at-class.gts b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/has-at-class.gts new file mode 100644 index 00000000..2dbf77bd --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/has-at-class.gts @@ -0,0 +1,3 @@ + diff --git a/test-apps/classic-app-2024-05/app/components/scoped.css b/test-apps/classic-app-2024-05/app/components/scoped.css new file mode 100644 index 00000000..e69de29b diff --git a/test-apps/classic-app-2024-05/app/components/scoped.hbs b/test-apps/classic-app-2024-05/app/components/scoped.hbs new file mode 100644 index 00000000..29db9216 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/scoped.hbs @@ -0,0 +1,6 @@ +
+ Component with scoped class helper +
\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/show-time.css b/test-apps/classic-app-2024-05/app/components/show-time.css new file mode 100644 index 00000000..2b4bb367 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/show-time.css @@ -0,0 +1,3 @@ +h2 { + color: blue; +} diff --git a/test-apps/classic-app-2024-05/app/components/show-time.gjs b/test-apps/classic-app-2024-05/app/components/show-time.gjs new file mode 100644 index 00000000..4161a60d --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/show-time.gjs @@ -0,0 +1,3 @@ + diff --git a/test-apps/classic-app-2024-05/app/components/subexpression.css b/test-apps/classic-app-2024-05/app/components/subexpression.css new file mode 100644 index 00000000..5a0ed9e8 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/subexpression.css @@ -0,0 +1,3 @@ +.a-local-class { + color: blue; +} diff --git a/test-apps/classic-app-2024-05/app/components/subexpression.gjs b/test-apps/classic-app-2024-05/app/components/subexpression.gjs new file mode 100644 index 00000000..6c01fa6a --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/subexpression.gjs @@ -0,0 +1,5 @@ + diff --git a/test-apps/classic-app-2024-05/app/components/template-only.css b/test-apps/classic-app-2024-05/app/components/template-only.css new file mode 100644 index 00000000..7a2b9b30 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/template-only.css @@ -0,0 +1,3 @@ +.some-class { + color: blue; +} diff --git a/test-apps/classic-app-2024-05/app/components/template-only.hbs b/test-apps/classic-app-2024-05/app/components/template-only.hbs new file mode 100644 index 00000000..cb25b72e --- /dev/null +++ b/test-apps/classic-app-2024-05/app/components/template-only.hbs @@ -0,0 +1 @@ +
hi there
\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/controllers/.gitkeep b/test-apps/classic-app-2024-05/app/controllers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/test-apps/classic-app-2024-05/app/controllers/application.js b/test-apps/classic-app-2024-05/app/controllers/application.js new file mode 100644 index 00000000..f036da2b --- /dev/null +++ b/test-apps/classic-app-2024-05/app/controllers/application.js @@ -0,0 +1,5 @@ +import Controller from '@ember/controller'; + +export default class ApplicationController extends Controller { + time = new Date(); +} diff --git a/test-apps/classic-app-2024-05/app/helpers/.gitkeep b/test-apps/classic-app-2024-05/app/helpers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/test-apps/classic-app-2024-05/app/index.html b/test-apps/classic-app-2024-05/app/index.html new file mode 100644 index 00000000..7aca2277 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/index.html @@ -0,0 +1,28 @@ + + + + + ClassicApp + + + + {{content-for "head"}} + + + + + {{content-for "head-footer"}} + + + {{content-for "body"}} + + + + + {{content-for "body-footer"}} + + diff --git a/test-apps/classic-app-2024-05/app/models/.gitkeep b/test-apps/classic-app-2024-05/app/models/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/test-apps/classic-app-2024-05/app/router.js b/test-apps/classic-app-2024-05/app/router.js new file mode 100644 index 00000000..da0fabd2 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/router.js @@ -0,0 +1,10 @@ +import EmberRouter from '@ember/routing/router'; + +import config from 'classic-app/config/environment'; + +export default class Router extends EmberRouter { + location = config.locationType; + rootURL = config.rootURL; +} + +Router.map(function () {}); diff --git a/test-apps/classic-app-2024-05/app/routes/.gitkeep b/test-apps/classic-app-2024-05/app/routes/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/test-apps/classic-app-2024-05/app/styles/app.css b/test-apps/classic-app-2024-05/app/styles/app.css new file mode 100644 index 00000000..ce778bb1 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/styles/app.css @@ -0,0 +1,7 @@ +p { + color: green; +} + +.test-class-app { + color: blue; +} diff --git a/test-apps/classic-app-2024-05/app/templates/application.hbs b/test-apps/classic-app-2024-05/app/templates/application.hbs new file mode 100644 index 00000000..ddd5dae8 --- /dev/null +++ b/test-apps/classic-app-2024-05/app/templates/application.hbs @@ -0,0 +1,13 @@ +{{page-title "ClassicApp"}} + +

+ {{this.time}} +

+ + +
+ + + + +{{outlet}} \ No newline at end of file diff --git a/test-apps/classic-app-2024-05/config/ember-cli-update.json b/test-apps/classic-app-2024-05/config/ember-cli-update.json new file mode 100644 index 00000000..18c4b7b9 --- /dev/null +++ b/test-apps/classic-app-2024-05/config/ember-cli-update.json @@ -0,0 +1,18 @@ +{ + "schemaVersion": "1.0.0", + "packages": [ + { + "name": "ember-cli", + "version": "4.10.0", + "blueprints": [ + { + "name": "app", + "outputRepo": "https://github.com/ember-cli/ember-new-output", + "codemodsSource": "ember-app-codemods-manifest@1", + "isBaseBlueprint": true, + "options": ["--ci-provider=github"] + } + ] + } + ] +} diff --git a/test-apps/classic-app-2024-05/config/environment.js b/test-apps/classic-app-2024-05/config/environment.js new file mode 100644 index 00000000..bc70bf05 --- /dev/null +++ b/test-apps/classic-app-2024-05/config/environment.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = function (environment) { + const ENV = { + modulePrefix: 'classic-app', + environment, + rootURL: '/', + locationType: 'history', + EmberENV: { + EXTEND_PROTOTYPES: false, + FEATURES: { + // Here you can enable experimental features on an ember canary build + // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true + }, + }, + + APP: { + // Here you can pass flags/options to your application instance + // when it is created + }, + }; + + if (environment === 'development') { + // ENV.APP.LOG_RESOLVER = true; + // ENV.APP.LOG_ACTIVE_GENERATION = true; + // ENV.APP.LOG_TRANSITIONS = true; + // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; + // ENV.APP.LOG_VIEW_LOOKUPS = true; + } + + if (environment === 'test') { + // Testem prefers this... + ENV.locationType = 'none'; + + // keep test console output quieter + ENV.APP.LOG_ACTIVE_GENERATION = false; + ENV.APP.LOG_VIEW_LOOKUPS = false; + + ENV.APP.rootElement = '#ember-testing'; + ENV.APP.autoboot = false; + } + + if (environment === 'production') { + // here you can enable a production-specific feature + } + + return ENV; +}; diff --git a/test-apps/classic-app-2024-05/config/optional-features.json b/test-apps/classic-app-2024-05/config/optional-features.json new file mode 100644 index 00000000..b26286e2 --- /dev/null +++ b/test-apps/classic-app-2024-05/config/optional-features.json @@ -0,0 +1,6 @@ +{ + "application-template-wrapper": false, + "default-async-observers": true, + "jquery-integration": false, + "template-only-glimmer-components": true +} diff --git a/test-apps/classic-app-2024-05/config/targets.js b/test-apps/classic-app-2024-05/config/targets.js new file mode 100644 index 00000000..1e48e059 --- /dev/null +++ b/test-apps/classic-app-2024-05/config/targets.js @@ -0,0 +1,11 @@ +'use strict'; + +const browsers = [ + 'last 1 Chrome versions', + 'last 1 Firefox versions', + 'last 1 Safari versions', +]; + +module.exports = { + browsers, +}; diff --git a/test-apps/classic-app-2024-05/ember-cli-build.js b/test-apps/classic-app-2024-05/ember-cli-build.js new file mode 100644 index 00000000..4d61b012 --- /dev/null +++ b/test-apps/classic-app-2024-05/ember-cli-build.js @@ -0,0 +1,35 @@ +'use strict'; + +const EmberApp = require('ember-cli/lib/broccoli/ember-app'); + +module.exports = function (defaults) { + const app = new EmberApp(defaults, { + name: 'classic-app', + cssModules: { + extension: 'module.css', + }, + 'ember-cli-babel': { + enableTypeScriptTransform: true, + }, + 'ember-scoped-css': { + layerName: 'classic-app-layer', + }, + }); + + // Use `app.import` to add additional libraries to the generated + // output files. + // + // If you need to use different assets in different + // environments, specify an object as the first parameter. That + // object's keys should be the environment name and the values + // should be the asset to use in that environment. + // + // If the library that you are including contains AMD or ES6 + // modules that you would like to import into your application + // please specify an object with the list of modules as keys + // along with the exports of each module as its value. + + app.import('node_modules/v2-addon/dist/scoped.css'); + + return app.toTree(); +}; diff --git a/test-apps/classic-app-2024-05/package.json b/test-apps/classic-app-2024-05/package.json new file mode 100644 index 00000000..8b6aae31 --- /dev/null +++ b/test-apps/classic-app-2024-05/package.json @@ -0,0 +1,78 @@ +{ + "name": "classic-app-2024-05", + "version": "0.0.0", + "private": true, + "description": "Small description for classic-app goes here", + "repository": "", + "license": "MIT", + "author": "", + "directories": { + "doc": "doc", + "test": "tests" + }, + "scripts": { + "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", + "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"", + "lint:hbs": "ember-template-lint .", + "lint:hbs:fix": "ember-template-lint . --fix", + "lint:js": "eslint . --cache --ignore-pattern \"**/*.gjs\"", + "lint:js:fix": "eslint . --fix", + "lint:prettier:fix": "prettier . -w", + "lint:prettier": "prettier . -c", + "start": "ember serve", + "test": "pnpm test:ember --test-port 0", + "test:ember": "ember test" + }, + "devDependencies": { + "@ember/optional-features": "^2.0.0", + "@ember/string": "^3.0.1", + "@ember/test-helpers": "^3.2.0", + "@glimmer/component": "^1.1.2", + "@glimmer/tracking": "^1.1.2", + "@nullvoxpopuli/eslint-configs": "^3.2.2", + "broccoli-asset-rev": "^3.0.0", + "concurrently": "^8.2.1", + "ember-auto-import": "2.7.2", + "ember-cli": "~5.8.1", + "ember-cli-app-version": "^6.0.0", + "ember-cli-babel": "^8.2.0", + "ember-cli-dependency-checker": "^3.3.1", + "ember-cli-htmlbars": "^6.3.0", + "ember-cli-inject-live-reload": "^2.1.0", + "ember-cli-sri": "^2.1.1", + "ember-cli-terser": "^4.0.2", + "ember-css-modules": "^2.0.1", + "ember-fetch": "^8.1.2", + "ember-load-initializers": "^2.1.2", + "ember-page-title": "^8.2.3", + "ember-qunit": "^8.0.2", + "ember-resolver": "^11.0.0", + "ember-scoped-css": "workspace:*", + "ember-scoped-css-compat": "workspace:*", + "ember-source": "~5.8.0", + "ember-style-loader": "github:mainmatter/ember-style-loader#main", + "ember-template-imports": "^4.1.0", + "ember-template-lint": "^6.0.0", + "eslint": "^8.50.0", + "eslint-plugin-ember": "^12.0.2", + "eslint-plugin-n": "^17.6.0", + "eslint-plugin-qunit": "^8.1.1", + "loader.js": "^4.7.0", + "prettier": "^3.2.5", + "qunit": "^2.20.1", + "qunit-dom": "^3.1.2", + "tracked-built-ins": "^3.1.0", + "v2-addon": "workspace:*", + "v2-addon-ts": "workspace:*", + "webpack": "^5.91.0" + }, + "engines": { + "node": "14.* || 16.* || >= 18" + }, + "ember": { + "edition": "octane" + }, + "dependencies": { + "ember-resources": "^6.4.0" + } +} diff --git a/test-apps/classic-app-2024-05/public/robots.txt b/test-apps/classic-app-2024-05/public/robots.txt new file mode 100644 index 00000000..f5916452 --- /dev/null +++ b/test-apps/classic-app-2024-05/public/robots.txt @@ -0,0 +1,3 @@ +# http://www.robotstxt.org +User-agent: * +Disallow: diff --git a/test-apps/classic-app-2024-05/testem.js b/test-apps/classic-app-2024-05/testem.js new file mode 100644 index 00000000..ed2f3712 --- /dev/null +++ b/test-apps/classic-app-2024-05/testem.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = { + test_page: 'tests/index.html?hidepassed', + disable_watching: true, + launch_in_ci: ['Chrome'], + launch_in_dev: ['Chrome'], + browser_start_timeout: 120, + browser_args: { + Chrome: { + ci: [ + // --no-sandbox is needed when running Chrome inside a container + process.env.CI ? '--no-sandbox' : null, + '--headless', + '--disable-dev-shm-usage', + '--disable-software-rasterizer', + '--mute-audio', + '--remote-debugging-port=0', + '--window-size=1440,900', + ].filter(Boolean), + }, + }, +}; diff --git a/test-apps/classic-app-2024-05/tests/helpers/index.js b/test-apps/classic-app-2024-05/tests/helpers/index.js new file mode 100644 index 00000000..7f70de80 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/helpers/index.js @@ -0,0 +1,42 @@ +import { + setupApplicationTest as upstreamSetupApplicationTest, + setupRenderingTest as upstreamSetupRenderingTest, + setupTest as upstreamSetupTest, +} from 'ember-qunit'; + +// This file exists to provide wrappers around ember-qunit's / ember-mocha's +// test setup functions. This way, you can easily extend the setup that is +// needed per test type. + +function setupApplicationTest(hooks, options) { + upstreamSetupApplicationTest(hooks, options); + + // Additional setup for application tests can be done here. + // + // For example, if you need an authenticated session for each + // application test, you could do: + // + // hooks.beforeEach(async function () { + // await authenticateSession(); // ember-simple-auth + // }); + // + // This is also a good place to call test setup functions coming + // from other addons: + // + // setupIntl(hooks); // ember-intl + // setupMirage(hooks); // ember-cli-mirage +} + +function setupRenderingTest(hooks, options) { + upstreamSetupRenderingTest(hooks, options); + + // Additional setup for rendering tests can be done here. +} + +function setupTest(hooks, options) { + upstreamSetupTest(hooks, options); + + // Additional setup for unit tests can be done here. +} + +export { setupApplicationTest, setupRenderingTest, setupTest }; diff --git a/test-apps/classic-app-2024-05/tests/index.html b/test-apps/classic-app-2024-05/tests/index.html new file mode 100644 index 00000000..dedfb4dc --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/index.html @@ -0,0 +1,35 @@ + + + + + ClassicApp Tests + + + + {{content-for "head"}} {{content-for "test-head"}} + + + + + + {{content-for "head-footer"}} {{content-for "test-head-footer"}} + + + {{content-for "body"}} {{content-for "test-body"}} + +
+
+
+
+
+
+ + + + + + + + {{content-for "body-footer"}} {{content-for "test-body-footer"}} + + diff --git a/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs new file mode 100644 index 00000000..fa485edf --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs @@ -0,0 +1,40 @@ +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import ComponentAtClass from 'classic-app/components/component-at-class'; +import { setupRenderingTest } from 'classic-app/tests/helpers'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + + +module('Integration | Component | @class', function (hooks) { + setupRenderingTest(hooks); + + test('strict mode', async function (assert) { + await render( + ); + + assert + .dom('p') + .hasClass( + scopedClass('text-color', 'classic-app/components/component-at-class') + ); + assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); + + test('loose mode', async function (assert) { + await render(hbs` + + `); + + assert + .dom('p') + .hasClass( + scopedClass('text-color', 'classic-app/components/component-at-class') + ); + assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js b/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js new file mode 100644 index 00000000..a50123db --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js @@ -0,0 +1,30 @@ +import { tracked } from '@glimmer/tracking'; +import { render, settled } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; + +module('Integration | Component | DynamicAttribute', function (hooks) { + setupRenderingTest(hooks); + + test('it has scoped class', async function (assert) { + class State { + @tracked ya = true; + } + + let state = new State(); + + this.setProperties({ state }); + await render(hbs``); + + assert.dom('div').hasClass('is-foo_e3cf3bd44'); + assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); + + state.ya = false; + await settled(); + + assert.dom('div').hasClass('is-not-foo_e3cf3bd44'); + assert.dom('div').hasStyle({ color: 'rgb(255, 0, 0)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs new file mode 100644 index 00000000..a1441148 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs @@ -0,0 +1,41 @@ + +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; +import ComponentAtClass from 'v2-addon-ts/components/at-class-ts/component-at-class'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + + +module('[v2 Addon TS] Integration | Component | @class', function (hooks) { + setupRenderingTest(hooks); + + test('strict mode', async function (assert) { + await render( + ); + + assert + .dom('p') + .hasClass( + scopedClass('text-color', 'v2-addon-ts/components/at-class-ts/component-at-class') + ); + assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); + + test('loose mode', async function (assert) { + await render(hbs` + + `); + + assert + .dom('p') + .hasClass( + scopedClass('text-color', 'v2-addon-ts/components/at-class-ts/component-at-class') + ); + assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs new file mode 100644 index 00000000..53de11de --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs @@ -0,0 +1,25 @@ +import { render } from '@ember/test-helpers'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { StrictClass } from 'v2-addon-ts/components/strict-class'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + +module('[v2 Addon TS] Integration | Component | Strict class import', function (hooks) { + setupRenderingTest(hooks); + + test('strict mode', async function (assert) { + await render( + ); + + assert + .dom('div') + .hasClass( + scopedClass('hello-there', 'v2-addon-ts/components/strict-class') + ); + assert.dom('div').hasStyle({ color: 'rgb(1, 2, 3)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs new file mode 100644 index 00000000..935abede --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs @@ -0,0 +1,25 @@ +import { render } from '@ember/test-helpers'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { Strict } from 'v2-addon-ts/components/strict'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + +module('[v2 Addon TS] Integration | Component | Strict import', function (hooks) { + setupRenderingTest(hooks); + + test('strict mode', async function (assert) { + await render( + ); + + assert + .dom('p') + .hasClass( + scopedClass('hi', 'v2-addon-ts/components/strict') + ); + assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js new file mode 100644 index 00000000..306832aa --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js @@ -0,0 +1,26 @@ +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + +module( + '[v2 Addon TS] Integration | Component | WithAClass from v2-addon-ts', + function (hooks) { + setupRenderingTest(hooks); + + test('it has scoped class', async function (assert) { + await render(hbs``); + + assert.dom('div').hasClass('greeting_efc49be66'); + assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); + assert + .dom('div') + .hasClass( + scopedClass('greeting', 'v2-addon-ts/components/with-a-class'), + ); + }); + }, +); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js new file mode 100644 index 00000000..b54889f4 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js @@ -0,0 +1,24 @@ +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + +module( + '[v2 Addon JS] Integration | Component | Alert from v2-addon', + function (hooks) { + setupRenderingTest(hooks); + + test('it has scoped class', async function (assert) { + await render(hbs``); + + assert.dom('p').hasClass('message_e4b9579df'); + assert.dom('p').hasStyle({ fontStyle: 'italic' }); + assert + .dom('p') + .hasClass(scopedClass('message', 'v2-addon/components/alert')); + }); + }, +); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs new file mode 100644 index 00000000..cdf19d64 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs @@ -0,0 +1,41 @@ + +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; +import ComponentAtClass from 'v2-addon/components/at-class/component-at-class'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + + +module('[v2 Addon JS] Integration | Component | @class', function (hooks) { + setupRenderingTest(hooks); + + test('strict mode', async function (assert) { + await render( + ); + + assert + .dom('p') + .hasClass( + scopedClass('text-color', 'v2-addon/components/at-class/component-at-class') + ); + assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); + + test('loose mode', async function (assert) { + await render(hbs` + + `); + + assert + .dom('p') + .hasClass( + scopedClass('text-color', 'v2-addon/components/at-class/component-at-class') + ); + assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/header-test.js b/test-apps/classic-app-2024-05/tests/integration/components/header-test.js new file mode 100644 index 00000000..326f0e61 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/header-test.js @@ -0,0 +1,21 @@ +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + +module('Integration | Component | header', function (hooks) { + setupRenderingTest(hooks); + + test('it has scoped class', async function (assert) { + await render(hbs`
`); + + assert.dom('h1').hasClass('test-header_e64a12152'); + assert.dom('h1').hasStyle({ color: 'rgb(255, 0, 0)' }); + assert + .dom('h1') + .hasClass(scopedClass('test-header', 'classic-app/components/header')); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts b/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts new file mode 100644 index 00000000..87fb2214 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts @@ -0,0 +1,19 @@ +import { render } from '@ember/test-helpers'; +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; + +import CallsAtHasClass from 'classic-app/components/in-app/at-class-ts/calls-has-at-class'; + +module('[In App] at-class-ts', function(hooks) { + setupRenderingTest(hooks); + + test('calls component with @class', async function(assert) { + await render( + + ); + + assert.dom('p').hasStyle({ color: 'rgb(51, 51, 119)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js b/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js new file mode 100644 index 00000000..49fd10b5 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js @@ -0,0 +1,18 @@ +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; + +module('Integration | Component | scoped', function (hooks) { + setupRenderingTest(hooks); + + test('it replaces the scoped-class helper', async function (assert) { + await render(hbs``); + + assert.dom('div').hasAttribute('data-scoped-class', 'some-class_e4aeedfc0'); + assert + .dom('div') + .hasAttribute('data-scoped-class-2', 'some-class-2_e4aeedfc0'); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js b/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js new file mode 100644 index 00000000..0f96e84a --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js @@ -0,0 +1,16 @@ +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; + +module('Integration | Component | show-time', function (hooks) { + setupRenderingTest(hooks); + + test('it has scoped class', async function (assert) { + await render(hbs``); + + assert.dom('h2').hasClass('e6e05c2f6'); + assert.dom('h2').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs new file mode 100644 index 00000000..54520a7a --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs @@ -0,0 +1,34 @@ +import { render, settled } from '@ember/test-helpers'; +import { module, test } from 'qunit'; + +import SubExpression from 'classic-app/components/subexpression'; +import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { cell } from 'ember-resources'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + +module('Integration | Component | subexpression', function (hooks) { + setupRenderingTest(hooks); + + test('it has scoped class', async function (assert) { + let cond = cell(false); + + await render( + ); + + assert.dom('div').hasClass('global-probably'); + + cond.current = true; + await settled(); + + + assert + .dom('div') + .hasClass( + scopedClass('a-local-class', 'classic-app/components/subexpression') + ); + assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js b/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js new file mode 100644 index 00000000..7032d566 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js @@ -0,0 +1,22 @@ +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { module, test } from 'qunit'; + +import { setupRenderingTest } from 'classic-app/tests/helpers'; + +import { scopedClass } from 'ember-scoped-css/test-support'; + +module('Integration | Component | template-only', function (hooks) { + setupRenderingTest(hooks); + + test('it has scoped class', async function (assert) { + await render(hbs``); + + assert + .dom('div') + .hasClass( + scopedClass('some-class', 'classic-app/components/template-only'), + ); + assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); + }); +}); diff --git a/test-apps/classic-app-2024-05/tests/test-helper.js b/test-apps/classic-app-2024-05/tests/test-helper.js new file mode 100644 index 00000000..3e92a514 --- /dev/null +++ b/test-apps/classic-app-2024-05/tests/test-helper.js @@ -0,0 +1,13 @@ +import { setApplication } from '@ember/test-helpers'; +import * as QUnit from 'qunit'; +import { setup } from 'qunit-dom'; +import { start } from 'ember-qunit'; + +import Application from 'classic-app/app'; +import config from 'classic-app/config/environment'; + +setApplication(Application.create(config.APP)); + +setup(QUnit.assert); + +start(); diff --git a/test-apps/classic-app-2024-05/tests/unit/.gitkeep b/test-apps/classic-app-2024-05/tests/unit/.gitkeep new file mode 100644 index 00000000..e69de29b From 0c5595aa76ca39632aefd7156c22bce710add4ab Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 10 May 2024 15:55:32 -0400 Subject: [PATCH 2/4] Fix --- ember-scoped-css-compat/index.js | 56 ++- ember-scoped-css-compat/package.json | 3 +- ember-scoped-css/build.mjs | 1 + ember-scoped-css/package.json | 5 + .../src/build/ember-classic-support.js | 2 + ember-scoped-css/src/build/template-plugin.js | 153 ++++++++ ember-scoped-css/src/lib/css/utils.js | 17 + ember-scoped-css/src/lib/path-utils.js | 87 ++++ pnpm-lock.yaml | 370 ++++++++---------- test-apps/classic-app-2024-05/.eslintrc.js | 21 +- test-apps/classic-app-2024-05/README.md | 4 +- test-apps/classic-app-2024-05/app/app.js | 2 +- .../app/components/scoped.hbs | 2 +- test-apps/classic-app-2024-05/app/index.html | 4 +- test-apps/classic-app-2024-05/app/router.js | 2 +- .../classic-app-2024-05/config/environment.js | 2 +- .../classic-app-2024-05/ember-cli-build.js | 4 +- test-apps/classic-app-2024-05/package.json | 6 +- .../classic-app-2024-05/tests/index.html | 4 +- .../integration/components/at-class-test.gjs | 8 +- .../components/dynamic-attribute-test.js | 6 +- .../from-v2-addon-ts/at-class-test.gjs | 2 +- .../from-v2-addon-ts/strict-class-test.gjs | 2 +- .../from-v2-addon-ts/strict-test.gjs | 2 +- .../v2-addon-ts-with-a-class-test.js | 2 +- .../from-v2-addon/alert-from-v2-addon-test.js | 2 +- .../from-v2-addon/at-class-test.gjs | 2 +- .../integration/components/header-test.js | 8 +- .../components/in-app/at-class-test.gts | 6 +- .../integration/components/scoped-test.js | 6 +- .../integration/components/show-time-test.js | 4 +- .../components/subexpression-test.gjs | 6 +- .../components/template-only-test.js | 7 +- .../classic-app-2024-05/tests/test-helper.js | 4 +- 34 files changed, 561 insertions(+), 251 deletions(-) create mode 100644 ember-scoped-css/src/build/template-plugin.js create mode 100644 ember-scoped-css/src/lib/path-utils.js diff --git a/ember-scoped-css-compat/index.js b/ember-scoped-css-compat/index.js index d9d6df70..903dd6af 100644 --- a/ember-scoped-css-compat/index.js +++ b/ember-scoped-css-compat/index.js @@ -1,5 +1,7 @@ 'use strict'; +const hashObj = require('hash-obj'); + const { default: ScopedCssPreprocessor, } = require('ember-scoped-css/build/ember-classic-support'); @@ -40,23 +42,73 @@ module.exports = { } }, + /** + * setupPreprocessorRegistry is called before included + * see https://github.com/ember-cli/ember-cli/issues/3701 + * as a workaround we ignore that hook and call this method from included + */ setupPreprocessorRegistry(type, registry) { // Skip if we're setting up this addon's own registry if (type !== 'parent') { return; } - let scopedCssOptions = this.app.options['ember-scoped-css'] || {}; + let options = this.app.options['ember-scoped-css'] || {}; + + this._setupCSSPlugins(registry, options); + this._setupHBSPlugins(registry, options); + }, + _setupCSSPlugins(registry, options) { // we need to run our css preprocessor first, so we removed all other from the registry and run them as part of our preprocessor // we did not find other way how to do it more elegantly let preprocessors = registry.load('css'); preprocessors.forEach((p) => registry.remove('css', p)); - this.outputStylePreprocessor.configureOptions(scopedCssOptions); + this.outputStylePreprocessor.configureOptions(options); this.outputStylePreprocessor.preprocessors = preprocessors; registry.add('css', this.outputStylePreprocessor); }, + + _setupHBSPlugins(registry, options) { + let plugin = this._buildHBSPlugin(options); + + plugin.parallelBabel = { + requireFile: __filename, + buildUsing: '_buildHBSPlugin', + params: options, + }; + + registry.add('htmlbars-ast-plugin', plugin); + }, + + _buildHBSPlugin(config = {}) { + let thePlugin = require('ember-scoped-css/template-plugin').createPlugin( + config, + ); + + return { + name: 'ember-scoped-css::template-plugin', + plugin: thePlugin, + baseDir() { + return __dirname; + }, + cacheKey() { + return cacheKeyForConfig(config); + }, + }; + }, }; + +function cacheKeyForConfig(config) { + let configHash = hashObj(config, { + encoding: 'base64', + algorithm: 'md5', + }); + + // TODO: we need the random because we expect hbs and js files to change when css changes. + // and those css files are not imported into js... so... no cache for us + return `ember-scoped-css-${configHash}-${Math.random()}`; +} diff --git a/ember-scoped-css-compat/package.json b/ember-scoped-css-compat/package.json index 0eb08472..7c3c0012 100644 --- a/ember-scoped-css-compat/package.json +++ b/ember-scoped-css-compat/package.json @@ -25,7 +25,8 @@ }, "dependencies": { "ember-cli-babel": "^8.2.0", - "ember-cli-htmlbars": "^6.3.0" + "ember-cli-htmlbars": "^6.3.0", + "hash-obj": "^3.0.0" }, "devDependencies": { "@babel/eslint-parser": "^7.24.5", diff --git a/ember-scoped-css/build.mjs b/ember-scoped-css/build.mjs index e9ab3972..c363be87 100644 --- a/ember-scoped-css/build.mjs +++ b/ember-scoped-css/build.mjs @@ -10,6 +10,7 @@ const buildFiles = [ 'src/build/app-dependency-loader.js', 'src/build/ember-classic-support.js', 'src/build/babel-plugin.js', + 'src/build/template-plugin.js', ]; const external = [...Object.keys(require('./package.json').dependencies)]; diff --git a/ember-scoped-css/package.json b/ember-scoped-css/package.json index 49d27df0..27746c17 100644 --- a/ember-scoped-css/package.json +++ b/ember-scoped-css/package.json @@ -47,6 +47,10 @@ "./babel-plugin": { "import": "./src/build/babel-plugin.js", "require": "./dist/cjs/babel-plugin.cjs" + }, + "./template-plugin": { + "import": "./src/build/template-plugin.js", + "require": "./dist/cjs/template-plugin.cjs" } }, "scripts": { @@ -63,6 +67,7 @@ "dependencies": { "@babel/parser": "^7.24.5", "@embroider/addon-shim": "^1.8.6", + "@glimmer/syntax": "^0.92.0", "acorn": "^8.11.2", "blueimp-md5": "^2.19.0", "broccoli-concat": "^4.2.5", diff --git a/ember-scoped-css/src/build/ember-classic-support.js b/ember-scoped-css/src/build/ember-classic-support.js index ac65519e..a41cd940 100644 --- a/ember-scoped-css/src/build/ember-classic-support.js +++ b/ember-scoped-css/src/build/ember-classic-support.js @@ -235,6 +235,8 @@ export default class ScopedCssPreprocessor { ...(this.userOptions.additionalRoots || []).map( (root) => `${this.appName}/${root}`, ), + 'app/components/', + ...(this.userOptions.additionalRoots || []).map((root) => `app/${root}`), ]; let include = roots .map((root) => { diff --git a/ember-scoped-css/src/build/template-plugin.js b/ember-scoped-css/src/build/template-plugin.js new file mode 100644 index 00000000..57701a5a --- /dev/null +++ b/ember-scoped-css/src/build/template-plugin.js @@ -0,0 +1,153 @@ +/** + * @typedef {import('@glimmer/syntax').ASTPlugin} ASTPlugin + * @typedef {import('@glimmer/syntax').ASTPluginEnvironment} ASTPluginEnvironment + * + */ +import path from 'node:path'; + +import { existsSync } from 'fs'; + +import { getCSSInfo } from '../lib/css/utils.js'; +import { appPath, findWorkspacePath } from '../lib/generateAbsolutePathHash.js'; +import { generateRelativePathHash } from '../lib/generateRelativePathHash.js'; +import { + cssPathFor, + isRelevantFile, + withoutExtension, +} from '../lib/path-utils.js'; +import { templatePlugin } from '../lib/rewriteHbs.js'; + +const noopPlugin = { + name: 'ember-scoped-css:noop', + visitor: {}, +}; + +/** + * @returns {ASTPlugin} + */ +export function createPlugin(config) { + /** + * + * @param {ASTPluginEnvironment} env + */ + return function scopedCss(env) { + let isRelevant = isRelevantFile(env.filename, config.additionalRoots); + + if (!isRelevant) { + return noopPlugin; + } + + let absolutePath = fixFilename(env); + let modulePath = appPath(absolutePath); + + let cssPath = cssPathFor(absolutePath); + let info = getCSSInfo(cssPath); + let postfix = generateRelativePathHash(modulePath); + + if (!info) { + return noopPlugin; + } + + let visitors = templatePlugin({ + classes: info.classes, + tags: info.tags, + postfix, + }); + + return { + name: 'ember-scoped-css:template-plugin', + visitor: { + // Stack Manager + ...visitors, + // Visitors broken out like this so we can conditionally + // debug based on file path. + AttrNode(...args) { + return visitors.AttrNode(...args); + }, + ElementNode(...args) { + return visitors.ElementNode(...args); + }, + MustacheStatement(...args) { + return visitors.MustacheStatement(...args); + }, + SubExpression(...args) { + return visitors.SubExpression(...args); + }, + }, + }; + }; +} + +/** + * template plugins do not hand us the correct file path. + * additionally, we may not be able to rely on this data in the future, + * so this functions acts as a means of normalizing _whatever_ we're given + * in the future. + * + * @param {ASTPluginEnvironment} env + * @returns {string} the absolute path to the file + */ +function fixFilename(env) { + let fileName = env.filename; + let workspace = findWorkspacePath(fileName); + + /** + * ember-source 5.8: + * - the filename looks like an absolute path, but swapped out the 'app' part of the path + * with the module name, so the file paths never exist on disk + */ + if (!fileName.includes('/app/')) { + let maybeModule = fileName.replace(workspace, ''); + let [maybeScope, ...rest] = maybeModule.split('/').filter(Boolean); + let parts = rest; + + if (maybeScope.startsWith('@')) { + let [, ...rester] = rest; + + parts = rester; + } + + let relative = path.join(...parts); + + /** + * We don't actually know if this file is an app. + * it could be an addon (v1 or v2) + * + * So here we log to see if we have unhandled situations. + */ + let candidatePath = path.join(workspace, 'app', relative); + + let resolved = findCandidate(candidatePath); + + if (resolved) { + return resolved; + } + } + + console.debug(`[ScopedCSS]: Failed to handle ${fileName}`); + + // Fallback to what the plugin system gives us. + // This may be wrong, and if wrong, reveals + // unhandled scenarios with the file names in the plugin infra + return fileName; +} + +const COMPILES_TO_JS = ['.hbs', '.gjs', '.gts']; + +function findCandidate(filePath) { + if (existsSync(filePath)) { + return filePath; + } + + let withoutExt = withoutExtension(filePath); + + for (let ext of COMPILES_TO_JS) { + let candidatePath = withoutExt + ext; + + if (existsSync(candidatePath)) { + return candidatePath; + } + } + + return null; +} diff --git a/ember-scoped-css/src/lib/css/utils.js b/ember-scoped-css/src/lib/css/utils.js index e69de29b..4d112062 100644 --- a/ember-scoped-css/src/lib/css/utils.js +++ b/ember-scoped-css/src/lib/css/utils.js @@ -0,0 +1,17 @@ +import { existsSync, readFileSync } from 'fs'; + +import getClassesTagsFromCss from '../getClassesTagsFromCss'; + +/** + * @param {string} cssPath path to a CSS file + */ +export function getCSSInfo(cssPath) { + if (!existsSync(cssPath)) { + return null; + } + + let css = readFileSync(cssPath, 'utf8'); + let result = getClassesTagsFromCss(css); + + return result; +} diff --git a/ember-scoped-css/src/lib/path-utils.js b/ember-scoped-css/src/lib/path-utils.js new file mode 100644 index 00000000..c0129a32 --- /dev/null +++ b/ember-scoped-css/src/lib/path-utils.js @@ -0,0 +1,87 @@ +import path from 'node:path'; + +import { findWorkspacePath } from './generateAbsolutePathHash'; + +/** + * Based on ember's component location conventions, + * this function will provide a path for where we + * expect the CSS to live. + * + * For co-located structure: + * - components/my-component.hbs + * - components/my-component.css + * + * For nested co-located structure + * - components/my-component/foo.hbs + * - components/my-component/foo.css + * + * For Pods routes structure + * - routes/my-route/template.{hbs,js} + * - routes/my-route/styles.css + * + * Deliberately not supported: + * - components w/ pods -- this is deprecated in 5.10 + * + * @param {string} fileName - the hbs, js, gjs, gts or whatever co-located path. + * @returns {string} - expected css path + */ +export function cssPathFor(fileName) { + let withoutExt = withoutExtension(fileName); + let cssPath = withoutExt + '.css'; + + /** + * Routes' Pods support + * + * components + pods will never be supported. + */ + let isPod = + !fileName.includes('/components/') && fileName.endsWith('template.js'); + + if (isPod) { + cssPath = fileName.replace(/template\.js$/, 'styles.css'); + } + + return cssPath; +} + +/** + * + * @param {string} filePath + * @returns the same path, but without the extension + */ +export function withoutExtension(filePath) { + let parsed = path.parse(filePath); + + return path.join(parsed.dir, parsed.name); +} + +const UNSUPPORTED_DIRECTORIES = new Set(['tests']); + +/** + * + * @param {string} fileName + * @param {string[]} [additionalRoots] + * @returns + */ +export function isRelevantFile(fileName, additionalRoots) { + let workspace = findWorkspacePath(fileName); + + let local = fileName.replace(workspace, ''); + let [, ...parts] = local.split('/').filter(Boolean); + + if (UNSUPPORTED_DIRECTORIES.has(parts[0])) { + return false; + } + + /** + * Mostly pods support. + * folks need to opt in to pods (routes), because every pods app can be configured differently + */ + let roots = ['/components/', ...(additionalRoots || [])]; + + if (!roots.some((root) => fileName.includes(root))) { + return; + } + + return true; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b762a74..4a86efd3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,6 +31,9 @@ importers: '@embroider/addon-shim': specifier: ^1.8.6 version: 1.8.8 + '@glimmer/syntax': + specifier: ^0.92.0 + version: 0.92.0 acorn: specifier: ^8.11.2 version: 8.11.3 @@ -127,7 +130,7 @@ importers: version: 5.4.5 vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.12.12)(jsdom@24.0.0)(terser@5.31.0) + version: 1.6.0(@types/node@20.12.12)(jsdom@16.7.0)(terser@5.31.0) webpack: specifier: ^5.91.0 version: 5.91.0(esbuild@0.21.3) @@ -140,6 +143,9 @@ importers: ember-cli-htmlbars: specifier: ^6.3.0 version: 6.3.0 + hash-obj: + specifier: ^3.0.0 + version: 3.0.0 devDependencies: '@babel/eslint-parser': specifier: ^7.24.5 @@ -377,6 +383,136 @@ importers: specifier: ^5.91.0 version: 5.91.0 + test-apps/classic-app-2024-05: + dependencies: + ember-resources: + specifier: ^6.4.0 + version: 6.5.1(@ember/test-waiters@3.1.0)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glimmer/tracking@1.1.2)(@glint/template@1.4.0)(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0)) + devDependencies: + '@ember/optional-features': + specifier: ^2.0.0 + version: 2.1.0 + '@ember/string': + specifier: ^3.0.1 + version: 3.1.1 + '@ember/test-helpers': + specifier: ^3.2.0 + version: 3.3.0(@glint/template@1.4.0)(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0))(webpack@5.91.0) + '@glimmer/component': + specifier: ^1.1.2 + version: 1.1.2(@babel/core@7.24.5) + '@glimmer/tracking': + specifier: ^1.1.2 + version: 1.1.2 + '@nullvoxpopuli/eslint-configs': + specifier: ^4.0.0 + version: 4.0.0(@babel/core@7.24.5)(@babel/eslint-parser@7.24.5(@babel/core@7.24.5)(eslint@8.57.0))(@babel/plugin-proposal-decorators@7.24.1(@babel/core@7.24.5))(@types/eslint@8.56.10)(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint-plugin-ember@12.1.1(@babel/core@7.24.5)(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint-plugin-qunit@8.1.1(eslint@8.57.0))(eslint@8.57.0)(prettier@3.2.5)(typescript@5.4.5) + broccoli-asset-rev: + specifier: ^3.0.0 + version: 3.0.0 + concurrently: + specifier: ^8.2.1 + version: 8.2.2 + ember-auto-import: + specifier: 2.7.2 + version: 2.7.2(@glint/template@1.4.0)(webpack@5.91.0) + ember-cli: + specifier: ~5.8.1 + version: 5.8.1(handlebars@4.7.8)(underscore@1.13.6) + ember-cli-app-version: + specifier: ^6.0.0 + version: 6.0.1(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0)) + ember-cli-babel: + specifier: ^8.2.0 + version: 8.2.0(@babel/core@7.24.5) + ember-cli-dependency-checker: + specifier: ^3.3.1 + version: 3.3.2(ember-cli@5.8.1(handlebars@4.7.8)(underscore@1.13.6)) + ember-cli-htmlbars: + specifier: ^6.3.0 + version: 6.3.0 + ember-cli-inject-live-reload: + specifier: ^2.1.0 + version: 2.1.0 + ember-cli-sri: + specifier: ^2.1.1 + version: 2.1.1 + ember-cli-terser: + specifier: ^4.0.2 + version: 4.0.2 + ember-css-modules: + specifier: ^2.0.1 + version: 2.1.0 + ember-fetch: + specifier: ^8.1.2 + version: 8.1.2(encoding@0.1.13) + ember-load-initializers: + specifier: ^2.1.2 + version: 2.1.2(@babel/core@7.24.5) + ember-page-title: + specifier: ^8.2.3 + version: 8.2.3(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0)) + ember-qunit: + specifier: ^8.0.2 + version: 8.0.2(@ember/test-helpers@3.3.0(@glint/template@1.4.0)(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0))(webpack@5.91.0))(@glint/template@1.4.0)(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0))(qunit@2.20.1) + ember-resolver: + specifier: ^11.0.0 + version: 11.0.1(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0)) + ember-scoped-css: + specifier: workspace:* + version: link:../../ember-scoped-css + ember-scoped-css-compat: + specifier: workspace:* + version: link:../../ember-scoped-css-compat + ember-source: + specifier: ~5.8.0 + version: 5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0) + ember-style-loader: + specifier: github:mainmatter/ember-style-loader#main + version: https://codeload.github.com/mainmatter/ember-style-loader/tar.gz/5d262a1671a9354312a376d70df220289b8b3330 + ember-template-imports: + specifier: ^4.1.1 + version: 4.1.1 + ember-template-lint: + specifier: ^6.0.0 + version: 6.0.0 + eslint: + specifier: ^8.50.0 + version: 8.57.0 + eslint-plugin-ember: + specifier: ^12.0.2 + version: 12.1.1(@babel/core@7.24.5)(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0) + eslint-plugin-n: + specifier: ^17.6.0 + version: 17.7.0(eslint@8.57.0) + eslint-plugin-qunit: + specifier: ^8.1.1 + version: 8.1.1(eslint@8.57.0) + loader.js: + specifier: ^4.7.0 + version: 4.7.0 + prettier: + specifier: ^3.2.5 + version: 3.2.5 + qunit: + specifier: ^2.20.1 + version: 2.20.1 + qunit-dom: + specifier: ^3.1.2 + version: 3.1.2 + tracked-built-ins: + specifier: ^3.1.0 + version: 3.3.0 + v2-addon: + specifier: workspace:* + version: link:../v2-addon + v2-addon-ts: + specifier: workspace:* + version: link:../v2-addon-ts + webpack: + specifier: ^5.91.0 + version: 5.91.0 + test-apps/embroider-app: devDependencies: '@ember/optional-features': @@ -3214,10 +3350,6 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} - agent-base@7.1.1: - resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} - engines: {node: '>= 14'} - agentkeepalive@4.5.0: resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} engines: {node: '>= 8.0.0'} @@ -4434,10 +4566,6 @@ packages: resolution: {integrity: sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==} engines: {node: '>=8'} - cssstyle@4.0.1: - resolution: {integrity: sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==} - engines: {node: '>=18'} - dag-map@2.0.2: resolution: {integrity: sha512-xnsprIzYuDeiyu5zSKwilV/ajRHxnoMlAhEREfyfTgTSViMVY2fGP1ZcHJbtwup26oCkofySU/m6oKJ3HrkW7w==} @@ -4448,10 +4576,6 @@ packages: resolution: {integrity: sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==} engines: {node: '>=10'} - data-urls@5.0.0: - resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} - engines: {node: '>=18'} - data-view-buffer@1.0.1: resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} engines: {node: '>= 0.4'} @@ -4905,6 +5029,10 @@ packages: resolution: {integrity: sha512-OS8TUVG2kQYYwP3netunLVfeijPoOKIs1SvPQRTNOQX4Pu8xGGBEZmrv0U1YTnQn12Eg+p6w/0UdGbUnITjyzw==} engines: {node: 12.* || >= 14} + ember-template-imports@4.1.1: + resolution: {integrity: sha512-mnbL3hjo/Ctg7rkBtuYkBRJUn5bDYRQCEZQxmNozRnfoEp2RLSbT6SFJRAFDYXT2OrY+8i821S4kPL1i0QuGIw==} + engines: {node: 16.* || >= 18} + ember-template-lint@6.0.0: resolution: {integrity: sha512-TWWt/qCd4KoQ50T3We5nCoKcsrAT8Ip79Kmm9eyWjjyL+LAbRFu0z+GxcmW7MR+QCNW/1LQs3kwEdtIcaHEGiA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5533,10 +5661,6 @@ packages: resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==} engines: {node: '>= 6'} - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -5851,6 +5975,10 @@ packages: hash-for-dep@1.5.1: resolution: {integrity: sha512-/dQ/A2cl7FBPI2pO0CANkvuuVi/IFS5oTyJ0PsOb6jW6WbVW1js5qJXMJTNbWHXBIPdFTWFbabjB+mE0d+gelw==} + hash-obj@3.0.0: + resolution: {integrity: sha512-mIORCoyREluZ2U0iSd4lnrQZ37V50gEKSHirRsCTTxsZvs1NtifSH/dMu07gB7897z/f1yEh/7KN6TeBT7ct7Q==} + engines: {node: '>=8'} + hash-string@1.0.0: resolution: {integrity: sha512-dtNNyxXobzHavayZwOwRWhBTqS9GX4jDjIMsGc0fDyaN2A+4zMn5Ua9ODDCggN6w3Spma6mAHL3ImmW3BkWDmQ==} @@ -5894,10 +6022,6 @@ packages: resolution: {integrity: sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==} engines: {node: '>=10'} - html-encoding-sniffer@4.0.0: - resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==} - engines: {node: '>=18'} - html-tags@3.3.1: resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==} engines: {node: '>=8'} @@ -5923,10 +6047,6 @@ packages: resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==} engines: {node: '>= 6'} - http-proxy-agent@7.0.2: - resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} - engines: {node: '>= 14'} - http-proxy@1.18.1: resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} engines: {node: '>=8.0.0'} @@ -5935,10 +6055,6 @@ packages: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} - https-proxy-agent@7.0.4: - resolution: {integrity: sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==} - engines: {node: '>= 14'} - https@1.0.0: resolution: {integrity: sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg==} @@ -6367,15 +6483,6 @@ packages: canvas: optional: true - jsdom@24.0.0: - resolution: {integrity: sha512-UDS2NayCvmXSXVP6mpTj+73JnNQadZlr9N68189xib2tx5Mls7swlTNao26IoHv46BZJFvXygyRtyXd1feAk1A==} - engines: {node: '>=18'} - peerDependencies: - canvas: ^2.11.2 - peerDependenciesMeta: - canvas: - optional: true - jsesc@0.3.0: resolution: {integrity: sha512-UHQmAeTXV+iwEk0aHheJRqo6Or90eDxI6KIYpHSjKLXKuKlPt1CQ7tGBerFcFA8uKU5mYxiPMlckmFptd5XZzA==} hasBin: true @@ -7879,9 +7986,6 @@ packages: route-recognizer: ^0.3.4 rsvp: ^4.8.5 - rrweb-cssom@0.6.0: - resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==} - rsvp@3.2.1: resolution: {integrity: sha512-Rf4YVNYpKjZ6ASAmibcwTNciQ5Co5Ztq6iZPEykHpkoflnD/K5ryE/rHehFsTm4NJj8nKDhbi3eKBWGogmNnkg==} @@ -7957,10 +8061,6 @@ packages: resolution: {integrity: sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==} engines: {node: '>=10'} - saxes@6.0.0: - resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} - engines: {node: '>=v12.22.7'} - schema-utils@2.7.1: resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} engines: {node: '>= 8.9.0'} @@ -8538,10 +8638,6 @@ packages: resolution: {integrity: sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==} engines: {node: '>=8'} - tr46@5.0.0: - resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} - engines: {node: '>=18'} - tracked-built-ins@3.3.0: resolution: {integrity: sha512-ewKFrW/AQs05oLPM5isOUb/1aOwBRfHfmF408CCzTk21FLAhKrKVOP5Q5ebX+zCT4kvg81PGBGwrBiEGND1nWA==} @@ -8595,6 +8691,10 @@ packages: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} + type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + type-is@1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} @@ -8864,10 +8964,6 @@ packages: resolution: {integrity: sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==} engines: {node: '>=10'} - w3c-xmlserializer@5.0.0: - resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} - engines: {node: '>=18'} - walk-sync@0.2.7: resolution: {integrity: sha512-OH8GdRMowEFr0XSHQeX5fGweO6zSVHo7bG/0yJQx6LAj9Oukz0C8heI3/FYectT66gY0IPGe89kOvU410/UNpg==} @@ -8913,10 +9009,6 @@ packages: resolution: {integrity: sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==} engines: {node: '>=10.4'} - webidl-conversions@7.0.0: - resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} - engines: {node: '>=12'} - webpack-sources@3.2.3: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} @@ -8945,24 +9037,12 @@ packages: whatwg-encoding@1.0.5: resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==} - whatwg-encoding@3.1.1: - resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==} - engines: {node: '>=18'} - whatwg-fetch@3.6.20: resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} whatwg-mimetype@2.3.0: resolution: {integrity: sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==} - whatwg-mimetype@4.0.0: - resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} - engines: {node: '>=18'} - - whatwg-url@14.0.0: - resolution: {integrity: sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==} - engines: {node: '>=18'} - whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} @@ -9074,18 +9154,6 @@ packages: utf-8-validate: optional: true - ws@8.17.0: - resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - xdg-basedir@4.0.0: resolution: {integrity: sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==} engines: {node: '>=8'} @@ -9093,10 +9161,6 @@ packages: xml-name-validator@3.0.0: resolution: {integrity: sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==} - xml-name-validator@5.0.0: - resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} - engines: {node: '>=18'} - xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} @@ -12560,13 +12624,6 @@ snapshots: transitivePeerDependencies: - supports-color - agent-base@7.1.1: - dependencies: - debug: 4.3.4(supports-color@9.4.0) - transitivePeerDependencies: - - supports-color - optional: true - agentkeepalive@4.5.0: dependencies: humanize-ms: 1.2.1 @@ -14083,11 +14140,6 @@ snapshots: dependencies: cssom: 0.3.8 - cssstyle@4.0.1: - dependencies: - rrweb-cssom: 0.6.0 - optional: true - dag-map@2.0.2: {} data-uri-to-buffer@2.0.2: {} @@ -14098,12 +14150,6 @@ snapshots: whatwg-mimetype: 2.3.0 whatwg-url: 8.7.0 - data-urls@5.0.0: - dependencies: - whatwg-mimetype: 4.0.0 - whatwg-url: 14.0.0 - optional: true - data-view-buffer@1.0.1: dependencies: call-bind: 1.0.7 @@ -15131,6 +15177,14 @@ snapshots: transitivePeerDependencies: - supports-color + ember-template-imports@4.1.1: + dependencies: + broccoli-stew: 3.0.0 + content-tag: 2.0.1 + ember-cli-version-checker: 5.1.2 + transitivePeerDependencies: + - supports-color + ember-template-lint@6.0.0: dependencies: '@lint-todo/utils': 13.1.1 @@ -16119,13 +16173,6 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - optional: true - forwarded@0.2.0: {} fragment-cache@0.2.1: @@ -16562,6 +16609,12 @@ snapshots: transitivePeerDependencies: - supports-color + hash-obj@3.0.0: + dependencies: + is-obj: 2.0.0 + sort-keys: 4.2.0 + type-fest: 0.8.1 + hash-string@1.0.0: {} hasown@2.0.2: @@ -16613,11 +16666,6 @@ snapshots: dependencies: whatwg-encoding: 1.0.5 - html-encoding-sniffer@4.0.0: - dependencies: - whatwg-encoding: 3.1.1 - optional: true - html-tags@3.3.1: {} htmlparser2@8.0.2: @@ -16662,14 +16710,6 @@ snapshots: transitivePeerDependencies: - supports-color - http-proxy-agent@7.0.2: - dependencies: - agent-base: 7.1.1 - debug: 4.3.4(supports-color@9.4.0) - transitivePeerDependencies: - - supports-color - optional: true - http-proxy@1.18.1: dependencies: eventemitter3: 4.0.7 @@ -16692,14 +16732,6 @@ snapshots: transitivePeerDependencies: - supports-color - https-proxy-agent@7.0.4: - dependencies: - agent-base: 7.1.1 - debug: 4.3.4(supports-color@9.4.0) - transitivePeerDependencies: - - supports-color - optional: true - https@1.0.0: {} human-signals@1.1.1: {} @@ -17163,35 +17195,6 @@ snapshots: - supports-color - utf-8-validate - jsdom@24.0.0: - dependencies: - cssstyle: 4.0.1 - data-urls: 5.0.0 - decimal.js: 10.4.3 - form-data: 4.0.0 - html-encoding-sniffer: 4.0.0 - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.4 - is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.10 - parse5: 7.1.2 - rrweb-cssom: 0.6.0 - saxes: 6.0.0 - symbol-tree: 3.2.4 - tough-cookie: 4.1.4 - w3c-xmlserializer: 5.0.0 - webidl-conversions: 7.0.0 - whatwg-encoding: 3.1.1 - whatwg-mimetype: 4.0.0 - whatwg-url: 14.0.0 - ws: 8.17.0 - xml-name-validator: 5.0.0 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - optional: true - jsesc@0.3.0: {} jsesc@0.5.0: {} @@ -18726,9 +18729,6 @@ snapshots: route-recognizer: 0.3.4 rsvp: 4.8.5 - rrweb-cssom@0.6.0: - optional: true - rsvp@3.2.1: {} rsvp@3.6.2: {} @@ -18814,11 +18814,6 @@ snapshots: dependencies: xmlchars: 2.2.0 - saxes@6.0.0: - dependencies: - xmlchars: 2.2.0 - optional: true - schema-utils@2.7.1: dependencies: '@types/json-schema': 7.0.15 @@ -19563,11 +19558,6 @@ snapshots: dependencies: punycode: 2.3.1 - tr46@5.0.0: - dependencies: - punycode: 2.3.1 - optional: true - tracked-built-ins@3.3.0: dependencies: '@embroider/addon-shim': 1.8.8 @@ -19626,6 +19616,8 @@ snapshots: type-fest@0.6.0: {} + type-fest@0.8.1: {} + type-is@1.6.18: dependencies: media-typer: 0.3.0 @@ -19824,7 +19816,7 @@ snapshots: fsevents: 2.3.3 terser: 5.31.0 - vitest@1.6.0(@types/node@20.12.12)(jsdom@24.0.0)(terser@5.31.0): + vitest@1.6.0(@types/node@20.12.12)(jsdom@16.7.0)(terser@5.31.0): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -19848,7 +19840,7 @@ snapshots: why-is-node-running: 2.2.2 optionalDependencies: '@types/node': 20.12.12 - jsdom: 24.0.0 + jsdom: 16.7.0 transitivePeerDependencies: - less - lightningcss @@ -19895,11 +19887,6 @@ snapshots: dependencies: xml-name-validator: 3.0.0 - w3c-xmlserializer@5.0.0: - dependencies: - xml-name-validator: 5.0.0 - optional: true - walk-sync@0.2.7: dependencies: ensure-posix-path: 1.1.1 @@ -19963,9 +19950,6 @@ snapshots: webidl-conversions@6.1.0: {} - webidl-conversions@7.0.0: - optional: true - webpack-sources@3.2.3: {} webpack-virtual-modules@0.6.1: {} @@ -20044,24 +20028,10 @@ snapshots: dependencies: iconv-lite: 0.4.24 - whatwg-encoding@3.1.1: - dependencies: - iconv-lite: 0.6.3 - optional: true - whatwg-fetch@3.6.20: {} whatwg-mimetype@2.3.0: {} - whatwg-mimetype@4.0.0: - optional: true - - whatwg-url@14.0.0: - dependencies: - tr46: 5.0.0 - webidl-conversions: 7.0.0 - optional: true - whatwg-url@5.0.0: dependencies: tr46: 0.0.3 @@ -20179,16 +20149,10 @@ snapshots: ws@8.11.0: {} - ws@8.17.0: - optional: true - xdg-basedir@4.0.0: {} xml-name-validator@3.0.0: {} - xml-name-validator@5.0.0: - optional: true - xmlchars@2.2.0: {} y18n@5.0.8: {} diff --git a/test-apps/classic-app-2024-05/.eslintrc.js b/test-apps/classic-app-2024-05/.eslintrc.js index 35b0e21d..74e643bb 100644 --- a/test-apps/classic-app-2024-05/.eslintrc.js +++ b/test-apps/classic-app-2024-05/.eslintrc.js @@ -6,5 +6,24 @@ const ember = configs.ember(); // accommodates: JS, TS, App, Addon, and V2 Addon module.exports = { - overrides: [...ember.overrides], + overrides: [ + ...ember.overrides, + { + files: ['**/*.gts'], + plugins: ['ember'], + parser: 'ember-eslint-parser', + }, + { + files: ['**/*.gjs'], + plugins: ['ember'], + parser: 'ember-eslint-parser', + }, + { + files: ['*.{cjs,js}'], + rules: { + 'n/no-unsupported-syntax': 'off', + 'n/no-unsupported-features': 'off', + }, + }, + ], }; diff --git a/test-apps/classic-app-2024-05/README.md b/test-apps/classic-app-2024-05/README.md index 3d92d98f..7e451b1f 100644 --- a/test-apps/classic-app-2024-05/README.md +++ b/test-apps/classic-app-2024-05/README.md @@ -1,4 +1,4 @@ -# classic-app +# classic-app-2024-05 This README outlines the details of collaborating on this Ember application. A short introduction of this app could easily go here. @@ -15,7 +15,7 @@ You will need the following things properly installed on your computer. ## Installation - `git clone ` this repository -- `cd classic-app` +- `cd classic-app-2024-05` - `npm install` ## Running / Development diff --git a/test-apps/classic-app-2024-05/app/app.js b/test-apps/classic-app-2024-05/app/app.js index a4857677..6aebd923 100644 --- a/test-apps/classic-app-2024-05/app/app.js +++ b/test-apps/classic-app-2024-05/app/app.js @@ -1,6 +1,6 @@ import Application from '@ember/application'; -import config from 'classic-app/config/environment'; +import config from 'classic-app-2024-05/config/environment'; import loadInitializers from 'ember-load-initializers'; import Resolver from 'ember-resolver'; diff --git a/test-apps/classic-app-2024-05/app/components/scoped.hbs b/test-apps/classic-app-2024-05/app/components/scoped.hbs index 29db9216..75555490 100644 --- a/test-apps/classic-app-2024-05/app/components/scoped.hbs +++ b/test-apps/classic-app-2024-05/app/components/scoped.hbs @@ -1,6 +1,6 @@
Component with scoped class helper
\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/index.html b/test-apps/classic-app-2024-05/app/index.html index 7aca2277..c2bdd3dd 100644 --- a/test-apps/classic-app-2024-05/app/index.html +++ b/test-apps/classic-app-2024-05/app/index.html @@ -12,7 +12,7 @@ {{content-for "head-footer"}} @@ -21,7 +21,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/test-apps/classic-app-2024-05/app/router.js b/test-apps/classic-app-2024-05/app/router.js index da0fabd2..59d1863e 100644 --- a/test-apps/classic-app-2024-05/app/router.js +++ b/test-apps/classic-app-2024-05/app/router.js @@ -1,6 +1,6 @@ import EmberRouter from '@ember/routing/router'; -import config from 'classic-app/config/environment'; +import config from 'classic-app-2024-05/config/environment'; export default class Router extends EmberRouter { location = config.locationType; diff --git a/test-apps/classic-app-2024-05/config/environment.js b/test-apps/classic-app-2024-05/config/environment.js index bc70bf05..21d86af4 100644 --- a/test-apps/classic-app-2024-05/config/environment.js +++ b/test-apps/classic-app-2024-05/config/environment.js @@ -2,7 +2,7 @@ module.exports = function (environment) { const ENV = { - modulePrefix: 'classic-app', + modulePrefix: 'classic-app-2024-05', environment, rootURL: '/', locationType: 'history', diff --git a/test-apps/classic-app-2024-05/ember-cli-build.js b/test-apps/classic-app-2024-05/ember-cli-build.js index 4d61b012..f355eeee 100644 --- a/test-apps/classic-app-2024-05/ember-cli-build.js +++ b/test-apps/classic-app-2024-05/ember-cli-build.js @@ -4,7 +4,7 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function (defaults) { const app = new EmberApp(defaults, { - name: 'classic-app', + // name: 'classic-app-2024-05', cssModules: { extension: 'module.css', }, @@ -12,7 +12,7 @@ module.exports = function (defaults) { enableTypeScriptTransform: true, }, 'ember-scoped-css': { - layerName: 'classic-app-layer', + layerName: 'classic-app-2024-05-layer', }, }); diff --git a/test-apps/classic-app-2024-05/package.json b/test-apps/classic-app-2024-05/package.json index 8b6aae31..78c45041 100644 --- a/test-apps/classic-app-2024-05/package.json +++ b/test-apps/classic-app-2024-05/package.json @@ -2,7 +2,7 @@ "name": "classic-app-2024-05", "version": "0.0.0", "private": true, - "description": "Small description for classic-app goes here", + "description": "Small description for classic-app-2024-05 goes here", "repository": "", "license": "MIT", "author": "", @@ -29,7 +29,7 @@ "@ember/test-helpers": "^3.2.0", "@glimmer/component": "^1.1.2", "@glimmer/tracking": "^1.1.2", - "@nullvoxpopuli/eslint-configs": "^3.2.2", + "@nullvoxpopuli/eslint-configs": "^4.0.0", "broccoli-asset-rev": "^3.0.0", "concurrently": "^8.2.1", "ember-auto-import": "2.7.2", @@ -51,7 +51,7 @@ "ember-scoped-css-compat": "workspace:*", "ember-source": "~5.8.0", "ember-style-loader": "github:mainmatter/ember-style-loader#main", - "ember-template-imports": "^4.1.0", + "ember-template-imports": "^4.1.1", "ember-template-lint": "^6.0.0", "eslint": "^8.50.0", "eslint-plugin-ember": "^12.0.2", diff --git a/test-apps/classic-app-2024-05/tests/index.html b/test-apps/classic-app-2024-05/tests/index.html index dedfb4dc..d1304879 100644 --- a/test-apps/classic-app-2024-05/tests/index.html +++ b/test-apps/classic-app-2024-05/tests/index.html @@ -9,7 +9,7 @@ {{content-for "head"}} {{content-for "test-head"}} - + {{content-for "head-footer"}} {{content-for "test-head-footer"}} @@ -27,7 +27,7 @@ - + {{content-for "body-footer"}} {{content-for "test-body-footer"}} diff --git a/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs index fa485edf..297d59d2 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs +++ b/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs @@ -2,8 +2,8 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import ComponentAtClass from 'classic-app/components/component-at-class'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import ComponentAtClass from 'classic-app-2024-05/components/component-at-class'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -20,7 +20,7 @@ module('Integration | Component | @class', function (hooks) { assert .dom('p') .hasClass( - scopedClass('text-color', 'classic-app/components/component-at-class') + scopedClass('text-color', 'classic-app-2024-05/components/component-at-class') ); assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); }); @@ -33,7 +33,7 @@ module('Integration | Component | @class', function (hooks) { assert .dom('p') .hasClass( - scopedClass('text-color', 'classic-app/components/component-at-class') + scopedClass('text-color', 'classic-app-2024-05/components/component-at-class') ); assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); }); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js b/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js index a50123db..eed1c19e 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js +++ b/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js @@ -3,7 +3,7 @@ import { render, settled } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; module('Integration | Component | DynamicAttribute', function (hooks) { setupRenderingTest(hooks); @@ -18,13 +18,13 @@ module('Integration | Component | DynamicAttribute', function (hooks) { this.setProperties({ state }); await render(hbs``); - assert.dom('div').hasClass('is-foo_e3cf3bd44'); + assert.dom('div').hasClass('is-foo_efdf9ecfb'); assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); state.ya = false; await settled(); - assert.dom('div').hasClass('is-not-foo_e3cf3bd44'); + assert.dom('div').hasClass('is-not-foo_efdf9ecfb'); assert.dom('div').hasStyle({ color: 'rgb(255, 0, 0)' }); }); }); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs index a1441148..4449937a 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs @@ -3,7 +3,7 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import ComponentAtClass from 'v2-addon-ts/components/at-class-ts/component-at-class'; import { scopedClass } from 'ember-scoped-css/test-support'; diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs index 53de11de..e3a2747c 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs @@ -1,7 +1,7 @@ import { render } from '@ember/test-helpers'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import { StrictClass } from 'v2-addon-ts/components/strict-class'; import { scopedClass } from 'ember-scoped-css/test-support'; diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs index 935abede..6325fdaa 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs @@ -1,7 +1,7 @@ import { render } from '@ember/test-helpers'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import { Strict } from 'v2-addon-ts/components/strict'; import { scopedClass } from 'ember-scoped-css/test-support'; diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js index 306832aa..caa8deb2 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js @@ -2,7 +2,7 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js index b54889f4..37d76418 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js @@ -2,7 +2,7 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs index cdf19d64..e8df43c7 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs +++ b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs @@ -3,7 +3,7 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import ComponentAtClass from 'v2-addon/components/at-class/component-at-class'; import { scopedClass } from 'ember-scoped-css/test-support'; diff --git a/test-apps/classic-app-2024-05/tests/integration/components/header-test.js b/test-apps/classic-app-2024-05/tests/integration/components/header-test.js index 326f0e61..e80fa8da 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/header-test.js +++ b/test-apps/classic-app-2024-05/tests/integration/components/header-test.js @@ -2,7 +2,7 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -12,10 +12,12 @@ module('Integration | Component | header', function (hooks) { test('it has scoped class', async function (assert) { await render(hbs`
`); - assert.dom('h1').hasClass('test-header_e64a12152'); + assert.dom('h1').hasClass('test-header_e784d3467'); assert.dom('h1').hasStyle({ color: 'rgb(255, 0, 0)' }); assert .dom('h1') - .hasClass(scopedClass('test-header', 'classic-app/components/header')); + .hasClass( + scopedClass('test-header', 'classic-app-2024-05/components/header'), + ); }); }); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts b/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts index 87fb2214..f506a9e5 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts +++ b/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts @@ -2,7 +2,9 @@ import { render } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import CallsAtHasClass from 'classic-app/components/in-app/at-class-ts/calls-has-at-class'; +import CallsAtHasClass from 'classic-app-2024-05/components/in-app/at-class-ts/calls-has-at-class'; + +import { scopedClass } from 'ember-scoped-css/test-support'; module('[In App] at-class-ts', function(hooks) { setupRenderingTest(hooks); @@ -14,6 +16,8 @@ module('[In App] at-class-ts', function(hooks) { ); + assert.dom('p').hasClass('text-color_e4912e7ba'); + assert.dom('p').hasClass(scopedClass('text-color', 'classic-app-2024-05/components/in-app/at-class-ts/calls-has-at-class')); assert.dom('p').hasStyle({ color: 'rgb(51, 51, 119)' }); }); }); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js b/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js index 49fd10b5..7315f68d 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js +++ b/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js @@ -2,7 +2,7 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; module('Integration | Component | scoped', function (hooks) { setupRenderingTest(hooks); @@ -10,9 +10,9 @@ module('Integration | Component | scoped', function (hooks) { test('it replaces the scoped-class helper', async function (assert) { await render(hbs``); - assert.dom('div').hasAttribute('data-scoped-class', 'some-class_e4aeedfc0'); + assert.dom('div').hasAttribute('data-scoped-class', 'some-class_e80b6d598'); assert .dom('div') - .hasAttribute('data-scoped-class-2', 'some-class-2_e4aeedfc0'); + .hasAttribute('data-scoped-class-2', 'some-class-2_e80b6d598'); }); }); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js b/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js index 0f96e84a..852f1734 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js +++ b/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js @@ -2,7 +2,7 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; module('Integration | Component | show-time', function (hooks) { setupRenderingTest(hooks); @@ -10,7 +10,7 @@ module('Integration | Component | show-time', function (hooks) { test('it has scoped class', async function (assert) { await render(hbs``); - assert.dom('h2').hasClass('e6e05c2f6'); + assert.dom('h2').hasClass('ed9ae5223'); assert.dom('h2').hasStyle({ color: 'rgb(0, 0, 255)' }); }); }); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs index 54520a7a..5223c0e7 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs +++ b/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs @@ -1,8 +1,8 @@ import { render, settled } from '@ember/test-helpers'; import { module, test } from 'qunit'; -import SubExpression from 'classic-app/components/subexpression'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import SubExpression from 'classic-app-2024-05/components/subexpression'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import { cell } from 'ember-resources'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -27,7 +27,7 @@ module('Integration | Component | subexpression', function (hooks) { assert .dom('div') .hasClass( - scopedClass('a-local-class', 'classic-app/components/subexpression') + scopedClass('a-local-class', 'classic-app-2024-05/components/subexpression') ); assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); }); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js b/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js index 7032d566..573c6fd2 100644 --- a/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js +++ b/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js @@ -2,7 +2,7 @@ import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; -import { setupRenderingTest } from 'classic-app/tests/helpers'; +import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -15,7 +15,10 @@ module('Integration | Component | template-only', function (hooks) { assert .dom('div') .hasClass( - scopedClass('some-class', 'classic-app/components/template-only'), + scopedClass( + 'some-class', + 'classic-app-2024-05/components/template-only', + ), ); assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); }); diff --git a/test-apps/classic-app-2024-05/tests/test-helper.js b/test-apps/classic-app-2024-05/tests/test-helper.js index 3e92a514..81afa86c 100644 --- a/test-apps/classic-app-2024-05/tests/test-helper.js +++ b/test-apps/classic-app-2024-05/tests/test-helper.js @@ -3,8 +3,8 @@ import * as QUnit from 'qunit'; import { setup } from 'qunit-dom'; import { start } from 'ember-qunit'; -import Application from 'classic-app/app'; -import config from 'classic-app/config/environment'; +import Application from 'classic-app-2024-05/app'; +import config from 'classic-app-2024-05/config/environment'; setApplication(Application.create(config.APP)); From 548b5ca143f9ddac21e12f258546f747ea28e496 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 15 May 2024 19:02:28 -0400 Subject: [PATCH 3/4] Re-support pods --- README.md | 3 - ember-scoped-css-compat/index.js | 50 +++++ ember-scoped-css-compat/package.json | 1 + ember-scoped-css/src/build/app-js-unplugin.js | 161 ---------------- ember-scoped-css/src/build/index.js | 3 +- ember-scoped-css/src/build/template-plugin.js | 89 +-------- ember-scoped-css/src/lib/path-utils.js | 87 --------- .../src/lib/path/template-transform-paths.js | 103 +++++++++++ .../path/template-transmform-paths.test.ts | 47 +++++ package.json | 2 +- pnpm-lock.yaml | 175 +++--------------- test-apps/classic-app-2024-05/.editorconfig | 19 -- test-apps/classic-app-2024-05/.ember-cli | 15 -- test-apps/classic-app-2024-05/.eslintignore | 25 --- test-apps/classic-app-2024-05/.eslintrc.js | 29 --- .../.github/workflows/ci.yml | 47 ----- test-apps/classic-app-2024-05/.gitignore | 32 ---- test-apps/classic-app-2024-05/.prettierignore | 25 --- test-apps/classic-app-2024-05/.prettierrc.js | 12 -- .../classic-app-2024-05/.template-lintrc.js | 5 - test-apps/classic-app-2024-05/.watchmanconfig | 3 - test-apps/classic-app-2024-05/README.md | 56 ------ test-apps/classic-app-2024-05/app/app.js | 13 -- .../app/components/.gitkeep | 0 .../app/components/component-at-class.css | 3 - .../app/components/component-at-class.hbs | 1 - .../app/components/dynamic-attribute.css | 7 - .../app/components/dynamic-attribute.hbs | 3 - .../app/components/face.hbs | 3 - .../app/components/face.module.css | 3 - .../app/components/has-at-class.hbs | 1 - .../app/components/header.css | 3 - .../app/components/header.hbs | 4 - .../app/components/header.js | 6 - .../in-app/at-class-ts/calls-has-at-class.css | 3 - .../in-app/at-class-ts/calls-has-at-class.gts | 7 - .../in-app/at-class-ts/has-at-class.gts | 3 - .../app/components/scoped.css | 0 .../app/components/scoped.hbs | 6 - .../app/components/show-time.css | 3 - .../app/components/show-time.gjs | 3 - .../app/components/subexpression.css | 3 - .../app/components/subexpression.gjs | 5 - .../app/components/template-only.css | 3 - .../app/components/template-only.hbs | 1 - .../app/controllers/.gitkeep | 0 .../app/controllers/application.js | 5 - .../classic-app-2024-05/app/helpers/.gitkeep | 0 test-apps/classic-app-2024-05/app/index.html | 28 --- .../classic-app-2024-05/app/models/.gitkeep | 0 test-apps/classic-app-2024-05/app/router.js | 10 - .../classic-app-2024-05/app/routes/.gitkeep | 0 .../classic-app-2024-05/app/styles/app.css | 7 - .../app/templates/application.hbs | 13 -- .../config/ember-cli-update.json | 18 -- .../classic-app-2024-05/config/environment.js | 48 ----- .../config/optional-features.json | 6 - .../classic-app-2024-05/config/targets.js | 11 -- .../classic-app-2024-05/ember-cli-build.js | 35 ---- test-apps/classic-app-2024-05/package.json | 78 -------- .../classic-app-2024-05/public/robots.txt | 3 - test-apps/classic-app-2024-05/testem.js | 23 --- .../tests/helpers/index.js | 42 ----- .../classic-app-2024-05/tests/index.html | 35 ---- .../integration/components/at-class-test.gjs | 40 ---- .../components/dynamic-attribute-test.js | 30 --- .../from-v2-addon-ts/at-class-test.gjs | 41 ---- .../from-v2-addon-ts/strict-class-test.gjs | 25 --- .../from-v2-addon-ts/strict-test.gjs | 25 --- .../v2-addon-ts-with-a-class-test.js | 26 --- .../from-v2-addon/alert-from-v2-addon-test.js | 24 --- .../from-v2-addon/at-class-test.gjs | 41 ---- .../integration/components/header-test.js | 23 --- .../components/in-app/at-class-test.gts | 23 --- .../integration/components/scoped-test.js | 18 -- .../integration/components/show-time-test.js | 16 -- .../components/subexpression-test.gjs | 34 ---- .../components/template-only-test.js | 25 --- .../classic-app-2024-05/tests/test-helper.js | 13 -- .../classic-app-2024-05/tests/unit/.gitkeep | 0 test-apps/classic-app/package.json | 2 +- test-apps/embroider-app/ember-cli-build.js | 11 +- test-apps/embroider-app/package.json | 3 +- .../pods-embroider-app/ember-cli-build.js | 3 - test-apps/pods-embroider-app/package.json | 3 +- .../expected-dist/components/strict.js | 4 +- test-apps/v2-addon/package.json | 3 +- 87 files changed, 252 insertions(+), 1616 deletions(-) delete mode 100644 ember-scoped-css/src/build/app-js-unplugin.js delete mode 100644 ember-scoped-css/src/lib/path-utils.js create mode 100644 ember-scoped-css/src/lib/path/template-transform-paths.js create mode 100644 ember-scoped-css/src/lib/path/template-transmform-paths.test.ts delete mode 100644 test-apps/classic-app-2024-05/.editorconfig delete mode 100644 test-apps/classic-app-2024-05/.ember-cli delete mode 100644 test-apps/classic-app-2024-05/.eslintignore delete mode 100644 test-apps/classic-app-2024-05/.eslintrc.js delete mode 100644 test-apps/classic-app-2024-05/.github/workflows/ci.yml delete mode 100644 test-apps/classic-app-2024-05/.gitignore delete mode 100644 test-apps/classic-app-2024-05/.prettierignore delete mode 100644 test-apps/classic-app-2024-05/.prettierrc.js delete mode 100644 test-apps/classic-app-2024-05/.template-lintrc.js delete mode 100644 test-apps/classic-app-2024-05/.watchmanconfig delete mode 100644 test-apps/classic-app-2024-05/README.md delete mode 100644 test-apps/classic-app-2024-05/app/app.js delete mode 100644 test-apps/classic-app-2024-05/app/components/.gitkeep delete mode 100644 test-apps/classic-app-2024-05/app/components/component-at-class.css delete mode 100644 test-apps/classic-app-2024-05/app/components/component-at-class.hbs delete mode 100644 test-apps/classic-app-2024-05/app/components/dynamic-attribute.css delete mode 100644 test-apps/classic-app-2024-05/app/components/dynamic-attribute.hbs delete mode 100644 test-apps/classic-app-2024-05/app/components/face.hbs delete mode 100644 test-apps/classic-app-2024-05/app/components/face.module.css delete mode 100644 test-apps/classic-app-2024-05/app/components/has-at-class.hbs delete mode 100644 test-apps/classic-app-2024-05/app/components/header.css delete mode 100644 test-apps/classic-app-2024-05/app/components/header.hbs delete mode 100644 test-apps/classic-app-2024-05/app/components/header.js delete mode 100644 test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.css delete mode 100644 test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.gts delete mode 100644 test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/has-at-class.gts delete mode 100644 test-apps/classic-app-2024-05/app/components/scoped.css delete mode 100644 test-apps/classic-app-2024-05/app/components/scoped.hbs delete mode 100644 test-apps/classic-app-2024-05/app/components/show-time.css delete mode 100644 test-apps/classic-app-2024-05/app/components/show-time.gjs delete mode 100644 test-apps/classic-app-2024-05/app/components/subexpression.css delete mode 100644 test-apps/classic-app-2024-05/app/components/subexpression.gjs delete mode 100644 test-apps/classic-app-2024-05/app/components/template-only.css delete mode 100644 test-apps/classic-app-2024-05/app/components/template-only.hbs delete mode 100644 test-apps/classic-app-2024-05/app/controllers/.gitkeep delete mode 100644 test-apps/classic-app-2024-05/app/controllers/application.js delete mode 100644 test-apps/classic-app-2024-05/app/helpers/.gitkeep delete mode 100644 test-apps/classic-app-2024-05/app/index.html delete mode 100644 test-apps/classic-app-2024-05/app/models/.gitkeep delete mode 100644 test-apps/classic-app-2024-05/app/router.js delete mode 100644 test-apps/classic-app-2024-05/app/routes/.gitkeep delete mode 100644 test-apps/classic-app-2024-05/app/styles/app.css delete mode 100644 test-apps/classic-app-2024-05/app/templates/application.hbs delete mode 100644 test-apps/classic-app-2024-05/config/ember-cli-update.json delete mode 100644 test-apps/classic-app-2024-05/config/environment.js delete mode 100644 test-apps/classic-app-2024-05/config/optional-features.json delete mode 100644 test-apps/classic-app-2024-05/config/targets.js delete mode 100644 test-apps/classic-app-2024-05/ember-cli-build.js delete mode 100644 test-apps/classic-app-2024-05/package.json delete mode 100644 test-apps/classic-app-2024-05/public/robots.txt delete mode 100644 test-apps/classic-app-2024-05/testem.js delete mode 100644 test-apps/classic-app-2024-05/tests/helpers/index.js delete mode 100644 test-apps/classic-app-2024-05/tests/index.html delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/header-test.js delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs delete mode 100644 test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js delete mode 100644 test-apps/classic-app-2024-05/tests/test-helper.js delete mode 100644 test-apps/classic-app-2024-05/tests/unit/.gitkeep diff --git a/README.md b/README.md index 20e5cf74..4afcabb8 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,6 @@ Setup webpack: ```js // ember-cli-build.js module.exports = async function (defaults) { - const { appJsUnplugin } = await import('ember-scoped-css/build'); - const app = new EmberApp(defaults, { /* ... */ }); const { Webpack } = require('@embroider/webpack'); @@ -70,7 +68,6 @@ module.exports = async function (defaults) { packagerOptions: { // css loaders for live reloading css webpackConfig: { - plugins: [appJsUnplugin.webpack({ appDir: __dirname })], module: { rules: [ // css loaders for production diff --git a/ember-scoped-css-compat/index.js b/ember-scoped-css-compat/index.js index 903dd6af..0712eecc 100644 --- a/ember-scoped-css-compat/index.js +++ b/ember-scoped-css-compat/index.js @@ -1,6 +1,7 @@ 'use strict'; const hashObj = require('hash-obj'); +const fs = require('fs'); const { default: ScopedCssPreprocessor, @@ -57,6 +58,7 @@ module.exports = { this._setupCSSPlugins(registry, options); this._setupHBSPlugins(registry, options); + this._setupJSPlugins(registry, options); }, _setupCSSPlugins(registry, options) { @@ -72,6 +74,10 @@ module.exports = { registry.add('css', this.outputStylePreprocessor); }, + _setupJSPlugins(registry, options) { + registry.add('js', new JSPreprocessor(options)); + }, + _setupHBSPlugins(registry, options) { let plugin = this._buildHBSPlugin(options); @@ -112,3 +118,47 @@ function cacheKeyForConfig(config) { // and those css files are not imported into js... so... no cache for us return `ember-scoped-css-${configHash}-${Math.random()}`; } + +const stew = require('broccoli-stew'); +const babel = require('@babel/core'); + +class JSPreprocessor { + constructor(options) { + this.options = options; + } + + toTree(tree) { + let updated = stew.map(tree, '**/*.{js}', (string, relativePath) => { + console.log({ string, relativePath }); + + let cssPath = relativePath.replace(/\.js$/, '.css'); + + if (fs.existsSync(cssPath)) { + /** + * This is slow to cause a whole parse again, + * so we only want to do it when we know we have a CSS file. + * + * The whole babel situation with embroider (pre v4) and classic ember, + * is... just a mess. So we're skirting around it and inserting our code + * as early as possible. + */ + let result = babel.transformSync('code', { + plugins: [ + [ + require.resolve('ember-scoped-css/babel-plugin'), + { + ...this.options, + }, + ], + ], + }); + + return result.code; + } + + return string; + }); + + return updated; + } +} diff --git a/ember-scoped-css-compat/package.json b/ember-scoped-css-compat/package.json index 7c3c0012..d327f183 100644 --- a/ember-scoped-css-compat/package.json +++ b/ember-scoped-css-compat/package.json @@ -39,6 +39,7 @@ "@glimmer/tracking": "^1.1.2", "@nullvoxpopuli/eslint-configs": "^4.0.0", "broccoli-asset-rev": "^3.0.0", + "broccoli-stew": "^3.0.0", "concurrently": "^8.2.2", "ember-auto-import": "^2.7.2", "ember-cli": "~5.8.1", diff --git a/ember-scoped-css/src/build/app-js-unplugin.js b/ember-scoped-css/src/build/app-js-unplugin.js deleted file mode 100644 index 16109e76..00000000 --- a/ember-scoped-css/src/build/app-js-unplugin.js +++ /dev/null @@ -1,161 +0,0 @@ -import path from 'node:path'; - -import { createUnplugin } from 'unplugin'; - -import getClassesTagsFromCss from '../lib/getClassesTagsFromCss.js'; -import { hashFromAbsolutePath, isPodTemplate } from '../lib/path/utils.js'; -import replaceGlimmerAst from '../lib/replaceGlimmerAst.js'; - -function* iterateOpcodes(opcodes) { - for (let instruction of opcodes) { - if (!Array.isArray(instruction)) { - continue; - } - - yield instruction; - - for (let subInstruction of iterateOpcodes(instruction)) { - yield subInstruction; - } - } -} - -function inflateTagName(tag) { - if (typeof tag === 'string') { - return tag; - } else { - if (tag === 0) { - return 'div'; - } else if (tag === 1) { - return 'span'; - } else if (tag === 2) { - return 'p'; - } else if (tag === 3) { - return 'a'; - } - } - - throw new Error('Unknown tag'); -} - -export default createUnplugin(({ appDir }) => { - return { - name: 'app-js-unplugin', - - transformInclude(id) { - return ( - id.includes(path.basename(appDir)) && - (id.endsWith('.js') || id.endsWith('.hbs')) - ); - }, - - /** - * This whole thing is error prone, and we should switch the embroider - * technique to using a babel plugin. - * - * Using a webpack plugin is too late in the process. - * We don't want to be dealing with wire-format, because - * - it's not public API - * - it can change as ember-source is upgraded - * - the numbers are not "stable", in that they are bitwise anded and ored - * together so that storage is efficient -- which means we'd need to know - * all the opcodes and appropriately | / & to deconstruct appropriately. - * @returns - */ - async transform(code, id) { - let cssPath = id.replace(/(\.js)|(\.hbs)/, '.css'); - let moduleGroupPath = cssPath; - - if (isPodTemplate(id)) { - cssPath = path.join(path.dirname(id), 'styles.css'); - moduleGroupPath = path.dirname(cssPath); - } - - const postfix = hashFromAbsolutePath(moduleGroupPath); - - return await replaceGlimmerAst(code, id, (opcodes, css) => { - const { classes, tags } = getClassesTagsFromCss(css); - // this.addWatchFile(cssPath); - const insertions = []; - - for (let instruction of iterateOpcodes(opcodes[0])) { - // replace classes - if ( - instruction[0] === 14 && - instruction[1] === 0 && - instruction[2] && - instruction[2].split(' ').find((i) => classes.has(i.trim())) - ) { - // 14 - css attribute, 0 - class - instruction[2] = instruction[2] - .split(' ') - .map((className) => { - if (className.trim() && classes.has(className.trim())) { - return className.trim() + '_' + postfix; - } else { - return className; - } - }) - .join(' '); - } - - // replace strings in if conditions - // this is brittle, because subexpressions can be deeply nested - // - // this particular one is
" - // if (instruction[0] === 15 && Array.isArray(instruction[1]) && instruction[1][0] === 29) { - - // } - - // add postfix to tags - if ( - instruction[0] === 10 && - tags.has(inflateTagName(instruction[1])) - ) { - // 10 - open element - let existingClassInstruction; - - for ( - let i = opcodes[0].indexOf(instruction); - i <= opcodes[0].length; - i++ - ) { - if (opcodes[0][i][0] === 14 && opcodes[0][i][1] === 0) { - // 14 - css attribute, 0 - class - existingClassInstruction = opcodes[0][i]; - - break; - } - - if (opcodes[0][i][0] === 12) { - // 12 - flush element - break; - } - } - - if (existingClassInstruction) { - existingClassInstruction[2] += ' ' + postfix; - } else { - const classInstruction = [14, 0, postfix, undefined]; - - insertions.push([instruction, classInstruction]); - } - } - } - - // insert new instructions - for (let [instruction, classInstruction] of insertions) { - const index = opcodes[0].indexOf(instruction); - - opcodes[0].splice(index + 1, 0, classInstruction); - } - - // rewrite opcodes - // const dbg = new WireFormatDebugger(opcodes); - // const wfd = dbg.format(opcodes); - - return opcodes; - }); - }, - }; -}); diff --git a/ember-scoped-css/src/build/index.js b/ember-scoped-css/src/build/index.js index 1862fa0a..4904ba94 100644 --- a/ember-scoped-css/src/build/index.js +++ b/ember-scoped-css/src/build/index.js @@ -1,4 +1,3 @@ -import appJsUnplugin from './app-js-unplugin.js'; import scopedCssUnplugin from './scoped-css-unplugin.js'; -export { appJsUnplugin, scopedCssUnplugin }; +export { scopedCssUnplugin }; diff --git a/ember-scoped-css/src/build/template-plugin.js b/ember-scoped-css/src/build/template-plugin.js index 57701a5a..e9622734 100644 --- a/ember-scoped-css/src/build/template-plugin.js +++ b/ember-scoped-css/src/build/template-plugin.js @@ -3,18 +3,15 @@ * @typedef {import('@glimmer/syntax').ASTPluginEnvironment} ASTPluginEnvironment * */ -import path from 'node:path'; - -import { existsSync } from 'fs'; import { getCSSInfo } from '../lib/css/utils.js'; -import { appPath, findWorkspacePath } from '../lib/generateAbsolutePathHash.js'; -import { generateRelativePathHash } from '../lib/generateRelativePathHash.js'; +import { fixFilename } from '../lib/path/template-transform-paths.js'; import { + appPath, cssPathFor, + hashFromModulePath, isRelevantFile, - withoutExtension, -} from '../lib/path-utils.js'; +} from '../lib/path/utils.js'; import { templatePlugin } from '../lib/rewriteHbs.js'; const noopPlugin = { @@ -37,12 +34,12 @@ export function createPlugin(config) { return noopPlugin; } - let absolutePath = fixFilename(env); + let absolutePath = fixFilename(env.filename); let modulePath = appPath(absolutePath); let cssPath = cssPathFor(absolutePath); let info = getCSSInfo(cssPath); - let postfix = generateRelativePathHash(modulePath); + let postfix = hashFromModulePath(modulePath); if (!info) { return noopPlugin; @@ -77,77 +74,3 @@ export function createPlugin(config) { }; }; } - -/** - * template plugins do not hand us the correct file path. - * additionally, we may not be able to rely on this data in the future, - * so this functions acts as a means of normalizing _whatever_ we're given - * in the future. - * - * @param {ASTPluginEnvironment} env - * @returns {string} the absolute path to the file - */ -function fixFilename(env) { - let fileName = env.filename; - let workspace = findWorkspacePath(fileName); - - /** - * ember-source 5.8: - * - the filename looks like an absolute path, but swapped out the 'app' part of the path - * with the module name, so the file paths never exist on disk - */ - if (!fileName.includes('/app/')) { - let maybeModule = fileName.replace(workspace, ''); - let [maybeScope, ...rest] = maybeModule.split('/').filter(Boolean); - let parts = rest; - - if (maybeScope.startsWith('@')) { - let [, ...rester] = rest; - - parts = rester; - } - - let relative = path.join(...parts); - - /** - * We don't actually know if this file is an app. - * it could be an addon (v1 or v2) - * - * So here we log to see if we have unhandled situations. - */ - let candidatePath = path.join(workspace, 'app', relative); - - let resolved = findCandidate(candidatePath); - - if (resolved) { - return resolved; - } - } - - console.debug(`[ScopedCSS]: Failed to handle ${fileName}`); - - // Fallback to what the plugin system gives us. - // This may be wrong, and if wrong, reveals - // unhandled scenarios with the file names in the plugin infra - return fileName; -} - -const COMPILES_TO_JS = ['.hbs', '.gjs', '.gts']; - -function findCandidate(filePath) { - if (existsSync(filePath)) { - return filePath; - } - - let withoutExt = withoutExtension(filePath); - - for (let ext of COMPILES_TO_JS) { - let candidatePath = withoutExt + ext; - - if (existsSync(candidatePath)) { - return candidatePath; - } - } - - return null; -} diff --git a/ember-scoped-css/src/lib/path-utils.js b/ember-scoped-css/src/lib/path-utils.js deleted file mode 100644 index c0129a32..00000000 --- a/ember-scoped-css/src/lib/path-utils.js +++ /dev/null @@ -1,87 +0,0 @@ -import path from 'node:path'; - -import { findWorkspacePath } from './generateAbsolutePathHash'; - -/** - * Based on ember's component location conventions, - * this function will provide a path for where we - * expect the CSS to live. - * - * For co-located structure: - * - components/my-component.hbs - * - components/my-component.css - * - * For nested co-located structure - * - components/my-component/foo.hbs - * - components/my-component/foo.css - * - * For Pods routes structure - * - routes/my-route/template.{hbs,js} - * - routes/my-route/styles.css - * - * Deliberately not supported: - * - components w/ pods -- this is deprecated in 5.10 - * - * @param {string} fileName - the hbs, js, gjs, gts or whatever co-located path. - * @returns {string} - expected css path - */ -export function cssPathFor(fileName) { - let withoutExt = withoutExtension(fileName); - let cssPath = withoutExt + '.css'; - - /** - * Routes' Pods support - * - * components + pods will never be supported. - */ - let isPod = - !fileName.includes('/components/') && fileName.endsWith('template.js'); - - if (isPod) { - cssPath = fileName.replace(/template\.js$/, 'styles.css'); - } - - return cssPath; -} - -/** - * - * @param {string} filePath - * @returns the same path, but without the extension - */ -export function withoutExtension(filePath) { - let parsed = path.parse(filePath); - - return path.join(parsed.dir, parsed.name); -} - -const UNSUPPORTED_DIRECTORIES = new Set(['tests']); - -/** - * - * @param {string} fileName - * @param {string[]} [additionalRoots] - * @returns - */ -export function isRelevantFile(fileName, additionalRoots) { - let workspace = findWorkspacePath(fileName); - - let local = fileName.replace(workspace, ''); - let [, ...parts] = local.split('/').filter(Boolean); - - if (UNSUPPORTED_DIRECTORIES.has(parts[0])) { - return false; - } - - /** - * Mostly pods support. - * folks need to opt in to pods (routes), because every pods app can be configured differently - */ - let roots = ['/components/', ...(additionalRoots || [])]; - - if (!roots.some((root) => fileName.includes(root))) { - return; - } - - return true; -} diff --git a/ember-scoped-css/src/lib/path/template-transform-paths.js b/ember-scoped-css/src/lib/path/template-transform-paths.js new file mode 100644 index 00000000..8f1e7cf8 --- /dev/null +++ b/ember-scoped-css/src/lib/path/template-transform-paths.js @@ -0,0 +1,103 @@ +import path from 'node:path'; + +import { existsSync } from 'fs'; + +import { findWorkspacePath, withoutExtension } from './utils'; + +/** + * template plugins do not hand us the correct file path. + * additionally, we may not be able to rely on this data in the future, + * so this functions acts as a means of normalizing _whatever_ we're given + * in the future. + * + * @param {string} filename + * @returns {string} the absolute path to the file + */ +export function fixFilename(filename) { + let fileName = filename; + let workspace = findWorkspacePath(fileName); + + /** + * ember-source 5.8: + * - the filename looks like an absolute path, but swapped out the 'app' part of the path + * with the module name, so the file paths never exist on disk + */ + if (!fileName.includes('/app/')) { + let maybeModule = fileName.replace(workspace, ''); + let [maybeScope, ...rest] = maybeModule.split('/').filter(Boolean); + let parts = rest; + + if (maybeScope.startsWith('@')) { + let [, ...rester] = rest; + + parts = rester; + } + + let relative = path.join(...parts); + + /** + * We don't actually know if this file is an app. + * it could be an addon (v1 or v2) + * + * So here we log to see if we have unhandled situations. + */ + let candidatePath = path.join(workspace, 'app', relative); + + let resolved = findCandidate(candidatePath); + + if (resolved) { + return resolved; + } + } + + /** + * under embroider@3, the fileName will be the path to the rewritten file. + * we don't want this. + * we want the path to the original source. + * Through the powers of ✨ convention ✨, we can map back to source. + */ + if (fileName.includes('/node_modules/.embroider/rewritten-app/')) { + let candidatePath = fileName.replace( + '/node_modules/.embroider/rewritten-app/', + '/app/', + ); + + let resolved = findCandidate(candidatePath); + + if (resolved) { + return resolved; + } + } + + // TODO: why are we passed files to other projects? + if (!fileName.includes(workspace)) { + return fileName; + } + + console.debug(`[ScopedCSS]: Failed to handle ${fileName}`); + + // Fallback to what the plugin system gives us. + // This may be wrong, and if wrong, reveals + // unhandled scenarios with the file names in the plugin infra + return fileName; +} + +const COMPILES_TO_JS = ['.hbs', '.gjs', '.gts']; + +function findCandidate(filePath) { + if (existsSync(filePath)) { + return filePath; + } + + let withoutExt = withoutExtension(filePath); + + for (let ext of COMPILES_TO_JS) { + let candidatePath = withoutExt + ext; + + if (existsSync(candidatePath)) { + return candidatePath; + } + } + + return null; +} diff --git a/ember-scoped-css/src/lib/path/template-transmform-paths.test.ts b/ember-scoped-css/src/lib/path/template-transmform-paths.test.ts new file mode 100644 index 00000000..2dc08842 --- /dev/null +++ b/ember-scoped-css/src/lib/path/template-transmform-paths.test.ts @@ -0,0 +1,47 @@ +import path from 'node:path'; + +import { describe, expect, it } from 'vitest'; + +import { fixFilename } from './template-transform-paths.js'; +import { paths } from './utils.paths.test.js'; + +describe('fixFilename()', () => { + it('works with embroider paths', () => { + let file = path.join( + paths.embroiderApp, + paths.rewritten, + 'components/template-only.hbs', + ); + let corrected = fixFilename(file); + + expect(corrected).to.equal( + path.join(paths.embroiderApp, 'app/components/template-only.hbs'), + ); + }); + + it('works with the real path', () => { + let file = path.join( + paths.classicApp, + 'app', + 'components/template-only.hbs', + ); + let corrected = fixFilename(file); + + expect(corrected).to.equal( + path.join(paths.classicApp, 'app/components/template-only.hbs'), + ); + }); + + it('works with classic paths (w/ module name)', () => { + let file = path.join( + paths.classicApp, + 'classic-app', + 'components/template-only.hbs', + ); + let corrected = fixFilename(file); + + expect(corrected).to.equal( + path.join(paths.classicApp, 'app/components/template-only.hbs'), + ); + }); +}); diff --git a/package.json b/package.json index 8fb83d9e..55a01421 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ ] }, "overrides": { - "babel-plugin-ember-template-compilation": "2.2.1", + "babel-plugin-ember-template-compilation": "^2.2.5", "@glimmer/validator": "0.84.3", "@types/eslint": "^8.0.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4a86efd3..ff0b9508 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - babel-plugin-ember-template-compilation: 2.2.1 + babel-plugin-ember-template-compilation: ^2.2.5 '@glimmer/validator': 0.84.3 '@types/eslint': ^8.0.0 @@ -177,6 +177,9 @@ importers: broccoli-asset-rev: specifier: ^3.0.0 version: 3.0.0 + broccoli-stew: + specifier: ^3.0.0 + version: 3.0.0 concurrently: specifier: ^8.2.2 version: 8.2.2 @@ -341,8 +344,8 @@ importers: specifier: github:mainmatter/ember-style-loader#main version: https://codeload.github.com/mainmatter/ember-style-loader/tar.gz/5d262a1671a9354312a376d70df220289b8b3330 ember-template-imports: - specifier: ^3.4.2 - version: 3.4.2 + specifier: ^4.1.1 + version: 4.1.1 ember-template-lint: specifier: ^6.0.0 version: 6.0.0 @@ -383,136 +386,6 @@ importers: specifier: ^5.91.0 version: 5.91.0 - test-apps/classic-app-2024-05: - dependencies: - ember-resources: - specifier: ^6.4.0 - version: 6.5.1(@ember/test-waiters@3.1.0)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glimmer/tracking@1.1.2)(@glint/template@1.4.0)(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0)) - devDependencies: - '@ember/optional-features': - specifier: ^2.0.0 - version: 2.1.0 - '@ember/string': - specifier: ^3.0.1 - version: 3.1.1 - '@ember/test-helpers': - specifier: ^3.2.0 - version: 3.3.0(@glint/template@1.4.0)(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0))(webpack@5.91.0) - '@glimmer/component': - specifier: ^1.1.2 - version: 1.1.2(@babel/core@7.24.5) - '@glimmer/tracking': - specifier: ^1.1.2 - version: 1.1.2 - '@nullvoxpopuli/eslint-configs': - specifier: ^4.0.0 - version: 4.0.0(@babel/core@7.24.5)(@babel/eslint-parser@7.24.5(@babel/core@7.24.5)(eslint@8.57.0))(@babel/plugin-proposal-decorators@7.24.1(@babel/core@7.24.5))(@types/eslint@8.56.10)(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint-plugin-ember@12.1.1(@babel/core@7.24.5)(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint-plugin-qunit@8.1.1(eslint@8.57.0))(eslint@8.57.0)(prettier@3.2.5)(typescript@5.4.5) - broccoli-asset-rev: - specifier: ^3.0.0 - version: 3.0.0 - concurrently: - specifier: ^8.2.1 - version: 8.2.2 - ember-auto-import: - specifier: 2.7.2 - version: 2.7.2(@glint/template@1.4.0)(webpack@5.91.0) - ember-cli: - specifier: ~5.8.1 - version: 5.8.1(handlebars@4.7.8)(underscore@1.13.6) - ember-cli-app-version: - specifier: ^6.0.0 - version: 6.0.1(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0)) - ember-cli-babel: - specifier: ^8.2.0 - version: 8.2.0(@babel/core@7.24.5) - ember-cli-dependency-checker: - specifier: ^3.3.1 - version: 3.3.2(ember-cli@5.8.1(handlebars@4.7.8)(underscore@1.13.6)) - ember-cli-htmlbars: - specifier: ^6.3.0 - version: 6.3.0 - ember-cli-inject-live-reload: - specifier: ^2.1.0 - version: 2.1.0 - ember-cli-sri: - specifier: ^2.1.1 - version: 2.1.1 - ember-cli-terser: - specifier: ^4.0.2 - version: 4.0.2 - ember-css-modules: - specifier: ^2.0.1 - version: 2.1.0 - ember-fetch: - specifier: ^8.1.2 - version: 8.1.2(encoding@0.1.13) - ember-load-initializers: - specifier: ^2.1.2 - version: 2.1.2(@babel/core@7.24.5) - ember-page-title: - specifier: ^8.2.3 - version: 8.2.3(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0)) - ember-qunit: - specifier: ^8.0.2 - version: 8.0.2(@ember/test-helpers@3.3.0(@glint/template@1.4.0)(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0))(webpack@5.91.0))(@glint/template@1.4.0)(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0))(qunit@2.20.1) - ember-resolver: - specifier: ^11.0.0 - version: 11.0.1(ember-source@5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0)) - ember-scoped-css: - specifier: workspace:* - version: link:../../ember-scoped-css - ember-scoped-css-compat: - specifier: workspace:* - version: link:../../ember-scoped-css-compat - ember-source: - specifier: ~5.8.0 - version: 5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0) - ember-style-loader: - specifier: github:mainmatter/ember-style-loader#main - version: https://codeload.github.com/mainmatter/ember-style-loader/tar.gz/5d262a1671a9354312a376d70df220289b8b3330 - ember-template-imports: - specifier: ^4.1.1 - version: 4.1.1 - ember-template-lint: - specifier: ^6.0.0 - version: 6.0.0 - eslint: - specifier: ^8.50.0 - version: 8.57.0 - eslint-plugin-ember: - specifier: ^12.0.2 - version: 12.1.1(@babel/core@7.24.5)(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0) - eslint-plugin-n: - specifier: ^17.6.0 - version: 17.7.0(eslint@8.57.0) - eslint-plugin-qunit: - specifier: ^8.1.1 - version: 8.1.1(eslint@8.57.0) - loader.js: - specifier: ^4.7.0 - version: 4.7.0 - prettier: - specifier: ^3.2.5 - version: 3.2.5 - qunit: - specifier: ^2.20.1 - version: 2.20.1 - qunit-dom: - specifier: ^3.1.2 - version: 3.1.2 - tracked-built-ins: - specifier: ^3.1.0 - version: 3.3.0 - v2-addon: - specifier: workspace:* - version: link:../v2-addon - v2-addon-ts: - specifier: workspace:* - version: link:../v2-addon-ts - webpack: - specifier: ^5.91.0 - version: 5.91.0 - test-apps/embroider-app: devDependencies: '@ember/optional-features': @@ -605,6 +478,9 @@ importers: ember-scoped-css: specifier: workspace:* version: link:../../ember-scoped-css + ember-scoped-css-compat: + specifier: workspace:^ + version: link:../../ember-scoped-css-compat ember-source: specifier: ~5.8.0 version: 5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0) @@ -615,8 +491,8 @@ importers: specifier: github:mainmatter/ember-style-loader#main version: https://codeload.github.com/mainmatter/ember-style-loader/tar.gz/5d262a1671a9354312a376d70df220289b8b3330 ember-template-imports: - specifier: ^3.4.2 - version: 3.4.2 + specifier: ^4.1.1 + version: 4.1.1 ember-template-lint: specifier: ^6.0.0 version: 6.0.0 @@ -884,6 +760,9 @@ importers: ember-scoped-css: specifier: workspace:^ version: link:../../ember-scoped-css + ember-scoped-css-compat: + specifier: workspace:^ + version: link:../../ember-scoped-css-compat ember-source: specifier: ~5.8.0 version: 5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0) @@ -967,8 +846,8 @@ importers: specifier: ^6.0.4 version: 6.0.4(@babel/core@7.24.5)(rollup@4.17.2) babel-plugin-ember-template-compilation: - specifier: 2.2.1 - version: 2.2.1 + specifier: ^2.2.5 + version: 2.2.5 compare-fixture: specifier: ^1.0.1 version: 1.1.2 @@ -3640,8 +3519,8 @@ packages: resolution: {integrity: sha512-pJajN/DkQUnStw0Az8c6khVcMQHgzqWr61lLNtVeu0g61LRW0k9jyK7vaedrHDWGe/Qe8sxG5wpiyW9NsMqFzA==} engines: {node: 6.* || 8.* || >= 10.*} - babel-plugin-ember-template-compilation@2.2.1: - resolution: {integrity: sha512-alinprIQcLficqkuIyeKKfD4HQOpMOiHK6pt6Skj/yjoPoQYBuwAJ2BoPAlRe9k/URPeVkpMefbN3m6jEp7RsA==} + babel-plugin-ember-template-compilation@2.2.5: + resolution: {integrity: sha512-NQ2DT0DsYyHVrEpFQIy2U8S91JaKSE8NOSZzMd7KZFJVgA6KodJq3Uj852HcH9LsSfvwppnM+dRo1G8bzTnnFw==} engines: {node: '>= 12.*'} babel-plugin-filter-imports@4.0.0: @@ -11001,7 +10880,7 @@ snapshots: '@types/yargs': 17.0.32 assert-never: 1.2.1 babel-import-util: 2.1.1 - babel-plugin-ember-template-compilation: 2.2.1 + babel-plugin-ember-template-compilation: 2.2.5 babel-plugin-syntax-dynamic-import: 6.18.0 babylon: 6.18.0 bind-decorator: 1.0.11 @@ -11045,7 +10924,7 @@ snapshots: '@embroider/macros': 1.16.1(@glint/template@1.4.0) '@embroider/shared-internals': 2.6.0 assert-never: 1.2.1 - babel-plugin-ember-template-compilation: 2.2.1 + babel-plugin-ember-template-compilation: 2.2.5 broccoli-node-api: 1.7.0 broccoli-persistent-filter: 3.1.3 broccoli-plugin: 4.0.7 @@ -12935,10 +12814,10 @@ snapshots: dependencies: ember-rfc176-data: 0.3.18 - babel-plugin-ember-template-compilation@2.2.1: + babel-plugin-ember-template-compilation@2.2.5: dependencies: '@glimmer/syntax': 0.84.3 - babel-import-util: 2.1.1 + babel-import-util: 3.0.0 babel-plugin-filter-imports@4.0.0: dependencies: @@ -14365,7 +14244,7 @@ snapshots: '@embroider/shared-internals': 2.6.0 babel-loader: 8.3.0(@babel/core@7.24.5)(webpack@5.91.0(esbuild@0.21.3)) babel-plugin-ember-modules-api-polyfill: 3.5.0 - babel-plugin-ember-template-compilation: 2.2.1 + babel-plugin-ember-template-compilation: 2.2.5 babel-plugin-htmlbars-inline-precompile: 5.3.1 babel-plugin-syntax-dynamic-import: 6.18.0 broccoli-debug: 0.6.5 @@ -14406,7 +14285,7 @@ snapshots: '@embroider/shared-internals': 2.6.0 babel-loader: 8.3.0(@babel/core@7.24.5)(webpack@5.91.0) babel-plugin-ember-modules-api-polyfill: 3.5.0 - babel-plugin-ember-template-compilation: 2.2.1 + babel-plugin-ember-template-compilation: 2.2.5 babel-plugin-htmlbars-inline-precompile: 5.3.1 babel-plugin-syntax-dynamic-import: 6.18.0 broccoli-debug: 0.6.5 @@ -14582,7 +14461,7 @@ snapshots: ember-cli-htmlbars@6.3.0: dependencies: '@ember/edition-utils': 1.2.0 - babel-plugin-ember-template-compilation: 2.2.1 + babel-plugin-ember-template-compilation: 2.2.5 babel-plugin-htmlbars-inline-precompile: 5.3.1 broccoli-debug: 0.6.5 broccoli-persistent-filter: 3.1.3 @@ -15071,7 +14950,7 @@ snapshots: '@glimmer/vm-babel-plugins': 0.87.1(@babel/core@7.24.5) '@simple-dom/interface': 1.4.0 babel-plugin-debug-macros: 0.3.4(@babel/core@7.24.5) - babel-plugin-ember-template-compilation: 2.2.1 + babel-plugin-ember-template-compilation: 2.2.5 babel-plugin-filter-imports: 4.0.0 backburner.js: 2.8.0 broccoli-concat: 4.2.5 @@ -15127,7 +15006,7 @@ snapshots: '@glimmer/vm-babel-plugins': 0.87.1(@babel/core@7.24.5) '@simple-dom/interface': 1.4.0 babel-plugin-debug-macros: 0.3.4(@babel/core@7.24.5) - babel-plugin-ember-template-compilation: 2.2.1 + babel-plugin-ember-template-compilation: 2.2.5 babel-plugin-filter-imports: 4.0.0 backburner.js: 2.8.0 broccoli-concat: 4.2.5 diff --git a/test-apps/classic-app-2024-05/.editorconfig b/test-apps/classic-app-2024-05/.editorconfig deleted file mode 100644 index c35a0024..00000000 --- a/test-apps/classic-app-2024-05/.editorconfig +++ /dev/null @@ -1,19 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.hbs] -insert_final_newline = false - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/test-apps/classic-app-2024-05/.ember-cli b/test-apps/classic-app-2024-05/.ember-cli deleted file mode 100644 index 8c1812cf..00000000 --- a/test-apps/classic-app-2024-05/.ember-cli +++ /dev/null @@ -1,15 +0,0 @@ -{ - /** - Ember CLI sends analytics information by default. The data is completely - anonymous, but there are times when you might want to disable this behavior. - - Setting `disableAnalytics` to true will prevent any data from being sent. - */ - "disableAnalytics": false, - - /** - Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript - rather than JavaScript by default, when a TypeScript version of a given blueprint is available. - */ - "isTypeScriptProject": false -} diff --git a/test-apps/classic-app-2024-05/.eslintignore b/test-apps/classic-app-2024-05/.eslintignore deleted file mode 100644 index d474a40b..00000000 --- a/test-apps/classic-app-2024-05/.eslintignore +++ /dev/null @@ -1,25 +0,0 @@ -# unconventional js -/blueprints/*/files/ -/vendor/ - -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/coverage/ -!.* -.*/ -.eslintcache - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try diff --git a/test-apps/classic-app-2024-05/.eslintrc.js b/test-apps/classic-app-2024-05/.eslintrc.js deleted file mode 100644 index 74e643bb..00000000 --- a/test-apps/classic-app-2024-05/.eslintrc.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const { configs } = require('@nullvoxpopuli/eslint-configs'); - -const ember = configs.ember(); - -// accommodates: JS, TS, App, Addon, and V2 Addon -module.exports = { - overrides: [ - ...ember.overrides, - { - files: ['**/*.gts'], - plugins: ['ember'], - parser: 'ember-eslint-parser', - }, - { - files: ['**/*.gjs'], - plugins: ['ember'], - parser: 'ember-eslint-parser', - }, - { - files: ['*.{cjs,js}'], - rules: { - 'n/no-unsupported-syntax': 'off', - 'n/no-unsupported-features': 'off', - }, - }, - ], -}; diff --git a/test-apps/classic-app-2024-05/.github/workflows/ci.yml b/test-apps/classic-app-2024-05/.github/workflows/ci.yml deleted file mode 100644 index e7266de6..00000000 --- a/test-apps/classic-app-2024-05/.github/workflows/ci.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: CI - -on: - push: - branches: - - main - - master - pull_request: {} - -concurrency: - group: ci-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -jobs: - lint: - name: "Lint" - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - uses: actions/checkout@v4 - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: 14.x - cache: npm - - name: Install Dependencies - run: npm ci - - name: Lint - run: npm run lint - - test: - name: "Test" - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - uses: actions/checkout@v4 - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: 14.x - cache: npm - - name: Install Dependencies - run: npm ci - - name: Run Tests - run: npm test diff --git a/test-apps/classic-app-2024-05/.gitignore b/test-apps/classic-app-2024-05/.gitignore deleted file mode 100644 index f1e859b2..00000000 --- a/test-apps/classic-app-2024-05/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/.eslintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/test-apps/classic-app-2024-05/.prettierignore b/test-apps/classic-app-2024-05/.prettierignore deleted file mode 100644 index 4178fd57..00000000 --- a/test-apps/classic-app-2024-05/.prettierignore +++ /dev/null @@ -1,25 +0,0 @@ -# unconventional js -/blueprints/*/files/ -/vendor/ - -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/coverage/ -!.* -.eslintcache -.lint-todo/ - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try diff --git a/test-apps/classic-app-2024-05/.prettierrc.js b/test-apps/classic-app-2024-05/.prettierrc.js deleted file mode 100644 index 324b444b..00000000 --- a/test-apps/classic-app-2024-05/.prettierrc.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = { - overrides: [ - { - files: '*.{js,ts,cjs,mjs,mts,cts,gts.gjs}', - options: { - singleQuote: true, - }, - }, - ], -}; diff --git a/test-apps/classic-app-2024-05/.template-lintrc.js b/test-apps/classic-app-2024-05/.template-lintrc.js deleted file mode 100644 index f35f61c7..00000000 --- a/test-apps/classic-app-2024-05/.template-lintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = { - extends: 'recommended', -}; diff --git a/test-apps/classic-app-2024-05/.watchmanconfig b/test-apps/classic-app-2024-05/.watchmanconfig deleted file mode 100644 index e7834e3e..00000000 --- a/test-apps/classic-app-2024-05/.watchmanconfig +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignore_dirs": ["tmp", "dist"] -} diff --git a/test-apps/classic-app-2024-05/README.md b/test-apps/classic-app-2024-05/README.md deleted file mode 100644 index 7e451b1f..00000000 --- a/test-apps/classic-app-2024-05/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# classic-app-2024-05 - -This README outlines the details of collaborating on this Ember application. -A short introduction of this app could easily go here. - -## Prerequisites - -You will need the following things properly installed on your computer. - -- [Git](https://git-scm.com/) -- [Node.js](https://nodejs.org/) (with npm) -- [Ember CLI](https://cli.emberjs.com/release/) -- [Google Chrome](https://google.com/chrome/) - -## Installation - -- `git clone ` this repository -- `cd classic-app-2024-05` -- `npm install` - -## Running / Development - -- `ember serve` -- Visit your app at [http://localhost:4200](http://localhost:4200). -- Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests). - -### Code Generators - -Make use of the many generators for code, try `ember help generate` for more details - -### Running Tests - -- `ember test` -- `ember test --server` - -### Linting - -- `npm run lint` -- `npm run lint:fix` - -### Building - -- `ember build` (development) -- `ember build --environment production` (production) - -### Deploying - -Specify what it takes to deploy your app. - -## Further Reading / Useful Links - -- [ember.js](https://emberjs.com/) -- [ember-cli](https://cli.emberjs.com/release/) -- Development Browser Extensions - - [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) - - [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) diff --git a/test-apps/classic-app-2024-05/app/app.js b/test-apps/classic-app-2024-05/app/app.js deleted file mode 100644 index 6aebd923..00000000 --- a/test-apps/classic-app-2024-05/app/app.js +++ /dev/null @@ -1,13 +0,0 @@ -import Application from '@ember/application'; - -import config from 'classic-app-2024-05/config/environment'; -import loadInitializers from 'ember-load-initializers'; -import Resolver from 'ember-resolver'; - -export default class App extends Application { - modulePrefix = config.modulePrefix; - podModulePrefix = config.podModulePrefix; - Resolver = Resolver; -} - -loadInitializers(App, config.modulePrefix); diff --git a/test-apps/classic-app-2024-05/app/components/.gitkeep b/test-apps/classic-app-2024-05/app/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/classic-app-2024-05/app/components/component-at-class.css b/test-apps/classic-app-2024-05/app/components/component-at-class.css deleted file mode 100644 index 989f5201..00000000 --- a/test-apps/classic-app-2024-05/app/components/component-at-class.css +++ /dev/null @@ -1,3 +0,0 @@ -.text-color { - color: #0000ff !important; -} diff --git a/test-apps/classic-app-2024-05/app/components/component-at-class.hbs b/test-apps/classic-app-2024-05/app/components/component-at-class.hbs deleted file mode 100644 index ab7bcd22..00000000 --- a/test-apps/classic-app-2024-05/app/components/component-at-class.hbs +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/dynamic-attribute.css b/test-apps/classic-app-2024-05/app/components/dynamic-attribute.css deleted file mode 100644 index 38274625..00000000 --- a/test-apps/classic-app-2024-05/app/components/dynamic-attribute.css +++ /dev/null @@ -1,7 +0,0 @@ -.is-foo { - color: blue; -} - -.is-not-foo { - color: red; -} diff --git a/test-apps/classic-app-2024-05/app/components/dynamic-attribute.hbs b/test-apps/classic-app-2024-05/app/components/dynamic-attribute.hbs deleted file mode 100644 index 1ad6416d..00000000 --- a/test-apps/classic-app-2024-05/app/components/dynamic-attribute.hbs +++ /dev/null @@ -1,3 +0,0 @@ -
- dynamic attribute -
\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/face.hbs b/test-apps/classic-app-2024-05/app/components/face.hbs deleted file mode 100644 index c9521fe0..00000000 --- a/test-apps/classic-app-2024-05/app/components/face.hbs +++ /dev/null @@ -1,3 +0,0 @@ -

- ember-css-modules -

\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/face.module.css b/test-apps/classic-app-2024-05/app/components/face.module.css deleted file mode 100644 index b58cc07a..00000000 --- a/test-apps/classic-app-2024-05/app/components/face.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.some-class { - color: red; -} diff --git a/test-apps/classic-app-2024-05/app/components/has-at-class.hbs b/test-apps/classic-app-2024-05/app/components/has-at-class.hbs deleted file mode 100644 index 15c58269..00000000 --- a/test-apps/classic-app-2024-05/app/components/has-at-class.hbs +++ /dev/null @@ -1 +0,0 @@ -

some text

\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/header.css b/test-apps/classic-app-2024-05/app/components/header.css deleted file mode 100644 index aa8e210f..00000000 --- a/test-apps/classic-app-2024-05/app/components/header.css +++ /dev/null @@ -1,3 +0,0 @@ -.test-header { - color: rgb(255, 0, 0); -} diff --git a/test-apps/classic-app-2024-05/app/components/header.hbs b/test-apps/classic-app-2024-05/app/components/header.hbs deleted file mode 100644 index f23e7cbd..00000000 --- a/test-apps/classic-app-2024-05/app/components/header.hbs +++ /dev/null @@ -1,4 +0,0 @@ -

- ember-scoped-css - {{this.label}}.hbs -

\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/header.js b/test-apps/classic-app-2024-05/app/components/header.js deleted file mode 100644 index 2aa4d21f..00000000 --- a/test-apps/classic-app-2024-05/app/components/header.js +++ /dev/null @@ -1,6 +0,0 @@ -import Component from '@glimmer/component'; -import { tracked } from '@glimmer/tracking'; - -export default class Header extends Component { - @tracked label = 'header'; -} diff --git a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.css b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.css deleted file mode 100644 index 27feb503..00000000 --- a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.css +++ /dev/null @@ -1,3 +0,0 @@ -.text-color { - color: #337 !important; -} diff --git a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.gts b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.gts deleted file mode 100644 index 83baad01..00000000 --- a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/calls-has-at-class.gts +++ /dev/null @@ -1,7 +0,0 @@ -import { scopedClass } from 'ember-scoped-css'; - -import HasAtClass from './has-at-class'; - - diff --git a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/has-at-class.gts b/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/has-at-class.gts deleted file mode 100644 index 2dbf77bd..00000000 --- a/test-apps/classic-app-2024-05/app/components/in-app/at-class-ts/has-at-class.gts +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/test-apps/classic-app-2024-05/app/components/scoped.css b/test-apps/classic-app-2024-05/app/components/scoped.css deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/classic-app-2024-05/app/components/scoped.hbs b/test-apps/classic-app-2024-05/app/components/scoped.hbs deleted file mode 100644 index 75555490..00000000 --- a/test-apps/classic-app-2024-05/app/components/scoped.hbs +++ /dev/null @@ -1,6 +0,0 @@ -
- Component with scoped class helper -
\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/components/show-time.css b/test-apps/classic-app-2024-05/app/components/show-time.css deleted file mode 100644 index 2b4bb367..00000000 --- a/test-apps/classic-app-2024-05/app/components/show-time.css +++ /dev/null @@ -1,3 +0,0 @@ -h2 { - color: blue; -} diff --git a/test-apps/classic-app-2024-05/app/components/show-time.gjs b/test-apps/classic-app-2024-05/app/components/show-time.gjs deleted file mode 100644 index 4161a60d..00000000 --- a/test-apps/classic-app-2024-05/app/components/show-time.gjs +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/test-apps/classic-app-2024-05/app/components/subexpression.css b/test-apps/classic-app-2024-05/app/components/subexpression.css deleted file mode 100644 index 5a0ed9e8..00000000 --- a/test-apps/classic-app-2024-05/app/components/subexpression.css +++ /dev/null @@ -1,3 +0,0 @@ -.a-local-class { - color: blue; -} diff --git a/test-apps/classic-app-2024-05/app/components/subexpression.gjs b/test-apps/classic-app-2024-05/app/components/subexpression.gjs deleted file mode 100644 index 6c01fa6a..00000000 --- a/test-apps/classic-app-2024-05/app/components/subexpression.gjs +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/test-apps/classic-app-2024-05/app/components/template-only.css b/test-apps/classic-app-2024-05/app/components/template-only.css deleted file mode 100644 index 7a2b9b30..00000000 --- a/test-apps/classic-app-2024-05/app/components/template-only.css +++ /dev/null @@ -1,3 +0,0 @@ -.some-class { - color: blue; -} diff --git a/test-apps/classic-app-2024-05/app/components/template-only.hbs b/test-apps/classic-app-2024-05/app/components/template-only.hbs deleted file mode 100644 index cb25b72e..00000000 --- a/test-apps/classic-app-2024-05/app/components/template-only.hbs +++ /dev/null @@ -1 +0,0 @@ -
hi there
\ No newline at end of file diff --git a/test-apps/classic-app-2024-05/app/controllers/.gitkeep b/test-apps/classic-app-2024-05/app/controllers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/classic-app-2024-05/app/controllers/application.js b/test-apps/classic-app-2024-05/app/controllers/application.js deleted file mode 100644 index f036da2b..00000000 --- a/test-apps/classic-app-2024-05/app/controllers/application.js +++ /dev/null @@ -1,5 +0,0 @@ -import Controller from '@ember/controller'; - -export default class ApplicationController extends Controller { - time = new Date(); -} diff --git a/test-apps/classic-app-2024-05/app/helpers/.gitkeep b/test-apps/classic-app-2024-05/app/helpers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/classic-app-2024-05/app/index.html b/test-apps/classic-app-2024-05/app/index.html deleted file mode 100644 index c2bdd3dd..00000000 --- a/test-apps/classic-app-2024-05/app/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ClassicApp - - - - {{content-for "head"}} - - - - - {{content-for "head-footer"}} - - - {{content-for "body"}} - - - - - {{content-for "body-footer"}} - - diff --git a/test-apps/classic-app-2024-05/app/models/.gitkeep b/test-apps/classic-app-2024-05/app/models/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/classic-app-2024-05/app/router.js b/test-apps/classic-app-2024-05/app/router.js deleted file mode 100644 index 59d1863e..00000000 --- a/test-apps/classic-app-2024-05/app/router.js +++ /dev/null @@ -1,10 +0,0 @@ -import EmberRouter from '@ember/routing/router'; - -import config from 'classic-app-2024-05/config/environment'; - -export default class Router extends EmberRouter { - location = config.locationType; - rootURL = config.rootURL; -} - -Router.map(function () {}); diff --git a/test-apps/classic-app-2024-05/app/routes/.gitkeep b/test-apps/classic-app-2024-05/app/routes/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/classic-app-2024-05/app/styles/app.css b/test-apps/classic-app-2024-05/app/styles/app.css deleted file mode 100644 index ce778bb1..00000000 --- a/test-apps/classic-app-2024-05/app/styles/app.css +++ /dev/null @@ -1,7 +0,0 @@ -p { - color: green; -} - -.test-class-app { - color: blue; -} diff --git a/test-apps/classic-app-2024-05/app/templates/application.hbs b/test-apps/classic-app-2024-05/app/templates/application.hbs deleted file mode 100644 index ddd5dae8..00000000 --- a/test-apps/classic-app-2024-05/app/templates/application.hbs +++ /dev/null @@ -1,13 +0,0 @@ -{{page-title "ClassicApp"}} - -

- {{this.time}} -

- - -
- - - - -{{outlet}} \ No newline at end of file diff --git a/test-apps/classic-app-2024-05/config/ember-cli-update.json b/test-apps/classic-app-2024-05/config/ember-cli-update.json deleted file mode 100644 index 18c4b7b9..00000000 --- a/test-apps/classic-app-2024-05/config/ember-cli-update.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "schemaVersion": "1.0.0", - "packages": [ - { - "name": "ember-cli", - "version": "4.10.0", - "blueprints": [ - { - "name": "app", - "outputRepo": "https://github.com/ember-cli/ember-new-output", - "codemodsSource": "ember-app-codemods-manifest@1", - "isBaseBlueprint": true, - "options": ["--ci-provider=github"] - } - ] - } - ] -} diff --git a/test-apps/classic-app-2024-05/config/environment.js b/test-apps/classic-app-2024-05/config/environment.js deleted file mode 100644 index 21d86af4..00000000 --- a/test-apps/classic-app-2024-05/config/environment.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -module.exports = function (environment) { - const ENV = { - modulePrefix: 'classic-app-2024-05', - environment, - rootURL: '/', - locationType: 'history', - EmberENV: { - EXTEND_PROTOTYPES: false, - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true - }, - }, - - APP: { - // Here you can pass flags/options to your application instance - // when it is created - }, - }; - - if (environment === 'development') { - // ENV.APP.LOG_RESOLVER = true; - // ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - // ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - // Testem prefers this... - ENV.locationType = 'none'; - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - ENV.APP.autoboot = false; - } - - if (environment === 'production') { - // here you can enable a production-specific feature - } - - return ENV; -}; diff --git a/test-apps/classic-app-2024-05/config/optional-features.json b/test-apps/classic-app-2024-05/config/optional-features.json deleted file mode 100644 index b26286e2..00000000 --- a/test-apps/classic-app-2024-05/config/optional-features.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "application-template-wrapper": false, - "default-async-observers": true, - "jquery-integration": false, - "template-only-glimmer-components": true -} diff --git a/test-apps/classic-app-2024-05/config/targets.js b/test-apps/classic-app-2024-05/config/targets.js deleted file mode 100644 index 1e48e059..00000000 --- a/test-apps/classic-app-2024-05/config/targets.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const browsers = [ - 'last 1 Chrome versions', - 'last 1 Firefox versions', - 'last 1 Safari versions', -]; - -module.exports = { - browsers, -}; diff --git a/test-apps/classic-app-2024-05/ember-cli-build.js b/test-apps/classic-app-2024-05/ember-cli-build.js deleted file mode 100644 index f355eeee..00000000 --- a/test-apps/classic-app-2024-05/ember-cli-build.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -const EmberApp = require('ember-cli/lib/broccoli/ember-app'); - -module.exports = function (defaults) { - const app = new EmberApp(defaults, { - // name: 'classic-app-2024-05', - cssModules: { - extension: 'module.css', - }, - 'ember-cli-babel': { - enableTypeScriptTransform: true, - }, - 'ember-scoped-css': { - layerName: 'classic-app-2024-05-layer', - }, - }); - - // Use `app.import` to add additional libraries to the generated - // output files. - // - // If you need to use different assets in different - // environments, specify an object as the first parameter. That - // object's keys should be the environment name and the values - // should be the asset to use in that environment. - // - // If the library that you are including contains AMD or ES6 - // modules that you would like to import into your application - // please specify an object with the list of modules as keys - // along with the exports of each module as its value. - - app.import('node_modules/v2-addon/dist/scoped.css'); - - return app.toTree(); -}; diff --git a/test-apps/classic-app-2024-05/package.json b/test-apps/classic-app-2024-05/package.json deleted file mode 100644 index 78c45041..00000000 --- a/test-apps/classic-app-2024-05/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "classic-app-2024-05", - "version": "0.0.0", - "private": true, - "description": "Small description for classic-app-2024-05 goes here", - "repository": "", - "license": "MIT", - "author": "", - "directories": { - "doc": "doc", - "test": "tests" - }, - "scripts": { - "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", - "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"", - "lint:hbs": "ember-template-lint .", - "lint:hbs:fix": "ember-template-lint . --fix", - "lint:js": "eslint . --cache --ignore-pattern \"**/*.gjs\"", - "lint:js:fix": "eslint . --fix", - "lint:prettier:fix": "prettier . -w", - "lint:prettier": "prettier . -c", - "start": "ember serve", - "test": "pnpm test:ember --test-port 0", - "test:ember": "ember test" - }, - "devDependencies": { - "@ember/optional-features": "^2.0.0", - "@ember/string": "^3.0.1", - "@ember/test-helpers": "^3.2.0", - "@glimmer/component": "^1.1.2", - "@glimmer/tracking": "^1.1.2", - "@nullvoxpopuli/eslint-configs": "^4.0.0", - "broccoli-asset-rev": "^3.0.0", - "concurrently": "^8.2.1", - "ember-auto-import": "2.7.2", - "ember-cli": "~5.8.1", - "ember-cli-app-version": "^6.0.0", - "ember-cli-babel": "^8.2.0", - "ember-cli-dependency-checker": "^3.3.1", - "ember-cli-htmlbars": "^6.3.0", - "ember-cli-inject-live-reload": "^2.1.0", - "ember-cli-sri": "^2.1.1", - "ember-cli-terser": "^4.0.2", - "ember-css-modules": "^2.0.1", - "ember-fetch": "^8.1.2", - "ember-load-initializers": "^2.1.2", - "ember-page-title": "^8.2.3", - "ember-qunit": "^8.0.2", - "ember-resolver": "^11.0.0", - "ember-scoped-css": "workspace:*", - "ember-scoped-css-compat": "workspace:*", - "ember-source": "~5.8.0", - "ember-style-loader": "github:mainmatter/ember-style-loader#main", - "ember-template-imports": "^4.1.1", - "ember-template-lint": "^6.0.0", - "eslint": "^8.50.0", - "eslint-plugin-ember": "^12.0.2", - "eslint-plugin-n": "^17.6.0", - "eslint-plugin-qunit": "^8.1.1", - "loader.js": "^4.7.0", - "prettier": "^3.2.5", - "qunit": "^2.20.1", - "qunit-dom": "^3.1.2", - "tracked-built-ins": "^3.1.0", - "v2-addon": "workspace:*", - "v2-addon-ts": "workspace:*", - "webpack": "^5.91.0" - }, - "engines": { - "node": "14.* || 16.* || >= 18" - }, - "ember": { - "edition": "octane" - }, - "dependencies": { - "ember-resources": "^6.4.0" - } -} diff --git a/test-apps/classic-app-2024-05/public/robots.txt b/test-apps/classic-app-2024-05/public/robots.txt deleted file mode 100644 index f5916452..00000000 --- a/test-apps/classic-app-2024-05/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# http://www.robotstxt.org -User-agent: * -Disallow: diff --git a/test-apps/classic-app-2024-05/testem.js b/test-apps/classic-app-2024-05/testem.js deleted file mode 100644 index ed2f3712..00000000 --- a/test-apps/classic-app-2024-05/testem.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -module.exports = { - test_page: 'tests/index.html?hidepassed', - disable_watching: true, - launch_in_ci: ['Chrome'], - launch_in_dev: ['Chrome'], - browser_start_timeout: 120, - browser_args: { - Chrome: { - ci: [ - // --no-sandbox is needed when running Chrome inside a container - process.env.CI ? '--no-sandbox' : null, - '--headless', - '--disable-dev-shm-usage', - '--disable-software-rasterizer', - '--mute-audio', - '--remote-debugging-port=0', - '--window-size=1440,900', - ].filter(Boolean), - }, - }, -}; diff --git a/test-apps/classic-app-2024-05/tests/helpers/index.js b/test-apps/classic-app-2024-05/tests/helpers/index.js deleted file mode 100644 index 7f70de80..00000000 --- a/test-apps/classic-app-2024-05/tests/helpers/index.js +++ /dev/null @@ -1,42 +0,0 @@ -import { - setupApplicationTest as upstreamSetupApplicationTest, - setupRenderingTest as upstreamSetupRenderingTest, - setupTest as upstreamSetupTest, -} from 'ember-qunit'; - -// This file exists to provide wrappers around ember-qunit's / ember-mocha's -// test setup functions. This way, you can easily extend the setup that is -// needed per test type. - -function setupApplicationTest(hooks, options) { - upstreamSetupApplicationTest(hooks, options); - - // Additional setup for application tests can be done here. - // - // For example, if you need an authenticated session for each - // application test, you could do: - // - // hooks.beforeEach(async function () { - // await authenticateSession(); // ember-simple-auth - // }); - // - // This is also a good place to call test setup functions coming - // from other addons: - // - // setupIntl(hooks); // ember-intl - // setupMirage(hooks); // ember-cli-mirage -} - -function setupRenderingTest(hooks, options) { - upstreamSetupRenderingTest(hooks, options); - - // Additional setup for rendering tests can be done here. -} - -function setupTest(hooks, options) { - upstreamSetupTest(hooks, options); - - // Additional setup for unit tests can be done here. -} - -export { setupApplicationTest, setupRenderingTest, setupTest }; diff --git a/test-apps/classic-app-2024-05/tests/index.html b/test-apps/classic-app-2024-05/tests/index.html deleted file mode 100644 index d1304879..00000000 --- a/test-apps/classic-app-2024-05/tests/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - ClassicApp Tests - - - - {{content-for "head"}} {{content-for "test-head"}} - - - - - - {{content-for "head-footer"}} {{content-for "test-head-footer"}} - - - {{content-for "body"}} {{content-for "test-body"}} - -
-
-
-
-
-
- - - - - - - - {{content-for "body-footer"}} {{content-for "test-body-footer"}} - - diff --git a/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs deleted file mode 100644 index 297d59d2..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/at-class-test.gjs +++ /dev/null @@ -1,40 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import ComponentAtClass from 'classic-app-2024-05/components/component-at-class'; -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - - -module('Integration | Component | @class', function (hooks) { - setupRenderingTest(hooks); - - test('strict mode', async function (assert) { - await render( - ); - - assert - .dom('p') - .hasClass( - scopedClass('text-color', 'classic-app-2024-05/components/component-at-class') - ); - assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); - - test('loose mode', async function (assert) { - await render(hbs` - - `); - - assert - .dom('p') - .hasClass( - scopedClass('text-color', 'classic-app-2024-05/components/component-at-class') - ); - assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js b/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js deleted file mode 100644 index eed1c19e..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/dynamic-attribute-test.js +++ /dev/null @@ -1,30 +0,0 @@ -import { tracked } from '@glimmer/tracking'; -import { render, settled } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; - -module('Integration | Component | DynamicAttribute', function (hooks) { - setupRenderingTest(hooks); - - test('it has scoped class', async function (assert) { - class State { - @tracked ya = true; - } - - let state = new State(); - - this.setProperties({ state }); - await render(hbs``); - - assert.dom('div').hasClass('is-foo_efdf9ecfb'); - assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); - - state.ya = false; - await settled(); - - assert.dom('div').hasClass('is-not-foo_efdf9ecfb'); - assert.dom('div').hasStyle({ color: 'rgb(255, 0, 0)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs deleted file mode 100644 index 4449937a..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/at-class-test.gjs +++ /dev/null @@ -1,41 +0,0 @@ - -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; -import ComponentAtClass from 'v2-addon-ts/components/at-class-ts/component-at-class'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - - -module('[v2 Addon TS] Integration | Component | @class', function (hooks) { - setupRenderingTest(hooks); - - test('strict mode', async function (assert) { - await render( - ); - - assert - .dom('p') - .hasClass( - scopedClass('text-color', 'v2-addon-ts/components/at-class-ts/component-at-class') - ); - assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); - - test('loose mode', async function (assert) { - await render(hbs` - - `); - - assert - .dom('p') - .hasClass( - scopedClass('text-color', 'v2-addon-ts/components/at-class-ts/component-at-class') - ); - assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs deleted file mode 100644 index e3a2747c..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-class-test.gjs +++ /dev/null @@ -1,25 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; -import { StrictClass } from 'v2-addon-ts/components/strict-class'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - -module('[v2 Addon TS] Integration | Component | Strict class import', function (hooks) { - setupRenderingTest(hooks); - - test('strict mode', async function (assert) { - await render( - ); - - assert - .dom('div') - .hasClass( - scopedClass('hello-there', 'v2-addon-ts/components/strict-class') - ); - assert.dom('div').hasStyle({ color: 'rgb(1, 2, 3)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs deleted file mode 100644 index 6325fdaa..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/strict-test.gjs +++ /dev/null @@ -1,25 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; -import { Strict } from 'v2-addon-ts/components/strict'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - -module('[v2 Addon TS] Integration | Component | Strict import', function (hooks) { - setupRenderingTest(hooks); - - test('strict mode', async function (assert) { - await render( - ); - - assert - .dom('p') - .hasClass( - scopedClass('hi', 'v2-addon-ts/components/strict') - ); - assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js deleted file mode 100644 index caa8deb2..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon-ts/v2-addon-ts-with-a-class-test.js +++ /dev/null @@ -1,26 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - -module( - '[v2 Addon TS] Integration | Component | WithAClass from v2-addon-ts', - function (hooks) { - setupRenderingTest(hooks); - - test('it has scoped class', async function (assert) { - await render(hbs``); - - assert.dom('div').hasClass('greeting_efc49be66'); - assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); - assert - .dom('div') - .hasClass( - scopedClass('greeting', 'v2-addon-ts/components/with-a-class'), - ); - }); - }, -); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js deleted file mode 100644 index 37d76418..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/alert-from-v2-addon-test.js +++ /dev/null @@ -1,24 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - -module( - '[v2 Addon JS] Integration | Component | Alert from v2-addon', - function (hooks) { - setupRenderingTest(hooks); - - test('it has scoped class', async function (assert) { - await render(hbs``); - - assert.dom('p').hasClass('message_e4b9579df'); - assert.dom('p').hasStyle({ fontStyle: 'italic' }); - assert - .dom('p') - .hasClass(scopedClass('message', 'v2-addon/components/alert')); - }); - }, -); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs deleted file mode 100644 index e8df43c7..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/from-v2-addon/at-class-test.gjs +++ /dev/null @@ -1,41 +0,0 @@ - -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; -import ComponentAtClass from 'v2-addon/components/at-class/component-at-class'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - - -module('[v2 Addon JS] Integration | Component | @class', function (hooks) { - setupRenderingTest(hooks); - - test('strict mode', async function (assert) { - await render( - ); - - assert - .dom('p') - .hasClass( - scopedClass('text-color', 'v2-addon/components/at-class/component-at-class') - ); - assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); - - test('loose mode', async function (assert) { - await render(hbs` - - `); - - assert - .dom('p') - .hasClass( - scopedClass('text-color', 'v2-addon/components/at-class/component-at-class') - ); - assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/header-test.js b/test-apps/classic-app-2024-05/tests/integration/components/header-test.js deleted file mode 100644 index e80fa8da..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/header-test.js +++ /dev/null @@ -1,23 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - -module('Integration | Component | header', function (hooks) { - setupRenderingTest(hooks); - - test('it has scoped class', async function (assert) { - await render(hbs`
`); - - assert.dom('h1').hasClass('test-header_e784d3467'); - assert.dom('h1').hasStyle({ color: 'rgb(255, 0, 0)' }); - assert - .dom('h1') - .hasClass( - scopedClass('test-header', 'classic-app-2024-05/components/header'), - ); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts b/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts deleted file mode 100644 index f506a9e5..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/in-app/at-class-test.gts +++ /dev/null @@ -1,23 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; - -import CallsAtHasClass from 'classic-app-2024-05/components/in-app/at-class-ts/calls-has-at-class'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - -module('[In App] at-class-ts', function(hooks) { - setupRenderingTest(hooks); - - test('calls component with @class', async function(assert) { - await render( - - ); - - assert.dom('p').hasClass('text-color_e4912e7ba'); - assert.dom('p').hasClass(scopedClass('text-color', 'classic-app-2024-05/components/in-app/at-class-ts/calls-has-at-class')); - assert.dom('p').hasStyle({ color: 'rgb(51, 51, 119)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js b/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js deleted file mode 100644 index 7315f68d..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/scoped-test.js +++ /dev/null @@ -1,18 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; - -module('Integration | Component | scoped', function (hooks) { - setupRenderingTest(hooks); - - test('it replaces the scoped-class helper', async function (assert) { - await render(hbs``); - - assert.dom('div').hasAttribute('data-scoped-class', 'some-class_e80b6d598'); - assert - .dom('div') - .hasAttribute('data-scoped-class-2', 'some-class-2_e80b6d598'); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js b/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js deleted file mode 100644 index 852f1734..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/show-time-test.js +++ /dev/null @@ -1,16 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; - -module('Integration | Component | show-time', function (hooks) { - setupRenderingTest(hooks); - - test('it has scoped class', async function (assert) { - await render(hbs``); - - assert.dom('h2').hasClass('ed9ae5223'); - assert.dom('h2').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs b/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs deleted file mode 100644 index 5223c0e7..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/subexpression-test.gjs +++ /dev/null @@ -1,34 +0,0 @@ -import { render, settled } from '@ember/test-helpers'; -import { module, test } from 'qunit'; - -import SubExpression from 'classic-app-2024-05/components/subexpression'; -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; -import { cell } from 'ember-resources'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - -module('Integration | Component | subexpression', function (hooks) { - setupRenderingTest(hooks); - - test('it has scoped class', async function (assert) { - let cond = cell(false); - - await render( - ); - - assert.dom('div').hasClass('global-probably'); - - cond.current = true; - await settled(); - - - assert - .dom('div') - .hasClass( - scopedClass('a-local-class', 'classic-app-2024-05/components/subexpression') - ); - assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js b/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js deleted file mode 100644 index 573c6fd2..00000000 --- a/test-apps/classic-app-2024-05/tests/integration/components/template-only-test.js +++ /dev/null @@ -1,25 +0,0 @@ -import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import { module, test } from 'qunit'; - -import { setupRenderingTest } from 'classic-app-2024-05/tests/helpers'; - -import { scopedClass } from 'ember-scoped-css/test-support'; - -module('Integration | Component | template-only', function (hooks) { - setupRenderingTest(hooks); - - test('it has scoped class', async function (assert) { - await render(hbs``); - - assert - .dom('div') - .hasClass( - scopedClass( - 'some-class', - 'classic-app-2024-05/components/template-only', - ), - ); - assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); - }); -}); diff --git a/test-apps/classic-app-2024-05/tests/test-helper.js b/test-apps/classic-app-2024-05/tests/test-helper.js deleted file mode 100644 index 81afa86c..00000000 --- a/test-apps/classic-app-2024-05/tests/test-helper.js +++ /dev/null @@ -1,13 +0,0 @@ -import { setApplication } from '@ember/test-helpers'; -import * as QUnit from 'qunit'; -import { setup } from 'qunit-dom'; -import { start } from 'ember-qunit'; - -import Application from 'classic-app-2024-05/app'; -import config from 'classic-app-2024-05/config/environment'; - -setApplication(Application.create(config.APP)); - -setup(QUnit.assert); - -start(); diff --git a/test-apps/classic-app-2024-05/tests/unit/.gitkeep b/test-apps/classic-app-2024-05/tests/unit/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/classic-app/package.json b/test-apps/classic-app/package.json index a8e37590..134cc902 100644 --- a/test-apps/classic-app/package.json +++ b/test-apps/classic-app/package.json @@ -51,7 +51,7 @@ "ember-scoped-css-compat": "workspace:*", "ember-source": "~5.8.0", "ember-style-loader": "github:mainmatter/ember-style-loader#main", - "ember-template-imports": "^3.4.2", + "ember-template-imports": "^4.1.1", "ember-template-lint": "^6.0.0", "eslint": "^8.50.0", "eslint-plugin-ember": "^12.1.0", diff --git a/test-apps/embroider-app/ember-cli-build.js b/test-apps/embroider-app/ember-cli-build.js index e9d1239a..e9b59a44 100644 --- a/test-apps/embroider-app/ember-cli-build.js +++ b/test-apps/embroider-app/ember-cli-build.js @@ -3,12 +3,17 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = async function (defaults) { - const { appJsUnplugin } = await import('ember-scoped-css/build'); - const app = new EmberApp(defaults, { // autoImport: { // watchDependencies: ['v2-addon'], // }, + // We can't add a babel plugin here, because it runs too late. + // This is post-AMD transform. + // babel: { + // plugins: [ + // [require.resolve('ember-scoped-css/babel-plugin'), { layerName: 'embroider-app' }, 'configured'], + // ] + // } }); const { Webpack } = require('@embroider/webpack'); @@ -20,9 +25,7 @@ module.exports = async function (defaults) { }, ], packagerOptions: { - // css loaders for live reloading css webpackConfig: { - plugins: [appJsUnplugin.webpack({ appDir: __dirname })], module: { rules: [ // css loaders for production diff --git a/test-apps/embroider-app/package.json b/test-apps/embroider-app/package.json index b7af10fd..b743ac44 100644 --- a/test-apps/embroider-app/package.json +++ b/test-apps/embroider-app/package.json @@ -54,10 +54,11 @@ "ember-qunit": "^8.0.2", "ember-resolver": "^11.0.0", "ember-scoped-css": "workspace:*", + "ember-scoped-css-compat": "workspace:^", "ember-source": "~5.8.0", "ember-source-channel-url": "^3.0.0", "ember-style-loader": "github:mainmatter/ember-style-loader#main", - "ember-template-imports": "^3.4.2", + "ember-template-imports": "^4.1.1", "ember-template-lint": "^6.0.0", "ember-try": "^3.0.0", "eslint": "^8.50.0", diff --git a/test-apps/pods-embroider-app/ember-cli-build.js b/test-apps/pods-embroider-app/ember-cli-build.js index 4670f431..3989475c 100644 --- a/test-apps/pods-embroider-app/ember-cli-build.js +++ b/test-apps/pods-embroider-app/ember-cli-build.js @@ -3,8 +3,6 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = async function (defaults) { - const { appJsUnplugin } = await import('ember-scoped-css/build'); - const app = new EmberApp(defaults, { // autoImport: { // watchDependencies: ['v2-addon'], @@ -22,7 +20,6 @@ module.exports = async function (defaults) { packagerOptions: { // css loaders for live reloading css webpackConfig: { - plugins: [appJsUnplugin.webpack({ appDir: __dirname })], module: { rules: [ // css loaders for production diff --git a/test-apps/pods-embroider-app/package.json b/test-apps/pods-embroider-app/package.json index 35bd0e0c..9e055ce7 100644 --- a/test-apps/pods-embroider-app/package.json +++ b/test-apps/pods-embroider-app/package.json @@ -18,7 +18,7 @@ "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", "start": "ember serve", - "test": "echo 'Would run \"pnpm test:ember\", but we need a different approach for transforming templates under embroider (like a template-transpilation plugin, see: https://github.com/emberjs/babel-plugin-ember-template-compilation/#common-options)'", + "test": "pnpm test:ember", "test:ember": "ember test" }, "devDependencies": { @@ -50,6 +50,7 @@ "ember-qunit": "^8.0.2", "ember-resolver": "^11.0.1", "ember-scoped-css": "workspace:^", + "ember-scoped-css-compat": "workspace:^", "ember-source": "~5.8.0", "ember-template-lint": "^6.0.0", "eslint": "^8.49.0", diff --git a/test-apps/v2-addon-ts/fixtures/expected-dist/components/strict.js b/test-apps/v2-addon-ts/fixtures/expected-dist/components/strict.js index 4bf2a2a8..d976a5e8 100644 --- a/test-apps/v2-addon-ts/fixtures/expected-dist/components/strict.js +++ b/test-apps/v2-addon-ts/fixtures/expected-dist/components/strict.js @@ -6,11 +6,11 @@ import templateOnly from '@ember/component/template-only'; const noop = () => {}; const Strict = setComponentTemplate(precompileTemplate("\n

text color

\n {{!-- this button is part of the test to ensure we don't blow away this scope bag--}}\n \n", { + strictMode: true, scope: () => ({ on, noop - }), - strictMode: true + }) }), templateOnly()); export { Strict }; diff --git a/test-apps/v2-addon/package.json b/test-apps/v2-addon/package.json index 34b0394b..45d48f55 100644 --- a/test-apps/v2-addon/package.json +++ b/test-apps/v2-addon/package.json @@ -42,9 +42,10 @@ "@embroider/addon-dev": "^4.3.1", "@nullvoxpopuli/eslint-configs": "^4.0.0", "@rollup/plugin-babel": "^6.0.4", - "babel-plugin-ember-template-compilation": "2.2.1", + "babel-plugin-ember-template-compilation": "^2.2.1", "compare-fixture": "^1.0.1", "concurrently": "^8.2.2", + "decorator-transforms": "^1.2.1", "ember-scoped-css": "workspace:*", "ember-template-lint": "^6.0.0", "eslint": "^8.50.0", From 09ee2c7eab547ce6366a5e9ee344edcfe42b4747 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 21 May 2024 19:55:56 -0400 Subject: [PATCH 4/4] WIP: emborider approach may need to change entirely to be more like glimmer-scoped-css --- .../src/build/ember-classic-support.js | 24 +++- ember-scoped-css/src/lib/path/utils.js | 7 +- pnpm-lock.yaml | 124 +++++++----------- test-apps/embroider-app/ember-cli-build.js | 5 +- .../embroider-app/lib/scoped-compat/index.js | 13 ++ .../lib/scoped-compat/package.json | 6 + test-apps/embroider-app/package.json | 6 +- .../pods-embroider-app/ember-cli-build.js | 10 ++ test-apps/pods-embroider-app/package.json | 1 - 9 files changed, 112 insertions(+), 84 deletions(-) create mode 100644 test-apps/embroider-app/lib/scoped-compat/index.js create mode 100644 test-apps/embroider-app/lib/scoped-compat/package.json diff --git a/ember-scoped-css/src/build/ember-classic-support.js b/ember-scoped-css/src/build/ember-classic-support.js index a41cd940..b6a6dd9b 100644 --- a/ember-scoped-css/src/build/ember-classic-support.js +++ b/ember-scoped-css/src/build/ember-classic-support.js @@ -17,11 +17,33 @@ import { } from '../lib/path/utils.js'; import rewriteCss from '../lib/rewriteCss.js'; import rewriteHbs from '../lib/rewriteHbs.js'; +import { createPlugin } from './template-plugin.js'; const p = new Preprocessor(); const COMPONENT_EXTENSIONS = ['hbs', 'js', 'ts', 'gjs', 'gts']; const TEMPLATE_EXTENSIONS = ['hbs', 'gjs', 'gts']; +export function installScopedCSS(registry, options) { + registry.add('htmlbars-ast-plugin', buildASTPlugin(options)); +} + +export function buildASTPlugin(options) { + let plugin = createPlugin(options); + + return { + name: 'ember-scoped-css::template-plugin', + plugin, + baseDir: function () { + return __dirname; + }, + parallelBabel: { + requireFile: __filename, + buildUsing: 'buildASTPlugin', + params: {}, + }, + }; +} + class ScopedFilter extends Filter { constructor(componentsNode, options = {}) { super(componentsNode, options); @@ -235,8 +257,6 @@ export default class ScopedCssPreprocessor { ...(this.userOptions.additionalRoots || []).map( (root) => `${this.appName}/${root}`, ), - 'app/components/', - ...(this.userOptions.additionalRoots || []).map((root) => `app/${root}`), ]; let include = roots .map((root) => { diff --git a/ember-scoped-css/src/lib/path/utils.js b/ember-scoped-css/src/lib/path/utils.js index bbfad5c4..d9973dba 100644 --- a/ember-scoped-css/src/lib/path/utils.js +++ b/ember-scoped-css/src/lib/path/utils.js @@ -141,6 +141,8 @@ export function isRelevantFile(fileName, additionalRoots) { // These are already the bundled files. if (fileName.includes('/node_modules/.embroider/rewritten-app/assets/')) { + return false; + // not supported, never will be if ( fileName.endsWith( @@ -265,6 +267,7 @@ export function appPath(sourcePath) { } const CACHE = new Set(); +const cwd = process.cwd(); /** * For a given source path, if we have seen a @@ -273,7 +276,7 @@ const CACHE = new Set(); */ function hasSeen(sourcePath) { for (let entry of CACHE) { - if (sourcePath.startsWith(entry)) { + if (sourcePath.startsWith(entry) && cwd !== entry) { return entry; } } @@ -294,7 +297,7 @@ export function findWorkspacePath(sourcePath) { } const packageJsonPath = findUp.sync('package.json', { - cwd: path.dirname(sourcePath), + cwd: sourcePath, }); const workspacePath = path.dirname(packageJsonPath); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ff0b9508..45403c61 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -478,9 +478,6 @@ importers: ember-scoped-css: specifier: workspace:* version: link:../../ember-scoped-css - ember-scoped-css-compat: - specifier: workspace:^ - version: link:../../ember-scoped-css-compat ember-source: specifier: ~5.8.0 version: 5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0) @@ -760,9 +757,6 @@ importers: ember-scoped-css: specifier: workspace:^ version: link:../../ember-scoped-css - ember-scoped-css-compat: - specifier: workspace:^ - version: link:../../ember-scoped-css-compat ember-source: specifier: ~5.8.0 version: 5.8.0(@babel/core@7.24.5)(@glimmer/component@1.1.2(@babel/core@7.24.5))(@glint/template@1.4.0)(rsvp@4.8.5)(webpack@5.91.0) @@ -9106,13 +9100,13 @@ snapshots: '@babel/generator': 7.24.5 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-module-transforms': 7.24.5(@babel/core@7.24.5) - '@babel/helpers': 7.24.5 + '@babel/helpers': 7.24.5(supports-color@8.1.1) '@babel/parser': 7.24.5 '@babel/template': 7.24.0 - '@babel/traverse': 7.24.5 + '@babel/traverse': 7.24.5(supports-color@8.1.1) '@babel/types': 7.24.5 convert-source-map: 2.0.0 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -9234,7 +9228,7 @@ snapshots: '@babel/core': 7.24.5 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.24.5 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -9335,14 +9329,6 @@ snapshots: '@babel/template': 7.24.0 '@babel/types': 7.24.5 - '@babel/helpers@7.24.5': - dependencies: - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.5 - '@babel/types': 7.24.5 - transitivePeerDependencies: - - supports-color - '@babel/helpers@7.24.5(supports-color@8.1.1)': dependencies: '@babel/template': 7.24.0 @@ -10502,21 +10488,6 @@ snapshots: '@babel/parser': 7.24.5 '@babel/types': 7.24.5 - '@babel/traverse@7.24.5': - dependencies: - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.24.5 - '@babel/parser': 7.24.5 - '@babel/types': 7.24.5 - debug: 4.3.4(supports-color@9.4.0) - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - '@babel/traverse@7.24.5(supports-color@8.1.1)': dependencies: '@babel/code-frame': 7.24.2 @@ -10849,7 +10820,7 @@ snapshots: '@embroider/addon-shim@1.8.8': dependencies: - '@embroider/shared-internals': 2.6.0 + '@embroider/shared-internals': 2.6.0(supports-color@8.1.1) broccoli-funnel: 3.0.8 common-ancestor-path: 1.0.1 semver: 7.6.2 @@ -10873,7 +10844,7 @@ snapshots: '@babel/plugin-transform-runtime': 7.24.3(@babel/core@7.24.5) '@babel/preset-env': 7.24.5(@babel/core@7.24.5) '@babel/runtime': 7.24.5 - '@babel/traverse': 7.24.5 + '@babel/traverse': 7.24.5(supports-color@8.1.1) '@embroider/core': 3.4.9(@glint/template@1.4.0) '@embroider/macros': 1.16.1(@glint/template@1.4.0) '@types/babel__code-frame': 7.0.6 @@ -10893,12 +10864,12 @@ snapshots: broccoli-plugin: 4.0.7 broccoli-source: 3.0.1 chalk: 4.1.2 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) escape-string-regexp: 4.0.0 fast-sourcemap-concat: 1.4.0 fs-extra: 9.1.0 fs-tree-diff: 2.0.1 - jsdom: 16.7.0 + jsdom: 16.7.0(supports-color@8.1.1) lodash: 4.17.21 pkg-up: 3.1.0 resolve: 1.22.8 @@ -10920,23 +10891,23 @@ snapshots: dependencies: '@babel/core': 7.24.5 '@babel/parser': 7.24.5 - '@babel/traverse': 7.24.5 + '@babel/traverse': 7.24.5(supports-color@8.1.1) '@embroider/macros': 1.16.1(@glint/template@1.4.0) - '@embroider/shared-internals': 2.6.0 + '@embroider/shared-internals': 2.6.0(supports-color@8.1.1) assert-never: 1.2.1 babel-plugin-ember-template-compilation: 2.2.5 broccoli-node-api: 1.7.0 broccoli-persistent-filter: 3.1.3 broccoli-plugin: 4.0.7 broccoli-source: 3.0.1 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) fast-sourcemap-concat: 1.4.0 filesize: 10.1.2 fs-extra: 9.1.0 fs-tree-diff: 2.0.1 handlebars: 4.7.8 js-string-escape: 1.0.1 - jsdom: 16.7.0 + jsdom: 16.7.0(supports-color@8.1.1) lodash: 4.17.21 resolve: 1.22.8 resolve-package-path: 4.0.3 @@ -10956,7 +10927,7 @@ snapshots: '@embroider/macros@1.16.1(@glint/template@1.4.0)': dependencies: - '@embroider/shared-internals': 2.6.0 + '@embroider/shared-internals': 2.6.0(supports-color@8.1.1) assert-never: 1.2.1 babel-import-util: 2.1.1 ember-cli-babel: 7.26.11 @@ -10972,7 +10943,7 @@ snapshots: '@embroider/shared-internals@2.6.0': dependencies: babel-import-util: 2.1.1 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) ember-rfc176-data: 0.3.18 fs-extra: 9.1.0 js-string-escape: 1.0.1 @@ -11187,7 +11158,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -11458,7 +11429,7 @@ snapshots: '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -12269,7 +12240,7 @@ snapshots: '@typescript-eslint/types': 7.10.0 '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.10.0 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.57.0 optionalDependencies: typescript: 5.4.5 @@ -12285,7 +12256,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) '@typescript-eslint/utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: @@ -12299,7 +12270,7 @@ snapshots: dependencies: '@typescript-eslint/types': 7.10.0 '@typescript-eslint/visitor-keys': 7.10.0 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 @@ -12493,7 +12464,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -12717,7 +12688,7 @@ snapshots: async-disk-cache@2.1.0: dependencies: - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) heimdalljs: 0.2.6 istextorbinary: 2.6.0 mkdirp: 0.5.6 @@ -13213,7 +13184,7 @@ snapshots: dependencies: array-equal: 1.0.2 broccoli-plugin: 4.0.7 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) fs-tree-diff: 2.0.1 heimdalljs: 0.2.6 minimatch: 3.1.2 @@ -13406,7 +13377,7 @@ snapshots: broccoli-persistent-filter: 2.3.1 broccoli-plugin: 2.1.0 chalk: 2.4.2 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) ensure-posix-path: 1.1.1 fs-extra: 8.1.0 minimatch: 3.1.2 @@ -13432,7 +13403,7 @@ snapshots: async-promise-queue: 1.0.5 broccoli-plugin: 4.0.7 convert-source-map: 2.0.0 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) lodash.defaultsdeep: 4.6.1 matcher-collection: 2.0.1 symlink-or-copy: 1.3.1 @@ -14282,7 +14253,7 @@ snapshots: '@babel/plugin-transform-class-static-block': 7.24.4(@babel/core@7.24.5) '@babel/preset-env': 7.24.5(@babel/core@7.24.5) '@embroider/macros': 1.16.1(@glint/template@1.4.0) - '@embroider/shared-internals': 2.6.0 + '@embroider/shared-internals': 2.6.0(supports-color@8.1.1) babel-loader: 8.3.0(@babel/core@7.24.5)(webpack@5.91.0) babel-plugin-ember-modules-api-polyfill: 3.5.0 babel-plugin-ember-template-compilation: 2.2.5 @@ -14294,7 +14265,7 @@ snapshots: broccoli-plugin: 4.0.7 broccoli-source: 3.0.1 css-loader: 5.2.7(webpack@5.91.0) - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) fs-extra: 10.1.0 fs-tree-diff: 2.0.1 handlebars: 4.7.8 @@ -14497,7 +14468,7 @@ snapshots: ember-cli-preprocess-registry@5.0.1: dependencies: broccoli-funnel: 3.0.8 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -14537,7 +14508,7 @@ snapshots: '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.24.5) '@babel/plugin-transform-typescript': 7.4.5(@babel/core@7.24.5) ansi-to-html: 0.6.15 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) ember-cli-babel-plugin-helpers: 1.1.1 execa: 1.0.0 fs-extra: 7.0.1 @@ -14554,7 +14525,7 @@ snapshots: dependencies: '@babel/plugin-transform-typescript': 7.5.5(@babel/core@7.24.5) ansi-to-html: 0.6.15 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) ember-cli-babel-plugin-helpers: 1.1.1 execa: 2.1.0 fs-extra: 8.1.0 @@ -14571,7 +14542,7 @@ snapshots: dependencies: ansi-to-html: 0.6.15 broccoli-stew: 3.0.0 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) execa: 4.1.0 fs-extra: 9.1.0 resolve: 1.22.8 @@ -14915,7 +14886,7 @@ snapshots: ember-router-generator@2.0.0: dependencies: '@babel/parser': 7.24.5 - '@babel/traverse': 7.24.5 + '@babel/traverse': 7.24.5(supports-color@8.1.1) recast: 0.18.10 transitivePeerDependencies: - supports-color @@ -15125,7 +15096,7 @@ snapshots: chalk: 4.1.2 cli-table3: 0.6.5 core-object: 3.1.5 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) ember-try-config: 4.0.0(encoding@0.1.13) execa: 4.1.0 fs-extra: 6.0.1 @@ -15171,7 +15142,7 @@ snapshots: base64id: 2.0.0 cookie: 0.4.2 cors: 2.8.5 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) engine.io-parser: 5.2.2 ws: 8.11.0 transitivePeerDependencies: @@ -15376,7 +15347,7 @@ snapshots: eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0): dependencies: - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) enhanced-resolve: 5.16.1 eslint: 8.57.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) @@ -15559,7 +15530,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -16576,8 +16547,8 @@ snapshots: http-proxy-agent@4.0.1: dependencies: '@tootallnate/once': 1.1.2 - agent-base: 6.0.2 - debug: 4.3.4(supports-color@9.4.0) + agent-base: 6.0.2(supports-color@8.1.1) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -16599,8 +16570,8 @@ snapshots: https-proxy-agent@5.0.1: dependencies: - agent-base: 6.0.2 - debug: 4.3.4(supports-color@9.4.0) + agent-base: 6.0.2(supports-color@8.1.1) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -17019,8 +16990,8 @@ snapshots: escodegen: 2.1.0 form-data: 3.0.1 html-encoding-sniffer: 2.0.1 - http-proxy-agent: 4.0.1 - https-proxy-agent: 5.0.1 + http-proxy-agent: 4.0.1(supports-color@8.1.1) + https-proxy-agent: 5.0.1(supports-color@8.1.1) is-potential-custom-element-name: 1.0.1 nwsapi: 2.2.10 parse5: 6.0.1 @@ -17039,6 +17010,7 @@ snapshots: - bufferutil - supports-color - utf-8-validate + optional: true jsdom@16.7.0(supports-color@8.1.1): dependencies: @@ -18857,7 +18829,7 @@ snapshots: socket.io-adapter@2.5.4: dependencies: - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) ws: 8.11.0 transitivePeerDependencies: - bufferutil @@ -18867,7 +18839,7 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -18876,7 +18848,7 @@ snapshots: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) engine.io: 6.5.4 socket.io-adapter: 2.5.4 socket.io-parser: 4.2.4 @@ -18998,7 +18970,7 @@ snapshots: stagehand@1.0.1: dependencies: - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -19163,7 +19135,7 @@ snapshots: sync-disk-cache@2.1.0: dependencies: - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) heimdalljs: 0.2.6 mkdirp: 0.5.6 rimraf: 3.0.2 @@ -19458,7 +19430,7 @@ snapshots: tree-sync@2.1.0: dependencies: - debug: 4.3.4(supports-color@9.4.0) + debug: 4.3.4(supports-color@8.1.1) fs-tree-diff: 2.0.1 mkdirp: 0.5.6 quick-temp: 0.1.8 diff --git a/test-apps/embroider-app/ember-cli-build.js b/test-apps/embroider-app/ember-cli-build.js index e9b59a44..0149b49a 100644 --- a/test-apps/embroider-app/ember-cli-build.js +++ b/test-apps/embroider-app/ember-cli-build.js @@ -7,8 +7,7 @@ module.exports = async function (defaults) { // autoImport: { // watchDependencies: ['v2-addon'], // }, - // We can't add a babel plugin here, because it runs too late. - // This is post-AMD transform. + // These babel plugins run after wire-format, which is too late // babel: { // plugins: [ // [require.resolve('ember-scoped-css/babel-plugin'), { layerName: 'embroider-app' }, 'configured'], @@ -25,7 +24,9 @@ module.exports = async function (defaults) { }, ], packagerOptions: { + // css loaders for live reloading css webpackConfig: { + cache: false, module: { rules: [ // css loaders for production diff --git a/test-apps/embroider-app/lib/scoped-compat/index.js b/test-apps/embroider-app/lib/scoped-compat/index.js new file mode 100644 index 00000000..6a631420 --- /dev/null +++ b/test-apps/embroider-app/lib/scoped-compat/index.js @@ -0,0 +1,13 @@ +const { installScopedCSS } = require('ember-scoped-css/build/ember-classic-support'); + +module.exports = { + name: require('./package').name, + setupPreprocessorRegistry(type, registry) { + if (type === 'parent') { + installScopedCSS(registry, { + layerName: 'embroider-app', + additionalRoots: ['routes'], + }); + } + }, +}; diff --git a/test-apps/embroider-app/lib/scoped-compat/package.json b/test-apps/embroider-app/lib/scoped-compat/package.json new file mode 100644 index 00000000..36fac86b --- /dev/null +++ b/test-apps/embroider-app/lib/scoped-compat/package.json @@ -0,0 +1,6 @@ +{ + "name": "scoped-compat", + "keywords": [ + "ember-addon" + ] +} diff --git a/test-apps/embroider-app/package.json b/test-apps/embroider-app/package.json index b743ac44..1a594e76 100644 --- a/test-apps/embroider-app/package.json +++ b/test-apps/embroider-app/package.json @@ -54,7 +54,6 @@ "ember-qunit": "^8.0.2", "ember-resolver": "^11.0.0", "ember-scoped-css": "workspace:*", - "ember-scoped-css-compat": "workspace:^", "ember-source": "~5.8.0", "ember-source-channel-url": "^3.0.0", "ember-style-loader": "github:mainmatter/ember-style-loader#main", @@ -82,5 +81,10 @@ }, "volta": { "extends": "../../package.json" + }, + "ember-addon": { + "paths": [ + "lib/scoped-compat" + ] } } diff --git a/test-apps/pods-embroider-app/ember-cli-build.js b/test-apps/pods-embroider-app/ember-cli-build.js index 3989475c..407e389e 100644 --- a/test-apps/pods-embroider-app/ember-cli-build.js +++ b/test-apps/pods-embroider-app/ember-cli-build.js @@ -7,6 +7,15 @@ module.exports = async function (defaults) { // autoImport: { // watchDependencies: ['v2-addon'], // }, + babel: { + plugins: [ + [ + require.resolve('ember-scoped-css/babel-plugin'), + { layerName: 'embroider-app' }, + 'configured', + ], + ], + }, }); const { Webpack } = require('@embroider/webpack'); @@ -20,6 +29,7 @@ module.exports = async function (defaults) { packagerOptions: { // css loaders for live reloading css webpackConfig: { + cache: false, module: { rules: [ // css loaders for production diff --git a/test-apps/pods-embroider-app/package.json b/test-apps/pods-embroider-app/package.json index 9e055ce7..a1b63958 100644 --- a/test-apps/pods-embroider-app/package.json +++ b/test-apps/pods-embroider-app/package.json @@ -50,7 +50,6 @@ "ember-qunit": "^8.0.2", "ember-resolver": "^11.0.1", "ember-scoped-css": "workspace:^", - "ember-scoped-css-compat": "workspace:^", "ember-source": "~5.8.0", "ember-template-lint": "^6.0.0", "eslint": "^8.49.0",