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

feat(@angular-devkit/schematics): support collection extension - #398

Merged
clydin merged 1 commit into
angular:masterfrom
clydin:collection-extension
Feb 2, 2018
Merged

clydin merged 1 commit into
angular:masterfrom
clydin:collection-extension

Conversation

@clydin

@clydin clydin commented Jan 19, 2018 •

Copy link
Copy Markdown
Member

Example usage (also supports an array of strings):

  "name": "extends-basic-string",
  "extends": "works",
  "schematics": {
    "schematic2": {
      "description": "2",
      "factory": "../null-factory"
    }
  }
}

Closes #34

@filipesilva

Copy link
Copy Markdown
Contributor

@clydin can you rebase please, and @hansl can you review?

@hansl hansl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 little nits. Nothing major. Good work!

"title": "Collection Schema for validating a 'collection.json'.",
"type": "object",
"properties": {
"extends": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How hard to add type: [ "array", "string" ] ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added support for both.

expect(schematic1.description.name).toBe('schematic1');
});

it('extends a collection ', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should just add a test for listSchematicNames to avoid regression.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.


private _createCollectionDescription(
name: string,
parentNames?: Set<string>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nit but not stopping the approval; parentNames = new Set<string>() then lower just add regardless of whether it's defined or not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants