@nx/react 23.0.0-beta.1 → 23.0.0-beta.2
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 +17 -22
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +0 -15
- 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-project.js +4 -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 +0 -4
- 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 +0 -4
- package/src/generators/component/schema.d.ts +0 -1
- package/src/generators/component/schema.json +2 -21
- package/src/generators/host/schema.json +2 -21
- 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 +1 -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/schema.json +2 -21
- package/src/generators/remote/schema.json +2 -21
- 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 +32 -5
- 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/versions.d.ts +1 -14
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +2 -17
- 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.2",
|
|
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": {
|
|
@@ -36,30 +36,29 @@
|
|
|
36
36
|
"@phenomnomnominal/tsquery": "~6.1.4",
|
|
37
37
|
"@svgr/webpack": "^8.0.1",
|
|
38
38
|
"minimatch": "10.2.4",
|
|
39
|
-
"picocolors": "^1.1.0",
|
|
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.2",
|
|
41
|
+
"@nx/js": "23.0.0-beta.2",
|
|
42
|
+
"@nx/eslint": "23.0.0-beta.2",
|
|
43
|
+
"@nx/web": "23.0.0-beta.2",
|
|
44
|
+
"@nx/module-federation": "23.0.0-beta.2",
|
|
45
|
+
"@nx/rollup": "23.0.0-beta.2",
|
|
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.2",
|
|
52
|
+
"@nx/playwright": "23.0.0-beta.2",
|
|
53
|
+
"@nx/rsbuild": "23.0.0-beta.2",
|
|
54
|
+
"@nx/vite": "23.0.0-beta.2",
|
|
55
|
+
"@nx/vitest": "23.0.0-beta.2",
|
|
56
|
+
"@nx/webpack": "23.0.0-beta.2",
|
|
57
|
+
"@nx/storybook": "23.0.0-beta.2",
|
|
58
|
+
"nx": "23.0.0-beta.2"
|
|
60
59
|
},
|
|
61
60
|
"optionalDependencies": {
|
|
62
|
-
"@nx/vite": "23.0.0-beta.
|
|
61
|
+
"@nx/vite": "23.0.0-beta.2"
|
|
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",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;AA8BpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,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"}
|
|
@@ -8,8 +8,6 @@ const js_1 = require("@nx/js");
|
|
|
8
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,7 +18,6 @@ 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");
|
|
@@ -68,7 +65,6 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
68
65
|
initial: 0,
|
|
69
66
|
}, { response: 'No' }).then((r) => r.response === 'Yes')))
|
|
70
67
|
: false;
|
|
71
|
-
(0, show_possible_warnings_1.showPossibleWarnings)(tree, options);
|
|
72
68
|
const initTask = await (0, init_1.default)(tree, {
|
|
73
69
|
...options,
|
|
74
70
|
skipFormat: true,
|
|
@@ -108,12 +104,6 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
108
104
|
if (options.isUsingTsSolutionConfig) {
|
|
109
105
|
await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
110
106
|
}
|
|
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
107
|
const lintTask = await (0, add_linting_1.addLinting)(tree, options);
|
|
118
108
|
tasks.push(lintTask);
|
|
119
109
|
if (options.bundler === 'vite') {
|
|
@@ -139,16 +129,11 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
139
129
|
(0, update_jest_config_1.updateSpecConfig)(tree, options);
|
|
140
130
|
const commonDependencyTask = await (0, install_common_dependencies_1.installCommonDependencies)(tree, options);
|
|
141
131
|
tasks.push(commonDependencyTask);
|
|
142
|
-
const styledTask = (0, add_styled_dependencies_1.addStyledModuleDependencies)(tree, options);
|
|
143
|
-
tasks.push(styledTask);
|
|
144
132
|
if (!options.useReactRouter) {
|
|
145
133
|
const routingTask = (0, add_routing_1.addRouting)(tree, options);
|
|
146
134
|
tasks.push(routingTask);
|
|
147
135
|
}
|
|
148
136
|
(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
137
|
if (options.useReactRouter) {
|
|
153
138
|
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json'), (json) => {
|
|
154
139
|
const types = new Set(json.compilerOptions?.types || []);
|
|
@@ -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
|
]
|
|
@@ -87,10 +87,10 @@ function createRspackBuildTarget(options) {
|
|
|
87
87
|
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
|
|
88
88
|
],
|
|
89
89
|
rspackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'rspack.config.js'),
|
|
90
|
-
styles:
|
|
90
|
+
styles: !options.hasStyles
|
|
91
91
|
? []
|
|
92
92
|
: [
|
|
93
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style
|
|
93
|
+
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style}`),
|
|
94
94
|
],
|
|
95
95
|
scripts: [],
|
|
96
96
|
configurations: {
|
|
@@ -149,10 +149,10 @@ function createBuildTarget(options) {
|
|
|
149
149
|
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/favicon.ico'),
|
|
150
150
|
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
|
|
151
151
|
],
|
|
152
|
-
styles:
|
|
152
|
+
styles: !options.hasStyles
|
|
153
153
|
? []
|
|
154
154
|
: [
|
|
155
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style
|
|
155
|
+
(0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style}`),
|
|
156
156
|
],
|
|
157
157
|
scripts: [],
|
|
158
158
|
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"}
|
|
@@ -16,7 +16,7 @@ const has_rspack_plugin_1 = require("../../../utils/has-rspack-plugin");
|
|
|
16
16
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
17
17
|
const versions_1 = require("../../../utils/versions");
|
|
18
18
|
function getDefaultTemplateVariables(host, options) {
|
|
19
|
-
const hasStyleFile = ['scss', 'css'
|
|
19
|
+
const hasStyleFile = ['scss', 'css'].includes(options.style);
|
|
20
20
|
const appTests = (0, get_app_tests_1.getAppTests)(options);
|
|
21
21
|
return {
|
|
22
22
|
...options.names,
|
|
@@ -33,7 +33,7 @@ function getDefaultTemplateVariables(host, options) {
|
|
|
33
33
|
offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.appProjectRoot),
|
|
34
34
|
appTests,
|
|
35
35
|
inSourceVitestTests: (0, get_in_source_vitest_tests_template_1.getInSourceVitestTestsTemplate)(appTests),
|
|
36
|
-
style: options.style
|
|
36
|
+
style: options.style,
|
|
37
37
|
hasStyleFile,
|
|
38
38
|
isUsingTsSolutionSetup: (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host),
|
|
39
39
|
port: options.port ?? 4200,
|
|
@@ -55,25 +55,12 @@ function createNxRspackPluginOptions(options, rootOffset, tsx = true) {
|
|
|
55
55
|
}, `./src/main.${tsx ? 'tsx' : 'ts'}`),
|
|
56
56
|
tsConfig: './tsconfig.app.json',
|
|
57
57
|
assets: ['./src/favicon.ico', './src/assets'],
|
|
58
|
-
styles: options.
|
|
59
|
-
? []
|
|
60
|
-
: [
|
|
61
|
-
`./src/styles.${options.style !== 'tailwind' ? options.style : 'css'}`,
|
|
62
|
-
],
|
|
58
|
+
styles: !options.hasStyles ? [] : [`./src/styles.${options.style}`],
|
|
63
59
|
};
|
|
64
60
|
}
|
|
65
61
|
async function createApplicationFiles(host, options) {
|
|
66
62
|
let styleSolutionSpecificAppFiles;
|
|
67
|
-
if (options.
|
|
68
|
-
styleSolutionSpecificAppFiles = '../files/style-styled-module';
|
|
69
|
-
}
|
|
70
|
-
else if (options.style === 'styled-jsx') {
|
|
71
|
-
styleSolutionSpecificAppFiles = '../files/style-styled-jsx';
|
|
72
|
-
}
|
|
73
|
-
else if (options.style === 'tailwind') {
|
|
74
|
-
styleSolutionSpecificAppFiles = '../files/style-tailwind';
|
|
75
|
-
}
|
|
76
|
-
else if (options.style === 'none') {
|
|
63
|
+
if (options.style === 'none') {
|
|
77
64
|
styleSolutionSpecificAppFiles = '../files/style-none';
|
|
78
65
|
}
|
|
79
66
|
else if (options.globalCss) {
|
|
@@ -107,53 +94,18 @@ async function createApplicationFiles(host, options) {
|
|
|
107
94
|
'@nx/react/babel',
|
|
108
95
|
{
|
|
109
96
|
runtime: 'automatic',
|
|
110
|
-
importSource: options.style === '@emotion/styled'
|
|
111
|
-
? '@emotion/react'
|
|
112
|
-
: undefined,
|
|
113
97
|
},
|
|
114
98
|
],
|
|
115
99
|
],
|
|
116
|
-
plugins: [
|
|
117
|
-
options.style === 'styled-components'
|
|
118
|
-
? ['styled-components', { pure: true, ssr: true }]
|
|
119
|
-
: undefined,
|
|
120
|
-
options.style === 'styled-jsx' ? 'styled-jsx/babel' : undefined,
|
|
121
|
-
options.style === '@emotion/styled'
|
|
122
|
-
? '@emotion/babel-plugin'
|
|
123
|
-
: undefined,
|
|
124
|
-
].filter(Boolean),
|
|
100
|
+
plugins: [],
|
|
125
101
|
});
|
|
126
102
|
}
|
|
127
103
|
else if (options.compiler === 'swc') {
|
|
128
|
-
|
|
104
|
+
(0, devkit_1.writeJson)(host, `${options.appProjectRoot}/.swcrc`, {
|
|
129
105
|
jsc: {
|
|
130
106
|
target: 'es2016',
|
|
131
107
|
},
|
|
132
|
-
};
|
|
133
|
-
if (options.style === 'styled-components') {
|
|
134
|
-
swcrc.jsc.experimental = {
|
|
135
|
-
plugins: [
|
|
136
|
-
[
|
|
137
|
-
'@swc/plugin-styled-components',
|
|
138
|
-
{
|
|
139
|
-
displayName: true,
|
|
140
|
-
ssr: true,
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
],
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
else if (options.style === '@emotion/styled') {
|
|
147
|
-
swcrc.jsc.experimental = {
|
|
148
|
-
plugins: [['@swc/plugin-emotion', {}]],
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
else if (options.style === 'styled-jsx') {
|
|
152
|
-
swcrc.jsc.experimental = {
|
|
153
|
-
plugins: [['@swc/plugin-styled-jsx', {}]],
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
(0, devkit_1.writeJson)(host, `${options.appProjectRoot}/.swcrc`, swcrc);
|
|
108
|
+
});
|
|
157
109
|
}
|
|
158
110
|
}
|
|
159
111
|
else if (options.bundler === 'rspack') {
|
|
@@ -207,11 +159,7 @@ function createNxWebpackPluginOptions(options, rootOffset) {
|
|
|
207
159
|
}, `./src/main.tsx`),
|
|
208
160
|
tsConfig: './tsconfig.app.json',
|
|
209
161
|
assets: ['./src/favicon.ico', './src/assets'],
|
|
210
|
-
styles: options.
|
|
211
|
-
? []
|
|
212
|
-
: [
|
|
213
|
-
`./src/styles.${options.style !== 'tailwind' ? options.style : 'css'}`,
|
|
214
|
-
],
|
|
162
|
+
styles: !options.hasStyles ? [] : [`./src/styles.${options.style}`],
|
|
215
163
|
};
|
|
216
164
|
}
|
|
217
165
|
function generateReactRouterFiles(tree, options, templateVariables) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-common-dependencies.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/install-common-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"install-common-dependencies.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/install-common-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,IAAI,EAAE,MAAM,YAAY,CAAC;AAahE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,mDAwD1B"}
|
|
@@ -32,13 +32,8 @@ async function installCommonDependencies(host, options) {
|
|
|
32
32
|
// Vite requires style preprocessors to be installed manually.
|
|
33
33
|
// `@nx/webpack` installs them automatically for now.
|
|
34
34
|
if (options.bundler === 'vite' || options.unitTestRunner === 'vitest') {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
devDependencies['sass'] = versions_1.sassVersion;
|
|
38
|
-
break;
|
|
39
|
-
case 'less':
|
|
40
|
-
devDependencies['less'] = versions_1.lessVersion;
|
|
41
|
-
break;
|
|
35
|
+
if (options.style === 'scss') {
|
|
36
|
+
devDependencies['sass'] = versions_1.sassVersion;
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
if (options.bundler === 'webpack') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAqB,MAAM,YAAY,CAAC;AASrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAIrD,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC9D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAqB,MAAM,YAAY,CAAC;AASrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAIrD,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC9D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAwE9B"}
|
|
@@ -27,9 +27,6 @@ async function normalizeOptions(host, options) {
|
|
|
27
27
|
? options.tags.split(',').map((s) => s.trim())
|
|
28
28
|
: [];
|
|
29
29
|
const fileName = 'app';
|
|
30
|
-
const styledModule = /^(css|scss|less|tailwind|none)$/.test(options.style)
|
|
31
|
-
? null
|
|
32
|
-
: options.style;
|
|
33
30
|
(0, assertion_1.assertValidStyle)(options.style);
|
|
34
31
|
(0, assertion_1.assertValidReactRouter)(options.useReactRouter, options.bundler);
|
|
35
32
|
if (options.useReactRouter && !options.bundler) {
|
|
@@ -45,7 +42,6 @@ async function normalizeOptions(host, options) {
|
|
|
45
42
|
e2eProjectRoot,
|
|
46
43
|
parsedTags,
|
|
47
44
|
fileName,
|
|
48
|
-
styledModule,
|
|
49
45
|
hasStyles: options.style !== 'none',
|
|
50
46
|
names: (0, devkit_1.names)(projectNames.projectSimpleName),
|
|
51
47
|
isUsingTsSolutionConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-jest-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/update-jest-config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"update-jest-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/update-jest-config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,QAiCrE"}
|
|
@@ -10,9 +10,6 @@ function updateSpecConfig(host, options) {
|
|
|
10
10
|
(0, devkit_1.updateJson)(host, `${options.appProjectRoot}/tsconfig.spec.json`, (json) => {
|
|
11
11
|
const compilerOptions = json.compilerOptions ?? {};
|
|
12
12
|
const types = compilerOptions.types ?? [];
|
|
13
|
-
if (options.style === 'styled-jsx') {
|
|
14
|
-
types.push('@nx/react/typings/styled-jsx.d.ts');
|
|
15
|
-
}
|
|
16
13
|
types.push('@nx/react/typings/cssmodule.d.ts', '@nx/react/typings/image.d.ts');
|
|
17
14
|
compilerOptions.types = types;
|
|
18
15
|
json.compilerOptions = compilerOptions;
|
|
@@ -44,7 +44,6 @@ export interface NormalizedSchema<T extends Schema = Schema> extends T {
|
|
|
44
44
|
importPath: string;
|
|
45
45
|
parsedTags: string[];
|
|
46
46
|
fileName: string;
|
|
47
|
-
styledModule: null | SupportedStyles;
|
|
48
47
|
hasStyles: boolean;
|
|
49
48
|
unitTestRunner: 'jest' | 'vitest' | 'none';
|
|
50
49
|
addPlugin?: boolean;
|