@nx/angular 16.6.0-beta.0 → 16.6.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.
package/ng-package.json CHANGED
@@ -25,7 +25,8 @@
25
25
  "webpack",
26
26
  "http-server",
27
27
  "magic-string",
28
- "enquirer"
28
+ "enquirer",
29
+ "find-cache-dir"
29
30
  ],
30
31
  "keepLifecycleScripts": true
31
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "16.6.0-beta.0",
3
+ "version": "16.6.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -66,19 +66,20 @@
66
66
  "migrations": "./migrations.json"
67
67
  },
68
68
  "dependencies": {
69
- "@nrwl/angular": "16.6.0-beta.0",
70
- "@nx/cypress": "16.6.0-beta.0",
71
- "@nx/devkit": "16.6.0-beta.0",
72
- "@nx/jest": "16.6.0-beta.0",
73
- "@nx/js": "16.6.0-beta.0",
74
- "@nx/linter": "16.6.0-beta.0",
75
- "@nx/webpack": "16.6.0-beta.0",
76
- "@nx/workspace": "16.6.0-beta.0",
69
+ "@nrwl/angular": "16.6.0-beta.1",
70
+ "@nx/cypress": "16.6.0-beta.1",
71
+ "@nx/devkit": "16.6.0-beta.1",
72
+ "@nx/jest": "16.6.0-beta.1",
73
+ "@nx/js": "16.6.0-beta.1",
74
+ "@nx/linter": "16.6.0-beta.1",
75
+ "@nx/webpack": "16.6.0-beta.1",
76
+ "@nx/workspace": "16.6.0-beta.1",
77
77
  "@phenomnomnominal/tsquery": "~5.0.1",
78
78
  "@typescript-eslint/type-utils": "^5.36.1",
79
79
  "chalk": "^4.1.0",
80
80
  "chokidar": "^3.5.1",
81
81
  "enquirer": "^2.3.6",
82
+ "find-cache-dir": "^3.3.2",
82
83
  "http-server": "^14.1.0",
83
84
  "ignore": "^5.0.4",
84
85
  "magic-string": "~0.26.2",
@@ -109,5 +110,5 @@
109
110
  "module": "fesm2022/nx-angular.mjs",
110
111
  "typings": "index.d.ts",
111
112
  "sideEffects": false,
112
- "gitHead": "5a7ffb93c9e84bffbf52f6ae9c6c1e3b8edb9d35"
113
+ "gitHead": "cf9f5cbe6a7ce3b916ec6505dc8488f669cbc52b"
113
114
  }
@@ -13,11 +13,7 @@
13
13
  },
14
14
  {
15
15
  "name": "Updating Project Dependencies for Buildable Library",
16
- "keys": [
17
- "project",
18
- "updateBuildableProjectDepsInPackageJson",
19
- "buildableProjectDepsInPackageJsonType"
20
- ]
16
+ "keys": ["project"]
21
17
  }
22
18
  ],
23
19
  "properties": {
@@ -40,13 +36,15 @@
40
36
  "updateBuildableProjectDepsInPackageJson": {
41
37
  "type": "boolean",
42
38
  "description": "Whether to update the buildable project dependencies in the build output package.json.",
43
- "default": false
39
+ "default": false,
40
+ "x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
44
41
  },
45
42
  "buildableProjectDepsInPackageJsonType": {
46
43
  "type": "string",
47
44
  "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
48
45
  "enum": ["dependencies", "peerDependencies"],
49
- "default": "peerDependencies"
46
+ "default": "peerDependencies",
47
+ "x-deprecated": "Configure the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
50
48
  },
51
49
  "tailwindConfig": {
52
50
  "type": "string",
@@ -1,8 +1,18 @@
1
1
  export interface BuildAngularLibraryExecutorOptions {
2
2
  project: string;
3
+ /**
4
+ * @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
5
+ * rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
6
+ * It will be removed in v17.
7
+ */
3
8
  buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
4
9
  tailwindConfig?: string;
5
10
  tsConfig?: string;
11
+ /**
12
+ * @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
13
+ * rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
14
+ * It will be removed in v17.
15
+ */
6
16
  updateBuildableProjectDepsInPackageJson?: boolean;
7
17
  watch?: boolean;
8
18
  }
@@ -13,11 +13,7 @@
13
13
  },
14
14
  {
15
15
  "name": "Updating Project Dependencies for Publishable Library",
16
- "keys": [
17
- "project",
18
- "updateBuildableProjectDepsInPackageJson",
19
- "buildableProjectDepsInPackageJsonType"
20
- ]
16
+ "keys": ["project"]
21
17
  }
22
18
  ],
