@nx/react 24.0.0-beta.2 → 24.0.0-beta.3
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/dist/index.d.ts +0 -2
- package/dist/index.js +1 -5
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +3 -1
- package/dist/plugins/component-testing/index.js +92 -33
- package/dist/plugins/storybook/index.js +18 -18
- package/dist/plugins/with-react.d.ts +3 -7
- package/dist/plugins/with-react.js +5 -19
- package/dist/src/generators/application/application.js +1 -36
- package/dist/src/generators/application/files/base-rspack/rspack.config.js__tmpl__ +1 -24
- package/dist/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +1 -26
- package/dist/src/generators/application/lib/add-e2e.js +5 -6
- package/dist/src/generators/application/lib/add-linting.js +0 -1
- package/dist/src/generators/application/lib/add-project.js +0 -167
- package/dist/src/generators/application/lib/bundlers/add-rsbuild.js +0 -1
- package/dist/src/generators/application/lib/bundlers/add-vite.js +0 -2
- package/dist/src/generators/application/lib/bundlers/add-webpack.js +0 -1
- package/dist/src/generators/application/lib/create-application-files.d.ts +0 -1
- package/dist/src/generators/application/lib/create-application-files.js +2 -11
- package/dist/src/generators/application/lib/normalize-options.js +0 -4
- package/dist/src/generators/application/schema.d.ts +0 -2
- package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +1 -9
- package/dist/src/generators/cypress-component-configuration/schema.d.ts +0 -1
- package/dist/src/generators/init/init.js +3 -5
- package/dist/src/generators/init/schema.d.ts +0 -1
- package/dist/src/generators/library/lib/add-linting.js +0 -1
- package/dist/src/generators/library/lib/add-rollup-build-target.js +3 -47
- package/dist/src/generators/library/lib/normalize-options.js +0 -4
- package/dist/src/generators/library/library.js +1 -4
- package/dist/src/generators/library/schema.d.ts +0 -1
- package/dist/src/generators/storybook-configuration/configuration.js +1 -9
- package/dist/src/generators/storybook-configuration/schema.d.ts +0 -1
- package/dist/src/migrations/update-23-2-0/add-optional-module-federation-packages.js +2 -1
- package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.d.ts +4 -0
- package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.js +13 -0
- package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.md +40 -0
- package/dist/src/plugins/router-plugin.d.ts +0 -1
- package/dist/src/plugins/router-plugin.js +5 -42
- package/dist/src/utils/ast-utils.d.ts +0 -1
- package/dist/src/utils/ast-utils.js +0 -23
- package/dist/src/utils/ct-utils.js +54 -14
- package/dist/src/utils/deprecation.d.ts +1 -1
- package/dist/src/utils/deprecation.js +3 -5
- package/dist/src/utils/versions.d.ts +0 -7
- package/dist/src/utils/versions.js +2 -9
- package/executors.json +1 -17
- package/generators.json +0 -27
- package/migrations.json +6 -0
- package/package.json +17 -47
- package/dist/mf/dynamic-federation.d.ts +0 -69
- package/dist/mf/dynamic-federation.js +0 -141
- package/dist/mf/index.d.ts +0 -1
- package/dist/mf/index.js +0 -8
- package/dist/module-federation.d.ts +0 -5
- package/dist/module-federation.js +0 -20
- package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
- package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
- package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -4
- package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -19
- package/dist/src/executors/module-federation-dev-server/lib/start-remotes.d.ts +0 -5
- package/dist/src/executors/module-federation-dev-server/lib/start-remotes.js +0 -33
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -6
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -80
- package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -19
- package/dist/src/executors/module-federation-dev-server/schema.json +0 -142
- package/dist/src/executors/module-federation-ssr-dev-server/lib/index.d.ts +0 -2
- package/dist/src/executors/module-federation-ssr-dev-server/lib/index.js +0 -5
- package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -4
- package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -23
- package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.d.ts +0 -5
- package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.js +0 -34
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -3
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -83
- package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -29
- package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -81
- package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +0 -12
- package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.js +0 -244
- package/dist/src/executors/module-federation-static-server/schema.d.ts +0 -3
- package/dist/src/executors/module-federation-static-server/schema.json +0 -16
- package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
- package/dist/src/generators/federate-module/federate-module.js +0 -67
- package/dist/src/generators/federate-module/lib/utils.d.ts +0 -23
- package/dist/src/generators/federate-module/lib/utils.js +0 -99
- package/dist/src/generators/federate-module/schema.d.ts +0 -15
- package/dist/src/generators/federate-module/schema.json +0 -89
- package/dist/src/generators/host/files/common/src/app/__fileName__.js__tmpl__ +0 -40
- package/dist/src/generators/host/files/common/src/main.js__tmpl__ +0 -13
- package/dist/src/generators/host/files/common/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/host/files/common-ts/src/app/__fileName__.tsx__tmpl__ +0 -41
- package/dist/src/generators/host/files/common-ts/src/main.ts__tmpl__ +0 -13
- package/dist/src/generators/host/files/rspack-common/src/app/__fileName__.jsx__tmpl__ +0 -42
- package/dist/src/generators/host/files/rspack-common/src/main.jsx__tmpl__ +0 -13
- package/dist/src/generators/host/files/rspack-common/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/host/files/rspack-module-federation/module-federation.config.js__tmpl__ +0 -24
- package/dist/src/generators/host/files/rspack-module-federation/rspack.config.js__tmpl__ +0 -42
- package/dist/src/generators/host/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +0 -66
- package/dist/src/generators/host/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -27
- package/dist/src/generators/host/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +0 -68
- package/dist/src/generators/host/files/rspack-module-federation-ssr/server.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +0 -49
- package/dist/src/generators/host/files/rspack-module-federation-ssr/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -22
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +0 -68
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +0 -49
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +0 -67
- package/dist/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +0 -42
- package/dist/src/generators/host/files/webpack-module-federation/module-federation.config.js__tmpl__ +0 -24
- package/dist/src/generators/host/files/webpack-module-federation/webpack.config.js__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +0 -39
- package/dist/src/generators/host/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -19
- package/dist/src/generators/host/files/webpack-module-federation-ssr/server.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/webpack-module-federation-ssr/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -16
- package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/server.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +0 -40
- package/dist/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +0 -18
- package/dist/src/generators/host/host.d.ts +0 -4
- package/dist/src/generators/host/host.js +0 -174
- package/dist/src/generators/host/lib/add-module-federation-files.d.ts +0 -6
- package/dist/src/generators/host/lib/add-module-federation-files.js +0 -92
- package/dist/src/generators/host/lib/normalize-host-name.d.ts +0 -2
- package/dist/src/generators/host/lib/normalize-host-name.js +0 -12
- package/dist/src/generators/host/lib/setup-ssr-for-host.d.ts +0 -6
- package/dist/src/generators/host/lib/setup-ssr-for-host.js +0 -59
- package/dist/src/generators/host/lib/update-module-federation-e2e-project.d.ts +0 -3
- package/dist/src/generators/host/lib/update-module-federation-e2e-project.js +0 -19
- package/dist/src/generators/host/lib/update-module-federation-tsconfig.d.ts +0 -3
- package/dist/src/generators/host/lib/update-module-federation-tsconfig.js +0 -34
- package/dist/src/generators/host/schema.d.ts +0 -44
- package/dist/src/generators/host/schema.json +0 -173
- package/dist/src/generators/remote/files/common/src/main.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/common/src/remote-entry.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/common-ts/src/main.ts__tmpl__ +0 -1
- package/dist/src/generators/remote/files/common-ts/src/remote-entry.ts__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-common/src/main.jsx__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-common/src/remote-entry.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-module-federation/module-federation.config.js__tmpl__ +0 -12
- package/dist/src/generators/remote/files/rspack-module-federation/rspack.config.js__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -15
- package/dist/src/generators/remote/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +0 -71
- package/dist/src/generators/remote/files/rspack-module-federation-ssr/server.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -19
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +0 -71
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -16
- package/dist/src/generators/remote/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/remote/files/webpack-module-federation/module-federation.config.js__tmpl__ +0 -12
- package/dist/src/generators/remote/files/webpack-module-federation/webpack.config.js__tmpl__ +0 -17
- package/dist/src/generators/remote/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -9
- package/dist/src/generators/remote/files/webpack-module-federation-ssr/server.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +0 -17
- package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -13
- package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/server.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +0 -17
- package/dist/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -16
- package/dist/src/generators/remote/files/webpack-module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/remote/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +0 -1
- package/dist/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +0 -17
- package/dist/src/generators/remote/lib/add-remote-to-dynamic-host.d.ts +0 -2
- package/dist/src/generators/remote/lib/add-remote-to-dynamic-host.js +0 -12
- package/dist/src/generators/remote/lib/setup-package-json-exports-for-remote.d.ts +0 -3
- package/dist/src/generators/remote/lib/setup-package-json-exports-for-remote.js +0 -30
- package/dist/src/generators/remote/lib/setup-ssr-for-remote.d.ts +0 -4
- package/dist/src/generators/remote/lib/setup-ssr-for-remote.js +0 -61
- package/dist/src/generators/remote/lib/setup-tspath-for-remote.d.ts +0 -3
- package/dist/src/generators/remote/lib/setup-tspath-for-remote.js +0 -14
- package/dist/src/generators/remote/lib/update-host-with-remote.d.ts +0 -2
- package/dist/src/generators/remote/lib/update-host-with-remote.js +0 -79
- package/dist/src/generators/remote/remote.d.ts +0 -6
- package/dist/src/generators/remote/remote.js +0 -201
- package/dist/src/generators/remote/schema.d.ts +0 -39
- package/dist/src/generators/remote/schema.json +0 -173
- package/dist/src/generators/setup-ssr/files/server.ts__tmpl__ +0 -28
- package/dist/src/generators/setup-ssr/files/src/main.server.tsx__tmpl__ +0 -47
- package/dist/src/generators/setup-ssr/files/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/setup-ssr/schema.d.ts +0 -8
- package/dist/src/generators/setup-ssr/schema.json +0 -54
- package/dist/src/generators/setup-ssr/setup-ssr.d.ts +0 -4
- package/dist/src/generators/setup-ssr/setup-ssr.js +0 -198
- package/dist/src/module-federation/ast-utils.d.ts +0 -8
- package/dist/src/module-federation/ast-utils.js +0 -101
- package/dist/src/rules/update-module-federation-project.d.ts +0 -11
- package/dist/src/rules/update-module-federation-project.js +0 -72
- package/dist/src/utils/add-mf-env-to-inputs.d.ts +0 -2
- package/dist/src/utils/add-mf-env-to-inputs.js +0 -29
- package/dist/src/utils/module-federation-deprecation.d.ts +0 -12
- package/dist/src/utils/module-federation-deprecation.js +0 -46
- package/dist/src/utils/normalize-remote.d.ts +0 -8
- package/dist/src/utils/normalize-remote.js +0 -31
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addProject = addProject;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
|
|
6
|
-
const maybe_js_1 = require("../../../utils/maybe-js");
|
|
7
|
-
const has_rspack_plugin_1 = require("../../../utils/has-rspack-plugin");
|
|
8
5
|
function addProject(host, options) {
|
|
9
6
|
const project = {
|
|
10
7
|
root: options.appProjectRoot,
|
|
@@ -13,31 +10,6 @@ function addProject(host, options) {
|
|
|
13
10
|
targets: {},
|
|
14
11
|
tags: options.parsedTags,
|
|
15
12
|
};
|
|
16
|
-
if (options.bundler === 'webpack') {
|
|
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.');
|
|
24
|
-
project.targets = {
|
|
25
|
-
build: createBuildTarget(options),
|
|
26
|
-
serve: createServeTarget(options),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
else if (options.bundler === 'rspack' &&
|
|
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.');
|
|
36
|
-
project.targets = {
|
|
37
|
-
build: createRspackBuildTarget(options),
|
|
38
|
-
serve: createRspackServeTarget(options),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
13
|
const packageJson = {
|
|
42
14
|
name: options.importPath,
|
|
43
15
|
version: '0.0.1',
|
|
@@ -77,142 +49,3 @@ function addProject(host, options) {
|
|
|
77
49
|
}
|
|
78
50
|
}
|
|
79
51
|
}
|
|
80
|
-
function createRspackBuildTarget(options) {
|
|
81
|
-
return {
|
|
82
|
-
executor: '@nx/rspack:rspack',
|
|
83
|
-
outputs: ['{options.outputPath}'],
|
|
84
|
-
defaultConfiguration: 'production',
|
|
85
|
-
options: {
|
|
86
|
-
outputPath: options.isUsingTsSolutionConfig
|
|
87
|
-
? (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'dist')
|
|
88
|
-
: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot !== '.'
|
|
89
|
-
? options.appProjectRoot
|
|
90
|
-
: options.projectName),
|
|
91
|
-
index: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/index.html'),
|
|
92
|
-
baseHref: '/',
|
|
93
|
-
main: (0, devkit_1.joinPathFragments)(options.appProjectRoot, (0, maybe_js_1.maybeJs)(options, `src/main.tsx`)),
|
|
94
|
-
tsConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
|
95
|
-
assets: [
|
|
96
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/favicon.ico'),
|
|
97
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
|
|
98
|
-
],
|
|
99
|
-
rspackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'rspack.config.js'),
|
|
100
|
-
styles: !options.hasStyles
|
|
101
|
-
? []
|
|
102
|
-
: [
|
|
103
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style}`),
|
|
104
|
-
],
|
|
105
|
-
scripts: [],
|
|
106
|
-
configurations: {
|
|
107
|
-
development: {
|
|
108
|
-
mode: 'development',
|
|
109
|
-
},
|
|
110
|
-
production: {
|
|
111
|
-
mode: 'production',
|
|
112
|
-
optimization: true,
|
|
113
|
-
sourceMap: false,
|
|
114
|
-
outputHashing: 'all',
|
|
115
|
-
namedChunks: false,
|
|
116
|
-
extractLicenses: true,
|
|
117
|
-
vendorChunk: false,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function createRspackServeTarget(options) {
|
|
124
|
-
return {
|
|
125
|
-
executor: '@nx/rspack:dev-server',
|
|
126
|
-
defaultConfiguration: 'development',
|
|
127
|
-
options: {
|
|
128
|
-
buildTarget: `${options.projectName}:build`,
|
|
129
|
-
// @nx/rspack:dev-server defaults to 4200 at runtime, not in its schema, so
|
|
130
|
-
// omitting this is safe but the generated executor docs show no default.
|
|
131
|
-
...(options.port != null ? { port: options.port } : {}),
|
|
132
|
-
hmr: true,
|
|
133
|
-
},
|
|
134
|
-
configurations: {
|
|
135
|
-
development: {
|
|
136
|
-
buildTarget: `${options.projectName}:build:development`,
|
|
137
|
-
},
|
|
138
|
-
production: {
|
|
139
|
-
buildTarget: `${options.projectName}:build:production`,
|
|
140
|
-
hmr: false,
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function createBuildTarget(options) {
|
|
146
|
-
return {
|
|
147
|
-
executor: '@nx/webpack:webpack',
|
|
148
|
-
outputs: ['{options.outputPath}'],
|
|
149
|
-
defaultConfiguration: 'production',
|
|
150
|
-
options: {
|
|
151
|
-
compiler: options.compiler ?? 'babel',
|
|
152
|
-
outputPath: options.isUsingTsSolutionConfig
|
|
153
|
-
? (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'dist')
|
|
154
|
-
: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot !== '.'
|
|
155
|
-
? options.appProjectRoot
|
|
156
|
-
: options.projectName),
|
|
157
|
-
index: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/index.html'),
|
|
158
|
-
baseHref: '/',
|
|
159
|
-
main: (0, devkit_1.joinPathFragments)(options.appProjectRoot, (0, maybe_js_1.maybeJs)(options, `src/main.tsx`)),
|
|
160
|
-
tsConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
|
161
|
-
assets: [
|
|
162
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/favicon.ico'),
|
|
163
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
|
|
164
|
-
],
|
|
165
|
-
styles: !options.hasStyles
|
|
166
|
-
? []
|
|
167
|
-
: [
|
|
168
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style}`),
|
|
169
|
-
],
|
|
170
|
-
scripts: [],
|
|
171
|
-
webpackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'webpack.config.js'),
|
|
172
|
-
},
|
|
173
|
-
configurations: {
|
|
174
|
-
development: {
|
|
175
|
-
extractLicenses: false,
|
|
176
|
-
optimization: false,
|
|
177
|
-
sourceMap: true,
|
|
178
|
-
vendorChunk: true,
|
|
179
|
-
},
|
|
180
|
-
production: {
|
|
181
|
-
fileReplacements: [
|
|
182
|
-
{
|
|
183
|
-
replace: (0, devkit_1.joinPathFragments)(options.appProjectRoot, (0, maybe_js_1.maybeJs)(options, `src/environments/environment.ts`)),
|
|
184
|
-
with: (0, devkit_1.joinPathFragments)(options.appProjectRoot, (0, maybe_js_1.maybeJs)(options, `src/environments/environment.prod.ts`)),
|
|
185
|
-
},
|
|
186
|
-
],
|
|
187
|
-
optimization: true,
|
|
188
|
-
outputHashing: 'all',
|
|
189
|
-
sourceMap: false,
|
|
190
|
-
namedChunks: false,
|
|
191
|
-
extractLicenses: true,
|
|
192
|
-
vendorChunk: false,
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
function createServeTarget(options) {
|
|
198
|
-
return {
|
|
199
|
-
executor: '@nx/webpack:dev-server',
|
|
200
|
-
defaultConfiguration: 'development',
|
|
201
|
-
options: {
|
|
202
|
-
buildTarget: `${options.projectName}:build`,
|
|
203
|
-
// Only when asked: @nx/webpack:dev-server already defaults to 4200, so writing
|
|
204
|
-
// it unrequested would just restate the executor's own default.
|
|
205
|
-
...(options.port != null ? { port: options.port } : {}),
|
|
206
|
-
hmr: true,
|
|
207
|
-
},
|
|
208
|
-
configurations: {
|
|
209
|
-
development: {
|
|
210
|
-
buildTarget: `${options.projectName}:build:development`,
|
|
211
|
-
},
|
|
212
|
-
production: {
|
|
213
|
-
buildTarget: `${options.projectName}:build:production`,
|
|
214
|
-
hmr: false,
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
}
|
|
@@ -10,7 +10,6 @@ async function initRsbuild(tree, options, tasks) {
|
|
|
10
10
|
const { initGenerator, } = require('@nx/rsbuild/generators');
|
|
11
11
|
const initTask = await initGenerator(tree, {
|
|
12
12
|
skipPackageJson: options.skipPackageJson,
|
|
13
|
-
addPlugin: true,
|
|
14
13
|
skipFormat: true,
|
|
15
14
|
});
|
|
16
15
|
tasks.push(initTask);
|
|
@@ -35,7 +35,6 @@ async function setupViteConfiguration(tree, options, tasks) {
|
|
|
35
35
|
inSourceTests: options.inSourceTests,
|
|
36
36
|
compiler: options.compiler,
|
|
37
37
|
skipFormat: true,
|
|
38
|
-
addPlugin: options.addPlugin,
|
|
39
38
|
projectType: 'application',
|
|
40
39
|
port: options.port,
|
|
41
40
|
...(forceViteV7 ? { useViteV7: true } : {}),
|
|
@@ -69,7 +68,6 @@ async function setupVitestConfiguration(tree, options, tasks) {
|
|
|
69
68
|
project: options.projectName,
|
|
70
69
|
inSourceTests: options.inSourceTests,
|
|
71
70
|
skipFormat: true,
|
|
72
|
-
addPlugin: options.addPlugin,
|
|
73
71
|
});
|
|
74
72
|
tasks.push(vitestTask);
|
|
75
73
|
createOrEditViteConfig(tree, {
|
|
@@ -8,7 +8,6 @@ async function initWebpack(tree, options, tasks) {
|
|
|
8
8
|
const webpackInitTask = await webpackInitGenerator(tree, {
|
|
9
9
|
skipPackageJson: options.skipPackageJson,
|
|
10
10
|
skipFormat: true,
|
|
11
|
-
addPlugin: options.addPlugin,
|
|
12
11
|
});
|
|
13
12
|
tasks.push(webpackInitTask);
|
|
14
13
|
if (!options.skipPackageJson) {
|
|
@@ -41,7 +41,6 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
|
|
|
41
41
|
fileName: string;
|
|
42
42
|
hasStyles: boolean;
|
|
43
43
|
unitTestRunner: 'jest' | 'vitest' | 'none';
|
|
44
|
-
addPlugin?: boolean;
|
|
45
44
|
names: ReturnType<typeof import("@nx/devkit").names>;
|
|
46
45
|
isUsingTsSolutionConfig?: boolean;
|
|
47
46
|
typesNodeVersion: string;
|
|
@@ -9,9 +9,7 @@ const path_1 = require("path");
|
|
|
9
9
|
const create_ts_config_1 = require("../../../utils/create-ts-config");
|
|
10
10
|
const get_in_source_vitest_tests_template_1 = require("../../../utils/get-in-source-vitest-tests-template");
|
|
11
11
|
const maybe_js_1 = require("../../../utils/maybe-js");
|
|
12
|
-
const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
|
|
13
12
|
const get_app_tests_1 = require("./get-app-tests");
|
|
14
|
-
const has_rspack_plugin_1 = require("../../../utils/has-rspack-plugin");
|
|
15
13
|
const internal_1 = require("@nx/js/internal");
|
|
16
14
|
const versions_1 = require("../../../utils/versions");
|
|
17
15
|
const internal_2 = require("@nx/devkit/internal");
|
|
@@ -83,12 +81,7 @@ async function createApplicationFiles(host, options) {
|
|
|
83
81
|
else if (options.bundler === 'webpack') {
|
|
84
82
|
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/base-webpack'), options.appProjectRoot, {
|
|
85
83
|
...templateVariables,
|
|
86
|
-
|
|
87
|
-
// so it needs the executor-shaped config too — otherwise the plugin config's
|
|
88
|
-
// devServer.port and the serve target's port both describe the same server.
|
|
89
|
-
webpackPluginOptions: (0, has_webpack_plugin_1.hasWebpackPlugin)(host) && options.addPlugin
|
|
90
|
-
? createNxWebpackPluginOptions(options, templateVariables.offsetFromRoot)
|
|
91
|
-
: null,
|
|
84
|
+
webpackPluginOptions: createNxWebpackPluginOptions(options, templateVariables.offsetFromRoot),
|
|
92
85
|
});
|
|
93
86
|
if (options.compiler === 'babel') {
|
|
94
87
|
(0, devkit_1.writeJson)(host, `${options.appProjectRoot}/.babelrc`, {
|
|
@@ -114,9 +107,7 @@ async function createApplicationFiles(host, options) {
|
|
|
114
107
|
else if (options.bundler === 'rspack') {
|
|
115
108
|
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/base-rspack'), options.appProjectRoot, {
|
|
116
109
|
...templateVariables,
|
|
117
|
-
rspackPluginOptions: (
|
|
118
|
-
? createNxRspackPluginOptions(options, templateVariables.offsetFromRoot)
|
|
119
|
-
: null,
|
|
110
|
+
rspackPluginOptions: createNxRspackPluginOptions(options, templateVariables.offsetFromRoot),
|
|
120
111
|
});
|
|
121
112
|
}
|
|
122
113
|
else if (options.bundler === 'rsbuild') {
|
|
@@ -13,10 +13,6 @@ async function normalizeOptions(host, options) {
|
|
|
13
13
|
directory: options.directory,
|
|
14
14
|
rootProject: options.rootProject,
|
|
15
15
|
});
|
|
16
|
-
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
17
|
-
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
18
|
-
nxJson.useInferencePlugins !== false;
|
|
19
|
-
options.addPlugin ??= addPlugin;
|
|
20
16
|
options.rootProject = appProjectRoot === '.';
|
|
21
17
|
const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
22
18
|
const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
|
|
@@ -33,7 +33,6 @@ export interface Schema {
|
|
|
33
33
|
bundler?: 'webpack' | 'vite' | 'rspack' | 'rsbuild';
|
|
34
34
|
minimal?: boolean;
|
|
35
35
|
// Internal options
|
|
36
|
-
addPlugin?: boolean;
|
|
37
36
|
nxCloudToken?: string;
|
|
38
37
|
useTsSolution?: boolean;
|
|
39
38
|
formatter?: 'prettier' | 'oxfmt' | 'none';
|
|
@@ -53,7 +52,6 @@ export interface NormalizedSchema<T extends Schema = Schema> extends T {
|
|
|
53
52
|
fileName: string;
|
|
54
53
|
hasStyles: boolean;
|
|
55
54
|
unitTestRunner: 'jest' | 'vitest' | 'none';
|
|
56
|
-
addPlugin?: boolean;
|
|
57
55
|
names: ReturnType<typeof names>;
|
|
58
56
|
isUsingTsSolutionConfig?: boolean;
|
|
59
57
|
}
|
package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js
CHANGED
|
@@ -8,10 +8,7 @@ const versions_1 = require("../../utils/versions");
|
|
|
8
8
|
const add_files_1 = require("./lib/add-files");
|
|
9
9
|
const ct_utils_1 = require("../../utils/ct-utils");
|
|
10
10
|
function cypressComponentConfigGenerator(tree, options) {
|
|
11
|
-
return cypressComponentConfigGeneratorInternal(tree,
|
|
12
|
-
addPlugin: false,
|
|
13
|
-
...options,
|
|
14
|
-
});
|
|
11
|
+
return cypressComponentConfigGeneratorInternal(tree, options);
|
|
15
12
|
}
|
|
16
13
|
/**
|
|
17
14
|
* This is for using cypresses own Component testing, if you want to use test
|
|
@@ -21,10 +18,6 @@ function cypressComponentConfigGenerator(tree, options) {
|
|
|
21
18
|
async function cypressComponentConfigGeneratorInternal(tree, options) {
|
|
22
19
|
(0, assert_supported_react_version_1.assertSupportedReactVersion)(tree);
|
|
23
20
|
const { componentConfigurationGenerator: baseCyCtConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
24
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
25
|
-
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
26
|
-
nxJson.useInferencePlugins !== false;
|
|
27
|
-
options.addPlugin ??= addPlugin;
|
|
28
21
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
29
22
|
const { found, bundler } = await (0, ct_utils_1.resolveCypressCTTarget)(tree, {
|
|
30
23
|
project: options.project,
|
|
@@ -39,7 +32,6 @@ async function cypressComponentConfigGeneratorInternal(tree, options) {
|
|
|
39
32
|
project: options.project,
|
|
40
33
|
skipFormat: true,
|
|
41
34
|
jsx: true,
|
|
42
|
-
addPlugin: options.addPlugin,
|
|
43
35
|
bundler,
|
|
44
36
|
});
|
|
45
37
|
await (0, ct_utils_1.configureCypressCT)(tree, { project: options.project, found, bundler });
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.reactInitGenerator = reactInitGenerator;
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
6
7
|
const versions_1 = require("../../utils/versions");
|
|
7
8
|
const version_utils_1 = require("../../utils/version-utils");
|
|
8
9
|
const assert_supported_react_version_1 = require("../../utils/assert-supported-react-version");
|
|
@@ -20,11 +21,7 @@ async function reactInitGenerator(tree, schema) {
|
|
|
20
21
|
'@nx/react': versions_1.nxVersion,
|
|
21
22
|
}, undefined, schema.keepExistingVersions ?? true));
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
schema.addPlugin ??=
|
|
25
|
-
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
26
|
-
nxJson.useInferencePlugins !== false;
|
|
27
|
-
if (schema.useReactRouterPlugin && schema.addPlugin) {
|
|
24
|
+
if (schema.useReactRouterPlugin) {
|
|
28
25
|
await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/react/router-plugin', router_plugin_1.createNodes, {
|
|
29
26
|
buildTargetName: ['build', 'react-router:build', 'react-router-build'],
|
|
30
27
|
devTargetName: ['dev', 'react-router:dev', 'react-router-dev'],
|
|
@@ -40,6 +37,7 @@ async function reactInitGenerator(tree, schema) {
|
|
|
40
37
|
'react-router-build-deps',
|
|
41
38
|
],
|
|
42
39
|
}, schema.updatePackageScripts);
|
|
40
|
+
await (0, internal_2.ensureTypescriptPlugin)(tree, schema.updatePackageScripts);
|
|
43
41
|
}
|
|
44
42
|
if (!schema.skipFormat) {
|
|
45
43
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -20,7 +20,6 @@ async function addLinting(host, options) {
|
|
|
20
20
|
unitTestRunner: options.unitTestRunner,
|
|
21
21
|
skipPackageJson: options.skipPackageJson,
|
|
22
22
|
enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
|
|
23
|
-
addPlugin: options.addPlugin,
|
|
24
23
|
}));
|
|
25
24
|
// Predefined configs, `extends` and ignore entries are ESLint concepts with
|
|
26
25
|
// no equivalent in other linters.
|
|
@@ -20,13 +20,7 @@ async function addRollupBuildTarget(host, options, external = new Set(['react',
|
|
|
20
20
|
}, undefined, true));
|
|
21
21
|
}
|
|
22
22
|
external.add('react/jsx-runtime');
|
|
23
|
-
|
|
24
|
-
const hasRollupPlugin = !!nxJson.plugins?.some((p) => typeof p === 'string'
|
|
25
|
-
? p === '@nx/rollup/plugin'
|
|
26
|
-
: p.plugin === '@nx/rollup/plugin');
|
|
27
|
-
if (hasRollupPlugin) {
|
|
28
|
-
// New behavior, using rollup config file and inferred target.
|
|
29
|
-
host.write((0, devkit_1.joinPathFragments)(options.projectRoot, 'rollup.config.cjs'), `const { withNx } = require('@nx/rollup/with-nx');
|
|
23
|
+
host.write((0, devkit_1.joinPathFragments)(options.projectRoot, 'rollup.config.cjs'), `const { withNx } = require('@nx/rollup/with-nx');
|
|
30
24
|
const url = require('@rollup/plugin-url');
|
|
31
25
|
const svg = require('@svgr/rollup');
|
|
32
26
|
|
|
@@ -34,8 +28,8 @@ module.exports = withNx(
|
|
|
34
28
|
{
|
|
35
29
|
main: '${(0, maybe_js_1.maybeJs)(options, './src/index.ts')}',
|
|
36
30
|
outputPath: '${options.isUsingTsSolutionConfig
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
? './dist'
|
|
32
|
+
: (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(options.projectRoot), 'dist', options.projectRoot)}',
|
|
39
33
|
tsConfig: './tsconfig.lib.json',
|
|
40
34
|
compiler: '${options.compiler ?? 'babel'}',
|
|
41
35
|
external: ${JSON.stringify(Array.from(external))},
|
|
@@ -56,43 +50,5 @@ module.exports = withNx(
|
|
|
56
50
|
}
|
|
57
51
|
);
|
|
58
52
|
`);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
// Legacy behavior, there is a target in project.json using rollup executor.
|
|
62
|
-
// Mirrors warnRollupExecutorGenerating from @nx/rollup/src/utils/deprecation.
|
|
63
|
-
// Inlined to avoid a cross-package deep import; @nx/rollup's package
|
|
64
|
-
// exports field doesn't expose internal `src/...` paths, so the import
|
|
65
|
-
// works at compile time (via tsconfig project refs) but fails at runtime
|
|
66
|
-
// in published packages.
|
|
67
|
-
devkit_1.logger.warn('The `@nx/rollup:rollup` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/rollup:convert-to-inferred` to migrate to the `@nx/rollup/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
68
|
-
const { targets } = (0, devkit_1.readProjectConfiguration)(host, options.name);
|
|
69
|
-
targets.build = {
|
|
70
|
-
executor: '@nx/rollup:rollup',
|
|
71
|
-
outputs: ['{options.outputPath}'],
|
|
72
|
-
options: {
|
|
73
|
-
outputPath: (0, devkit_1.joinPathFragments)('dist', options.projectRoot),
|
|
74
|
-
tsConfig: `${options.projectRoot}/tsconfig.lib.json`,
|
|
75
|
-
project: `${options.projectRoot}/package.json`,
|
|
76
|
-
entryFile: (0, maybe_js_1.maybeJs)(options, `${options.projectRoot}/src/index.ts`),
|
|
77
|
-
external: Array.from(external),
|
|
78
|
-
rollupConfig: `@nx/react/plugins/bundle-rollup`,
|
|
79
|
-
compiler: options.compiler ?? 'babel',
|
|
80
|
-
assets: [
|
|
81
|
-
{
|
|
82
|
-
glob: `${options.projectRoot}/README.md`,
|
|
83
|
-
input: '.',
|
|
84
|
-
output: '.',
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
(0, devkit_1.updateProjectConfiguration)(host, options.name, {
|
|
90
|
-
root: options.projectRoot,
|
|
91
|
-
sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
|
|
92
|
-
projectType: 'library',
|
|
93
|
-
tags: options.parsedTags,
|
|
94
|
-
targets,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
53
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
98
54
|
}
|
|
@@ -14,10 +14,6 @@ async function normalizeOptions(host, options) {
|
|
|
14
14
|
directory: options.directory,
|
|
15
15
|
importPath: options.importPath,
|
|
16
16
|
});
|
|
17
|
-
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
18
|
-
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
19
|
-
nxJson.useInferencePlugins !== false;
|
|
20
|
-
options.addPlugin ??= addPlugin;
|
|
21
17
|
const fileName = projectNames.projectFileName;
|
|
22
18
|
const parsedTags = options.tags
|
|
23
19
|
? options.tags.split(',').map((s) => s.trim())
|
|
@@ -25,7 +25,6 @@ const set_defaults_1 = require("./lib/set-defaults");
|
|
|
25
25
|
const update_app_routes_1 = require("./lib/update-app-routes");
|
|
26
26
|
async function libraryGenerator(host, schema) {
|
|
27
27
|
return await libraryGeneratorInternal(host, {
|
|
28
|
-
addPlugin: false,
|
|
29
28
|
useProjectJson: true,
|
|
30
29
|
...schema,
|
|
31
30
|
});
|
|
@@ -33,7 +32,7 @@ async function libraryGenerator(host, schema) {
|
|
|
33
32
|
async function libraryGeneratorInternal(host, schema) {
|
|
34
33
|
(0, assert_supported_react_version_1.assertSupportedReactVersion)(host);
|
|
35
34
|
const tasks = [];
|
|
36
|
-
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host
|
|
35
|
+
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host);
|
|
37
36
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
38
37
|
...schema,
|
|
39
38
|
addTsPlugin,
|
|
@@ -101,7 +100,6 @@ async function libraryGeneratorInternal(host, schema) {
|
|
|
101
100
|
compiler: options.compiler,
|
|
102
101
|
skipFormat: true,
|
|
103
102
|
testEnvironment: 'jsdom',
|
|
104
|
-
addPlugin: options.addPlugin,
|
|
105
103
|
});
|
|
106
104
|
tasks.push(viteTask);
|
|
107
105
|
createOrEditViteConfig(host, {
|
|
@@ -159,7 +157,6 @@ async function libraryGeneratorInternal(host, schema) {
|
|
|
159
157
|
inSourceTests: options.inSourceTests,
|
|
160
158
|
skipFormat: true,
|
|
161
159
|
testEnvironment: 'jsdom',
|
|
162
|
-
addPlugin: options.addPlugin,
|
|
163
160
|
compiler: options.compiler,
|
|
164
161
|
});
|
|
165
162
|
tasks.push(vitestTask);
|
|
@@ -8,18 +8,11 @@ const framework_1 = require("../../utils/framework");
|
|
|
8
8
|
const versions_1 = require("../../utils/versions");
|
|
9
9
|
const stories_1 = require("../stories/stories");
|
|
10
10
|
function storybookConfigurationGenerator(host, schema) {
|
|
11
|
-
return storybookConfigurationGeneratorInternal(host,
|
|
12
|
-
addPlugin: false,
|
|
13
|
-
...schema,
|
|
14
|
-
});
|
|
11
|
+
return storybookConfigurationGeneratorInternal(host, schema);
|
|
15
12
|
}
|
|
16
13
|
async function storybookConfigurationGeneratorInternal(host, schema) {
|
|
17
14
|
(0, assert_supported_react_version_1.assertSupportedReactVersion)(host);
|
|
18
15
|
const tasks = [];
|
|
19
|
-
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
20
|
-
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
21
|
-
nxJson.useInferencePlugins !== false;
|
|
22
|
-
schema.addPlugin ??= addPluginDefault;
|
|
23
16
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
|
|
24
17
|
const uiFramework = (0, framework_1.getUiFramework)(host, schema.project);
|
|
25
18
|
if (uiFramework === '@storybook/react-vite') {
|
|
@@ -34,7 +27,6 @@ async function storybookConfigurationGeneratorInternal(host, schema) {
|
|
|
34
27
|
configureStaticServe: schema.configureStaticServe,
|
|
35
28
|
uiFramework: uiFramework, // cannot import UiFramework type dynamically
|
|
36
29
|
skipFormat: true,
|
|
37
|
-
addPlugin: schema.addPlugin,
|
|
38
30
|
});
|
|
39
31
|
tasks.push(installTask);
|
|
40
32
|
if (schema.generateStories) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = addOptionalModuleFederationPackages;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const versions_1 = require("../../utils/versions");
|
|
6
|
+
const httpProxyMiddlewareVersion = '^3.0.5';
|
|
6
7
|
const moduleFederationExecutors = new Set([
|
|
7
8
|
'@nx/react:module-federation-dev-server',
|
|
8
9
|
'@nx/react:module-federation-ssr-dev-server',
|
|
@@ -54,7 +55,7 @@ async function addOptionalModuleFederationPackages(tree) {
|
|
|
54
55
|
...(needsStaticServer
|
|
55
56
|
? {
|
|
56
57
|
express: versions_1.expressVersion,
|
|
57
|
-
'http-proxy-middleware':
|
|
58
|
+
'http-proxy-middleware': httpProxyMiddlewareVersion,
|
|
58
59
|
}
|
|
59
60
|
: {}),
|
|
60
61
|
}, undefined, true);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
|
+
async function update(tree) {
|
|
7
|
+
if (!(0, internal_1.registerTypescriptPluginForTypecheck)(tree, '@nx/react/router-plugin', {
|
|
8
|
+
removeTypecheckTargetName: true,
|
|
9
|
+
})) {
|
|
10
|
+
return { skipAgentic: true };
|
|
11
|
+
}
|
|
12
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#### Register `@nx/js/typescript` for typecheck targets
|
|
2
|
+
|
|
3
|
+
`@nx/react/router-plugin` no longer infers a `typecheck` target in any setup, and its `typecheckTargetName` option is removed. `@nx/js/typescript` provides the target instead. This migration registers `@nx/js/typescript` with only its typecheck target when the workspace uses `@nx/react/router-plugin` and doesn't register `@nx/js/typescript` yet, so your projects keep a `typecheck` target.
|
|
4
|
+
|
|
5
|
+
The new registration is added before the framework plugin and reuses its `typecheckTargetName`, and the migration then removes that option from `@nx/react/router-plugin`. Registrations with `typecheckTargetName: false` have the option removed and don't register `@nx/js/typescript`.
|
|
6
|
+
|
|
7
|
+
#### Sample code changes
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```json title="nx.json"
|
|
12
|
+
{
|
|
13
|
+
"plugins": [
|
|
14
|
+
{
|
|
15
|
+
"plugin": "@nx/react/router-plugin",
|
|
16
|
+
"options": {
|
|
17
|
+
"buildTargetName": "build",
|
|
18
|
+
"typecheckTargetName": "typecheck"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
##### After
|
|
26
|
+
|
|
27
|
+
```json title="nx.json"
|
|
28
|
+
{
|
|
29
|
+
"plugins": [
|
|
30
|
+
{
|
|
31
|
+
"plugin": "@nx/js/typescript",
|
|
32
|
+
"options": { "typecheck": { "targetName": "typecheck" } }
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"plugin": "@nx/react/router-plugin",
|
|
36
|
+
"options": { "buildTargetName": "build" }
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
```
|