ember-cli 5.3.0 → 5.4.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 +19 -0
- package/RELEASE.md +46 -0
- package/bin/ember +0 -0
- package/blueprints/addon/additional-package.json +1 -1
- package/blueprints/addon/files/.github/workflows/ci.yml +6 -7
- package/blueprints/addon/files/.travis.yml +1 -2
- package/blueprints/addon/files/README.md +3 -3
- package/blueprints/addon/files/addon-config/ember-try.js +0 -8
- package/blueprints/addon/index.js +6 -6
- package/blueprints/app/files/.ember-cli +0 -8
- package/blueprints/app/files/.github/workflows/ci.yml +2 -2
- package/blueprints/app/files/.travis.yml +1 -1
- package/blueprints/app/files/package.json +50 -50
- package/blueprints/app/index.js +5 -5
- package/blueprints/http-mock/index.js +0 -1
- package/blueprints/http-proxy/index.js +0 -1
- package/blueprints/in-repo-addon/files/__root__/__name__/index.js +0 -0
- package/blueprints/in-repo-addon/index.js +0 -0
- package/blueprints/lib/index.js +0 -0
- package/docs/build/data.json +458 -555
- package/lib/cli/cli.js +0 -8
- package/lib/cli/index.js +4 -53
- package/lib/commands/addon.js +5 -2
- package/lib/commands/init.js +17 -13
- package/lib/commands/install.js +8 -7
- package/lib/commands/new.js +6 -5
- package/lib/models/blueprint.js +1 -2
- package/lib/models/command.js +44 -50
- package/lib/models/watcher.js +0 -21
- package/lib/tasks/addon-install.js +1 -6
- package/lib/tasks/build-watch.js +0 -1
- package/lib/tasks/build.js +1 -21
- package/lib/tasks/generate-from-blueprint.js +0 -1
- package/lib/tasks/install-blueprint.js +0 -1
- package/lib/tasks/interactive-new.js +1 -1
- package/lib/tasks/npm-install.js +1 -2
- package/lib/tasks/npm-task.js +3 -6
- package/lib/tasks/serve.js +0 -3
- package/lib/tasks/server/express-server.js +0 -2
- package/lib/tasks/server/livereload-server.js +1 -12
- package/lib/utilities/get-lang-arg.js +3 -4
- package/lib/utilities/lint-fix.js +1 -2
- package/lib/utilities/package-managers.js +47 -0
- package/package.json +3 -7
- package/tests/helpers/acceptance.js +1 -1
- package/tests/helpers/ember.js +1 -4
- package/lib/utilities/get-package-manager-from-flags.js +0 -38
- package/lib/utilities/is-pnpm-project.js +0 -27
- package/lib/utilities/is-yarn-project.js +0 -26
- package/tests/helpers/mock-analytics.js +0 -23
|
@@ -49,12 +49,11 @@ function readSSLandCert(sslKey, sslCert) {
|
|
|
49
49
|
const DEFAULT_PREFIX = '/';
|
|
50
50
|
|
|
51
51
|
module.exports = class LiveReloadServer {
|
|
52
|
-
constructor({ app, watcher, ui, project,
|
|
52
|
+
constructor({ app, watcher, ui, project, httpServer }) {
|
|
53
53
|
this.app = app;
|
|
54
54
|
this.watcher = watcher;
|
|
55
55
|
this.ui = ui;
|
|
56
56
|
this.project = project;
|
|
57
|
-
this.analytics = analytics;
|
|
58
57
|
this.httpServer = httpServer;
|
|
59
58
|
this.liveReloadPrefix = DEFAULT_PREFIX;
|
|
60
59
|
}
|
|
@@ -224,11 +223,6 @@ module.exports = class LiveReloadServer {
|
|
|
224
223
|
files,
|
|
225
224
|
},
|
|
226
225
|
});
|
|
227
|
-
|
|
228
|
-
this.analytics.track({
|
|
229
|
-
name: 'broccoli watcher',
|
|
230
|
-
message: 'live-reload',
|
|
231
|
-
});
|
|
232
226
|
}
|
|
233
227
|
}
|
|
234
228
|
|
|
@@ -238,10 +232,5 @@ module.exports = class LiveReloadServer {
|
|
|
238
232
|
files: ['LiveReload files'],
|
|
239
233
|
},
|
|
240
234
|
});
|
|
241
|
-
|
|
242
|
-
this.analytics.track({
|
|
243
|
-
name: 'express server',
|
|
244
|
-
message: 'live-reload',
|
|
245
|
-
});
|
|
246
235
|
}
|
|
247
236
|
};
|
|
@@ -153,17 +153,16 @@ As examples, the parser behavior would likely affect the following usages:
|
|
|
153
153
|
2. `ember new app-name --lang`
|
|
154
154
|
|
|
155
155
|
In this context, the unintended parser behavior is that `langArg` will be
|
|
156
|
-
|
|
156
|
+
assigned to the String that immediately follows `--lang` in the command. If
|
|
157
157
|
`--lang` is the last explicitly defined part of the command (as in the second
|
|
158
158
|
example above), the first of any any `hidden` options pushed onto the command
|
|
159
|
-
after the initial parse (e.g. `--
|
|
159
|
+
after the initial parse (e.g. `--no-watcher`) will be
|
|
160
160
|
used when assigning `langArg`.
|
|
161
161
|
|
|
162
162
|
In the above examples, `langArg` would likely be assigned as follows:
|
|
163
163
|
1. `ember new app-name --lang --skip-npm => `langArg='--skip-npm'`
|
|
164
|
-
2. `ember new app-name --lang` => `langArg='--disable-analytics'`
|
|
165
164
|
|
|
166
|
-
The workaround
|
|
165
|
+
The workaround implemented herein is to check whether or not the value of
|
|
167
166
|
`langArg` starts with a hyphen. The rationale for this approach is based on
|
|
168
167
|
the following underlying assumptions:
|
|
169
168
|
- ALL CLI options start with (at least one) hyphen
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const execa = require('../utilities/execa');
|
|
4
|
-
const isYarnProject = require('../utilities/
|
|
5
|
-
const isPnpmProject = require('../utilities/is-pnpm-project');
|
|
4
|
+
const { isPnpmProject, isYarnProject } = require('../utilities/package-managers');
|
|
6
5
|
const prependEmoji = require('../utilities/prepend-emoji');
|
|
7
6
|
|
|
8
7
|
async function run(project) {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
|
|
5
|
+
async function determineInstallCommand(projectRoot) {
|
|
6
|
+
if (await isPnpmProject(projectRoot)) {
|
|
7
|
+
return 'pnpm install';
|
|
8
|
+
} else if (isYarnProject(projectRoot)) {
|
|
9
|
+
return 'yarn install';
|
|
10
|
+
} else {
|
|
11
|
+
return 'npm install';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async function isPnpmProject(projectRoot) {
|
|
16
|
+
if (fs.existsSync(`${projectRoot}/pnpm-lock.yaml`)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const { findWorkspaceDir } = await import('@pnpm/find-workspace-dir');
|
|
21
|
+
|
|
22
|
+
if (await findWorkspaceDir(projectRoot)) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isYarnProject(projectRoot) {
|
|
30
|
+
if (fs.existsSync(`${projectRoot}/yarn.lock`)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const findWorkspaceRoot = require('find-yarn-workspace-root');
|
|
35
|
+
|
|
36
|
+
if (findWorkspaceRoot(projectRoot)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = {
|
|
44
|
+
determineInstallCommand,
|
|
45
|
+
isPnpmProject,
|
|
46
|
+
isYarnProject,
|
|
47
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Command line tool for developing ambitious ember.js apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"test:slow": "node --unhandled-rejections=strict tests/runner slow"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@babel/core": "^7.22.10",
|
|
41
40
|
"@pnpm/find-workspace-dir": "^6.0.2",
|
|
42
41
|
"broccoli": "^3.5.2",
|
|
43
42
|
"broccoli-builder": "^0.18.14",
|
|
@@ -91,7 +90,6 @@
|
|
|
91
90
|
"is-git-url": "^1.0.0",
|
|
92
91
|
"is-language-code": "^3.1.0",
|
|
93
92
|
"isbinaryfile": "^5.0.0",
|
|
94
|
-
"leek": "0.0.24",
|
|
95
93
|
"lodash.template": "^4.5.0",
|
|
96
94
|
"markdown-it": "^13.0.1",
|
|
97
95
|
"markdown-it-terminal": "^0.4.0",
|
|
@@ -118,7 +116,6 @@
|
|
|
118
116
|
"testem": "^3.10.1",
|
|
119
117
|
"tiny-lr": "^2.0.0",
|
|
120
118
|
"tree-sync": "^2.1.0",
|
|
121
|
-
"uuid": "^9.0.0",
|
|
122
119
|
"walk-sync": "^3.0.0",
|
|
123
120
|
"watch-detector": "^1.0.2",
|
|
124
121
|
"workerpool": "^6.4.0",
|
|
@@ -159,7 +156,7 @@
|
|
|
159
156
|
"yuidocjs": "0.10.2"
|
|
160
157
|
},
|
|
161
158
|
"engines": {
|
|
162
|
-
"node": ">=
|
|
159
|
+
"node": ">= 18"
|
|
163
160
|
},
|
|
164
161
|
"publishConfig": {
|
|
165
162
|
"registry": "https://registry.npmjs.org"
|
|
@@ -174,9 +171,8 @@
|
|
|
174
171
|
"tokenRef": "GITHUB_AUTH"
|
|
175
172
|
}
|
|
176
173
|
},
|
|
177
|
-
"trackingCode": "UA-49225444-1",
|
|
178
174
|
"volta": {
|
|
179
|
-
"node": "
|
|
175
|
+
"node": "18.12.0",
|
|
180
176
|
"yarn": "1.22.19"
|
|
181
177
|
}
|
|
182
178
|
}
|
|
@@ -34,7 +34,7 @@ function handleResult(result) {
|
|
|
34
34
|
function applyCommand(command, name /*, ...flags*/) {
|
|
35
35
|
let flags = [].slice.call(arguments, 2, arguments.length);
|
|
36
36
|
let binaryPath = path.resolve(path.join(__dirname, '..', '..', 'bin', 'ember'));
|
|
37
|
-
let args = [binaryPath, command, name, '--
|
|
37
|
+
let args = [binaryPath, command, name, '--watcher=node', '--skip-git', runCommandOptions];
|
|
38
38
|
|
|
39
39
|
flags.forEach(function (flag) {
|
|
40
40
|
args.splice(2, 0, flag);
|
package/tests/helpers/ember.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const MockUI = require('console-ui/mock');
|
|
4
|
-
const MockAnalytics = require('./mock-analytics');
|
|
5
4
|
const cli = require('../../lib/cli');
|
|
6
5
|
const MockProcess = require('./mock-process');
|
|
7
6
|
const path = require('path');
|
|
@@ -59,11 +58,10 @@ module.exports = function ember(args, options) {
|
|
|
59
58
|
delete require.cache[path.join(process.cwd(), 'testem.js')];
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
args.push('--disable-analytics');
|
|
63
61
|
args.push('--watcher=node');
|
|
64
62
|
|
|
65
63
|
if (!options || options.skipGit !== false) {
|
|
66
|
-
args.push('--
|
|
64
|
+
args.push('--skip-git');
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
// Most tests don't npm install so let's disable lint fixing by default
|
|
@@ -79,7 +77,6 @@ module.exports = function ember(args, options) {
|
|
|
79
77
|
outputStream,
|
|
80
78
|
errorLog,
|
|
81
79
|
cliArgs: args,
|
|
82
|
-
Leek: MockAnalytics,
|
|
83
80
|
UI: ui,
|
|
84
81
|
testing: true,
|
|
85
82
|
disableDependencyChecker,
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns the package manager, given an object where folks can *technically*
|
|
5
|
-
* pass --pnpm --yarn --npm. But using multiple package managers at the
|
|
6
|
-
* same time is not supported (by anything).
|
|
7
|
-
*
|
|
8
|
-
* This function defines the priority of package managers, if multiple are present.
|
|
9
|
-
*
|
|
10
|
-
* @private
|
|
11
|
-
* @method getPackageManagerFromFlags
|
|
12
|
-
* @param {{ pnpm?: boolean; yarn?: boolean; packageManager?: 'pnpm' | 'yarn' | 'npm' }} options
|
|
13
|
-
* @return {'pnpm' | 'yarn' | 'npm' | undefined}
|
|
14
|
-
*/
|
|
15
|
-
function getPackageManagerFromFlags(options) {
|
|
16
|
-
let { pnpm, yarn, packageManager } = options;
|
|
17
|
-
|
|
18
|
-
if (packageManager) {
|
|
19
|
-
return packageManager;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (pnpm) {
|
|
23
|
-
return 'pnpm';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (yarn) {
|
|
27
|
-
return 'yarn';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// supported for legacy reasons
|
|
31
|
-
if (yarn === false) {
|
|
32
|
-
return 'npm';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
module.exports = { getPackageManagerFromFlags };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Returns true if and only if the given directory has a pnpm-lock.yaml file or is a child of a
|
|
7
|
-
* pnpm workspace root.
|
|
8
|
-
* @private
|
|
9
|
-
* @method isPnpmProject
|
|
10
|
-
* @param {string} thePath
|
|
11
|
-
* @return {Promise<boolean>}
|
|
12
|
-
*/
|
|
13
|
-
async function isPnpmProject(thePath) {
|
|
14
|
-
if (fs.existsSync(`${thePath}/pnpm-lock.yaml`)) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const { findWorkspaceDir } = await import('@pnpm/find-workspace-dir');
|
|
19
|
-
|
|
20
|
-
if (await findWorkspaceDir(thePath)) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = isPnpmProject;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const findWorkspaceRoot = require('find-yarn-workspace-root');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns true if and only if the given directory has a yarn.lock file or is a child of a
|
|
8
|
-
* yarn workspace root.
|
|
9
|
-
* @private
|
|
10
|
-
* @method isYarnProject
|
|
11
|
-
* @param {string} thePath
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
*/
|
|
14
|
-
function isYarnProject(thePath) {
|
|
15
|
-
if (fs.existsSync(`${thePath}/yarn.lock`)) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (findWorkspaceRoot(thePath)) {
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = isYarnProject;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
class MockAnalytics {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.tracks = [];
|
|
6
|
-
this.trackTimings = [];
|
|
7
|
-
this.trackErrors = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
track(arg) {
|
|
11
|
-
this.tracks.push(arg);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
trackTiming(arg) {
|
|
15
|
-
this.trackTimings.push(arg);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
trackError(arg) {
|
|
19
|
-
this.trackErrors.push(arg);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = MockAnalytics;
|