23
19
  "properties": {
@@ -40,13 +36,15 @@
40
36
  "updateBuildableProjectDepsInPackageJson": {
41
37
  "type": "boolean",
42
38
  "description": "Whether to update the buildable project dependencies in the build output package.json.",
43
- "default": false
39
+ "default": false,
40
+ "x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
44
41
  },
45
42
  "buildableProjectDepsInPackageJsonType": {
46
43
  "type": "string",
47
44
  "description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
48
45
  "enum": ["dependencies", "peerDependencies"],
49
- "default": "peerDependencies"
46
+ "default": "peerDependencies",
47
+ "x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
50
48
  },
51
49
  "tailwindConfig": {
52
50
  "type": "string",
@@ -8,7 +8,7 @@ const test_runners_1 = require("../../../utils/test-runners");
8
8
  function addUnitTestRunner(host, options) {
9
9
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
10
  if (options.unitTestRunner === test_runners_1.UnitTestRunner.Jest) {
11
- yield (0, jest_1.jestProjectGenerator)(host, {
11
+ yield (0, jest_1.configurationGenerator)(host, {
12
12
  project: options.name,
13
13
  setupFile: 'angular',
14
14
  supportTsx: false,
@@ -81,7 +81,7 @@ exports.libraryGenerator = libraryGenerator;
81
81
  function addUnitTestRunner(host, options) {
82
82
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
83
83
  if (options.unitTestRunner === 'jest') {
84
- yield (0, jest_1.jestProjectGenerator)(host, {
84
+ yield (0, jest_1.configurationGenerator)(host, {
85
85
  project: options.name,
86
86
  setupFile: 'angular',
87
87
  supportTsx: false,
@@ -9,26 +9,29 @@ const executors = new Set([
9
9
  '@nrwl/angular:package',
10
10
  ]);
11
11
  function default_1(tree) {
12
+ var _a;
13
+ var _b;
12
14
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
- const projects = (0, devkit_1.getProjects)(tree);
14
- for (const [projectName, project] of projects) {
15
- if (project.projectType !== 'library') {
15
+ // use project graph to get the expanded target configurations
16
+ const projectGraph = yield (0, devkit_1.createProjectGraphAsync)();
17
+ for (const [projectName, { data: projectData }] of Object.entries(projectGraph.nodes)) {
18
+ if (projectData.projectType !== 'library') {
16
19
  continue;
17
20
  }
18
- let updated = false;
19
- for (const [, target] of Object.entries(project.targets || {})) {
21
+ for (const [targetName, target] of Object.entries(projectData.targets || {})) {
20
22
  if (!executors.has(target.executor)) {
21
23
  continue;
22
24
  }
23
- if (target.options &&
25
+ if (!target.options ||
24
26
  target.options.updateBuildableProjectDepsInPackageJson === undefined) {
25
- target.options.updateBuildableProjectDepsInPackageJson = true;
26
- updated = true;
27
+ // read the project configuration to write the explicit project configuration
28
+ // and avoid writing the expanded target configuration
29
+ const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
30
+ (_a = (_b = project.targets[targetName]).options) !== null && _a !== void 0 ? _a : (_b.options = {});
31
+ project.targets[targetName].options.updateBuildableProjectDepsInPackageJson = true;
32
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
27
33
  }
28
34
  }
29
- if (updated) {
30
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
31
- }
32
35
  }
33
36
  yield (0, devkit_1.formatFiles)(tree);
34
37
  });