@nx/next 19.7.4 → 19.8.0-beta.1

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/next",
3
- "version": "19.7.4",
3
+ "version": "19.8.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace. \n\nWhen using Next.js in Nx, you get the out-of-the-box support for TypeScript, Playwright, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "next": ">=14.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "19.7.4",
38
+ "@nx/devkit": "19.8.0-beta.1",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.0.1",
41
41
  "chalk": "^4.1.0",
@@ -46,18 +46,18 @@
46
46
  "semver": "^7.5.3",
47
47
  "tslib": "^2.3.0",
48
48
  "webpack-merge": "^5.8.0",
49
- "@nx/js": "19.7.4",
50
- "@nx/eslint": "19.7.4",
51
- "@nx/react": "19.7.4",
52
- "@nx/web": "19.7.4",
53
- "@nx/webpack": "19.7.4",
54
- "@nx/workspace": "19.7.4",
49
+ "@nx/js": "19.8.0-beta.1",
50
+ "@nx/eslint": "19.8.0-beta.1",
51
+ "@nx/react": "19.8.0-beta.1",
52
+ "@nx/web": "19.8.0-beta.1",
53
+ "@nx/webpack": "19.8.0-beta.1",
54
+ "@nx/workspace": "19.8.0-beta.1",
55
55
  "@phenomnomnominal/tsquery": "~5.0.1",
56
- "@nrwl/next": "19.7.4"
56
+ "@nrwl/next": "19.8.0-beta.1"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
61
  "type": "commonjs",
62
62
  "types": "./index.d.ts"
63
- }
63
+ }
@@ -6,6 +6,7 @@ const devkit_1 = require("@nx/devkit");
6
6
  const lint_1 = require("@nx/react/src/utils/lint");
7
7
  const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
8
8
  const versions_1 = require("../../../utils/versions");
9
+ const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
9
10
  async function addLinting(host, options) {
10
11
  const tasks = [];
11
12
  tasks.push(await (0, eslint_1.lintProjectGenerator)(host, {
@@ -21,11 +22,23 @@ async function addLinting(host, options) {
21
22
  addPlugin: options.addPlugin,
22
23
  }));
23
24
  if (options.linter === eslint_1.Linter.EsLint && (0, eslint_file_1.isEslintConfigSupported)(host)) {
24
- (0, eslint_file_1.addExtendsToLintConfig)(host, options.appProjectRoot, [
25
- 'plugin:@nx/react-typescript',
26
- 'next',
27
- 'next/core-web-vitals',
28
- ]);
25
+ if ((0, flat_config_1.useFlatConfig)(host)) {
26
+ (0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react-typescript');
27
+ // Since Next.js does not support flat configs yet, we need to use compat fixup.
28
+ const addExtendsTask = (0, eslint_file_1.addExtendsToLintConfig)(host, options.appProjectRoot, [
29
+ { name: 'next', needCompatFixup: true },
30
+ { name: 'next/core-web-vitals', needCompatFixup: true },
31
+ ]);
32
+ tasks.push(addExtendsTask);
33
+ }
34
+ else {
35
+ const addExtendsTask = (0, eslint_file_1.addExtendsToLintConfig)(host, options.appProjectRoot, [
36
+ 'plugin:@nx/react-typescript',
37
+ { name: 'next', needCompatFixup: true },
38
+ { name: 'next/core-web-vitals', needCompatFixup: true },
39
+ ]);
40
+ tasks.push(addExtendsTask);
41
+ }
29
42
  (0, eslint_file_1.updateOverrideInLintConfig)(host, options.appProjectRoot, (o) => Array.isArray(o.files) &&
30
43
  o.files.some((f) => f.match(/\*\.ts$/)) &&
31
44
  o.files.some((f) => f.match(/\*\.tsx$/)) &&
@@ -40,15 +53,6 @@ async function addLinting(host, options) {
40
53
  ],
41
54
  },
42
55
  }));
43
- // add jest specific config
44
- if (options.unitTestRunner === 'jest') {
45
- (0, eslint_file_1.addOverrideToLintConfig)(host, options.appProjectRoot, {
46
- files: ['*.spec.ts', '*.spec.tsx', '*.spec.js', '*.spec.jsx'],
47
- env: {
48
- jest: true,
49
- },
50
- });
51
- }
52
56
  (0, eslint_file_1.addIgnoresToLintConfig)(host, options.appProjectRoot, ['.next/**/*']);
53
57
  }
54
58
  if (!options.skipPackageJson) {
@@ -32,7 +32,7 @@ async function convertToInferred(tree, options) {
32
32
  },
33
33
  ], options.project);
34
34
  if (migratedProjects.size === 0) {
35
- throw new Error('Could not find any targets to migrate');
35
+ throw new executor_to_plugin_migrator_1.NoTargetsToMigrateError();
36
36
  }
37
37
  if (!options.skipFormat) {
38
38
  await (0, devkit_1.formatFiles)(tree);