Skip to content

Commit aad3bbf

Browse files
committed
refactor(@angular/cli): use direct schematic workflow option transform option
1 parent 9280d87 commit aad3bbf

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

packages/angular/cli/models/schematic-command.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ export abstract class SchematicCommand<
251251
// Global
252252
: [__dirname, process.cwd()],
253253
schemaValidation: true,
254+
optionTransforms: [
255+
// Add configuration file defaults
256+
async (schematic, current) => ({
257+
...(await getSchematicDefaults(schematic.collection.name, schematic.name, getProjectName())),
258+
...current,
259+
}),
260+
],
254261
});
255262

256263
const getProjectName = () => {
@@ -278,16 +285,6 @@ export abstract class SchematicCommand<
278285
return undefined;
279286
};
280287

281-
const defaultOptionTransform = async (
282-
schematic: FileSystemSchematicDescription,
283-
current: {},
284-
) => ({
285-
...(await getSchematicDefaults(schematic.collection.name, schematic.name, getProjectName())),
286-
...current,
287-
});
288-
289-
workflow.engineHost.registerOptionsTransform(defaultOptionTransform);
290-
291288
workflow.registry.addPostTransform(schema.transforms.addUndefinedDefaults);
292289
workflow.registry.addSmartDefaultProvider('projectName', getProjectName);
293290
workflow.registry.useXDeprecatedProvider(msg => this.logger.warn(msg));

0 commit comments

Comments
 (0)