@angular/cli 1.4.3 → 1.4.4
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/commands/new.js +7 -14
- package/commands/new.js.map +1 -1
- package/ember-cli/lib/cli/cli.js +0 -15
- package/ember-cli/lib/cli/index.js +0 -12
- package/ember-cli/lib/cli/lookup-command.js +0 -29
- package/ember-cli/lib/models/command.js +1 -15
- package/ember-cli/lib/models/installation-checker.js +0 -3
- package/ember-cli/lib/models/project.js +0 -222
- package/lib/cli/index.d.ts +1 -0
- package/lib/cli/index.js +40 -50
- package/lib/cli/index.js.map +1 -0
- package/models/webpack-config.d.ts +8 -12
- package/models/webpack-config.js.map +1 -1
- package/models/webpack-configs/common.js +7 -0
- package/models/webpack-configs/common.js.map +1 -1
- package/models/webpack-configs/development.d.ts +1 -1
- package/models/webpack-configs/development.js +3 -2
- package/models/webpack-configs/development.js.map +1 -1
- package/models/webpack-configs/production.d.ts +1 -1
- package/models/webpack-configs/production.js +3 -2
- package/models/webpack-configs/production.js.map +1 -1
- package/models/webpack-configs/server.d.ts +1 -1
- package/models/webpack-configs/server.js +3 -2
- package/models/webpack-configs/server.js.map +1 -1
- package/models/webpack-configs/test.d.ts +2 -1
- package/models/webpack-configs/test.js +4 -6
- package/models/webpack-configs/test.js.map +1 -1
- package/models/webpack-configs/typescript.d.ts +3 -3
- package/models/webpack-configs/typescript.js +9 -6
- package/models/webpack-configs/typescript.js.map +1 -1
- package/models/webpack-test-config.d.ts +1 -2
- package/models/webpack-test-config.js +2 -3
- package/models/webpack-test-config.js.map +1 -1
- package/package.json +5 -8
- package/plugins/webpack.d.ts +5 -0
- package/plugins/webpack.js +13 -13
- package/plugins/webpack.js.map +1 -0
- package/tasks/eject.js +15 -2
- package/tasks/eject.js.map +1 -1
- package/tasks/serve.js +3 -3
- package/tasks/serve.js.map +1 -1
- package/upgrade/version.js +3 -2
- package/upgrade/version.js.map +1 -1
- package/commands/init.d.ts +0 -2
- package/commands/init.js +0 -44
- package/commands/init.js.map +0 -1
package/commands/new.js
CHANGED
|
@@ -3,12 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const chalk = require("chalk");
|
|
6
|
-
const init_1 = require("./init");
|
|
7
6
|
const config_1 = require("../models/config");
|
|
8
7
|
const validate_project_name_1 = require("../utilities/validate-project-name");
|
|
9
8
|
const common_tags_1 = require("common-tags");
|
|
10
9
|
const Command = require('../ember-cli/lib/models/command');
|
|
11
|
-
const Project = require('../ember-cli/lib/models/project');
|
|
12
10
|
const SilentError = require('silent-error');
|
|
13
11
|
const NewCommand = Command.extend({
|
|
14
12
|
name: 'new',
|
|
@@ -48,13 +46,6 @@ const NewCommand = Command.extend({
|
|
|
48
46
|
aliases: ['si'],
|
|
49
47
|
description: 'Skip installing packages.'
|
|
50
48
|
},
|
|
51
|
-
{
|
|
52
|
-
name: 'skip-git',
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false,
|
|
55
|
-
aliases: ['sg'],
|
|
56
|
-
description: 'Skip initializing a git repository.'
|
|
57
|
-
},
|
|
58
49
|
{
|
|
59
50
|
name: 'skip-commit',
|
|
60
51
|
type: Boolean,
|
|
@@ -131,13 +122,15 @@ const NewCommand = Command.extend({
|
|
|
131
122
|
else {
|
|
132
123
|
commandOptions.collectionName = this.getCollectionName(rawArgs);
|
|
133
124
|
}
|
|
134
|
-
const
|
|
135
|
-
|
|
125
|
+
const InitTask = require('../tasks/init').default;
|
|
126
|
+
const initTask = new InitTask({
|
|
127
|
+
project: this.project,
|
|
136
128
|
tasks: this.tasks,
|
|
137
|
-
|
|
129
|
+
ui: this.ui,
|
|
138
130
|
});
|
|
139
|
-
|
|
140
|
-
|
|
131
|
+
// Ensure skipGit has a boolean value.
|
|
132
|
+
commandOptions.skipGit = commandOptions.skipGit === undefined ? false : commandOptions.skipGit;
|
|
133
|
+
return initTask.run(commandOptions, rawArgs);
|
|
141
134
|
}
|
|
142
135
|
});
|
|
143
136
|
NewCommand.overrideCore = true;
|
package/commands/new.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new.js","sourceRoot":"/users/hansl/sources/angular-cli/","sources":["commands/new.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAC7B,+BAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"new.js","sourceRoot":"/users/hansl/sources/angular-cli/","sources":["commands/new.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAC7B,+BAA+B;AAE/B,6CAA6C;AAC7C,8EAAyE;AACzE,6CAAsC;AAGtC,MAAM,OAAO,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAC;AAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE5C,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,CAAC,GAAG,CAAC;IACd,WAAW,EAAE,oEAAoE;IACjF,KAAK,EAAE,gBAAgB;IAEvB,gBAAgB,EAAE;QAChB;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,CAAC,GAAG,CAAC;YACd,WAAW,EAAE,qBAAO,CAAA;;;OAGnB;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,CAAC,GAAG,CAAC;YACd,WAAW,EAAE,sCAAsC;SACpD;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,CAAC,IAAI,CAAC;YACf,WAAW,EAAE,gDAAgD;YAC7D,MAAM,EAAE,IAAI;SACb;QACD;YACE,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,O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|
5
|
-
let logger = require('heimdalljs-logger')('ember-cli:cli');
|
|
6
|
-
let loggerTesting = require('heimdalljs-logger')('ember-cli:testing');
|
|
7
|
-
const heimdall = require('heimdalljs');
|
|
8
5
|
|
|
9
6
|
// Disabled until e2e and serve command can be evaluated/corrected -- require('../utilities/will-interrupt-process');
|
|
10
7
|
const onProcessInterrupt = { addHandler: (_handler) => { }, removeHandler: (_handler) => { } };
|
|
@@ -70,8 +67,6 @@ class CLI {
|
|
|
70
67
|
stopAndReport: (...args) => { },
|
|
71
68
|
start: (...args) => { },
|
|
72
69
|
};
|
|
73
|
-
|
|
74
|
-
logger.info('testing %o', !!this.testing);
|
|
75
70
|
}
|
|
76
71
|
|
|
77
72
|
/**
|
|
@@ -103,8 +98,6 @@ class CLI {
|
|
|
103
98
|
let commandArgs = args;
|
|
104
99
|
let helpOptions;
|
|
105
100
|
|
|
106
|
-
let commandLookupCreationtoken = heimdall.start('lookup-command');
|
|
107
|
-
|
|
108
101
|
let CurrentCommand = lookupCommand(environment.commands, commandName, commandArgs, {
|
|
109
102
|
project: environment.project,
|
|
110
103
|
ui: this.ui,
|
|
@@ -121,14 +114,10 @@ class CLI {
|
|
|
121
114
|
cli: this,
|
|
122
115
|
});
|
|
123
116
|
|
|
124
|
-
commandLookupCreationtoken.stop();
|
|
125
|
-
|
|
126
117
|
getOptionArgs('--verbose', commandArgs).forEach(arg => {
|
|
127
118
|
process.env[`EMBER_VERBOSE_${arg.toUpperCase()}`] = 'true';
|
|
128
119
|
});
|
|
129
120
|
|
|
130
|
-
logger.info('command: %s', commandName);
|
|
131
|
-
|
|
132
121
|
if (!this.testing) {
|
|
133
122
|
let skipInstallationCheck = commandArgs.indexOf('--skip-installation-check') !== -1;
|
|
134
123
|
if (environment.project.isEmberCLIProject() && !skipInstallationCheck) {
|
|
@@ -144,13 +133,10 @@ class CLI {
|
|
|
144
133
|
instrumentation.stopAndReport('init');
|
|
145
134
|
instrumentation.start('command');
|
|
146
135
|
|
|
147
|
-
loggerTesting.info('cli: command.beforeRun');
|
|
148
136
|
onProcessInterrupt.addHandler(onCommandInterrupt);
|
|
149
137
|
|
|
150
138
|
return command.beforeRun(commandArgs);
|
|
151
139
|
}).then(() => {
|
|
152
|
-
loggerTesting.info('cli: command.validateAndRun');
|
|
153
|
-
|
|
154
140
|
return command.validateAndRun(commandArgs);
|
|
155
141
|
}).then(result => {
|
|
156
142
|
instrumentation.stopAndReport('command', commandName, commandArgs);
|
|
@@ -172,7 +158,6 @@ class CLI {
|
|
|
172
158
|
|
|
173
159
|
return result;
|
|
174
160
|
}).then(exitCode => {
|
|
175
|
-
loggerTesting.info(`cli: command run complete. exitCode: ${exitCode}`);
|
|
176
161
|
// TODO: fix this
|
|
177
162
|
// Possibly this issue: https://github.com/joyent/node/issues/8329
|
|
178
163
|
// Wait to resolve promise when running on windows.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// Main entry point
|
|
4
|
-
let logger = require('heimdalljs-logger')('ember-cli:cli/index');
|
|
5
4
|
const path = require('path');
|
|
6
|
-
const heimdall = require('heimdalljs');
|
|
7
5
|
|
|
8
6
|
// ember-cli and user apps have many dependencies, many of which require
|
|
9
7
|
// process.addListener('exit', ....) for cleanup, by default this limit for
|
|
@@ -14,22 +12,12 @@ const heimdall = require('heimdalljs');
|
|
|
14
12
|
// https://github.com/babel/ember-cli-babel/issues/76
|
|
15
13
|
process.setMaxListeners(1000);
|
|
16
14
|
|
|
17
|
-
function configureLogger(env) {
|
|
18
|
-
let depth = Number(env['DEBUG_DEPTH']);
|
|
19
|
-
if (depth) {
|
|
20
|
-
let logConfig = require('heimdalljs').configFor('logging');
|
|
21
|
-
logConfig.depth = depth;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
15
|
// Options: Array cliArgs, Stream inputStream, Stream outputStream
|
|
26
16
|
module.exports = function(options) {
|
|
27
17
|
let UI = options.UI || require('../ui');
|
|
28
18
|
const CLI = require('./cli');
|
|
29
19
|
const Project = require('../models/project');
|
|
30
20
|
|
|
31
|
-
configureLogger(process.env);
|
|
32
|
-
|
|
33
21
|
// TODO: one UI (lib/models/project.js also has one for now...)
|
|
34
22
|
let ui = new UI({
|
|
35
23
|
inputStream: options.inputStream,
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
const UnknownCommand = require('../commands/unknown');
|
|
4
4
|
|
|
5
5
|
module.exports = function(commands, commandName, commandArgs, optionHash) {
|
|
6
|
-
let options = optionHash || {};
|
|
7
|
-
let project = options.project;
|
|
8
|
-
let ui = options.ui;
|
|
9
6
|
|
|
10
7
|
function aliasMatches(alias) {
|
|
11
8
|
return alias === commandName;
|
|
@@ -27,36 +24,10 @@ module.exports = function(commands, commandName, commandArgs, optionHash) {
|
|
|
27
24
|
// Attempt to find command in ember-cli core commands
|
|
28
25
|
let command = findCommand(commands, commandName);
|
|
29
26
|
|
|
30
|
-
let addonCommand;
|
|
31
|
-
// Attempt to find command within addons
|
|
32
|
-
if (project && project.eachAddonCommand) {
|
|
33
|
-
project.eachAddonCommand((addonName, commands) => {
|
|
34
|
-
addonCommand = findCommand(commands, commandName);
|
|
35
|
-
return !addonCommand;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (command && addonCommand) {
|
|
40
|
-
if (addonCommand.overrideCore) {
|
|
41
|
-
ui.writeWarnLine(`An ember-addon has attempted to override the core command "${command.prototype.name}". ` +
|
|
42
|
-
`The addon command will be used as the overridding was explicit.`);
|
|
43
|
-
|
|
44
|
-
return addonCommand;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
ui.writeWarnLine(`An ember-addon has attempted to override the core command "${command.prototype.name}". ` +
|
|
48
|
-
`The core command will be used.`);
|
|
49
|
-
return command;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
27
|
if (command) {
|
|
53
28
|
return command;
|
|
54
29
|
}
|
|
55
30
|
|
|
56
|
-
if (addonCommand) {
|
|
57
|
-
return addonCommand;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
31
|
// if we didn't find anything, return an "UnknownCommand"
|
|
61
32
|
return class extends UnknownCommand {
|
|
62
33
|
constructor(options) {
|
|
@@ -4,12 +4,10 @@ const nopt = require('nopt');
|
|
|
4
4
|
const chalk = require('chalk');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const camelize = require('ember-cli-string-utils').camelize;
|
|
7
|
-
const getCallerFile = require('get-caller-file');
|
|
8
7
|
const printCommand = require('../utilities/print-command');
|
|
9
8
|
const _ = require('lodash');
|
|
10
9
|
const EOL = require('os').EOL;
|
|
11
10
|
const CoreObject = require('core-object');
|
|
12
|
-
let logger = require('heimdalljs-logger')('ember-cli:command');
|
|
13
11
|
const SilentError = require('silent-error');
|
|
14
12
|
const fs = require('fs');
|
|
15
13
|
|
|
@@ -84,9 +82,7 @@ let Command = CoreObject.extend({
|
|
|
84
82
|
* @type String
|
|
85
83
|
* @example `new` or `generate`
|
|
86
84
|
*/
|
|
87
|
-
this.name = this.name ||
|
|
88
|
-
|
|
89
|
-
logger.info('initialize: name: %s, name: %s', this.name);
|
|
85
|
+
this.name = this.name || '<undefined>';
|
|
90
86
|
|
|
91
87
|
/**
|
|
92
88
|
* An array of aliases for the command
|
|
@@ -211,8 +207,6 @@ let Command = CoreObject.extend({
|
|
|
211
207
|
throw new Error(`Concurrent tasks are not supported`);
|
|
212
208
|
}
|
|
213
209
|
|
|
214
|
-
logger.info(`\`${this.name}\` command running \`${name}\` task`);
|
|
215
|
-
|
|
216
210
|
let Task = this.tasks[name];
|
|
217
211
|
if (!Task) {
|
|
218
212
|
throw new Error(`Unknown task "${name}"`);
|
|
@@ -223,11 +217,6 @@ let Command = CoreObject.extend({
|
|
|
223
217
|
this._currentTask = task;
|
|
224
218
|
|
|
225
219
|
return Promise.resolve().then(() => task.run(options))
|
|
226
|
-
.catch(error => {
|
|
227
|
-
logger.info(`An error occurred running \`${name}\` from the \`${this.name}\` command.`, error.stack);
|
|
228
|
-
|
|
229
|
-
throw error;
|
|
230
|
-
})
|
|
231
220
|
.finally(() => {
|
|
232
221
|
delete this._currentTask;
|
|
233
222
|
});
|
|
@@ -252,7 +241,6 @@ let Command = CoreObject.extend({
|
|
|
252
241
|
let commandOptions = this.parseArgs(args);
|
|
253
242
|
// if the help option was passed, resolve with 'callHelp' to call help command
|
|
254
243
|
if (commandOptions && (commandOptions.options.help || commandOptions.options.h)) {
|
|
255
|
-
logger.info(`${this.name} called with help option`);
|
|
256
244
|
return resolve('callHelp');
|
|
257
245
|
}
|
|
258
246
|
|
|
@@ -430,8 +418,6 @@ let Command = CoreObject.extend({
|
|
|
430
418
|
try {
|
|
431
419
|
aliasValue = JSON.parse(alias);
|
|
432
420
|
} catch (e) {
|
|
433
|
-
let logger = require('heimdalljs-logger')('@angular/cli/ember-cli/models/command');
|
|
434
|
-
logger.error(e);
|
|
435
421
|
}
|
|
436
422
|
}
|
|
437
423
|
throw new Error(`The "${aliasValue}" [type:${aliasType}] alias is not an acceptable value. ` +
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
let logger = require('heimdalljs-logger')('ember-cli:installation-checker');
|
|
4
3
|
const fs = require('fs-extra');
|
|
5
4
|
const path = require('path');
|
|
6
5
|
const SilentError = require('silent-error');
|
|
@@ -24,11 +23,9 @@ class InstallationChecker {
|
|
|
24
23
|
let commands = [];
|
|
25
24
|
|
|
26
25
|
if (this.usingNpm() && this.npmDependenciesNotPresent()) {
|
|
27
|
-
logger.info('npm dependencies not installed');
|
|
28
26
|
commands.push('`npm install`');
|
|
29
27
|
}
|
|
30
28
|
if (this.usingBower() && this.bowerDependenciesNotPresent()) {
|
|
31
|
-
logger.info('bower dependencies not installed');
|
|
32
29
|
commands.push('`bower install`');
|
|
33
30
|
}
|
|
34
31
|
if (commands.length) {
|
|
@@ -9,9 +9,7 @@ const findUp = require('../../../utilities/find-up').findUp;
|
|
|
9
9
|
let resolve = denodeify(require('resolve'));
|
|
10
10
|
const fs = require('fs-extra');
|
|
11
11
|
const _ = require('lodash');
|
|
12
|
-
let logger = require('heimdalljs-logger')('ember-cli:project');
|
|
13
12
|
const nodeModulesPath = require('node-modules-path');
|
|
14
|
-
const heimdall = require('heimdalljs');
|
|
15
13
|
|
|
16
14
|
let processCwd = process.cwd();
|
|
17
15
|
// ensure NULL_PROJECT is a singleton
|
|
@@ -30,8 +28,6 @@ class Project {
|
|
|
30
28
|
@param {CLI} cli
|
|
31
29
|
*/
|
|
32
30
|
constructor(root, pkg, ui, cli) {
|
|
33
|
-
logger.info('init root: %s', root);
|
|
34
|
-
|
|
35
31
|
this.root = root;
|
|
36
32
|
this.pkg = pkg;
|
|
37
33
|
this.ui = ui;
|
|
@@ -76,8 +72,6 @@ class Project {
|
|
|
76
72
|
*/
|
|
77
73
|
setupNodeModulesPath() {
|
|
78
74
|
this.nodeModulesPath = nodeModulesPath(this.root);
|
|
79
|
-
|
|
80
|
-
logger.info('nodeModulesPath: %s', this.nodeModulesPath);
|
|
81
75
|
}
|
|
82
76
|
|
|
83
77
|
static nullProject(ui, cli) {
|
|
@@ -89,16 +83,10 @@ class Project {
|
|
|
89
83
|
return false;
|
|
90
84
|
};
|
|
91
85
|
|
|
92
|
-
NULL_PROJECT.isEmberCLIAddon = function() {
|
|
93
|
-
return false;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
86
|
NULL_PROJECT.name = function() {
|
|
97
87
|
return path.basename(process.cwd());
|
|
98
88
|
};
|
|
99
89
|
|
|
100
|
-
NULL_PROJECT.initializeAddons();
|
|
101
|
-
|
|
102
90
|
return NULL_PROJECT;
|
|
103
91
|
}
|
|
104
92
|
|
|
@@ -126,15 +114,6 @@ class Project {
|
|
|
126
114
|
|| '@angular/cli' in this.dependencies();
|
|
127
115
|
}
|
|
128
116
|
|
|
129
|
-
/**
|
|
130
|
-
Returns whether or not this is an Ember CLI addon.
|
|
131
|
-
@method isEmberCLIAddon
|
|
132
|
-
@return {Boolean} Whether or not this is an Ember CLI Addon.
|
|
133
|
-
*/
|
|
134
|
-
isEmberCLIAddon() {
|
|
135
|
-
return !!this.pkg.keywords && this.pkg.keywords.indexOf('ember-addon') > -1;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
117
|
/**
|
|
139
118
|
Loads the configuration for this project and its addons.
|
|
140
119
|
@public
|
|
@@ -143,8 +122,6 @@ class Project {
|
|
|
143
122
|
@return {Object} Merged confiration object
|
|
144
123
|
*/
|
|
145
124
|
config(env) {
|
|
146
|
-
this.initializeAddons();
|
|
147
|
-
|
|
148
125
|
let initialConfig = {};
|
|
149
126
|
|
|
150
127
|
return this.addons.reduce((config, addon) => {
|
|
@@ -231,139 +208,6 @@ class Project {
|
|
|
231
208
|
return _.assign({}, devDependencies, pkg['dependencies']);
|
|
232
209
|
}
|
|
233
210
|
|
|
234
|
-
/**
|
|
235
|
-
Provides the list of paths to consult for addons that may be provided
|
|
236
|
-
internally to this project. Used for middleware addons with built-in support.
|
|
237
|
-
@private
|
|
238
|
-
@method supportedInternalAddonPaths
|
|
239
|
-
*/
|
|
240
|
-
supportedInternalAddonPaths() {
|
|
241
|
-
if (!this.root) { return []; }
|
|
242
|
-
|
|
243
|
-
let internalMiddlewarePath = path.join(__dirname, '../tasks/server/middleware');
|
|
244
|
-
let legacyBlueprintsPath = require.resolve('ember-cli-legacy-blueprints');
|
|
245
|
-
let emberTryPath = require.resolve('ember-try');
|
|
246
|
-
return [
|
|
247
|
-
path.join(internalMiddlewarePath, 'testem-url-rewriter'),
|
|
248
|
-
path.join(internalMiddlewarePath, 'tests-server'),
|
|
249
|
-
path.join(internalMiddlewarePath, 'history-support'),
|
|
250
|
-
path.join(internalMiddlewarePath, 'broccoli-watcher'),
|
|
251
|
-
path.join(internalMiddlewarePath, 'broccoli-serve-files'),
|
|
252
|
-
path.join(internalMiddlewarePath, 'proxy-server'),
|
|
253
|
-
path.dirname(legacyBlueprintsPath),
|
|
254
|
-
path.dirname(emberTryPath),
|
|
255
|
-
];
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
Loads and initializes all addons for this project.
|
|
260
|
-
@private
|
|
261
|
-
@method initializeAddons
|
|
262
|
-
*/
|
|
263
|
-
initializeAddons() {
|
|
264
|
-
if (this._addonsInitialized) {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
this._addonsInitialized = true;
|
|
268
|
-
|
|
269
|
-
logger.info('initializeAddons for: %s', this.name());
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
Returns what commands are made available by addons by inspecting
|
|
274
|
-
`includedCommands` for every addon.
|
|
275
|
-
@private
|
|
276
|
-
@method addonCommands
|
|
277
|
-
@return {Object} Addon names and command maps as key-value pairs
|
|
278
|
-
*/
|
|
279
|
-
addonCommands() {
|
|
280
|
-
const Command = require('../models/command');
|
|
281
|
-
let commands = {};
|
|
282
|
-
this.addons.forEach(addon => {
|
|
283
|
-
if (!addon.includedCommands) { return; }
|
|
284
|
-
|
|
285
|
-
let token = heimdall.start({
|
|
286
|
-
name: `lookup-commands: ${addon.name}`,
|
|
287
|
-
addonName: addon.name,
|
|
288
|
-
addonCommandInitialization: true,
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
let includedCommands = addon.includedCommands();
|
|
292
|
-
let addonCommands = {};
|
|
293
|
-
|
|
294
|
-
for (let key in includedCommands) {
|
|
295
|
-
if (typeof includedCommands[key] === 'function') {
|
|
296
|
-
addonCommands[key] = includedCommands[key];
|
|
297
|
-
} else {
|
|
298
|
-
addonCommands[key] = Command.extend(includedCommands[key]);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
if (Object.keys(addonCommands).length) {
|
|
302
|
-
commands[addon.name] = addonCommands;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
token.stop();
|
|
306
|
-
});
|
|
307
|
-
return commands;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
Execute a given callback for every addon command.
|
|
312
|
-
Example:
|
|
313
|
-
```
|
|
314
|
-
project.eachAddonCommand(function(addonName, commands) {
|
|
315
|
-
console.log('Addon ' + addonName + ' exported the following commands:' + commands.keys().join(', '));
|
|
316
|
-
});
|
|
317
|
-
```
|
|
318
|
-
@private
|
|
319
|
-
@method eachAddonCommand
|
|
320
|
-
@param {Function} callback [description]
|
|
321
|
-
*/
|
|
322
|
-
eachAddonCommand(callback) {
|
|
323
|
-
if (this.initializeAddons && this.addonCommands) {
|
|
324
|
-
this.initializeAddons();
|
|
325
|
-
let addonCommands = this.addonCommands();
|
|
326
|
-
|
|
327
|
-
_.forOwn(addonCommands, (commands, addonName) => callback(addonName, commands));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
Path to the blueprints for this project.
|
|
333
|
-
@private
|
|
334
|
-
@method localBlueprintLookupPath
|
|
335
|
-
@return {String} Path to blueprints
|
|
336
|
-
*/
|
|
337
|
-
localBlueprintLookupPath() {
|
|
338
|
-
return path.join(this.cli.root, 'blueprints');
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
Returns a list of paths (including addon paths) where blueprints will be looked up.
|
|
343
|
-
@private
|
|
344
|
-
@method blueprintLookupPaths
|
|
345
|
-
@return {Array} List of paths
|
|
346
|
-
*/
|
|
347
|
-
blueprintLookupPaths() {
|
|
348
|
-
return [this.localBlueprintLookupPath()];
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
Returns a list of addon paths where blueprints will be looked up.
|
|
353
|
-
@private
|
|
354
|
-
@method addonBlueprintLookupPaths
|
|
355
|
-
@return {Array} List of paths
|
|
356
|
-
*/
|
|
357
|
-
addonBlueprintLookupPaths() {
|
|
358
|
-
let addonPaths = this.addons.map(addon => {
|
|
359
|
-
if (addon.blueprintsPath) {
|
|
360
|
-
return addon.blueprintsPath();
|
|
361
|
-
}
|
|
362
|
-
}, this);
|
|
363
|
-
|
|
364
|
-
return addonPaths.filter(Boolean).reverse();
|
|
365
|
-
}
|
|
366
|
-
|
|
367
211
|
/**
|
|
368
212
|
Reloads package.json
|
|
369
213
|
@private
|
|
@@ -379,62 +223,6 @@ class Project {
|
|
|
379
223
|
return this.pkg;
|
|
380
224
|
}
|
|
381
225
|
|
|
382
|
-
/**
|
|
383
|
-
Re-initializes addons.
|
|
384
|
-
@private
|
|
385
|
-
@method reloadAddons
|
|
386
|
-
*/
|
|
387
|
-
reloadAddons() {
|
|
388
|
-
this.reloadPkg();
|
|
389
|
-
this._addonsInitialized = false;
|
|
390
|
-
return this.initializeAddons();
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
Find an addon by its name
|
|
395
|
-
@private
|
|
396
|
-
@method findAddonByName
|
|
397
|
-
@param {String} name Addon name as specified in package.json
|
|
398
|
-
@return {Addon} Addon instance
|
|
399
|
-
*/
|
|
400
|
-
findAddonByName(name) {
|
|
401
|
-
this.initializeAddons();
|
|
402
|
-
|
|
403
|
-
var exactMatch = _.find(this.addons, function(addon) {
|
|
404
|
-
return name === addon.name || (addon.pkg && name === addon.pkg.name);
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
if (exactMatch) {
|
|
408
|
-
return exactMatch;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
return _.find(this.addons, function(addon) {
|
|
412
|
-
return name.indexOf(addon.name) > -1 || (addon.pkg && name.indexOf(addon.pkg.name) > -1);
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
Generate test file contents.
|
|
418
|
-
This method is supposed to be overwritten by test framework addons
|
|
419
|
-
like `ember-cli-qunit` and `ember-cli-mocha`.
|
|
420
|
-
@public
|
|
421
|
-
@method generateTestFile
|
|
422
|
-
@param {String} moduleName Name of the test module (e.g. `JSHint`)
|
|
423
|
-
@param {Object[]} tests Array of tests with `name`, `passed` and `errorMessage` properties
|
|
424
|
-
@return {String} The test file content
|
|
425
|
-
*/
|
|
426
|
-
generateTestFile() {
|
|
427
|
-
let message = 'Please install an Ember.js test framework addon or update your dependencies.';
|
|
428
|
-
|
|
429
|
-
if (this.ui) {
|
|
430
|
-
this.ui.writeDeprecateLine(message);
|
|
431
|
-
} else {
|
|
432
|
-
console.warn(message);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
return '';
|
|
436
|
-
}
|
|
437
|
-
|
|
438
226
|
/**
|
|
439
227
|
Returns a new project based on the first package.json that is found
|
|
440
228
|
in `pathName`.
|
|
@@ -451,7 +239,6 @@ class Project {
|
|
|
451
239
|
ui.writeDeprecateLine('`Project.closest` is a private method that will be removed, please use `Project.closestSync` instead.');
|
|
452
240
|
|
|
453
241
|
return closestPackageJSON(pathName).then(result => {
|
|
454
|
-
logger.info('closest %s -> %s', pathName, result);
|
|
455
242
|
if (result.pkg && result.pkg.name === 'ember-cli') {
|
|
456
243
|
return Project.nullProject(_ui, _cli);
|
|
457
244
|
}
|
|
@@ -471,24 +258,18 @@ class Project {
|
|
|
471
258
|
@return {Project} Project instance
|
|
472
259
|
*/
|
|
473
260
|
static closestSync(pathName, _ui, _cli) {
|
|
474
|
-
logger.info('looking for package.json starting at %s', pathName);
|
|
475
|
-
|
|
476
261
|
let ui = ensureUI(_ui);
|
|
477
262
|
|
|
478
263
|
let directory = findupPath(pathName);
|
|
479
|
-
logger.info('found package.json at %s', directory);
|
|
480
264
|
|
|
481
265
|
let relative = path.relative(directory, pathName);
|
|
482
266
|
if (relative.indexOf('tmp') === 0) {
|
|
483
|
-
logger.info('ignoring parent project since we are in the tmp folder of the project');
|
|
484
267
|
return Project.nullProject(_ui, _cli);
|
|
485
268
|
}
|
|
486
269
|
|
|
487
270
|
let pkg = fs.readJsonSync(path.join(directory, 'package.json'));
|
|
488
|
-
logger.info('project name: %s', pkg && pkg.name);
|
|
489
271
|
|
|
490
272
|
if (!isEmberCliProject(pkg)) {
|
|
491
|
-
logger.info('ignoring parent project since it is not an Angular CLI project');
|
|
492
273
|
return Project.nullProject(_ui, _cli);
|
|
493
274
|
}
|
|
494
275
|
|
|
@@ -526,7 +307,6 @@ class Project {
|
|
|
526
307
|
static getProjectRoot() {
|
|
527
308
|
let packagePath = findUp(process.cwd(), 'package.json');
|
|
528
309
|
if (!packagePath) {
|
|
529
|
-
logger.info('getProjectRoot: not found. Will use cwd: %s', process.cwd());
|
|
530
310
|
return process.cwd();
|
|
531
311
|
}
|
|
532
312
|
|
|
@@ -534,11 +314,9 @@ class Project {
|
|
|
534
314
|
const pkg = require(packagePath);
|
|
535
315
|
|
|
536
316
|
if (pkg && pkg.name === 'ember-cli') {
|
|
537
|
-
logger.info('getProjectRoot: named \'ember-cli\'. Will use cwd: %s', process.cwd());
|
|
538
317
|
return process.cwd();
|
|
539
318
|
}
|
|
540
319
|
|
|
541
|
-
logger.info('getProjectRoot %s -> %s', process.cwd(), directory);
|
|
542
320
|
return directory;
|
|
543
321
|
}
|
|
544
322
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (options: any): any;
|