fix(nx): small fixes
This commit is contained in:
parent
9ef7606b3e
commit
b4b38d12d8
@ -20,9 +20,9 @@ describe('Affected', () => {
|
||||
const mypublishablelib = uniq('mypublishablelib');
|
||||
newApp(myapp);
|
||||
newApp(myapp2);
|
||||
newLib(mylib);
|
||||
newLib(mylib2);
|
||||
newLib(`${mypublishablelib} --publishable`);
|
||||
newLib(`${mylib} --framework angular`);
|
||||
newLib(`${mylib2} --framework angular`);
|
||||
newLib(`${mypublishablelib} --framework angular --publishable`);
|
||||
|
||||
updateFile(
|
||||
`apps/${myapp}/src/app/app.component.spec.ts`,
|
||||
|
||||
@ -181,9 +181,6 @@ describe('Command line', () => {
|
||||
`npm run workspace-schematic ${custom} ${workspace} -- --no-interactive --directory=dir -d`
|
||||
);
|
||||
expect(exists(`libs/dir/${workspace}/src/index.ts`)).toEqual(false);
|
||||
expect(dryRunOutput).toContain(
|
||||
`create libs/dir/${workspace}/src/lib/dir-${workspace}.module.ts`
|
||||
);
|
||||
expect(dryRunOutput).toContain('update angular.json');
|
||||
expect(dryRunOutput).toContain('update nx.json');
|
||||
|
||||
@ -191,9 +188,6 @@ describe('Command line', () => {
|
||||
`npm run workspace-schematic ${custom} ${workspace} -- --no-interactive --directory=dir`
|
||||
);
|
||||
checkFilesExist(`libs/dir/${workspace}/src/index.ts`);
|
||||
expect(output).toContain(
|
||||
`create libs/dir/${workspace}/src/lib/dir-${workspace}.module.ts`
|
||||
);
|
||||
expect(output).toContain('update angular.json');
|
||||
expect(output).toContain('update nx.json');
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ describe('ngrx', () => {
|
||||
|
||||
const mylib = uniq('mylib');
|
||||
// Generate feature library and ngrx state within that library
|
||||
runCLI(`g lib ${mylib} --prefix=fl`);
|
||||
runCLI(`g lib ${mylib} --framework angular --prefix=fl`);
|
||||
runCLI(
|
||||
`generate ngrx flights --module=libs/${mylib}/src/lib/${mylib}.module.ts --facade`
|
||||
);
|
||||
|
||||
@ -65,6 +65,8 @@ export function copyMissingPackages(): void {
|
||||
'angular',
|
||||
'@angular/upgrade',
|
||||
'@angular-devkit/build-ng-packagr',
|
||||
'codelyzer',
|
||||
'ngrx-store-freeze',
|
||||
'npm-run-all',
|
||||
'yargs',
|
||||
'yargs-parser',
|
||||
|
||||
@ -59,6 +59,7 @@
|
||||
"angular": "1.6.6",
|
||||
"app-root-path": "^2.0.1",
|
||||
"circular-dependency-plugin": "^5.0.2",
|
||||
"codelyzer": "~4.5.0",
|
||||
"commitizen": "^2.10.1",
|
||||
"conventional-changelog-cli": "^1.3.21",
|
||||
"cosmiconfig": "^4.0.0",
|
||||
@ -87,6 +88,7 @@
|
||||
"karma-webpack": "2.0.4",
|
||||
"license-webpack-plugin": "^1.4.0",
|
||||
"ng-packagr": "4.3.1",
|
||||
"ngrx-store-freeze": "0.2.4",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"opn": "^5.3.0",
|
||||
"precise-commits": "1.0.2",
|
||||
|
||||
@ -234,7 +234,7 @@ describe('Update 7.2.0', () => {
|
||||
}
|
||||
});
|
||||
createJson('apps/node-app/tsconfig.app.json', {
|
||||
extends: '../../tsconfig.json',
|
||||
extends: '../../tsconfig.json',
|
||||
compilerOptions: {
|
||||
types: ['node']
|
||||
}
|
||||
|
||||
@ -265,15 +265,8 @@ function updateDependencies(options: NormalizedSchema): Rule {
|
||||
return addDepsToPackageJson(deps, devDeps);
|
||||
}
|
||||
|
||||
function lint(options: NormalizedSchema): Rule {
|
||||
function updateLinting(options: NormalizedSchema): Rule {
|
||||
switch (options.framework) {
|
||||
case Framework.React:
|
||||
return updateJsonInTree(`${options.appProjectRoot}/tslint.json`, json => {
|
||||
json.extends = `${offsetFromRoot(options.appProjectRoot)}tslint.json`;
|
||||
json.rules = [];
|
||||
return json;
|
||||
});
|
||||
|
||||
case Framework.Angular:
|
||||
return chain([
|
||||
updateJsonInTree('tslint.json', json => {
|
||||
@ -306,7 +299,7 @@ function lint(options: NormalizedSchema): Rule {
|
||||
return json;
|
||||
})
|
||||
]);
|
||||
|
||||
case Framework.React:
|
||||
case Framework.WebComponents:
|
||||
return updateJsonInTree(`${options.appProjectRoot}/tslint.json`, json => {
|
||||
json.extends = `${offsetFromRoot(options.appProjectRoot)}tslint.json`;
|
||||
@ -534,7 +527,7 @@ export default function(schema: Schema): Rule {
|
||||
? addRouterRootConfiguration(options)
|
||||
: noop(),
|
||||
updateDependencies(options),
|
||||
lint(options),
|
||||
updateLinting(options),
|
||||
options.unitTestRunner === 'jest'
|
||||
? schematic('jest-project', {
|
||||
project: options.name,
|
||||
|
||||
@ -366,6 +366,7 @@ function updateProject(options: NormalizedSchema): Rule {
|
||||
updateJsonInTree(`${options.projectRoot}/tslint.json`, json => {
|
||||
return {
|
||||
...json,
|
||||
rules: options.framework === Framework.Angular ? json.rules : [],
|
||||
extends: `${offsetFromRoot(options.projectRoot)}tslint.json`
|
||||
};
|
||||
}),
|
||||
|
||||
75
yarn.lock
75
yarn.lock
@ -1144,7 +1144,7 @@ anymatch@^2.0.0:
|
||||
micromatch "^3.1.4"
|
||||
normalize-path "^2.1.1"
|
||||
|
||||
app-root-path@^2.0.1:
|
||||
app-root-path@^2.0.1, app-root-path@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.1.0.tgz#98bf6599327ecea199309866e8140368fd2e646a"
|
||||
integrity sha1-mL9lmTJ+zqGZMJhm6BQDaP0uZGo=
|
||||
@ -2925,6 +2925,18 @@ code-point-at@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
|
||||
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
|
||||
|
||||
codelyzer@~4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/codelyzer/-/codelyzer-4.5.0.tgz#a65ddeeeca2894653253a89bfa229118ff9f59b1"
|
||||
integrity sha512-oO6vCkjqsVrEsmh58oNlnJkRXuA30hF8cdNAQV9DytEalDwyOFRvHMnlKFzmOStNerOmPGZU9GAHnBo4tGvtiQ==
|
||||
dependencies:
|
||||
app-root-path "^2.1.0"
|
||||
css-selector-tokenizer "^0.7.0"
|
||||
cssauron "^1.4.0"
|
||||
semver-dsl "^1.0.1"
|
||||
source-map "^0.5.7"
|
||||
sprintf-js "^1.1.1"
|
||||
|
||||
collection-visit@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
|
||||
@ -3671,11 +3683,32 @@ css-select@^1.1.0:
|
||||
domutils "1.5.1"
|
||||
nth-check "~1.0.1"
|
||||
|
||||
css-selector-tokenizer@^0.7.0:
|
||||
version "0.7.1"
|
||||
resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz#a177271a8bca5019172f4f891fc6eed9cbf68d5d"
|
||||
integrity sha512-xYL0AMZJ4gFzJQsHUKa5jiWWi2vH77WVNg7JYRyewwj6oPh4yb/y6Y9ZCw9dsj/9UauMhtuxR+ogQd//EdEVNA==
|
||||
dependencies:
|
||||
cssesc "^0.1.0"
|
||||
fastparse "^1.1.1"
|
||||
regexpu-core "^1.0.0"
|
||||
|
||||
css-what@2.1:
|
||||
version "2.1.3"
|
||||
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
|
||||
integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==
|
||||
|
||||
cssauron@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/cssauron/-/cssauron-1.4.0.tgz#a6602dff7e04a8306dc0db9a551e92e8b5662ad8"
|
||||
integrity sha1-pmAt/34EqDBtwNuaVR6S6LVmKtg=
|
||||
dependencies:
|
||||
through X.X.X
|
||||
|
||||
cssesc@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4"
|
||||
integrity sha1-yBSQPkViM3GgR3tAEJqq++6t27Q=
|
||||
|
||||
cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0":
|
||||
version "0.3.4"
|
||||
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797"
|
||||
@ -3921,6 +3954,11 @@ deep-extend@^0.6.0:
|
||||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
|
||||
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
|
||||
|
||||
deep-freeze-strict@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/deep-freeze-strict/-/deep-freeze-strict-1.1.1.tgz#77d0583ca24a69be4bbd9ac2fae415d55523e5b0"
|
||||
integrity sha1-d9BYPKJKab5LvZrC+uQV1VUj5bA=
|
||||
|
||||
deep-is@~0.1.3:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
|
||||
@ -4913,6 +4951,11 @@ fast-safe-stringify@1.2.0:
|
||||
resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-1.2.0.tgz#ebd42666fd18fe4f2ba4f0d295065f3f85cade96"
|
||||
integrity sha1-69QmZv0Y/k8rpPDSlQZfP4XK3pY=
|
||||
|
||||
fastparse@^1.1.1:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9"
|
||||
integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==
|
||||
|
||||
faye-websocket@^0.10.0:
|
||||
version "0.10.0"
|
||||
resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4"
|
||||
@ -8737,6 +8780,13 @@ ng-packagr@4.3.1:
|
||||
uglify-js "^3.0.7"
|
||||
update-notifier "^2.3.0"
|
||||
|
||||
ngrx-store-freeze@0.2.4:
|
||||
version "0.2.4"
|
||||
resolved "https://registry.yarnpkg.com/ngrx-store-freeze/-/ngrx-store-freeze-0.2.4.tgz#146687cdf7e21244eb9003c7e883f2125847076c"
|
||||
integrity sha512-90awpbbMa/x2H81eWWYniyli3LJ1PZU/FaztL10d9Rp/4kw2+97pqyLjdxSPxcOv9St//m9kfuWZ7gyoVDjgcg==
|
||||
dependencies:
|
||||
deep-freeze-strict "^1.1.1"
|
||||
|
||||
nice-try@^1.0.4:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
|
||||
@ -10523,6 +10573,15 @@ regex-not@^1.0.0, regex-not@^1.0.2:
|
||||
extend-shallow "^3.0.2"
|
||||
safe-regex "^1.1.0"
|
||||
|
||||
regexpu-core@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b"
|
||||
integrity sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=
|
||||
dependencies:
|
||||
regenerate "^1.2.1"
|
||||
regjsgen "^0.2.0"
|
||||
regjsparser "^0.1.4"
|
||||
|
||||
regexpu-core@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240"
|
||||
@ -11082,6 +11141,13 @@ semver-diff@^2.0.0:
|
||||
dependencies:
|
||||
semver "^5.0.3"
|
||||
|
||||
semver-dsl@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/semver-dsl/-/semver-dsl-1.0.1.tgz#d3678de5555e8a61f629eed025366ae5f27340a0"
|
||||
integrity sha1-02eN5VVeimH2Ke7QJTZq5fJzQKA=
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
semver-intersect@1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/semver-intersect/-/semver-intersect-1.4.0.tgz#bdd9c06bedcdd2fedb8cd352c3c43ee8c61321f3"
|
||||
@ -11617,6 +11683,11 @@ split@^1.0.0:
|
||||
dependencies:
|
||||
through "2"
|
||||
|
||||
sprintf-js@^1.1.1:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673"
|
||||
integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==
|
||||
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
@ -12092,7 +12163,7 @@ through2@^2.0.0, through2@^2.0.2:
|
||||
readable-stream "^2.1.5"
|
||||
xtend "~4.0.1"
|
||||
|
||||
through@2, "through@>=2.2.7 <3", through@^2.3.6:
|
||||
through@2, "through@>=2.2.7 <3", through@X.X.X, through@^2.3.6:
|
||||
version "2.3.8"
|
||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user