mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 18:13:38 +08:00
fix(@angular-devkit/schematics): allow custom registry for node package task
This commit is contained in:
parent
0d6dae107d
commit
33656f7aa8
@ -135,6 +135,7 @@ export declare class NodeWorkflow extends workflow.BaseWorkflow {
|
||||
dryRun?: boolean;
|
||||
root?: Path;
|
||||
packageManager?: string;
|
||||
packageRegistry?: string;
|
||||
registry?: schema.CoreSchemaRegistry;
|
||||
resolvePaths?: string[];
|
||||
});
|
||||
|
@ -13,13 +13,13 @@ import { Observable } from 'rxjs';
|
||||
import { TaskExecutor, UnsuccessfulWorkflowExecution } from '../../src';
|
||||
import { NodePackageTaskFactoryOptions, NodePackageTaskOptions } from './options';
|
||||
|
||||
type PackageManagerProfile = {
|
||||
interface PackageManagerProfile {
|
||||
quietArgument?: string;
|
||||
commands: {
|
||||
installAll?: string;
|
||||
installPackage: string;
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
const packageManagers: { [name: string]: PackageManagerProfile } = {
|
||||
'npm': {
|
||||
@ -99,6 +99,10 @@ export default function(
|
||||
args.push(taskPackageManagerProfile.quietArgument);
|
||||
}
|
||||
|
||||
if (factoryOptions.registry) {
|
||||
args.push(`--registry="${factoryOptions.registry}"`);
|
||||
}
|
||||
|
||||
return new Observable(obs => {
|
||||
const spinner = ora({
|
||||
text: 'Installing packages...',
|
||||
|
@ -11,6 +11,7 @@ export interface NodePackageTaskFactoryOptions {
|
||||
rootDirectory?: string;
|
||||
packageManager?: string;
|
||||
allowPackageManagerOverride?: boolean;
|
||||
registry?: string;
|
||||
}
|
||||
|
||||
export interface NodePackageTaskOptions {
|
||||
|
@ -24,6 +24,7 @@ export class NodeWorkflow extends workflow.BaseWorkflow {
|
||||
dryRun?: boolean;
|
||||
root?: Path;
|
||||
packageManager?: string;
|
||||
packageRegistry?: string;
|
||||
registry?: schema.CoreSchemaRegistry;
|
||||
resolvePaths?: string[],
|
||||
},
|
||||
@ -44,6 +45,7 @@ export class NodeWorkflow extends workflow.BaseWorkflow {
|
||||
allowPackageManagerOverride: true,
|
||||
packageManager: options.packageManager,
|
||||
rootDirectory: options.root && getSystemPath(options.root),
|
||||
registry: options.packageRegistry,
|
||||
},
|
||||
);
|
||||
engineHost.registerTaskExecutor(
|
||||
|
Loading…
x
Reference in New Issue
Block a user