ember-cli 7.0.0-alpha.1 → 7.0.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/CHANGELOG.md +197 -317
- package/docs/build/data.json +1 -1
- package/package.json +40 -48
- package/packages/addon-blueprint/package.json +3 -11
- package/packages/app-blueprint/files/package.json +6 -6
- package/packages/app-blueprint/package.json +2 -10
- package/packages/blueprint-blueprint/files/blueprints/__name__/files/.gitkeep +0 -0
- package/packages/blueprint-blueprint/files/blueprints/__name__/index.js +0 -16
- package/packages/blueprint-blueprint/index.js +0 -5
- package/packages/blueprint-blueprint/package.json +0 -13
- package/packages/blueprint-model/package.json +0 -19
- package/packages/blueprint-model/utilities/directory-for-package-name.js +0 -31
- package/packages/blueprint-model/utilities/edit-file-diff.js +0 -64
- package/packages/blueprint-model/utilities/experiments.js +0 -63
- package/packages/blueprint-model/utilities/file-info.js +0 -170
- package/packages/blueprint-model/utilities/open-editor.js +0 -44
- package/packages/blueprint-model/utilities/prepend-emoji.js +0 -12
- package/packages/blueprint-model/utilities/process-template.js +0 -10
package/docs/build/data.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"logo": "https://ember-cli.com/assets/images/ember-cli-logo-small-dark.png",
|
|
4
4
|
"name": "ember-cli",
|
|
5
5
|
"description": "Command line tool for developing ambitious ember.js apps",
|
|
6
|
-
"version": "7.0.0-
|
|
6
|
+
"version": "7.0.0-release-a239f20b05"
|
|
7
7
|
},
|
|
8
8
|
"files": {
|
|
9
9
|
"lib/broccoli/default-packager.js": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-cli",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Command line tool for developing ambitious ember.js apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -26,22 +26,16 @@
|
|
|
26
26
|
"bin": {
|
|
27
27
|
"ember": "./bin/ember"
|
|
28
28
|
},
|
|
29
|
-
"release-plan": {
|
|
30
|
-
"semverIncrementAs": {
|
|
31
|
-
"minor": "prerelease",
|
|
32
|
-
"patch": "prerelease"
|
|
33
|
-
},
|
|
34
|
-
"semverIncrementTag": "alpha",
|
|
35
|
-
"publishTag": "alpha"
|
|
36
|
-
},
|
|
37
29
|
"dependencies": {
|
|
38
|
-
"@ember/
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
30
|
+
"@ember-tooling/blueprint-blueprint": "^0.3.0",
|
|
31
|
+
"@ember-tooling/blueprint-model": "^0.6.2",
|
|
32
|
+
"@ember/app-blueprint": "~7.0.0",
|
|
33
|
+
"@pnpm/find-workspace-dir": "^1000.1.5",
|
|
34
|
+
"babel-remove-types": "^1.1.0",
|
|
41
35
|
"broccoli": "^4.0.0",
|
|
42
|
-
"broccoli-concat": "^4.2.
|
|
36
|
+
"broccoli-concat": "^4.2.7",
|
|
43
37
|
"broccoli-config-loader": "^1.0.1",
|
|
44
|
-
"broccoli-config-replace": "^1.1.
|
|
38
|
+
"broccoli-config-replace": "^1.1.3",
|
|
45
39
|
"broccoli-debug": "^0.6.5",
|
|
46
40
|
"broccoli-funnel": "^3.0.8",
|
|
47
41
|
"broccoli-funnel-reducer": "^1.0.0",
|
|
@@ -53,15 +47,15 @@
|
|
|
53
47
|
"calculate-cache-key-for-tree": "^2.0.0",
|
|
54
48
|
"capture-exit": "^2.0.0",
|
|
55
49
|
"chalk": "^5.6.2",
|
|
56
|
-
"ci-info": "^4.
|
|
50
|
+
"ci-info": "^4.4.0",
|
|
57
51
|
"clean-base-url": "^1.0.0",
|
|
58
52
|
"compression": "^1.8.1",
|
|
59
53
|
"configstore": "^7.1.0",
|
|
60
54
|
"console-ui": "^3.1.2",
|
|
61
|
-
"content-tag": "^4.
|
|
55
|
+
"content-tag": "^4.2.0",
|
|
62
56
|
"core-object": "^3.1.5",
|
|
63
57
|
"dag-map": "^2.0.2",
|
|
64
|
-
"diff": "^8.0.
|
|
58
|
+
"diff": "^8.0.4",
|
|
65
59
|
"ember-cli-is-package-missing": "^1.0.0",
|
|
66
60
|
"ember-cli-normalize-entity-name": "^1.0.0",
|
|
67
61
|
"ember-cli-preprocess-registry": "^5.0.1",
|
|
@@ -70,86 +64,84 @@
|
|
|
70
64
|
"execa": "^9.6.1",
|
|
71
65
|
"exit": "^0.1.2",
|
|
72
66
|
"express": "^5.2.1",
|
|
73
|
-
"filesize": "^11.0.
|
|
67
|
+
"filesize": "^11.0.17",
|
|
74
68
|
"find-up": "^8.0.0",
|
|
75
69
|
"find-yarn-workspace-root": "^2.0.0",
|
|
76
|
-
"fs-extra": "^11.3.
|
|
70
|
+
"fs-extra": "^11.3.5",
|
|
77
71
|
"fs-tree-diff": "^2.0.1",
|
|
78
72
|
"get-caller-file": "^2.0.5",
|
|
79
73
|
"git-repo-info": "^2.1.1",
|
|
80
|
-
"glob": "^13.0.
|
|
74
|
+
"glob": "^13.0.6",
|
|
81
75
|
"heimdalljs": "^0.2.6",
|
|
82
76
|
"heimdalljs-fs-monitor": "^1.1.2",
|
|
83
77
|
"heimdalljs-graph": "^1.0.0",
|
|
84
78
|
"heimdalljs-logger": "^0.1.10",
|
|
85
79
|
"http-proxy": "^1.18.1",
|
|
86
80
|
"inflection": "^3.0.2",
|
|
87
|
-
"inquirer": "^13.
|
|
81
|
+
"inquirer": "^13.4.2",
|
|
88
82
|
"is-git-url": "^1.0.0",
|
|
89
|
-
"is-language-code": "^5.1.
|
|
90
|
-
"lodash": "^4.
|
|
91
|
-
"markdown-it": "^14.1.
|
|
83
|
+
"is-language-code": "^5.1.3",
|
|
84
|
+
"lodash": "^4.18.1",
|
|
85
|
+
"markdown-it": "^14.1.1",
|
|
92
86
|
"markdown-it-terminal": "^0.4.0",
|
|
93
|
-
"minimatch": "^10.
|
|
87
|
+
"minimatch": "^10.2.5",
|
|
94
88
|
"morgan": "^1.10.1",
|
|
95
89
|
"nopt": "^3.0.6",
|
|
96
90
|
"npm-package-arg": "^13.0.2",
|
|
97
91
|
"os-locale": "^6.0.2",
|
|
98
92
|
"p-defer": "^4.0.1",
|
|
99
|
-
"portfinder": "^1.0.
|
|
93
|
+
"portfinder": "^1.0.38",
|
|
100
94
|
"promise-map-series": "^0.3.0",
|
|
101
95
|
"promise.hash.helper": "^1.0.8",
|
|
102
96
|
"quick-temp": "^0.1.9",
|
|
103
|
-
"resolve": "^1.22.
|
|
97
|
+
"resolve": "^1.22.12",
|
|
104
98
|
"resolve-package-path": "^4.0.3",
|
|
105
|
-
"safe-stable-stringify": "^2.
|
|
99
|
+
"safe-stable-stringify": "^2.5.0",
|
|
106
100
|
"sane": "^5.0.1",
|
|
107
|
-
"semver": "^7.7.
|
|
101
|
+
"semver": "^7.7.4",
|
|
108
102
|
"silent-error": "^1.1.1",
|
|
109
|
-
"sort-package-json": "^3.6.
|
|
103
|
+
"sort-package-json": "^3.6.1",
|
|
110
104
|
"symlink-or-copy": "^1.3.1",
|
|
111
|
-
"testem": "^3.
|
|
105
|
+
"testem": "^3.20.0",
|
|
112
106
|
"tiny-lr": "^2.0.0",
|
|
113
107
|
"tree-sync": "^2.1.0",
|
|
114
108
|
"walk-sync": "^4.0.1",
|
|
115
109
|
"watch-detector": "^1.0.2",
|
|
116
|
-
"workerpool": "^10.0.
|
|
110
|
+
"workerpool": "^10.0.2",
|
|
117
111
|
"yam": "^1.0.0",
|
|
118
|
-
"@ember-tooling/
|
|
119
|
-
"@ember-tooling/blueprint
|
|
120
|
-
"@ember-tooling/classic-build-addon-blueprint": "7.0.0-alpha.1",
|
|
121
|
-
"@ember-tooling/classic-build-app-blueprint": "7.0.0-alpha.1"
|
|
112
|
+
"@ember-tooling/classic-build-app-blueprint": "7.0.0",
|
|
113
|
+
"@ember-tooling/classic-build-addon-blueprint": "7.0.0"
|
|
122
114
|
},
|
|
123
115
|
"devDependencies": {
|
|
124
|
-
"broccoli-plugin": "^4.0.
|
|
116
|
+
"broccoli-plugin": "^4.0.7",
|
|
125
117
|
"broccoli-test-helper": "^2.0.0",
|
|
126
|
-
"chai": "^6.2.
|
|
118
|
+
"chai": "^6.2.2",
|
|
127
119
|
"chai-as-promised": "^8.0.2",
|
|
128
120
|
"chai-files": "^1.4.0",
|
|
129
121
|
"chai-jest-snapshot": "^2.0.0",
|
|
130
122
|
"concurrently": "^9.2.1",
|
|
131
123
|
"ember-cli-blueprint-test-helpers": "^0.19.2",
|
|
132
124
|
"ember-cli-internal-test-helpers": "^0.9.1",
|
|
133
|
-
"eslint": "^8.
|
|
125
|
+
"eslint": "^8.57.1",
|
|
134
126
|
"eslint-config-prettier": "^10.1.8",
|
|
135
|
-
"eslint-plugin-chai-expect": "^3.
|
|
127
|
+
"eslint-plugin-chai-expect": "^3.1.0",
|
|
136
128
|
"eslint-plugin-mocha": "^10.5.0",
|
|
137
|
-
"eslint-plugin-n": "^17.
|
|
129
|
+
"eslint-plugin-n": "^17.24.0",
|
|
138
130
|
"fixturify": "^3.0.0",
|
|
139
131
|
"fixturify-project": "^2.1.1",
|
|
140
|
-
"jsdom": "^21.1.
|
|
132
|
+
"jsdom": "^21.1.2",
|
|
141
133
|
"latest-version": "^9.0.0",
|
|
142
134
|
"mocha": "^11.7.5",
|
|
143
|
-
"nock": "^14.0.
|
|
135
|
+
"nock": "^14.0.15",
|
|
144
136
|
"nyc": "^17.1.0",
|
|
145
137
|
"prettier": "3.7.4",
|
|
146
|
-
"release-plan": "^0.17.
|
|
147
|
-
"strip-ansi": "^7.
|
|
148
|
-
"supertest": "^7.
|
|
149
|
-
"testdouble": "^3.
|
|
138
|
+
"release-plan": "^0.17.4",
|
|
139
|
+
"strip-ansi": "^7.2.0",
|
|
140
|
+
"supertest": "^7.2.2",
|
|
141
|
+
"testdouble": "^3.20.2",
|
|
150
142
|
"tmp": "^0.2.5",
|
|
151
143
|
"tmp-promise": "^3.0.3",
|
|
152
|
-
"websocket": "^1.0.
|
|
144
|
+
"websocket": "^1.0.35",
|
|
153
145
|
"which": "6.0.0",
|
|
154
146
|
"yuidoc-ember-cli-theme": "^1.0.4",
|
|
155
147
|
"yuidocjs": "0.10.2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-tooling/classic-build-addon-blueprint",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/ember-cli/ember-cli.git",
|
|
@@ -11,22 +11,14 @@
|
|
|
11
11
|
"ember-blueprint"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ember-tooling/blueprint-model": "
|
|
14
|
+
"@ember-tooling/blueprint-model": "^0.6.2",
|
|
15
15
|
"chalk": "^5.6.2",
|
|
16
16
|
"ember-cli-normalize-entity-name": "^1.0.0",
|
|
17
17
|
"ember-cli-string-utils": "^1.1.0",
|
|
18
|
-
"fs-extra": "^11.3.
|
|
18
|
+
"fs-extra": "^11.3.5",
|
|
19
19
|
"lodash": "^4.18.1",
|
|
20
20
|
"silent-error": "^1.1.1",
|
|
21
21
|
"sort-package-json": "^2.15.1",
|
|
22
22
|
"walk-sync": "^3.0.0"
|
|
23
|
-
},
|
|
24
|
-
"release-plan": {
|
|
25
|
-
"semverIncrementAs": {
|
|
26
|
-
"minor": "prerelease",
|
|
27
|
-
"patch": "prerelease"
|
|
28
|
-
},
|
|
29
|
-
"semverIncrementTag": "alpha",
|
|
30
|
-
"publishTag": "alpha"
|
|
31
23
|
}
|
|
32
24
|
}
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@ember-data/store": "~5.8.2",
|
|
43
43
|
"@warp-drive/ember": "~5.8.2<% } %>",
|
|
44
44
|
"@ember/optional-features": "^2.3.0",
|
|
45
|
-
"@ember/test-helpers": "^5.4.
|
|
46
|
-
"@embroider/compat": "^3.9.
|
|
47
|
-
"@embroider/core": "^3.5.
|
|
45
|
+
"@ember/test-helpers": "^5.4.2<% if (embroider) { %>",
|
|
46
|
+
"@embroider/compat": "^3.9.4",
|
|
47
|
+
"@embroider/core": "^3.5.10<% } %>",
|
|
48
48
|
"@embroider/macros": "^1.20.2<% if (embroider) { %>",
|
|
49
49
|
"@embroider/webpack": "^4.1.2<% } %>",
|
|
50
50
|
"@eslint/js": "^9.39.4",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"broccoli-asset-rev": "^3.0.0",
|
|
64
64
|
"concurrently": "^9.2.1",
|
|
65
65
|
"ember-auto-import": "^2.13.1",
|
|
66
|
-
"ember-cli": "~7.0.0
|
|
66
|
+
"ember-cli": "~7.0.0",
|
|
67
67
|
"ember-cli-app-version": "^7.0.0",
|
|
68
68
|
"ember-cli-babel": "^8.3.1",
|
|
69
69
|
"ember-cli-clean-css": "^3.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"ember-page-title": "^9.0.3",
|
|
80
80
|
"ember-qunit": "^9.0.4",
|
|
81
81
|
"ember-resolver": "^13.2.0",
|
|
82
|
-
"ember-source": "~7.0.0
|
|
82
|
+
"ember-source": "~7.0.0",
|
|
83
83
|
"ember-template-imports": "^4.4.0",
|
|
84
84
|
"ember-template-lint": "^6.1.0<% if (welcome) { %>",
|
|
85
85
|
"ember-welcome-page": "^7.0.2<% } %>",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"stylelint": "^16.26.1",
|
|
99
99
|
"stylelint-config-standard": "^36.0.1<% if (typescript) { %>",
|
|
100
100
|
"typescript": "^5.9.3",
|
|
101
|
-
"typescript-eslint": "^8.
|
|
101
|
+
"typescript-eslint": "^8.59.2<% } %>",
|
|
102
102
|
"webpack": "^5.106.2"
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-tooling/classic-build-app-blueprint",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/ember-cli/ember-cli.git",
|
|
@@ -11,16 +11,8 @@
|
|
|
11
11
|
"ember-blueprint"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ember-tooling/blueprint-model": "
|
|
14
|
+
"@ember-tooling/blueprint-model": "^0.6.2",
|
|
15
15
|
"chalk": "^5.6.2",
|
|
16
16
|
"ember-cli-string-utils": "^1.1.0"
|
|
17
|
-
},
|
|
18
|
-
"release-plan": {
|
|
19
|
-
"semverIncrementAs": {
|
|
20
|
-
"minor": "prerelease",
|
|
21
|
-
"patch": "prerelease"
|
|
22
|
-
},
|
|
23
|
-
"semverIncrementTag": "alpha",
|
|
24
|
-
"publishTag": "alpha"
|
|
25
17
|
}
|
|
26
18
|
}
|
|
File without changes
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
description: ''
|
|
5
|
-
|
|
6
|
-
// locals(options) {
|
|
7
|
-
// // Return custom template variables here.
|
|
8
|
-
// return {
|
|
9
|
-
// foo: options.entity.options.foo
|
|
10
|
-
// };
|
|
11
|
-
// }
|
|
12
|
-
|
|
13
|
-
// afterInstall(options) {
|
|
14
|
-
// // Perform extra work here.
|
|
15
|
-
// }
|
|
16
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ember-tooling/blueprint-blueprint",
|
|
3
|
-
"version": "0.3.0",
|
|
4
|
-
"repository": {
|
|
5
|
-
"type": "git",
|
|
6
|
-
"url": "https://github.com/ember-cli/ember-cli.git",
|
|
7
|
-
"directory": "packages/blueprint-blueprint"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"keywords": [
|
|
11
|
-
"ember-blueprint"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ember-tooling/blueprint-model",
|
|
3
|
-
"version": "0.6.2",
|
|
4
|
-
"repository": {
|
|
5
|
-
"type": "git",
|
|
6
|
-
"url": "https://github.com/ember-cli/ember-cli.git",
|
|
7
|
-
"directory": "packages/blueprint-model"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"chalk": "^5.6.2",
|
|
12
|
-
"diff": "^7.0.0",
|
|
13
|
-
"isbinaryfile": "^5.0.7",
|
|
14
|
-
"lodash": "^4.17.23",
|
|
15
|
-
"promise.hash.helper": "^1.0.8",
|
|
16
|
-
"quick-temp": "^0.1.9",
|
|
17
|
-
"silent-error": "^1.1.1"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const util = require('util');
|
|
5
|
-
const { applyPatch, createPatch } = require('diff');
|
|
6
|
-
const quickTemp = require('quick-temp');
|
|
7
|
-
const path = require('path');
|
|
8
|
-
const SilentError = require('silent-error');
|
|
9
|
-
const openEditor = require('./open-editor');
|
|
10
|
-
const hash = require('promise.hash.helper');
|
|
11
|
-
|
|
12
|
-
const readFile = util.promisify(fs.readFile);
|
|
13
|
-
const writeFile = util.promisify(fs.writeFile);
|
|
14
|
-
|
|
15
|
-
class EditFileDiff {
|
|
16
|
-
constructor(options) {
|
|
17
|
-
this.info = options.info;
|
|
18
|
-
|
|
19
|
-
quickTemp.makeOrRemake(this, 'tmpDifferenceDir');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
edit() {
|
|
23
|
-
return hash({
|
|
24
|
-
input: this.info.render(),
|
|
25
|
-
output: readFile(this.info.outputPath),
|
|
26
|
-
})
|
|
27
|
-
.then(this.invokeEditor.bind(this))
|
|
28
|
-
.then(this.applyPatch.bind(this))
|
|
29
|
-
.finally(this.cleanUp.bind(this));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
cleanUp() {
|
|
33
|
-
quickTemp.remove(this, 'tmpDifferenceDir');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
applyPatch(resultHash) {
|
|
37
|
-
return hash({
|
|
38
|
-
diffString: readFile(resultHash.diffPath),
|
|
39
|
-
currentString: readFile(resultHash.outputPath),
|
|
40
|
-
}).then((result) => {
|
|
41
|
-
let appliedDiff = applyPatch(result.currentString.toString(), result.diffString.toString());
|
|
42
|
-
|
|
43
|
-
if (!appliedDiff) {
|
|
44
|
-
let message = 'Patch was not cleanly applied.';
|
|
45
|
-
this.info.ui.writeLine(`${message} Please choose another action.`);
|
|
46
|
-
throw new SilentError(message);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return writeFile(resultHash.outputPath, appliedDiff);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
invokeEditor(result) {
|
|
54
|
-
let info = this.info;
|
|
55
|
-
let diff = createPatch(info.outputPath, result.output.toString(), result.input);
|
|
56
|
-
let diffPath = path.join(this.tmpDifferenceDir, 'currentDiff.diff');
|
|
57
|
-
|
|
58
|
-
return writeFile(diffPath, diff)
|
|
59
|
-
.then(() => openEditor(diffPath))
|
|
60
|
-
.then(() => ({ outputPath: info.outputPath, diffPath }));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
module.exports = EditFileDiff;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { default: chalk } = require('chalk');
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
If you're here to remove the VITE experiment flag in favor of it being
|
|
7
|
-
permanently on, you can't do that until addressing
|
|
8
|
-
https://github.com/ember-cli/ember-cli/pull/10781#pullrequestreview-3230644293
|
|
9
|
-
|
|
10
|
-
A lot of test coverage would otherwise be lost, because valid tests are being
|
|
11
|
-
run only when the VITE experiment is off.
|
|
12
|
-
*/
|
|
13
|
-
const availableExperiments = Object.freeze(['EMBROIDER', 'CLASSIC', 'VITE']);
|
|
14
|
-
|
|
15
|
-
const deprecatedExperiments = Object.freeze([]);
|
|
16
|
-
const enabledExperiments = Object.freeze(['VITE']);
|
|
17
|
-
const deprecatedExperimentsDeprecationsIssued = [];
|
|
18
|
-
|
|
19
|
-
function isExperimentEnabled(experimentName) {
|
|
20
|
-
if (!availableExperiments.includes(experimentName)) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (process.env.EMBER_CLI_ENABLE_ALL_EXPERIMENTS && deprecatedExperiments.includes(experimentName)) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (process.env.EMBER_CLI_ENABLE_ALL_EXPERIMENTS) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (process.env.EMBER_CLI_CLASSIC && experimentName === 'EMBROIDER') {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let experimentEnvironmentVariable = `EMBER_CLI_${experimentName}`;
|
|
37
|
-
let experimentValue = process.env[experimentEnvironmentVariable];
|
|
38
|
-
|
|
39
|
-
if (deprecatedExperiments.includes(experimentName)) {
|
|
40
|
-
let deprecationPreviouslyIssued = deprecatedExperimentsDeprecationsIssued.includes(experimentName);
|
|
41
|
-
let isSpecifiedByUser = experimentValue !== undefined;
|
|
42
|
-
|
|
43
|
-
if (!deprecationPreviouslyIssued && isSpecifiedByUser) {
|
|
44
|
-
console.warn(
|
|
45
|
-
chalk.yellow(`The ${experimentName} experiment in ember-cli has been deprecated and will be removed.`)
|
|
46
|
-
);
|
|
47
|
-
deprecatedExperimentsDeprecationsIssued.push(experimentName);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (enabledExperiments.includes(experimentName)) {
|
|
52
|
-
return experimentValue !== 'false';
|
|
53
|
-
} else {
|
|
54
|
-
return experimentValue !== undefined && experimentValue !== 'false';
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
module.exports = {
|
|
59
|
-
isExperimentEnabled,
|
|
60
|
-
|
|
61
|
-
// exported for testing purposes
|
|
62
|
-
_deprecatedExperimentsDeprecationsIssued: deprecatedExperimentsDeprecationsIssued,
|
|
63
|
-
};
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const util = require('util');
|
|
5
|
-
const { default: chalk } = require('chalk');
|
|
6
|
-
const EditFileDiff = require('./edit-file-diff');
|
|
7
|
-
const EOL = require('os').EOL;
|
|
8
|
-
const rxEOL = new RegExp(EOL, 'g');
|
|
9
|
-
const isBinaryFile = require('isbinaryfile').isBinaryFileSync;
|
|
10
|
-
const hash = require('promise.hash.helper');
|
|
11
|
-
const canEdit = require('./open-editor').canEdit;
|
|
12
|
-
const processTemplate = require('./process-template');
|
|
13
|
-
|
|
14
|
-
const readFile = util.promisify(fs.readFile);
|
|
15
|
-
const lstat = util.promisify(fs.stat);
|
|
16
|
-
|
|
17
|
-
function diffHighlight(line) {
|
|
18
|
-
if (line[0] === '+') {
|
|
19
|
-
return chalk.green(line);
|
|
20
|
-
} else if (line[0] === '-') {
|
|
21
|
-
return chalk.red(line);
|
|
22
|
-
} else if (/^@@/.test(line)) {
|
|
23
|
-
return chalk.cyan(line);
|
|
24
|
-
} else {
|
|
25
|
-
return line;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const NOOP = (_) => _;
|
|
30
|
-
class FileInfo {
|
|
31
|
-
constructor(options) {
|
|
32
|
-
this.action = options.action;
|
|
33
|
-
this.outputBasePath = options.outputBasePath;
|
|
34
|
-
this.outputPath = options.outputPath;
|
|
35
|
-
this.displayPath = options.displayPath;
|
|
36
|
-
this.inputPath = options.inputPath;
|
|
37
|
-
this.templateVariables = options.templateVariables;
|
|
38
|
-
this.replacer = options.replacer || NOOP;
|
|
39
|
-
this.ui = options.ui;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
confirmOverwrite(path) {
|
|
43
|
-
let promptOptions = {
|
|
44
|
-
type: 'expand',
|
|
45
|
-
name: 'answer',
|
|
46
|
-
default: false,
|
|
47
|
-
message: `${chalk.red('Overwrite')} ${path}?`,
|
|
48
|
-
choices: [
|
|
49
|
-
{ key: 'y', name: 'Yes, overwrite', value: 'overwrite' },
|
|
50
|
-
{ key: 'n', name: 'No, skip', value: 'skip' },
|
|
51
|
-
],
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
let outputPathIsFile = false;
|
|
55
|
-
try {
|
|
56
|
-
outputPathIsFile = fs.statSync(this.outputPath).isFile();
|
|
57
|
-
} catch (err) {
|
|
58
|
-
/* ignore */
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
let canDiff = !isBinaryFile(this.inputPath) && (!outputPathIsFile || !isBinaryFile(this.outputPath));
|
|
62
|
-
|
|
63
|
-
if (canDiff) {
|
|
64
|
-
promptOptions.choices.push({ key: 'd', name: 'Diff', value: 'diff' });
|
|
65
|
-
|
|
66
|
-
if (canEdit()) {
|
|
67
|
-
promptOptions.choices.push({ key: 'e', name: 'Edit', value: 'edit' });
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return this.ui.prompt(promptOptions).then((response) => response.answer);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
displayDiff() {
|
|
75
|
-
let info = this,
|
|
76
|
-
{ createPatch } = require('diff');
|
|
77
|
-
return hash({
|
|
78
|
-
input: this.render(),
|
|
79
|
-
output: readFile(info.outputPath),
|
|
80
|
-
}).then((result) => {
|
|
81
|
-
let diff = createPatch(
|
|
82
|
-
info.outputPath,
|
|
83
|
-
result.output.toString().replace(rxEOL, '\n'),
|
|
84
|
-
result.input.replace(rxEOL, '\n')
|
|
85
|
-
);
|
|
86
|
-
let lines = diff.split('\n');
|
|
87
|
-
|
|
88
|
-
for (let i = 0; i < lines.length; i++) {
|
|
89
|
-
info.ui.write(diffHighlight(lines[i] + EOL));
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
async render() {
|
|
95
|
-
if (!this.rendered) {
|
|
96
|
-
let result = await this._render();
|
|
97
|
-
this.rendered = this.replacer(result, this);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return this.rendered;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
_render() {
|
|
104
|
-
let path = this.inputPath;
|
|
105
|
-
let context = this.templateVariables;
|
|
106
|
-
|
|
107
|
-
return readFile(path).then((content) =>
|
|
108
|
-
lstat(path).then((fileStat) => {
|
|
109
|
-
if (isBinaryFile(content, fileStat.size)) {
|
|
110
|
-
return content;
|
|
111
|
-
} else {
|
|
112
|
-
try {
|
|
113
|
-
return processTemplate(content.toString(), context);
|
|
114
|
-
} catch (err) {
|
|
115
|
-
err.message += ` (Error in blueprint template: ${path})`;
|
|
116
|
-
throw err;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
checkForConflict() {
|
|
124
|
-
return this.render().then((input) => {
|
|
125
|
-
input = input.toString().replace(rxEOL, '\n');
|
|
126
|
-
|
|
127
|
-
return readFile(this.outputPath)
|
|
128
|
-
.then((output) => {
|
|
129
|
-
output = output.toString().replace(rxEOL, '\n');
|
|
130
|
-
|
|
131
|
-
return input === output ? 'identical' : 'confirm';
|
|
132
|
-
})
|
|
133
|
-
.catch((e) => {
|
|
134
|
-
if (e.code === 'ENOENT') {
|
|
135
|
-
return 'none';
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
throw e;
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
confirmOverwriteTask() {
|
|
144
|
-
let info = this;
|
|
145
|
-
|
|
146
|
-
return function () {
|
|
147
|
-
function doConfirm() {
|
|
148
|
-
return info.confirmOverwrite(info.displayPath).then((action) => {
|
|
149
|
-
if (action === 'diff') {
|
|
150
|
-
return info.displayDiff().then(doConfirm);
|
|
151
|
-
} else if (action === 'edit') {
|
|
152
|
-
let editFileDiff = new EditFileDiff({ info });
|
|
153
|
-
return editFileDiff
|
|
154
|
-
.edit()
|
|
155
|
-
.then(() => (info.action = action))
|
|
156
|
-
.catch(() => doConfirm())
|
|
157
|
-
.then(() => info);
|
|
158
|
-
} else {
|
|
159
|
-
info.action = action;
|
|
160
|
-
return info;
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return doConfirm();
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
module.exports = FileInfo;
|