@angular-devkit/architect-cli 0.1400.0-next.1 → 0.1400.0-next.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/bin/architect.js +23 -7
- package/package.json +5 -5
package/bin/architect.js
CHANGED
|
@@ -36,9 +36,9 @@ const core_1 = require("@angular-devkit/core");
|
|
|
36
36
|
const node_2 = require("@angular-devkit/core/node");
|
|
37
37
|
const ansiColors = __importStar(require("ansi-colors"));
|
|
38
38
|
const fs_1 = require("fs");
|
|
39
|
-
const minimist_1 = __importDefault(require("minimist"));
|
|
40
39
|
const path = __importStar(require("path"));
|
|
41
40
|
const operators_1 = require("rxjs/operators");
|
|
41
|
+
const yargs_parser_1 = __importDefault(require("yargs-parser"));
|
|
42
42
|
const progress_1 = require("../src/progress");
|
|
43
43
|
function findUp(names, from) {
|
|
44
44
|
if (!Array.isArray(names)) {
|
|
@@ -86,15 +86,23 @@ async function _executeTarget(parentLogger, workspace, root, argv, registry) {
|
|
|
86
86
|
const architectHost = new node_1.WorkspaceNodeModulesArchitectHost(workspace, root);
|
|
87
87
|
const architect = new architect_1.Architect(architectHost, registry);
|
|
88
88
|
// Split a target into its parts.
|
|
89
|
-
const targetStr =
|
|
89
|
+
const { _: [targetStr = ''], help, ...options } = argv;
|
|
90
90
|
const [project, target, configuration] = targetStr.split(':');
|
|
91
91
|
const targetSpec = { project, target, configuration };
|
|
92
|
-
delete argv['help'];
|
|
93
92
|
const logger = new core_1.logging.Logger('jobs');
|
|
94
93
|
const logs = [];
|
|
95
94
|
logger.subscribe((entry) => logs.push({ ...entry, message: `${entry.name}: ` + entry.message }));
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
// Camelize options as yargs will return the object in kebab-case when camel casing is disabled.
|
|
96
|
+
// Casting temporary until https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59065 is merged and released.
|
|
97
|
+
const { camelCase, decamelize } = yargs_parser_1.default;
|
|
98
|
+
const camelCasedOptions = {};
|
|
99
|
+
for (const [key, value] of Object.entries(options)) {
|
|
100
|
+
if (/[A-Z]/.test(key)) {
|
|
101
|
+
throw new Error(`Unknown argument ${key}. Did you mean ${decamelize(key)}?`);
|
|
102
|
+
}
|
|
103
|
+
camelCasedOptions[camelCase(key)] = value;
|
|
104
|
+
}
|
|
105
|
+
const run = await architect.scheduleTarget(targetSpec, camelCasedOptions, { logger });
|
|
98
106
|
const bars = new progress_1.MultiProgressBar(':name :bar (:current/:total) :status');
|
|
99
107
|
run.progress.subscribe((update) => {
|
|
100
108
|
const data = bars.get(update.id) || {
|
|
@@ -103,7 +111,7 @@ async function _executeTarget(parentLogger, workspace, root, argv, registry) {
|
|
|
103
111
|
target: update.target,
|
|
104
112
|
status: update.status || '',
|
|
105
113
|
name: ((update.target ? _targetStringFromTarget(update.target) : update.builder.name) +
|
|
106
|
-
' '.repeat(80)).
|
|
114
|
+
' '.repeat(80)).substring(0, 40),
|
|
107
115
|
};
|
|
108
116
|
if (update.status !== undefined) {
|
|
109
117
|
data.status = update.status;
|
|
@@ -158,7 +166,15 @@ async function _executeTarget(parentLogger, workspace, root, argv, registry) {
|
|
|
158
166
|
}
|
|
159
167
|
async function main(args) {
|
|
160
168
|
/** Parse the command line. */
|
|
161
|
-
const argv = (0,
|
|
169
|
+
const argv = (0, yargs_parser_1.default)(args, {
|
|
170
|
+
boolean: ['help'],
|
|
171
|
+
configuration: {
|
|
172
|
+
'dot-notation': false,
|
|
173
|
+
'boolean-negation': true,
|
|
174
|
+
'strip-aliased': true,
|
|
175
|
+
'camel-case-expansion': false,
|
|
176
|
+
},
|
|
177
|
+
});
|
|
162
178
|
/** Create the DevKit Logger used through the CLI. */
|
|
163
179
|
const logger = (0, node_2.createConsoleLogger)(argv['verbose'], process.stdout, process.stderr, {
|
|
164
180
|
info: (s) => s,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/architect-cli",
|
|
3
|
-
"version": "0.1400.0-next.
|
|
3
|
+
"version": "0.1400.0-next.4",
|
|
4
4
|
"description": "Angular Architect CLI",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"experimental": true,
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"tooling"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@angular-devkit/architect": "0.1400.0-next.
|
|
23
|
-
"@angular-devkit/core": "14.0.0-next.
|
|
22
|
+
"@angular-devkit/architect": "0.1400.0-next.4",
|
|
23
|
+
"@angular-devkit/core": "14.0.0-next.4",
|
|
24
24
|
"ansi-colors": "4.1.1",
|
|
25
|
-
"minimist": "1.2.5",
|
|
26
25
|
"progress": "2.0.3",
|
|
27
26
|
"rxjs": "6.6.7",
|
|
28
|
-
"symbol-observable": "4.0.0"
|
|
27
|
+
"symbol-observable": "4.0.0",
|
|
28
|
+
"yargs-parser": "21.0.1"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|