@nx/react 0.0.0-pr-27696-37f7ce3 → 0.0.0-pr-27404-ad15a9c
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/executors.json +5 -0
- package/package.json +8 -6
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +1 -14
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +2 -60
- package/src/executors/module-federation-dev-server/schema.d.ts +17 -0
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +12 -0
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +240 -0
- package/src/executors/module-federation-static-server/schema.d.ts +3 -0
- package/src/executors/module-federation-static-server/schema.json +14 -0
- package/src/generators/application/application.js +13 -1
- package/src/generators/library/lib/add-linting.d.ts +2 -1
- package/src/generators/library/lib/add-linting.js +20 -2
- package/src/module-federation/utils.js +1 -1
- package/src/module-federation/with-module-federation.js +2 -11
- package/src/rules/update-module-federation-project.d.ts +2 -2
- package/src/rules/update-module-federation-project.js +7 -8
- package/src/utils/build-static.remotes.d.ts +4 -0
- package/src/utils/build-static.remotes.js +65 -0
- package/src/utils/versions.d.ts +2 -3
- package/src/utils/versions.js +3 -4
package/executors.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"implementation": "./src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl",
|
|
10
10
|
"schema": "./src/executors/module-federation-ssr-dev-server/schema.json",
|
|
11
11
|
"description": "Serve a host application along with it's known remotes."
|
|
12
|
+
},
|
|
13
|
+
"module-federation-static-server": {
|
|
14
|
+
"implementation": "./src/executors/module-federation-static-server/module-federation-static-server.impl",
|
|
15
|
+
"schema": "./src/executors/module-federation-static-server/schema.json",
|
|
16
|
+
"description": "Serve a host and its remotes statically."
|
|
12
17
|
}
|
|
13
18
|
}
|
|
14
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-27404-ad15a9c",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -39,11 +39,13 @@
|
|
|
39
39
|
"minimatch": "9.0.3",
|
|
40
40
|
"tslib": "^2.3.0",
|
|
41
41
|
"@module-federation/enhanced": "~0.6.0",
|
|
42
|
-
"@nx/devkit": "0.0.0-pr-
|
|
43
|
-
"@nx/js": "0.0.0-pr-
|
|
44
|
-
"@nx/eslint": "0.0.0-pr-
|
|
45
|
-
"@nx/web": "0.0.0-pr-
|
|
46
|
-
"
|
|
42
|
+
"@nx/devkit": "0.0.0-pr-27404-ad15a9c",
|
|
43
|
+
"@nx/js": "0.0.0-pr-27404-ad15a9c",
|
|
44
|
+
"@nx/eslint": "0.0.0-pr-27404-ad15a9c",
|
|
45
|
+
"@nx/web": "0.0.0-pr-27404-ad15a9c",
|
|
46
|
+
"express": "^4.19.2",
|
|
47
|
+
"http-proxy-middleware": "^3.0.0",
|
|
48
|
+
"@nrwl/react": "0.0.0-pr-27404-ad15a9c"
|
|
47
49
|
},
|
|
48
50
|
"publishConfig": {
|
|
49
51
|
"access": "public"
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
-
import {
|
|
3
|
-
type ModuleFederationDevServerOptions = WebDevServerOptions & {
|
|
4
|
-
devRemotes?: (string | {
|
|
5
|
-
remoteName: string;
|
|
6
|
-
configuration: string;
|
|
7
|
-
})[];
|
|
8
|
-
skipRemotes?: string[];
|
|
9
|
-
static?: boolean;
|
|
10
|
-
isInitialHost?: boolean;
|
|
11
|
-
parallel?: number;
|
|
12
|
-
staticRemotesPort?: number;
|
|
13
|
-
pathToManifestFile?: string;
|
|
14
|
-
};
|
|
2
|
+
import { ModuleFederationDevServerOptions } from './schema';
|
|
15
3
|
export default function moduleFederationDevServer(options: ModuleFederationDevServerOptions, context: ExecutorContext): AsyncIterableIterator<{
|
|
16
4
|
success: boolean;
|
|
17
5
|
baseUrl?: string;
|
|
18
6
|
}>;
|
|
19
|
-
export {};
|
|
@@ -7,12 +7,11 @@ const file_server_impl_1 = require("@nx/web/src/executors/file-server/file-serve
|
|
|
7
7
|
const module_federation_1 = require("@nx/webpack/src/utils/module-federation");
|
|
8
8
|
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
9
9
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
10
|
-
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
11
|
-
const node_child_process_1 = require("node:child_process");
|
|
12
10
|
const fs_1 = require("fs");
|
|
13
11
|
const path_1 = require("path");
|
|
14
12
|
const start_remote_proxies_1 = require("@nx/webpack/src/utils/module-federation/start-remote-proxies");
|
|
15
13
|
const parse_static_remotes_config_1 = require("@nx/webpack/src/utils/module-federation/parse-static-remotes-config");
|
|
14
|
+
const build_static_remotes_1 = require("../../utils/build-static.remotes");
|
|
16
15
|
function getBuildOptions(buildTarget, context) {
|
|
17
16
|
const target = (0, devkit_1.parseTargetString)(buildTarget, context);
|
|
18
17
|
const buildOptions = (0, devkit_1.readTargetOptions)(target, context);
|
|
@@ -92,63 +91,6 @@ async function startRemotes(remotes, context, options, target = 'serve') {
|
|
|
92
91
|
}
|
|
93
92
|
return remoteIters;
|
|
94
93
|
}
|
|
95
|
-
async function buildStaticRemotes(staticRemotesConfig, nxBin, context, options) {
|
|
96
|
-
if (!staticRemotesConfig.remotes.length) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
devkit_1.logger.info(`NX Building ${staticRemotesConfig.remotes.length} static remotes...`);
|
|
100
|
-
const mappedLocationOfRemotes = {};
|
|
101
|
-
for (const app of staticRemotesConfig.remotes) {
|
|
102
|
-
mappedLocationOfRemotes[app] = `http${options.ssl ? 's' : ''}://${options.host}:${options.staticRemotesPort}/${staticRemotesConfig.config[app].urlSegment}`;
|
|
103
|
-
}
|
|
104
|
-
await new Promise((res, rej) => {
|
|
105
|
-
const staticProcess = (0, node_child_process_1.fork)(nxBin, [
|
|
106
|
-
'run-many',
|
|
107
|
-
`--target=build`,
|
|
108
|
-
`--projects=${staticRemotesConfig.remotes.join(',')}`,
|
|
109
|
-
...(context.configurationName
|
|
110
|
-
? [`--configuration=${context.configurationName}`]
|
|
111
|
-
: []),
|
|
112
|
-
...(options.parallel ? [`--parallel=${options.parallel}`] : []),
|
|
113
|
-
], {
|
|
114
|
-
cwd: context.root,
|
|
115
|
-
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
|
116
|
-
});
|
|
117
|
-
// File to debug build failures e.g. 2024-01-01T00_00_0_0Z-build.log'
|
|
118
|
-
const remoteBuildLogFile = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `${new Date().toISOString().replace(/[:\.]/g, '_')}-build.log`);
|
|
119
|
-
const stdoutStream = (0, fs_1.createWriteStream)(remoteBuildLogFile);
|
|
120
|
-
staticProcess.stdout.on('data', (data) => {
|
|
121
|
-
const ANSII_CODE_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
122
|
-
const stdoutString = data.toString().replace(ANSII_CODE_REGEX, '');
|
|
123
|
-
stdoutStream.write(stdoutString);
|
|
124
|
-
// in addition to writing into the stdout stream, also show error directly in console
|
|
125
|
-
// so the error is easily discoverable. 'ERROR in' is the key word to search in webpack output.
|
|
126
|
-
if (stdoutString.includes('ERROR in')) {
|
|
127
|
-
devkit_1.logger.log(stdoutString);
|
|
128
|
-
}
|
|
129
|
-
if (stdoutString.includes('Successfully ran target build')) {
|
|
130
|
-
staticProcess.stdout.removeAllListeners('data');
|
|
131
|
-
devkit_1.logger.info(`NX Built ${staticRemotesConfig.remotes.length} static remotes`);
|
|
132
|
-
res();
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
staticProcess.stderr.on('data', (data) => devkit_1.logger.info(data.toString()));
|
|
136
|
-
staticProcess.once('exit', (code) => {
|
|
137
|
-
stdoutStream.end();
|
|
138
|
-
staticProcess.stdout.removeAllListeners('data');
|
|
139
|
-
staticProcess.stderr.removeAllListeners('data');
|
|
140
|
-
if (code !== 0) {
|
|
141
|
-
rej(`Remote failed to start. A complete log can be found in: ${remoteBuildLogFile}`);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
res();
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
process.on('SIGTERM', () => staticProcess.kill('SIGTERM'));
|
|
148
|
-
process.on('exit', () => staticProcess.kill('SIGTERM'));
|
|
149
|
-
});
|
|
150
|
-
return mappedLocationOfRemotes;
|
|
151
|
-
}
|
|
152
94
|
async function* moduleFederationDevServer(options, context) {
|
|
153
95
|
// Force Node to resolve to look for the nx binary that is inside node_modules
|
|
154
96
|
const nxBin = require.resolve('nx/bin/nx');
|
|
@@ -192,7 +134,7 @@ async function* moduleFederationDevServer(options, context) {
|
|
|
192
134
|
p.name,
|
|
193
135
|
]);
|
|
194
136
|
const staticRemotesConfig = (0, parse_static_remotes_config_1.parseStaticRemotesConfig)([...remotes.staticRemotes, ...remotes.dynamicRemotes], context);
|
|
195
|
-
const mappedLocationsOfStaticRemotes = await buildStaticRemotes(staticRemotesConfig, nxBin, context, options);
|
|
137
|
+
const mappedLocationsOfStaticRemotes = await (0, build_static_remotes_1.buildStaticRemotes)(staticRemotesConfig, nxBin, context, options);
|
|
196
138
|
const devRemoteIters = await startRemotes(remotes.devRemotes, context, options, 'serve');
|
|
197
139
|
const staticRemotesIter = startStaticRemotesFileServer(staticRemotesConfig, context, options);
|
|
198
140
|
(0, start_remote_proxies_1.startRemoteProxies)(staticRemotesConfig, mappedLocationsOfStaticRemotes, options.ssl
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WebDevServerOptions } from '@nx/webpack';
|
|
2
|
+
|
|
3
|
+
export type ModuleFederationDevServerOptions = WebDevServerOptions & {
|
|
4
|
+
devRemotes?: (
|
|
5
|
+
| string
|
|
6
|
+
| {
|
|
7
|
+
remoteName: string;
|
|
8
|
+
configuration: string;
|
|
9
|
+
}
|
|
10
|
+
)[];
|
|
11
|
+
skipRemotes?: string[];
|
|
12
|
+
static?: boolean;
|
|
13
|
+
isInitialHost?: boolean;
|
|
14
|
+
parallel?: number;
|
|
15
|
+
staticRemotesPort?: number;
|
|
16
|
+
pathToManifestFile?: string;
|
|
17
|
+
};
|
package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ModuleFederationStaticServerSchema } from './schema';
|
|
2
|
+
import { ModuleFederationDevServerOptions } from '../module-federation-dev-server/schema';
|
|
3
|
+
import { ExecutorContext } from 'nx/src/config/misc-interfaces';
|
|
4
|
+
import { StaticRemotesConfig } from '@nx/webpack/src/utils/module-federation/parse-static-remotes-config';
|
|
5
|
+
export declare function startProxies(staticRemotesConfig: StaticRemotesConfig, hostServeOptions: ModuleFederationDevServerOptions, mappedLocationOfHost: string, mappedLocationsOfRemotes: Record<string, string>, sslOptions?: {
|
|
6
|
+
pathToCert: string;
|
|
7
|
+
pathToKey: string;
|
|
8
|
+
}): void;
|
|
9
|
+
export default function moduleFederationStaticServer(schema: ModuleFederationStaticServerSchema, context: ExecutorContext): AsyncGenerator<{
|
|
10
|
+
success: boolean;
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
}, any, unknown>;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startProxies = startProxies;
|
|
4
|
+
exports.default = moduleFederationStaticServer;
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const module_federation_1 = require("@nx/webpack/src/utils/module-federation");
|
|
9
|
+
const parse_static_remotes_config_1 = require("@nx/webpack/src/utils/module-federation/parse-static-remotes-config");
|
|
10
|
+
const build_static_remotes_1 = require("../../utils/build-static.remotes");
|
|
11
|
+
const child_process_1 = require("child_process");
|
|
12
|
+
const process = require("node:process");
|
|
13
|
+
const file_server_impl_1 = require("@nx/web/src/executors/file-server/file-server.impl");
|
|
14
|
+
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
15
|
+
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
16
|
+
function getBuildAndServeOptionsFromServeTarget(serveTarget, context) {
|
|
17
|
+
const target = (0, devkit_1.parseTargetString)(serveTarget, context);
|
|
18
|
+
const serveOptions = (0, devkit_1.readTargetOptions)(target, context);
|
|
19
|
+
const buildTarget = (0, devkit_1.parseTargetString)(serveOptions.buildTarget, context);
|
|
20
|
+
const buildOptions = (0, devkit_1.readTargetOptions)(buildTarget, context);
|
|
21
|
+
let pathToManifestFile = (0, path_1.join)(context.root, context.projectGraph.nodes[context.projectName].data.sourceRoot, 'assets/module-federation.manifest.json');
|
|
22
|
+
if (serveOptions.pathToManifestFile) {
|
|
23
|
+
const userPathToManifestFile = (0, path_1.join)(context.root, serveOptions.pathToManifestFile);
|
|
24
|
+
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
|
25
|
+
throw new Error(`The provided Module Federation manifest file path does not exist. Please check the file exists at "${userPathToManifestFile}".`);
|
|
26
|
+
}
|
|
27
|
+
else if ((0, path_1.extname)(serveOptions.pathToManifestFile) !== '.json') {
|
|
28
|
+
throw new Error(`The Module Federation manifest file must be a JSON. Please ensure the file at ${userPathToManifestFile} is a JSON.`);
|
|
29
|
+
}
|
|
30
|
+
pathToManifestFile = userPathToManifestFile;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
buildTarget,
|
|
34
|
+
buildOptions,
|
|
35
|
+
serveOptions,
|
|
36
|
+
pathToManifestFile,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async function buildHost(nxBin, buildTarget, context) {
|
|
40
|
+
await new Promise((res, rej) => {
|
|
41
|
+
const staticProcess = (0, child_process_1.fork)(nxBin, [
|
|
42
|
+
`run`,
|
|
43
|
+
`${buildTarget.project}:${buildTarget.target}${buildTarget.configuration
|
|
44
|
+
? `:${buildTarget.configuration}`
|
|
45
|
+
: context.configurationName
|
|
46
|
+
? `:${context.configurationName}`
|
|
47
|
+
: ''}`,
|
|
48
|
+
], {
|
|
49
|
+
cwd: context.root,
|
|
50
|
+
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
|
51
|
+
});
|
|
52
|
+
staticProcess.stdout.on('data', (data) => {
|
|
53
|
+
const ANSII_CODE_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
54
|
+
const stdoutString = data.toString().replace(ANSII_CODE_REGEX, '');
|
|
55
|
+
// in addition to writing into the stdout stream, also show error directly in console
|
|
56
|
+
// so the error is easily discoverable. 'ERROR in' is the key word to search in webpack output.
|
|
57
|
+
if (stdoutString.includes('ERROR in')) {
|
|
58
|
+
devkit_1.logger.log(stdoutString);
|
|
59
|
+
}
|
|
60
|
+
if (stdoutString.includes('Successfully ran target build')) {
|
|
61
|
+
staticProcess.stdout.removeAllListeners('data');
|
|
62
|
+
devkit_1.logger.info(`NX Built host`);
|
|
63
|
+
res();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
staticProcess.stderr.on('data', (data) => devkit_1.logger.info(data.toString()));
|
|
67
|
+
staticProcess.once('exit', (code) => {
|
|
68
|
+
staticProcess.stdout.removeAllListeners('data');
|
|
69
|
+
staticProcess.stderr.removeAllListeners('data');
|
|
70
|
+
if (code !== 0) {
|
|
71
|
+
rej(`Host failed to build. See above for details.`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
res();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
process.on('SIGTERM', () => staticProcess.kill('SIGTERM'));
|
|
78
|
+
process.on('exit', () => staticProcess.kill('SIGTERM'));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function moveToTmpDirectory(staticRemotesConfig, hostOutputPath, hostUrlSegment) {
|
|
82
|
+
const commonOutputDirectory = (0, path_1.join)(devkit_1.workspaceRoot, 'tmp/static-module-federation');
|
|
83
|
+
for (const app of staticRemotesConfig.remotes) {
|
|
84
|
+
const remoteConfig = staticRemotesConfig.config[app];
|
|
85
|
+
(0, fs_1.cpSync)(remoteConfig.outputPath, (0, path_1.join)(commonOutputDirectory, remoteConfig.urlSegment), {
|
|
86
|
+
force: true,
|
|
87
|
+
recursive: true,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
(0, fs_1.cpSync)(hostOutputPath, (0, path_1.join)(commonOutputDirectory, hostUrlSegment), {
|
|
91
|
+
force: true,
|
|
92
|
+
recursive: true,
|
|
93
|
+
});
|
|
94
|
+
const cleanup = () => {
|
|
95
|
+
(0, fs_1.rmSync)(commonOutputDirectory, { force: true, recursive: true });
|
|
96
|
+
};
|
|
97
|
+
process.on('SIGTERM', () => {
|
|
98
|
+
cleanup();
|
|
99
|
+
});
|
|
100
|
+
process.on('exit', () => {
|
|
101
|
+
cleanup();
|
|
102
|
+
});
|
|
103
|
+
return commonOutputDirectory;
|
|
104
|
+
}
|
|
105
|
+
function startProxies(staticRemotesConfig, hostServeOptions, mappedLocationOfHost, mappedLocationsOfRemotes, sslOptions) {
|
|
106
|
+
const { createProxyMiddleware } = require('http-proxy-middleware');
|
|
107
|
+
const express = require('express');
|
|
108
|
+
let sslCert;
|
|
109
|
+
let sslKey;
|
|
110
|
+
if (sslOptions && sslOptions.pathToCert && sslOptions.pathToKey) {
|
|
111
|
+
if ((0, fs_1.existsSync)(sslOptions.pathToCert) && (0, fs_1.existsSync)(sslOptions.pathToKey)) {
|
|
112
|
+
sslCert = (0, fs_1.readFileSync)(sslOptions.pathToCert);
|
|
113
|
+
sslKey = (0, fs_1.readFileSync)(sslOptions.pathToKey);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
devkit_1.logger.warn(`Encountered SSL options in project.json, however, the certificate files do not exist in the filesystem. Using http.`);
|
|
117
|
+
devkit_1.logger.warn(`Attempted to find '${sslOptions.pathToCert}' and '${sslOptions.pathToKey}'.`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const http = require('http');
|
|
121
|
+
const https = require('https');
|
|
122
|
+
devkit_1.logger.info(`NX Starting static remotes proxies...`);
|
|
123
|
+
for (const app of staticRemotesConfig.remotes) {
|
|
124
|
+
const expressProxy = express();
|
|
125
|
+
expressProxy.use(createProxyMiddleware({
|
|
126
|
+
target: mappedLocationsOfRemotes[app],
|
|
127
|
+
changeOrigin: true,
|
|
128
|
+
secure: sslCert ? false : undefined,
|
|
129
|
+
}));
|
|
130
|
+
const proxyServer = (sslCert ? https : http)
|
|
131
|
+
.createServer({ cert: sslCert, key: sslKey }, expressProxy)
|
|
132
|
+
.listen(staticRemotesConfig.config[app].port);
|
|
133
|
+
process.on('SIGTERM', () => proxyServer.close());
|
|
134
|
+
process.on('exit', () => proxyServer.close());
|
|
135
|
+
}
|
|
136
|
+
devkit_1.logger.info(`NX Static remotes proxies started successfully`);
|
|
137
|
+
devkit_1.logger.info(`NX Starting static host proxy...`);
|
|
138
|
+
const expressProxy = express();
|
|
139
|
+
expressProxy.use(createProxyMiddleware({
|
|
140
|
+
target: mappedLocationOfHost,
|
|
141
|
+
changeOrigin: true,
|
|
142
|
+
secure: sslCert ? false : undefined,
|
|
143
|
+
pathRewrite: (path) => {
|
|
144
|
+
let pathRewrite = path;
|
|
145
|
+
for (const app of staticRemotesConfig.remotes) {
|
|
146
|
+
if (path.endsWith(app)) {
|
|
147
|
+
pathRewrite = '/';
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return pathRewrite;
|
|
152
|
+
},
|
|
153
|
+
}));
|
|
154
|
+
const proxyServer = (sslCert ? https : http)
|
|
155
|
+
.createServer({ cert: sslCert, key: sslKey }, expressProxy)
|
|
156
|
+
.listen(hostServeOptions.port);
|
|
157
|
+
process.on('SIGTERM', () => proxyServer.close());
|
|
158
|
+
process.on('exit', () => proxyServer.close());
|
|
159
|
+
devkit_1.logger.info('NX Static host proxy started successfully');
|
|
160
|
+
}
|
|
161
|
+
async function* moduleFederationStaticServer(schema, context) {
|
|
162
|
+
// Force Node to resolve to look for the nx binary that is inside node_modules
|
|
163
|
+
const nxBin = require.resolve('nx/bin/nx');
|
|
164
|
+
// Get the remotes from the module federation config
|
|
165
|
+
const p = context.projectsConfigurations.projects[context.projectName];
|
|
166
|
+
const options = getBuildAndServeOptionsFromServeTarget(schema.serveTarget, context);
|
|
167
|
+
const moduleFederationConfig = (0, module_federation_1.getModuleFederationConfig)(options.buildOptions.tsConfig, context.root, p.root, 'react');
|
|
168
|
+
const remotes = (0, module_federation_1.getRemotes)([], options.serveOptions.skipRemotes, moduleFederationConfig, {
|
|
169
|
+
projectName: context.projectName,
|
|
170
|
+
projectGraph: context.projectGraph,
|
|
171
|
+
root: context.root,
|
|
172
|
+
}, options.pathToManifestFile);
|
|
173
|
+
const staticRemotesConfig = (0, parse_static_remotes_config_1.parseStaticRemotesConfig)([...remotes.staticRemotes, ...remotes.dynamicRemotes], context);
|
|
174
|
+
options.serveOptions.staticRemotesPort ??= remotes.staticRemotePort;
|
|
175
|
+
const mappedLocationsOfStaticRemotes = await (0, build_static_remotes_1.buildStaticRemotes)(staticRemotesConfig, nxBin, context, options.serveOptions);
|
|
176
|
+
// Build the host
|
|
177
|
+
const hostUrlSegment = (0, path_1.basename)(options.buildOptions.outputPath);
|
|
178
|
+
const mappedLocationOfHost = `http${options.serveOptions.ssl ? 's' : ''}://${options.serveOptions.host}:${options.serveOptions.staticRemotesPort}/${hostUrlSegment}`;
|
|
179
|
+
await buildHost(nxBin, options.buildTarget, context);
|
|
180
|
+
// Move to a temporary directory
|
|
181
|
+
const commonOutputDirectory = moveToTmpDirectory(staticRemotesConfig, options.buildOptions.outputPath, hostUrlSegment);
|
|
182
|
+
// File Serve the temporary directory
|
|
183
|
+
const staticFileServerIter = (0, file_server_impl_1.default)({
|
|
184
|
+
cors: true,
|
|
185
|
+
watch: false,
|
|
186
|
+
staticFilePath: commonOutputDirectory,
|
|
187
|
+
parallel: false,
|
|
188
|
+
spa: false,
|
|
189
|
+
withDeps: false,
|
|
190
|
+
host: options.serveOptions.host,
|
|
191
|
+
port: options.serveOptions.staticRemotesPort,
|
|
192
|
+
ssl: options.serveOptions.ssl,
|
|
193
|
+
sslCert: options.serveOptions.sslCert,
|
|
194
|
+
sslKey: options.serveOptions.sslKey,
|
|
195
|
+
cacheSeconds: -1,
|
|
196
|
+
}, context);
|
|
197
|
+
// express proxy all of it
|
|
198
|
+
startProxies(staticRemotesConfig, options.serveOptions, mappedLocationOfHost, mappedLocationsOfStaticRemotes, options.serveOptions.ssl
|
|
199
|
+
? {
|
|
200
|
+
pathToCert: (0, path_1.join)(devkit_1.workspaceRoot, options.serveOptions.sslCert),
|
|
201
|
+
pathToKey: (0, path_1.join)(devkit_1.workspaceRoot, options.serveOptions.sslKey),
|
|
202
|
+
}
|
|
203
|
+
: undefined);
|
|
204
|
+
return yield* (0, async_iterable_1.combineAsyncIterables)(staticFileServerIter, (0, async_iterable_1.createAsyncIterable)(async ({ next, done }) => {
|
|
205
|
+
const host = options.serveOptions.host ?? 'localhost';
|
|
206
|
+
const baseUrl = `http${options.serveOptions.ssl ? 's' : ''}://${host}:${options.serveOptions.port}`;
|
|
207
|
+
if (remotes.remotePorts.length === 0) {
|
|
208
|
+
const portsToWaitFor = [options.serveOptions.staticRemotesPort];
|
|
209
|
+
await Promise.all(portsToWaitFor.map((port) => (0, wait_for_port_open_1.waitForPortOpen)(port, {
|
|
210
|
+
retries: 480,
|
|
211
|
+
retryDelay: 2500,
|
|
212
|
+
host: host,
|
|
213
|
+
})));
|
|
214
|
+
devkit_1.logger.info(`NX Server ready at ${baseUrl}`);
|
|
215
|
+
next({ success: true, baseUrl: baseUrl });
|
|
216
|
+
done();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
try {
|
|
220
|
+
const portsToWaitFor = staticFileServerIter
|
|
221
|
+
? [options.serveOptions.staticRemotesPort, ...remotes.remotePorts]
|
|
222
|
+
: [...remotes.remotePorts];
|
|
223
|
+
await Promise.all(portsToWaitFor.map((port) => (0, wait_for_port_open_1.waitForPortOpen)(port, {
|
|
224
|
+
retries: 480,
|
|
225
|
+
retryDelay: 2500,
|
|
226
|
+
host: host,
|
|
227
|
+
})));
|
|
228
|
+
devkit_1.logger.info(`NX Server ready at ${baseUrl}`);
|
|
229
|
+
next({ success: true, baseUrl: baseUrl });
|
|
230
|
+
}
|
|
231
|
+
catch (err) {
|
|
232
|
+
throw new Error(`Failed to start. Check above for any errors.`, {
|
|
233
|
+
cause: err,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
finally {
|
|
237
|
+
done();
|
|
238
|
+
}
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"title": "Module Federation Static Dev Server",
|
|
5
|
+
"description": "Serve a host application statically along with it's remotes.",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"serveTarget": {
|
|
10
|
+
"type": "string"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"required": ["serveTarget"]
|
|
14
|
+
}
|
|
@@ -26,6 +26,7 @@ const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
|
|
|
26
26
|
const js_1 = require("@nx/js");
|
|
27
27
|
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
28
28
|
const setup_tailwind_1 = require("../setup-tailwind/setup-tailwind");
|
|
29
|
+
const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
|
|
29
30
|
async function addLinting(host, options) {
|
|
30
31
|
const tasks = [];
|
|
31
32
|
if (options.linter === eslint_1.Linter.EsLint) {
|
|
@@ -43,7 +44,18 @@ async function addLinting(host, options) {
|
|
|
43
44
|
});
|
|
44
45
|
tasks.push(lintTask);
|
|
45
46
|
if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
|
|
46
|
-
(0,
|
|
47
|
+
if ((0, flat_config_1.useFlatConfig)(host)) {
|
|
48
|
+
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react');
|
|
49
|
+
// Add an empty rules object to users know how to add/override rules
|
|
50
|
+
(0, eslint_file_1.addOverrideToLintConfig)(host, options.appProjectRoot, {
|
|
51
|
+
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
52
|
+
rules: {},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
const addExtendsTask = (0, eslint_file_1.addExtendsToLintConfig)(host, options.appProjectRoot, { name: 'plugin:@nx/react', needCompatFixup: true });
|
|
57
|
+
tasks.push(addExtendsTask);
|
|
58
|
+
}
|
|
47
59
|
}
|
|
48
60
|
if (!options.skipPackageJson) {
|
|
49
61
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Tree } from 'nx/src/generators/tree';
|
|
2
|
+
import { GeneratorCallback } from '@nx/devkit';
|
|
2
3
|
import { NormalizedSchema } from '../schema';
|
|
3
|
-
export declare function addLinting(host: Tree, options: NormalizedSchema): Promise<
|
|
4
|
+
export declare function addLinting(host: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
|
|
@@ -6,8 +6,10 @@ const path_1 = require("nx/src/utils/path");
|
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const lint_1 = require("../../../utils/lint");
|
|
8
8
|
const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
|
|
9
|
+
const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
|
|
9
10
|
async function addLinting(host, options) {
|
|
10
11
|
if (options.linter === eslint_1.Linter.EsLint) {
|
|
12
|
+
const tasks = [];
|
|
11
13
|
const lintTask = await (0, eslint_1.lintProjectGenerator)(host, {
|
|
12
14
|
linter: options.linter,
|
|
13
15
|
project: options.name,
|
|
@@ -20,14 +22,30 @@ async function addLinting(host, options) {
|
|
|
20
22
|
setParserOptionsProject: options.setParserOptionsProject,
|
|
21
23
|
addPlugin: options.addPlugin,
|
|
22
24
|
});
|
|
25
|
+
tasks.push(lintTask);
|
|
23
26
|
if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
|
|
24
|
-
(0,
|
|
27
|
+
if ((0, flat_config_1.useFlatConfig)(host)) {
|
|
28
|
+
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react');
|
|
29
|
+
// Add an empty rules object to users know how to add/override rules
|
|
30
|
+
(0, eslint_file_1.addOverrideToLintConfig)(host, options.projectRoot, {
|
|
31
|
+
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
32
|
+
rules: {},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
const addExtendsTask = (0, eslint_file_1.addExtendsToLintConfig)(host, options.projectRoot, {
|
|
37
|
+
name: 'plugin:@nx/react',
|
|
38
|
+
needCompatFixup: true,
|
|
39
|
+
});
|
|
40
|
+
tasks.push(addExtendsTask);
|
|
41
|
+
}
|
|
25
42
|
}
|
|
26
43
|
let installTask = () => { };
|
|
27
44
|
if (!options.skipPackageJson) {
|
|
28
45
|
installTask = (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
46
|
+
tasks.push(installTask);
|
|
29
47
|
}
|
|
30
|
-
return (0, devkit_1.runTasksInSerial)(
|
|
48
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
31
49
|
}
|
|
32
50
|
else {
|
|
33
51
|
return () => { };
|
|
@@ -69,7 +69,7 @@ async function getModuleFederationConfig(mfConfig, options = { isServer: false }
|
|
|
69
69
|
let mappedRemotes = {};
|
|
70
70
|
if (mfConfig.remotes && mfConfig.remotes.length > 0) {
|
|
71
71
|
const isLibraryTypeVar = mfConfig.library?.type === 'var';
|
|
72
|
-
mappedRemotes = mapRemotesFunction(mfConfig.remotes, 'js', determineRemoteUrlFunction,
|
|
72
|
+
mappedRemotes = mapRemotesFunction(mfConfig.remotes, 'js', determineRemoteUrlFunction, true);
|
|
73
73
|
}
|
|
74
74
|
return { sharedLibraries, sharedDependencies, mappedRemotes };
|
|
75
75
|
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withModuleFederation = withModuleFederation;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
const webpack_1 = require("@module-federation/enhanced/webpack");
|
|
6
|
-
const isVarOrWindow = (libType) => libType === 'var' || libType === 'window';
|
|
7
6
|
/**
|
|
8
7
|
* @param {ModuleFederationConfig} options
|
|
9
8
|
* @return {Promise<AsyncNxComposableWebpackPlugin>}
|
|
@@ -13,13 +12,10 @@ async function withModuleFederation(options, configOverride) {
|
|
|
13
12
|
return (config) => config;
|
|
14
13
|
}
|
|
15
14
|
const { sharedDependencies, sharedLibraries, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options);
|
|
16
|
-
const isGlobal = isVarOrWindow(options.library?.type);
|
|
17
15
|
return (config, ctx) => {
|
|
18
16
|
config.output.uniqueName = options.name;
|
|
19
17
|
config.output.publicPath = 'auto';
|
|
20
|
-
|
|
21
|
-
config.output.scriptType = 'text/javascript';
|
|
22
|
-
}
|
|
18
|
+
config.output.scriptType = 'text/javascript';
|
|
23
19
|
config.optimization = {
|
|
24
20
|
...(config.optimization ?? {}),
|
|
25
21
|
runtimeChunk: false,
|
|
@@ -29,13 +25,8 @@ async function withModuleFederation(options, configOverride) {
|
|
|
29
25
|
!options.exposes) {
|
|
30
26
|
config.optimization.runtimeChunk = 'single';
|
|
31
27
|
}
|
|
32
|
-
config.experiments = {
|
|
33
|
-
...config.experiments,
|
|
34
|
-
outputModule: !isGlobal,
|
|
35
|
-
};
|
|
36
28
|
config.plugins.push(new webpack_1.ModuleFederationPlugin({
|
|
37
29
|
name: options.name,
|
|
38
|
-
library: options.library ?? { type: 'module' },
|
|
39
30
|
filename: 'remoteEntry.js',
|
|
40
31
|
exposes: options.exposes,
|
|
41
32
|
remotes: mappedRemotes,
|
|
@@ -48,7 +39,7 @@ async function withModuleFederation(options, configOverride) {
|
|
|
48
39
|
* { appX: 'appX@http://localhost:3001/remoteEntry.js' }
|
|
49
40
|
* { appY: 'appY@http://localhost:3002/remoteEntry.js' }
|
|
50
41
|
*/
|
|
51
|
-
|
|
42
|
+
remoteType: 'script',
|
|
52
43
|
/**
|
|
53
44
|
* Apply user-defined config overrides
|
|
54
45
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
2
|
export declare function updateModuleFederationProject(host: Tree, options: {
|
|
3
3
|
js?: boolean;
|
|
4
4
|
projectName: string;
|
|
@@ -7,4 +7,4 @@ export declare function updateModuleFederationProject(host: Tree, options: {
|
|
|
7
7
|
typescriptConfiguration?: boolean;
|
|
8
8
|
dynamic?: boolean;
|
|
9
9
|
bundler?: 'rspack' | 'webpack';
|
|
10
|
-
}):
|
|
10
|
+
}): void;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateModuleFederationProject = updateModuleFederationProject;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const versions_1 = require("../utils/versions");
|
|
6
5
|
const maybe_js_1 = require("../utils/maybe-js");
|
|
7
6
|
function updateModuleFederationProject(host, options) {
|
|
8
7
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
|
@@ -59,23 +58,23 @@ function updateModuleFederationProject(host, options) {
|
|
|
59
58
|
}
|
|
60
59
|
projectConfig.targets.serve.options.port = options.devServerPort;
|
|
61
60
|
// `serve-static` for remotes that don't need to be in development mode
|
|
61
|
+
const serveStaticExecutor = options.bundler === 'rspack'
|
|
62
|
+
? '@nx/rspack:module-federation-static-server'
|
|
63
|
+
: '@nx/react:module-federation-static-server';
|
|
62
64
|
projectConfig.targets['serve-static'] = {
|
|
63
|
-
executor:
|
|
65
|
+
executor: serveStaticExecutor,
|
|
64
66
|
defaultConfiguration: 'production',
|
|
65
67
|
options: {
|
|
66
|
-
|
|
67
|
-
watch: false,
|
|
68
|
-
port: options.devServerPort,
|
|
68
|
+
serveTarget: `${options.projectName}:serve`,
|
|
69
69
|
},
|
|
70
70
|
configurations: {
|
|
71
71
|
development: {
|
|
72
|
-
|
|
72
|
+
serveTarget: `${options.projectName}:serve:development`,
|
|
73
73
|
},
|
|
74
74
|
production: {
|
|
75
|
-
|
|
75
|
+
serveTarget: `${options.projectName}:serve:production`,
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
};
|
|
79
79
|
(0, devkit_1.updateProjectConfiguration)(host, options.projectName, projectConfig);
|
|
80
|
-
return (0, devkit_1.addDependenciesToPackageJson)(host, {}, { '@nx/web': versions_1.nxVersion });
|
|
81
80
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StaticRemotesConfig } from '@nx/webpack/src/utils/module-federation/parse-static-remotes-config';
|
|
2
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
3
|
+
import { ModuleFederationDevServerOptions } from '../executors/module-federation-dev-server/schema';
|
|
4
|
+
export declare function buildStaticRemotes(staticRemotesConfig: StaticRemotesConfig, nxBin: any, context: ExecutorContext, options: ModuleFederationDevServerOptions): Promise<Record<string, string>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildStaticRemotes = buildStaticRemotes;
|
|
4
|
+
const logger_1 = require("nx/src/utils/logger");
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
async function buildStaticRemotes(staticRemotesConfig, nxBin, context, options) {
|
|
10
|
+
if (!staticRemotesConfig.remotes.length) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
logger_1.logger.info(`NX Building ${staticRemotesConfig.remotes.length} static remotes...`);
|
|
14
|
+
const mappedLocationOfRemotes = {};
|
|
15
|
+
for (const app of staticRemotesConfig.remotes) {
|
|
16
|
+
mappedLocationOfRemotes[app] = `http${options.ssl ? 's' : ''}://${options.host}:${options.staticRemotesPort}/${staticRemotesConfig.config[app].urlSegment}`;
|
|
17
|
+
}
|
|
18
|
+
await new Promise((res, rej) => {
|
|
19
|
+
const staticProcess = (0, node_child_process_1.fork)(nxBin, [
|
|
20
|
+
'run-many',
|
|
21
|
+
`--target=build`,
|
|
22
|
+
`--projects=${staticRemotesConfig.remotes.join(',')}`,
|
|
23
|
+
...(context.configurationName
|
|
24
|
+
? [`--configuration=${context.configurationName}`]
|
|
25
|
+
: []),
|
|
26
|
+
...(options.parallel ? [`--parallel=${options.parallel}`] : []),
|
|
27
|
+
], {
|
|
28
|
+
cwd: context.root,
|
|
29
|
+
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
|
30
|
+
});
|
|
31
|
+
// File to debug build failures e.g. 2024-01-01T00_00_0_0Z-build.log'
|
|
32
|
+
const remoteBuildLogFile = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `${new Date().toISOString().replace(/[:\.]/g, '_')}-build.log`);
|
|
33
|
+
const stdoutStream = (0, fs_1.createWriteStream)(remoteBuildLogFile);
|
|
34
|
+
staticProcess.stdout.on('data', (data) => {
|
|
35
|
+
const ANSII_CODE_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
36
|
+
const stdoutString = data.toString().replace(ANSII_CODE_REGEX, '');
|
|
37
|
+
stdoutStream.write(stdoutString);
|
|
38
|
+
// in addition to writing into the stdout stream, also show error directly in console
|
|
39
|
+
// so the error is easily discoverable. 'ERROR in' is the key word to search in webpack output.
|
|
40
|
+
if (stdoutString.includes('ERROR in')) {
|
|
41
|
+
logger_1.logger.log(stdoutString);
|
|
42
|
+
}
|
|
43
|
+
if (stdoutString.includes('Successfully ran target build')) {
|
|
44
|
+
staticProcess.stdout.removeAllListeners('data');
|
|
45
|
+
logger_1.logger.info(`NX Built ${staticRemotesConfig.remotes.length} static remotes`);
|
|
46
|
+
res();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
staticProcess.stderr.on('data', (data) => logger_1.logger.info(data.toString()));
|
|
50
|
+
staticProcess.once('exit', (code) => {
|
|
51
|
+
stdoutStream.end();
|
|
52
|
+
staticProcess.stdout.removeAllListeners('data');
|
|
53
|
+
staticProcess.stderr.removeAllListeners('data');
|
|
54
|
+
if (code !== 0) {
|
|
55
|
+
rej(`Remote failed to start. A complete log can be found in: ${remoteBuildLogFile}`);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
res();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
process.on('SIGTERM', () => staticProcess.kill('SIGTERM'));
|
|
62
|
+
process.on('exit', () => staticProcess.kill('SIGTERM'));
|
|
63
|
+
});
|
|
64
|
+
return mappedLocationOfRemotes;
|
|
65
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -22,10 +22,9 @@ export declare const reactRouterDomVersion = "6.11.2";
|
|
|
22
22
|
export declare const testingLibraryReactVersion = "15.0.6";
|
|
23
23
|
export declare const reduxjsToolkitVersion = "1.9.3";
|
|
24
24
|
export declare const reactReduxVersion = "8.0.5";
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const eslintPluginImportVersion = "2.27.5";
|
|
25
|
+
export declare const eslintPluginImportVersion = "2.30.0";
|
|
27
26
|
export declare const eslintPluginJsxA11yVersion = "6.7.1";
|
|
28
|
-
export declare const eslintPluginReactVersion = "7.
|
|
27
|
+
export declare const eslintPluginReactVersion = "7.35.0";
|
|
29
28
|
export declare const eslintPluginReactHooksVersion = "4.6.0";
|
|
30
29
|
export declare const babelPluginStyledComponentsVersion = "1.10.7";
|
|
31
30
|
export declare const tsLibVersion = "^2.3.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.swcPluginStyledComponentsVersion = exports.swcPluginEmotionVersion = exports.swcPluginStyledJsxVersion = exports.svgrRollupVersion = exports.rollupPluginUrlVersion = exports.sassVersion = exports.lessVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.typesCorsVersion = exports.corsVersion = exports.isbotVersion = exports.typesExpressVersion = exports.expressVersion = exports.autoprefixerVersion = exports.tailwindcssVersion = exports.postcssVersion = exports.tsLibVersion = exports.babelPluginStyledComponentsVersion = exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.
|
|
3
|
+
exports.swcPluginStyledComponentsVersion = exports.swcPluginEmotionVersion = exports.swcPluginStyledJsxVersion = exports.svgrRollupVersion = exports.rollupPluginUrlVersion = exports.sassVersion = exports.lessVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.typesCorsVersion = exports.corsVersion = exports.isbotVersion = exports.typesExpressVersion = exports.expressVersion = exports.autoprefixerVersion = exports.tailwindcssVersion = exports.postcssVersion = exports.tsLibVersion = exports.babelPluginStyledComponentsVersion = exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.reactReduxVersion = exports.reduxjsToolkitVersion = exports.testingLibraryReactVersion = exports.reactRouterDomVersion = exports.styledJsxVersion = exports.emotionBabelPlugin = exports.emotionReactVersion = exports.emotionStyledVersion = exports.typesStyledComponentsVersion = exports.styledComponentsVersion = exports.babelCoreVersion = exports.babelPresetReactVersion = exports.typesNodeVersion = exports.reactViteVersion = exports.typesReactIsVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.babelLoaderVersion = exports.swcLoaderVersion = exports.reactIsVersion = exports.reactDomVersion = exports.reactVersion = exports.nxRspackVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
5
|
// Always pull the latest version until we merge rspack plugin into the repo.
|
|
6
6
|
exports.nxRspackVersion = '*';
|
|
@@ -27,10 +27,9 @@ exports.reactRouterDomVersion = '6.11.2';
|
|
|
27
27
|
exports.testingLibraryReactVersion = '15.0.6';
|
|
28
28
|
exports.reduxjsToolkitVersion = '1.9.3';
|
|
29
29
|
exports.reactReduxVersion = '8.0.5';
|
|
30
|
-
exports.
|
|
31
|
-
exports.eslintPluginImportVersion = '2.27.5';
|
|
30
|
+
exports.eslintPluginImportVersion = '2.30.0';
|
|
32
31
|
exports.eslintPluginJsxA11yVersion = '6.7.1';
|
|
33
|
-
exports.eslintPluginReactVersion = '7.
|
|
32
|
+
exports.eslintPluginReactVersion = '7.35.0';
|
|
34
33
|
exports.eslintPluginReactHooksVersion = '4.6.0';
|
|
35
34
|
exports.babelPluginStyledComponentsVersion = '1.10.7';
|
|
36
35
|
exports.tsLibVersion = '^2.3.0';
|