fix(nx): extend @nrwl/workspace collection and cleanup inconsistencies

This commit is contained in:
Jason Jean 2019-05-17 15:50:48 -04:00 committed by Victor Savkin
parent d73c10ae54
commit ff729156b3
16 changed files with 69 additions and 53 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "nx/angular", "name": "nx/angular",
"version": "0.1", "version": "0.1",
"extends": ["@schematics/angular"], "extends": ["@schematics/angular", "@nrwl/workspace"],
"schematics": { "schematics": {
"ng-add": { "ng-add": {
"factory": "./src/schematics/ng-add/ng-add", "factory": "./src/schematics/ng-add/ng-add",

View File

@ -55,10 +55,18 @@
"type": "list", "type": "list",
"items": [ "items": [
{ "value": "css", "label": "CSS" }, { "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" }, {
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" }, "value": "scss",
{ "value": "less", "label": "LESS [ http://lesscss.org ]" }, "label": "SASS(.scss) [ http://sass-lang.com ]"
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" } },
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
] ]
} }
}, },

View File

@ -1,6 +1,7 @@
{ {
"name": "nx/express", "name": "nx/express",
"version": "0.1", "version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": { "schematics": {
"ng-add": { "ng-add": {
"factory": "./src/schematics/ng-add/ng-add", "factory": "./src/schematics/ng-add/ng-add",

View File

@ -1,6 +1,7 @@
{ {
"name": "nx/nest", "name": "nx/nest",
"version": "0.1", "version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": { "schematics": {
"ng-add": { "ng-add": {
"factory": "./src/schematics/ng-add/ng-add", "factory": "./src/schematics/ng-add/ng-add",

View File

@ -1,6 +1,7 @@
{ {
"name": "nx/node", "name": "nx/node",
"version": "0.1", "version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": { "schematics": {
"ng-add": { "ng-add": {
"factory": "./src/schematics/ng-add/ng-add", "factory": "./src/schematics/ng-add/ng-add",

View File

@ -1,6 +1,7 @@
{ {
"name": "nx/react", "name": "nx/react",
"version": "0.1", "version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": { "schematics": {
"ng-add": { "ng-add": {
"factory": "./src/schematics/ng-add/ng-add", "factory": "./src/schematics/ng-add/ng-add",

View File

@ -27,10 +27,18 @@
"type": "list", "type": "list",
"items": [ "items": [
{ "value": "css", "label": "CSS" }, { "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" }, {
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" }, "value": "scss",
{ "value": "less", "label": "LESS [ http://lesscss.org ]" }, "label": "SASS(.scss) [ http://sass-lang.com ]"
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" } },
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
] ]
} }
}, },

View File

@ -1,6 +1,7 @@
{ {
"name": "nx/web", "name": "nx/web",
"version": "0.1", "version": "0.1",
"extends": ["@nrwl/workspace"],
"schematics": { "schematics": {
"ng-add": { "ng-add": {
"factory": "./src/schematics/ng-add/ng-add", "factory": "./src/schematics/ng-add/ng-add",

View File

@ -26,7 +26,8 @@
"ng-new": { "ng-new": {
"factory": "./src/schematics/ng-new/ng-new", "factory": "./src/schematics/ng-new/ng-new",
"schema": "./src/schematics/ng-new/schema.json", "schema": "./src/schematics/ng-new/schema.json",
"description": "Create a workspace" "description": "Create a workspace",
"hidden": true
}, },
"library": { "library": {

View File

@ -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', () => { describe('--unit-test-runner none', () => {
it('should not generate test configuration', async () => { it('should not generate test configuration', async () => {
const resultTree = await runSchematic( const resultTree = await runSchematic(

View File

@ -4,7 +4,6 @@ import { Framework } from '../../utils/framework';
export interface Schema { export interface Schema {
name: string; name: string;
directory?: string; directory?: string;
style?: string;
skipTsConfig: boolean; skipTsConfig: boolean;
skipFormat: boolean; skipFormat: boolean;
tags?: string; tags?: string;

View File

@ -18,22 +18,6 @@
"description": "A directory where the app is placed", "description": "A directory where the app is placed",
"x-prompt": "In which directory should the library be generated?" "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": { "unitTestRunner": {
"type": "string", "type": "string",
"enum": ["jest", "none"], "enum": ["jest", "none"],

View File

@ -7,8 +7,7 @@
"properties": { "properties": {
"npmScope": { "npmScope": {
"type": "string", "type": "string",
"description": "Npm scope for importing libs.", "description": "Npm scope for importing libs."
"x-prompt": "What is the npm scope you would like to use for your Nx Workspace?"
}, },
"skipInstall": { "skipInstall": {
"type": "boolean", "type": "boolean",

View File

@ -23,10 +23,18 @@
"type": "list", "type": "list",
"items": [ "items": [
{ "value": "css", "label": "CSS" }, { "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" }, {
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" }, "value": "scss",
{ "value": "less", "label": "LESS [ http://lesscss.org ]" }, "label": "SASS(.scss) [ http://sass-lang.com ]"
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" } },
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
] ]
} }
}, },

View File

@ -25,10 +25,18 @@
"type": "list", "type": "list",
"items": [ "items": [
{ "value": "css", "label": "CSS" }, { "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" }, {
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" }, "value": "scss",
{ "value": "less", "label": "LESS [ http://lesscss.org ]" }, "label": "SASS(.scss) [ http://sass-lang.com ]"
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" } },
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
] ]
} }
} }

View File

@ -23,10 +23,18 @@
"type": "list", "type": "list",
"items": [ "items": [
{ "value": "css", "label": "CSS" }, { "value": "css", "label": "CSS" },
{ "value": "scss", "label": "SCSS [ http://sass-lang.com ]" }, {
{ "value": "sass", "label": "SASS [ http://sass-lang.com ]" }, "value": "scss",
{ "value": "less", "label": "LESS [ http://lesscss.org ]" }, "label": "SASS(.scss) [ http://sass-lang.com ]"
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" } },
{
"value": "styl",
"label": "Stylus(.styl)[ http://stylus-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://lesscss.org ]"
}
] ]
} }
}, },