@ember/app-blueprint 0.8.1 → 6.6.0
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.
- package/.prettierignore +1 -2
- package/.release-plan.json +9 -5
- package/CHANGELOG.md +28 -0
- package/eslint.config.mjs +1 -5
- package/files/app/config/environment.ts +24 -9
- package/files/app/templates/_js_application.gjs +2 -2
- package/files/app/templates/_ts_application.gts +2 -2
- package/files/package.json +43 -43
- package/files/tsconfig.json +7 -22
- package/package.json +2 -2
- package/tests/arguments.test.mjs +155 -0
- package/tests/fixtures/tests-js-10/app/components/.gitkeep +0 -0
- package/tests/fixtures/tests-js-10/app/components/sweet.gjs +3 -0
- package/tests/{fixture → fixtures/tests-js-10}/app/router.js +2 -3
- package/tests/fixtures/tests-js-10/app/routes/.gitkeep +0 -0
- package/tests/{fixture/app/routes/styles.js → fixtures/tests-js-10/app/routes/fancy.js} +1 -1
- package/tests/fixtures/tests-js-10/app/styles/app.css +3 -0
- package/tests/fixtures/tests-js-10/app/templates/application.gjs +15 -0
- package/tests/fixtures/tests-js-10/app/templates/fancy.gjs +12 -0
- package/tests/fixtures/tests-js-10/tests/acceptance/index-test.js +26 -0
- package/tests/fixtures/tests-js-10/tests/integration/components/sweet-test.gjs +28 -0
- package/tests/fixtures/tests-js-10/tests/routes/fancy-test.js +11 -0
- package/tests/{fixture-ts/testem-proxy.js → fixtures/tests-js-20/testem-dev.js} +26 -2
- package/tests/fixtures/tests-ts-10/app/components/.gitkeep +0 -0
- package/tests/fixtures/tests-ts-10/app/components/sweet.gts +3 -0
- package/tests/{fixture-ts → fixtures/tests-ts-10}/app/router.ts +2 -3
- package/tests/fixtures/tests-ts-10/app/routes/.gitkeep +0 -0
- package/tests/{fixture-ts/app/routes/styles.ts → fixtures/tests-ts-10/app/routes/fancy.ts} +1 -1
- package/tests/fixtures/tests-ts-10/app/styles/app.css +3 -0
- package/tests/fixtures/tests-ts-10/app/templates/application.gts +15 -0
- package/tests/fixtures/tests-ts-10/app/templates/fancy.gts +12 -0
- package/tests/fixtures/tests-ts-10/tests/acceptance/index-test.ts +26 -0
- package/tests/fixtures/tests-ts-10/tests/integration/components/sweet-test.gjs +28 -0
- package/tests/fixtures/tests-ts-10/tests/routes/fancy-test.js +11 -0
- package/tests/generators.test.mjs +60 -0
- package/tests/helpers.mjs +26 -67
- package/tests/lint.test.mjs +44 -0
- package/tests/tests.test.mjs +218 -0
- package/vitest.config.ts +2 -2
- package/tests/default.test.mjs +0 -161
- package/tests/fixture/app/components/custom-component.hbs +0 -3
- package/tests/fixture/app/styles/app.css +0 -5
- package/tests/fixture/app/templates/application.hbs +0 -3
- package/tests/fixture/app/templates/custom-component.hbs +0 -1
- package/tests/fixture/app/templates/index.hbs +0 -1
- package/tests/fixture/app/templates/styles.hbs +0 -5
- package/tests/fixture/testem-proxy.js +0 -35
- package/tests/fixture/tests/acceptance/custom-component-test.js +0 -14
- package/tests/fixture/tests/acceptance/styles-test.js +0 -18
- package/tests/fixture-ts/app/styles/app.css +0 -5
- package/tests/fixture-ts/app/templates/components/custom.gts +0 -5
- package/tests/fixture-ts/app/templates/custom-component.gts +0 -5
- package/tests/fixture-ts/app/templates/index.gts +0 -5
- package/tests/fixture-ts/app/templates/styles.gts +0 -7
- package/tests/fixture-ts/tests/acceptance/custom-component-test.ts +0 -14
- package/tests/fixture-ts/tests/acceptance/styles-test.ts +0 -18
- package/tests/typescript.test.mjs +0 -24
- /package/tests/{fixture → fixtures/tests-js-10}/app/initializers/test-init.js +0 -0
- /package/tests/{fixture → fixtures/tests-js-10}/app/instance-initializers/test-instance-init.js +0 -0
- /package/tests/{fixture → fixtures/tests-js-10}/tests/acceptance/app-init-test.js +0 -0
- /package/tests/{fixture → fixtures/tests-js-10}/tests/acceptance/welcome-page-test.js +0 -0
- /package/tests/{fixture-ts → fixtures/tests-ts-10}/app/initializers/test-init.ts +0 -0
- /package/tests/{fixture-ts → fixtures/tests-ts-10}/app/instance-initializers/test-instance-init.ts +0 -0
- /package/tests/{fixture-ts → fixtures/tests-ts-10}/tests/acceptance/app-init-test.ts +0 -0
- /package/tests/{fixture-ts → fixtures/tests-ts-10}/tests/acceptance/welcome-page-test.ts +0 -0
package/tests/default.test.mjs
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { existsSync, writeFileSync } from 'fs';
|
|
4
|
-
import stripAnsi from 'strip-ansi';
|
|
5
|
-
import { newProjectWithFixtures } from './helpers.mjs';
|
|
6
|
-
|
|
7
|
-
const SCENARIOS = [
|
|
8
|
-
{
|
|
9
|
-
name: 'defaults',
|
|
10
|
-
flags: [],
|
|
11
|
-
fixturePath: join(import.meta.dirname, 'fixture'),
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'compat (v1 addon support)',
|
|
15
|
-
// @glimmer/component >= 2.0.0 is a v2 addon, which we don't need when testing "compat mode"
|
|
16
|
-
// this test is "compat mode"
|
|
17
|
-
// compat mode forces us to use v1 addon infra, ember-cli, etc
|
|
18
|
-
flags: [
|
|
19
|
-
/* none, default */
|
|
20
|
-
],
|
|
21
|
-
packageJson: {
|
|
22
|
-
devDependencies: {
|
|
23
|
-
'@glimmer/component': '^1.1.2',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
fixturePath: join(import.meta.dirname, 'fixture'),
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'typescript',
|
|
30
|
-
flags: ['--typescript'],
|
|
31
|
-
fixturePath: join(import.meta.dirname, 'fixture-ts'),
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
describe('basic functionality', function () {
|
|
36
|
-
for (let { name, flags, packageJson, fixturePath } of SCENARIOS) {
|
|
37
|
-
describe(name, function () {
|
|
38
|
-
let project = newProjectWithFixtures({
|
|
39
|
-
fixturePath,
|
|
40
|
-
flags,
|
|
41
|
-
packageJson,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('verify files', async function () {
|
|
45
|
-
expect(
|
|
46
|
-
!existsSync(join(project.dir(), 'app/index.html')),
|
|
47
|
-
'the app index.html has been removed',
|
|
48
|
-
);
|
|
49
|
-
expect(
|
|
50
|
-
existsSync(join(project.dir(), 'index.html')),
|
|
51
|
-
'the root index.html has been added',
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('successfully lints', async function () {
|
|
56
|
-
let result = await project.execa('pnpm', ['lint']);
|
|
57
|
-
|
|
58
|
-
console.log(result.stdout);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('successfully builds', async function () {
|
|
62
|
-
let result = await project.execa('pnpm', ['build']);
|
|
63
|
-
|
|
64
|
-
console.log(result.stdout);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('successfully runs tests', async function () {
|
|
68
|
-
let result;
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
result = await project.execa('pnpm', ['test']);
|
|
72
|
-
} catch (err) {
|
|
73
|
-
console.log(err.stdout, err.stderr);
|
|
74
|
-
throw 'Failed to successfully run test';
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// make sure that each of the tests that we expect actually show up
|
|
78
|
-
// alternatively we can change this to search for `pass 3`
|
|
79
|
-
expect(result.stdout).to.contain(
|
|
80
|
-
'Acceptance | welcome page: visiting /index shows the welcome page',
|
|
81
|
-
);
|
|
82
|
-
expect(result.stdout).to.contain(
|
|
83
|
-
'Acceptance | styles: visiting /styles',
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
console.log(result.stdout);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('successfully runs tests in dev mode', async function () {
|
|
90
|
-
await project.$`pnpm install --save-dev testem http-proxy`;
|
|
91
|
-
let appURL;
|
|
92
|
-
|
|
93
|
-
let server;
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
server = project.execa('pnpm', ['start']);
|
|
97
|
-
|
|
98
|
-
await new Promise((resolve) => {
|
|
99
|
-
server.stdout.on('data', (line) => {
|
|
100
|
-
let result = /Local:\s+(https?:\/\/.*)\//g.exec(
|
|
101
|
-
stripAnsi(line.toString()),
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
if (result) {
|
|
105
|
-
appURL = result[1];
|
|
106
|
-
resolve();
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
writeFileSync(
|
|
112
|
-
join(project.dir(), 'testem-dev.js'),
|
|
113
|
-
`module.exports = {
|
|
114
|
-
test_page: 'tests/index.html?hidepassed',
|
|
115
|
-
disable_watching: true,
|
|
116
|
-
launch_in_ci: ['Chrome'],
|
|
117
|
-
launch_in_dev: ['Chrome'],
|
|
118
|
-
browser_start_timeout: 120,
|
|
119
|
-
browser_args: {
|
|
120
|
-
Chrome: {
|
|
121
|
-
ci: [
|
|
122
|
-
// --no-sandbox is needed when running Chrome inside a container
|
|
123
|
-
process.env.CI ? '--no-sandbox' : null,
|
|
124
|
-
'--headless',
|
|
125
|
-
'--disable-dev-shm-usage',
|
|
126
|
-
'--disable-software-rasterizer',
|
|
127
|
-
'--mute-audio',
|
|
128
|
-
'--remote-debugging-port=0',
|
|
129
|
-
'--window-size=1440,900',
|
|
130
|
-
].filter(Boolean),
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
middleware: [
|
|
134
|
-
require(__dirname + '/testem-proxy.js')('${appURL}')
|
|
135
|
-
],
|
|
136
|
-
};
|
|
137
|
-
`,
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
let testResult = await project.execa('pnpm', [
|
|
141
|
-
'testem',
|
|
142
|
-
'--file',
|
|
143
|
-
'testem-dev.js',
|
|
144
|
-
'ci',
|
|
145
|
-
]);
|
|
146
|
-
expect(testResult.exitCode).to.eq(0, testResult.output);
|
|
147
|
-
} finally {
|
|
148
|
-
server?.kill('SIGINT');
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it('successfully optimizes deps', function () {
|
|
153
|
-
return project.execa('pnpm', ['vite', 'optimize', '--force']);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('can run generators', function () {
|
|
157
|
-
return project.execa('pnpm', ['ember', 'g', 'route', 'fancy']);
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<CustomComponent />
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<WelcomePage />
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const httpProxy = require('http-proxy');
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
This can be installed as a testem middleware to make testem run against an
|
|
5
|
-
arbitrary real webserver at targetURL.
|
|
6
|
-
|
|
7
|
-
It allows testem to handle the well-known testem-specific paths and proxies
|
|
8
|
-
everything else, while rewriting the testem-added prefix out of your
|
|
9
|
-
"/tests/index.html" URL.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
module.exports = function testemProxy(targetURL) {
|
|
13
|
-
return function testemProxyHandler(app) {
|
|
14
|
-
const proxy = httpProxy.createProxyServer({
|
|
15
|
-
changeOrigin: true,
|
|
16
|
-
ignorePath: true,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
proxy.on('error', (err, _req, res) => {
|
|
20
|
-
res && res.status && res.status(500).json(err);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
app.all('*', (req, res, next) => {
|
|
24
|
-
let url = req.url;
|
|
25
|
-
if (url === '/testem.js' || url.startsWith('/testem/')) {
|
|
26
|
-
return next();
|
|
27
|
-
}
|
|
28
|
-
let m = /^(\/\d+)\/tests\/index.html/.exec(url);
|
|
29
|
-
if (m) {
|
|
30
|
-
url = url.slice(m[1].length);
|
|
31
|
-
}
|
|
32
|
-
proxy.web(req, res, { target: targetURL + url });
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { module, test } from 'qunit';
|
|
2
|
-
import { visit, currentURL } from '@ember/test-helpers';
|
|
3
|
-
import { setupApplicationTest } from 'test-app/tests/helpers';
|
|
4
|
-
|
|
5
|
-
module('Acceptance | custom-component page', function (hooks) {
|
|
6
|
-
setupApplicationTest(hooks);
|
|
7
|
-
|
|
8
|
-
test('visiting /custom-component', async function (assert) {
|
|
9
|
-
await visit('/custom-component');
|
|
10
|
-
|
|
11
|
-
assert.strictEqual(currentURL(), '/custom-component');
|
|
12
|
-
assert.dom('#custom-component').containsText('I am a custom component');
|
|
13
|
-
});
|
|
14
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { module, test } from 'qunit';
|
|
2
|
-
import { visit } from '@ember/test-helpers';
|
|
3
|
-
import { setupApplicationTest } from 'test-app/tests/helpers';
|
|
4
|
-
|
|
5
|
-
module('Acceptance | styles', function (hooks) {
|
|
6
|
-
setupApplicationTest(hooks);
|
|
7
|
-
|
|
8
|
-
test('visiting /styles', async function (assert) {
|
|
9
|
-
await visit('/styles');
|
|
10
|
-
|
|
11
|
-
assert.dom('.styles-test').hasStyle(
|
|
12
|
-
{
|
|
13
|
-
'background-color': 'rgb(0, 0, 255)',
|
|
14
|
-
},
|
|
15
|
-
'The background should be blue if the app styles are working correctly',
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { module, test } from 'qunit';
|
|
2
|
-
import { visit, currentURL } from '@ember/test-helpers';
|
|
3
|
-
import { setupApplicationTest } from 'test-app/tests/helpers';
|
|
4
|
-
|
|
5
|
-
module('Acceptance | custom-component page', function (hooks) {
|
|
6
|
-
setupApplicationTest(hooks);
|
|
7
|
-
|
|
8
|
-
test('visiting /custom-component', async function (assert) {
|
|
9
|
-
await visit('/custom-component');
|
|
10
|
-
|
|
11
|
-
assert.strictEqual(currentURL(), '/custom-component');
|
|
12
|
-
assert.dom('#custom-component').containsText('I am a custom component');
|
|
13
|
-
});
|
|
14
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { module, test } from 'qunit';
|
|
2
|
-
import { visit } from '@ember/test-helpers';
|
|
3
|
-
import { setupApplicationTest } from 'test-app/tests/helpers';
|
|
4
|
-
|
|
5
|
-
module('Acceptance | styles', function (hooks) {
|
|
6
|
-
setupApplicationTest(hooks);
|
|
7
|
-
|
|
8
|
-
test('visiting /styles', async function (assert) {
|
|
9
|
-
await visit('/styles');
|
|
10
|
-
|
|
11
|
-
assert.dom('.styles-test').hasStyle(
|
|
12
|
-
{
|
|
13
|
-
'background-color': 'rgb(0, 0, 255)',
|
|
14
|
-
},
|
|
15
|
-
'The background should be blue if the app styles are working correctly',
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { existsSync } from 'fs';
|
|
4
|
-
import { newProjectWithFixtures } from './helpers.mjs';
|
|
5
|
-
|
|
6
|
-
describe('typescript', function () {
|
|
7
|
-
let project = newProjectWithFixtures({
|
|
8
|
-
fixturePath: join(__dirname, 'fixture-ts'),
|
|
9
|
-
flags: ['--typescript'],
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it('verify files', async function () {
|
|
13
|
-
expect(
|
|
14
|
-
existsSync(join(project.dir(), 'tsconfig.json')),
|
|
15
|
-
'the root tsconfig.json has been added',
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('glint passes', async function () {
|
|
20
|
-
let result = await project.execa('pnpm', ['glint']);
|
|
21
|
-
|
|
22
|
-
console.log(result.stdout);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
File without changes
|
/package/tests/{fixture → fixtures/tests-js-10}/app/instance-initializers/test-instance-init.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/tests/{fixture-ts → fixtures/tests-ts-10}/app/instance-initializers/test-instance-init.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|