@angular-devkit/architect-cli 0.2101.0-next.2 → 0.2101.0-next.3
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.d.ts → cli.js} +2 -1
- package/package.json +5 -8
- package/bin/architect.js +0 -222
- package/bin/architect.js.map +0 -1
- package/src/progress.d.ts +0 -23
- package/src/progress.js +0 -129
- package/src/progress.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/architect-cli",
|
|
3
|
-
"version": "0.2101.0-next.
|
|
3
|
+
"version": "0.2101.0-next.3",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Angular Architect CLI",
|
|
5
6
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
7
|
"experimental": true,
|
|
7
8
|
"bin": {
|
|
8
|
-
"architect": "./bin/
|
|
9
|
+
"architect": "./bin/cli.js"
|
|
9
10
|
},
|
|
10
11
|
"keywords": [
|
|
11
12
|
"Angular CLI",
|
|
@@ -19,17 +20,13 @@
|
|
|
19
20
|
"tooling"
|
|
20
21
|
],
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"@angular-devkit/architect": "0.2101.0-next.
|
|
23
|
-
"@angular-devkit/core": "21.1.0-next.2",
|
|
24
|
-
"ansi-colors": "4.1.3",
|
|
25
|
-
"progress": "2.0.3",
|
|
26
|
-
"yargs-parser": "22.0.0"
|
|
23
|
+
"@angular-devkit/architect": "0.2101.0-next.3"
|
|
27
24
|
},
|
|
28
25
|
"repository": {
|
|
29
26
|
"type": "git",
|
|
30
27
|
"url": "https://github.com/angular/angular-cli.git"
|
|
31
28
|
},
|
|
32
|
-
"packageManager": "pnpm@10.
|
|
29
|
+
"packageManager": "pnpm@10.26.0",
|
|
33
30
|
"engines": {
|
|
34
31
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
35
32
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
package/bin/architect.js
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright Google LLC All Rights Reserved.
|
|
6
|
-
*
|
|
7
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
8
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
9
|
-
*/
|
|
10
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
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);
|
|
17
|
-
}) : (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
o[k2] = m[k];
|
|
20
|
-
}));
|
|
21
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
-
}) : function(o, v) {
|
|
24
|
-
o["default"] = v;
|
|
25
|
-
});
|
|
26
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
-
var ownKeys = function(o) {
|
|
28
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
-
var ar = [];
|
|
30
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
-
return ar;
|
|
32
|
-
};
|
|
33
|
-
return ownKeys(o);
|
|
34
|
-
};
|
|
35
|
-
return function (mod) {
|
|
36
|
-
if (mod && mod.__esModule) return mod;
|
|
37
|
-
var result = {};
|
|
38
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
-
__setModuleDefault(result, mod);
|
|
40
|
-
return result;
|
|
41
|
-
};
|
|
42
|
-
})();
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
const architect_1 = require("@angular-devkit/architect");
|
|
45
|
-
const node_1 = require("@angular-devkit/architect/node");
|
|
46
|
-
const core_1 = require("@angular-devkit/core");
|
|
47
|
-
const node_2 = require("@angular-devkit/core/node");
|
|
48
|
-
const ansiColors = __importStar(require("ansi-colors"));
|
|
49
|
-
const node_fs_1 = require("node:fs");
|
|
50
|
-
const path = __importStar(require("node:path"));
|
|
51
|
-
const yargs_parser_1 = __importStar(require("yargs-parser"));
|
|
52
|
-
const progress_1 = require("../src/progress");
|
|
53
|
-
function findUp(names, from) {
|
|
54
|
-
if (!Array.isArray(names)) {
|
|
55
|
-
names = [names];
|
|
56
|
-
}
|
|
57
|
-
const root = path.parse(from).root;
|
|
58
|
-
let currentDir = from;
|
|
59
|
-
while (currentDir && currentDir !== root) {
|
|
60
|
-
for (const name of names) {
|
|
61
|
-
const p = path.join(currentDir, name);
|
|
62
|
-
if ((0, node_fs_1.existsSync)(p)) {
|
|
63
|
-
return p;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
currentDir = path.dirname(currentDir);
|
|
67
|
-
}
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Show usage of the CLI tool, and exit the process.
|
|
72
|
-
*/
|
|
73
|
-
function usage(logger, exitCode = 0) {
|
|
74
|
-
logger.info(core_1.tags.stripIndent `
|
|
75
|
-
architect [project][:target][:configuration] [options, ...]
|
|
76
|
-
|
|
77
|
-
Run a project target.
|
|
78
|
-
If project/target/configuration are not specified, the workspace defaults will be used.
|
|
79
|
-
|
|
80
|
-
Options:
|
|
81
|
-
--help Show available options for project target.
|
|
82
|
-
Shows this message instead when ran without the run argument.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Any additional option is passed the target, overriding existing options.
|
|
86
|
-
`);
|
|
87
|
-
return process.exit(exitCode);
|
|
88
|
-
}
|
|
89
|
-
function _targetStringFromTarget({ project, target, configuration }) {
|
|
90
|
-
return `${project}:${target}${configuration !== undefined ? ':' + configuration : ''}`;
|
|
91
|
-
}
|
|
92
|
-
// Create a separate instance to prevent unintended global changes to the color configuration
|
|
93
|
-
const colors = ansiColors.create();
|
|
94
|
-
async function _executeTarget(parentLogger, workspace, root, argv, registry) {
|
|
95
|
-
const architectHost = new node_1.WorkspaceNodeModulesArchitectHost(workspace, root);
|
|
96
|
-
const architect = new architect_1.Architect(architectHost, registry);
|
|
97
|
-
// Split a target into its parts.
|
|
98
|
-
const { _: [targetStr = ''], help, ...options } = argv;
|
|
99
|
-
const [project, target, configuration] = targetStr.toString().split(':');
|
|
100
|
-
const targetSpec = { project, target, configuration };
|
|
101
|
-
const logger = new core_1.logging.Logger('jobs');
|
|
102
|
-
const logs = [];
|
|
103
|
-
logger.subscribe((entry) => logs.push({ ...entry, message: `${entry.name}: ` + entry.message }));
|
|
104
|
-
// Camelize options as yargs will return the object in kebab-case when camel casing is disabled.
|
|
105
|
-
const camelCasedOptions = {};
|
|
106
|
-
for (const [key, value] of Object.entries(options)) {
|
|
107
|
-
if (/[A-Z]/.test(key)) {
|
|
108
|
-
throw new Error(`Unknown argument ${key}. Did you mean ${(0, yargs_parser_1.decamelize)(key)}?`);
|
|
109
|
-
}
|
|
110
|
-
camelCasedOptions[(0, yargs_parser_1.camelCase)(key)] = value;
|
|
111
|
-
}
|
|
112
|
-
const run = await architect.scheduleTarget(targetSpec, camelCasedOptions, { logger });
|
|
113
|
-
const bars = new progress_1.MultiProgressBar(':name :bar (:current/:total) :status');
|
|
114
|
-
run.progress.subscribe((update) => {
|
|
115
|
-
const data = bars.get(update.id) || {
|
|
116
|
-
id: update.id,
|
|
117
|
-
builder: update.builder,
|
|
118
|
-
target: update.target,
|
|
119
|
-
status: update.status || '',
|
|
120
|
-
name: ((update.target ? _targetStringFromTarget(update.target) : update.builder.name) +
|
|
121
|
-
' '.repeat(80)).substring(0, 40),
|
|
122
|
-
};
|
|
123
|
-
if (update.status !== undefined) {
|
|
124
|
-
data.status = update.status;
|
|
125
|
-
}
|
|
126
|
-
switch (update.state) {
|
|
127
|
-
case architect_1.BuilderProgressState.Error:
|
|
128
|
-
data.status = 'Error: ' + update.error;
|
|
129
|
-
bars.update(update.id, data);
|
|
130
|
-
break;
|
|
131
|
-
case architect_1.BuilderProgressState.Stopped:
|
|
132
|
-
data.status = 'Done.';
|
|
133
|
-
bars.complete(update.id);
|
|
134
|
-
bars.update(update.id, data, update.total, update.total);
|
|
135
|
-
break;
|
|
136
|
-
case architect_1.BuilderProgressState.Waiting:
|
|
137
|
-
bars.update(update.id, data);
|
|
138
|
-
break;
|
|
139
|
-
case architect_1.BuilderProgressState.Running:
|
|
140
|
-
bars.update(update.id, data, update.current, update.total);
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
bars.render();
|
|
144
|
-
});
|
|
145
|
-
// Wait for full completion of the builder.
|
|
146
|
-
try {
|
|
147
|
-
const result = await run.lastOutput;
|
|
148
|
-
if (result.success) {
|
|
149
|
-
parentLogger.info(colors.green('SUCCESS'));
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
parentLogger.info(colors.red('FAILURE'));
|
|
153
|
-
}
|
|
154
|
-
parentLogger.info('Result: ' + JSON.stringify({ ...result, info: undefined }, null, 4));
|
|
155
|
-
parentLogger.info('\nLogs:');
|
|
156
|
-
logs.forEach((l) => parentLogger.next(l));
|
|
157
|
-
logs.splice(0);
|
|
158
|
-
await run.stop();
|
|
159
|
-
bars.terminate();
|
|
160
|
-
return result.success ? 0 : 1;
|
|
161
|
-
}
|
|
162
|
-
catch (err) {
|
|
163
|
-
parentLogger.info(colors.red('ERROR'));
|
|
164
|
-
parentLogger.info('\nLogs:');
|
|
165
|
-
logs.forEach((l) => parentLogger.next(l));
|
|
166
|
-
parentLogger.fatal('Exception:');
|
|
167
|
-
parentLogger.fatal((err instanceof Error && err.stack) || `${err}`);
|
|
168
|
-
return 2;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
async function main(args) {
|
|
172
|
-
/** Parse the command line. */
|
|
173
|
-
const argv = (0, yargs_parser_1.default)(args, {
|
|
174
|
-
boolean: ['help'],
|
|
175
|
-
configuration: {
|
|
176
|
-
'dot-notation': false,
|
|
177
|
-
'boolean-negation': true,
|
|
178
|
-
'strip-aliased': true,
|
|
179
|
-
'camel-case-expansion': false,
|
|
180
|
-
},
|
|
181
|
-
});
|
|
182
|
-
/** Create the DevKit Logger used through the CLI. */
|
|
183
|
-
const logger = (0, node_2.createConsoleLogger)(argv['verbose'], process.stdout, process.stderr, {
|
|
184
|
-
info: (s) => s,
|
|
185
|
-
debug: (s) => s,
|
|
186
|
-
warn: (s) => colors.bold.yellow(s),
|
|
187
|
-
error: (s) => colors.bold.red(s),
|
|
188
|
-
fatal: (s) => colors.bold.red(s),
|
|
189
|
-
});
|
|
190
|
-
// Check the target.
|
|
191
|
-
const targetStr = argv._[0] || '';
|
|
192
|
-
if (!targetStr || argv.help) {
|
|
193
|
-
// Show architect usage if there's no target.
|
|
194
|
-
usage(logger);
|
|
195
|
-
}
|
|
196
|
-
// Load workspace configuration file.
|
|
197
|
-
const currentPath = process.cwd();
|
|
198
|
-
const configFileNames = ['angular.json', '.angular.json', 'workspace.json', '.workspace.json'];
|
|
199
|
-
const configFilePath = findUp(configFileNames, currentPath);
|
|
200
|
-
if (!configFilePath) {
|
|
201
|
-
logger.fatal(`Workspace configuration file (${configFileNames.join(', ')}) cannot be found in ` +
|
|
202
|
-
`'${currentPath}' or in parent directories.`);
|
|
203
|
-
return 3;
|
|
204
|
-
}
|
|
205
|
-
const root = path.dirname(configFilePath);
|
|
206
|
-
const registry = new core_1.schema.CoreSchemaRegistry();
|
|
207
|
-
registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults);
|
|
208
|
-
// Show usage of deprecated options
|
|
209
|
-
registry.useXDeprecatedProvider((msg) => logger.warn(msg));
|
|
210
|
-
const { workspace } = await core_1.workspaces.readWorkspace(configFilePath, core_1.workspaces.createWorkspaceHost(new node_2.NodeJsSyncHost()));
|
|
211
|
-
// Clear the console.
|
|
212
|
-
process.stdout.write('\u001Bc');
|
|
213
|
-
return await _executeTarget(logger, workspace, root, argv, registry);
|
|
214
|
-
}
|
|
215
|
-
main(process.argv.slice(2)).then((code) => {
|
|
216
|
-
process.exit(code);
|
|
217
|
-
}, (err) => {
|
|
218
|
-
// eslint-disable-next-line no-console
|
|
219
|
-
console.error('Error: ' + err.stack || err.message || err);
|
|
220
|
-
process.exit(-1);
|
|
221
|
-
});
|
|
222
|
-
//# sourceMappingURL=architect.js.map
|
package/bin/architect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"architect.js","sourceRoot":"","sources":["architect.ts"],"names":[],"mappings":";;AACA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAAiG;AACjG,yDAAmF;AACnF,+CAA0F;AAC1F,oDAAgF;AAChF,wDAA0C;AAC1C,qCAAqC;AACrC,gDAAkC;AAClC,6DAAkE;AAClE,8CAAmD;AAEnD,SAAS,MAAM,CAAC,KAAwB,EAAE,IAAY;IACpD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;IAEnC,IAAI,UAAU,GAAG,IAAI,CAAC;IACtB,OAAO,UAAU,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAA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AAC,EACD,CAAC,GAAG,EAAE,EAAE;IACN,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;IAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CACF,CAAC"}
|
package/src/progress.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
-
*/
|
|
8
|
-
export declare class MultiProgressBar<Key, T> {
|
|
9
|
-
private _status;
|
|
10
|
-
private _stream;
|
|
11
|
-
private _bars;
|
|
12
|
-
constructor(_status: string, _stream?: NodeJS.WriteStream & {
|
|
13
|
-
fd: 2;
|
|
14
|
-
});
|
|
15
|
-
private _add;
|
|
16
|
-
complete(id: Key): void;
|
|
17
|
-
add(id: Key, data: T): void;
|
|
18
|
-
get(key: Key): T | undefined;
|
|
19
|
-
has(key: Key): boolean;
|
|
20
|
-
update(key: Key, data: T, current?: number, total?: number): void;
|
|
21
|
-
render(max?: number, sort?: (a: T, b: T) => number): void;
|
|
22
|
-
terminate(): void;
|
|
23
|
-
}
|
package/src/progress.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
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);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
43
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
|
-
};
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.MultiProgressBar = void 0;
|
|
47
|
-
const readline = __importStar(require("node:readline"));
|
|
48
|
-
const progress_1 = __importDefault(require("progress"));
|
|
49
|
-
class MultiProgressBar {
|
|
50
|
-
_status;
|
|
51
|
-
_stream;
|
|
52
|
-
_bars = new Map();
|
|
53
|
-
constructor(_status, _stream = process.stderr) {
|
|
54
|
-
this._status = _status;
|
|
55
|
-
this._stream = _stream;
|
|
56
|
-
}
|
|
57
|
-
_add(id, data) {
|
|
58
|
-
const width = Math.min(80, this._stream.columns || 80);
|
|
59
|
-
const value = {
|
|
60
|
-
data,
|
|
61
|
-
bar: new progress_1.default(this._status, {
|
|
62
|
-
renderThrottle: 0,
|
|
63
|
-
clear: true,
|
|
64
|
-
total: 1,
|
|
65
|
-
width: width,
|
|
66
|
-
complete: '#',
|
|
67
|
-
incomplete: '.',
|
|
68
|
-
stream: this._stream,
|
|
69
|
-
}),
|
|
70
|
-
};
|
|
71
|
-
this._bars.set(id, value);
|
|
72
|
-
readline.moveCursor(this._stream, 0, 1);
|
|
73
|
-
return value;
|
|
74
|
-
}
|
|
75
|
-
complete(id) {
|
|
76
|
-
const maybeBar = this._bars.get(id);
|
|
77
|
-
if (maybeBar) {
|
|
78
|
-
maybeBar.bar.complete = true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
add(id, data) {
|
|
82
|
-
this._add(id, data);
|
|
83
|
-
}
|
|
84
|
-
get(key) {
|
|
85
|
-
const maybeValue = this._bars.get(key);
|
|
86
|
-
return maybeValue && maybeValue.data;
|
|
87
|
-
}
|
|
88
|
-
has(key) {
|
|
89
|
-
return this._bars.has(key);
|
|
90
|
-
}
|
|
91
|
-
update(key, data, current, total) {
|
|
92
|
-
let maybeBar = this._bars.get(key);
|
|
93
|
-
if (!maybeBar) {
|
|
94
|
-
maybeBar = this._add(key, data);
|
|
95
|
-
}
|
|
96
|
-
maybeBar.data = data;
|
|
97
|
-
if (total !== undefined) {
|
|
98
|
-
maybeBar.bar.total = total;
|
|
99
|
-
}
|
|
100
|
-
if (current !== undefined) {
|
|
101
|
-
maybeBar.bar.curr = Math.max(0, Math.min(current, maybeBar.bar.total));
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
render(max = Infinity, sort) {
|
|
105
|
-
const stream = this._stream;
|
|
106
|
-
readline.moveCursor(stream, 0, -this._bars.size);
|
|
107
|
-
readline.cursorTo(stream, 0);
|
|
108
|
-
let values = this._bars.values();
|
|
109
|
-
if (sort) {
|
|
110
|
-
values = [...values].sort((a, b) => sort(a.data, b.data));
|
|
111
|
-
}
|
|
112
|
-
for (const { data, bar } of values) {
|
|
113
|
-
if (max-- == 0) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
bar.render(data);
|
|
117
|
-
readline.moveCursor(stream, 0, 1);
|
|
118
|
-
readline.cursorTo(stream, 0);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
terminate() {
|
|
122
|
-
for (const { bar } of this._bars.values()) {
|
|
123
|
-
bar.terminate();
|
|
124
|
-
}
|
|
125
|
-
this._bars.clear();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.MultiProgressBar = MultiProgressBar;
|
|
129
|
-
//# sourceMappingURL=progress.js.map
|
package/src/progress.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["progress.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wDAA0C;AAC1C,wDAAmC;AAEnC,MAAa,gBAAgB;IAIjB;IACA;IAJF,KAAK,GAAG,IAAI,GAAG,EAAsC,CAAC;IAE9D,YACU,OAAe,EACf,UAAU,OAAO,CAAC,MAAM;QADxB,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAiB;IAC/B,CAAC;IACI,IAAI,CAAC,EAAO,EAAE,IAAO;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG;YACZ,IAAI;YACJ,G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