ember-cli 4.2.0 → 4.3.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.
- package/CHANGELOG.md +23 -5
- package/README.md +0 -1
- package/blueprints/addon/files/.github/workflows/ci.yml +3 -3
- package/blueprints/addon/files/gitignore +2 -0
- package/blueprints/app/files/.ember-cli +7 -1
- package/blueprints/app/files/.github/workflows/ci.yml +2 -2
- package/blueprints/app/files/app/index.html +0 -1
- package/blueprints/app/files/gitignore +3 -0
- package/blueprints/app/files/package.json +2 -2
- package/blueprints/app/files/tests/helpers/index.js +42 -0
- package/blueprints/app/files/tests/index.html +0 -1
- package/docs/build/data.json +156 -97
- package/lib/broccoli/default-packager.js +14 -1
- package/lib/broccoli/ember-app.js +4 -4
- package/lib/commands/destroy.js +7 -0
- package/lib/commands/generate.js +16 -7
- package/lib/models/blueprint.js +209 -4
- package/lib/models/installation-checker.js +1 -1
- package/lib/models/project.js +47 -4
- package/package.json +15 -14
- package/tests/helpers/fixturify-project.js +1 -0
- package/tests/helpers/package-cache.js +1 -1
- package/blueprints/app/files/tests/helpers/.gitkeep +0 -0
|
@@ -12,6 +12,7 @@ const ConfigReplace = require('broccoli-config-replace');
|
|
|
12
12
|
const emberAppUtils = require('../utilities/ember-app-utils');
|
|
13
13
|
const funnelReducer = require('broccoli-funnel-reducer');
|
|
14
14
|
const addonProcessTree = require('../utilities/addon-process-tree');
|
|
15
|
+
const { deprecate } = require('../debug');
|
|
15
16
|
|
|
16
17
|
const preprocessCss = p.preprocessCss;
|
|
17
18
|
const preprocessJs = p.preprocessJs;
|
|
@@ -628,9 +629,21 @@ module.exports = class DefaultPackager {
|
|
|
628
629
|
* @param {String} bowerDirectory Custom path to bower components
|
|
629
630
|
*/
|
|
630
631
|
packageBower(tree, bowerDirectory) {
|
|
632
|
+
let destDir = bowerDirectory || DEFAULT_BOWER_PATH;
|
|
633
|
+
|
|
634
|
+
deprecate(`Building Bower packages has been deprecated. You have Bower packages in \`${destDir}\`.`, false, {
|
|
635
|
+
for: 'ember-cli',
|
|
636
|
+
id: 'ember-cli.building-bower-packages',
|
|
637
|
+
since: {
|
|
638
|
+
available: '4.2.0',
|
|
639
|
+
enabled: '4.2.0',
|
|
640
|
+
},
|
|
641
|
+
until: '5.0.0',
|
|
642
|
+
});
|
|
643
|
+
|
|
631
644
|
if (this._cachedBower === null) {
|
|
632
645
|
this._cachedBower = new Funnel(tree, {
|
|
633
|
-
destDir
|
|
646
|
+
destDir,
|
|
634
647
|
annotation: 'Packaged Bower',
|
|
635
648
|
});
|
|
636
649
|
}
|
|
@@ -20,9 +20,9 @@ const concat = require('broccoli-concat');
|
|
|
20
20
|
const BroccoliDebug = require('broccoli-debug');
|
|
21
21
|
const AmdFunnel = require('broccoli-amd-funnel');
|
|
22
22
|
const mergeTrees = require('./merge-trees');
|
|
23
|
+
const broccoliMergeTrees = require('broccoli-merge-trees');
|
|
23
24
|
const WatchedDir = require('broccoli-source').WatchedDir;
|
|
24
25
|
const UnwatchedDir = require('broccoli-source').UnwatchedDir;
|
|
25
|
-
const BroccoliMergeTrees = require('broccoli-merge-trees');
|
|
26
26
|
|
|
27
27
|
const merge = require('ember-cli-lodash-subset').merge;
|
|
28
28
|
const defaultsDeep = require('ember-cli-lodash-subset').defaultsDeep;
|
|
@@ -108,7 +108,7 @@ class EmberApp {
|
|
|
108
108
|
|
|
109
109
|
this.registry = options.registry || p.defaultRegistry(this);
|
|
110
110
|
|
|
111
|
-
this.bowerDirectory = this.project.
|
|
111
|
+
this.bowerDirectory = this.project._bowerDirectory;
|
|
112
112
|
|
|
113
113
|
this._initTestsAndHinting(options);
|
|
114
114
|
this._initOptions(options);
|
|
@@ -438,7 +438,7 @@ class EmberApp {
|
|
|
438
438
|
@method _initVendorFiles
|
|
439
439
|
*/
|
|
440
440
|
_initVendorFiles() {
|
|
441
|
-
let bowerDeps = this.project.
|
|
441
|
+
let bowerDeps = this.project._bowerDependencies();
|
|
442
442
|
let ember = this.project.findAddonByName('ember-source');
|
|
443
443
|
let addonEmberCliShims = this.project.findAddonByName('ember-cli-shims');
|
|
444
444
|
let bowerEmberCliShims = bowerDeps['ember-cli-shims'];
|
|
@@ -1727,7 +1727,7 @@ class EmberApp {
|
|
|
1727
1727
|
}
|
|
1728
1728
|
|
|
1729
1729
|
let trees = [].concat(packagedTree, additionalTrees).filter(Boolean);
|
|
1730
|
-
let combinedPackageTree =
|
|
1730
|
+
let combinedPackageTree = broccoliMergeTrees(trees);
|
|
1731
1731
|
|
|
1732
1732
|
return this.addonPostprocessTree('all', combinedPackageTree);
|
|
1733
1733
|
}
|
package/lib/commands/destroy.js
CHANGED
|
@@ -26,6 +26,13 @@ module.exports = Command.extend({
|
|
|
26
26
|
description:
|
|
27
27
|
'Runs a blueprint against an in repo addon. ' + 'A path is expected, relative to the root of the project.',
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
name: 'typescript',
|
|
31
|
+
type: Boolean,
|
|
32
|
+
aliases: ['ts'],
|
|
33
|
+
description:
|
|
34
|
+
'Specifically destroys the TypeScript output of the `generate` command. Run `--no-typescript` to instead target the JavaScript output.',
|
|
35
|
+
},
|
|
29
36
|
],
|
|
30
37
|
|
|
31
38
|
anonymousOptions: ['<blueprint>'],
|
package/lib/commands/generate.js
CHANGED
|
@@ -9,6 +9,11 @@ const _ = require('ember-cli-lodash-subset');
|
|
|
9
9
|
const EOL = require('os').EOL;
|
|
10
10
|
const SilentError = require('silent-error');
|
|
11
11
|
|
|
12
|
+
const UNKNOWN_BLUEPRINT_ERROR =
|
|
13
|
+
'The `ember generate` command requires a ' +
|
|
14
|
+
'blueprint name to be specified. ' +
|
|
15
|
+
'For more details, use `ember help`';
|
|
16
|
+
|
|
12
17
|
module.exports = Command.extend({
|
|
13
18
|
name: 'generate',
|
|
14
19
|
description: 'Generates new code from blueprints.',
|
|
@@ -30,6 +35,12 @@ module.exports = Command.extend({
|
|
|
30
35
|
description:
|
|
31
36
|
'Runs a blueprint against an in repo addon. ' + 'A path is expected, relative to the root of the project.',
|
|
32
37
|
},
|
|
38
|
+
{
|
|
39
|
+
name: 'typescript',
|
|
40
|
+
type: Boolean,
|
|
41
|
+
aliases: ['ts'],
|
|
42
|
+
description: 'Generates a version of the blueprint written in TypeScript (if available).',
|
|
43
|
+
},
|
|
33
44
|
],
|
|
34
45
|
|
|
35
46
|
anonymousOptions: ['<blueprint>'],
|
|
@@ -40,13 +51,7 @@ module.exports = Command.extend({
|
|
|
40
51
|
let blueprintName = rawArgs[0];
|
|
41
52
|
|
|
42
53
|
if (!blueprintName) {
|
|
43
|
-
return Promise.reject(
|
|
44
|
-
new SilentError(
|
|
45
|
-
'The `ember generate` command requires a ' +
|
|
46
|
-
'blueprint name to be specified. ' +
|
|
47
|
-
'For more details, use `ember help`.'
|
|
48
|
-
)
|
|
49
|
-
);
|
|
54
|
+
return Promise.reject(new SilentError(UNKNOWN_BLUEPRINT_ERROR));
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
let taskArgs = {
|
|
@@ -166,3 +171,7 @@ module.exports = Command.extend({
|
|
|
166
171
|
}
|
|
167
172
|
},
|
|
168
173
|
});
|
|
174
|
+
|
|
175
|
+
module.exports.ERRORS = {
|
|
176
|
+
UNKNOWN_BLUEPRINT_ERROR,
|
|
177
|
+
};
|
package/lib/models/blueprint.js
CHANGED
|
@@ -23,7 +23,9 @@ const EOL = require('os').EOL;
|
|
|
23
23
|
const bowEpParser = require('bower-endpoint-parser');
|
|
24
24
|
const logger = require('heimdalljs-logger')('ember-cli:blueprint');
|
|
25
25
|
const normalizeEntityName = require('ember-cli-normalize-entity-name');
|
|
26
|
+
const { removeTypes } = require('remove-types');
|
|
26
27
|
const isAddon = require('../utilities/is-addon');
|
|
28
|
+
const { deprecate } = require('../debug');
|
|
27
29
|
|
|
28
30
|
const initialIgnoredFiles = ['.DS_Store'];
|
|
29
31
|
|
|
@@ -195,6 +197,18 @@ let Blueprint = CoreObject.extend({
|
|
|
195
197
|
|
|
196
198
|
_printableProperties: ['name', 'description', 'availableOptions', 'anonymousOptions', 'overridden'],
|
|
197
199
|
|
|
200
|
+
/**
|
|
201
|
+
Indicates whether or not a blueprint is a candidate for automatic transpilation from TS to JS.
|
|
202
|
+
This property could be false in the case that the blueprint is written in JS and is not intended
|
|
203
|
+
to work with TS at all, OR in the case that the blueprint is written in TS and the author does
|
|
204
|
+
not intend to support transpilation to JS.
|
|
205
|
+
|
|
206
|
+
@public
|
|
207
|
+
@property shouldTransformTypeScript
|
|
208
|
+
@type Boolean
|
|
209
|
+
*/
|
|
210
|
+
shouldTransformTypeScript: false,
|
|
211
|
+
|
|
198
212
|
init(blueprintPath) {
|
|
199
213
|
this._super();
|
|
200
214
|
|
|
@@ -429,12 +443,85 @@ let Blueprint = CoreObject.extend({
|
|
|
429
443
|
let fileInfos = await process.call(this, intoDir, locals);
|
|
430
444
|
|
|
431
445
|
// commit changes for each FileInfo (with prompting as needed)
|
|
432
|
-
await Promise.all(fileInfos.map((
|
|
446
|
+
await Promise.all(fileInfos.map((info) => this._commit(info)));
|
|
433
447
|
|
|
434
448
|
// run afterInstall/afterUninstall userland hooks
|
|
435
449
|
await afterHook.call(this, options);
|
|
436
450
|
},
|
|
437
451
|
|
|
452
|
+
/**
|
|
453
|
+
@private
|
|
454
|
+
@method shouldConvertToJS
|
|
455
|
+
@param {Object} options
|
|
456
|
+
@param {FileInfo} fileInfo
|
|
457
|
+
@return {Boolean}
|
|
458
|
+
*/
|
|
459
|
+
shouldConvertToJS(options, fileInfo) {
|
|
460
|
+
// If this isn't turned on, it doesn't matter what else was passed, we're not touching it.
|
|
461
|
+
if (!this.shouldTransformTypeScript) {
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// If the blueprint isn't a TS file to begin with, there's nothing to convert.
|
|
466
|
+
if (!isTypeScriptFile(fileInfo.outputPath)) {
|
|
467
|
+
// If the user wants TypeScript output but there is no TypeScript blueprint available, we want
|
|
468
|
+
// to warn them that they're not going to get what they're expecting while still at least giving
|
|
469
|
+
// them the JS output. We check for this *after* checking `shouldTranformTypeScript` because
|
|
470
|
+
// it's possible for people to set `{typescript: true}` in their `.ember-cli` file, which would
|
|
471
|
+
// then erroneously trigger this message every time they generate a JS blueprint even though
|
|
472
|
+
// they didn't pass the flag.
|
|
473
|
+
if (options.typescript === true) {
|
|
474
|
+
this.ui.writeLine(
|
|
475
|
+
chalk.yellow(
|
|
476
|
+
"You passed the '--typescript' flag but there is no TypeScript blueprint available. " +
|
|
477
|
+
'A JavaScript blueprint will be generated instead.'
|
|
478
|
+
)
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Indicates when the user explicitly passed either `--typescript` or `--no-typescript` as opposed
|
|
486
|
+
// to not passing a flag at all and allowing for default behavior
|
|
487
|
+
const userExplicitlySelectedTypeScriptStatus = options.typescript !== undefined;
|
|
488
|
+
|
|
489
|
+
// Indicates when the user has asked for TypeScript either globally (by setting
|
|
490
|
+
// `isTypeScriptProject` to true) or locally (by passing the `--typescript` flag when they
|
|
491
|
+
// invoked the generator). Although ember-cli merges `.ember-cli` and all of the flag values into
|
|
492
|
+
// one object, we thought the DX would be improved by differentiating between what is intended
|
|
493
|
+
// to be global vs. local config.
|
|
494
|
+
const shouldUseTypeScript = userExplicitlySelectedTypeScriptStatus
|
|
495
|
+
? options.typescript
|
|
496
|
+
: options.isTypeScriptProject;
|
|
497
|
+
|
|
498
|
+
// if the user wants TS output and we have a TS file available, we do *not* want to downlevel to JS
|
|
499
|
+
if (shouldUseTypeScript) {
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return true;
|
|
504
|
+
},
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
@private
|
|
508
|
+
@method convertToJS
|
|
509
|
+
@param {FileInfo} fileInfo
|
|
510
|
+
@return {Promise}
|
|
511
|
+
*/
|
|
512
|
+
async convertToJS(fileInfo) {
|
|
513
|
+
let rendered = await fileInfo.render();
|
|
514
|
+
|
|
515
|
+
const transformed = await removeTypes(rendered);
|
|
516
|
+
|
|
517
|
+
fileInfo.rendered = transformed;
|
|
518
|
+
|
|
519
|
+
fileInfo.displayPath = replaceExtension(fileInfo.displayPath, '.js');
|
|
520
|
+
fileInfo.outputPath = replaceExtension(fileInfo.outputPath, '.js');
|
|
521
|
+
|
|
522
|
+
return fileInfo;
|
|
523
|
+
},
|
|
524
|
+
|
|
438
525
|
/**
|
|
439
526
|
@method install
|
|
440
527
|
@param {Object} options
|
|
@@ -756,6 +843,17 @@ let Blueprint = CoreObject.extend({
|
|
|
756
843
|
|
|
757
844
|
return Promise.all(fileInfos.filter(isValidFile).map(prepareConfirm))
|
|
758
845
|
.then(finishProcessingForInstall)
|
|
846
|
+
.then((fileInfos) => {
|
|
847
|
+
return Promise.all(
|
|
848
|
+
fileInfos.map((info) => {
|
|
849
|
+
if (this.shouldConvertToJS(this.options, info)) {
|
|
850
|
+
return this.convertToJS(info);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
return info;
|
|
854
|
+
})
|
|
855
|
+
);
|
|
856
|
+
})
|
|
759
857
|
.then((fileInfos) => fileInfos.concat(fileInfosToRemove));
|
|
760
858
|
},
|
|
761
859
|
|
|
@@ -769,7 +867,45 @@ let Blueprint = CoreObject.extend({
|
|
|
769
867
|
|
|
770
868
|
this._ignoreUpdateFiles();
|
|
771
869
|
|
|
772
|
-
|
|
870
|
+
fileInfos = fileInfos.filter(isValidFile).reduce((acc, info) => {
|
|
871
|
+
// if it's possible that this blueprint could have produced either typescript OR javascript, we have to do some
|
|
872
|
+
// work to figure out which files to delete.
|
|
873
|
+
if (this.shouldTransformTypeScript) {
|
|
874
|
+
if (this.options.typescript === true) {
|
|
875
|
+
// if the user explicitly passed `--typescript`, we only want to delete TS files, so we stick with the existing
|
|
876
|
+
// info object since it will contain a .ts outputPath (since we know this blueprint is authored in TS because
|
|
877
|
+
// of our check above)
|
|
878
|
+
acc.push(info);
|
|
879
|
+
return acc;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
const jsInfo = new FileInfo({
|
|
883
|
+
...info,
|
|
884
|
+
outputPath: replaceExtension(info.outputPath, '.js'),
|
|
885
|
+
displayPath: replaceExtension(info.displayPath, '.js'),
|
|
886
|
+
});
|
|
887
|
+
|
|
888
|
+
if (this.options.typescript === false) {
|
|
889
|
+
// if the user explicitly passed `--no-typescript`, we only want to delete JS file, so we return our newly
|
|
890
|
+
// created jsInfo object since it contains the javascript version of the output path.
|
|
891
|
+
acc.push(jsInfo);
|
|
892
|
+
return acc;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
if (this.options.typescript === undefined) {
|
|
896
|
+
// if the user didn't specify one way or the other, then both the JS and TS paths are possibilities, so we add
|
|
897
|
+
// both of them to the list. `finishProcessingForUninstall` will actually look to see which of them exists and
|
|
898
|
+
// delete whatever it finds.
|
|
899
|
+
acc.push(info, jsInfo);
|
|
900
|
+
return acc;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
acc.push(info);
|
|
905
|
+
return acc;
|
|
906
|
+
}, []);
|
|
907
|
+
|
|
908
|
+
return finishProcessingForUninstall(fileInfos);
|
|
773
909
|
},
|
|
774
910
|
|
|
775
911
|
/**
|
|
@@ -1017,10 +1153,29 @@ let Blueprint = CoreObject.extend({
|
|
|
1017
1153
|
```
|
|
1018
1154
|
*/
|
|
1019
1155
|
addBowerPackageToProject(localPackageName, target, installOptions) {
|
|
1156
|
+
deprecate(
|
|
1157
|
+
[
|
|
1158
|
+
`(Blueprint: \`${this.name}\`) \`addBowerPackageToProject\` has been deprecated.`,
|
|
1159
|
+
'If the package is also available on the npm registry, please use `addPackageToProject` instead.',
|
|
1160
|
+
'If not, please install the Bower package manually by running:',
|
|
1161
|
+
`\`bower install ${localPackageName} --save\``,
|
|
1162
|
+
].join('\n'),
|
|
1163
|
+
false,
|
|
1164
|
+
{
|
|
1165
|
+
for: 'ember-cli',
|
|
1166
|
+
id: 'ember-cli.blueprint.add-bower-package-to-project',
|
|
1167
|
+
since: {
|
|
1168
|
+
available: '4.2.0',
|
|
1169
|
+
enabled: '4.2.0',
|
|
1170
|
+
},
|
|
1171
|
+
until: '5.0.0',
|
|
1172
|
+
}
|
|
1173
|
+
);
|
|
1174
|
+
|
|
1020
1175
|
let lpn = localPackageName;
|
|
1021
1176
|
let tar = target;
|
|
1022
1177
|
let packageObject = bowEpParser.json2decomposed(lpn, tar);
|
|
1023
|
-
return this.addBowerPackagesToProject([packageObject], installOptions);
|
|
1178
|
+
return this.addBowerPackagesToProject([packageObject], installOptions, true);
|
|
1024
1179
|
},
|
|
1025
1180
|
|
|
1026
1181
|
/**
|
|
@@ -1039,7 +1194,7 @@ let Blueprint = CoreObject.extend({
|
|
|
1039
1194
|
@param {Object} installOptions
|
|
1040
1195
|
@return {Promise}
|
|
1041
1196
|
*/
|
|
1042
|
-
addBowerPackagesToProject(packages, installOptions) {
|
|
1197
|
+
addBowerPackagesToProject(packages, installOptions, _deprecationCondition = false) {
|
|
1043
1198
|
let task = this.taskFor('bower-install');
|
|
1044
1199
|
let installText = packages.length > 1 ? 'install bower packages' : 'install bower package';
|
|
1045
1200
|
let packageNames = [];
|
|
@@ -1051,6 +1206,25 @@ let Blueprint = CoreObject.extend({
|
|
|
1051
1206
|
})
|
|
1052
1207
|
.map(bowEpParser.compose);
|
|
1053
1208
|
|
|
1209
|
+
deprecate(
|
|
1210
|
+
[
|
|
1211
|
+
`(Blueprint: \`${this.name}\`) \`addBowerPackagesToProject\` has been deprecated.`,
|
|
1212
|
+
'If the packages are also available on the npm registry, please use `addPackagesToProject` instead.',
|
|
1213
|
+
'If not, please install the Bower packages manually by running:',
|
|
1214
|
+
`\`bower install ${packageNames.join(' ')} --save\``,
|
|
1215
|
+
].join('\n'),
|
|
1216
|
+
_deprecationCondition,
|
|
1217
|
+
{
|
|
1218
|
+
for: 'ember-cli',
|
|
1219
|
+
id: 'ember-cli.blueprint.add-bower-packages-to-project',
|
|
1220
|
+
since: {
|
|
1221
|
+
available: '4.2.0',
|
|
1222
|
+
enabled: '4.2.0',
|
|
1223
|
+
},
|
|
1224
|
+
until: '5.0.0',
|
|
1225
|
+
}
|
|
1226
|
+
);
|
|
1227
|
+
|
|
1054
1228
|
this._writeStatusToUI(chalk.green, installText, packageNames.join(', '));
|
|
1055
1229
|
|
|
1056
1230
|
return task.run({
|
|
@@ -1279,6 +1453,23 @@ let Blueprint = CoreObject.extend({
|
|
|
1279
1453
|
Blueprint.lookup = function (name, options) {
|
|
1280
1454
|
options = options || {};
|
|
1281
1455
|
|
|
1456
|
+
if (name.includes(path.sep)) {
|
|
1457
|
+
let blueprintPath = path.resolve(name);
|
|
1458
|
+
let isNameAPath = Boolean(blueprintPath);
|
|
1459
|
+
|
|
1460
|
+
if (isNameAPath) {
|
|
1461
|
+
if (Blueprint._existsSync(blueprintPath)) {
|
|
1462
|
+
return Blueprint.load(blueprintPath);
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
if (!options.ignoreMissing) {
|
|
1466
|
+
throw new SilentError(`Unknown blueprint: ${name}`);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1282
1473
|
let lookupPaths = generateLookupPaths(options.paths);
|
|
1283
1474
|
|
|
1284
1475
|
let lookupPath;
|
|
@@ -1581,4 +1772,18 @@ function finishProcessingForUninstall(infos) {
|
|
|
1581
1772
|
return validInfos;
|
|
1582
1773
|
}
|
|
1583
1774
|
|
|
1775
|
+
function replaceExtension(filePath, newExt) {
|
|
1776
|
+
const { dir, name } = path.parse(filePath);
|
|
1777
|
+
|
|
1778
|
+
return path.format({
|
|
1779
|
+
dir,
|
|
1780
|
+
name,
|
|
1781
|
+
ext: newExt,
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
function isTypeScriptFile(filePath) {
|
|
1786
|
+
return path.extname(filePath) === '.ts';
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1584
1789
|
module.exports = Blueprint;
|
package/lib/models/project.js
CHANGED
|
@@ -18,6 +18,7 @@ const PackageInfoCache = require('./package-info-cache');
|
|
|
18
18
|
const PerBundleAddonCache = require('./per-bundle-addon-cache');
|
|
19
19
|
const instantiateAddons = require('./instantiate-addons');
|
|
20
20
|
const HostInfoCache = require('./host-info-cache');
|
|
21
|
+
const { deprecate } = require('../debug');
|
|
21
22
|
|
|
22
23
|
let processCwd = process.cwd();
|
|
23
24
|
|
|
@@ -117,15 +118,36 @@ class Project {
|
|
|
117
118
|
|
|
118
119
|
if (fs.existsSync(bowerrcPath)) {
|
|
119
120
|
try {
|
|
120
|
-
this.
|
|
121
|
+
this._bowerDirectory = fs.readJsonSync(bowerrcPath).directory;
|
|
121
122
|
} catch (exception) {
|
|
122
123
|
logger.info('failed to parse bowerc: %s', exception);
|
|
123
|
-
this.
|
|
124
|
+
this._bowerDirectory = null;
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
this.
|
|
128
|
-
logger.info('bowerDirectory: %s', this.
|
|
128
|
+
this._bowerDirectory = this._bowerDirectory || 'bower_components';
|
|
129
|
+
logger.info('bowerDirectory: %s', this._bowerDirectory);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
get bowerDirectory() {
|
|
133
|
+
deprecate(
|
|
134
|
+
[
|
|
135
|
+
'`bowerDirectory` has been deprecated.',
|
|
136
|
+
"If you still need access to the project's Bower directory, you will have to manually resolve the project's `.bowerrc` file, and read the `directory` property instead.",
|
|
137
|
+
].join('\n'),
|
|
138
|
+
false,
|
|
139
|
+
{
|
|
140
|
+
for: 'ember-cli',
|
|
141
|
+
id: 'ember-cli.project.bower-directory',
|
|
142
|
+
since: {
|
|
143
|
+
available: '4.2.0',
|
|
144
|
+
enabled: '4.2.0',
|
|
145
|
+
},
|
|
146
|
+
until: '5.0.0',
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
return this._bowerDirectory;
|
|
129
151
|
}
|
|
130
152
|
|
|
131
153
|
// Checks whether the project's npm dependencies are
|
|
@@ -387,6 +409,27 @@ class Project {
|
|
|
387
409
|
@return {Object} Bower dependencies
|
|
388
410
|
*/
|
|
389
411
|
bowerDependencies(bower) {
|
|
412
|
+
deprecate(
|
|
413
|
+
[
|
|
414
|
+
'`bowerDependencies` has been deprecated.',
|
|
415
|
+
"If you still need access to the project's Bower dependencies, you will have to manually resolve the project's `bower.json` file instead.",
|
|
416
|
+
].join('\n'),
|
|
417
|
+
false,
|
|
418
|
+
{
|
|
419
|
+
for: 'ember-cli',
|
|
420
|
+
id: 'ember-cli.project.bower-dependencies',
|
|
421
|
+
since: {
|
|
422
|
+
available: '4.2.0',
|
|
423
|
+
enabled: '4.2.0',
|
|
424
|
+
},
|
|
425
|
+
until: '5.0.0',
|
|
426
|
+
}
|
|
427
|
+
);
|
|
428
|
+
|
|
429
|
+
return this._bowerDependencies(bower);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
_bowerDependencies(bower) {
|
|
390
433
|
if (!bower) {
|
|
391
434
|
let bowerPath = path.join(this.root, 'bower.json');
|
|
392
435
|
bower = fs.existsSync(bowerPath) ? require(bowerPath) : {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-beta.1",
|
|
4
4
|
"description": "Command line tool for developing ambitious ember.js apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"broccoli-debug": "^0.6.5",
|
|
54
54
|
"broccoli-funnel": "^3.0.8",
|
|
55
55
|
"broccoli-funnel-reducer": "^1.0.0",
|
|
56
|
-
"broccoli-merge-trees": "^
|
|
56
|
+
"broccoli-merge-trees": "^4.2.0",
|
|
57
57
|
"broccoli-middleware": "^2.1.1",
|
|
58
58
|
"broccoli-slow-trees": "^3.1.0",
|
|
59
59
|
"broccoli-source": "^3.0.1",
|
|
60
60
|
"broccoli-stew": "^3.0.0",
|
|
61
61
|
"calculate-cache-key-for-tree": "^2.0.0",
|
|
62
62
|
"capture-exit": "^2.0.0",
|
|
63
|
-
"chalk": "^4.1.
|
|
63
|
+
"chalk": "^4.1.2",
|
|
64
64
|
"ci-info": "^3.3.0",
|
|
65
65
|
"clean-base-url": "^1.0.0",
|
|
66
66
|
"compression": "^1.7.4",
|
|
@@ -98,10 +98,9 @@
|
|
|
98
98
|
"is-language-code": "^3.1.0",
|
|
99
99
|
"isbinaryfile": "^4.0.8",
|
|
100
100
|
"js-yaml": "^3.14.0",
|
|
101
|
-
"json-stable-stringify": "^1.0.1",
|
|
102
101
|
"leek": "0.0.24",
|
|
103
102
|
"lodash.template": "^4.5.0",
|
|
104
|
-
"markdown-it": "^12.0
|
|
103
|
+
"markdown-it": "^12.2.0",
|
|
105
104
|
"markdown-it-terminal": "0.2.1",
|
|
106
105
|
"minimatch": "^3.0.4",
|
|
107
106
|
"morgan": "^1.10.0",
|
|
@@ -110,14 +109,16 @@
|
|
|
110
109
|
"p-defer": "^3.0.0",
|
|
111
110
|
"portfinder": "^1.0.28",
|
|
112
111
|
"promise-map-series": "^0.3.0",
|
|
113
|
-
"promise.hash.helper": "^1.0.
|
|
112
|
+
"promise.hash.helper": "^1.0.8",
|
|
114
113
|
"quick-temp": "^0.1.8",
|
|
114
|
+
"remove-types": "^1.0.0",
|
|
115
115
|
"resolve": "^1.20.0",
|
|
116
116
|
"resolve-package-path": "^3.1.0",
|
|
117
|
+
"safe-stable-stringify": "^2.2.0",
|
|
117
118
|
"sane": "^5.0.1",
|
|
118
|
-
"semver": "^7.3.
|
|
119
|
+
"semver": "^7.3.5",
|
|
119
120
|
"silent-error": "^1.1.1",
|
|
120
|
-
"sort-package-json": "^1.
|
|
121
|
+
"sort-package-json": "^1.51.0",
|
|
121
122
|
"symlink-or-copy": "^1.3.1",
|
|
122
123
|
"temp": "0.9.4",
|
|
123
124
|
"testem": "^3.6.0",
|
|
@@ -126,7 +127,7 @@
|
|
|
126
127
|
"uuid": "^8.3.2",
|
|
127
128
|
"walk-sync": "^2.2.0",
|
|
128
129
|
"watch-detector": "^1.0.1",
|
|
129
|
-
"workerpool": "^6.
|
|
130
|
+
"workerpool": "^6.2.0",
|
|
130
131
|
"yam": "^1.0.0"
|
|
131
132
|
},
|
|
132
133
|
"devDependencies": {
|
|
@@ -134,7 +135,7 @@
|
|
|
134
135
|
"@octokit/rest": "^18.12.0",
|
|
135
136
|
"broccoli-plugin": "^4.0.3",
|
|
136
137
|
"broccoli-test-helper": "^2.0.0",
|
|
137
|
-
"chai": "^4.3.
|
|
138
|
+
"chai": "^4.3.6",
|
|
138
139
|
"chai-as-promised": "^7.1.1",
|
|
139
140
|
"chai-files": "^1.4.0",
|
|
140
141
|
"chai-jest-snapshot": "^2.0.0",
|
|
@@ -145,15 +146,15 @@
|
|
|
145
146
|
"eslint-plugin-chai-expect": "^3.0.0",
|
|
146
147
|
"eslint-plugin-mocha": "^9.0.0",
|
|
147
148
|
"eslint-plugin-node": "^11.1.0",
|
|
148
|
-
"eslint-plugin-prettier": "^
|
|
149
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
149
150
|
"fixturify": "^2.1.0",
|
|
150
151
|
"jsdom": "^19.0.0",
|
|
151
152
|
"latest-version": "^5.1.0",
|
|
152
|
-
"mocha": "^9.1
|
|
153
|
-
"nock": "^13.2.
|
|
153
|
+
"mocha": "^9.2.1",
|
|
154
|
+
"nock": "^13.2.2",
|
|
154
155
|
"nyc": "^15.1.0",
|
|
155
156
|
"prettier": "2.5.1",
|
|
156
|
-
"release-it": "^14.
|
|
157
|
+
"release-it": "^14.12.4",
|
|
157
158
|
"rimraf": "^3.0.2",
|
|
158
159
|
"strip-ansi": "^6.0.0",
|
|
159
160
|
"supertest": "^6.1.6",
|
|
@@ -5,7 +5,7 @@ const path = require('path');
|
|
|
5
5
|
const quickTemp = require('quick-temp');
|
|
6
6
|
const Configstore = require('configstore');
|
|
7
7
|
const CommandGenerator = require('./command-generator');
|
|
8
|
-
const stableStringify = require('
|
|
8
|
+
const stableStringify = require('safe-stable-stringify');
|
|
9
9
|
const symlinkOrCopySync = require('symlink-or-copy').sync;
|
|
10
10
|
|
|
11
11
|
let originalWorkingDirectory = process.cwd();
|
|
File without changes
|