Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit fd7afde

Browse files
filipesilvahansl
authored andcommitted
refactor(@angular-devkit/schematics): add standardFormats array
1 parent 4fa0167 commit fd7afde

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

packages/angular_devkit/schematics/src/formats/index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export * from './app-name';
10-
export * from './html-selector';
11-
export * from './path';
9+
import { schema } from '@angular-devkit/core';
10+
import { appNameFormat } from './app-name';
11+
export { appNameFormat } from './app-name';
12+
import { htmlSelectorFormat } from './html-selector';
13+
export { htmlSelectorFormat } from './html-selector';
14+
import { pathFormat } from './path';
15+
export { pathFormat } from './path';
16+
17+
export const standardFormats: schema.SchemaFormat[] = [
18+
appNameFormat,
19+
htmlSelectorFormat,
20+
pathFormat,
21+
];

packages/angular_devkit/schematics_cli/bin/schematics.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,7 @@ const engine = new SchematicEngine(engineHost);
129129

130130

131131
// Add support for schemaJson.
132-
const schemaFormats = [
133-
formats.appNameFormat,
134-
formats.htmlSelectorFormat,
135-
formats.pathFormat,
136-
];
137-
const registry = new schema.CoreSchemaRegistry(schemaFormats);
132+
const registry = new schema.CoreSchemaRegistry(formats.standardFormats);
138133
engineHost.registerOptionsTransform(validateOptionsWithSchema(registry));
139134

140135

0 commit comments

Comments
 (0)