@nx/react 23.0.0-beta.2 → 23.0.0-beta.21
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/generators.json +16 -3
- package/index.d.ts +0 -3
- package/index.d.ts.map +1 -1
- package/index.js +1 -4
- package/migrations.json +6 -0
- package/package.json +18 -18
- package/plugins/component-testing/index.js +7 -7
- package/plugins/component-testing/webpack-fallback.js +2 -2
- package/plugins/storybook/index.js +3 -3
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts.map +1 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +6 -4
- package/src/executors/module-federation-dev-server/schema.json +1 -0
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts.map +1 -1
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +7 -5
- package/src/executors/module-federation-ssr-dev-server/schema.json +1 -0
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts.map +1 -1
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +6 -4
- package/src/executors/module-federation-static-server/schema.json +1 -0
- package/src/generators/_utils/mf-dependencies.d.ts +8 -0
- package/src/generators/_utils/mf-dependencies.d.ts.map +1 -0
- package/src/generators/_utils/mf-dependencies.js +84 -0
- package/src/generators/_utils/mf-versions.d.ts +12 -0
- package/src/generators/_utils/mf-versions.d.ts.map +1 -0
- package/src/generators/_utils/mf-versions.js +29 -0
- package/src/generators/_utils/normalize.d.ts +20 -0
- package/src/generators/_utils/normalize.d.ts.map +1 -0
- package/src/generators/_utils/normalize.js +48 -0
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +32 -18
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-linting.js +10 -11
- package/src/generators/application/lib/add-project.d.ts.map +1 -1
- package/src/generators/application/lib/add-project.js +10 -0
- package/src/generators/application/lib/add-routing.js +2 -2
- package/src/generators/application/lib/bundlers/add-vite.d.ts.map +1 -1
- package/src/generators/application/lib/bundlers/add-vite.js +10 -2
- package/src/generators/application/lib/create-application-files.d.ts +1 -1
- package/src/generators/application/lib/create-application-files.js +2 -2
- package/src/generators/application/lib/normalize-options.js +5 -5
- package/src/generators/component/component.js +2 -2
- package/src/generators/component/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/component/lib/normalize-options.js +5 -6
- package/src/generators/component/schema.d.ts +2 -7
- package/src/generators/component/schema.json +0 -5
- package/src/generators/component-story/component-story.d.ts.map +1 -1
- package/src/generators/component-story/component-story.js +3 -4
- package/src/generators/component-test/component-test.d.ts.map +1 -1
- package/src/generators/component-test/component-test.js +3 -4
- package/src/generators/consumer/consumer.d.ts +5 -0
- package/src/generators/consumer/consumer.d.ts.map +1 -0
- package/src/generators/consumer/consumer.js +135 -0
- package/src/generators/consumer/files/_common/src/App.tsx__tmpl__ +53 -0
- package/src/generators/consumer/files/_common/src/bootstrap.tsx__tmpl__ +12 -0
- package/src/generators/consumer/files/_common/src/index.ts__tmpl__ +4 -0
- package/src/generators/consumer/files/_common/src/mf.ts__tmpl__ +35 -0
- package/src/generators/consumer/files/_common/tsconfig.json__tmpl__ +17 -0
- package/src/generators/consumer/files/rsbuild/index.html__tmpl__ +12 -0
- package/src/generators/consumer/files/rsbuild/package.json__tmpl__ +23 -0
- package/src/generators/consumer/files/rsbuild/rsbuild.config.ts__tmpl__ +25 -0
- package/src/generators/consumer/files/rspack/index.html__tmpl__ +12 -0
- package/src/generators/consumer/files/rspack/package.json__tmpl__ +23 -0
- package/src/generators/consumer/files/rspack/rspack.config.ts__tmpl__ +59 -0
- package/src/generators/consumer/files/vite/index.html__tmpl__ +12 -0
- package/src/generators/consumer/files/vite/package.json__tmpl__ +24 -0
- package/src/generators/consumer/files/vite/vite.config.ts__tmpl__ +27 -0
- package/src/generators/consumer/schema.d.ts +8 -0
- package/src/generators/consumer/schema.json +43 -0
- package/src/generators/cypress-component-configuration/lib/add-files.d.ts +1 -1
- package/src/generators/cypress-component-configuration/lib/add-files.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/lib/add-files.js +4 -4
- package/src/generators/federate-module/federate-module.d.ts.map +1 -1
- package/src/generators/federate-module/federate-module.js +4 -2
- package/src/generators/federate-module/lib/utils.js +2 -2
- package/src/generators/hook/hook.d.ts.map +1 -1
- package/src/generators/hook/hook.js +5 -6
- package/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +2 -2
- package/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +2 -2
- package/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +2 -2
- package/src/generators/host/host.d.ts.map +1 -1
- package/src/generators/host/host.js +7 -5
- package/src/generators/host/lib/add-module-federation-files.d.ts.map +1 -1
- package/src/generators/host/lib/add-module-federation-files.js +3 -3
- package/src/generators/host/lib/normalize-host-name.js +2 -2
- package/src/generators/host/lib/update-module-federation-tsconfig.js +2 -2
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +2 -2
- package/src/generators/library/lib/add-linting.js +7 -8
- package/src/generators/library/lib/add-rollup-build-target.d.ts.map +1 -1
- package/src/generators/library/lib/add-rollup-build-target.js +6 -0
- package/src/generators/library/lib/install-common-dependencies.js +2 -2
- package/src/generators/library/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/library/lib/normalize-options.js +7 -7
- package/src/generators/library/lib/update-app-routes.js +2 -2
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +14 -18
- package/src/generators/provider/files/_common/src/__componentName__.tsx__tmpl__ +11 -0
- package/src/generators/provider/files/_common/src/bootstrap.tsx__tmpl__ +12 -0
- package/src/generators/provider/files/_common/src/index.ts__tmpl__ +5 -0
- package/src/generators/provider/files/_common/tsconfig.json__tmpl__ +17 -0
- package/src/generators/provider/files/rsbuild/index.html__tmpl__ +12 -0
- package/src/generators/provider/files/rsbuild/package.json__tmpl__ +22 -0
- package/src/generators/provider/files/rsbuild/rsbuild.config.ts__tmpl__ +31 -0
- package/src/generators/provider/files/rspack/index.html__tmpl__ +12 -0
- package/src/generators/provider/files/rspack/package.json__tmpl__ +22 -0
- package/src/generators/provider/files/rspack/rspack.config.ts__tmpl__ +69 -0
- package/src/generators/provider/files/vite/index.html__tmpl__ +12 -0
- package/src/generators/provider/files/vite/package.json__tmpl__ +23 -0
- package/src/generators/provider/files/vite/vite.config.ts__tmpl__ +37 -0
- package/src/generators/provider/provider.d.ts +5 -0
- package/src/generators/provider/provider.d.ts.map +1 -0
- package/src/generators/provider/provider.js +92 -0
- package/src/generators/provider/schema.d.ts +9 -0
- package/src/generators/provider/schema.json +46 -0
- package/src/generators/redux/redux.d.ts.map +1 -1
- package/src/generators/redux/redux.js +7 -8
- package/src/generators/redux/schema.d.ts +1 -1
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +1 -1
- package/src/generators/remote/lib/setup-package-json-exports-for-remote.js +2 -2
- package/src/generators/remote/lib/update-host-with-remote.js +4 -5
- package/src/generators/remote/remote.d.ts.map +1 -1
- package/src/generators/remote/remote.js +9 -7
- package/src/generators/setup-ssr/setup-ssr.d.ts.map +1 -1
- package/src/generators/setup-ssr/setup-ssr.js +5 -7
- package/src/generators/stories/stories.js +5 -6
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts.map +1 -1
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +2 -2
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts.map +1 -1
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.js +2 -2
- package/src/migrations/update-22-0-0/add-svgr-to-webpack-config.d.ts.map +1 -1
- package/src/migrations/update-22-0-0/add-svgr-to-webpack-config.js +2 -2
- package/src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import.d.ts +3 -0
- package/src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import.js +128 -0
- package/src/module-federation/ast-utils.js +2 -2
- package/src/plugins/router-plugin.d.ts.map +1 -1
- package/src/plugins/router-plugin.js +14 -23
- package/src/rules/update-module-federation-project.js +3 -3
- package/src/utils/add-mf-env-to-inputs.d.ts.map +1 -1
- package/src/utils/add-mf-env-to-inputs.js +15 -8
- package/src/utils/ast-utils.js +15 -15
- package/src/utils/component-props.js +3 -3
- package/src/utils/create-ts-config.js +3 -3
- package/src/utils/ct-utils.d.ts +1 -1
- package/src/utils/ct-utils.d.ts.map +1 -1
- package/src/utils/ct-utils.js +6 -6
- package/src/utils/module-federation-deprecation.d.ts +13 -0
- package/src/utils/module-federation-deprecation.d.ts.map +1 -0
- package/src/utils/module-federation-deprecation.js +46 -0
- package/src/utils/normalize-remote.js +2 -2
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/tailwind.js +2 -2
package/src/utils/ast-utils.js
CHANGED
|
@@ -21,11 +21,11 @@ exports.getComponentNode = getComponentNode;
|
|
|
21
21
|
exports.parseComponentPropsInfo = parseComponentPropsInfo;
|
|
22
22
|
const js_1 = require("@nx/js");
|
|
23
23
|
const devkit_1 = require("@nx/devkit");
|
|
24
|
-
const
|
|
24
|
+
const internal_1 = require("@nx/js/internal");
|
|
25
25
|
let tsModule;
|
|
26
26
|
function addImport(source, statement) {
|
|
27
27
|
if (!tsModule) {
|
|
28
|
-
tsModule = (0,
|
|
28
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
29
29
|
}
|
|
30
30
|
const allImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration);
|
|
31
31
|
if (allImports.length > 0) {
|
|
@@ -50,7 +50,7 @@ function addImport(source, statement) {
|
|
|
50
50
|
}
|
|
51
51
|
function findMainRenderStatement(source) {
|
|
52
52
|
if (!tsModule) {
|
|
53
|
-
tsModule = (0,
|
|
53
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
54
54
|
}
|
|
55
55
|
// 1. Try to find ReactDOM.render.
|
|
56
56
|
const calls = (0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression);
|
|
@@ -88,7 +88,7 @@ function findDefaultExport(source) {
|
|
|
88
88
|
}
|
|
89
89
|
function findDefaultExportDeclaration(source) {
|
|
90
90
|
if (!tsModule) {
|
|
91
|
-
tsModule = (0,
|
|
91
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
92
92
|
}
|
|
93
93
|
const identifier = findDefaultExportIdentifier(source);
|
|
94
94
|
if (identifier) {
|
|
@@ -107,7 +107,7 @@ function findDefaultExportDeclaration(source) {
|
|
|
107
107
|
}
|
|
108
108
|
function findExportDeclarationsForJsx(source) {
|
|
109
109
|
if (!tsModule) {
|
|
110
|
-
tsModule = (0,
|
|
110
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
111
111
|
}
|
|
112
112
|
const variables = (0, js_1.findNodes)(source, tsModule.SyntaxKind.VariableDeclaration);
|
|
113
113
|
const variableStatements = (0, js_1.findNodes)(source, tsModule.SyntaxKind.VariableStatement);
|
|
@@ -157,7 +157,7 @@ function findExportDeclarationsForJsx(source) {
|
|
|
157
157
|
}
|
|
158
158
|
function findDefaultExportIdentifier(source) {
|
|
159
159
|
if (!tsModule) {
|
|
160
|
-
tsModule = (0,
|
|
160
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
161
161
|
}
|
|
162
162
|
const exports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ExportAssignment);
|
|
163
163
|
const identifier = exports
|
|
@@ -167,7 +167,7 @@ function findDefaultExportIdentifier(source) {
|
|
|
167
167
|
}
|
|
168
168
|
function findDefaultClassOrFunction(source) {
|
|
169
169
|
if (!tsModule) {
|
|
170
|
-
tsModule = (0,
|
|
170
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
171
171
|
}
|
|
172
172
|
const fns = (0, js_1.findNodes)(source, tsModule.SyntaxKind.FunctionDeclaration);
|
|
173
173
|
const cls = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ClassDeclaration);
|
|
@@ -177,7 +177,7 @@ function findDefaultClassOrFunction(source) {
|
|
|
177
177
|
}
|
|
178
178
|
function hasDefaultExportModifier(x) {
|
|
179
179
|
if (!tsModule) {
|
|
180
|
-
tsModule = (0,
|
|
180
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
181
181
|
}
|
|
182
182
|
return (x.modifiers &&
|
|
183
183
|
x.modifiers.some((m) => m.kind === tsModule.SyntaxKind.ExportKeyword) &&
|
|
@@ -185,7 +185,7 @@ function hasDefaultExportModifier(x) {
|
|
|
185
185
|
}
|
|
186
186
|
function findComponentImportPath(componentName, source) {
|
|
187
187
|
if (!tsModule) {
|
|
188
|
-
tsModule = (0,
|
|
188
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
189
189
|
}
|
|
190
190
|
const allImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration);
|
|
191
191
|
const matching = allImports.filter((i) => {
|
|
@@ -201,7 +201,7 @@ function findComponentImportPath(componentName, source) {
|
|
|
201
201
|
}
|
|
202
202
|
function findElements(source, tagName) {
|
|
203
203
|
if (!tsModule) {
|
|
204
|
-
tsModule = (0,
|
|
204
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
205
205
|
}
|
|
206
206
|
const nodes = (0, js_1.findNodes)(source, [
|
|
207
207
|
tsModule.SyntaxKind.JsxSelfClosingElement,
|
|
@@ -222,7 +222,7 @@ function findClosestOpening(tagName, node) {
|
|
|
222
222
|
}
|
|
223
223
|
function isTag(tagName, node) {
|
|
224
224
|
if (!tsModule) {
|
|
225
|
-
tsModule = (0,
|
|
225
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
226
226
|
}
|
|
227
227
|
if (tsModule.isJsxOpeningLikeElement(node)) {
|
|
228
228
|
return (node.tagName.kind === tsModule.SyntaxKind.Identifier &&
|
|
@@ -236,7 +236,7 @@ function isTag(tagName, node) {
|
|
|
236
236
|
}
|
|
237
237
|
function addInitialRoutes(sourcePath, source, addBrowserRouter) {
|
|
238
238
|
if (!tsModule) {
|
|
239
|
-
tsModule = (0,
|
|
239
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
240
240
|
}
|
|
241
241
|
const jsxClosingElements = (0, js_1.findNodes)(source, [
|
|
242
242
|
tsModule.SyntaxKind.JsxClosingElement,
|
|
@@ -405,7 +405,7 @@ const store = configureStore({
|
|
|
405
405
|
}
|
|
406
406
|
function updateReduxStore(sourcePath, source, feature) {
|
|
407
407
|
if (!tsModule) {
|
|
408
|
-
tsModule = (0,
|
|
408
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
409
409
|
}
|
|
410
410
|
const calls = (0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression);
|
|
411
411
|
let reducerDescriptor;
|
|
@@ -459,7 +459,7 @@ function updateReduxStore(sourcePath, source, feature) {
|
|
|
459
459
|
}
|
|
460
460
|
function getComponentNode(sourceFile) {
|
|
461
461
|
if (!tsModule) {
|
|
462
|
-
tsModule = (0,
|
|
462
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
463
463
|
}
|
|
464
464
|
const defaultExport = findDefaultExport(sourceFile);
|
|
465
465
|
if (!(defaultExport &&
|
|
@@ -472,7 +472,7 @@ function getComponentNode(sourceFile) {
|
|
|
472
472
|
}
|
|
473
473
|
function parseComponentPropsInfo(sourceFile, cmpDeclaration) {
|
|
474
474
|
if (!tsModule) {
|
|
475
|
-
tsModule = (0,
|
|
475
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
476
476
|
}
|
|
477
477
|
let propsTypeName = null;
|
|
478
478
|
let inlineTypeString = null;
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getArgsDefaultValue = getArgsDefaultValue;
|
|
4
4
|
exports.getComponentPropDefaults = getComponentPropDefaults;
|
|
5
5
|
exports.getImportForType = getImportForType;
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
const ast_utils_1 = require("./ast-utils");
|
|
8
8
|
let tsModule;
|
|
9
9
|
// TODO: candidate to refactor with the angular component story
|
|
10
10
|
function getArgsDefaultValue(property) {
|
|
11
11
|
if (!tsModule) {
|
|
12
|
-
tsModule = (0,
|
|
12
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
13
13
|
}
|
|
14
14
|
const typeNameToDefault = {
|
|
15
15
|
[tsModule.SyntaxKind.StringKeyword]: "''",
|
|
@@ -26,7 +26,7 @@ function getArgsDefaultValue(property) {
|
|
|
26
26
|
}
|
|
27
27
|
function getComponentPropDefaults(sourceFile, cmpDeclaration) {
|
|
28
28
|
if (!tsModule) {
|
|
29
|
-
tsModule = (0,
|
|
29
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
30
30
|
}
|
|
31
31
|
const info = (0, ast_utils_1.parseComponentPropsInfo)(sourceFile, cmpDeclaration);
|
|
32
32
|
let propsTypeName = null;
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createTsConfig = createTsConfig;
|
|
4
4
|
exports.extractTsConfigBase = extractTsConfigBase;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
-
const shared = tslib_1.__importStar(require("@nx/js
|
|
6
|
+
const shared = tslib_1.__importStar(require("@nx/js"));
|
|
7
7
|
const json_1 = require("nx/src/generators/utils/json");
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@nx/js/internal");
|
|
9
9
|
function createTsConfig(host, projectRoot, type, options, relativePathToRootTsConfig) {
|
|
10
|
-
if ((0,
|
|
10
|
+
if ((0, internal_1.isUsingTsSolutionSetup)(host)) {
|
|
11
11
|
createTsConfigForTsSolution(host, projectRoot, type, options, relativePathToRootTsConfig);
|
|
12
12
|
}
|
|
13
13
|
else {
|
package/src/utils/ct-utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { type FoundTarget } from '@nx/cypress/
|
|
2
|
+
import { type FoundTarget } from '@nx/cypress/internal';
|
|
3
3
|
export declare function configureCypressCT(tree: Tree, options: {
|
|
4
4
|
project: string;
|
|
5
5
|
buildTarget: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/ct-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAEL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ct-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/ct-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAEL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAQxD,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACjC,GACA,OAAO,CAAC,WAAW,CAAC,CAiEtB;AAUD,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAY7B;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAC/D,KAAK,EAAE,WAAW,+BASnB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAmBjE"}
|
package/src/utils/ct-utils.js
CHANGED
|
@@ -38,7 +38,7 @@ exports.getBundlerFromTarget = getBundlerFromTarget;
|
|
|
38
38
|
exports.getActualBundler = getActualBundler;
|
|
39
39
|
exports.isComponent = isComponent;
|
|
40
40
|
const devkit_1 = require("@nx/devkit");
|
|
41
|
-
const
|
|
41
|
+
const internal_1 = require("@nx/js/internal");
|
|
42
42
|
const ast_utils_1 = require("./ast-utils");
|
|
43
43
|
let tsModule;
|
|
44
44
|
const allowedFileExt = new RegExp(/\.[jt]sx?/);
|
|
@@ -48,7 +48,7 @@ async function configureCypressCT(tree, options) {
|
|
|
48
48
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
49
49
|
// Specifically undefined as a workaround for Remix to pass an empty string as the buildTarget
|
|
50
50
|
if (options.buildTarget === undefined) {
|
|
51
|
-
const { findBuildConfig } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/
|
|
51
|
+
const { findBuildConfig } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/internal')));
|
|
52
52
|
found = await findBuildConfig(tree, {
|
|
53
53
|
project: options.project,
|
|
54
54
|
buildTarget: options.buildTarget,
|
|
@@ -65,7 +65,7 @@ async function configureCypressCT(tree, options) {
|
|
|
65
65
|
throw new Error(`Cypress Component Testing is not currently supported for this project. Either 'executer' is not defined in '${target} target' of '${project} project.json' or executer present is not valid one. Valid ones are ${JSON.stringify([...options.validExecutorNames])}. Please check https://github.com/nrwl/nx/issues/21546 for more information.`);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
const { addDefaultCTConfig, getProjectCypressConfigPath } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/
|
|
68
|
+
const { addDefaultCTConfig, getProjectCypressConfigPath } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/internal')));
|
|
69
69
|
const ctConfigOptions = {
|
|
70
70
|
bundler: options.bundler ?? (await getActualBundler(tree, options, found)),
|
|
71
71
|
};
|
|
@@ -82,8 +82,8 @@ async function configureCypressCT(tree, options) {
|
|
|
82
82
|
ctConfigOptions.buildTarget = found.target;
|
|
83
83
|
}
|
|
84
84
|
const cypressConfigFilePath = getProjectCypressConfigPath(tree, projectConfig.root);
|
|
85
|
-
const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigFilePath, 'utf-8'), ctConfigOptions);
|
|
86
|
-
tree.write(cypressConfigFilePath,
|
|
85
|
+
const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigFilePath, 'utf-8'), ctConfigOptions, '@nx/react/plugins/component-testing');
|
|
86
|
+
tree.write(cypressConfigFilePath, updatedCyConfig);
|
|
87
87
|
return found;
|
|
88
88
|
}
|
|
89
89
|
function assertValidConfig(config) {
|
|
@@ -109,7 +109,7 @@ async function getActualBundler(tree, options, found) {
|
|
|
109
109
|
}
|
|
110
110
|
function isComponent(tree, filePath) {
|
|
111
111
|
if (!tsModule) {
|
|
112
|
-
tsModule = (0,
|
|
112
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
113
113
|
}
|
|
114
114
|
if (isSpecFile.test(filePath) || !allowedFileExt.test(filePath)) {
|
|
115
115
|
return false;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const REACT_HOST_GENERATOR_DEPRECATION_MESSAGE = "The `@nx/react:host` generator is deprecated and will be removed in Nx v24. Use `nx g @nx/react:consumer` (dynamic federation, no static-serve orchestration). See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide.";
|
|
2
|
+
export declare const REACT_REMOTE_GENERATOR_DEPRECATION_MESSAGE = "The `@nx/react:remote` generator is deprecated and will be removed in Nx v24. Use `nx g @nx/react:provider` instead. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide.";
|
|
3
|
+
export declare const REACT_FEDERATE_MODULE_GENERATOR_DEPRECATION_MESSAGE = "The `@nx/react:federate-module` generator is deprecated and will be removed in Nx v24. The new `@nx/react:provider` generator exposes modules directly. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide.";
|
|
4
|
+
export declare const REACT_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/react:module-federation-dev-server` executor is deprecated and will be removed in Nx v24. Dynamic federation in `@nx/react:consumer` removes the need for host-orchestrated remote serving. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide.";
|
|
5
|
+
export declare const REACT_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/react:module-federation-ssr-dev-server` executor is deprecated and will be removed in Nx v24. SSR is not first-classed in the new generators; see https://nx.dev/docs/technologies/module-federation/consumer-and-provider for guidance on wiring SSR with `@nx/react:consumer`.";
|
|
6
|
+
export declare const REACT_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/react:module-federation-static-server` executor is deprecated and will be removed in Nx v24. Use plain `vite preview` / `rsbuild preview` via `nx:run-commands` if a static-serve workflow is still needed. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for details.";
|
|
7
|
+
export declare function warnReactHostGeneratorDeprecation(): void;
|
|
8
|
+
export declare function warnReactRemoteGeneratorDeprecation(): void;
|
|
9
|
+
export declare function warnReactFederateModuleGeneratorDeprecation(): void;
|
|
10
|
+
export declare function warnReactMfDevServerExecutorDeprecation(): void;
|
|
11
|
+
export declare function warnReactMfSsrDevServerExecutorDeprecation(): void;
|
|
12
|
+
export declare function warnReactMfStaticServerExecutorDeprecation(): void;
|
|
13
|
+
//# sourceMappingURL=module-federation-deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-federation-deprecation.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/module-federation-deprecation.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,wCAAwC,6QAAyN,CAAC;AAE/Q,eAAO,MAAM,0CAA0C,mOAA+K,CAAC;AAEvO,eAAO,MAAM,mDAAmD,sQAAkN,CAAC;AAEnR,eAAO,MAAM,gDAAgD,mTAA+P,CAAC;AAE7T,eAAO,MAAM,oDAAoD,8RAA0O,CAAC;AAE5S,eAAO,MAAM,mDAAmD,mTAAmQ,CAAC;AAEpU,wBAAgB,iCAAiC,IAAI,IAAI,CAExD;AAED,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D;AAED,wBAAgB,2CAA2C,IAAI,IAAI,CAElE;AAWD,wBAAgB,uCAAuC,IAAI,IAAI,CAK9D;AAED,wBAAgB,0CAA0C,IAAI,IAAI,CAKjE;AAED,wBAAgB,0CAA0C,IAAI,IAAI,CAKjE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REACT_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.REACT_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.REACT_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.REACT_FEDERATE_MODULE_GENERATOR_DEPRECATION_MESSAGE = exports.REACT_REMOTE_GENERATOR_DEPRECATION_MESSAGE = exports.REACT_HOST_GENERATOR_DEPRECATION_MESSAGE = void 0;
|
|
4
|
+
exports.warnReactHostGeneratorDeprecation = warnReactHostGeneratorDeprecation;
|
|
5
|
+
exports.warnReactRemoteGeneratorDeprecation = warnReactRemoteGeneratorDeprecation;
|
|
6
|
+
exports.warnReactFederateModuleGeneratorDeprecation = warnReactFederateModuleGeneratorDeprecation;
|
|
7
|
+
exports.warnReactMfDevServerExecutorDeprecation = warnReactMfDevServerExecutorDeprecation;
|
|
8
|
+
exports.warnReactMfSsrDevServerExecutorDeprecation = warnReactMfSsrDevServerExecutorDeprecation;
|
|
9
|
+
exports.warnReactMfStaticServerExecutorDeprecation = warnReactMfStaticServerExecutorDeprecation;
|
|
10
|
+
const devkit_1 = require("@nx/devkit");
|
|
11
|
+
// TODO(v24): Remove these surfaces. Replaced by `@nx/react:consumer`
|
|
12
|
+
// and `@nx/react:provider` (React, dynamic federation, Vite/Rsbuild/Rspack).
|
|
13
|
+
const MIGRATION_URL = 'https://nx.dev/docs/technologies/module-federation/consumer-and-provider';
|
|
14
|
+
exports.REACT_HOST_GENERATOR_DEPRECATION_MESSAGE = `The \`@nx/react:host\` generator is deprecated and will be removed in Nx v24. Use \`nx g @nx/react:consumer\` (dynamic federation, no static-serve orchestration). See ${MIGRATION_URL} for the v23 migration guide.`;
|
|
15
|
+
exports.REACT_REMOTE_GENERATOR_DEPRECATION_MESSAGE = `The \`@nx/react:remote\` generator is deprecated and will be removed in Nx v24. Use \`nx g @nx/react:provider\` instead. See ${MIGRATION_URL} for the v23 migration guide.`;
|
|
16
|
+
exports.REACT_FEDERATE_MODULE_GENERATOR_DEPRECATION_MESSAGE = `The \`@nx/react:federate-module\` generator is deprecated and will be removed in Nx v24. The new \`@nx/react:provider\` generator exposes modules directly. See ${MIGRATION_URL} for the v23 migration guide.`;
|
|
17
|
+
exports.REACT_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/react:module-federation-dev-server\` executor is deprecated and will be removed in Nx v24. Dynamic federation in \`@nx/react:consumer\` removes the need for host-orchestrated remote serving. See ${MIGRATION_URL} for the v23 migration guide.`;
|
|
18
|
+
exports.REACT_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/react:module-federation-ssr-dev-server\` executor is deprecated and will be removed in Nx v24. SSR is not first-classed in the new generators; see ${MIGRATION_URL} for guidance on wiring SSR with \`@nx/react:consumer\`.`;
|
|
19
|
+
exports.REACT_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/react:module-federation-static-server\` executor is deprecated and will be removed in Nx v24. Use plain \`vite preview\` / \`rsbuild preview\` via \`nx:run-commands\` if a static-serve workflow is still needed. See ${MIGRATION_URL} for details.`;
|
|
20
|
+
function warnReactHostGeneratorDeprecation() {
|
|
21
|
+
devkit_1.logger.warn(exports.REACT_HOST_GENERATOR_DEPRECATION_MESSAGE);
|
|
22
|
+
}
|
|
23
|
+
function warnReactRemoteGeneratorDeprecation() {
|
|
24
|
+
devkit_1.logger.warn(exports.REACT_REMOTE_GENERATOR_DEPRECATION_MESSAGE);
|
|
25
|
+
}
|
|
26
|
+
function warnReactFederateModuleGeneratorDeprecation() {
|
|
27
|
+
devkit_1.logger.warn(exports.REACT_FEDERATE_MODULE_GENERATOR_DEPRECATION_MESSAGE);
|
|
28
|
+
}
|
|
29
|
+
// Executor warnings fire once per process (dev-server reload loops would
|
|
30
|
+
// otherwise flood the console).
|
|
31
|
+
const executorWarned = new Set();
|
|
32
|
+
function warnOnce(key, message) {
|
|
33
|
+
if (executorWarned.has(key))
|
|
34
|
+
return;
|
|
35
|
+
executorWarned.add(key);
|
|
36
|
+
devkit_1.logger.warn(message);
|
|
37
|
+
}
|
|
38
|
+
function warnReactMfDevServerExecutorDeprecation() {
|
|
39
|
+
warnOnce('react-mf-dev-server', exports.REACT_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE);
|
|
40
|
+
}
|
|
41
|
+
function warnReactMfSsrDevServerExecutorDeprecation() {
|
|
42
|
+
warnOnce('react-mf-ssr-dev-server', exports.REACT_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE);
|
|
43
|
+
}
|
|
44
|
+
function warnReactMfStaticServerExecutorDeprecation() {
|
|
45
|
+
warnOnce('react-mf-static-server', exports.REACT_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE);
|
|
46
|
+
}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeRemoteName = normalizeRemoteName;
|
|
4
4
|
exports.normalizeRemoteDirectory = normalizeRemoteDirectory;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
async function normalizeRemoteName(tree, remote, options) {
|
|
8
|
-
const { projectName: remoteName } = await (0,
|
|
8
|
+
const { projectName: remoteName } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
9
9
|
name: remote,
|
|
10
10
|
projectType: 'application',
|
|
11
11
|
directory: options.directory,
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const typesReactDomVersion = "^19.0.0";
|
|
|
13
13
|
export declare const typesReactIsV18Version = "18.3.0";
|
|
14
14
|
export declare const typesReactIsVersion = "^19.0.0";
|
|
15
15
|
export declare const reactViteVersion = "^4.2.0";
|
|
16
|
-
export declare const typesNodeVersion = "^
|
|
16
|
+
export declare const typesNodeVersion = "^22.0.0";
|
|
17
17
|
export declare const babelPresetReactVersion = "^7.14.5";
|
|
18
18
|
export declare const babelCoreVersion = "^7.14.5";
|
|
19
19
|
export declare const reactRouterDomVersion = "6.30.3";
|
package/src/utils/versions.js
CHANGED
|
@@ -17,7 +17,7 @@ exports.typesReactIsV18Version = '18.3.0';
|
|
|
17
17
|
exports.typesReactIsVersion = '^19.0.0';
|
|
18
18
|
exports.reactViteVersion = '^4.2.0';
|
|
19
19
|
// Needed for React-Router
|
|
20
|
-
exports.typesNodeVersion = '^
|
|
20
|
+
exports.typesNodeVersion = '^22.0.0';
|
|
21
21
|
exports.babelPresetReactVersion = '^7.14.5';
|
|
22
22
|
exports.babelCoreVersion = '^7.14.5';
|
|
23
23
|
exports.reactRouterDomVersion = '6.30.3';
|
package/tailwind.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createGlobPatternsForDependencies = createGlobPatternsForDependencies;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/js/internal");
|
|
5
5
|
let hasWarned = false;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated `@nx/react/tailwind` will be removed in Nx 24. Migrate to Tailwind CSS v4 which no longer needs glob patterns.
|
|
@@ -15,7 +15,7 @@ function createGlobPatternsForDependencies(dirPath, fileGlobPattern = '/**/!(*.s
|
|
|
15
15
|
`See: https://nx.dev/docs/technologies/react/guides/using-tailwind-css-in-react\n`);
|
|
16
16
|
}
|
|
17
17
|
try {
|
|
18
|
-
return (0,
|
|
18
|
+
return (0, internal_1.createGlobPatternsForDependencies)(dirPath, fileGlobPattern);
|
|
19
19
|
}
|
|
20
20
|
catch (e) {
|
|
21
21
|
/**
|