Skip to content

refactor(@angular-devkit/architect-cli): minor package cleanup #15289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/angular_devkit/architect_cli/bin/architect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import { Architect, BuilderInfo, BuilderProgressState, Target } from '@angular-devkit/architect';
import { WorkspaceNodeModulesArchitectHost } from '@angular-devkit/architect/node';
import { json, logging, schema, tags, terminal, workspaces } from '@angular-devkit/core';
import { logging, schema, tags, terminal, workspaces } from '@angular-devkit/core';
import { NodeJsSyncHost, createConsoleLogger } from '@angular-devkit/core/node';
import { existsSync } from 'fs';
import * as minimist from 'minimist';
Expand Down Expand Up @@ -55,8 +55,7 @@ function usage(logger: logging.Logger, exitCode = 0): never {
Any additional option is passed the target, overriding existing options.
`);

process.exit(exitCode);
throw 0; // The node typing sometimes don't have a never type for process.exit().
return process.exit(exitCode);
}

function _targetStringFromTarget({ project, target, configuration }: Target) {
Expand All @@ -74,7 +73,7 @@ async function _executeTarget(
workspace: workspaces.WorkspaceDefinition,
root: string,
argv: minimist.ParsedArgs,
registry: json.schema.SchemaRegistry,
registry: schema.SchemaRegistry,
) {
const architectHost = new WorkspaceNodeModulesArchitectHost(workspace, root);
const architect = new Architect(architectHost, registry);
Expand Down
6 changes: 4 additions & 2 deletions packages/angular_devkit/architect_cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
"dependencies": {
"@angular-devkit/architect": "0.0.0",
"@angular-devkit/core": "0.0.0",
"@types/progress": "^2.0.3",
"minimist": "1.2.0",
"progress": "^2.0.3",
"progress": "2.0.3",
"rxjs": "6.4.0",
"symbol-observable": "1.2.0"
},
"devDependencies": {
"@types/progress": "2.0.3"
}
}
3 changes: 1 addition & 2 deletions packages/angular_devkit/architect_cli/src/progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { terminal } from '@angular-devkit/core';
import * as ProgressBar from 'progress';
import * as readline from 'readline';

Expand All @@ -14,7 +13,7 @@ export class MultiProgressBar<Key, T> {

constructor(private _status: string, private _stream = process.stderr) {}
private _add(id: Key, data: T): { data: T, bar: ProgressBar } {
const width = Math.min(80, terminal.getCapabilities(this._stream).columns || 80);
const width = Math.min(80, this._stream.columns || 80);
const value = {
data,
bar: new ProgressBar(this._status, {
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.14.0.tgz#85c6998293fc6f2945915419296c7fbb63384f66"
integrity sha512-6tQyh4Q4B5pECcXBOQDZ5KjyBIxRZGzrweGPM47sAYTdVG4+7R+2EGMTmp0h6ZwgqHrFRCeg2gdhsG9xXEl2Sg==

"@types/progress@^2.0.3":
"@types/progress@2.0.3", "@types/progress@^2.0.3":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@types/progress/-/progress-2.0.3.tgz#7ccbd9c6d4d601319126c469e73b5bb90dfc8ccc"
integrity sha512-bPOsfCZ4tsTlKiBjBhKnM8jpY5nmIll166IPD58D92hR7G7kZDfx5iB9wGF4NfZrdKolebjeAr3GouYkSGoJ/A==
Expand Down Expand Up @@ -8832,7 +8832,7 @@ process@^0.11.10:
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI=

progress@^2.0.1, progress@^2.0.3:
progress@2.0.3, progress@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
Expand Down