Skip to content

Commit fb0be7d

Browse files
committed
refactor(@angular/cli): use direct schematic workflow option transform option
(cherry picked from commit aad3bbf)
1 parent 3839f35 commit fb0be7d

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
@@ -257,6 +257,13 @@ export abstract class SchematicCommand<
257257
// Global
258258
: [__dirname, process.cwd()],
259259
schemaValidation: true,
260+
optionTransforms: [
261+
// Add configuration file defaults
262+
async (schematic, current) => ({
263+
...(await getSchematicDefaults(schematic.collection.name, schematic.name, getProjectName())),
264+
...current,
265+
}),
266+
],
260267
});
261268

262269
const getProjectName = () => {
@@ -284,16 +291,6 @@ export abstract class SchematicCommand<
284291
return undefined;
285292
};
286293

287-
const defaultOptionTransform = async (
288-
schematic: FileSystemSchematicDescription,
289-
current: {},
290-
) => ({
291-
...(await getSchematicDefaults(schematic.collection.name, schematic.name, getProjectName())),
292-
...current,
293-
});
294-
295-
workflow.engineHost.registerOptionsTransform(defaultOptionTransform);
296-
297294
workflow.registry.addPostTransform(schema.transforms.addUndefinedDefaults);
298295
workflow.registry.addSmartDefaultProvider('projectName', getProjectName);
299296
workflow.registry.useXDeprecatedProvider(msg => this.logger.warn(msg));

0 commit comments

Comments
 (0)