Skip to content

Commit 9805e84

Browse files
tiaguinhoalexeagle
authored andcommitted
feat(@angular/cli): implement --registry for ng add (#14285)
Closes 14189
1 parent 16ce92d commit 9805e84

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/angular/cli/commands/add-impl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> {
6464
packageMetadata = await fetchPackageMetadata(
6565
packageIdentifier.name,
6666
this.logger,
67-
{ usingYarn },
67+
{ registry: options.registry, usingYarn },
6868
);
6969
} catch (e) {
7070
this.logger.error('Unable to fetch package metadata: ' + e.message);
@@ -114,7 +114,7 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> {
114114
const manifest = await fetchPackageManifest(
115115
packageIdentifier,
116116
this.logger,
117-
{ usingYarn },
117+
{ registry: options.registry, usingYarn },
118118
);
119119

120120
collectionName = manifest.name;

packages/angular/cli/commands/add.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818
"$source": "argv",
1919
"index": 0
2020
}
21+
},
22+
"registry": {
23+
"description": "The NPM registry to use.",
24+
"type": "string",
25+
"oneOf": [
26+
{
27+
"format": "uri"
28+
},
29+
{
30+
"format": "hostname"
31+
}
32+
]
2133
}
2234
},
2335
"required": [

0 commit comments

Comments
 (0)