@nx/angular 16.5.0 → 16.6.0-beta.0
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/builders/module-federation-dev-server/module-federation-dev-server.impl.js +3 -0
- package/src/builders/module-federation-dev-server/schema.json +1 -1
- package/src/builders/module-federation-dev-ssr/schema.json +1 -1
- package/src/builders/utilities/module-federation.js +23 -12
- package/src/executors/ng-packagr-lite/schema.json +1 -1
- package/src/executors/package/schema.json +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.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 +36 -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.0",
|
|
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.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",
|
|
77
77
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
78
78
|
"@typescript-eslint/type-utils": "^5.36.1",
|
|
79
79
|
"chalk": "^4.1.0",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"module": "fesm2022/nx-angular.mjs",
|
|
110
110
|
"typings": "index.d.ts",
|
|
111
111
|
"sideEffects": false,
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "5a7ffb93c9e84bffbf52f6ae9c6c1e3b8edb9d35"
|
|
113
113
|
}
|
|
@@ -30,6 +30,9 @@ function executeModuleFederationDevServerBuilder(schema, context) {
|
|
|
30
30
|
}
|
|
31
31
|
(0, module_federation_1.validateDevRemotes)(options, workspaceProjects);
|
|
32
32
|
const remotesToSkip = new Set((_a = (0, find_matching_projects_1.findMatchingProjects)(options.skipRemotes, projectGraph.nodes)) !== null && _a !== void 0 ? _a : []);
|
|
33
|
+
if (remotesToSkip.size > 0) {
|
|
34
|
+
devkit_1.logger.info(`Remotes not served automatically: ${[...remotesToSkip].join(', ')}`);
|
|
35
|
+
}
|
|
33
36
|
const staticRemotes = (0, module_federation_1.getStaticRemotes)(project, context, workspaceProjects, remotesToSkip);
|
|
34
37
|
const dynamicRemotes = (0, module_federation_1.getDynamicRemotes)(project, context, workspaceProjects, remotesToSkip, pathToManifestFile);
|
|
35
38
|
const remotes = [...staticRemotes, ...dynamicRemotes];
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"items": {
|
|
118
118
|
"type": "string"
|
|
119
119
|
},
|
|
120
|
-
"description": "List of remote applications to not automatically serve, either statically or in development mode.
|
|
120
|
+
"description": "List of remote applications to not automatically serve, either statically or in development mode."
|
|
121
121
|
},
|
|
122
122
|
"pathToManifestFile": {
|
|
123
123
|
"type": "string",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"items": {
|
|
74
74
|
"type": "string"
|
|
75
75
|
},
|
|
76
|
-
"description": "List of remote applications to not automatically serve, either statically or in development mode.
|
|
76
|
+
"description": "List of remote applications to not automatically serve, either statically or in development mode."
|
|
77
77
|
},
|
|
78
78
|
"verbose": {
|
|
79
79
|
"type": "boolean",
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validateDevRemotes = exports.getStaticRemotes = exports.getDynamicRemotes = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip, pathToManifestFile = (0, path_1.join)(context.workspaceRoot, project.sourceRoot, 'assets/module-federation.manifest.json')) {
|
|
7
8
|
// check for dynamic remotes
|
|
8
9
|
// we should only check for dynamic based on what we generate
|
|
@@ -22,14 +23,19 @@ function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip, p
|
|
|
22
23
|
if (!Object.keys(parsedManifest).every((key) => typeof key === 'string' && typeof parsedManifest[key] === 'string')) {
|
|
23
24
|
return [];
|
|
24
25
|
}
|
|
25
|
-
const
|
|
26
|
+
const allDynamicRemotes = Object.entries(parsedManifest)
|
|
26
27
|
.map(([remoteName]) => remoteName)
|
|
27
28
|
.filter((r) => !remotesToSkip.has(r));
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const remotesNotInWorkspace = [];
|
|
30
|
+
const dynamicRemotes = allDynamicRemotes.filter((remote) => {
|
|
31
|
+
if (!workspaceProjects[remote]) {
|
|
32
|
+
remotesNotInWorkspace.push(remote);
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
});
|
|
37
|
+
if (remotesNotInWorkspace.length > 0) {
|
|
38
|
+
devkit_1.logger.warn(`Skipping serving ${remotesNotInWorkspace.join(', ')} as they could not be found in the workspace. Ensure they are served correctly.`);
|
|
33
39
|
}
|
|
34
40
|
return dynamicRemotes;
|
|
35
41
|
}
|
|
@@ -46,14 +52,19 @@ function getStaticRemotes(project, context, workspaceProjects, remotesToSkip) {
|
|
|
46
52
|
const remotesConfig = Array.isArray(mfeConfig.remotes) && mfeConfig.remotes.length > 0
|
|
47
53
|
? mfeConfig.remotes
|
|
48
54
|
: [];
|
|
49
|
-
const
|
|
55
|
+
const allStaticRemotes = remotesConfig
|
|
50
56
|
.map((remoteDefinition) => Array.isArray(remoteDefinition) ? remoteDefinition[0] : remoteDefinition)
|
|
51
57
|
.filter((r) => !remotesToSkip.has(r));
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
const remotesNotInWorkspace = [];
|
|
59
|
+
const staticRemotes = allStaticRemotes.filter((remote) => {
|
|
60
|
+
if (!workspaceProjects[remote]) {
|
|
61
|
+
remotesNotInWorkspace.push(remote);
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
});
|
|
66
|
+
if (remotesNotInWorkspace.length > 0) {
|
|
67
|
+
devkit_1.logger.warn(`Skipping serving ${remotesNotInWorkspace.join(', ')} as they could not be found in the workspace. Ensure they are served correctly.`);
|
|
57
68
|
}
|
|
58
69
|
return staticRemotes;
|
|
59
70
|
}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"updateBuildableProjectDepsInPackageJson": {
|
|
41
41
|
"type": "boolean",
|
|
42
42
|
"description": "Whether to update the buildable project dependencies in the build output package.json.",
|
|
43
|
-
"default":
|
|
43
|
+
"default": false
|
|
44
44
|
},
|
|
45
45
|
"buildableProjectDepsInPackageJsonType": {
|
|
46
46
|
"type": "string",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"updateBuildableProjectDepsInPackageJson": {
|
|
41
41
|
"type": "boolean",
|
|
42
42
|
"description": "Whether to update the buildable project dependencies in the build output package.json.",
|
|
43
|
-
"default":
|
|
43
|
+
"default": false
|
|
44
44
|
},
|
|
45
45
|
"buildableProjectDepsInPackageJsonType": {
|
|
46
46
|
"type": "string",
|
|
@@ -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
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
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') {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
let updated = false;
|
|
19
|
+
for (const [, target] of Object.entries(project.targets || {})) {
|
|
20
|
+
if (!executors.has(target.executor)) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (target.options &&
|
|
24
|
+
target.options.updateBuildableProjectDepsInPackageJson === undefined) {
|
|
25
|
+
target.options.updateBuildableProjectDepsInPackageJson = true;
|
|
26
|
+
updated = true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (updated) {
|
|
30
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.default = default_1;
|