Skip to content

Commit

Permalink
fix(nx): extend @nrwl/workspace collection and cleanup inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored and vsavkin committed May 17, 2019
1 parent d73c10a commit ff72915
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 53 deletions.
2 changes: 1 addition & 1 deletion packages/angular/collection.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nx/angular",
"version": "0.1",
"extends": ["@schematics/angular"],
"extends": ["@schematics/angular", "@nrwl/workspace"],
"schematics": {
"ng-add": {
"factory": "./src/schematics/ng-add/ng-add",
Expand Down
16 changes: 12 additions & 4 deletions packages/angular/src/schematics/application/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@
"type": "list",
"items": [
{ "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" },
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" },
{ "value": "less", "label": "LESS [ http://lesscss.org ]" },
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" }
{
"value": "scss",
"label": "SASS(.scss) [ http://sass-lang.com ]"
},
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
]
}
},
Expand Down
1 change: 1 addition & 0 deletions packages/express/collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "nx/express",
"version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": {
"ng-add": {
"factory": "./src/schematics/ng-add/ng-add",
Expand Down
1 change: 1 addition & 0 deletions packages/nest/collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "nx/nest",
"version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": {
"ng-add": {
"factory": "./src/schematics/ng-add/ng-add",
Expand Down
1 change: 1 addition & 0 deletions packages/node/collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "nx/node",
"version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": {
"ng-add": {
"factory": "./src/schematics/ng-add/ng-add",
Expand Down
1 change: 1 addition & 0 deletions packages/react/collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "nx/react",
"version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": {
"ng-add": {
"factory": "./src/schematics/ng-add/ng-add",
Expand Down
16 changes: 12 additions & 4 deletions packages/react/src/schematics/library/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@
"type": "list",
"items": [
{ "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" },
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" },
{ "value": "less", "label": "LESS [ http://lesscss.org ]" },
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" }
{
"value": "scss",
"label": "SASS(.scss) [ http://sass-lang.com ]"
},
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
]
}
},
Expand Down
1 change: 1 addition & 0 deletions packages/web/collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "nx/web",
"version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": {
"ng-add": {
"factory": "./src/schematics/ng-add/ng-add",
Expand Down
3 changes: 2 additions & 1 deletion packages/workspace/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"ng-new": {
"factory": "./src/schematics/ng-new/ng-new",
"schema": "./src/schematics/ng-new/schema.json",
"description": "Create a workspace"
"description": "Create a workspace",
"hidden": true
},

"library": {
Expand Down
12 changes: 0 additions & 12 deletions packages/workspace/src/schematics/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,6 @@ describe('lib', () => {
});
});

describe('--style scss', () => {
it('should use scss for styles', async () => {
const result = await runSchematic(
'lib',
{ name: 'myLib', style: 'scss' },
appTree
);

expect(result.exists('libs/my-lib/src/lib/my-lib.scss'));
});
});

describe('--unit-test-runner none', () => {
it('should not generate test configuration', async () => {
const resultTree = await runSchematic(
Expand Down
1 change: 0 additions & 1 deletion packages/workspace/src/schematics/library/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Framework } from '../../utils/framework';
export interface Schema {
name: string;
directory?: string;
style?: string;
skipTsConfig: boolean;
skipFormat: boolean;
tags?: string;
Expand Down
16 changes: 0 additions & 16 deletions packages/workspace/src/schematics/library/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@
"description": "A directory where the app is placed",
"x-prompt": "In which directory should the library be generated?"
},
"style": {
"description": "The file extension to be used for style files.",
"type": "string",
"default": "css",
"x-prompt": {
"message": "Which stylesheet format would you like to use?",
"type": "list",
"items": [
{ "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" },
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" },
{ "value": "less", "label": "LESS [ http://lesscss.org ]" },
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" }
]
}
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
Expand Down
3 changes: 1 addition & 2 deletions packages/workspace/src/schematics/ng-add/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"properties": {
"npmScope": {
"type": "string",
"description": "Npm scope for importing libs.",
"x-prompt": "What is the npm scope you would like to use for your Nx Workspace?"
"description": "Npm scope for importing libs."
},
"skipInstall": {
"type": "boolean",
Expand Down
16 changes: 12 additions & 4 deletions packages/workspace/src/schematics/ng-new/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@
"type": "list",
"items": [
{ "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" },
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" },
{ "value": "less", "label": "LESS [ http://lesscss.org ]" },
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" }
{
"value": "scss",
"label": "SASS(.scss) [ http://sass-lang.com ]"
},
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
]
}
},
Expand Down
16 changes: 12 additions & 4 deletions packages/workspace/src/schematics/preset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@
"type": "list",
"items": [
{ "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" },
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" },
{ "value": "less", "label": "LESS [ http://lesscss.org ]" },
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" }
{
"value": "scss",
"label": "SASS(.scss) [ http://sass-lang.com ]"
},
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
]
}
}
Expand Down
16 changes: 12 additions & 4 deletions packages/workspace/src/schematics/workspace/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@
"type": "list",
"items": [
{ "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" },
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" },
{ "value": "less", "label": "LESS [ http://lesscss.org ]" },
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" }
{
"value": "scss",
"label": "SASS(.scss) [ http://sass-lang.com ]"
},
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
]
}
},
Expand Down

0 comments on commit ff72915

Please sign in to comment.