@nrwl/nx-plugin 14.8.8 → 14.9.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/LICENSE +22 -22
  3. package/README.md +5 -26
  4. package/migrations.json +18 -15
  5. package/package.json +8 -7
  6. package/src/executors/e2e/e2e.impl.js +30 -15
  7. package/src/executors/e2e/e2e.impl.js.map +1 -1
  8. package/src/executors/e2e/schema.json +26 -8
  9. package/src/generators/e2e-project/e2e.d.ts +2 -1
  10. package/src/generators/e2e-project/e2e.js +33 -9
  11. package/src/generators/e2e-project/e2e.js.map +1 -1
  12. package/src/generators/e2e-project/schema.d.ts +3 -1
  13. package/src/generators/e2e-project/schema.json +16 -11
  14. package/src/generators/executor/files/executor/__fileName__/schema.json__tmpl__ +1 -0
  15. package/src/generators/executor/schema.json +5 -4
  16. package/src/generators/generator/files/generator/__fileName__/generator.spec.ts__tmpl__ +1 -1
  17. package/src/generators/generator/files/generator/__fileName__/schema.json__tmpl__ +1 -2
  18. package/src/generators/generator/generator.js +4 -0
  19. package/src/generators/generator/generator.js.map +1 -1
  20. package/src/generators/generator/schema.json +4 -2
  21. package/src/generators/lint-checks/generator.js +3 -0
  22. package/src/generators/lint-checks/generator.js.map +1 -1
  23. package/src/generators/lint-checks/schema.json +2 -1
  24. package/src/generators/migration/schema.json +7 -5
  25. package/src/generators/plugin/plugin.js +3 -4
  26. package/src/generators/plugin/plugin.js.map +1 -1
  27. package/src/generators/plugin/schema.d.ts +0 -1
  28. package/src/generators/plugin/schema.json +15 -11
  29. package/src/generators/plugin/utils/normalize-schema.d.ts +1 -0
  30. package/src/generators/plugin/utils/normalize-schema.js +10 -9
  31. package/src/generators/plugin/utils/normalize-schema.js.map +1 -1
  32. package/src/migrations/update-15-0-0/specify-output-capture.d.ts +2 -0
  33. package/src/migrations/update-15-0-0/specify-output-capture.js +57 -0
  34. package/src/migrations/update-15-0-0/specify-output-capture.js.map +1 -0
  35. package/src/migrations/update-15-9-0/jest-29-configs.d.ts +3 -0
  36. package/src/migrations/update-15-9-0/jest-29-configs.js +154 -0
  37. package/src/migrations/update-15-9-0/jest-29-configs.js.map +1 -0
  38. package/src/migrations/update-15-9-0/jest-29-tests.d.ts +5 -0
  39. package/src/migrations/update-15-9-0/jest-29-tests.js +65 -0
  40. package/src/migrations/update-15-9-0/jest-29-tests.js.map +1 -0
  41. package/src/utils/testing-utils/async-commands.d.ts +5 -2
  42. package/src/utils/testing-utils/async-commands.js +12 -2
  43. package/src/utils/testing-utils/async-commands.js.map +1 -1
  44. package/src/utils/testing-utils/commands.d.ts +6 -2
  45. package/src/utils/testing-utils/commands.js +20 -5
  46. package/src/utils/testing-utils/commands.js.map +1 -1
  47. package/src/migrations/update-10-2-0/update-10-2-0.d.ts +0 -2
  48. package/src/migrations/update-10-2-0/update-10-2-0.js +0 -26
  49. package/src/migrations/update-10-2-0/update-10-2-0.js.map +0 -1
  50. package/src/migrations/update-11-0-0/rename-ng-update-into-nx-migrate.d.ts +0 -1
  51. package/src/migrations/update-11-0-0/rename-ng-update-into-nx-migrate.js +0 -16
  52. package/src/migrations/update-11-0-0/rename-ng-update-into-nx-migrate.js.map +0 -1
  53. package/src/migrations/update-11-0-0/update-schema-version-for-executors-and-generators.d.ts +0 -1
  54. package/src/migrations/update-11-0-0/update-schema-version-for-executors-and-generators.js +0 -20
  55. package/src/migrations/update-11-0-0/update-schema-version-for-executors-and-generators.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [14.8.8](https://github.com/nrwl/nx/compare/14.8.7...14.8.8) (2023-03-14)
6
+
7
7
 
8
8
  **Note:** Version bump only for package @nrwl/nx-plugin
package/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2017-2022 Narwhal Technologies Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- 'Software'), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2017-2023 Narwhal Technologies Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -47,40 +47,19 @@ npm init nx-workspace
47
47
  yarn create nx-workspace
