Skip to content

fix(@angular/cli): add verbose option to update and add #15000

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
Jul 9, 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
8 changes: 4 additions & 4 deletions packages/angular/cli/commands/add-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { dirname, join } from 'path';
import { intersects, prerelease, rcompare, satisfies, valid, validRange } from 'semver';
import { isPackageNameSafeForAnalytics } from '../models/analytics';
import { Arguments } from '../models/interface';
import { SchematicCommand } from '../models/schematic-command';
import { RunSchematicOptions, SchematicCommand } from '../models/schematic-command';
import npmInstall from '../tasks/npm-install';
import { colors } from '../utilities/color';
import { getPackageManager } from '../utilities/package-manager';
Expand Down Expand Up @@ -65,6 +65,7 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> {
packageMetadata = await fetchPackageMetadata(packageIdentifier.name, this.logger, {
registry: options.registry,
usingYarn,
verbose: options.verbose,
});
} catch (e) {
this.logger.error('Unable to fetch package metadata: ' + e.message);
Expand Down Expand Up @@ -116,6 +117,7 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> {
try {
const manifest = await fetchPackageManifest(packageIdentifier, this.logger, {
registry: options.registry,
verbose: options.verbose,
usingYarn,
});

Expand Down Expand Up @@ -174,12 +176,10 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> {
collectionName: string,
options: string[] = [],
): Promise<number | void> {
const runOptions = {
const runOptions: RunSchematicOptions = {
schematicOptions: options,
workingDir: this.workspace.root,
collectionName,
schematicName: 'ng-add',
allowPrivate: true,
dryRun: false,
force: false,
};
Expand Down
5 changes: 5 additions & 0 deletions packages/angular/cli/commands/add.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"format": "hostname"
}
]
},
"verbose": {
"description": "Display additional details about internal operations during execution.",
"type": "boolean",
"default": false
}
},
"required": [
Expand Down
6 changes: 4 additions & 2 deletions packages/angular/cli/commands/update-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import * as path from 'path';
import * as semver from 'semver';
import { Arguments, Option } from '../models/interface';
import { SchematicCommand } from '../models/schematic-command';
import { findUp } from '../utilities/find-up';
import { getPackageManager } from '../utilities/package-manager';
import {
PackageIdentifier,
Expand Down Expand Up @@ -134,6 +133,7 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
additionalOptions: {
force: options.force || false,
next: options.next || false,
verbose: options.verbose || false,
packageManager,
packages: options.all ? Object.keys(rootDependencies) : [],
},
Expand Down Expand Up @@ -240,6 +240,7 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
package: packageName,
collection: migrations,
from: options.from,
verbose: options.verbose || false,
to: options.to || packageNode.package.version,
},
});
Expand Down Expand Up @@ -286,7 +287,7 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
try {
// Metadata requests are internally cached; multiple requests for same name
// does not result in additional network traffic
metadata = await fetchPackageMetadata(packageName, this.logger);
metadata = await fetchPackageMetadata(packageName, this.logger, { verbose: options.verbose });
} catch (e) {
this.logger.error(`Error fetching metadata for '${packageName}': ` + e.message);

Expand Down Expand Up @@ -339,6 +340,7 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
dryRun: !!options.dryRun,
showNothingDone: false,
additionalOptions: {
verbose: options.verbose || false,
force: options.force || false,
packageManager,
packages: packagesToUpdate,
Expand Down
5 changes: 5 additions & 0 deletions packages/angular/cli/commands/update.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"allowDirty": {
"description": "Whether to allow updating when the repository contains modified or untracked files.",
"type": "boolean"
},
"verbose": {
"description": "Display additional details about internal operations during execution.",
"type": "boolean",
"default": false
}
}
}
Expand Down