@ember/app-blueprint 6.11.0-alpha.3 → 6.11.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.release-plan.json +13 -5
  2. package/CHANGELOG.md +34 -48
  3. package/README.md +0 -43
  4. package/RELEASE.md +1 -1
  5. package/eslint.config.mjs +0 -5
  6. package/files/app/templates/application.gts +2 -2
  7. package/files/index.html +5 -8
  8. package/files/package.json +21 -21
  9. package/files/testem.cjs +1 -2
  10. package/files/tests/index.html +3 -10
  11. package/files/tests/test-helper.ts +2 -3
  12. package/files/vite.config.mjs +3 -3
  13. package/index.js +3 -213
  14. package/package.json +8 -11
  15. package/conditional-files/minimal/app/app.ts +0 -10
  16. package/conditional-files/minimal/app/templates/application.gts +0 -7
  17. package/conditional-files/no-compat/_js_babel.config.mjs +0 -47
  18. package/conditional-files/no-compat/_ts_babel.config.mjs +0 -55
  19. package/conditional-files/no-compat/app/app.ts +0 -18
  20. package/conditional-files/no-compat/app/config/environment.ts +0 -38
  21. package/tests/fixtures/tests-js-no-compat-10/app/components/.gitkeep +0 -0
  22. package/tests/fixtures/tests-js-no-compat-10/app/components/sweet.gjs +0 -3
  23. package/tests/fixtures/tests-js-no-compat-10/app/router.js +0 -11
  24. package/tests/fixtures/tests-js-no-compat-10/app/routes/fancy.js +0 -6
  25. package/tests/fixtures/tests-js-no-compat-10/app/styles/app.css +0 -3
  26. package/tests/fixtures/tests-js-no-compat-10/app/templates/application.gjs +0 -7
  27. package/tests/fixtures/tests-js-no-compat-10/app/templates/fancy.gjs +0 -9
  28. package/tests/fixtures/tests-js-no-compat-10/tests/acceptance/index-test.js +0 -26
  29. package/tests/fixtures/tests-js-no-compat-10/tests/integration/components/sweet-test.gjs +0 -28
  30. package/tests/fixtures/tests-js-no-compat-10/tests/routes/fancy-test.js +0 -11
  31. package/tests/fixtures/tests-ts-no-compat-10/app/components/.gitkeep +0 -0
  32. package/tests/fixtures/tests-ts-no-compat-10/app/components/sweet.gts +0 -3
  33. package/tests/fixtures/tests-ts-no-compat-10/app/router.ts +0 -11
  34. package/tests/fixtures/tests-ts-no-compat-10/app/routes/fancy.ts +0 -8
  35. package/tests/fixtures/tests-ts-no-compat-10/app/styles/app.css +0 -3
  36. package/tests/fixtures/tests-ts-no-compat-10/app/templates/application.gts +0 -7
  37. package/tests/fixtures/tests-ts-no-compat-10/app/templates/fancy.gts +0 -9
  38. package/tests/fixtures/tests-ts-no-compat-10/tests/acceptance/index-test.ts +0 -26
  39. package/tests/fixtures/tests-ts-no-compat-10/tests/integration/components/sweet-test.gjs +0 -28
  40. package/tests/fixtures/tests-ts-no-compat-10/tests/routes/fancy-test.js +0 -11
  41. package/tests/minimal.test.mjs +0 -120
  42. package/tests/no-compat.test.mjs +0 -181
