@angular-devkit/architect-cli 0.1400.0-next.3 → 0.1400.0-next.6
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 +27 -12
- package/package.json +6 -6
- package/src/progress.d.ts +3 -1
- package/src/progress.js +5 -1
package/bin/architect.js
CHANGED
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
11
|
if (k2 === undefined) k2 = k;
|
|
12
|
-
Object.
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
13
17
|
}) : (function(o, m, k, k2) {
|
|
14
18
|
if (k2 === undefined) k2 = k;
|
|
15
19
|
o[k2] = m[k];
|
|
@@ -26,9 +30,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
30
|
__setModuleDefault(result, mod);
|
|
27
31
|
return result;
|
|
28
32
|
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
34
|
const architect_1 = require("@angular-devkit/architect");
|
|
34
35
|
const node_1 = require("@angular-devkit/architect/node");
|
|
@@ -36,9 +37,9 @@ const core_1 = require("@angular-devkit/core");
|
|
|
36
37
|
const node_2 = require("@angular-devkit/core/node");
|
|
37
38
|
const ansiColors = __importStar(require("ansi-colors"));
|
|
38
39
|
const fs_1 = require("fs");
|
|
39
|
-
const minimist_1 = __importDefault(require("minimist"));
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
41
|
const operators_1 = require("rxjs/operators");
|
|
42
|
+
const yargs_parser_1 = __importStar(require("yargs-parser"));
|
|
42
43
|
const progress_1 = require("../src/progress");
|
|
43
44
|
function findUp(names, from) {
|
|
44
45
|
if (!Array.isArray(names)) {
|
|
@@ -86,15 +87,21 @@ async function _executeTarget(parentLogger, workspace, root, argv, registry) {
|
|
|
86
87
|
const architectHost = new node_1.WorkspaceNodeModulesArchitectHost(workspace, root);
|
|
87
88
|
const architect = new architect_1.Architect(architectHost, registry);
|
|
88
89
|
// Split a target into its parts.
|
|
89
|
-
const targetStr =
|
|
90
|
-
const [project, target, configuration] = targetStr.split(':');
|
|
90
|
+
const { _: [targetStr = ''], help, ...options } = argv;
|
|
91
|
+
const [project, target, configuration] = targetStr.toString().split(':');
|
|
91
92
|
const targetSpec = { project, target, configuration };
|
|
92
|
-
delete argv['help'];
|
|
93
93
|
const logger = new core_1.logging.Logger('jobs');
|
|
94
94
|
const logs = [];
|
|
95
95
|
logger.subscribe((entry) => logs.push({ ...entry, message: `${entry.name}: ` + entry.message }));
|
|
96
|
-
|
|
97
|
-
const
|
|
96
|
+
// Camelize options as yargs will return the object in kebab-case when camel casing is disabled.
|
|
97
|
+
const camelCasedOptions = {};
|
|
98
|
+
for (const [key, value] of Object.entries(options)) {
|
|
99
|
+
if (/[A-Z]/.test(key)) {
|
|
100
|
+
throw new Error(`Unknown argument ${key}. Did you mean ${(0, yargs_parser_1.decamelize)(key)}?`);
|
|
101
|
+
}
|
|
102
|
+
camelCasedOptions[(0, yargs_parser_1.camelCase)(key)] = value;
|
|
103
|
+
}
|
|
104
|
+
const run = await architect.scheduleTarget(targetSpec, camelCasedOptions, { logger });
|
|
98
105
|
const bars = new progress_1.MultiProgressBar(':name :bar (:current/:total) :status');
|
|
99
106
|
run.progress.subscribe((update) => {
|
|
100
107
|
const data = bars.get(update.id) || {
|
|
@@ -103,7 +110,7 @@ async function _executeTarget(parentLogger, workspace, root, argv, registry) {
|
|
|
103
110
|
target: update.target,
|
|
104
111
|
status: update.status || '',
|
|
105
112
|
name: ((update.target ? _targetStringFromTarget(update.target) : update.builder.name) +
|
|
106
|
-
' '.repeat(80)).
|
|
113
|
+
' '.repeat(80)).substring(0, 40),
|
|
107
114
|
};
|
|
108
115
|
if (update.status !== undefined) {
|
|
109
116
|
data.status = update.status;
|
|
@@ -158,7 +165,15 @@ async function _executeTarget(parentLogger, workspace, root, argv, registry) {
|
|
|
158
165
|
}
|
|
159
166
|
async function main(args) {
|
|
160
167
|
/** Parse the command line. */
|
|
161
|
-
const argv = (0,
|
|
168
|
+
const argv = (0, yargs_parser_1.default)(args, {
|
|
169
|
+
boolean: ['help'],
|
|
170
|
+
configuration: {
|
|
171
|
+
'dot-notation': false,
|
|
172
|
+
'boolean-negation': true,
|
|
173
|
+
'strip-aliased': true,
|
|
174
|
+
'camel-case-expansion': false,
|
|
175
|
+
},
|
|
176
|
+
});
|
|
162
177
|
/** Create the DevKit Logger used through the CLI. */
|
|
163
178
|
const logger = (0, node_2.createConsoleLogger)(argv['verbose'], process.stdout, process.stderr, {
|
|
164
179
|
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.6",
|
|
4
4
|
"description": "Angular Architect CLI",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"experimental": true,
|
|
@@ -19,20 +19,20 @@
|
|
|
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.6",
|
|
23
|
+
"@angular-devkit/core": "14.0.0-next.6",
|
|
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",
|
|
32
32
|
"url": "https://github.com/angular/angular-cli.git"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
|
-
"node": "^
|
|
35
|
+
"node": "^14.15.0 || >=16.10.0",
|
|
36
36
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
37
37
|
"yarn": ">= 1.13.0"
|
|
38
38
|
},
|
package/src/progress.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ export declare class MultiProgressBar<Key, T> {
|
|
|
10
10
|
private _status;
|
|
11
11
|
private _stream;
|
|
12
12
|
private _bars;
|
|
13
|
-
constructor(_status: string, _stream?: NodeJS.WriteStream
|
|
13
|
+
constructor(_status: string, _stream?: NodeJS.WriteStream & {
|
|
14
|
+
fd: 2;
|
|
15
|
+
});
|
|
14
16
|
private _add;
|
|
15
17
|
complete(id: Key): void;
|
|
16
18
|
add(id: Key, data: T): void;
|
package/src/progress.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|