Skip to content

Commit 54b08d7

Browse files
author
Angular Builds
committed
b2b7544 release: v0.4.0
1 parent a0146fb commit 54b08d7

14 files changed

+45
-18
lines changed

collection-schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@
4141
"schema": {
4242
"type": "string",
4343
"description": "Location of the schema.json file of the schematic"
44+
},
45+
"hidden": {
46+
"type": "boolean",
47+
"default": false,
48+
"description": "Whether or not this schematic should be listed by the tooling. This does not prevent the tooling to run this schematic, just remove it name from listSchematicNames()."
49+
},
50+
"private": {
51+
"type": "boolean",
52+
"default": false,
53+
"description": "Whether or not this schematic can be called from an external schematic, or a tool. This implies hidden: true."
4454
}
4555
},
4656
"required": [

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-devkit/schematics",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"description": "Angular Schematics - Library",
55
"main": "src/index.js",
66
"typings": "src/index.d.ts",
@@ -21,7 +21,7 @@
2121
"rxjs": "^5.5.6"
2222
},
2323
"peerDependencies": {
24-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#c7f933a"
24+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#b2b7544"
2525
},
2626
"repository": {
2727
"type": "git",

src/engine/collection.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export declare class CollectionImpl<CollectionT extends object, SchematicT exten
1414
constructor(_description: CollectionDescription<CollectionT>, _engine: SchematicEngine<CollectionT, SchematicT>, baseDescriptions?: CollectionDescription<CollectionT>[] | undefined);
1515
readonly description: CollectionDescription<CollectionT>;
1616
readonly name: string;
17-
createSchematic(name: string): Schematic<CollectionT, SchematicT>;
17+
createSchematic(name: string, allowPrivate?: boolean): Schematic<CollectionT, SchematicT>;
1818
listSchematicNames(): string[];
1919
}

src/engine/collection.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/engine/engine.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export declare class CircularCollectionException extends BaseException {
2323
export declare class UnknownSchematicException extends BaseException {
2424
constructor(name: string, collection: CollectionDescription<{}>);
2525
}
26+
export declare class PrivateSchematicException extends BaseException {
27+
constructor(name: string, collection: CollectionDescription<{}>);
28+
}
2629
export declare class SchematicEngineConflictingException extends BaseException {
2730
constructor();
2831
}
@@ -39,7 +42,7 @@ export declare class SchematicEngine<CollectionT extends object, SchematicT exte
3942
createCollection(name: string): Collection<CollectionT, SchematicT>;
4043
private _createCollectionDescription(name, parentNames?);
4144
createContext(schematic: Schematic<CollectionT, SchematicT>, parent?: Partial<TypedSchematicContext<CollectionT, SchematicT>>): TypedSchematicContext<CollectionT, SchematicT>;
42-
createSchematic(name: string, collection: Collection<CollectionT, SchematicT>): Schematic<CollectionT, SchematicT>;
45+
createSchematic(name: string, collection: Collection<CollectionT, SchematicT>, allowPrivate?: boolean): Schematic<CollectionT, SchematicT>;
4346
listSchematicNames(collection: Collection<CollectionT, SchematicT>): string[];
4447
transformOptions<OptionT extends object, ResultT extends object>(schematic: Schematic<CollectionT, SchematicT>, options: OptionT): Observable<ResultT>;
4548
createSourceFromUrl(url: Url, context: TypedSchematicContext<CollectionT, SchematicT>): Source;

src/engine/engine.js

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/engine/interface.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export declare type CollectionDescription<CollectionMetadataT extends object> =
2828
export declare type SchematicDescription<CollectionMetadataT extends object, SchematicMetadataT extends object> = SchematicMetadataT & {
2929
readonly collection: CollectionDescription<CollectionMetadataT>;
3030
readonly name: string;
31+
readonly private?: boolean;
32+
readonly hidden?: boolean;
3133
};
3234
/**
3335
* The Host for the Engine. Specifically, the piece of the tooling responsible for resolving
@@ -75,7 +77,7 @@ export interface Engine<CollectionMetadataT extends object, SchematicMetadataT e
7577
export interface Collection<CollectionMetadataT extends object, SchematicMetadataT extends object> {
7678
readonly description: CollectionDescription<CollectionMetadataT>;
7779
readonly baseDescriptions?: Array<CollectionDescription<CollectionMetadataT>>;
78-
createSchematic(name: string): Schematic<CollectionMetadataT, SchematicMetadataT>;
80+
createSchematic(name: string, allowPrivate?: boolean): Schematic<CollectionMetadataT, SchematicMetadataT>;
7981
listSchematicNames(): string[];
8082
}
8183
/**

0 commit comments

Comments
 (0)