@ember/app-blueprint 0.0.0 → 0.1.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.
- package/.editorconfig +19 -0
- package/.github/workflows/ci.yml +35 -0
- package/.github/workflows/plan-release.yml +94 -0
- package/.github/workflows/publish.yml +43 -0
- package/.prettierrc.cjs +13 -0
- package/.release-plan.json +18 -0
- package/CHANGELOG.md +29 -0
- package/RELEASE.md +27 -0
- package/eslint.config.mjs +30 -0
- package/files/.editorconfig +19 -0
- package/files/.ember-cli +7 -0
- package/files/.github/workflows/ci.yml +53 -0
- package/files/.prettierignore +13 -0
- package/files/.prettierrc.js +39 -0
- package/files/.stylelintignore +5 -0
- package/files/.stylelintrc.js +5 -0
- package/files/.template-lintrc.js +5 -0
- package/files/.watchmanconfig +3 -0
- package/files/README.md +58 -0
- package/files/_js_babel.config.cjs +42 -0
- package/files/_js_eslint.config.mjs +115 -0
- package/files/_ts_babel.config.cjs +50 -0
- package/files/_ts_eslint.config.mjs +135 -0
- package/files/app/app.ts +18 -0
- package/files/app/components/.gitkeep +0 -0
- package/files/app/config/environment.ts +17 -0
- package/files/app/controllers/.gitkeep +0 -0
- package/files/app/deprecation-workflow.ts +24 -0
- package/files/app/helpers/.gitkeep +0 -0
- package/files/app/models/.gitkeep +0 -0
- package/files/app/router.ts +11 -0
- package/files/app/routes/.gitkeep +0 -0
- package/files/app/styles/app.css +1 -0
- package/files/app/templates/_js_application.hbs +10 -0
- package/files/app/templates/_ts_application.gts +15 -0
- package/files/config/ember-cli-update.json +16 -0
- package/files/config/environment.js +48 -0
- package/files/config/optional-features.json +7 -0
- package/files/config/targets.js +11 -0
- package/files/ember-cli-build.js +22 -0
- package/files/gitignore +26 -0
- package/files/index.html +29 -0
- package/files/package.json +112 -0
- package/files/public/robots.txt +3 -0
- package/files/testem.js +25 -0
- package/files/tests/helpers/index.ts +43 -0
- package/files/tests/index.html +43 -0
- package/files/tests/integration/.gitkeep +0 -0
- package/files/tests/test-helper.ts +15 -0
- package/files/tests/unit/.gitkeep +0 -0
- package/files/tsconfig.json +31 -0
- package/files/vite.config.mjs +15 -0
- package/index.js +158 -0
- package/lib/directory-for-package-name.js +31 -0
- package/lib/prepend-emoji.js +12 -0
- package/package.json +33 -6
- package/tests/default.test.mjs +145 -0
- package/tests/fixture/app/components/custom-component.hbs +3 -0
- package/tests/fixture/app/initializers/test-init.js +6 -0
- package/tests/fixture/app/instance-initializers/test-instance-init.js +6 -0
- package/tests/fixture/app/router.js +12 -0
- package/tests/fixture/app/routes/styles.js +6 -0
- package/tests/fixture/app/styles/app.css +5 -0
- package/tests/fixture/app/templates/application.hbs +3 -0
- package/tests/fixture/app/templates/custom-component.hbs +1 -0
- package/tests/fixture/app/templates/index.hbs +1 -0
- package/tests/fixture/app/templates/styles.hbs +5 -0
- package/tests/fixture/testem-proxy.js +35 -0
- package/tests/fixture/tests/acceptance/app-init-test.js +13 -0
- package/tests/fixture/tests/acceptance/custom-component-test.js +14 -0
- package/tests/fixture/tests/acceptance/styles-test.js +18 -0
- package/tests/fixture/tests/acceptance/welcome-page-test.js +14 -0
- package/tests/fixture-ts/app/initializers/test-init.ts +10 -0
- package/tests/fixture-ts/app/instance-initializers/test-instance-init.ts +10 -0
- package/tests/fixture-ts/app/router.ts +12 -0
- package/tests/fixture-ts/app/routes/styles.ts +8 -0
- package/tests/fixture-ts/app/styles/app.css +5 -0
- package/tests/fixture-ts/app/templates/components/custom.gts +5 -0
- package/tests/fixture-ts/app/templates/custom-component.gts +5 -0
- package/tests/fixture-ts/app/templates/index.gts +5 -0
- package/tests/fixture-ts/app/templates/styles.gts +7 -0
- package/tests/fixture-ts/testem-proxy.js +36 -0
- package/tests/fixture-ts/tests/acceptance/app-init-test.ts +22 -0
- package/tests/fixture-ts/tests/acceptance/custom-component-test.ts +14 -0
- package/tests/fixture-ts/tests/acceptance/styles-test.ts +18 -0
- package/tests/fixture-ts/tests/acceptance/welcome-page-test.ts +14 -0
- package/tests/helpers.mjs +57 -0
- package/tests/typescript.test.mjs +24 -0
- package/vitest.config.ts +10 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= name %>",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Small description for <%= name %> goes here",
|
|
6
|
+
"repository": "",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "",
|
|
9
|
+
"directories": {
|
|
10
|
+
"doc": "doc",
|
|
11
|
+
"test": "tests"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "vite build",
|
|
15
|
+
"format": "prettier . --cache --write",
|
|
16
|
+
"lint": "concurrently \"<%= packageManager %>:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
|
|
17
|
+
"lint:css": "stylelint \"**/*.css\"",
|
|
18
|
+
"lint:css:fix": "concurrently \"<%= packageManager %>:lint:css -- --fix\"",
|
|
19
|
+
"lint:fix": "concurrently \"<%= packageManager %>:lint:*:fix\" --names \"fix:\" --prefixColors auto && <%= invokeScriptPrefix %> format",
|
|
20
|
+
"lint:format": "prettier . --cache --check",
|
|
21
|
+
"lint:hbs": "ember-template-lint .",
|
|
22
|
+
"lint:hbs:fix": "ember-template-lint . --fix",
|
|
23
|
+
"lint:js": "eslint . --cache",
|
|
24
|
+
"lint:js:fix": "eslint . --fix<% if (typescript) { %>",
|
|
25
|
+
"lint:types": "glint<% } %>",
|
|
26
|
+
"start": "vite",
|
|
27
|
+
"test": "concurrently \"<%= packageManager %>:lint\" \"<%= packageManager %>:test:*\" --names \"lint,test:\" --prefixColors auto",
|
|
28
|
+
"test:ember": "vite build --mode test && ember test --path dist"
|
|
29
|
+
},
|
|
30
|
+
"exports": {
|
|
31
|
+
"./tests/*": "./tests/*",
|
|
32
|
+
"./*": "./app/*"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@babel/core": "^7.26.10",
|
|
36
|
+
"@babel/runtime": "^7.0.0",
|
|
37
|
+
"@babel/plugin-transform-runtime": "^7.26.10<% if (typescript) { %>",
|
|
38
|
+
"@babel/plugin-transform-typescript":"^7.27.0<% } %>",
|
|
39
|
+
"@babel/eslint-parser": "^7.26.10<% if (typescript && emberData) { %>",
|
|
40
|
+
"@ember-data/adapter": "~5.3.12",
|
|
41
|
+
"@ember-data/graph": "~5.3.12",
|
|
42
|
+
"@ember-data/json-api": "~5.3.12",
|
|
43
|
+
"@ember-data/legacy-compat": "~5.3.12",
|
|
44
|
+
"@ember-data/model": "~5.3.12",
|
|
45
|
+
"@ember-data/request": "~5.3.12",
|
|
46
|
+
"@ember-data/request-utils": "~5.3.12",
|
|
47
|
+
"@ember-data/serializer": "~5.3.12",
|
|
48
|
+
"@ember-data/store": "~5.3.12",
|
|
49
|
+
"@ember-data/tracking": "~5.3.12<% } %><% if (typescript) { %>",
|
|
50
|
+
"@ember/app-tsconfig": "^1.0.3<% } %>",
|
|
51
|
+
"@ember/optional-features": "^2.2.0",
|
|
52
|
+
"@ember/string": "^4.0.0",
|
|
53
|
+
"@ember/test-helpers": "^5.1.0",
|
|
54
|
+
"@ember/test-waiters": "^4.1.0",
|
|
55
|
+
"@embroider/macros": "^1.16.12",
|
|
56
|
+
"@embroider/core": "^4.0.0-alpha.0",
|
|
57
|
+
"@embroider/vite": "^1.0.0-alpha.0",
|
|
58
|
+
"@embroider/compat": "^4.0.0-alpha.0",
|
|
59
|
+
"@embroider/router": "^3.0.1",
|
|
60
|
+
"@embroider/config-meta-loader": "^1.0.0-alpha.0",
|
|
61
|
+
"@eslint/js": "^9.23.0",
|
|
62
|
+
"@glimmer/component": "^2.0.0<% if (typescript) { %>",
|
|
63
|
+
"@glint/core": "^1.5.2",
|
|
64
|
+
"@glint/environment-ember-loose": "^1.5.2",
|
|
65
|
+
"@glint/environment-ember-template-imports": "^1.5.2",
|
|
66
|
+
"@glint/template": "^1.5.2<% } %>",
|
|
67
|
+
"@rollup/plugin-babel": "^6.0.4<% if (typescript) { %>",
|
|
68
|
+
"@types/qunit": "^2.19.12",
|
|
69
|
+
"@types/rsvp": "^4.0.9<% if (emberData) {%>",
|
|
70
|
+
"@warp-drive/core-types": "~0.0.2<% }} %>",
|
|
71
|
+
"babel-plugin-ember-template-compilation": "^2.4.1",
|
|
72
|
+
"concurrently": "^9.1.2",
|
|
73
|
+
"decorator-transforms": "^2.3.0",
|
|
74
|
+
"ember-auto-import": "^2.10.0",
|
|
75
|
+
"ember-cli": "~6.3.0",
|
|
76
|
+
"ember-cli-babel": "^8.2.0",
|
|
77
|
+
"ember-cli-deprecation-workflow": "^3.3.0",
|
|
78
|
+
"ember-cli-htmlbars": "^6.3.0<% if (emberData) { %>",
|
|
79
|
+
"ember-data": "~5.4.1<% } %>",
|
|
80
|
+
"ember-load-initializers": "^3.0.1",
|
|
81
|
+
"ember-modifier": "^4.2.0",
|
|
82
|
+
"ember-page-title": "^9.0.1",
|
|
83
|
+
"ember-qunit": "^9.0.1",
|
|
84
|
+
"ember-resolver": "^13.1.0",
|
|
85
|
+
"ember-source": "~6.3.0",
|
|
86
|
+
"ember-template-imports": "^4.3.0",
|
|
87
|
+
"ember-template-lint": "^6.1.0<% if (welcome) { %>",
|
|
88
|
+
"ember-welcome-page": "^7.0.2<% } %>",
|
|
89
|
+
"eslint": "^9.23.0",
|
|
90
|
+
"eslint-config-prettier": "^9.1.0",
|
|
91
|
+
"eslint-plugin-ember": "^12.5.0",
|
|
92
|
+
"eslint-plugin-n": "^17.16.2",
|
|
93
|
+
"eslint-plugin-qunit": "^8.1.2",
|
|
94
|
+
"globals": "^15.15.0",
|
|
95
|
+
"prettier": "^3.5.3",
|
|
96
|
+
"prettier-plugin-ember-template-tag": "^2.0.4",
|
|
97
|
+
"qunit": "^2.24.1",
|
|
98
|
+
"qunit-dom": "^3.4.0",
|
|
99
|
+
"stylelint": "^16.16.0",
|
|
100
|
+
"stylelint-config-standard": "^36.0.1",
|
|
101
|
+
"tracked-built-ins": "^3.4.0<% if (typescript) { %>",
|
|
102
|
+
"typescript": "^5.8.2",
|
|
103
|
+
"typescript-eslint": "^8.27.0<% } %>",
|
|
104
|
+
"vite": "^6.0.0"
|
|
105
|
+
},
|
|
106
|
+
"engines": {
|
|
107
|
+
"node": ">= 18"
|
|
108
|
+
},
|
|
109
|
+
"ember": {
|
|
110
|
+
"edition": "octane"
|
|
111
|
+
}
|
|
112
|
+
}
|
package/files/testem.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
if (typeof module !== 'undefined') {
|
|
4
|
+
module.exports = {
|
|
5
|
+
test_page: 'tests/index.html?hidepassed',
|
|
6
|
+
disable_watching: true,
|
|
7
|
+
launch_in_ci: ['Chrome'],
|
|
8
|
+
launch_in_dev: ['Chrome'],
|
|
9
|
+
browser_start_timeout: 120,
|
|
10
|
+
browser_args: {
|
|
11
|
+
Chrome: {
|
|
12
|
+
ci: [
|
|
13
|
+
// --no-sandbox is needed when running Chrome inside a container
|
|
14
|
+
process.env.CI ? '--no-sandbox' : null,
|
|
15
|
+
'--headless',
|
|
16
|
+
'--disable-dev-shm-usage',
|
|
17
|
+
'--disable-software-rasterizer',
|
|
18
|
+
'--mute-audio',
|
|
19
|
+
'--remote-debugging-port=0',
|
|
20
|
+
'--window-size=1440,900',
|
|
21
|
+
].filter(Boolean),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setupApplicationTest as upstreamSetupApplicationTest,
|
|
3
|
+
setupRenderingTest as upstreamSetupRenderingTest,
|
|
4
|
+
setupTest as upstreamSetupTest,
|
|
5
|
+
type SetupTestOptions,
|
|
6
|
+
} from 'ember-qunit';
|
|
7
|
+
|
|
8
|
+
// This file exists to provide wrappers around ember-qunit's
|
|
9
|
+
// test setup functions. This way, you can easily extend the setup that is
|
|
10
|
+
// needed per test type.
|
|
11
|
+
|
|
12
|
+
function setupApplicationTest(hooks: NestedHooks, options?: SetupTestOptions) {
|
|
13
|
+
upstreamSetupApplicationTest(hooks, options);
|
|
14
|
+
|
|
15
|
+
// Additional setup for application tests can be done here.
|
|
16
|
+
//
|
|
17
|
+
// For example, if you need an authenticated session for each
|
|
18
|
+
// application test, you could do:
|
|
19
|
+
//
|
|
20
|
+
// hooks.beforeEach(async function () {
|
|
21
|
+
// await authenticateSession(); // ember-simple-auth
|
|
22
|
+
// });
|
|
23
|
+
//
|
|
24
|
+
// This is also a good place to call test setup functions coming
|
|
25
|
+
// from other addons:
|
|
26
|
+
//
|
|
27
|
+
// setupIntl(hooks, 'en-us'); // ember-intl
|
|
28
|
+
// setupMirage(hooks); // ember-cli-mirage
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions) {
|
|
32
|
+
upstreamSetupRenderingTest(hooks, options);
|
|
33
|
+
|
|
34
|
+
// Additional setup for rendering tests can be done here.
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function setupTest(hooks: NestedHooks, options?: SetupTestOptions) {
|
|
38
|
+
upstreamSetupTest(hooks, options);
|
|
39
|
+
|
|
40
|
+
// Additional setup for unit tests can be done here.
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { setupApplicationTest, setupRenderingTest, setupTest };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title><%= namespace %> Tests</title>
|
|
6
|
+
<meta name="description" content="">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
|
|
9
|
+
{{content-for "head"}}
|
|
10
|
+
{{content-for "test-head"}}
|
|
11
|
+
|
|
12
|
+
<link rel="stylesheet" href="/@embroider/virtual/vendor.css">
|
|
13
|
+
<link rel="stylesheet" href="/@embroider/virtual/app.css">
|
|
14
|
+
<link rel="stylesheet" href="/@embroider/virtual/test-support.css">
|
|
15
|
+
|
|
16
|
+
{{content-for "head-footer"}}
|
|
17
|
+
{{content-for "test-head-footer"}}
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
{{content-for "body"}}
|
|
21
|
+
{{content-for "test-body"}}
|
|
22
|
+
|
|
23
|
+
<div id="qunit"></div>
|
|
24
|
+
<div id="qunit-fixture">
|
|
25
|
+
<div id="ember-testing-container">
|
|
26
|
+
<div id="ember-testing"></div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<script src="/testem.js" integrity="" data-embroider-ignore></script>
|
|
31
|
+
<script src="/@embroider/virtual/vendor.js"></script>
|
|
32
|
+
<script src="/@embroider/virtual/test-support.js"></script>
|
|
33
|
+
<script type="module">import "ember-testing";</script>
|
|
34
|
+
|
|
35
|
+
<script type="module">
|
|
36
|
+
import { start } from './test-helper';
|
|
37
|
+
import.meta.glob("./**/*.{js,ts,gjs,gts}", { eager: true });
|
|
38
|
+
start();
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
{{content-for "body-footer"}}
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Application from '<%= modulePrefix %>/app';
|
|
2
|
+
import config from '<%= modulePrefix %>/config/environment';
|
|
3
|
+
import * as QUnit from 'qunit';
|
|
4
|
+
import { setApplication } from '@ember/test-helpers';
|
|
5
|
+
import { setup } from 'qunit-dom';
|
|
6
|
+
import { start as qunitStart, setupEmberOnerrorValidation } from 'ember-qunit';
|
|
7
|
+
|
|
8
|
+
export function start() {
|
|
9
|
+
setApplication(Application.create(config.APP));
|
|
10
|
+
|
|
11
|
+
setup(QUnit.assert);
|
|
12
|
+
setupEmberOnerrorValidation();
|
|
13
|
+
|
|
14
|
+
qunitStart();
|
|
15
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@ember/app-tsconfig",
|
|
3
|
+
"include": [
|
|
4
|
+
"app", "tests", "types"
|
|
5
|
+
],
|
|
6
|
+
"glint": {
|
|
7
|
+
"environment": [
|
|
8
|
+
"ember-loose",
|
|
9
|
+
"ember-template-imports"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"compilerOptions": {
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"paths": {
|
|
15
|
+
"<%= name %>/tests/*": [
|
|
16
|
+
"./tests/*"
|
|
17
|
+
],
|
|
18
|
+
"<%= name %>/*": [
|
|
19
|
+
"./app/*"
|
|
20
|
+
],
|
|
21
|
+
"*": [
|
|
22
|
+
"./types/*"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"types": [
|
|
26
|
+
"ember-source/types",
|
|
27
|
+
"@embroider/core/virtual",
|
|
28
|
+
"vite/client"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import { extensions, classicEmberSupport, ember } from '@embroider/vite';
|
|
3
|
+
import { babel } from '@rollup/plugin-babel';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [
|
|
7
|
+
classicEmberSupport(),
|
|
8
|
+
ember(),
|
|
9
|
+
// extra plugins here
|
|
10
|
+
babel({
|
|
11
|
+
babelHelpers: 'runtime',
|
|
12
|
+
extensions,
|
|
13
|
+
}),
|
|
14
|
+
],
|
|
15
|
+
});
|
package/index.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const stringUtil = require('ember-cli-string-utils');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const directoryForPackageName = require('./lib/directory-for-package-name');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
description: 'The default blueprint for ember-cli projects.',
|
|
9
|
+
|
|
10
|
+
shouldTransformTypeScript: true,
|
|
11
|
+
|
|
12
|
+
filesToRemove: [
|
|
13
|
+
'app/styles/.gitkeep',
|
|
14
|
+
'app/templates/.gitkeep',
|
|
15
|
+
'app/views/.gitkeep',
|
|
16
|
+
'public/.gitkeep',
|
|
17
|
+
'Brocfile.js',
|
|
18
|
+
'testem.json',
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
locals(options) {
|
|
22
|
+
let entity = options.entity;
|
|
23
|
+
let rawName = entity.name;
|
|
24
|
+
let name = stringUtil.dasherize(rawName);
|
|
25
|
+
let namespace = stringUtil.classify(rawName);
|
|
26
|
+
|
|
27
|
+
let hasOptions = !options.welcome || options.packageManager || options.ciProvider;
|
|
28
|
+
let blueprintOptions = '';
|
|
29
|
+
if (hasOptions) {
|
|
30
|
+
let indent = `\n `;
|
|
31
|
+
let outdent = `\n `;
|
|
32
|
+
|
|
33
|
+
blueprintOptions =
|
|
34
|
+
indent +
|
|
35
|
+
[
|
|
36
|
+
!options.welcome && '"--no-welcome"',
|
|
37
|
+
options.packageManager === 'yarn' && '"--yarn"',
|
|
38
|
+
options.packageManager === 'pnpm' && '"--pnpm"',
|
|
39
|
+
options.ciProvider && `"--ci-provider=${options.ciProvider}"`,
|
|
40
|
+
options.typescript && `"--typescript"`,
|
|
41
|
+
!options.emberData && `"--no-ember-data"`,
|
|
42
|
+
]
|
|
43
|
+
.filter(Boolean)
|
|
44
|
+
.join(',\n ') +
|
|
45
|
+
outdent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let invokeScriptPrefix = 'npm run';
|
|
49
|
+
let execBinPrefix = 'npm exec';
|
|
50
|
+
|
|
51
|
+
if (options.packageManager === 'yarn') {
|
|
52
|
+
invokeScriptPrefix = 'yarn';
|
|
53
|
+
execBinPrefix = 'yarn';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (options.packageManager === 'pnpm') {
|
|
57
|
+
invokeScriptPrefix = 'pnpm';
|
|
58
|
+
execBinPrefix = 'pnpm';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
appDirectory: directoryForPackageName(name),
|
|
63
|
+
name,
|
|
64
|
+
modulePrefix: name,
|
|
65
|
+
namespace,
|
|
66
|
+
blueprintVersion: require('./package').version,
|
|
67
|
+
yarn: options.packageManager === 'yarn',
|
|
68
|
+
pnpm: options.packageManager === 'pnpm',
|
|
69
|
+
npm: options.packageManager !== 'yarn' && options.packageManager !== 'pnpm',
|
|
70
|
+
invokeScriptPrefix,
|
|
71
|
+
execBinPrefix,
|
|
72
|
+
welcome: options.welcome,
|
|
73
|
+
blueprint: 'app',
|
|
74
|
+
blueprintOptions,
|
|
75
|
+
lang: options.lang,
|
|
76
|
+
emberData: options.emberData,
|
|
77
|
+
ciProvider: options.ciProvider,
|
|
78
|
+
typescript: options.typescript,
|
|
79
|
+
packageManager: options.packageManager ?? 'npm',
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
files(options) {
|
|
84
|
+
if (this._files) {
|
|
85
|
+
return this._files;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let files = this._super();
|
|
89
|
+
|
|
90
|
+
if (options.ciProvider !== 'github') {
|
|
91
|
+
files = files.filter((file) => file.indexOf('.github') < 0);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!options.typescript) {
|
|
95
|
+
files = files.filter(
|
|
96
|
+
(file) => !['tsconfig.json', 'app/config/', 'types/'].includes(file) && !file.endsWith('.d.ts')
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (!options.emberData) {
|
|
101
|
+
files = files.filter((file) => !file.includes('models/'));
|
|
102
|
+
files = files.filter((file) => !file.includes('ember-data/'));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
this._files = files;
|
|
106
|
+
|
|
107
|
+
return this._files;
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
beforeInstall() {
|
|
111
|
+
const prependEmoji = require('./lib/prepend-emoji');
|
|
112
|
+
|
|
113
|
+
this.ui.writeLine(prependEmoji('✨', `Creating a new Ember app in ${chalk.yellow(process.cwd())}:`));
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @override
|
|
118
|
+
*
|
|
119
|
+
* This modification of buildFileInfo allows our differing
|
|
120
|
+
* input files to output to a single file, depending on the options.
|
|
121
|
+
* For example:
|
|
122
|
+
*
|
|
123
|
+
* for javascript,
|
|
124
|
+
* _ts_eslint.config.mjs is deleted
|
|
125
|
+
* _js_eslint.config.mjs is renamed to eslint.config.mjs
|
|
126
|
+
*
|
|
127
|
+
* for typescript,
|
|
128
|
+
* _js_eslint.config.mjs is deleted
|
|
129
|
+
* _ts_eslint.config.mjs is renamed to eslint.config.mjs
|
|
130
|
+
*/
|
|
131
|
+
buildFileInfo(intoDir, templateVariables, file, options) {
|
|
132
|
+
let fileInfo = this._super.buildFileInfo.apply(this, arguments);
|
|
133
|
+
|
|
134
|
+
if (file.includes('_js_')) {
|
|
135
|
+
if (options.typescript) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
fileInfo.outputBasePath = fileInfo.outputPath.replace('_js_', '');
|
|
140
|
+
fileInfo.outputPath = fileInfo.outputPath.replace('_js_', '');
|
|
141
|
+
fileInfo.displayPath = fileInfo.outputPath.replace('_js_', '');
|
|
142
|
+
return fileInfo;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (file.includes('_ts_')) {
|
|
146
|
+
if (!options.typescript) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
fileInfo.outputBasePath = fileInfo.outputPath.replace('_ts_', '');
|
|
151
|
+
fileInfo.outputPath = fileInfo.outputPath.replace('_ts_', '');
|
|
152
|
+
fileInfo.displayPath = fileInfo.outputPath.replace('_ts_', '');
|
|
153
|
+
return fileInfo;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return fileInfo;
|
|
157
|
+
},
|
|
158
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Derive a directory name from a package name.
|
|
7
|
+
* Takes scoped packages into account.
|
|
8
|
+
*
|
|
9
|
+
* @method directoryForPackageName
|
|
10
|
+
* @param {String} packageName
|
|
11
|
+
* @return {String} Derived directory name.
|
|
12
|
+
*/
|
|
13
|
+
module.exports = function directoryForPackageName(packageName) {
|
|
14
|
+
let isScoped = packageName[0] === '@' && packageName.includes('/');
|
|
15
|
+
|
|
16
|
+
if (isScoped) {
|
|
17
|
+
let slashIndex = packageName.indexOf('/');
|
|
18
|
+
let scopeName = packageName.substring(1, slashIndex);
|
|
19
|
+
let packageNameWithoutScope = packageName.substring(slashIndex + 1);
|
|
20
|
+
let pathParts = process.cwd().split(path.sep);
|
|
21
|
+
let parentDirectoryContainsScopeName = pathParts.includes(scopeName);
|
|
22
|
+
|
|
23
|
+
if (parentDirectoryContainsScopeName) {
|
|
24
|
+
return packageNameWithoutScope;
|
|
25
|
+
} else {
|
|
26
|
+
return `${scopeName}-${packageNameWithoutScope}`;
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
return packageName;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function supportEmoji() {
|
|
4
|
+
const hasEmojiTurnedOff = process.argv.indexOf('--no-emoji') > -1;
|
|
5
|
+
return process.stdout.isTTY && process.platform !== 'win32' && !hasEmojiTurnedOff;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const areEmojiSupported = supportEmoji();
|
|
9
|
+
|
|
10
|
+
module.exports = function prependEmoji(emoji, msg) {
|
|
11
|
+
return areEmojiSupported ? `${emoji} ${msg}` : msg;
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember/app-blueprint",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Blueprint for next generation of Ember apps",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ember-blueprint"
|
|
7
|
+
],
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git@github.com:ember-cli/ember-app-blueprint.git"
|
|
11
|
+
},
|
|
8
12
|
"license": "MIT",
|
|
13
|
+
"author": "",
|
|
14
|
+
"main": "index.js",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"lodash": "^4.17.21",
|
|
17
|
+
"walk-sync": "^3.0.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@eslint/js": "^9.3.0",
|
|
21
|
+
"ember-cli": "^6.3.1",
|
|
22
|
+
"eslint": "9.x",
|
|
23
|
+
"eslint-config-prettier": "^9.1.0",
|
|
24
|
+
"execa": "^9.1.0",
|
|
25
|
+
"fixturify": "^3.0.0",
|
|
26
|
+
"globals": "^15.3.0",
|
|
27
|
+
"prettier": "^3.2.5",
|
|
28
|
+
"prettier-plugin-ember-template-tag": "^2.0.2",
|
|
29
|
+
"release-plan": "^0.16.0",
|
|
30
|
+
"resolve-bin": "^1.0.1",
|
|
31
|
+
"strip-ansi": "^7.1.0",
|
|
32
|
+
"tmp-promise": "^3.0.3",
|
|
33
|
+
"vitest": "^3.1.2"
|
|
34
|
+
},
|
|
9
35
|
"scripts": {
|
|
10
|
-
"
|
|
36
|
+
"lint": "eslint .",
|
|
37
|
+
"test": "vitest"
|
|
11
38
|
}
|
|
12
39
|
}
|