diff --git a/ember-scoped-css/src/build/babel-plugin.js b/ember-scoped-css/src/build/babel-plugin.js index fc861f5e..fbb77d98 100644 --- a/ember-scoped-css/src/build/babel-plugin.js +++ b/ember-scoped-css/src/build/babel-plugin.js @@ -97,11 +97,27 @@ export default (env, options, workingDirectory) => { let cssPath = cssPathFor(fileName); - if (existsSync(cssPath)) { - let baseCSS = nodePath.basename(cssPath); - - state.importUtil.importForSideEffect(`./${baseCSS}`); + if (!existsSync(cssPath)) { + // check if we have an extraneous folder path + // this can happen because plugins have tried using + // the module path instead of the real path on disk. + // it's tricky to support both when there are no standards + // around managing these paths. + // But also, in normal projects, they are not different paths. + let [, ...parts] = cssPath.split('/'); + + cssPath = ['app', ...parts].join('/'); + + if (!existsSync(cssPath)) { + // there is no css path + // we don't want to add an import of the CSS file doesn't exist + return; + } } + + let baseCSS = nodePath.basename(cssPath); + + state.importUtil.importForSideEffect(`./${baseCSS}`); } }, }, diff --git a/ember-scoped-css/src/lib/path/hash-from-absolute-path.test.ts b/ember-scoped-css/src/lib/path/hash-from-absolute-path.test.ts index ab70145a..b4b0c6dc 100644 --- a/ember-scoped-css/src/lib/path/hash-from-absolute-path.test.ts +++ b/ember-scoped-css/src/lib/path/hash-from-absolute-path.test.ts @@ -12,7 +12,7 @@ describe('hashFromAbsolutePath', () => { let expected = 'ea418816b'; it('matches the module path', () => { - let postfix = hashFromModulePath(`embroider-app/${file}`); + let postfix = hashFromModulePath(`test-app/${file}`); expect(postfix).to.equal(expected); }); diff --git a/ember-scoped-css/src/lib/path/utils.appPath.test.ts b/ember-scoped-css/src/lib/path/utils.appPath.test.ts index c0ab26b9..edc4b86a 100644 --- a/ember-scoped-css/src/lib/path/utils.appPath.test.ts +++ b/ember-scoped-css/src/lib/path/utils.appPath.test.ts @@ -14,20 +14,20 @@ describe('appPath()', () => { ); let result = appPath(file); - expect(result).to.equal('embroider-app/templates/application'); + expect(result).to.equal('test-app/templates/application'); }); it('handles extraneous /app/', () => { let file = path.join(paths.embroiderApp, 'app', 'templates/application'); let result = appPath(file); - expect(result).to.equal('embroider-app/templates/application'); + expect(result).to.equal('test-app/templates/application'); }); it('handles psuedo module', () => { let file = path.join(paths.embroiderApp, 'templates/application'); let result = appPath(file); - expect(result).to.equal('embroider-app/templates/application'); + expect(result).to.equal('test-app/templates/application'); }); }); diff --git a/sync-test-apps.mjs b/sync-test-apps.mjs new file mode 100644 index 00000000..7e109100 --- /dev/null +++ b/sync-test-apps.mjs @@ -0,0 +1,30 @@ +import path from 'node:path'; +import fs from 'node:fs/promises'; + +const cwd = process.cwd(); +const source = 'test-apps/classic-app'; +const sourceComponents = path.join(source, 'app/components'); +const sourceTests = path.join(source, 'tests/shared-scenarios'); + +const otherApps = ['embroider-app', 'pods-classic-app', 'pods-embroider-app']; + +async function sync(source, destination) { + let target = path.join('../../', source).replace('/test-apps/', '/'); + + console.log(target); + + await fs.rm(destination, { force: true, recursive: true }); + await fs.symlink(target, destination); +} + +for (let app of otherApps) { + await sync( + sourceComponents, + path.join(cwd, 'test-apps', app, 'app/components'), + ); + + await sync( + sourceTests, + path.join(cwd, 'test-apps', app, 'tests/shared-scenarios'), + ); +} diff --git a/test-apps/classic-app/app/app.js b/test-apps/classic-app/app/app.js index a4857677..83bc0d2b 100644 --- a/test-apps/classic-app/app/app.js +++ b/test-apps/classic-app/app/app.js @@ -1,8 +1,8 @@ import Application from '@ember/application'; -import config from 'classic-app/config/environment'; import loadInitializers from 'ember-load-initializers'; import Resolver from 'ember-resolver'; +import config from 'test-app/config/environment'; export default class App extends Application { modulePrefix = config.modulePrefix; diff --git a/test-apps/classic-app/app/index.html b/test-apps/classic-app/app/index.html index 7aca2277..64824bfd 100644 --- a/test-apps/classic-app/app/index.html +++ b/test-apps/classic-app/app/index.html @@ -9,11 +9,7 @@ {{content-for "head"}} - + {{content-for "head-footer"}} @@ -21,7 +17,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/test-apps/classic-app/app/router.js b/test-apps/classic-app/app/router.js index da0fabd2..2d73bafa 100644 --- a/test-apps/classic-app/app/router.js +++ b/test-apps/classic-app/app/router.js @@ -1,6 +1,6 @@ import EmberRouter from '@ember/routing/router'; -import config from 'classic-app/config/environment'; +import config from 'test-app/config/environment'; export default class Router extends EmberRouter { location = config.locationType; diff --git a/test-apps/classic-app/config/environment.js b/test-apps/classic-app/config/environment.js index bc70bf05..113d30ae 100644 --- a/test-apps/classic-app/config/environment.js +++ b/test-apps/classic-app/config/environment.js @@ -2,7 +2,7 @@ module.exports = function (environment) { const ENV = { - modulePrefix: 'classic-app', + modulePrefix: 'test-app', environment, rootURL: '/', locationType: 'history', diff --git a/test-apps/classic-app/ember-cli-build.js b/test-apps/classic-app/ember-cli-build.js index 056aa320..fcc7fff4 100644 --- a/test-apps/classic-app/ember-cli-build.js +++ b/test-apps/classic-app/ember-cli-build.js @@ -4,15 +4,22 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function (defaults) { const app = new EmberApp(defaults, { + // All our test-apps must have the same name + // so that we can ensure that moving between configurations + // causes no string-comparison headaches. + name: 'test-app', // Add options here cssModules: { extension: 'module.css', }, + autoImport: { + allowAppImports: ['*.css'], + }, 'ember-cli-babel': { enableTypeScriptTransform: true, }, 'ember-scoped-css': { - layerName: 'classic-app-layer', + layerName: 'test-app', }, }); diff --git a/test-apps/classic-app/tests/index.html b/test-apps/classic-app/tests/index.html index dedfb4dc..c63b88ff 100644 --- a/test-apps/classic-app/tests/index.html +++ b/test-apps/classic-app/tests/index.html @@ -9,11 +9,11 @@ {{content-for "head"}} {{content-for "test-head"}} - - + {{content-for "head-footer"}} {{content-for "test-head-footer"}} + {{content-for "body"}} {{content-for "test-body"}} @@ -27,7 +27,7 @@ - + {{content-for "body-footer"}} {{content-for "test-body-footer"}} diff --git a/test-apps/classic-app/tests/shared-scenarios/in-app/at-class-test.gts b/test-apps/classic-app/tests/shared-scenarios/in-app/at-class-test.gts index 08c89393..2512afb3 100644 --- a/test-apps/classic-app/tests/shared-scenarios/in-app/at-class-test.gts +++ b/test-apps/classic-app/tests/shared-scenarios/in-app/at-class-test.gts @@ -2,7 +2,7 @@ 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 'test-app/components/in-app/at-class-ts/calls-has-at-class'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -16,8 +16,8 @@ module('[In App] at-class-ts', function(hooks) { ); - assert.dom('p').hasClass('text-color_ed46c3a30'); - assert.dom('p').hasClass(scopedClass('text-color', 'classic-app/components/in-app/at-class-ts/calls-has-at-class')); + assert.dom('p').hasClass('text-color_e859f8885'); + assert.dom('p').hasClass(scopedClass('text-color', 'test-app/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/tests/shared-scenarios/in-app/basic-test.gts b/test-apps/classic-app/tests/shared-scenarios/in-app/basic-test.gts index 4ab08268..43c43172 100644 --- a/test-apps/classic-app/tests/shared-scenarios/in-app/basic-test.gts +++ b/test-apps/classic-app/tests/shared-scenarios/in-app/basic-test.gts @@ -2,7 +2,7 @@ import { render } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import Basic from 'classic-app/components/in-app/basic'; +import Basic from 'test-app/components/in-app/basic'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -17,7 +17,7 @@ module('[In App] basic', function(hooks) { ); assert.dom('div').hasClass('has-a-style_e8d85123f'); - assert.dom('div').hasClass(scopedClass('has-a-style', 'classic-app/components/in-app/basic')); + assert.dom('div').hasClass(scopedClass('has-a-style', 'test-app/components/in-app/basic')); assert.dom('div').hasStyle({ color: 'rgb(0, 100, 50)', fontWeight: '700' }); }); }); diff --git a/test-apps/classic-app/tests/shared-scenarios/in-app/component-at-class-test.gjs b/test-apps/classic-app/tests/shared-scenarios/in-app/component-at-class-test.gjs index 56c7c715..b0fa0d70 100644 --- a/test-apps/classic-app/tests/shared-scenarios/in-app/component-at-class-test.gjs +++ b/test-apps/classic-app/tests/shared-scenarios/in-app/component-at-class-test.gjs @@ -3,7 +3,7 @@ import { hbs } from 'ember-cli-htmlbars'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import ComponentAtClass from 'classic-app/components/component-at-class'; +import ComponentAtClass from 'test-app/components/component-at-class'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -20,7 +20,7 @@ module('[In App] @class', function (hooks) { assert .dom('p') .hasClass( - scopedClass('text-color', 'classic-app/components/component-at-class') + scopedClass('text-color', 'test-app/components/component-at-class') ); assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); }); @@ -33,7 +33,7 @@ module('[In App] @class', function (hooks) { assert .dom('p') .hasClass( - scopedClass('text-color', 'classic-app/components/component-at-class') + scopedClass('text-color', 'test-app/components/component-at-class') ); assert.dom('p').hasStyle({ color: 'rgb(0, 0, 255)' }); }); diff --git a/test-apps/classic-app/tests/shared-scenarios/in-app/header-test.js b/test-apps/classic-app/tests/shared-scenarios/in-app/header-test.js index 63ab4832..0c668951 100644 --- a/test-apps/classic-app/tests/shared-scenarios/in-app/header-test.js +++ b/test-apps/classic-app/tests/shared-scenarios/in-app/header-test.js @@ -5,7 +5,7 @@ import { setupRenderingTest } from 'ember-qunit'; import { scopedClass } from 'ember-scoped-css/test-support'; -module('[In App] header', function (hooks) { +module('[In App] header', function (hooks) { setupRenderingTest(hooks); test('it has scoped class', async function (assert) { @@ -15,6 +15,6 @@ module('[In App] header', function (hooks) { assert.dom('h1').hasStyle({ color: 'rgb(255, 0, 0)' }); assert .dom('h1') - .hasClass(scopedClass('test-header', 'classic-app/components/header')); + .hasClass(scopedClass('test-header', 'test-app/components/header')); }); }); diff --git a/test-apps/classic-app/tests/shared-scenarios/in-app/subexpression-test.gjs b/test-apps/classic-app/tests/shared-scenarios/in-app/subexpression-test.gjs index f4fbf563..e0dc4bae 100644 --- a/test-apps/classic-app/tests/shared-scenarios/in-app/subexpression-test.gjs +++ b/test-apps/classic-app/tests/shared-scenarios/in-app/subexpression-test.gjs @@ -2,8 +2,8 @@ import { render, settled } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import SubExpression from 'classic-app/components/subexpression'; import { cell } from 'ember-resources'; +import SubExpression from 'test-app/components/subexpression'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -27,7 +27,7 @@ module('[In App] subexpression', function (hooks) { assert .dom('div') .hasClass( - scopedClass('a-local-class', 'classic-app/components/subexpression') + scopedClass('a-local-class', 'test-app/components/subexpression') ); assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); }); diff --git a/test-apps/classic-app/tests/shared-scenarios/in-app/template-only-test.js b/test-apps/classic-app/tests/shared-scenarios/in-app/template-only-test.js index f92016d9..3ce9108c 100644 --- a/test-apps/classic-app/tests/shared-scenarios/in-app/template-only-test.js +++ b/test-apps/classic-app/tests/shared-scenarios/in-app/template-only-test.js @@ -13,9 +13,7 @@ module('[In App] template-only', function (hooks) { assert .dom('div') - .hasClass( - scopedClass('some-class', 'classic-app/components/template-only'), - ); + .hasClass(scopedClass('some-class', 'test-app/components/template-only')); assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); }); }); diff --git a/test-apps/classic-app/tests/test-helper.js b/test-apps/classic-app/tests/test-helper.js index 3e92a514..5990eca2 100644 --- a/test-apps/classic-app/tests/test-helper.js +++ b/test-apps/classic-app/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 'test-app/app'; +import config from 'test-app/config/environment'; setApplication(Application.create(config.APP)); diff --git a/test-apps/embroider-app/app/app.js b/test-apps/embroider-app/app/app.js index a8e9a7ca..83bc0d2b 100644 --- a/test-apps/embroider-app/app/app.js +++ b/test-apps/embroider-app/app/app.js @@ -2,7 +2,7 @@ import Application from '@ember/application'; import loadInitializers from 'ember-load-initializers'; import Resolver from 'ember-resolver'; -import config from 'embroider-app/config/environment'; +import config from 'test-app/config/environment'; export default class App extends Application { modulePrefix = config.modulePrefix; diff --git a/test-apps/embroider-app/app/components b/test-apps/embroider-app/app/components new file mode 120000 index 00000000..29ee9fab --- /dev/null +++ b/test-apps/embroider-app/app/components @@ -0,0 +1 @@ +../../classic-app/app/components \ No newline at end of file diff --git a/test-apps/embroider-app/app/components/.gitkeep b/test-apps/embroider-app/app/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/embroider-app/app/components/forth.css b/test-apps/embroider-app/app/components/forth.css deleted file mode 100644 index f40bc5a6..00000000 --- a/test-apps/embroider-app/app/components/forth.css +++ /dev/null @@ -1,19 +0,0 @@ -div { - width: 250px; - border: 1px solid black; - padding: 0px 15px; - margin-top: 15px; -} - -.header { - margin-top: 0; - background-color: lightslategrey; - padding: 15px; - margin: 0px -15px; - text-align: right; -} - -.message { - font-weight: bold; - font-size: 3em; -} diff --git a/test-apps/embroider-app/app/components/forth.gjs b/test-apps/embroider-app/app/components/forth.gjs deleted file mode 100644 index b094340d..00000000 --- a/test-apps/embroider-app/app/components/forth.gjs +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/test-apps/embroider-app/app/components/my-component.css b/test-apps/embroider-app/app/components/my-component.css deleted file mode 100644 index 8ee66446..00000000 --- a/test-apps/embroider-app/app/components/my-component.css +++ /dev/null @@ -1,22 +0,0 @@ -div { - width: 300px; - border: 1px solid black; - border-radius: 4px; - padding: 0px 15px; - margin-top: 15px; -} - -.header { - margin-top: 0; - background-color: lightblue; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - padding: 15px; - margin: 0px -15px; - color: rgb(255, 0, 0); -} - -.message { - font-style: italic; - font-size: 2em; -} diff --git a/test-apps/embroider-app/app/components/my-component.hbs b/test-apps/embroider-app/app/components/my-component.hbs deleted file mode 100644 index 520f2bf2..00000000 --- a/test-apps/embroider-app/app/components/my-component.hbs +++ /dev/null @@ -1,9 +0,0 @@ -
-

- {{@title}} -

-

- {{@message}} -

- {{yield}} -
\ No newline at end of file diff --git a/test-apps/embroider-app/app/components/second.css b/test-apps/embroider-app/app/components/second.css deleted file mode 100644 index 85043202..00000000 --- a/test-apps/embroider-app/app/components/second.css +++ /dev/null @@ -1,18 +0,0 @@ -div { - width: 220px; - border: 1px solid black; - padding: 0px 15px; - margin-top: 15px; -} - -.header { - margin-top: 0; - background-color: lightcoral; - padding: 15px; - margin: 0px -15px; -} - -.message { - font-style: italic; - font-size: 1em; -} diff --git a/test-apps/embroider-app/app/components/second.hbs b/test-apps/embroider-app/app/components/second.hbs deleted file mode 100644 index ca760fbc..00000000 --- a/test-apps/embroider-app/app/components/second.hbs +++ /dev/null @@ -1,8 +0,0 @@ -
-

- {{@title}} -

-

- {{@message}} -

-
\ No newline at end of file diff --git a/test-apps/embroider-app/app/components/template-only.css b/test-apps/embroider-app/app/components/template-only.css deleted file mode 100644 index 7a2b9b30..00000000 --- a/test-apps/embroider-app/app/components/template-only.css +++ /dev/null @@ -1,3 +0,0 @@ -.some-class { - color: blue; -} diff --git a/test-apps/embroider-app/app/components/template-only.hbs b/test-apps/embroider-app/app/components/template-only.hbs deleted file mode 100644 index cb25b72e..00000000 --- a/test-apps/embroider-app/app/components/template-only.hbs +++ /dev/null @@ -1 +0,0 @@ -
hi there
\ No newline at end of file diff --git a/test-apps/embroider-app/app/components/third.gjs b/test-apps/embroider-app/app/components/third.gjs deleted file mode 100644 index 98db41cd..00000000 --- a/test-apps/embroider-app/app/components/third.gjs +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/test-apps/embroider-app/app/components/with-class.gjs b/test-apps/embroider-app/app/components/with-class.gjs deleted file mode 100644 index 13401e6d..00000000 --- a/test-apps/embroider-app/app/components/with-class.gjs +++ /dev/null @@ -1,19 +0,0 @@ - -import Component from '@glimmer/component'; - -export default class Hello extends Component { - name = 'world'; - - -} - diff --git a/test-apps/embroider-app/app/index.html b/test-apps/embroider-app/app/index.html index 4a1b1ce1..88212466 100644 --- a/test-apps/embroider-app/app/index.html +++ b/test-apps/embroider-app/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/embroider-app/app/router.js b/test-apps/embroider-app/app/router.js index 79e2d003..2d73bafa 100644 --- a/test-apps/embroider-app/app/router.js +++ b/test-apps/embroider-app/app/router.js @@ -1,6 +1,6 @@ import EmberRouter from '@ember/routing/router'; -import config from 'embroider-app/config/environment'; +import config from 'test-app/config/environment'; export default class Router extends EmberRouter { location = config.locationType; diff --git a/test-apps/embroider-app/config/environment.js b/test-apps/embroider-app/config/environment.js index b5363da7..113d30ae 100644 --- a/test-apps/embroider-app/config/environment.js +++ b/test-apps/embroider-app/config/environment.js @@ -2,7 +2,7 @@ module.exports = function (environment) { const ENV = { - modulePrefix: 'embroider-app', + modulePrefix: 'test-app', environment, rootURL: '/', locationType: 'history', diff --git a/test-apps/embroider-app/ember-cli-build.js b/test-apps/embroider-app/ember-cli-build.js index 6895f84d..d1c478dd 100644 --- a/test-apps/embroider-app/ember-cli-build.js +++ b/test-apps/embroider-app/ember-cli-build.js @@ -4,6 +4,7 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = async function (defaults) { const app = new EmberApp(defaults, { + name: 'test-app', // autoImport: { // watchDependencies: ['v2-addon'], // }, @@ -31,7 +32,7 @@ module.exports = async function (defaults) { 'ember-scoped-css/build/app-css-loader', ), options: { - layerName: 'embroider-app', + layerName: 'test-app', }, }, ], diff --git a/test-apps/embroider-app/tests/application/route-scoped-css-test.js b/test-apps/embroider-app/tests/application/route-scoped-css-test.js index 3e30c5d4..f143d2c8 100644 --- a/test-apps/embroider-app/tests/application/route-scoped-css-test.js +++ b/test-apps/embroider-app/tests/application/route-scoped-css-test.js @@ -1,7 +1,7 @@ import { visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; -import { setupApplicationTest } from 'embroider-app/tests/helpers'; +import { setupApplicationTest } from 'test-app/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -11,9 +11,7 @@ module('Application | visit `/`', function (hooks) { test('it has scoped class', async function (assert) { await visit('/'); - assert - .dom('h3') - .hasClass(scopedClass('embroider-app/templates/application')); + assert.dom('h3').hasClass(scopedClass('test-app/templates/application')); assert.dom('h3').hasStyle({ color: 'rgb(0, 255, 0)' }); }); }); diff --git a/test-apps/embroider-app/tests/index.html b/test-apps/embroider-app/tests/index.html index ed47a151..5ad864df 100644 --- a/test-apps/embroider-app/tests/index.html +++ b/test-apps/embroider-app/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/embroider-app/tests/integration/alert-from-v2-addon-test.js b/test-apps/embroider-app/tests/integration/alert-from-v2-addon-test.js index 654387d2..f7b9b2d2 100644 --- a/test-apps/embroider-app/tests/integration/alert-from-v2-addon-test.js +++ b/test-apps/embroider-app/tests/integration/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 'embroider-app/tests/helpers'; +import { setupRenderingTest } from 'test-app/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; diff --git a/test-apps/embroider-app/tests/integration/my-component-test.js b/test-apps/embroider-app/tests/integration/my-component-test.js index 8988247d..72212654 100644 --- a/test-apps/embroider-app/tests/integration/my-component-test.js +++ b/test-apps/embroider-app/tests/integration/my-component-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 'embroider-app/tests/helpers'; +import { setupRenderingTest } from 'test-app/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -16,6 +16,6 @@ module('Integration | Component | my-component', function (hooks) { assert.dom('h3').hasStyle({ color: 'rgb(255, 0, 0)' }); assert .dom('h3') - .hasClass(scopedClass('header', 'embroider-app/components/my-component')); + .hasClass(scopedClass('header', 'test-app/components/my-component')); }); }); diff --git a/test-apps/embroider-app/tests/integration/second-test.js b/test-apps/embroider-app/tests/integration/second-test.js index d671386f..170ca9f8 100644 --- a/test-apps/embroider-app/tests/integration/second-test.js +++ b/test-apps/embroider-app/tests/integration/second-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 'embroider-app/tests/helpers'; +import { setupRenderingTest } from 'test-app/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -20,6 +20,6 @@ module('Integration | Component | second', function (hooks) { assert.dom('h3').hasStyle({ margin: '0px -15px' }); assert .dom('h3') - .hasClass(scopedClass('header', 'embroider-app/components/second')); + .hasClass(scopedClass('header', 'test-app/components/second')); }); }); diff --git a/test-apps/embroider-app/tests/integration/template-only-test.js b/test-apps/embroider-app/tests/integration/template-only-test.js index 6d287ae2..1ae850e9 100644 --- a/test-apps/embroider-app/tests/integration/template-only-test.js +++ b/test-apps/embroider-app/tests/integration/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 'embroider-app/tests/helpers'; +import { setupRenderingTest } from 'test-app/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -14,9 +14,7 @@ module('Integration | Component | template-only', function (hooks) { assert .dom('div') - .hasClass( - scopedClass('some-class', 'embroider-app/components/template-only'), - ); + .hasClass(scopedClass('some-class', 'test-app/components/template-only')); assert.dom('div').hasStyle({ color: 'rgb(0, 0, 255)' }); }); }); diff --git a/test-apps/embroider-app/tests/shared-scenarios b/test-apps/embroider-app/tests/shared-scenarios new file mode 120000 index 00000000..f66e330d --- /dev/null +++ b/test-apps/embroider-app/tests/shared-scenarios @@ -0,0 +1 @@ +../../classic-app/tests/shared-scenarios \ No newline at end of file diff --git a/test-apps/embroider-app/tests/test-helper.js b/test-apps/embroider-app/tests/test-helper.js index 6df20656..5990eca2 100644 --- a/test-apps/embroider-app/tests/test-helper.js +++ b/test-apps/embroider-app/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 'embroider-app/app'; -import config from 'embroider-app/config/environment'; +import Application from 'test-app/app'; +import config from 'test-app/config/environment'; setApplication(Application.create(config.APP)); diff --git a/test-apps/pods-classic-app/app/app.js b/test-apps/pods-classic-app/app/app.js index 948bf818..1ba93424 100644 --- a/test-apps/pods-classic-app/app/app.js +++ b/test-apps/pods-classic-app/app/app.js @@ -1,7 +1,7 @@ import Application from '@ember/application'; import Resolver from 'ember-resolver'; import loadInitializers from 'ember-load-initializers'; -import config from 'pods-classic-app/config/environment'; +import config from 'test-app/config/environment'; export default class App extends Application { modulePrefix = config.modulePrefix; diff --git a/test-apps/pods-classic-app/app/components b/test-apps/pods-classic-app/app/components new file mode 120000 index 00000000..29ee9fab --- /dev/null +++ b/test-apps/pods-classic-app/app/components @@ -0,0 +1 @@ +../../classic-app/app/components \ No newline at end of file diff --git a/test-apps/pods-classic-app/app/components/.gitkeep b/test-apps/pods-classic-app/app/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/pods-classic-app/app/index.html b/test-apps/pods-classic-app/app/index.html index 0a34fc2d..7f4b92a2 100644 --- a/test-apps/pods-classic-app/app/index.html +++ b/test-apps/pods-classic-app/app/index.html @@ -9,7 +9,7 @@ {{content-for "head"}} - + {{content-for "head-footer"}} @@ -17,7 +17,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/test-apps/pods-classic-app/app/router.js b/test-apps/pods-classic-app/app/router.js index 09910140..38a0b80a 100644 --- a/test-apps/pods-classic-app/app/router.js +++ b/test-apps/pods-classic-app/app/router.js @@ -1,5 +1,5 @@ import EmberRouter from '@ember/routing/router'; -import config from 'pods-classic-app/config/environment'; +import config from 'test-app/config/environment'; export default class Router extends EmberRouter { location = config.locationType; diff --git a/test-apps/pods-classic-app/config/environment.js b/test-apps/pods-classic-app/config/environment.js index e54e3a0f..9b1ced92 100644 --- a/test-apps/pods-classic-app/config/environment.js +++ b/test-apps/pods-classic-app/config/environment.js @@ -2,8 +2,8 @@ module.exports = function (environment) { const ENV = { - modulePrefix: 'pods-classic-app', - podModulePrefix: 'pods-classic-app/routes', + modulePrefix: 'test-app', + podModulePrefix: 'test-app/routes', environment, rootURL: '/', locationType: 'history', diff --git a/test-apps/pods-classic-app/tests/application/route-scoped-css-test.js b/test-apps/pods-classic-app/tests/application/route-scoped-css-test.js index f6c78e41..9378d3d0 100644 --- a/test-apps/pods-classic-app/tests/application/route-scoped-css-test.js +++ b/test-apps/pods-classic-app/tests/application/route-scoped-css-test.js @@ -11,9 +11,7 @@ module('Application | visit `/`', function (hooks) { test('it has scoped class', async function (assert) { await visit('/'); - assert - .dom('h3') - .hasClass(scopedClass('pods-classic-app/routes/application')); + assert.dom('h3').hasClass(scopedClass('test-app/routes/application')); assert.dom('h3').hasStyle({ color: 'rgb(0, 255, 0)' }); }); }); diff --git a/test-apps/pods-classic-app/tests/index.html b/test-apps/pods-classic-app/tests/index.html index 69424f26..00da8130 100644 --- a/test-apps/pods-classic-app/tests/index.html +++ b/test-apps/pods-classic-app/tests/index.html @@ -10,7 +10,7 @@ {{content-for "test-head"}} - + {{content-for "head-footer"}} @@ -30,7 +30,7 @@ - + {{content-for "body-footer"}} diff --git a/test-apps/pods-classic-app/tests/shared-scenarios b/test-apps/pods-classic-app/tests/shared-scenarios new file mode 120000 index 00000000..f66e330d --- /dev/null +++ b/test-apps/pods-classic-app/tests/shared-scenarios @@ -0,0 +1 @@ +../../classic-app/tests/shared-scenarios \ No newline at end of file diff --git a/test-apps/pods-classic-app/tests/test-helper.js b/test-apps/pods-classic-app/tests/test-helper.js index 0a019993..81843044 100644 --- a/test-apps/pods-classic-app/tests/test-helper.js +++ b/test-apps/pods-classic-app/tests/test-helper.js @@ -1,5 +1,5 @@ -import Application from 'pods-classic-app/app'; -import config from 'pods-classic-app/config/environment'; +import Application from 'test-app/app'; +import config from 'test-app/config/environment'; import * as QUnit from 'qunit'; import { setApplication } from '@ember/test-helpers'; import { setup } from 'qunit-dom'; diff --git a/test-apps/pods-embroider-app/app/app.js b/test-apps/pods-embroider-app/app/app.js index 322aae22..1ba93424 100644 --- a/test-apps/pods-embroider-app/app/app.js +++ b/test-apps/pods-embroider-app/app/app.js @@ -1,7 +1,7 @@ import Application from '@ember/application'; import Resolver from 'ember-resolver'; import loadInitializers from 'ember-load-initializers'; -import config from 'pods-embroider-app/config/environment'; +import config from 'test-app/config/environment'; export default class App extends Application { modulePrefix = config.modulePrefix; diff --git a/test-apps/pods-embroider-app/app/components b/test-apps/pods-embroider-app/app/components new file mode 120000 index 00000000..29ee9fab --- /dev/null +++ b/test-apps/pods-embroider-app/app/components @@ -0,0 +1 @@ +../../classic-app/app/components \ No newline at end of file diff --git a/test-apps/pods-embroider-app/app/components/.gitkeep b/test-apps/pods-embroider-app/app/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/test-apps/pods-embroider-app/app/index.html b/test-apps/pods-embroider-app/app/index.html index 58a29bc8..27eb0bc1 100644 --- a/test-apps/pods-embroider-app/app/index.html +++ b/test-apps/pods-embroider-app/app/index.html @@ -9,7 +9,7 @@ {{content-for "head"}} - + {{content-for "head-footer"}} @@ -17,7 +17,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/test-apps/pods-embroider-app/app/router.js b/test-apps/pods-embroider-app/app/router.js index 9a9738d2..38a0b80a 100644 --- a/test-apps/pods-embroider-app/app/router.js +++ b/test-apps/pods-embroider-app/app/router.js @@ -1,5 +1,5 @@ import EmberRouter from '@ember/routing/router'; -import config from 'pods-embroider-app/config/environment'; +import config from 'test-app/config/environment'; export default class Router extends EmberRouter { location = config.locationType; diff --git a/test-apps/pods-embroider-app/config/environment.js b/test-apps/pods-embroider-app/config/environment.js index 0a500420..9b1ced92 100644 --- a/test-apps/pods-embroider-app/config/environment.js +++ b/test-apps/pods-embroider-app/config/environment.js @@ -2,8 +2,8 @@ module.exports = function (environment) { const ENV = { - modulePrefix: 'pods-embroider-app', - podModulePrefix: 'pods-embroider-app/routes', + modulePrefix: 'test-app', + podModulePrefix: 'test-app/routes', environment, rootURL: '/', locationType: 'history', diff --git a/test-apps/pods-embroider-app/ember-cli-build.js b/test-apps/pods-embroider-app/ember-cli-build.js index f9f4b157..81d7e1be 100644 --- a/test-apps/pods-embroider-app/ember-cli-build.js +++ b/test-apps/pods-embroider-app/ember-cli-build.js @@ -4,12 +4,13 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = async function (defaults) { const app = new EmberApp(defaults, { + name: 'test-app', // autoImport: { // watchDependencies: ['v2-addon'], // }, 'ember-scoped-css': { additionalRoots: ['routes/'], - layerName: 'emborider-app', + layerName: 'test-app', }, }); @@ -35,7 +36,7 @@ module.exports = async function (defaults) { 'ember-scoped-css/build/app-css-loader', ), options: { - layerName: 'embroider-app', + layerName: 'test-app', additionalRoots: ['routes/'], }, }, diff --git a/test-apps/pods-embroider-app/tests/application/route-scoped-css-test.js b/test-apps/pods-embroider-app/tests/application/route-scoped-css-test.js index 71ea9747..c227074b 100644 --- a/test-apps/pods-embroider-app/tests/application/route-scoped-css-test.js +++ b/test-apps/pods-embroider-app/tests/application/route-scoped-css-test.js @@ -1,7 +1,7 @@ import { visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; -import { setupApplicationTest } from 'pods-embroider-app/tests/helpers'; +import { setupApplicationTest } from 'test-app/tests/helpers'; import { scopedClass } from 'ember-scoped-css/test-support'; @@ -11,9 +11,7 @@ module('Application | visit `/`', function (hooks) { test('it has scoped class', async function (assert) { await visit('/'); - assert - .dom('h3') - .hasClass(scopedClass('pods-embroider-app/routes/application')); + assert.dom('h3').hasClass(scopedClass('test-app/routes/application')); assert.dom('h3').hasStyle({ color: 'rgb(0, 255, 0)' }); }); }); diff --git a/test-apps/pods-embroider-app/tests/index.html b/test-apps/pods-embroider-app/tests/index.html index 2e93c42b..d592226b 100644 --- a/test-apps/pods-embroider-app/tests/index.html +++ b/test-apps/pods-embroider-app/tests/index.html @@ -10,7 +10,7 @@ {{content-for "test-head"}} - + {{content-for "head-footer"}} @@ -30,7 +30,7 @@ - + {{content-for "body-footer"}} diff --git a/test-apps/pods-embroider-app/tests/shared-scenarios b/test-apps/pods-embroider-app/tests/shared-scenarios new file mode 120000 index 00000000..f66e330d --- /dev/null +++ b/test-apps/pods-embroider-app/tests/shared-scenarios @@ -0,0 +1 @@ +../../classic-app/tests/shared-scenarios \ No newline at end of file diff --git a/test-apps/pods-embroider-app/tests/test-helper.js b/test-apps/pods-embroider-app/tests/test-helper.js index fcf34061..81843044 100644 --- a/test-apps/pods-embroider-app/tests/test-helper.js +++ b/test-apps/pods-embroider-app/tests/test-helper.js @@ -1,5 +1,5 @@ -import Application from 'pods-embroider-app/app'; -import config from 'pods-embroider-app/config/environment'; +import Application from 'test-app/app'; +import config from 'test-app/config/environment'; import * as QUnit from 'qunit'; import { setApplication } from '@ember/test-helpers'; import { setup } from 'qunit-dom';