@nx/react 17.1.1 → 17.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react",
3
- "version": "17.1.1",
3
+ "version": "17.1.3",
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, 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": {
@@ -37,11 +37,11 @@
37
37
  "file-loader": "^6.2.0",
38
38
  "minimatch": "3.0.5",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "17.1.1",
41
- "@nx/js": "17.1.1",
42
- "@nx/eslint": "17.1.1",
43
- "@nx/web": "17.1.1",
44
- "@nrwl/react": "17.1.1"
40
+ "@nx/devkit": "17.1.3",
41
+ "@nx/js": "17.1.3",
42
+ "@nx/eslint": "17.1.3",
43
+ "@nx/web": "17.1.3",
44
+ "@nrwl/react": "17.1.3"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -132,7 +132,7 @@ async function applicationGeneratorInternal(host, schema) {
132
132
  const { createOrEditViteConfig, vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
133
133
  const vitestTask = await vitestGenerator(host, {
134
134
  uiFramework: 'react',
135
- coverageProvider: 'c8',
135
+ coverageProvider: 'v8',
136
136
  project: options.projectName,
137
137
  inSourceTests: options.inSourceTests,
138
138
  skipFormat: true,
@@ -8,15 +8,14 @@ function updateSpecConfig(host, options) {
8
8
  return;
9
9
  }
10
10
  (0, devkit_1.updateJson)(host, `${options.appProjectRoot}/tsconfig.spec.json`, (json) => {
11
- json.types = json.types || [];
11
+ const compilerOptions = json.compilerOptions ?? {};
12
+ const types = compilerOptions.types ?? [];
12
13
  if (options.style === 'styled-jsx') {
13
- json.types.push('@nx/react/typings/styled-jsx.d.ts');
14
+ types.push('@nx/react/typings/styled-jsx.d.ts');
14
15
  }
15
- json.types = [
16
- ...json.types,
17
- '@nx/react/typings/cssmodule.d.ts',
18
- '@nx/react/typings/image.d.ts',
19
- ];
16
+ types.push('@nx/react/typings/cssmodule.d.ts', '@nx/react/typings/image.d.ts');
17
+ compilerOptions.types = types;
18
+ json.compilerOptions = compilerOptions;
20
19
  return json;
21
20
  });
22
21
  if (options.unitTestRunner !== 'jest') {
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "types": [
6
+ "node",
7
+ "@nx/react/typings/cssmodule.d.ts",
8
+ "@nx/react/typings/image.d.ts"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.js",
13
+ "src/**/*.jsx",
14
+ "src/**/*.ts",
15
+ "src/**/*.tsx",
16
+ "webpack.config.ts",
17
+ "webpack.prod.config.ts"
18
+ ]
19
+ }
@@ -72,6 +72,9 @@ async function hostGeneratorInternal(host, schema) {
72
72
  projectConfig.targets.server.options.webpackConfig = (0, devkit_1.joinPathFragments)(projectConfig.root, `webpack.server.config.${options.typescriptConfiguration ? 'ts' : 'js'}`);
73
73
  (0, devkit_1.updateProjectConfiguration)(host, options.projectName, projectConfig);
74
74
  }
75
+ if (!options.setParserOptionsProject) {
76
+ host.delete((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.lint.json'));
77
+ }
75
78
  if (!options.skipFormat) {
76
79
  await (0, devkit_1.formatFiles)(host);
77
80
  }
@@ -113,7 +113,7 @@ async function libraryGeneratorInternal(host, schema) {
113
113
  const vitestTask = await vitestGenerator(host, {
114
114
  uiFramework: 'react',
115
115
  project: options.name,
116
- coverageProvider: 'c8',
116
+ coverageProvider: 'v8',
117
117
  inSourceTests: options.inSourceTests,
118
118
  skipFormat: true,
119
119
  testEnvironment: 'jsdom',
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "types": [
6
+ "node",
7
+ "@nx/react/typings/cssmodule.d.ts",
8
+ "@nx/react/typings/image.d.ts"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.js",
13
+ "src/**/*.jsx",
14
+ "src/**/*.ts",
15
+ "src/**/*.tsx",
16
+ "webpack.config.ts",
17
+ "webpack.prod.config.ts"
18
+ ]
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "types": [
6
+ "node",
7
+ "@nx/react/typings/cssmodule.d.ts",
8
+ "@nx/react/typings/image.d.ts"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.js",
13
+ "src/**/*.jsx",
14
+ "src/**/*.ts",
15
+ "src/**/*.tsx",
16
+ "webpack.config.ts",
17
+ "webpack.prod.config.ts"
18
+ ]
19
+ }
@@ -75,6 +75,9 @@ async function remoteGeneratorInternal(host, schema) {
75
75
  projectConfig.targets.server.options.webpackConfig = (0, devkit_1.joinPathFragments)(projectConfig.root, `webpack.server.config.${options.typescriptConfiguration ? 'ts' : 'js'}`);
76
76
  (0, devkit_1.updateProjectConfiguration)(host, options.projectName, projectConfig);
77
77
  }
78
+ if (!options.setParserOptionsProject) {
79
+ host.delete((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.lint.json'));
80
+ }
78
81
  if (!options.skipFormat) {
79
82
  await (0, devkit_1.formatFiles)(host);
80
83
  }
@@ -8,10 +8,10 @@ async function generateStories(host, schema) {
8
8
  // TODO(katerina): Nx 18 -> remove Cypress
9
9
  (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
10
10
  const { getE2eProjectName } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/project-name'));
11
- const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.name);
12
- const cypressProject = getE2eProjectName(schema.name, projectConfig.root, schema.cypressDirectory);
11
+ const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.project);
12
+ const cypressProject = getE2eProjectName(schema.project, projectConfig.root, schema.cypressDirectory);
13
13
  await (0, stories_1.default)(host, {
14
- project: schema.name,
14
+ project: schema.project,
15
15
  generateCypressSpecs: schema.configureCypress && schema.generateCypressSpecs,
16
16
  js: schema.js,
17
17
  cypressProject,
@@ -23,7 +23,7 @@ async function generateStories(host, schema) {
23
23
  async function storybookConfigurationGenerator(host, schema) {
24
24
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
25
25
  let uiFramework = '@storybook/react-vite';
26
- const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.name);
26
+ const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.project);
27
27
  if (projectConfig.targets['build']?.executor === '@nx/webpack:webpack' ||
28
28
  projectConfig.targets['build']?.executor === '@nrwl/webpack:webpack' ||
29
29
  projectConfig.targets['build']?.executor === '@nx/rollup:rollup' ||
@@ -31,7 +31,7 @@ async function storybookConfigurationGenerator(host, schema) {
31
31
  uiFramework = '@storybook/react-webpack5';
32
32
  }
33
33
  const installTask = await configurationGenerator(host, {
34
- name: schema.name,
34
+ project: schema.project,
35
35
  configureCypress: schema.configureCypress,
36
36
  js: schema.js,
37
37
  linter: schema.linter,
@@ -1,7 +1,7 @@
1
1
  import { Linter } from '@nx/eslint';
2
2
 
3
3
  export interface StorybookConfigureSchema {
4
- name: string;
4
+ project: string;
5
5
  interactionTests?: boolean;
6
6
  generateStories?: boolean;
7
7
  js?: boolean;
@@ -6,9 +6,9 @@
6
6
  "description": "Set up Storybook for a React app or library.",
7
7
  "type": "object",
8
8
  "properties": {
9
- "name": {
9
+ "project": {
10
10
  "type": "string",
11
- "aliases": ["project", "projectName"],
11
+ "aliases": ["name", "projectName"],
12
12
  "description": "Project for which to generate Storybook configuration.",
13
13
  "$default": {
14
14
  "$source": "argv",
@@ -90,6 +90,6 @@
90
90
  ]
91
91
  }
92
92
  },
93
- "required": ["name"],
93
+ "required": ["project"],
94
94
  "examplesFile": "../../../docs/storybook-configuration-examples.md"
95
95
  }