48
48
  ```
49
49
 
50
- The `create-nx-workspace` command will ask you to select a preset, which will configure some plugins and create your applications to help you get started.
51
-
52
- ```
53
- ? What to create in the new workspace (Use arrow keys)
54
- ❯ apps [an empty workspace with no plugins with a layout that works best for building apps]
55
- core [an empty workspace with no plugins set up to publish npm packages (similar to yarn workspaces)]
56
- ts [an empty workspace with the JS/TS plugin preinstalled]
57
- react [a workspace with a single React application]
58
- angular [a workspace with a single Angular application]
59
- next.js [a workspace with a single Next.js application]
60
- nest [a workspace with a single Nest application]
61
- express [a workspace with a single Express application]
62
- web components [a workspace with a single app built using web components]
63
- react-native [a workspace with a single React Native application]
64
- react-express [a workspace with a full stack application (React + Express)]
65
- ```
66
-
67
- Select the preset that works best for you
68
-
69
- ### Adding Nx to an Existing Monorepo
50
+ ### Adding Nx to an Existing Repository
70
51
 
71
52
  Run:
72
53
 
73
54
  ```bash
74
- npx add-nx-to-monorepo@latest
55
+ npx nx@latest init
75
56
  ```
76
57
 
77
58
  ## Documentation & Resources
78
59
 
79
- A few links to help you get started:
80
-
81
- - [Nx.Dev: Documentation, Guides, Interactive Tutorials](https://nx.dev)
82
- - [Tutorial: Adding Nx to an Existing Monorepo](/recipe/adding-to-monorepo)
83
- - [Official Nx YouTube Channel](https://www.youtube.com/c/Nrwl_io)
60
+ - [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
61
+ - [Intro to Nx](https://nx.dev/getting-started/intro)
62
+ - [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
84
63
  - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
85
64
 
86
65
  <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
package/migrations.json CHANGED
@@ -1,20 +1,5 @@
1
1
  {
2
2
  "schematics": {
3
- "update-10.2.0": {
4
- "version": "10.2.0",
5
- "description": "Remove deprecated jest builder options",
6
- "factory": "./src/migrations/update-10-2-0/update-10-2-0"
7
- },
8
- "rename-ng-update-into-nx-migrate": {
9
- "version": "11.0.0-beta.4",
10
- "description": "Rename ng-update into nx-migrate",
11
- "factory": "./src/migrations/update-11-0-0/rename-ng-update-into-nx-migrate"
12
- },
13
- "update-schema-version-for-executors-and-generators": {
14
- "version": "11.0.17",
15
- "description": "Update schema versions for executors and generators",
16
- "factory": "./src/migrations/update-11-0-0/update-schema-version-for-executors-and-generators"
17
- },
18
3
  "add-swc-deps": {
19
4
  "cli": "nx",
20
5
  "version": "14.1.9-beta.0",
@@ -26,6 +11,24 @@
26
11
  "version": "14.2.3-beta.0",
27
12
  "description": "Adds @swc/core and @swc-node as a dev dep if you are using them (repeated due to bad version on earlier migration)",
28
13
  "factory": "./src/migrations/update-14-1-9/add-swc-deps-if-needed"
14
+ },
15
+ "update-15-0-0": {
16
+ "cli": "nx",
17
+ "version": "15.0.0-beta.0",
18
+ "description": "Migrates executor schema files to v2",
19
+ "factory": "./src/migrations/update-15-0-0/specify-output-capture"
20
+ },
21
+ "update-configs-jest-29": {
22
+ "version": "15.9.0-beta.0",
23
+ "cli": "nx",
24
+ "description": "Update nx plugin jest configs to support jest 29 changes (https://jestjs.io/docs/upgrading-to-jest29)",
25
+ "factory": "./src/migrations/update-15-9-0/jest-29-configs"
26
+ },
27
+ "update-tests-jest-29": {
28
+ "version": "15.9.0-beta.0",
29
+ "cli": "nx",
30
+ "description": "Update nx plugin jest test files to support jest 29 changes (https://jestjs.io/docs/upgrading-to-jest29)",
31
+ "factory": "./src/migrations/update-15-9-0/jest-29-tests"
29
32
  }
30
33
  }
31
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/nx-plugin",
3
- "version": "14.8.8",
3
+ "version": "14.9.0-beta.1",
4
4
  "private": false,
5
5
  "description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.",
6
6
  "repository": {
@@ -28,16 +28,17 @@
28
28
  "migrations": "./migrations.json"
29
29
  },
30
30
  "dependencies": {
31
- "@nrwl/devkit": "14.8.8",
32
- "@nrwl/jest": "14.8.8",
33
- "@nrwl/js": "14.8.8",
34
- "@nrwl/linter": "14.8.8",
31
+ "@nrwl/devkit": "14.9.0-beta.1",
32
+ "@nrwl/jest": "14.9.0-beta.1",
33
+ "@nrwl/js": "14.9.0-beta.1",
34
+ "@nrwl/linter": "14.9.0-beta.1",
35
+ "@phenomnomnominal/tsquery": "4.1.1",
35
36
  "dotenv": "~10.0.0",
36
- "fs-extra": "^10.1.0",
37
+ "fs-extra": "^11.1.0",
37
38
  "tslib": "^2.3.0"
38
39
  },
39
40
  "publishConfig": {
40
41
  "access": "public"
41
42
  },
42
- "gitHead": "26f7cfdf15ae9c7f90a79789d744b71612951ae4"
43
+ "gitHead": "b2a467bcb2bdc124ed52f3755780bca429a43855"
43
44
  }
@@ -5,27 +5,35 @@ const tslib_1 = require("tslib");
5
5
  require("dotenv/config");
6
6
  const devkit_1 = require("@nrwl/devkit");
7
7
  const jest_impl_1 = require("@nrwl/jest/src/executors/jest/jest.impl");
8
+ // TODO(Caleb & Craigory): can we get rid of this and just use @nrwl/jest directly?
8
9
  function nxPluginE2EExecutor(options, context) {
9
10
  return tslib_1.__asyncGenerator(this, arguments, function* nxPluginE2EExecutor_1() {
10
- var e_1, _a;
11
+ var _a, e_1, _b, _c;
11
12
  const { target } = options, jestOptions = tslib_1.__rest(options, ["target"]);
12
13
  let success;
13
14
  try {
14
- for (var _b = tslib_1.__asyncValues(runBuildTarget(target, context)), _c; _c = yield tslib_1.__await(_b.next()), !_c.done;) {
15
- const _ = _c.value;
15
+ for (var _d = true, _e = tslib_1.__asyncValues(runBuildTarget(target, context)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a;) {
16
+ _c = _f.value;
17
+ _d = false;
16
18
  try {
17
- success = yield tslib_1.__await(runTests(jestOptions, context));
19
+ const _ = _c;
20
+ try {
21
+ success = yield tslib_1.__await(runTests(jestOptions, context));
22
+ }
23
+ catch (e) {
24
+ devkit_1.logger.error(e.message);
25
+ success = false;
26
+ }
18
27
  }
19
- catch (e) {
20
- devkit_1.logger.error(e.message);
21
- success = false;
28
+ finally {
29
+ _d = true;
22
30
  }
23
31
  }
24
32
  }
25
33
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
26
34
  finally {
27
35
  try {
28
- if (_c && !_c.done && (_a = _b.return)) yield tslib_1.__await(_a.call(_b));
36
+ if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
29
37
  }
30
38
  finally { if (e_1) throw e_1.error; }
31
39
  }
@@ -35,22 +43,29 @@ function nxPluginE2EExecutor(options, context) {
35
43
  exports.nxPluginE2EExecutor = nxPluginE2EExecutor;
36
44
  function runBuildTarget(buildTarget, context) {
37
45
  return tslib_1.__asyncGenerator(this, arguments, function* runBuildTarget_1() {
38
- var e_2, _a;
46
+ var _a, e_2, _b, _c;
39
47
  const { project, target, configuration } = (0, devkit_1.parseTargetString)(buildTarget);
40
48
  const buildTargetOptions = (0, devkit_1.readTargetOptions)({ project, target, configuration }, context);
41
49
  const targetSupportsWatch = Object.keys(buildTargetOptions).includes('watch');
42
50
  try {
43
- for (var _b = tslib_1.__asyncValues(yield tslib_1.__await((0, devkit_1.runExecutor)({ project, target, configuration }, targetSupportsWatch ? { watch: false } : {}, context))), _c; _c = yield tslib_1.__await(_b.next()), !_c.done;) {
44
- const output = _c.value;
45
- if (!output.success)
46
- throw new Error('Could not compile application files.');
47
- yield yield tslib_1.__await(output.success);
51
+ for (var _d = true, _e = tslib_1.__asyncValues(yield tslib_1.__await((0, devkit_1.runExecutor)({ project, target, configuration }, targetSupportsWatch ? { watch: false } : {}, context))), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a;) {
52
+ _c = _f.value;
53
+ _d = false;
54
+ try {
55
+ const output = _c;
56
+ if (!output.success)
57
+ throw new Error('Could not compile application files.');
58
+ yield yield tslib_1.__await(output.success);
59
+ }
60
+ finally {
61
+ _d = true;
62
+ }
48
63
  }
49
64
  }
50
65
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
51
66
  finally {
52
67
  try {
53
- if (_c && !_c.done && (_a = _b.return)) yield tslib_1.__await(_a.call(_b));
68
+ if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
54
69
  }
55
70
  finally { if (e_2) throw e_2.error; }
56
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"e2e.impl.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/e2e/e2e.impl.ts"],"names":[],"mappings":";;;;AAAA,yBAAuB;AAIvB,yCAKsB;AAEtB,uEAAuE;AAGvE,SAAuB,mBAAmB,CACxC,OAAmC,EACnC,OAAwB;;;QAExB,MAAM,EAAE,MAAM,KAAqB,OAAO,EAAvB,WAAW,kBAAK,OAAO,EAApC,UAA0B,CAAU,CAAC;QAE3C,IAAI,OAAgB,CAAC;;YACrB,KAAsB,IAAA,KAAA,sBAAA,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA,IAAA;gBAA1C,MAAM,CAAC,WAAA,CAAA;gBAChB,IAAI;oBACF,OAAO,GAAG,sBAAM,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA,CAAC;iBAChD;gBAAC,OAAO,CAAC,EAAE;oBACV,eAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;oBACxB,OAAO,GAAG,KAAK,CAAC;iBACjB;aACF;;;;;;;;;QAED,6BAAO,EAAE,OAAO,EAAE,EAAC;IACrB,CAAC;CAAA;AAj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,KAAA,CAAA;oBAKrB,IAAI,CAAC,MAAM,CAAC,OAAO;wBACjB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;oBAC1D,4BAAM,MAAM,CAAC,OAAO,CAAA,CAAC;;;;;aACtB;;;;;;;;;IACH,CAAC;CAAA;AAED,SAAe,QAAQ,CACrB,WAAgC,EAChC,OAAwB;;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,wBAAY,kCAC/B,WAAW,KAAE,KAAK,EAAE,KAAK,KAC9B,OAAO,CACR,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AAED,kBAAe,mBAAmB,CAAC"}
@@ -1,4 +1,6 @@
1
1
  {
2
+ "version": 2,
3
+ "outputCapture": "direct-nodejs",
2
4
  "title": "Nx Plugin Playground Target",
3
5
  "description": "Creates a playground for a Nx Plugin.",
4
6
  "cli": "nx",
@@ -6,22 +8,24 @@
6
8
  "properties": {
7
9
  "target": {
8
10
  "description": "The build target for the Nx Plugin project.",
9
- "type": "string"
11
+ "type": "string",
12
+ "x-priority": "important"
10
13
  },
11
14
  "jestConfig": {
12
15
  "type": "string",
13
16
  "description": "Jest config file.",
14
17
  "x-completion-type": "file",
15
- "x-completion-glob": "jest.config@(.js|.ts)"
18
+ "x-completion-glob": "jest.config@(.js|.ts)",
19
+ "x-priority": "important"
16
20
  },
17
21
  "tsSpecConfig": {
18
22
  "type": "string",
19
23
  "description": "The tsconfig file for specs.",
20
24
  "x-deprecated": "Use the `tsconfig` property for `ts-jest` in the e2e project `jest.config.js` file. It will be removed in the next major release.",
21
25
  "x-completion-type": "file",
22
- "x-completion-glob": "tsconfig.*.json"
26
+ "x-completion-glob": "tsconfig.*.json",
27
+ "x-priority": "important"
23
28
  },
24
-
25
29
  "codeCoverage": {
26
30
  "description": "Indicates that test coverage information should be collected and reported in the output. (https://jestjs.io/docs/cli#--coverageboolean)",
27
31
  "type": "boolean",
@@ -56,17 +60,24 @@
56
60
  "tsConfig": {
57
61
  "description": "The name of the Typescript configuration file. Set the tsconfig option in the jest config file. ",
58
62
  "type": "string",
59
- "x-deprecated": true
63
+ "x-deprecated": "Use the ts-jest configuration options in the jest config file instead."
60
64
  },
61
65
  "setupFile": {
62
66
  "description": "The name of a setup file used by Jest. (use Jest config file https://jestjs.io/docs/en/configuration#setupfilesafterenv-array)",
63
67
  "type": "string",
64
- "x-deprecated": true
68
+ "x-deprecated": "Use the setupFilesAfterEnv option in the jest config file. https://jestjs.io/docs/en/configuration#setupfilesafterenv-array"
65
69
  },
66
70
  "bail": {
67
71
  "alias": "b",
68
72
  "description": "Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/cli#--bail)",
69
- "oneOf": [{ "type": "number" }, { "type": "boolean" }]
73
+ "oneOf": [
74
+ {
75
+ "type": "number"
76
+ },
77
+ {
78
+ "type": "boolean"
79
+ }
80
+ ]
70
81
  },
71
82
  "ci": {
72
83
  "description": "Whether to run Jest in continuous integration (CI) mode. This option is on by default in most popular CI environments. It will prevent snapshots from being written unless explicitly requested. (https://jestjs.io/docs/cli#--ci)",
@@ -88,7 +99,14 @@
88
99
  "maxWorkers": {
89
100
  "alias": "w",
90
101
  "description": "Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. Useful for CI. (its usually best not to override this default) (https://jestjs.io/docs/cli#--maxworkersnumstring)",
91
- "oneOf": [{ "type": "number" }, { "type": "string" }]
102
+ "oneOf": [
103
+ {
104
+ "type": "number"
105
+ },
106
+ {
107
+ "type": "string"
108
+ }
109
+ ]
92
110
  },
93
111
  "onlyChanged": {
94
112
  "alias": "o",
@@ -1,5 +1,6 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
+ import { GeneratorCallback } from '@nrwl/devkit';
2
3
  import type { Schema } from './schema';
3
- export declare function e2eProjectGenerator(host: Tree, schema: Schema): Promise<void>;
4
+ export declare function e2eProjectGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
4
5
  export default e2eProjectGenerator;
5
6
  export declare const e2eProjectSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
@@ -4,18 +4,20 @@ exports.e2eProjectSchematic = exports.e2eProjectGenerator = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
6
  const jest_1 = require("@nrwl/jest");
7
- const typescript_1 = require("@nrwl/workspace/src/utilities/typescript");
7
+ const js_1 = require("@nrwl/js");
8
8
  const path = require("path");
9
+ const linter_1 = require("@nrwl/linter");
9
10
  function normalizeOptions(host, options) {
10
- var _a;
11
- const { npmScope, appsDir } = (0, devkit_1.getWorkspaceLayout)(host);
11
+ var _a, _b;
12
+ const { layoutDirectory, projectDirectory } = (0, devkit_1.extractLayoutDirectory)(options.projectDirectory);
13
+ const { npmScope, appsDir: defaultAppsDir } = (0, devkit_1.getWorkspaceLayout)(host);
14
+ const appsDir = layoutDirectory !== null && layoutDirectory !== void 0 ? layoutDirectory : defaultAppsDir;
12
15
  const projectName = `${options.pluginName}-e2e`;
13
- const projectRoot = options.projectDirectory
14
- ? (0, devkit_1.joinPathFragments)(appsDir, `${options.projectDirectory}-e2e`)
16
+ const projectRoot = projectDirectory
17
+ ? (0, devkit_1.joinPathFragments)(appsDir, `${projectDirectory}-e2e`)
15
18
  : (0, devkit_1.joinPathFragments)(appsDir, projectName);
16
19
  const pluginPropertyName = (0, devkit_1.names)(options.pluginName).propertyName;
17
- return Object.assign(Object.assign({}, options), { minimal: (_a = options.minimal) !== null && _a !== void 0 ? _a : false, projectName,
18
- pluginPropertyName,
20
+ return Object.assign(Object.assign({}, options), { minimal: (_a = options.minimal) !== null && _a !== void 0 ? _a : false, projectName, linter: (_b = options.linter) !== null && _b !== void 0 ? _b : linter_1.Linter.EsLint, pluginPropertyName,
19
21
  projectRoot,
20
22
  npmScope });
21
23
  }
@@ -28,7 +30,7 @@ function validatePlugin(host, pluginName) {
28
30
  }
29
31
  }
30
32
  function addFiles(host, options) {
31
- (0, devkit_1.generateFiles)(host, path.join(__dirname, './files'), options.projectRoot, Object.assign(Object.assign({}, options), { tmpl: '', rootTsConfigPath: (0, typescript_1.getRelativePathToRootTsConfig)(host, options.projectRoot) }));
33
+ (0, devkit_1.generateFiles)(host, path.join(__dirname, './files'), options.projectRoot, Object.assign(Object.assign({}, options), { tmpl: '', rootTsConfigPath: (0, js_1.getRelativePathToRootTsConfig)(host, options.projectRoot) }));
32
34
  }
33
35
  function updateWorkspaceConfiguration(host, options) {
34
36
  (0, devkit_1.addProjectConfiguration)(host, options.projectName, {
@@ -43,7 +45,7 @@ function updateWorkspaceConfiguration(host, options) {
43
45
  },
44
46
  tags: [],
45
47
  implicitDependencies: [options.pluginName],
46
- }, options.standaloneConfig);
48
+ });
47
49
  }
48
50
  function addJest(host, options) {
49
51
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -62,14 +64,36 @@ function addJest(host, options) {
62
64
  (0, devkit_1.updateProjectConfiguration)(host, options.projectName, project);
63
65
  });
64
66
  }
67
+ function addLintingToApplication(tree, options) {
68
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
69
+ const lintTask = yield (0, linter_1.lintProjectGenerator)(tree, {
70
+ linter: options.linter,
71
+ project: options.projectName,
72
+ tsConfigPaths: [
73
+ (0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.app.json'),
74
+ ],
75
+ eslintFilePatterns: [`${options.projectRoot}/**/*.ts`],
76
+ unitTestRunner: 'jest',
77
+ skipFormat: true,
78
+ setParserOptionsProject: false,
79
+ });
80
+ return lintTask;
81
+ });
82
+ }
65
83
  function e2eProjectGenerator(host, schema) {
66
84
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
85
+ const tasks = [];
67
86
  validatePlugin(host, schema.pluginName);
68
87
  const options = normalizeOptions(host, schema);
69
88
  addFiles(host, options);
70
89
  updateWorkspaceConfiguration(host, options);
71
90
  yield addJest(host, options);
91
+ if (options.linter !== linter_1.Linter.None) {
92
+ const lintTask = yield addLintingToApplication(host, Object.assign({}, options));
93
+ tasks.push(lintTask);
94
+ }
72
95
  yield (0, devkit_1.formatFiles)(host);
96
+ return (0, devkit_1.runTasksInSerial)(...tasks);
73
97
  });
74
98
  }
75
99
  exports.e2eProjectGenerator = e2eProjectGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"e2e.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/e2e-project/e2e.ts"],"names":[],"mappings":";;;;AAAA,yCAUsB;AACtB,qCAAkD;AAClD,yEAAyF;AACzF,6BAA6B;AAY7B,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAAe;;IACnD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;IAEvD,MAAM,WAAW,GAAG,GAAG,OAAO,CAAC,UAAU,MAAM,CAAC;IAChD,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB;QAC1C,CAAC,CAAC,IAAA,0BAAiB,EAAC,OAAO,EAAE,GAAG,OAAO,CAAC,gBAAgB,MAAM,CAAC;QAC/D,CAAC,CAAC,IAAA,0BAAiB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC5C,MAAM,kBAAkB,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC;IAElE,uCACK,OAAO,KACV,OAAO,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,KAAK,EACjC,WAAW;QACX,kBAAkB;QAClB,WAAW;QACX,QAAQ,IACR;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,IAAU,EAAE,UAAkB;IACpD,IAAI;QACF,IAAA,iCAAwB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;KAC5C;IAAC,WAAM;QACN,MAAM,IAAI,KAAK,CAAC,iBAAiB,UAAU,sBAAsB,CAAC,CAAC;KACpE;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,IAAU,EAAE,OAAyB;IACrD,IAAA,sBAA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;aAC5D;YACD,kBAAkB,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,UAAU,CAAC;YACtD,cAAc,EAAE,MAAM;YACtB,UAAU,EAAE,IAAI;YAChB,uBAAuB,EAAE,KAAK;SAC/B,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAED,SAAsB,mBAAmB,CAAC,IAAU,EAAE,MAAc;;QAClE,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxB,4BAA4B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC5C,MAAM,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE7B,IAAI,OAAO,CAAC,MAAM,KAAK,eAAM,CAAC,IAAI,EAAE;YAClC,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAAC,IAAI,oBAC9C,OAAO,EACV,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACtB;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAnBD,kDAmBC;AAED,kBAAe,mBAAmB,CAAC;AACtB,QAAA,mBAAmB,GAAG,IAAA,2BAAkB,EAAC,mBAAmB,CAAC,CAAC"}
@@ -1,9 +1,11 @@
1
+ import { Linter } from '@nrwl/linter';
2
+
1
3
  export interface Schema {
2
4
  pluginName: string;
3
5
  npmPackageName: string;
4
6
  projectDirectory?: string;
5
7
  pluginOutputPath?: string;
6
8
  jestConfig?: string;
7
- standaloneConfig?: boolean;
8
9
  minimal?: boolean;
10
+ linter?: Linter;
9
11
  }
@@ -8,11 +8,13 @@
8
8
  "properties": {
9
9
  "pluginName": {
10
10
  "type": "string",
11
- "description": "the name of the plugin to be tested."
11
+ "description": "the project name of the plugin to be tested.",
12
+ "x-priority": "important"
12
13
  },
13
14
  "npmPackageName": {
14
15
  "type": "string",
15
- "description": "the name of the package that would be published to NPM."
16
+ "description": "the package name of the plugin as it would be published to NPM.",
17
+ "x-priority": "important"
16
18
  },
17
19
  "projectDirectory": {
18
20
  "type": "string",
@@ -20,20 +22,24 @@
20
22
  },
21
23
  "pluginOutputPath": {
22
24
  "type": "string",
23
- "description": "the output path of the plugin after it builds."
25
+ "description": "the output path of the plugin after it builds.",
26
+ "x-priority": "important"
24
27
  },
25
28
  "jestConfig": {
26
29
  "type": "string",
27
30
  "description": "Jest config file."
28
31
  },
29
- "tsSpecConfig": {
30
- "type": "string",
31
- "description": "Spec `tsconfig` file.",
32
- "x-deprecated": true
33
- },
34
32
  "standaloneConfig": {
35
33
  "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
36
- "type": "boolean"
34
+ "type": "boolean",
35
+ "default": true,
36
+ "x-deprecated": "Nx only supports standaloneConfig"
37
+ },
38
+ "linter": {
39
+ "description": "The tool to use for running lint checks.",
40
+ "type": "string",
41
+ "enum": ["eslint", "none"],
42
+ "default": "eslint"
37
43
  },
38
44
  "minimal": {
39
45
  "type": "boolean",
@@ -41,6 +47,5 @@
41
47
  "default": false
42
48
  }
43
49
  },
44
- "required": ["pluginName", "npmPackageName"],
45
- "additionalProperties": false
50
+ "required": ["pluginName", "npmPackageName"]
46
51
  }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/schema",
3
+ "version": 2,
3
4
  "cli": "nx",
4
5
  "title": "<%= className %> executor",
5
6
  "description": "",
@@ -19,7 +19,8 @@
19
19
  "$default": {
20
20
  "$source": "projectName"
21
21
  },
22
- "x-prompt": "What is the name of the project for the executor?"
22
+ "x-prompt": "What is the name of the project for the executor?",
23
+ "x-priority": "important"
23
24
  },
24
25
  "name": {
25
26
  "type": "string",
@@ -28,12 +29,12 @@
28
29
  "$source": "argv",
29
30
  "index": 0
30
31
  },
31
- "x-prompt": "What name would you like to use for the executor?"
32
+ "x-prompt": "What name would you like to use for the executor?",
33
+ "x-priority": "important"
32
34
  },
33
35
  "description": {
34
36
  "type": "string",
35
- "description": "Executor description.",
36
- "alias": "d"
37
+ "description": "Executor description."
37
38
  },
38
39
  "unitTestRunner": {
39
40
  "type": "string",
@@ -9,7 +9,7 @@ describe('<%= name %> generator', () => {
9
9
  const options: <%= className %>GeneratorSchema = { name: 'test' };
10
10
 
11
11
  beforeEach(() => {
12
- appTree = createTreeWithEmptyWorkspace();
12
+ appTree = createTreeWithEmptyWorkspace({layout: 'apps-libs'});
13
13
  });
14
14
 
15
15
  it('should run successfully', async () => {
@@ -21,8 +21,7 @@
21
21
  },
22
22
  "directory": {
23
23
  "type": "string",
24
- "description": "A directory where the project is placed",
25
- "alias": "d"
24
+ "description": "A directory where the project is placed"
26
25
  }
27
26
  },
28
27
  "required": ["name"]
@@ -67,6 +67,10 @@ function updateGeneratorJson(host, options) {
67
67
  schema: `./src/generators/${options.fileName}/schema.json`,
68
68
  description: options.description,
69
69
  };
70
+ // @todo(v17): Remove this, prop is defunct.
71
+ if (options.name === 'preset') {
72
+ generators[options.name]['x-use-standalone-layout'] = true;
73
+ }
70
74
  json.generators = generators;
71
75
  return json;
72
76
  });
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/generator/generator.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AACtB,yCAQsB;AAEtB,6BAA6B;AAY7B,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAAe;IACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAA,cAAK,EAAC,OAAO,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,GAAG,UAAU,IAAI,EAAE,CAAC;QAC9B,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG;YACzB,OAAO,EAAE,oBAAoB,OAAO,CAAC,QAAQ,YAAY;YACzD,MAAM,EAAE,oBAAoB,OAAO,CAAC,QAAQ,cAAc;YAC1D,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAsB,kBAAkB,CAAC,IAAU,EAAE,MAAc;;QACjE,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE/C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAExB,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;CAAA;AAND,gDAMC;AAED,kBAAe,kBAAkB,CAAC;AACrB,QAAA,kBAAkB,GAAG,IAAA,2BAAkB,EAAC,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/generator/generator.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AACtB,yCAQsB;AAEtB,6BAA6B;AAY7B,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAAe;IACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACxD,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAElD,MAAM,cAAc,GAAG,IAAA,iBAAQ,EAC7B,IAAI,EACJ,IAA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ACjC,CAAC;QACF,4CAA4C;QAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC7B,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC;SAC5D;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAsB,kBAAkB,CAAC,IAAU,EAAE,MAAc;;QACjE,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE/C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAExB,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;CAAA;AAND,gDAMC;AAED,kBAAe,kBAAkB,CAAC;AACrB,QAAA,kBAAkB,GAAG,IAAA,2BAAkB,EAAC,kBAAkB,CAAC,CAAC"}
@@ -19,7 +19,8 @@
19
19
  "$default": {
20
20
  "$source": "projectName"
21
21
  },
22
- "x-prompt": "What is the name of the project for the generator?"
22
+ "x-prompt": "What is the name of the project for the generator?",
23
+ "x-priority": "important"
23
24
  },
24
25
  "name": {
25
26
  "type": "string",
@@ -28,7 +29,8 @@
28
29
  "$source": "argv",
29
30
  "index": 0
30
31
  },
31
- "x-prompt": "What name would you like to use for the generator?"
32
+ "x-prompt": "What name would you like to use for the generator?",
33
+ "x-priority": "important"
32
34
  },
33
35
  "description": {
34
36
  "type": "string",