@nx/module-federation 0.0.0-pr-30418-4e2b721 → 0.0.0-pr-3-ec41644
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 +0 -19
- package/package.json +7 -7
- package/src/plugins/models/index.d.ts +0 -5
- package/src/plugins/nx-module-federation-plugin/rspack/nx-module-federation-plugin.js +1 -0
- package/src/plugins/utils/get-static-remotes.d.ts +1 -2
- package/src/plugins/utils/get-static-remotes.js +3 -3
- package/src/plugins/utils/parse-remotes-config.js +2 -13
- package/src/utils/parse-static-remotes-config.js +7 -12
package/migrations.json
CHANGED
|
@@ -20,25 +20,6 @@
|
|
|
20
20
|
"alwaysAddToPackageJson": false
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
},
|
|
24
|
-
"20.5.0": {
|
|
25
|
-
"version": "20.5.0-beta.5",
|
|
26
|
-
"@module-federation/enhanced": {
|
|
27
|
-
"version": "^0.9.0",
|
|
28
|
-
"alwaysAddToPackageJson": false
|
|
29
|
-
},
|
|
30
|
-
"@module-federation/runtime": {
|
|
31
|
-
"version": "^0.9.0",
|
|
32
|
-
"alwaysAddToPackageJson": false
|
|
33
|
-
},
|
|
34
|
-
"@module-federation/sdk": {
|
|
35
|
-
"version": "^0.9.0",
|
|
36
|
-
"alwaysAddToPackageJson": false
|
|
37
|
-
},
|
|
38
|
-
"@module-federation/node": {
|
|
39
|
-
"version": "^2.6.26",
|
|
40
|
-
"alwaysAddToPackageJson": false
|
|
41
|
-
}
|
|
42
23
|
}
|
|
43
24
|
}
|
|
44
25
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/module-federation",
|
|
3
3
|
"description": "The Nx Plugin for Module Federation contains executors and utilities that support building applications using Module Federation.",
|
|
4
|
-
"version": "0.0.0-pr-
|
|
4
|
+
"version": "0.0.0-pr-3-ec41644",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"tslib": "^2.3.0",
|
|
28
|
-
"@nx/devkit": "0.0.0-pr-
|
|
29
|
-
"@nx/js": "0.0.0-pr-
|
|
30
|
-
"@nx/web": "0.0.0-pr-
|
|
28
|
+
"@nx/devkit": "0.0.0-pr-3-ec41644",
|
|
29
|
+
"@nx/js": "0.0.0-pr-3-ec41644",
|
|
30
|
+
"@nx/web": "0.0.0-pr-3-ec41644",
|
|
31
31
|
"picocolors": "^1.1.0",
|
|
32
32
|
"webpack": "^5.88.0",
|
|
33
|
-
"@module-federation/enhanced": "^0.
|
|
34
|
-
"@module-federation/node": "^2.6.
|
|
35
|
-
"@module-federation/sdk": "^0.
|
|
33
|
+
"@module-federation/enhanced": "^0.8.8",
|
|
34
|
+
"@module-federation/node": "^2.6.21",
|
|
35
|
+
"@module-federation/sdk": "^0.8.8",
|
|
36
36
|
"express": "^4.21.2",
|
|
37
37
|
"http-proxy-middleware": "^3.0.3"
|
|
38
38
|
},
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { StaticRemoteConfig } from '../../utils';
|
|
2
|
-
|
|
3
|
-
export declare function getStaticRemotes(remotesConfig: Record<string, StaticRemoteConfig>, devRemoteFindOptions?: DevRemoteFindOptions): Promise<Record<string, StaticRemoteConfig>>;
|
|
2
|
+
export declare function getStaticRemotes(remotesConfig: Record<string, StaticRemoteConfig>): Promise<Record<string, StaticRemoteConfig>>;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getStaticRemotes = getStaticRemotes;
|
|
4
4
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
5
|
-
async function getStaticRemotes(remotesConfig
|
|
5
|
+
async function getStaticRemotes(remotesConfig) {
|
|
6
6
|
const remotes = Object.keys(remotesConfig);
|
|
7
7
|
const findStaticRemotesPromises = [];
|
|
8
8
|
for (const remote of remotes) {
|
|
9
9
|
findStaticRemotesPromises.push(new Promise((resolve, reject) => {
|
|
10
10
|
(0, wait_for_port_open_1.waitForPortOpen)(remotesConfig[remote].port, {
|
|
11
|
-
retries:
|
|
12
|
-
retryDelay:
|
|
11
|
+
retries: 5,
|
|
12
|
+
retryDelay: 1000,
|
|
13
13
|
}).then((res) => {
|
|
14
14
|
resolve(undefined);
|
|
15
15
|
}, (rej) => {
|
|
@@ -2,25 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseRemotesConfig = parseRemotesConfig;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
6
|
-
const devkit_1 = require("@nx/devkit");
|
|
7
5
|
function parseRemotesConfig(remotes, workspaceRoot, projectGraph) {
|
|
8
6
|
if (!remotes?.length) {
|
|
9
7
|
return { remotes: [], config: undefined };
|
|
10
8
|
}
|
|
11
9
|
const config = {};
|
|
12
10
|
for (const app of remotes) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
projectGraph.nodes[app].data.targets?.['build']?.outputs?.[0] ??
|
|
16
|
-
`${workspaceRoot ? `${workspaceRoot}/` : ''}${projectGraph.nodes[app].data.root}/dist`, {
|
|
17
|
-
projectName: projectGraph.nodes[app].data.name,
|
|
18
|
-
projectRoot,
|
|
19
|
-
workspaceRoot,
|
|
20
|
-
});
|
|
21
|
-
if (outputPath.startsWith(projectRoot)) {
|
|
22
|
-
outputPath = (0, devkit_1.joinPathFragments)(workspaceRoot, outputPath);
|
|
23
|
-
}
|
|
11
|
+
const outputPath = projectGraph.nodes[app].data.targets?.['build']?.options.outputPath ??
|
|
12
|
+
`${workspaceRoot ? `${workspaceRoot}/` : ''}${projectGraph.nodes[app].data.root}/dist`; // this needs replaced with better logic for finding the output path
|
|
24
13
|
const basePath = (0, path_1.dirname)(outputPath);
|
|
25
14
|
const urlSegment = app;
|
|
26
15
|
const port = projectGraph.nodes[app].data.targets?.['serve']?.options.port;
|
|
@@ -9,11 +9,9 @@ function parseStaticRemotesConfig(staticRemotes, context) {
|
|
|
9
9
|
}
|
|
10
10
|
const config = {};
|
|
11
11
|
for (const app of staticRemotes) {
|
|
12
|
-
const outputPath = context.projectGraph.nodes[app].data.targets['build'].options.outputPath;
|
|
13
|
-
const basePath =
|
|
14
|
-
|
|
15
|
-
: (0, path_1.dirname)(outputPath); // dist || dist/checkout -> dist
|
|
16
|
-
const urlSegment = app;
|
|
12
|
+
const outputPath = context.projectGraph.nodes[app].data.targets['build'].options.outputPath;
|
|
13
|
+
const basePath = (0, path_1.dirname)(outputPath);
|
|
14
|
+
const urlSegment = (0, path_1.basename)(outputPath);
|
|
17
15
|
const port = context.projectGraph.nodes[app].data.targets['serve'].options.port;
|
|
18
16
|
config[app] = { basePath, outputPath, urlSegment, port };
|
|
19
17
|
}
|
|
@@ -25,13 +23,10 @@ function parseStaticSsrRemotesConfig(staticRemotes, context) {
|
|
|
25
23
|
}
|
|
26
24
|
const config = {};
|
|
27
25
|
for (const app of staticRemotes) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
? outputPath
|
|
33
|
-
: (0, path_1.dirname)(outputPath); // dist || dist/checkout -> dist
|
|
34
|
-
const urlSegment = app;
|
|
26
|
+
const outputPath = (0, path_1.dirname)(context.projectGraph.nodes[app].data.targets['build'].options.outputPath // dist/checkout/browser -> checkout
|
|
27
|
+
);
|
|
28
|
+
const basePath = (0, path_1.dirname)(outputPath); // dist/checkout -> dist
|
|
29
|
+
const urlSegment = (0, path_1.basename)(outputPath); // dist/checkout -> checkout
|
|
35
30
|
const port = context.projectGraph.nodes[app].data.targets['serve'].options.port;
|
|
36
31
|
config[app] = { basePath, outputPath, urlSegment, port };
|
|
37
32
|
}
|