Skip to content

Commit bd4319a

Browse files
committed
refactor(@angular-devkit/schematics): allow customization of node workflow engine host
This adds an option to the NodeWorkflow to allow a custom NodeModulesEngineHost to be used with the workflow.
1 parent c561e73 commit bd4319a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

etc/api/angular_devkit/schematics/tools/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export declare class NodeWorkflow extends workflow.BaseWorkflow {
134134

135135
export interface NodeWorkflowOptions {
136136
dryRun?: boolean;
137+
engineHostCreator?: (options: NodeWorkflowOptions) => NodeModulesEngineHost;
137138
force?: boolean;
138139
optionTransforms?: OptionTransform<object, object>[];
139140
packageManager?: string;

packages/angular_devkit/schematics/tools/workflow/node-workflow.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface NodeWorkflowOptions {
2525
resolvePaths?: string[];
2626
schemaValidation?: boolean;
2727
optionTransforms?: OptionTransform<object, object>[];
28+
engineHostCreator?: (options: NodeWorkflowOptions) => NodeModulesEngineHost;
2829
}
2930

3031
/**
@@ -46,7 +47,8 @@ export class NodeWorkflow extends workflow.BaseWorkflow {
4647
root = options.root;
4748
}
4849

49-
const engineHost = new NodeModulesEngineHost(options.resolvePaths);
50+
const engineHost =
51+
options.engineHostCreator?.(options) || new NodeModulesEngineHost(options.resolvePaths);
5052
super({
5153
host,
5254
engineHost,

0 commit comments

Comments
 (0)