@nx/react 23.0.0-beta.0 → 23.0.0-beta.10
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 +0 -7
- package/index.d.ts +0 -2
- package/index.d.ts.map +1 -1
- package/index.js +1 -5
- package/package.json +19 -24
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +2 -2
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +3 -3
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +2 -2
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +3 -19
- package/src/generators/application/files/base-rsbuild/tsconfig.app.json__tmpl__ +0 -2
- package/src/generators/application/files/base-rspack/tsconfig.app.json__tmpl__ +0 -2
- package/src/generators/application/files/base-vite/index.html__tmpl__ +1 -1
- package/src/generators/application/files/base-vite/tsconfig.app.json__tmpl__ +0 -2
- package/src/generators/application/files/base-webpack/tsconfig.app.json__tmpl__ +0 -2
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-project.d.ts.map +1 -1
- package/src/generators/application/lib/add-project.js +14 -4
- package/src/generators/application/lib/bundlers/add-rsbuild.d.ts.map +1 -1
- package/src/generators/application/lib/bundlers/add-rsbuild.js +2 -21
- package/src/generators/application/lib/bundlers/add-rspack.d.ts +0 -1
- package/src/generators/application/lib/bundlers/add-rspack.d.ts.map +1 -1
- package/src/generators/application/lib/bundlers/add-rspack.js +0 -25
- package/src/generators/application/lib/create-application-files.d.ts +1 -2
- package/src/generators/application/lib/create-application-files.d.ts.map +1 -1
- package/src/generators/application/lib/create-application-files.js +8 -60
- package/src/generators/application/lib/install-common-dependencies.d.ts.map +1 -1
- package/src/generators/application/lib/install-common-dependencies.js +2 -7
- package/src/generators/application/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/application/lib/normalize-options.js +3 -7
- package/src/generators/application/lib/update-jest-config.d.ts.map +1 -1
- package/src/generators/application/lib/update-jest-config.js +0 -3
- package/src/generators/application/schema.d.ts +0 -1
- package/src/generators/application/schema.json +2 -21
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +2 -5
- package/src/generators/component/files/__fileName__.__ext__ +3 -18
- package/src/generators/component/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/component/lib/normalize-options.js +3 -8
- package/src/generators/component/schema.d.ts +2 -8
- package/src/generators/component/schema.json +2 -26
- package/src/generators/federate-module/federate-module.d.ts.map +1 -1
- package/src/generators/federate-module/federate-module.js +2 -2
- package/src/generators/hook/hook.d.ts.map +1 -1
- package/src/generators/hook/hook.js +2 -2
- package/src/generators/host/host.d.ts.map +1 -1
- package/src/generators/host/host.js +2 -2
- package/src/generators/host/lib/normalize-host-name.js +2 -2
- package/src/generators/host/schema.json +2 -21
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +2 -2
- package/src/generators/library/files/common/tsconfig.lib.json__tmpl__ +0 -1
- package/src/generators/library/files/vite/tsconfig.lib.json__tmpl__ +0 -1
- package/src/generators/library/lib/add-rollup-build-target.d.ts.map +1 -1
- package/src/generators/library/lib/add-rollup-build-target.js +7 -6
- package/src/generators/library/lib/create-files.d.ts.map +1 -1
- package/src/generators/library/lib/create-files.js +1 -12
- package/src/generators/library/lib/install-common-dependencies.d.ts.map +1 -1
- package/src/generators/library/lib/install-common-dependencies.js +2 -7
- package/src/generators/library/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/library/lib/normalize-options.js +3 -3
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +4 -6
- package/src/generators/library/schema.json +2 -21
- package/src/generators/redux/redux.d.ts.map +1 -1
- package/src/generators/redux/redux.js +2 -2
- package/src/generators/redux/schema.d.ts +1 -1
- package/src/generators/remote/remote.d.ts.map +1 -1
- package/src/generators/remote/remote.js +2 -2
- package/src/generators/remote/schema.json +2 -21
- 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 +34 -7
- package/src/plugins/router-plugin.d.ts.map +1 -1
- package/src/plugins/router-plugin.js +11 -19
- package/src/utils/assertion.d.ts.map +1 -1
- package/src/utils/assertion.js +1 -10
- package/src/utils/create-ts-config.js +0 -7
- package/src/utils/normalize-remote.js +2 -2
- package/src/utils/versions.d.ts +2 -15
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +3 -18
- package/tailwind.d.ts +2 -3
- package/tailwind.d.ts.map +1 -1
- package/tailwind.js +11 -5
- package/typings/style.d.ts +1 -9
- package/src/generators/application/files/style-styled-jsx/src/app/__fileName__.tsx__tmpl__ +0 -46
- package/src/generators/application/files/style-styled-module/src/app/__fileName__.tsx__tmpl__ +0 -49
- package/src/generators/application/files/style-tailwind/src/app/__fileName__.tsx__tmpl__ +0 -45
- package/src/generators/application/files/style-tailwind/src/styles.css +0 -1
- package/src/generators/application/lib/show-possible-warnings.d.ts +0 -4
- package/src/generators/application/lib/show-possible-warnings.d.ts.map +0 -1
- package/src/generators/application/lib/show-possible-warnings.js +0 -11
- package/src/generators/setup-tailwind/files/postcss.config.js__tmpl__ +0 -15
- package/src/generators/setup-tailwind/files/tailwind.config.js__tmpl__ +0 -17
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js +0 -27
- package/src/generators/setup-tailwind/lib/update-project.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/update-project.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/update-project.js +0 -11
- package/src/generators/setup-tailwind/schema.d.ts +0 -7
- package/src/generators/setup-tailwind/schema.d.ts.map +0 -1
- package/src/generators/setup-tailwind/schema.js +0 -2
- package/src/generators/setup-tailwind/schema.json +0 -47
- package/src/generators/setup-tailwind/setup-tailwind.d.ts +0 -5
- package/src/generators/setup-tailwind/setup-tailwind.d.ts.map +0 -1
- package/src/generators/setup-tailwind/setup-tailwind.js +0 -35
- package/src/rules/add-styled-dependencies.d.ts +0 -6
- package/src/rules/add-styled-dependencies.d.ts.map +0 -1
- package/src/rules/add-styled-dependencies.js +0 -16
- package/src/utils/styled.d.ts +0 -4
- package/src/utils/styled.d.ts.map +0 -1
- package/src/utils/styled.js +0 -62
package/generators.json
CHANGED
|
@@ -86,13 +86,6 @@
|
|
|
86
86
|
"description": "Generate a Cypress component test for a React component",
|
|
87
87
|
"hidden": false
|
|
88
88
|
},
|
|
89
|
-
"setup-tailwind": {
|
|
90
|
-
"factory": "./src/generators/setup-tailwind/setup-tailwind#setupTailwindGenerator",
|
|
91
|
-
"schema": "./src/generators/setup-tailwind/schema.json",
|
|
92
|
-
"description": "Set up Tailwind configuration for a project.",
|
|
93
|
-
"hidden": false,
|
|
94
|
-
"x-deprecated": "Generating Tailwind configuration is no longer maintained. This generator will be removed in Nx 23."
|
|
95
|
-
},
|
|
96
89
|
"setup-ssr": {
|
|
97
90
|
"factory": "./src/generators/setup-ssr/setup-ssr#setupSsrGenerator",
|
|
98
91
|
"schema": "./src/generators/setup-ssr/schema.json",
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { NxReactWebpackPlugin as _NxReactWebpackPlugin } from './plugins/nx-reac
|
|
|
2
2
|
/** @deprecated Use '@nx/react/webpack-plugin' instead, which can improve graph creation by 150-200ms per file. */
|
|
3
3
|
export declare const NxReactWebpackPlugin: typeof _NxReactWebpackPlugin;
|
|
4
4
|
export { extraEslintDependencies, extendReactEslintJson, } from './src/utils/lint';
|
|
5
|
-
export { cssInJsDependenciesBabel } from './src/utils/styled';
|
|
6
5
|
export { assertValidStyle } from './src/utils/assertion';
|
|
7
6
|
export { reactDomVersion, reactVersion } from './src/utils/versions';
|
|
8
7
|
export { applicationGenerator } from './src/generators/application/application';
|
|
@@ -18,7 +17,6 @@ export { hostGenerator } from './src/generators/host/host';
|
|
|
18
17
|
export { remoteGenerator } from './src/generators/remote/remote';
|
|
19
18
|
export { cypressComponentConfigGenerator } from './src/generators/cypress-component-configuration/cypress-component-configuration';
|
|
20
19
|
export { componentTestGenerator } from './src/generators/component-test/component-test';
|
|
21
|
-
export { setupTailwindGenerator } from './src/generators/setup-tailwind/setup-tailwind';
|
|
22
20
|
export type { SupportedStyles } from './typings/style';
|
|
23
21
|
export * from './plugins/with-react';
|
|
24
22
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAE1H,kHAAkH;AAClH,eAAO,MAAM,oBAAoB,8BAAwB,CAAC;AAE1D,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAE1H,kHAAkH;AAClH,eAAO,MAAM,oBAAoB,8BAAwB,CAAC;AAE1D,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wDAAwD,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,+BAA+B,EAAE,MAAM,kFAAkF,CAAC;AACnI,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,cAAc,sBAAsB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.componentTestGenerator = exports.cypressComponentConfigGenerator = exports.remoteGenerator = exports.hostGenerator = exports.storybookConfigurationGenerator = exports.storiesGenerator = exports.reduxGenerator = exports.reactInitGenerator = exports.libraryGenerator = exports.componentStoryGenerator = exports.hookGenerator = exports.componentGenerator = exports.applicationGenerator = exports.reactVersion = exports.reactDomVersion = exports.assertValidStyle = exports.extendReactEslintJson = exports.extraEslintDependencies = exports.NxReactWebpackPlugin = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const nx_react_webpack_plugin_1 = require("./plugins/nx-react-webpack-plugin/nx-react-webpack-plugin");
|
|
6
6
|
/** @deprecated Use '@nx/react/webpack-plugin' instead, which can improve graph creation by 150-200ms per file. */
|
|
@@ -8,8 +8,6 @@ exports.NxReactWebpackPlugin = nx_react_webpack_plugin_1.NxReactWebpackPlugin;
|
|
|
8
8
|
var lint_1 = require("./src/utils/lint");
|
|
9
9
|
Object.defineProperty(exports, "extraEslintDependencies", { enumerable: true, get: function () { return lint_1.extraEslintDependencies; } });
|
|
10
10
|
Object.defineProperty(exports, "extendReactEslintJson", { enumerable: true, get: function () { return lint_1.extendReactEslintJson; } });
|
|
11
|
-
var styled_1 = require("./src/utils/styled");
|
|
12
|
-
Object.defineProperty(exports, "cssInJsDependenciesBabel", { enumerable: true, get: function () { return styled_1.cssInJsDependenciesBabel; } });
|
|
13
11
|
var assertion_1 = require("./src/utils/assertion");
|
|
14
12
|
Object.defineProperty(exports, "assertValidStyle", { enumerable: true, get: function () { return assertion_1.assertValidStyle; } });
|
|
15
13
|
var versions_1 = require("./src/utils/versions");
|
|
@@ -41,6 +39,4 @@ var cypress_component_configuration_1 = require("./src/generators/cypress-compon
|
|
|
41
39
|
Object.defineProperty(exports, "cypressComponentConfigGenerator", { enumerable: true, get: function () { return cypress_component_configuration_1.cypressComponentConfigGenerator; } });
|
|
42
40
|
var component_test_1 = require("./src/generators/component-test/component-test");
|
|
43
41
|
Object.defineProperty(exports, "componentTestGenerator", { enumerable: true, get: function () { return component_test_1.componentTestGenerator; } });
|
|
44
|
-
var setup_tailwind_1 = require("./src/generators/setup-tailwind/setup-tailwind");
|
|
45
|
-
Object.defineProperty(exports, "setupTailwindGenerator", { enumerable: true, get: function () { return setup_tailwind_1.setupTailwindGenerator; } });
|
|
46
42
|
tslib_1.__exportStar(require("./plugins/with-react"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.10",
|
|
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": {
|
|
@@ -33,33 +33,32 @@
|
|
|
33
33
|
"migrations": "./migrations.json"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@phenomnomnominal/tsquery": "~6.
|
|
36
|
+
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
37
37
|
"@svgr/webpack": "^8.0.1",
|
|
38
|
-
"minimatch": "10.2.
|
|
39
|
-
"picocolors": "^1.1.0",
|
|
38
|
+
"minimatch": "10.2.5",
|
|
40
39
|
"tslib": "^2.3.0",
|
|
41
|
-
"@nx/devkit": "23.0.0-beta.
|
|
42
|
-
"@nx/js": "23.0.0-beta.
|
|
43
|
-
"@nx/eslint": "23.0.0-beta.
|
|
44
|
-
"@nx/web": "23.0.0-beta.
|
|
45
|
-
"@nx/module-federation": "23.0.0-beta.
|
|
46
|
-
"@nx/rollup": "23.0.0-beta.
|
|
40
|
+
"@nx/devkit": "23.0.0-beta.10",
|
|
41
|
+
"@nx/js": "23.0.0-beta.10",
|
|
42
|
+
"@nx/eslint": "23.0.0-beta.10",
|
|
43
|
+
"@nx/web": "23.0.0-beta.10",
|
|
44
|
+
"@nx/module-federation": "23.0.0-beta.10",
|
|
45
|
+
"@nx/rollup": "23.0.0-beta.10",
|
|
47
46
|
"express": "^4.21.2",
|
|
48
47
|
"http-proxy-middleware": "^3.0.5",
|
|
49
48
|
"semver": "^7.6.3"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
|
-
"@nx/cypress": "23.0.0-beta.
|
|
53
|
-
"@nx/playwright": "23.0.0-beta.
|
|
54
|
-
"@nx/rsbuild": "23.0.0-beta.
|
|
55
|
-
"@nx/vite": "23.0.0-beta.
|
|
56
|
-
"@nx/vitest": "23.0.0-beta.
|
|
57
|
-
"@nx/webpack": "23.0.0-beta.
|
|
58
|
-
"@nx/storybook": "23.0.0-beta.
|
|
59
|
-
"nx": "23.0.0-beta.
|
|
51
|
+
"@nx/cypress": "23.0.0-beta.10",
|
|
52
|
+
"@nx/playwright": "23.0.0-beta.10",
|
|
53
|
+
"@nx/rsbuild": "23.0.0-beta.10",
|
|
54
|
+
"@nx/vite": "23.0.0-beta.10",
|
|
55
|
+
"@nx/vitest": "23.0.0-beta.10",
|
|
56
|
+
"@nx/webpack": "23.0.0-beta.10",
|
|
57
|
+
"@nx/storybook": "23.0.0-beta.10",
|
|
58
|
+
"nx": "23.0.0-beta.10"
|
|
60
59
|
},
|
|
61
60
|
"optionalDependencies": {
|
|
62
|
-
"@nx/vite": "23.0.0-beta.
|
|
61
|
+
"@nx/vite": "23.0.0-beta.10"
|
|
63
62
|
},
|
|
64
63
|
"publishConfig": {
|
|
65
64
|
"access": "public"
|
|
@@ -84,11 +83,7 @@
|
|
|
84
83
|
"require": "./babel.js",
|
|
85
84
|
"types": "./babel.d.ts"
|
|
86
85
|
},
|
|
87
|
-
"./tailwind":
|
|
88
|
-
"import": "./tailwind.js",
|
|
89
|
-
"require": "./tailwind.js",
|
|
90
|
-
"types": "./tailwind.d.ts"
|
|
91
|
-
},
|
|
86
|
+
"./tailwind": "./tailwind.js",
|
|
92
87
|
"./module-federation": {
|
|
93
88
|
"import": "./module-federation.js",
|
|
94
89
|
"require": "./module-federation.js",
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = moduleFederationDevServer;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
8
8
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
9
9
|
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
|
@@ -41,7 +41,7 @@ async function* moduleFederationDevServer(schema, context) {
|
|
|
41
41
|
return yield* currIter;
|
|
42
42
|
}
|
|
43
43
|
const { staticRemotesIter, devRemoteIters, remotes } = await (0, utils_1.startRemoteIterators)(options, context, lib_1.startRemotes, pathToManifestFile, 'react');
|
|
44
|
-
return yield* (0,
|
|
44
|
+
return yield* (0, internal_1.combineAsyncIterables)(currIter, ...devRemoteIters, ...(staticRemotesIter ? [staticRemotesIter] : []), (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
45
45
|
if (!options.isInitialHost) {
|
|
46
46
|
done();
|
|
47
47
|
return;
|
package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = moduleFederationSsrDevServer;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
8
8
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
9
9
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
@@ -31,7 +31,7 @@ async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
|
31
31
|
return yield* iter;
|
|
32
32
|
}
|
|
33
33
|
const { staticRemotesIter, devRemoteIters, remotes } = await (0, utils_1.startRemoteIterators)(options, context, lib_1.startRemotes, pathToManifestFile, 'react', true);
|
|
34
|
-
const combined = (0,
|
|
34
|
+
const combined = (0, internal_1.combineAsyncIterables)(staticRemotesIter, ...devRemoteIters);
|
|
35
35
|
let refs = 1 + (devRemoteIters?.length ?? 0);
|
|
36
36
|
for await (const result of combined) {
|
|
37
37
|
if (result.success === false)
|
|
@@ -41,7 +41,7 @@ async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
|
41
41
|
if (refs === 0)
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
|
-
return yield* (0,
|
|
44
|
+
return yield* (0, internal_1.combineAsyncIterables)(iter, (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
45
45
|
const host = options.host ?? 'localhost';
|
|
46
46
|
const baseUrl = `http${options.ssl ? 's' : ''}://${host}:${options.port}`;
|
|
47
47
|
if (!options.isInitialHost) {
|
package/src/executors/module-federation-static-server/module-federation-static-server.impl.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.startProxies = startProxies;
|
|
4
4
|
exports.default = moduleFederationStaticServer;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
8
8
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
9
9
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
10
10
|
const utils_2 = require("@nx/module-federation/src/utils");
|
|
@@ -201,7 +201,7 @@ async function* moduleFederationStaticServer(schema, context) {
|
|
|
201
201
|
pathToKey: (0, path_1.join)(devkit_1.workspaceRoot, options.serveOptions.sslKey),
|
|
202
202
|
}
|
|
203
203
|
: undefined);
|
|
204
|
-
return yield* (0,
|
|
204
|
+
return yield* (0, internal_1.combineAsyncIterables)(staticFileServerIter, (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
205
205
|
const host = options.serveOptions.host ?? 'localhost';
|
|
206
206
|
const baseUrl = `http${options.serveOptions.ssl ? 's' : ''}://${host}:${options.serveOptions.port}`;
|
|
207
207
|
if (remotes.remotePorts.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/application/application.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/application/application.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;AA6BpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAsL5B;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.applicationGenerator = applicationGenerator;
|
|
4
4
|
exports.applicationGeneratorInternal = applicationGeneratorInternal;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
const js_1 = require("@nx/js");
|
|
8
|
-
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
9
9
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
10
10
|
const create_ts_config_1 = require("../../utils/create-ts-config");
|
|
11
|
-
const add_styled_dependencies_1 = require("../../rules/add-styled-dependencies");
|
|
12
|
-
const setup_tailwind_1 = require("../setup-tailwind/setup-tailwind");
|
|
13
11
|
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
14
12
|
const create_application_files_1 = require("./lib/create-application-files");
|
|
15
13
|
const update_jest_config_1 = require("./lib/update-jest-config");
|
|
@@ -20,14 +18,12 @@ const add_routing_1 = require("./lib/add-routing");
|
|
|
20
18
|
const set_defaults_1 = require("./lib/set-defaults");
|
|
21
19
|
const add_linting_1 = require("./lib/add-linting");
|
|
22
20
|
const add_e2e_1 = require("./lib/add-e2e");
|
|
23
|
-
const show_possible_warnings_1 = require("./lib/show-possible-warnings");
|
|
24
21
|
const install_common_dependencies_1 = require("./lib/install-common-dependencies");
|
|
25
22
|
const add_webpack_1 = require("./lib/bundlers/add-webpack");
|
|
26
23
|
const add_rspack_1 = require("./lib/bundlers/add-rspack");
|
|
27
24
|
const add_rsbuild_1 = require("./lib/bundlers/add-rsbuild");
|
|
28
25
|
const add_vite_1 = require("./lib/bundlers/add-vite");
|
|
29
26
|
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
30
|
-
const prompt_1 = require("@nx/devkit/src/generators/prompt");
|
|
31
27
|
async function applicationGenerator(tree, schema) {
|
|
32
28
|
return await applicationGeneratorInternal(tree, {
|
|
33
29
|
addPlugin: false,
|
|
@@ -51,7 +47,7 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
51
47
|
options.useReactRouter =
|
|
52
48
|
options.routing && options.bundler === 'vite'
|
|
53
49
|
? (options.useReactRouter ??
|
|
54
|
-
(await (0,
|
|
50
|
+
(await (0, internal_1.promptWhenInteractive)({
|
|
55
51
|
name: 'response',
|
|
56
52
|
message: 'Would you like to use react-router for server-side rendering?',
|
|
57
53
|
type: 'autocomplete',
|
|
@@ -68,7 +64,6 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
68
64
|
initial: 0,
|
|
69
65
|
}, { response: 'No' }).then((r) => r.response === 'Yes')))
|
|
70
66
|
: false;
|
|
71
|
-
(0, show_possible_warnings_1.showPossibleWarnings)(tree, options);
|
|
72
67
|
const initTask = await (0, init_1.default)(tree, {
|
|
73
68
|
...options,
|
|
74
69
|
skipFormat: true,
|
|
@@ -108,12 +103,6 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
108
103
|
if (options.isUsingTsSolutionConfig) {
|
|
109
104
|
await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
110
105
|
}
|
|
111
|
-
if (options.style === 'tailwind') {
|
|
112
|
-
const twTask = await (0, setup_tailwind_1.setupTailwindGenerator)(tree, {
|
|
113
|
-
project: options.projectName,
|
|
114
|
-
});
|
|
115
|
-
tasks.push(twTask);
|
|
116
|
-
}
|
|
117
106
|
const lintTask = await (0, add_linting_1.addLinting)(tree, options);
|
|
118
107
|
tasks.push(lintTask);
|
|
119
108
|
if (options.bundler === 'vite') {
|
|
@@ -139,16 +128,11 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
139
128
|
(0, update_jest_config_1.updateSpecConfig)(tree, options);
|
|
140
129
|
const commonDependencyTask = await (0, install_common_dependencies_1.installCommonDependencies)(tree, options);
|
|
141
130
|
tasks.push(commonDependencyTask);
|
|
142
|
-
const styledTask = (0, add_styled_dependencies_1.addStyledModuleDependencies)(tree, options);
|
|
143
|
-
tasks.push(styledTask);
|
|
144
131
|
if (!options.useReactRouter) {
|
|
145
132
|
const routingTask = (0, add_routing_1.addRouting)(tree, options);
|
|
146
133
|
tasks.push(routingTask);
|
|
147
134
|
}
|
|
148
135
|
(0, set_defaults_1.setDefaults)(tree, options);
|
|
149
|
-
if (options.bundler === 'rspack' && options.style === 'styled-jsx') {
|
|
150
|
-
(0, add_rspack_1.handleStyledJsxForRspack)(tasks, tree, options);
|
|
151
|
-
}
|
|
152
136
|
if (options.useReactRouter) {
|
|
153
137
|
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json'), (json) => {
|
|
154
138
|
const types = new Set(json.compilerOptions?.types || []);
|
|
@@ -178,7 +162,7 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
178
162
|
await (0, devkit_1.formatFiles)(tree);
|
|
179
163
|
}
|
|
180
164
|
tasks.push(() => {
|
|
181
|
-
(0,
|
|
165
|
+
(0, internal_1.logShowProjectCommand)(options.projectName);
|
|
182
166
|
});
|
|
183
167
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
184
168
|
}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"lib": ["dom"],
|
|
8
8
|
"types": [
|
|
9
9
|
"node",
|
|
10
|
-
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
|
11
10
|
"@nx/react/typings/cssmodule.d.ts",
|
|
12
11
|
"@nx/react/typings/image.d.ts"
|
|
13
12
|
]
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
|
21
20
|
"types": [
|
|
22
21
|
"node",
|
|
23
|
-
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
|
24
22
|
"@nx/react/typings/cssmodule.d.ts",
|
|
25
23
|
"@nx/react/typings/image.d.ts"
|
|
26
24
|
]
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"lib": ["dom"],
|
|
8
8
|
"types": [
|
|
9
9
|
"node",
|
|
10
|
-
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
|
11
10
|
"@nx/react/typings/cssmodule.d.ts",
|
|
12
11
|
"@nx/react/typings/image.d.ts"
|
|
13
12
|
]
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
|
21
20
|
"types": [
|
|
22
21
|
"node",
|
|
23
|
-
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
|
24
22
|
"@nx/react/typings/cssmodule.d.ts",
|
|
25
23
|
"@nx/react/typings/image.d.ts"
|
|
26
24
|
]
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
9
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
10
|
-
<% if (
|
|
10
|
+
<% if (style !== 'none') { %><link rel="stylesheet" href="/src/styles.<%= style %>" /><% } %>
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"lib": ["dom"],
|
|
8
8
|
"types": [
|
|
9
9
|
"node",
|
|
10
|
-
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
|
11
10
|
"@nx/react/typings/cssmodule.d.ts",
|
|
12
11
|
"@nx/react/typings/image.d.ts"
|
|
13
12
|
]
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
|
21
20
|
"types": [
|
|
22
21
|
"node",
|
|
23
|
-
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
|
24
22
|
"@nx/react/typings/cssmodule.d.ts",
|
|
25
23
|
"@nx/react/typings/image.d.ts"
|
|
26
24
|
]
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"lib": ["dom"],
|
|
8
8
|
"types": [
|
|
9
9
|
"node",
|
|
10
|
-
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
|
11
10
|
"@nx/react/typings/cssmodule.d.ts",
|
|
12
11
|
"@nx/react/typings/image.d.ts"
|
|
13
12
|
]
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
|
21
20
|
"types": [
|
|
22
21
|
"node",
|
|
23
|
-
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
|
24
22
|
"@nx/react/typings/cssmodule.d.ts",
|
|
25
23
|
"@nx/react/typings/image.d.ts"
|
|
26
24
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,iBAAiB,EAGjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,wBAAsB,MAAM,CAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAwN5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-project.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/add-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"add-project.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/add-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAML,IAAI,EAGL,MAAM,YAAY,CAAC;AAMpB,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,QAyF/D"}
|
|
@@ -15,6 +15,12 @@ function addProject(host, options) {
|
|
|
15
15
|
};
|
|
16
16
|
if (options.bundler === 'webpack') {
|
|
17
17
|
if (!(0, has_webpack_plugin_1.hasWebpackPlugin)(host) || !options.addPlugin) {
|
|
18
|
+
// Mirrors warnWebpackExecutorGenerating from @nx/webpack/src/utils/deprecation.
|
|
19
|
+
// Inlined to avoid a cross-package deep import; @nx/webpack's package
|
|
20
|
+
// exports field doesn't expose internal `src/...` paths, so the import
|
|
21
|
+
// works at compile time (via tsconfig project refs) but fails at runtime
|
|
22
|
+
// in published packages.
|
|
23
|
+
devkit_1.logger.warn('Generating targets that use the deprecated `@nx/webpack:webpack` and `@nx/webpack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` next to migrate these targets to the `@nx/webpack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
18
24
|
project.targets = {
|
|
19
25
|
build: createBuildTarget(options),
|
|
20
26
|
serve: createServeTarget(options),
|
|
@@ -23,6 +29,10 @@ function addProject(host, options) {
|
|
|
23
29
|
}
|
|
24
30
|
else if (options.bundler === 'rspack' &&
|
|
25
31
|
(!(0, has_rspack_plugin_1.hasRspackPlugin)(host) || !options.addPlugin)) {
|
|
32
|
+
// Mirrors warnRspackExecutorGenerating from @nx/rspack/src/utils/deprecation.
|
|
33
|
+
// Inlined to avoid a cross-package import where react does not declare a
|
|
34
|
+
// TypeScript project reference to rspack.
|
|
35
|
+
devkit_1.logger.warn('Generating targets that use the deprecated `@nx/rspack:rspack` and `@nx/rspack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/rspack:convert-to-inferred` next to migrate these targets to the `@nx/rspack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
26
36
|
project.targets = {
|
|
27
37
|
build: createRspackBuildTarget(options),
|
|
28
38
|
serve: createRspackServeTarget(options),
|
|
@@ -87,10 +97,10 @@ function createRspackBuildTarget(options) {
|
|
|
87
97
|
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
|
|
88
98
|
],
|
|
89
99
|
rspackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'rspack.config.js'),
|
|
90
|
-
styles:
|
|
100
|
+
styles: !options.hasStyles
|
|
91
101
|
? []
|
|
92
102
|
: [
|
|
93
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style
|
|
103
|
+
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style}`),
|
|
94
104
|
],
|
|
95
105
|
scripts: [],
|
|
96
106
|
configurations: {
|
|
@@ -149,10 +159,10 @@ function createBuildTarget(options) {
|
|
|
149
159
|
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/favicon.ico'),
|
|
150
160
|
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
|
|
151
161
|
],
|
|
152
|
-
styles:
|
|
162
|
+
styles: !options.hasStyles
|
|
153
163
|
? []
|
|
154
164
|
: [
|
|
155
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style
|
|
165
|
+
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style}`),
|
|
156
166
|
],
|
|
157
167
|
scripts: [],
|
|
158
168
|
webpackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'webpack.config.js'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-rsbuild.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/react/src/generators/application/lib/bundlers/add-rsbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAIV,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAExD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,EACjC,KAAK,EAAE,GAAG,EAAE,iBAUb;AAED,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,EACjC,KAAK,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"add-rsbuild.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/react/src/generators/application/lib/bundlers/add-rsbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAIV,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAExD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,EACjC,KAAK,EAAE,GAAG,EAAE,iBAUb;AAED,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,EACjC,KAAK,EAAE,GAAG,EAAE,iBA0Db"}
|
|
@@ -51,7 +51,7 @@ async function initRsbuild(tree, options, tasks) {
|
|
|
51
51
|
async function setupRsbuildConfiguration(tree, options, tasks) {
|
|
52
52
|
(0, devkit_1.ensurePackage)('@nx/rsbuild', versions_1.nxVersion);
|
|
53
53
|
const { configurationGenerator } = await Promise.resolve().then(() => __importStar(require('@nx/rsbuild/generators')));
|
|
54
|
-
const { addBuildPlugin, addCopyAssets, addHtmlTemplatePath,
|
|
54
|
+
const { addBuildPlugin, addCopyAssets, addHtmlTemplatePath, addSourceDefine, versions, } = await Promise.resolve().then(() => __importStar(require('@nx/rsbuild/config-utils')));
|
|
55
55
|
const rsbuildTask = await configurationGenerator(tree, {
|
|
56
56
|
project: options.projectName,
|
|
57
57
|
entry: (0, maybe_js_1.maybeJs)({
|
|
@@ -68,30 +68,11 @@ async function setupRsbuildConfiguration(tree, options, tasks) {
|
|
|
68
68
|
addSourceDefine(tree, pathToConfigFile, 'import.meta.vitest', 'undefined');
|
|
69
69
|
}
|
|
70
70
|
const deps = { '@rsbuild/plugin-react': versions.rsbuildPluginReactVersion };
|
|
71
|
-
addBuildPlugin(tree, pathToConfigFile, '@rsbuild/plugin-react', 'pluginReact'
|
|
72
|
-
? `swcReactOptions: {\n\timportSource: '@emotion/react',\n}`
|
|
73
|
-
: undefined);
|
|
71
|
+
addBuildPlugin(tree, pathToConfigFile, '@rsbuild/plugin-react', 'pluginReact');
|
|
74
72
|
if (options.style === 'scss') {
|
|
75
73
|
addBuildPlugin(tree, pathToConfigFile, '@rsbuild/plugin-sass', 'pluginSass');
|
|
76
74
|
deps['@rsbuild/plugin-sass'] = versions.rsbuildPluginSassVersion;
|
|
77
75
|
}
|
|
78
|
-
else if (options.style === 'less') {
|
|
79
|
-
addBuildPlugin(tree, pathToConfigFile, '@rsbuild/plugin-less', 'pluginLess');
|
|
80
|
-
deps['@rsbuild/plugin-less'] = versions.rsbuildPluginLessVersion;
|
|
81
|
-
}
|
|
82
|
-
else if (options.style === '@emotion/styled') {
|
|
83
|
-
deps['@swc/plugin-emotion'] = versions.rsbuildSwcPluginEmotionVersion;
|
|
84
|
-
addExperimentalSwcPlugin(tree, pathToConfigFile, '@swc/plugin-emotion');
|
|
85
|
-
}
|
|
86
|
-
else if (options.style === 'styled-jsx') {
|
|
87
|
-
deps['@swc/plugin-styled-jsx'] = versions.rsbuildSwcPluginStyledJsxVersion;
|
|
88
|
-
addExperimentalSwcPlugin(tree, pathToConfigFile, '@swc/plugin-styled-jsx');
|
|
89
|
-
}
|
|
90
|
-
else if (options.style === 'styled-components') {
|
|
91
|
-
deps['@rsbuild/plugin-styled-components'] =
|
|
92
|
-
versions.rsbuildPluginStyledComponentsVersion;
|
|
93
|
-
addBuildPlugin(tree, pathToConfigFile, '@rsbuild/plugin-styled-components', 'pluginStyledComponents');
|
|
94
|
-
}
|
|
95
76
|
addHtmlTemplatePath(tree, pathToConfigFile, './src/index.html');
|
|
96
77
|
addCopyAssets(tree, pathToConfigFile, './src/assets');
|
|
97
78
|
addCopyAssets(tree, pathToConfigFile, './src/favicon.ico');
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
2
|
import { NormalizedSchema, Schema } from '../../schema';
|
|
3
3
|
export declare function initRspack(tree: Tree, options: NormalizedSchema<Schema>, tasks: any[]): Promise<void>;
|
|
4
|
-
export declare function handleStyledJsxForRspack(tasks: any[], tree: Tree, options: NormalizedSchema<Schema>): void;
|
|
5
4
|
//# sourceMappingURL=add-rspack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-rspack.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/react/src/generators/application/lib/bundlers/add-rspack.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"add-rspack.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/react/src/generators/application/lib/bundlers/add-rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAiB,MAAM,YAAY,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAExD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,EACjC,KAAK,EAAE,GAAG,EAAE,iBAQb"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initRspack = initRspack;
|
|
4
|
-
exports.handleStyledJsxForRspack = handleStyledJsxForRspack;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
4
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const pc = tslib_1.__importStar(require("picocolors"));
|
|
8
5
|
const versions_1 = require("../../../../utils/versions");
|
|
9
6
|
async function initRspack(tree, options, tasks) {
|
|
10
7
|
const { rspackInitGenerator } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
|
|
@@ -14,25 +11,3 @@ async function initRspack(tree, options, tasks) {
|
|
|
14
11
|
});
|
|
15
12
|
tasks.push(rspackInitTask);
|
|
16
13
|
}
|
|
17
|
-
function handleStyledJsxForRspack(tasks, tree, options) {
|
|
18
|
-
devkit_1.logger.warn(`${pc.bold('styled-jsx')} is not supported by ${pc.bold('Rspack')}. We've added ${pc.bold('babel-loader')} to your project, but using babel will slow down your build.`);
|
|
19
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'babel-loader': versions_1.babelLoaderVersion }));
|
|
20
|
-
tree.write((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'rspack.config.js'), (0, devkit_1.stripIndents) `
|
|
21
|
-
const { composePlugins, withNx, withReact } = require('@nx/rspack');
|
|
22
|
-
module.exports = composePlugins(withNx(), withReact(), (config) => {
|
|
23
|
-
config.module.rules.push({
|
|
24
|
-
test: /\\.[jt]sx$/i,
|
|
25
|
-
use: [
|
|
26
|
-
{
|
|
27
|
-
loader: 'babel-loader',
|
|
28
|
-
options: {
|
|
29
|
-
presets: ['@babel/preset-typescript'],
|
|
30
|
-
plugins: ['styled-jsx/babel'],
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
});
|
|
35
|
-
return config;
|
|
36
|
-
});
|
|
37
|
-
`);
|
|
38
|
-
}
|
|
@@ -15,7 +15,7 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
|
|
|
15
15
|
offsetFromRoot: string;
|
|
16
16
|
appTests: string;
|
|
17
17
|
inSourceVitestTests: string;
|
|
18
|
-
style: "
|
|
18
|
+
style: import("../../../..").SupportedStyles;
|
|
19
19
|
hasStyleFile: boolean;
|
|
20
20
|
isUsingTsSolutionSetup: boolean;
|
|
21
21
|
port: number;
|
|
@@ -26,7 +26,6 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
|
|
|
26
26
|
importPath: string;
|
|
27
27
|
parsedTags: string[];
|
|
28
28
|
fileName: string;
|
|
29
|
-
styledModule: null | import("../../../..").SupportedStyles;
|
|
30
29
|
hasStyles: boolean;
|
|
31
30
|
unitTestRunner: "jest" | "vitest" | "none";
|
|
32
31
|
addPlugin?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-application-files.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/create-application-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAGL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAkB7C,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB
|
|
1
|
+
{"version":3,"file":"create-application-files.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/create-application-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAGL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAkB7C,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB1B;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,MAAM,EAClB,GAAG,GAAE,OAAc,GAClB,aAAa,GAAG,gBAAgB,CAyBlC;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,iBAgJ1B"}
|