@nx/angular 16.5.1 → 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/migrations.json +6 -0
- package/package.json +10 -10
- package/src/executors/ng-packagr-lite/schema.json +5 -7
- package/src/executors/package/schema.d.ts +10 -0
- package/src/executors/package/schema.json +5 -7
- package/src/generators/application/lib/add-unit-test-runner.js +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +1 -1
- package/src/generators/library/library.js +1 -1
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts +2 -0
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +39 -0
package/migrations.json
CHANGED
|
@@ -263,6 +263,12 @@
|
|
|
263
263
|
},
|
|
264
264
|
"description": "Update the @angular/cli package version to ~16.1.0.",
|
|
265
265
|
"factory": "./src/migrations/update-16-4-0/update-angular-cli"
|
|
266
|
+
},
|
|
267
|
+
"explicitly-set-projects-to-update-buildable-deps": {
|
|
268
|
+
"cli": "nx",
|
|
269
|
+
"version": "16.6.0-beta.0",
|
|
270
|
+
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
|
|
271
|
+
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps"
|
|
266
272
|
}
|
|
267
273
|
},
|
|
268
274
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "16.
|
|
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,14 +66,14 @@
|
|
|
66
66
|
"migrations": "./migrations.json"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@nrwl/angular": "16.
|
|
70
|
-
"@nx/cypress": "16.
|
|
71
|
-
"@nx/devkit": "16.
|
|
72
|
-
"@nx/jest": "16.
|
|
73
|
-
"@nx/js": "16.
|
|
74
|
-
"@nx/linter": "16.
|
|
75
|
-
"@nx/webpack": "16.
|
|
76
|
-
"@nx/workspace": "16.
|
|
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",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"module": "fesm2022/nx-angular.mjs",
|
|
111
111
|
"typings": "index.d.ts",
|
|
112
112
|
"sideEffects": false,
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "cf9f5cbe6a7ce3b916ec6505dc8488f669cbc52b"
|
|
114
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":
|
|
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":
|
|
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.
|
|
11
|
+
yield (0, jest_1.configurationGenerator)(host, {
|
|
12
12
|
project: options.name,
|
|
13
13
|
setupFile: 'angular',
|
|
14
14
|
supportTsx: false,
|
|
@@ -18,7 +18,7 @@ const module_info_1 = require("../utils/storybook-ast/module-info");
|
|
|
18
18
|
function cypressComponentConfiguration(tree, options) {
|
|
19
19
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
21
|
-
const installTask = yield (0, cypress_1.
|
|
21
|
+
const installTask = yield (0, cypress_1.componentConfigurationGenerator)(tree, {
|
|
22
22
|
project: options.project,
|
|
23
23
|
skipFormat: true,
|
|
24
24
|
});
|
|
@@ -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.
|
|
84
|
+
yield (0, jest_1.configurationGenerator)(host, {
|
|
85
85
|
project: options.name,
|
|
86
86
|
setupFile: 'angular',
|
|
87
87
|
supportTsx: false,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const executors = new Set([
|
|
6
|
+
'@nx/angular:ng-packagr-lite',
|
|
7
|
+
'@nrwl/angular:ng-packagr-lite',
|
|
8
|
+
'@nx/angular:package',
|
|
9
|
+
'@nrwl/angular:package',
|
|
10
|
+
]);
|
|
11
|
+
function default_1(tree) {
|
|
12
|
+
var _a;
|
|
13
|
+
var _b;
|
|
14
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
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') {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
for (const [targetName, target] of Object.entries(projectData.targets || {})) {
|
|
22
|
+
if (!executors.has(target.executor)) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (!target.options ||
|
|
26
|
+
target.options.updateBuildableProjectDepsInPackageJson === undefined) {
|
|
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);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.default = default_1;
|