@nx/react 23.2.0-beta.5 → 23.2.0-beta.7
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/src/generators/application/files/nx-welcome/claimed/src/app/nx-welcome.tsx__tmpl__ +2 -0
- package/dist/src/generators/application/files/nx-welcome/not-configured/src/app/nx-welcome.tsx__tmpl__ +2 -0
- package/dist/src/generators/application/files/nx-welcome/unclaimed/src/app/nx-welcome.tsx__tmpl__ +2 -0
- package/dist/src/generators/application/files/react-router-ssr/nx-welcome/claimed/app/nx-welcome.tsx__tmpl__ +2 -0
- package/dist/src/generators/application/files/react-router-ssr/nx-welcome/not-configured/app/nx-welcome.tsx__tmpl__ +2 -0
- package/dist/src/generators/application/files/react-router-ssr/nx-welcome/unclaimed/app/nx-welcome.tsx__tmpl__ +2 -0
- package/dist/src/generators/application/lib/add-linting.d.ts +0 -1
- package/dist/src/generators/application/lib/add-linting.js +19 -29
- package/dist/src/generators/application/lib/create-application-files.d.ts +1 -1
- package/dist/src/generators/application/lib/normalize-options.js +15 -11
- package/dist/src/generators/application/schema.d.ts +4 -2
- package/dist/src/generators/application/schema.json +2 -4
- package/dist/src/generators/federate-module/schema.d.ts +2 -2
- package/dist/src/generators/federate-module/schema.json +2 -3
- package/dist/src/generators/host/schema.d.ts +4 -2
- package/dist/src/generators/host/schema.json +2 -3
- package/dist/src/generators/library/lib/add-linting.js +28 -29
- package/dist/src/generators/library/lib/normalize-options.js +28 -21
- package/dist/src/generators/library/schema.d.ts +4 -2
- package/dist/src/generators/library/schema.json +2 -4
- package/dist/src/generators/remote/schema.d.ts +2 -2
- package/dist/src/generators/remote/schema.json +2 -3
- package/dist/src/generators/storybook-configuration/schema.d.ts +2 -2
- package/dist/src/generators/storybook-configuration/schema.json +1 -2
- package/dist/src/utils/ast-utils.js +2 -2
- package/package.json +19 -19
- /package/dist/src/generators/consumer/files/vite/{vite.config.ts__tmpl__ → vite.config.mts__tmpl__} +0 -0
- /package/dist/src/generators/provider/files/vite/{vite.config.ts__tmpl__ → vite.config.mts__tmpl__} +0 -0
package/dist/src/generators/application/files/nx-welcome/claimed/src/app/nx-welcome.tsx__tmpl__
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
Delete this file and get started with your project!
|
|
6
6
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
7
7
|
*/
|
|
8
|
+
/* oxlint-disable jsx-a11y/prefer-tag-over-role -- the icons below
|
|
9
|
+
are inline SVGs, which have no tag to swap the role for. */
|
|
8
10
|
export function NxWelcome({ title }: { title: string }) {
|
|
9
11
|
return (
|
|
10
12
|
<>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
Delete this file and get started with your project!
|
|
6
6
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
7
7
|
*/
|
|
8
|
+
/* oxlint-disable jsx-a11y/prefer-tag-over-role -- the icons below
|
|
9
|
+
are inline SVGs, which have no tag to swap the role for. */
|
|
8
10
|
export function NxWelcome({ title }: { title: string }) {
|
|
9
11
|
return (
|
|
10
12
|
<>
|
package/dist/src/generators/application/files/nx-welcome/unclaimed/src/app/nx-welcome.tsx__tmpl__
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
Delete this file and get started with your project!
|
|
6
6
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
7
7
|
*/
|
|
8
|
+
/* oxlint-disable jsx-a11y/prefer-tag-over-role -- the icons below
|
|
9
|
+
are inline SVGs, which have no tag to swap the role for. */
|
|
8
10
|
export function NxWelcome({ title }: { title: string }) {
|
|
9
11
|
return (
|
|
10
12
|
<>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
Delete this file and get started with your project!
|
|
6
6
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
7
7
|
*/
|
|
8
|
+
/* oxlint-disable jsx-a11y/prefer-tag-over-role -- the icons below
|
|
9
|
+
are inline SVGs, which have no tag to swap the role for. */
|
|
8
10
|
export function NxWelcome({ title }: { title: string }) {
|
|
9
11
|
return (
|
|
10
12
|
<>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
Delete this file and get started with your project!
|
|
6
6
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
7
7
|
*/
|
|
8
|
+
/* oxlint-disable jsx-a11y/prefer-tag-over-role -- the icons below
|
|
9
|
+
are inline SVGs, which have no tag to swap the role for. */
|
|
8
10
|
export function NxWelcome({ title }: { title: string }) {
|
|
9
11
|
return (
|
|
10
12
|
<>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
Delete this file and get started with your project!
|
|
6
6
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
7
7
|
*/
|
|
8
|
+
/* oxlint-disable jsx-a11y/prefer-tag-over-role -- the icons below
|
|
9
|
+
are inline SVGs, which have no tag to swap the role for. */
|
|
8
10
|
export function NxWelcome({ title }: { title: string }) {
|
|
9
11
|
return (
|
|
10
12
|
<>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type Tree, type GeneratorCallback } from '@nx/devkit';
|
|
2
2
|
import { NormalizedSchema } from '../schema';
|
|
3
3
|
export declare function addLinting(host: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
|
|
4
|
-
export declare function isEslintInstalled(tree: Tree): boolean;
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addLinting = addLinting;
|
|
4
|
-
exports.isEslintInstalled = isEslintInstalled;
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const eslint_1 = require("@nx/eslint");
|
|
7
5
|
const internal_1 = require("@nx/eslint/internal");
|
|
8
6
|
const devkit_2 = require("@nx/devkit");
|
|
9
7
|
const internal_2 = require("@nx/js/internal");
|
|
10
8
|
const lint_1 = require("../../../utils/lint");
|
|
11
9
|
const versions_1 = require("../../../utils/versions");
|
|
12
10
|
async function addLinting(host, options) {
|
|
11
|
+
if (options.linter === 'none') {
|
|
12
|
+
return () => { };
|
|
13
|
+
}
|
|
13
14
|
const tasks = [];
|
|
15
|
+
tasks.push(await (0, internal_2.addLintingToProject)(host, {
|
|
16
|
+
oxlintPlugins: ['react', 'react-perf', 'jsx-a11y'],
|
|
17
|
+
linter: options.linter,
|
|
18
|
+
project: options.projectName,
|
|
19
|
+
tsConfigPaths: [
|
|
20
|
+
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
|
21
|
+
],
|
|
22
|
+
unitTestRunner: options.unitTestRunner,
|
|
23
|
+
rootProject: options.rootProject,
|
|
24
|
+
skipPackageJson: options.skipPackageJson,
|
|
25
|
+
enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
|
|
26
|
+
addPlugin: options.addPlugin,
|
|
27
|
+
}));
|
|
28
|
+
// Predefined configs, `extends` and ignore entries are ESLint concepts with
|
|
29
|
+
// no equivalent in other linters.
|
|
14
30
|
if (options.linter === 'eslint') {
|
|
15
|
-
const lintTask = await (0, eslint_1.lintProjectGenerator)(host, {
|
|
16
|
-
linter: options.linter,
|
|
17
|
-
project: options.projectName,
|
|
18
|
-
tsConfigPaths: [
|
|
19
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
|
20
|
-
],
|
|
21
|
-
unitTestRunner: options.unitTestRunner,
|
|
22
|
-
skipFormat: true,
|
|
23
|
-
rootProject: options.rootProject,
|
|
24
|
-
skipPackageJson: options.skipPackageJson,
|
|
25
|
-
enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
|
|
26
|
-
addPlugin: options.addPlugin,
|
|
27
|
-
});
|
|
28
|
-
tasks.push(lintTask);
|
|
29
31
|
if ((0, internal_1.isEslintConfigSupported)(host)) {
|
|
30
32
|
if ((0, internal_1.useFlatConfig)(host)) {
|
|
31
33
|
(0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react', { checkBaseConfig: true });
|
|
@@ -52,7 +54,7 @@ async function addLinting(host, options) {
|
|
|
52
54
|
return (0, devkit_2.runTasksInSerial)(...tasks);
|
|
53
55
|
}
|
|
54
56
|
async function ignoreReactRouterFilesInEslintConfig(tree, projectRoot) {
|
|
55
|
-
if (!
|
|
57
|
+
if (!(0, internal_2.detectLinters)(tree).includes('eslint')) {
|
|
56
58
|
return;
|
|
57
59
|
}
|
|
58
60
|
(0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
|
|
@@ -71,15 +73,3 @@ async function ignoreReactRouterFilesInEslintConfig(tree, projectRoot) {
|
|
|
71
73
|
const directory = isUsingFlatConfig ? '' : (projectRoot ?? '');
|
|
72
74
|
addIgnoresToLintConfig(tree, directory, ['**/build', '**/.react-router']);
|
|
73
75
|
}
|
|
74
|
-
function isEslintInstalled(tree) {
|
|
75
|
-
try {
|
|
76
|
-
require('eslint');
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
catch { }
|
|
80
|
-
// it might not be installed yet, but it might be in the tree pending install
|
|
81
|
-
const { devDependencies, dependencies } = tree.exists('package.json')
|
|
82
|
-
? (0, devkit_1.readJson)(tree, 'package.json')
|
|
83
|
-
: {};
|
|
84
|
-
return !!devDependencies?.['eslint'] || !!dependencies?.['eslint'];
|
|
85
|
-
}
|
|
@@ -12,7 +12,6 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
|
|
|
12
12
|
tags?: string;
|
|
13
13
|
inSourceTests?: boolean;
|
|
14
14
|
e2eTestRunner: 'cypress' | 'playwright' | 'none';
|
|
15
|
-
linter: import("@nx/eslint").Linter | import("@nx/eslint").LinterType;
|
|
16
15
|
classComponent?: boolean;
|
|
17
16
|
routing?: boolean;
|
|
18
17
|
useReactRouter?: boolean;
|
|
@@ -32,6 +31,7 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
|
|
|
32
31
|
useTsSolution?: boolean;
|
|
33
32
|
formatter?: 'prettier' | 'none';
|
|
34
33
|
useProjectJson?: boolean;
|
|
34
|
+
linter: import("@nx/js").LinterType;
|
|
35
35
|
projectName: string;
|
|
36
36
|
appProjectRoot: string;
|
|
37
37
|
e2eProjectName: string;
|
|
@@ -46,17 +46,21 @@ async function normalizeOptions(host, options) {
|
|
|
46
46
|
names: (0, devkit_1.names)(projectNames.projectSimpleName),
|
|
47
47
|
isUsingTsSolutionConfig,
|
|
48
48
|
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
49
|
+
routing: options.routing ?? false,
|
|
50
|
+
useReactRouter: options.useReactRouter ?? false,
|
|
51
|
+
strict: options.strict ?? true,
|
|
52
|
+
classComponent: options.classComponent ?? false,
|
|
53
|
+
compiler: options.compiler ?? 'babel',
|
|
54
|
+
bundler: options.bundler ?? 'webpack',
|
|
55
|
+
unitTestRunner: options.unitTestRunner ?? 'jest',
|
|
56
|
+
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
57
|
+
inSourceTests: options.minimal || options.inSourceTests,
|
|
58
|
+
devServerPort: options.devServerPort ?? options.port ?? (0, find_free_port_1.findFreePort)(host),
|
|
59
|
+
minimal: options.minimal ?? false,
|
|
60
|
+
// Programmatic callers such as the host and remote generators leave this
|
|
61
|
+
// unset; the guards downstream read an unresolved `undefined` as "not eslint"
|
|
62
|
+
// and would half-configure the project.
|
|
63
|
+
linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
|
|
49
64
|
};
|
|
50
|
-
normalized.routing = normalized.routing ?? false;
|
|
51
|
-
normalized.useReactRouter = normalized.useReactRouter ?? false;
|
|
52
|
-
normalized.strict = normalized.strict ?? true;
|
|
53
|
-
normalized.classComponent = normalized.classComponent ?? false;
|
|
54
|
-
normalized.compiler = normalized.compiler ?? 'babel';
|
|
55
|
-
normalized.bundler = normalized.bundler ?? 'webpack';
|
|
56
|
-
normalized.unitTestRunner = normalized.unitTestRunner ?? 'jest';
|
|
57
|
-
normalized.e2eTestRunner = normalized.e2eTestRunner ?? 'playwright';
|
|
58
|
-
normalized.inSourceTests = normalized.minimal || normalized.inSourceTests;
|
|
59
|
-
normalized.devServerPort ??= options.port ?? (0, find_free_port_1.findFreePort)(host);
|
|
60
|
-
normalized.minimal = normalized.minimal ?? false;
|
|
61
65
|
return normalized;
|
|
62
66
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { names } from '@nx/devkit';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LinterType } from '@nx/js';
|
|
3
3
|
import type { SupportedStyles } from '../../../typings/style';
|
|
4
4
|
|
|
5
5
|
export interface Schema {
|
|
@@ -11,7 +11,7 @@ export interface Schema {
|
|
|
11
11
|
unitTestRunner?: 'jest' | 'vitest' | 'none';
|
|
12
12
|
inSourceTests?: boolean;
|
|
13
13
|
e2eTestRunner: 'cypress' | 'playwright' | 'none';
|
|
14
|
-
linter
|
|
14
|
+
linter?: LinterType;
|
|
15
15
|
classComponent?: boolean;
|
|
16
16
|
routing?: boolean;
|
|
17
17
|
useReactRouter?: boolean;
|
|
@@ -41,6 +41,8 @@ export interface Schema {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export interface NormalizedSchema<T extends Schema = Schema> extends T {
|
|
44
|
+
// `normalizeOptions` always resolves this, so it is no longer optional.
|
|
45
|
+
linter: LinterType;
|
|
44
46
|
projectName: string;
|
|
45
47
|
appProjectRoot: string;
|
|
46
48
|
e2eProjectName: string;
|
|
@@ -97,11 +97,9 @@
|
|
|
97
97
|
"x-priority": "important"
|
|
98
98
|
},
|
|
99
99
|
"linter": {
|
|
100
|
-
"description": "The tool to use for running lint checks.",
|
|
100
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
101
101
|
"type": "string",
|
|
102
|
-
"enum": ["eslint", "none"],
|
|
103
|
-
"default": "none",
|
|
104
|
-
"x-prompt": "Which linter would you like to use?",
|
|
102
|
+
"enum": ["eslint", "oxlint", "none"],
|
|
105
103
|
"x-priority": "important"
|
|
106
104
|
},
|
|
107
105
|
"unitTestRunner": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinterType } from '@nx/js';
|
|
2
2
|
|
|
3
3
|
export interface Schema {
|
|
4
4
|
name: string;
|
|
@@ -7,7 +7,7 @@ export interface Schema {
|
|
|
7
7
|
remoteDirectory?: string;
|
|
8
8
|
e2eTestRunner?: 'cypress' | 'playwright' | 'none';
|
|
9
9
|
host?: string;
|
|
10
|
-
linter?:
|
|
10
|
+
linter?: LinterType;
|
|
11
11
|
skipFormat?: boolean;
|
|
12
12
|
style?: SupportedStyles;
|
|
13
13
|
unitTestRunner?: 'jest' | 'vitest' | 'none';
|
|
@@ -50,10 +50,9 @@
|
|
|
50
50
|
"alias": "s"
|
|
51
51
|
},
|
|
52
52
|
"linter": {
|
|
53
|
-
"description": "The tool to use for running lint checks.",
|
|
53
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
54
54
|
"type": "string",
|
|
55
|
-
"enum": ["eslint"]
|
|
56
|
-
"default": "eslint"
|
|
55
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
57
56
|
},
|
|
58
57
|
"skipFormat": {
|
|
59
58
|
"description": "Skip formatting files.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
import type { SupportedStyles } from '../../../typings/style';
|
|
3
3
|
|
|
4
4
|
export interface Schema {
|
|
@@ -9,7 +9,7 @@ export interface Schema {
|
|
|
9
9
|
e2eTestRunner: 'cypress' | 'playwright' | 'none';
|
|
10
10
|
globalCss?: boolean;
|
|
11
11
|
js?: boolean;
|
|
12
|
-
linter
|
|
12
|
+
linter?: LinterType;
|
|
13
13
|
name?: string;
|
|
14
14
|
remotes?: string[];
|
|
15
15
|
enableTypedLinting?: boolean;
|
|
@@ -33,6 +33,8 @@ export interface Schema {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface NormalizedSchema extends Schema {
|
|
36
|
+
// `normalizeOptions` always resolves this, so it is no longer optional.
|
|
37
|
+
linter: LinterType;
|
|
36
38
|
appProjectRoot: string;
|
|
37
39
|
e2eProjectName: string;
|
|
38
40
|
projectName: string;
|
|
@@ -48,10 +48,9 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"linter": {
|
|
51
|
-
"description": "The tool to use for running lint checks.",
|
|
51
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
52
52
|
"type": "string",
|
|
53
|
-
"enum": ["eslint"]
|
|
54
|
-
"default": "eslint"
|
|
53
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
55
54
|
},
|
|
56
55
|
"dynamic": {
|
|
57
56
|
"type": "boolean",
|
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addLinting = addLinting;
|
|
4
|
-
const eslint_1 = require("@nx/eslint");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
const lint_1 = require("../../../utils/lint");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/eslint/internal");
|
|
8
8
|
async function addLinting(host, options) {
|
|
9
|
+
if (options.linter === 'none') {
|
|
10
|
+
return () => { };
|
|
11
|
+
}
|
|
12
|
+
const tasks = [];
|
|
13
|
+
tasks.push(await (0, internal_1.addLintingToProject)(host, {
|
|
14
|
+
oxlintPlugins: ['react', 'react-perf', 'jsx-a11y'],
|
|
15
|
+
linter: options.linter,
|
|
16
|
+
project: options.name,
|
|
17
|
+
tsConfigPaths: [
|
|
18
|
+
(0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.lib.json'),
|
|
19
|
+
],
|
|
20
|
+
unitTestRunner: options.unitTestRunner,
|
|
21
|
+
skipPackageJson: options.skipPackageJson,
|
|
22
|
+
enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
|
|
23
|
+
addPlugin: options.addPlugin,
|
|
24
|
+
}));
|
|
25
|
+
// Predefined configs, `extends` and ignore entries are ESLint concepts with
|
|
26
|
+
// no equivalent in other linters.
|
|
9
27
|
if (options.linter === 'eslint') {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
project: options.name,
|
|
14
|
-
tsConfigPaths: [
|
|
15
|
-
(0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.lib.json'),
|
|
16
|
-
],
|
|
17
|
-
unitTestRunner: options.unitTestRunner,
|
|
18
|
-
skipFormat: true,
|
|
19
|
-
skipPackageJson: options.skipPackageJson,
|
|
20
|
-
enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
|
|
21
|
-
addPlugin: options.addPlugin,
|
|
22
|
-
});
|
|
23
|
-
tasks.push(lintTask);
|
|
24
|
-
if ((0, internal_1.isEslintConfigSupported)(host)) {
|
|
25
|
-
if ((0, internal_1.useFlatConfig)(host)) {
|
|
26
|
-
(0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react', { checkBaseConfig: true });
|
|
28
|
+
if ((0, internal_2.isEslintConfigSupported)(host)) {
|
|
29
|
+
if ((0, internal_2.useFlatConfig)(host)) {
|
|
30
|
+
(0, internal_2.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react', { checkBaseConfig: true });
|
|
27
31
|
// Add an empty rules object to users know how to add/override rules
|
|
28
|
-
(0,
|
|
32
|
+
(0, internal_2.addOverrideToLintConfig)(host, options.projectRoot, {
|
|
29
33
|
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
30
34
|
rules: {},
|
|
31
35
|
});
|
|
32
36
|
}
|
|
33
37
|
else {
|
|
34
|
-
const addExtendsTask = (0,
|
|
38
|
+
const addExtendsTask = (0, internal_2.addExtendsToLintConfig)(host, options.projectRoot, {
|
|
35
39
|
name: 'plugin:@nx/react',
|
|
36
40
|
needCompatFixup: true,
|
|
37
41
|
});
|
|
@@ -39,17 +43,12 @@ async function addLinting(host, options) {
|
|
|
39
43
|
}
|
|
40
44
|
// Add out-tsc ignore pattern when using TS solution setup
|
|
41
45
|
if (options.isUsingTsSolutionConfig) {
|
|
42
|
-
(0,
|
|
46
|
+
(0, internal_2.addIgnoresToLintConfig)(host, options.projectRoot, ['**/out-tsc']);
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
|
-
let installTask = () => { };
|
|
46
49
|
if (!options.skipPackageJson) {
|
|
47
|
-
|
|
48
|
-
tasks.push(installTask);
|
|
50
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies, undefined, true));
|
|
49
51
|
}
|
|
50
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return () => { };
|
|
54
52
|
}
|
|
53
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
55
54
|
}
|
|
@@ -33,39 +33,46 @@ async function normalizeOptions(host, options) {
|
|
|
33
33
|
bundler = 'rollup';
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
compiler: options.compiler ?? 'babel',
|
|
39
|
-
bundler,
|
|
40
|
-
fileName,
|
|
41
|
-
routePath: `/${projectNames.projectSimpleName}`,
|
|
42
|
-
name: isUsingTsSolutionConfig && !options.name ? importPath : projectName,
|
|
43
|
-
projectRoot,
|
|
44
|
-
parsedTags,
|
|
45
|
-
importPath,
|
|
46
|
-
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
47
|
-
};
|
|
48
|
-
// Libraries with a bundler or is publishable must also be buildable.
|
|
49
|
-
normalized.buildable = Boolean(normalized.bundler !== 'none' || options.buildable || options.publishable);
|
|
50
|
-
normalized.inSourceTests === normalized.minimal || normalized.inSourceTests;
|
|
36
|
+
let appMain;
|
|
37
|
+
let appSourceRoot;
|
|
51
38
|
if (options.appProject) {
|
|
52
39
|
const appProjectConfig = (0, devkit_1.getProjects)(host).get(options.appProject);
|
|
53
40
|
const appProjectType = (0, internal_2.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
|
|
54
41
|
if (appProjectType !== 'application') {
|
|
55
42
|
throw new Error(`appProject expected type of "application" but got "${appProjectType}"`);
|
|
56
43
|
}
|
|
57
|
-
|
|
58
|
-
normalized.appMain =
|
|
44
|
+
appMain =
|
|
59
45
|
appProjectConfig.targets.build?.options?.main ??
|
|
60
46
|
findMainEntry(host, appProjectConfig.root);
|
|
61
|
-
|
|
47
|
+
appSourceRoot = (0, devkit_1.normalizePath)((0, internal_2.getProjectSourceRoot)(appProjectConfig, host));
|
|
62
48
|
// TODO(jack): We should use appEntryFile instead of appProject so users can directly set it rather than us inferring it.
|
|
63
|
-
if (!
|
|
49
|
+
if (!appMain) {
|
|
64
50
|
throw new Error(`Could not locate project main for ${options.appProject}`);
|
|
65
51
|
}
|
|
66
52
|
}
|
|
67
|
-
(0, assertion_1.assertValidStyle)(
|
|
68
|
-
normalized
|
|
53
|
+
(0, assertion_1.assertValidStyle)(options.style);
|
|
54
|
+
const normalized = {
|
|
55
|
+
...options,
|
|
56
|
+
compiler: options.compiler ?? 'babel',
|
|
57
|
+
bundler,
|
|
58
|
+
fileName,
|
|
59
|
+
routePath: `/${projectNames.projectSimpleName}`,
|
|
60
|
+
name: isUsingTsSolutionConfig && !options.name ? importPath : projectName,
|
|
61
|
+
projectRoot,
|
|
62
|
+
parsedTags,
|
|
63
|
+
importPath,
|
|
64
|
+
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
65
|
+
isUsingTsSolutionConfig,
|
|
66
|
+
js: options.js ?? false,
|
|
67
|
+
unitTestRunner: options.unitTestRunner ?? 'none',
|
|
68
|
+
// Libraries with a bundler or that are publishable must also be buildable.
|
|
69
|
+
buildable: Boolean(bundler !== 'none' || options.buildable || options.publishable),
|
|
70
|
+
appMain,
|
|
71
|
+
appSourceRoot,
|
|
72
|
+
// The React-specific ESLint shaping is guarded on `=== 'eslint'`, so an
|
|
73
|
+
// unresolved `undefined` would create a bare config with none of it.
|
|
74
|
+
linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
|
|
75
|
+
};
|
|
69
76
|
return normalized;
|
|
70
77
|
}
|
|
71
78
|
function findMainEntry(tree, projectRoot) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
import type { SupportedStyles } from '../../../typings/style';
|
|
3
3
|
|
|
4
4
|
export interface Schema {
|
|
@@ -12,7 +12,7 @@ export interface Schema {
|
|
|
12
12
|
importPath?: string;
|
|
13
13
|
inSourceTests?: boolean;
|
|
14
14
|
js?: boolean;
|
|
15
|
-
linter
|
|
15
|
+
linter?: LinterType;
|
|
16
16
|
name?: string;
|
|
17
17
|
publishable?: boolean;
|
|
18
18
|
routing?: boolean;
|
|
@@ -34,6 +34,8 @@ export interface Schema {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export interface NormalizedSchema extends Schema {
|
|
37
|
+
// `normalizeOptions` always resolves this, so it is no longer optional.
|
|
38
|
+
linter: LinterType;
|
|
37
39
|
js: boolean;
|
|
38
40
|
name: string;
|
|
39
41
|
fileName: string;
|
|
@@ -65,11 +65,9 @@
|
|
|
65
65
|
"x-priority": "important"
|
|
66
66
|
},
|
|
67
67
|
"linter": {
|
|
68
|
-
"description": "The tool to use for running lint checks.",
|
|
68
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
69
69
|
"type": "string",
|
|
70
|
-
"enum": ["eslint", "none"],
|
|
71
|
-
"default": "none",
|
|
72
|
-
"x-prompt": "Which linter would you like to use?",
|
|
70
|
+
"enum": ["eslint", "oxlint", "none"],
|
|
73
71
|
"x-priority": "important"
|
|
74
72
|
},
|
|
75
73
|
"unitTestRunner": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
import type { SupportedStyles } from '../../../typings/style';
|
|
3
3
|
import type { NormalizedSchema as ApplicationNormalizedSchema } from '../application/schema';
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ export interface Schema {
|
|
|
11
11
|
globalCss?: boolean;
|
|
12
12
|
host?: string;
|
|
13
13
|
js?: boolean;
|
|
14
|
-
linter
|
|
14
|
+
linter?: LinterType;
|
|
15
15
|
name?: string;
|
|
16
16
|
routing?: boolean;
|
|
17
17
|
enableTypedLinting?: boolean;
|
|
@@ -54,10 +54,9 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"linter": {
|
|
57
|
-
"description": "The tool to use for running lint checks.",
|
|
57
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
58
58
|
"type": "string",
|
|
59
|
-
"enum": ["eslint"]
|
|
60
|
-
"default": "eslint"
|
|
59
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
61
60
|
},
|
|
62
61
|
"routing": {
|
|
63
62
|
"type": "boolean",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinterType } from '@nx/js';
|
|
2
2
|
|
|
3
3
|
export interface StorybookConfigureSchema {
|
|
4
4
|
project: string;
|
|
@@ -6,7 +6,7 @@ export interface StorybookConfigureSchema {
|
|
|
6
6
|
generateStories?: boolean;
|
|
7
7
|
js?: boolean;
|
|
8
8
|
tsConfiguration?: boolean;
|
|
9
|
-
linter?:
|
|
9
|
+
linter?: LinterType;
|
|
10
10
|
ignorePaths?: string[];
|
|
11
11
|
configureStaticServe?: boolean;
|
|
12
12
|
addPlugin?: boolean;
|
|
@@ -257,12 +257,12 @@ function addInitialRoutes(sourcePath, source, addBrowserRouter) {
|
|
|
257
257
|
<br/>
|
|
258
258
|
<hr/>
|
|
259
259
|
<br/>
|
|
260
|
-
<
|
|
260
|
+
<nav>
|
|
261
261
|
<ul>
|
|
262
262
|
<li><Link to="/">Home</Link></li>
|
|
263
263
|
<li><Link to="/page-2">Page 2</Link></li>
|
|
264
264
|
</ul>
|
|
265
|
-
</
|
|
265
|
+
</nav>
|
|
266
266
|
<Routes>
|
|
267
267
|
<Route
|
|
268
268
|
path="/"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.7",
|
|
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": {
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"react": ">=18.0.0 <20.0.0",
|
|
96
96
|
"react-dom": ">=18.0.0 <20.0.0",
|
|
97
97
|
"express": "^4.21.2",
|
|
98
|
-
"http-proxy-middleware": "^3.0.
|
|
99
|
-
"@nx/module-federation": "23.2.0-beta.
|
|
98
|
+
"http-proxy-middleware": "^3.0.7",
|
|
99
|
+
"@nx/module-federation": "23.2.0-beta.7"
|
|
100
100
|
},
|
|
101
101
|
"peerDependenciesMeta": {
|
|
102
102
|
"babel-plugin-react-compiler": {
|
|
@@ -118,27 +118,27 @@
|
|
|
118
118
|
"minimatch": "10.2.5",
|
|
119
119
|
"tslib": "^2.3.0",
|
|
120
120
|
"semver": "^7.6.3",
|
|
121
|
-
"@nx/devkit": "23.2.0-beta.
|
|
122
|
-
"@nx/js": "23.2.0-beta.
|
|
123
|
-
"@nx/eslint": "23.2.0-beta.
|
|
124
|
-
"@nx/web": "23.2.0-beta.
|
|
121
|
+
"@nx/devkit": "23.2.0-beta.7",
|
|
122
|
+
"@nx/js": "23.2.0-beta.7",
|
|
123
|
+
"@nx/eslint": "23.2.0-beta.7",
|
|
124
|
+
"@nx/web": "23.2.0-beta.7"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"express": "^4.21.2",
|
|
128
|
-
"http-proxy-middleware": "^3.0.
|
|
129
|
-
"@nx/cypress": "23.2.0-beta.
|
|
130
|
-
"@nx/module-federation": "23.2.0-beta.
|
|
131
|
-
"@nx/playwright": "23.2.0-beta.
|
|
132
|
-
"@nx/rollup": "23.2.0-beta.
|
|
133
|
-
"@nx/rsbuild": "23.2.0-beta.
|
|
134
|
-
"@nx/vite": "23.2.0-beta.
|
|
135
|
-
"@nx/vitest": "23.2.0-beta.
|
|
136
|
-
"@nx/webpack": "23.2.0-beta.
|
|
137
|
-
"@nx/storybook": "23.2.0-beta.
|
|
138
|
-
"nx": "23.2.0-beta.
|
|
128
|
+
"http-proxy-middleware": "^3.0.7",
|
|
129
|
+
"@nx/cypress": "23.2.0-beta.7",
|
|
130
|
+
"@nx/module-federation": "23.2.0-beta.7",
|
|
131
|
+
"@nx/playwright": "23.2.0-beta.7",
|
|
132
|
+
"@nx/rollup": "23.2.0-beta.7",
|
|
133
|
+
"@nx/rsbuild": "23.2.0-beta.7",
|
|
134
|
+
"@nx/vite": "23.2.0-beta.7",
|
|
135
|
+
"@nx/vitest": "23.2.0-beta.7",
|
|
136
|
+
"@nx/webpack": "23.2.0-beta.7",
|
|
137
|
+
"@nx/storybook": "23.2.0-beta.7",
|
|
138
|
+
"nx": "23.2.0-beta.7"
|
|
139
139
|
},
|
|
140
140
|
"optionalDependencies": {
|
|
141
|
-
"@nx/vite": "23.2.0-beta.
|
|
141
|
+
"@nx/vite": "23.2.0-beta.7"
|
|
142
142
|
},
|
|
143
143
|
"publishConfig": {
|
|
144
144
|
"access": "public"
|
/package/dist/src/generators/consumer/files/vite/{vite.config.ts__tmpl__ → vite.config.mts__tmpl__}
RENAMED
|
File without changes
|
/package/dist/src/generators/provider/files/vite/{vite.config.ts__tmpl__ → vite.config.mts__tmpl__}
RENAMED
|
File without changes
|