package/index.js CHANGED
@@ -24,45 +24,6 @@ function stringifyAndNormalize(contents) {
24
24
  * (see `conditional-files`)
25
25
  */
26
26
  const replacers = {
27
- 'app/app.ts'(locals, contents) {
28
- if (locals.minimal) {
29
- let filePath = join(CONDITIONAL_FILES, 'minimal', 'app/app.ts');
30
- let raw = readFileSync(filePath).toString();
31
- return ejs.render(raw, locals);
32
- } else if (locals.noCompat) {
33
- let filePath = join(CONDITIONAL_FILES, 'no-compat', 'app/app.ts');
34
- let raw = readFileSync(filePath).toString();
35
- return ejs.render(raw, locals);
36
- }
37
-
38
- return ejs.render(contents, locals);
39
- },
40
- 'app/config/environment.ts'(locals, contents) {
41
- if (locals.noCompat) {
42
- let filePath = join(
43
- CONDITIONAL_FILES,
44
- 'no-compat',
45
- 'app/config/environment.ts',
46
- );
47
- let raw = readFileSync(filePath).toString();
48
- return ejs.render(raw, locals);
49
- }
50
-
51
- return ejs.render(contents, locals);
52
- },
53
- 'app/templates/application.gts'(locals, contents) {
54
- if (locals.minimal) {
55
- let filePath = join(
56
- CONDITIONAL_FILES,
57
- 'minimal',
58
- 'app/templates/application.gts',
59
- );
60
- let raw = readFileSync(filePath).toString();
61
- return ejs.render(raw, locals);
62
- }
63
-
64
- return ejs.render(contents, locals);
65
- },
66
27
  'package.json'(...args) {
67
28
  return this.updatePackageJson(...args);
68
29
  },
@@ -76,14 +37,7 @@ const replacers = {
76
37
  },
77
38
  'babel.config.mjs'(locals) {
78
39
  let prefix = locals.typescript ? '_ts_' : '_js_';
79
-
80
- let filePath = join(
81
- ...[
82
- CONDITIONAL_FILES,
83
- locals.noCompat && 'no-compat',
84
- prefix + 'babel.config.mjs',
85
- ].filter(Boolean),
86
- );
40
+ let filePath = join(CONDITIONAL_FILES, prefix + 'babel.config.mjs');
87
41
 
88
42
  let raw = readFileSync(filePath).toString();
89
43
 
@@ -126,8 +80,6 @@ module.exports = {
126
80
  options.packageManager === 'pnpm' && '"--pnpm"',
127
81
  options.ciProvider && `"--ci-provider=${options.ciProvider}"`,
128
82
  options.typescript && `"--typescript"`,
129
- options.minimal && `"--minimal"`,
130
- options.noCompat && `"--no-compat"`,
131
83
  !options.emberData && `"--no-ember-data"`,
132
84
  !options.warpDrive && `"--no-warp-drive"`,
133
85
  ]
@@ -149,37 +101,6 @@ module.exports = {
149
101
  execBinPrefix = 'pnpm';
150
102
  }
151
103
 
152
- let welcome = options.welcome;
153
- let warpDrive = options.warpDrive ?? options.emberData;
154
- let minimal = false;
155
- let compat = true;
156
- /**
157
- * --minimal overrides compat/no-compat
158
- */
159
- if (options.minimal) {
160
- minimal = true;
161
- compat = false;
162
-
163
- // Invert defaults
164
- {
165
- welcome = options.welcome = process.argv.includes('--welcome');
166
- warpDrive =
167
- options.emberData =
168
- options.warpDrive =
169
- process.argv.includes('--ember-data') ||
170
- process.argv.includes('--warp-drive');
171
- }
172
- }
173
-
174
- if (!minimal) {
175
- if (options.noCompat || options.compat === false) {
176
- compat = false;
177
- }
178
- }
179
-
180
- let noCompat = !compat;
181
- let notMinimal = !minimal;
182
-
183
104
  return {
184
105
  appDirectory: directoryForPackageName(name),
185
106
  name,
@@ -192,18 +113,14 @@ module.exports = {
192
113
  options.packageManager !== 'yarn' && options.packageManager !== 'pnpm',
193
114
  invokeScriptPrefix,
194
115
  execBinPrefix,
195
- welcome,
116
+ welcome: options.welcome,
196
117
  blueprint: 'app',
197
118
  blueprintOptions,
198
119
  lang: options.lang,
199
- warpDrive: warpDrive,
120
+ warpDrive: options.warpDrive ?? options.emberData,
200
121
  ciProvider: options.ciProvider,
201
122
  typescript: options.typescript,
202
123
  packageManager: options.packageManager ?? 'npm',
203
- compat,
204
- noCompat,
205
- minimal,
206
- notMinimal,
207
124
  };
208
125
  },
209
126
 
@@ -214,10 +131,6 @@ module.exports = {
214
131
 
215
132
  let files = this._super();
216
133
 
217
- // Locals is where we calculate defaults and such.
218
- // Let's not duplicate that work here
219
- options = this.locals(options);
220
-
221
134
  if (options.ciProvider !== 'github') {
222
135
  files = files.filter((file) => file.indexOf('.github') < 0);
223
136
  }
@@ -237,43 +150,6 @@ module.exports = {
237
150
  files = files.filter((file) => !file.includes('services/.gitkeep'));
238
151
  }
239
152
 
240
- if (options.noCompat) {
241
- files = files.filter((file) => {
242
- return (
243
- !file.includes('ember-cli') &&
244
- !file.includes('ember-cli-build.js') &&
245
- !file.includes('controllers/') &&
246
- !file.includes('config/environment.js') &&
247
- !file.includes('config/optional-features') &&
248
- !file.includes('config/targets') &&
249
- !file.includes('app/helpers/')
250
- );
251
- });
252
- }
253
-
254
- if (options.minimal) {
255
- files = files.filter((file) => {
256
- return (
257
- !file.includes('.github/') &&
258
- !file.includes('.prettierignore') &&
259
- !file.includes('README') &&
260
- !file.includes('deprecation-workflow') &&
261
- !file.includes('components/') &&
262
- !file.includes('eslint.config') &&
263
- !file.includes('prettierrc') &&
264
- !file.includes('public/') &&
265
- !file.includes('routes/') &&
266
- !file.includes('services/') &&
267
- !file.includes('stylelint') &&
268
- !file.includes('styles/') &&
269
- !file.includes('template-lintrc') &&
270
- !file.includes('testem') &&
271
- !file.includes('tests/') &&
272
- !file.includes('watchman')
273
- );
274
- });
275
- }
276
-
277
153
  this._files = files;
278
154
 
279
155
  return this._files;
@@ -306,92 +182,6 @@ module.exports = {
306
182
  updatePackageJson(options, content) {
307
183
  let contents = JSON.parse(content);
308
184
 
309
- if (options.minimal) {
310
- // Remove linting
311
- {
312
- delete contents.scripts['format'];
313
- delete contents.scripts['lint'];
314
- delete contents.scripts['lint:format'];
315
- delete contents.scripts['lint:fix'];
316
- delete contents.scripts['lint:js'];
317
- delete contents.scripts['lint:js:fix'];
318
- delete contents.scripts['lint:css'];
319
- delete contents.scripts['lint:css:fix'];
320
- delete contents.scripts['lint:hbs'];
321
- delete contents.scripts['lint:hbs:fix'];
322
-
323
- delete contents.devDependencies['@babel/eslint-parser'];
324
- delete contents.devDependencies['@eslint/js'];
325
- delete contents.devDependencies['concurrently'];
326
- delete contents.devDependencies['ember-template-lint'];
327
- delete contents.devDependencies['eslint'];
328
- delete contents.devDependencies['eslint-config-prettier'];
329
- delete contents.devDependencies['eslint-plugin-ember'];
330
- delete contents.devDependencies['eslint-plugin-n'];
331
- delete contents.devDependencies['eslint-plugin-qunit'];
332
- delete contents.devDependencies['eslint-plugin-warp-drive'];
333
- delete contents.devDependencies['globals'];
334
- delete contents.devDependencies['prettier'];
335
- delete contents.devDependencies['prettier-plugin-ember-template-tag'];
336
- delete contents.devDependencies['stylelint'];
337
- delete contents.devDependencies['stylelint-config-standard'];
338
- delete contents.devDependencies['typescript-eslint'];
339
- }
340
- // Remove testing
341
- {
342
- delete contents.scripts['test'];
343
- delete contents.devDependencies['@ember/test-helpers'];
344
- delete contents.devDependencies['@ember/test-waiters'];
345
- delete contents.devDependencies['ember-qunit'];
346
- delete contents.devDependencies['qunit'];
347
- delete contents.devDependencies['qunit-dom'];
348
- delete contents.devDependencies['testem'];
349
- }
350
- // Extraneous / non-core deps.
351
- // if folks go minimal, they know what they are doing
352
- {
353
- delete contents.devDependencies['ember-welcome-page'];
354
- delete contents.devDependencies['tracked-built-ins'];
355
- delete contents.devDependencies['ember-page-title'];
356
- delete contents.devDependencies['ember-modifier'];
357
- delete contents.devDependencies['ember-cli-deprecation-workflow'];
358
- delete contents.devDependencies['ember-resolver'];
359
- }
360
- // common-in-the-vite-ecosystem alias
361
- {
362
- contents.scripts.dev = contents.scripts.start;
363
- }
364
-
365
- contents.devDependencies['ember-strict-application-resolver'] = '^0.1.0';
366
- }
367
- if (options.noCompat) {
368
- contents.type = 'module';
369
- contents.engines.node = '>= 24';
370
- delete contents.directories;
371
- delete contents.devDependencies['@ember/string'];
372
- delete contents.devDependencies['@ember/optional-features'];
373
- delete contents.devDependencies['@embroider/compat'];
374
- delete contents.devDependencies['@embroider/config-meta-loader'];
375
- // Users should use npx ember-cli instead
376
- delete contents.devDependencies['ember-cli'];
377
- delete contents.devDependencies['ember-cli-babel'];
378
- delete contents.devDependencies['ember-load-initializers'];
379
-
380
- // A nice feature of modern apps is using sub-path imports
381
- // Why specify the whole app name, when you can use `#`?
382
- contents.imports = {
383
- '#app/*': './app/*',
384
- '#config': './app/config/environment',
385
- '#components/*': './app/components/*',
386
- };
387
-
388
- if (contents.scripts.test) {
389
- contents.scripts.test =
390
- 'vite build --mode development && testem ci --port 0';
391
- contents.devDependencies['testem'] = '^3.17.0';
392
- }
393
- }
394
-
395
185
  return stringifyAndNormalize(sortPackageJson(contents));
396
186
  },
397
187
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember/app-blueprint",
3
- "version": "6.11.0-alpha.3",
3
+ "version": "6.11.0-beta.1",
4
4
  "description": "Blueprint for next generation of Ember apps",
5
5
  "keywords": [
6
6
  "ember-blueprint"
@@ -17,21 +17,21 @@
17
17
  "minor": "prerelease",
18
18
  "patch": "prerelease"
19
19
  },
20
- "semverIncrementTag": "alpha",
21
- "publishTag": "alpha"
20
+ "semverIncrementTag": "beta",
21
+ "publishTag": "beta"
22
22
  },
23
23
  "dependencies": {
24
24
  "chalk": "^4.1.2",
25
25
  "ejs": "^3.1.10",
26
26
  "ember-cli-string-utils": "^1.1.0",
27
27
  "lodash": "^4.17.21",
28
- "sort-package-json": "^3.5.1",
28
+ "sort-package-json": "^3.6.0",
29
29
  "walk-sync": "^3.0.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@eslint/js": "^9.3.0",
33
33
  "concurrently": "^9.1.2",
34
- "ember-cli": "^6.9.1",
34
+ "ember-cli": "^6.3.1",
35
35
  "eslint": "9.x",
36
36
  "eslint-config-prettier": "^9.1.0",
37
37
  "execa": "^9.1.0",
@@ -43,7 +43,7 @@
43
43
  "release-plan": "^0.17.2",
44
44
  "strip-ansi": "^7.1.0",
45
45
  "tmp-promise": "^3.0.3",
46
- "vitest": "^4.0.16"
46
+ "vitest": "^4.0.0-beta.17"
47
47
  },
48
48
  "scripts": {
49
49
  "lint": "concurrently 'pnpm:lint:*(!fix)'",
@@ -51,10 +51,7 @@
51
51
  "lint:eslint": "eslint .",
52
52
  "lint:prettier": "prettier . --check",
53
53
  "format": "prettier . --write",
54
- "new:app": "pnpm dlx ember-cli@latest new my-app --blueprint .",
55
- "update:all": "pnpm dlx update-blueprint-deps --filter . ./files/package.json",
56
- "update:alpha": "pnpm dlx update-blueprint-deps --ember-source alpha --ember-cli alpha --ember-data alpha ./files/package.json",
57
- "update:beta": "pnpm dlx update-blueprint-deps --ember-source beta --ember-cli beta --ember-data beta ./files/package.json",
58
- "test": "vitest"
54
+ "test": "vitest",
55
+ "new:app": "pnpm dlx ember-cli@latest new my-app --blueprint ."
59
56
  }
60
57
  }
@@ -1,10 +0,0 @@
1
- <% if (warpDrive) { %>import '@warp-drive/ember/install';
2
- <% } %>import Application from 'ember-strict-application-resolver';
3
-
4
- export default class App extends Application {
5
- modules = {
6
- ...import.meta.glob('./router.*', { eager: true }),
7
- ...import.meta.glob('./templates/**/*', { eager: true }),
8
- ...import.meta.glob('./services/**/*', { eager: true }),
9
- }
10
- }
@@ -1,7 +0,0 @@
1
-
2
- <template>
3
- <h1>Welcome to Ember</h1>
4
-
5
- {{outlet}}
6
-
7
- </template>
@@ -1,47 +0,0 @@
1
- import { dirname } from 'node:path';
2
- import { fileURLToPath } from 'node:url';
3
- <% if (warpDrive) { %>import { setConfig } from '@warp-drive/core/build-config';
4
- <% } %>import { buildMacros } from '@embroider/macros/babel';
5
-
6
- <% if (warpDrive) { %>const macros = buildMacros({
7
- configure: (config) => {
8
- setConfig(config, {
9
- // for universal apps this MUST be at least 5.6
10
- compatWith: '5.6',
11
- });
12
- },
13
- });
14
- <% } else { %>const macros = buildMacros();
15
- <% } %>
16
- export default {
17
- plugins: [
18
- [
19
- 'babel-plugin-ember-template-compilation',
20
- {
21
- compilerPath: 'ember-source/dist/ember-template-compiler.js',
22
- transforms: [...macros.templateMacros],
23
- },
24
- ],
25
- [
26
- 'module:decorator-transforms',
27
- {
28
- runtime: {
29
- import: import.meta.resolve('decorator-transforms/runtime-esm'),
30
- },
31
- },
32
- ],
33
- [
34
- '@babel/plugin-transform-runtime',
35
- {
36
- absoluteRuntime: dirname(fileURLToPath(import.meta.url)),
37
- useESModules: true,
38
- regenerator: false,
39
- },
40
- ],
41
- ...macros.babelMacros,
42
- ],
43
-
44
- generatorOpts: {
45
- compact: false,
46
- },
47
- };
@@ -1,55 +0,0 @@
1
- import { dirname } from 'node:path';
2
- import { fileURLToPath } from 'node:url';
3
- <% if (warpDrive) { %>import { setConfig } from '@warp-drive/core/build-config';
4
- <% } %>import { buildMacros } from '@embroider/macros/babel';
5
-
6
- <% if (warpDrive) { %>const macros = buildMacros({
7
- configure: (config) => {
8
- setConfig(config, {
9
- // for universal apps this MUST be at least 5.6
10
- compatWith: '5.6',
11
- });
12
- },
13
- });
14
- <% } else { %>const macros = buildMacros();
15
- <% } %>
16
- export default {
17
- plugins: [
18
- [
19
- '@babel/plugin-transform-typescript',
20
- {
21
- allExtensions: true,
22
- onlyRemoveTypeImports: true,
23
- allowDeclareFields: true,
24
- },
25
- ],
26
- [
27
- 'babel-plugin-ember-template-compilation',
28
- {
29
- compilerPath: 'ember-source/dist/ember-template-compiler.js',
30
- transforms: [...macros.templateMacros],
31
- },
32
- ],
33
- [
34
- 'module:decorator-transforms',
35
- {
36
- runtime: {
37
- import: import.meta.resolve('decorator-transforms/runtime-esm'),
38
- },
39
- },
40
- ],
41
- [
42
- '@babel/plugin-transform-runtime',
43
- {
44
- absoluteRuntime: dirname(fileURLToPath(import.meta.url)),
45
- useESModules: true,
46
- regenerator: false,
47
- },
48
- ],
49
- ...macros.babelMacros,
50
- ],
51
-
52
- generatorOpts: {
53
- compact: false,
54
- },
55
- };
@@ -1,18 +0,0 @@
1
- <% if (warpDrive) { %>import '@warp-drive/ember/install';<% } %>
2
- import Application from '@ember/application';
3
- import compatModules from '@embroider/virtual/compat-modules';
4
- import Resolver from 'ember-resolver';
5
- import config from '<%= modulePrefix %>/config/environment';
6
- import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
7
- import setupInspector from '@embroider/legacy-inspector-support/ember-source-4.12';
8
-
9
- if (macroCondition(isDevelopingApp())) {
10
- importSync('./deprecation-workflow');
11
- }
12
-
13
- export default class App extends Application {
14
- modulePrefix = config.modulePrefix;
15
- podModulePrefix = config.podModulePrefix;
16
- Resolver = Resolver.withModules(compatModules);
17
- inspector = setupInspector(this);
18
- }
@@ -1,38 +0,0 @@
1
- <% if (notMinimal) { %><% if (typescript) { %>// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
- // @ts-expect-error
3
- <% } %>import { getGlobalConfig } from '@embroider/macros/src/addon/runtime';
4
- <% } %>
5
- interface Config {
6
- isTesting?: boolean;
7
- environment: string;
8
- modulePrefix: string;
9
- podModulePrefix?: string;
10
- locationType: 'history' | 'hash' | 'none' | 'auto';
11
- rootURL: string;
12
- EmberENV?: Record<string, unknown>;
13
- APP: Record<string, unknown> & { rootElement?: string; autoboot?: boolean };
14
- }
15
-
16
- const ENV: Config = {
17
- modulePrefix: '<%= name %>',
18
- environment: import.meta.env.DEV ? 'development' : 'production',
19
- rootURL: '/',
20
- locationType: 'history',
21
- EmberENV: {},
22
- APP: {},
23
- };
24
-
25
- export default ENV;
26
- <% if (notMinimal) { %>
27
- export function enterTestMode() {
28
- ENV.locationType = 'none';
29
- ENV.APP.rootElement = '#ember-testing';
30
- ENV.APP.autoboot = false;
31
-
32
- <% if (typescript) { %>// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
33
- <% } %>const config = getGlobalConfig()['@embroider/macros'];
34
-
35
- <% if (typescript) { %>// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
36
- <% } %>if (config) config.isTesting = true;
37
- }
38
- <% } %>
@@ -1,3 +0,0 @@
1
- <template>
2
- {{yield}}
3
- </template>
@@ -1,11 +0,0 @@
1
- import EmberRouter from '@embroider/router';
2
- import config from 'test-app/config/environment';
3
-
4
- export default class Router extends EmberRouter {
5
- location = config.locationType;
6
- rootURL = config.rootURL;
7
- }
8
-
9
- Router.map(function () {
10
- this.route('fancy');
11
- });
@@ -1,6 +0,0 @@
1
- import Route from '@ember/routing/route';
2
- import { service } from '@ember/service';
3
-
4
- export default class FancyRoute extends Route {
5
- @service router;
6
- }
@@ -1,3 +0,0 @@
1
- .purple {
2
- color: rebeccapurple;
3
- }
@@ -1,7 +0,0 @@
1
- import { LinkTo } from '@ember/routing';
2
-
3
- <template>
4
- {{outlet}}
5
-
6
- <LinkTo @route="fancy" data-test-a>Fancy</LinkTo>
7
- </template>
@@ -1,9 +0,0 @@
1
- import Sweet from '../components/sweet.gjs';
2
-
3
- <template>
4
- <Sweet />
5
-
6
- <p class="purple">Fancy</p>
7
-
8
- {{outlet}}
9
- </template>
@@ -1,26 +0,0 @@
1
- import { module, test } from 'qunit';
2
- import { visit, currentURL, click } from '@ember/test-helpers';
3
- import { setupApplicationTest } from 'test-app/tests/helpers';
4
-
5
- module('Acceptance | index', function (hooks) {
6
- setupApplicationTest(hooks);
7
-
8
- test('visiting /', async function (assert) {
9
- await visit('/');
10
-
11
- assert.strictEqual(currentURL(), '/');
12
-
13
- await click('[data-test-a]');
14
-
15
- assert.strictEqual(currentURL(), '/fancy');
16
-
17
- assert.dom('p').hasText('Fancy');
18
-
19
- assert.dom('p.purple').hasStyle(
20
- {
21
- 'color': 'rgb(102, 51, 153)',
22
- },
23
- 'The text should be purple if the app styles are working correctly',
24
- )
25
- });
26
- });
@@ -1,28 +0,0 @@
1
- import { module, test } from 'qunit';
2
- import { setupRenderingTest } from 'test-app/tests/helpers';
3
- import { render } from '@ember/test-helpers';
4
- import Sweet from 'test-app/components/sweet';
5
-
6
- module('Integration | Component | sweet', function (hooks) {
7
- setupRenderingTest(hooks);
8
-
9
- test('it renders', async function (assert) {
10
- // Updating values is achieved using autotracking, just like in app code. For example:
11
- // class State { @tracked myProperty = 0; }; const state = new State();
12
- // and update using state.myProperty = 1; await rerender();
13
- // Handle any actions with function myAction(val) { ... };
14
-
15
- await render(<template><Sweet /></template>);
16
-
17
- assert.dom().hasText('');
18
-
19
- // Template block usage:
20
- await render(<template>
21
- <Sweet>
22
- template block text
23
- </Sweet>
24
- </template>);
25
-
26
- assert.dom().hasText('template block text');
27
- });
28
- });
@@ -1,11 +0,0 @@
1
- import { module, test } from 'qunit';
2
- import { setupTest } from 'test-app/tests/helpers';
3
-
4
- module('Unit | Route | fancy', function (hooks) {
5
- setupTest(hooks);
6
-
7
- test('it exists', function (assert) {
8
- let route = this.owner.lookup('route:fancy');
9
- assert.ok(route);
10
- });
11
- });
@@ -1,3 +0,0 @@
1
- <template>
2
- {{yield}}
3
- </template>
@@ -1,11 +0,0 @@
1
- import EmberRouter from '@embroider/router';
2
- import config from 'test-app/config/environment';
3
-
4
- export default class Router extends EmberRouter {
5
- location = config.locationType;
6
- rootURL = config.rootURL;
7
- }
8
-
9
- Router.map(function () {
10
- this.route('fancy');
11
- });
@@ -1,8 +0,0 @@
1
- import Route from '@ember/routing/route';
2
- import { service } from '@ember/service';
3
-
4
- import type RouterService from '@ember/routing/router-service';
5
-
6
- export default class FancyRoute extends Route {
7
- @service declare router: RouterService;
8
- }
@@ -1,3 +0,0 @@
1
- .purple {
2
- color: rebeccapurple;
3
- }
@@ -1,7 +0,0 @@
1
- import { LinkTo } from '@ember/routing';
2
-
3
- <template>
4
- {{outlet}}
5
-
6
- <LinkTo @route="fancy" data-test-a>Fancy</LinkTo>
7
- </template>