@nx/angular 16.5.0 → 16.5.2
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 +2 -1
- package/package.json +11 -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/ng-package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "16.5.
|
|
3
|
+
"version": "16.5.2",
|
|
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.5.
|
|
70
|
-
"@nx/cypress": "16.5.
|
|
71
|
-
"@nx/devkit": "16.5.
|
|
72
|
-
"@nx/jest": "16.5.
|
|
73
|
-
"@nx/js": "16.5.
|
|
74
|
-
"@nx/linter": "16.5.
|
|
75
|
-
"@nx/webpack": "16.5.
|
|
76
|
-
"@nx/workspace": "16.5.
|
|
69
|
+
"@nrwl/angular": "16.5.2",
|
|
70
|
+
"@nx/cypress": "16.5.2",
|
|
71
|
+
"@nx/devkit": "16.5.2",
|
|
72
|
+
"@nx/jest": "16.5.2",
|
|
73
|
+
"@nx/js": "16.5.2",
|
|
74
|
+
"@nx/linter": "16.5.2",
|
|
75
|
+
"@nx/webpack": "16.5.2",
|
|
76
|
+
"@nx/workspace": "16.5.2",
|
|
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": "
|
|
113
|
+
"gitHead": "928273940d11aa7dea87cb625a92f2c3ec62e726"
|
|
113
114
|
}
|
|
@@ -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
|
}
|