@nx/next 23.3.0-beta.1 → 23.3.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.
@@ -2,13 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLinting = addLinting;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  const react_1 = require("@nx/react");
6
- const internal_1 = require("@nx/eslint/internal");
7
+ const internal_2 = require("@nx/eslint/internal");
7
8
  const version_utils_1 = require("../../../utils/version-utils");
8
- const internal_2 = require("@nx/js/internal");
9
+ const internal_3 = require("@nx/js/internal");
9
10
  async function addLinting(host, options) {
10
11
  const tasks = [];
11
- tasks.push(await (0, internal_2.addLintingToProject)(host, {
12
+ tasks.push(await (0, internal_3.addLintingToProject)(host, {
12
13
  oxlintPlugins: ['nextjs', 'react', 'react-perf', 'jsx-a11y'],
13
14
  linter: options.linter,
14
15
  project: options.projectName,
@@ -17,21 +18,21 @@ async function addLinting(host, options) {
17
18
  ],
18
19
  unitTestRunner: options.unitTestRunner,
19
20
  rootProject: options.rootProject,
20
- enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
21
+ enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
21
22
  addPlugin: options.addPlugin,
22
23
  skipPackageJson: options.skipPackageJson,
23
24
  }));
24
25
  // Everything below configures ESLint — predefined configs, `extends`, ignore
25
26
  // entries — which have no equivalent in other linters.
26
- if (options.linter === 'eslint' && (0, internal_1.isEslintConfigSupported)(host)) {
27
- if ((0, internal_1.useFlatConfig)(host)) {
28
- (0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react-typescript', { checkBaseConfig: true });
27
+ if (options.linter === 'eslint' && (0, internal_2.isEslintConfigSupported)(host)) {
28
+ if ((0, internal_2.useFlatConfig)(host)) {
29
+ (0, internal_2.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react-typescript', { checkBaseConfig: true });
29
30
  if (await (0, version_utils_1.isNext16)(host)) {
30
- (0, internal_1.addPluginsToLintConfig)(host, options.appProjectRoot, ['@next/next']);
31
+ (0, internal_2.addPluginsToLintConfig)(host, options.appProjectRoot, ['@next/next']);
31
32
  }
32
33
  else {
33
34
  // Since Next.js < 16 does not support flat configs yet, we need to use compat fixup.
34
- const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(host, options.appProjectRoot, [
35
+ const addExtendsTask = (0, internal_2.addExtendsToLintConfig)(host, options.appProjectRoot, [
35
36
  { name: 'next', needCompatFixup: true },
36
37
  {
37
38
  name: 'next/core-web-vitals',
@@ -42,14 +43,14 @@ async function addLinting(host, options) {
42
43
  }
43
44
  }
44
45
  else {
45
- const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(host, options.appProjectRoot, [
46
+ const addExtendsTask = (0, internal_2.addExtendsToLintConfig)(host, options.appProjectRoot, [
46
47
  'plugin:@nx/react-typescript',
47
48
  { name: 'next', needCompatFixup: true },
48
49
  { name: 'next/core-web-vitals', needCompatFixup: true },
49
50
  ]);
50
51
  tasks.push(addExtendsTask);
51
52
  }
52
- (0, internal_1.updateOverrideInLintConfig)(host, options.appProjectRoot, (o) => Array.isArray(o.files) &&
53
+ (0, internal_2.updateOverrideInLintConfig)(host, options.appProjectRoot, (o) => Array.isArray(o.files) &&
53
54
  o.files.some((f) => f.match(/\*\.ts$/)) &&
54
55
  o.files.some((f) => f.match(/\*\.tsx$/)) &&
55
56
  o.files.some((f) => f.match(/\*\.js$/)) &&
@@ -63,13 +64,19 @@ async function addLinting(host, options) {
63
64
  ],
64
65
  },
65
66
  }));
66
- (0, internal_1.addIgnoresToLintConfig)(host, options.appProjectRoot, [
67
+ (0, internal_2.addIgnoresToLintConfig)(host, options.appProjectRoot, [
67
68
  '.next/**/*',
68
69
  ...(options.isTsSolutionSetup ? ['**/out-tsc'] : []),
69
70
  ]);
70
71
  }
71
72
  if (options.linter === 'eslint' && !options.skipPackageJson) {
72
73
  const eslintConfigNextVersion = await (0, version_utils_1.getEslintConfigNextDependenciesVersionsToInstall)(host);
74
+ // eslint-config-next pulls in unrs-resolver via
75
+ // eslint-import-resolver-typescript, whose postinstall only fetches a
76
+ // fallback binding for platforms its prebuilt optional dependencies miss.
77
+ (0, internal_1.acknowledgeBuildScripts)(host, (0, devkit_1.detectPackageManager)(host.root), {
78
+ 'unrs-resolver': false,
79
+ });
73
80
  tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, react_1.extraEslintDependencies.dependencies, {
74
81
  ...react_1.extraEslintDependencies.devDependencies,
75
82
  'eslint-config-next': eslintConfigNextVersion,
@@ -5,6 +5,7 @@ exports.nextInitGeneratorInternal = nextInitGeneratorInternal;
5
5
  const internal_1 = require("@nx/devkit/internal");
6
6
  const devkit_1 = require("@nx/devkit");
7
7
  const internal_2 = require("@nx/react/internal");
8
+ const semver_1 = require("semver");
8
9
  const add_gitignore_entry_1 = require("../../utils/add-gitignore-entry");
9
10
  const versions_1 = require("../../utils/versions");
10
11
  const version_utils_1 = require("../../utils/version-utils");
@@ -14,6 +15,14 @@ async function updateDependencies(host, schema) {
14
15
  tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nx/next'], []));
15
16
  const versions = await (0, version_utils_1.getNextDependenciesVersionsToInstall)(host, await (0, internal_2.isReact18)(host));
16
17
  const reactVersions = await (0, internal_2.getReactDependenciesVersionsToInstall)(host);
18
+ // next 15+ pulls in sharp, whose install script only compiles from source
19
+ // against a system libvips and is otherwise a no-op; the prebuilt binaries
20
+ // ship via optional dependencies, so skip it.
21
+ if ((0, semver_1.major)((0, semver_1.coerce)(versions.next)) >= 15) {
22
+ (0, internal_1.acknowledgeBuildScripts)(host, (0, devkit_1.detectPackageManager)(host.root), {
23
+ sharp: false,
24
+ });
25
+ }
17
26
  tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, {
18
27
  next: versions.next,
19
28
  react: reactVersions.react,
@@ -23,6 +23,7 @@ function configureForSwc(tree, projectRoot, swcConfigName = '.swcrc', additonalE
23
23
  return () => (0, devkit_1.installPackagesTask)(tree);
24
24
  }
25
25
  function addSwcDependencies(tree) {
26
+ (0, internal_1.acknowledgeSwcBuildScripts)(tree);
26
27
  return (0, devkit_1.addDependenciesToPackageJson)(tree, {
27
28
  '@swc/helpers': internal_1.swcHelpersVersion,
28
29
  }, {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addStyleDependencies = addStyleDependencies;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  const versions_1 = require("./versions");
6
7
  const nextSpecificStyleDependencies = {
7
8
  css: {
@@ -15,6 +16,13 @@ const nextSpecificStyleDependencies = {
15
16
  };
16
17
  function addStyleDependencies(host, options) {
17
18
  const extraDependencies = nextSpecificStyleDependencies[options.style];
19
+ if (options.style === 'scss') {
20
+ // sass pulls in @parcel/watcher, whose install script only builds from
21
+ // source when npm_config_build_from_source is set.
22
+ (0, internal_1.acknowledgeBuildScripts)(host, (0, devkit_1.detectPackageManager)(host.root), {
23
+ '@parcel/watcher': false,
24
+ });
25
+ }
18
26
  return extraDependencies
19
27
  ? (0, devkit_1.addDependenciesToPackageJson)(host, extraDependencies.dependencies, extraDependencies.devDependencies, undefined, true)
20
28
  : () => { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "23.3.0-beta.1",
3
+ "version": "23.3.0-beta.3",
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": {
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "peerDependencies": {
70
70
  "next": ">=14.0.0 <17.0.0",
71
- "@nx/webpack": "23.3.0-beta.1"
71
+ "@nx/webpack": "23.3.0-beta.3"
72
72
  },
73
73
  "peerDependenciesMeta": {
74
74
  "@nx/webpack": {
@@ -83,19 +83,19 @@
83
83
  "tslib": "^2.3.0",
84
84
  "webpack-merge": "^5.8.0",
85
85
  "@phenomnomnominal/tsquery": "~6.2.0",
86
- "@nx/devkit": "23.3.0-beta.1",
87
- "@nx/js": "23.3.0-beta.1",
88
- "@nx/eslint": "23.3.0-beta.1",
89
- "@nx/react": "23.3.0-beta.1",
90
- "@nx/web": "23.3.0-beta.1"
86
+ "@nx/devkit": "23.3.0-beta.3",
87
+ "@nx/js": "23.3.0-beta.3",
88
+ "@nx/eslint": "23.3.0-beta.3",
89
+ "@nx/react": "23.3.0-beta.3",
90
+ "@nx/web": "23.3.0-beta.3"
91
91
  },
92
92
  "devDependencies": {
93
93
  "next": "15.5.25",
94
- "@nx/cypress": "23.3.0-beta.1",
95
- "@nx/playwright": "23.3.0-beta.1",
96
- "@nx/vitest": "23.3.0-beta.1",
97
- "@nx/webpack": "23.3.0-beta.1",
98
- "nx": "23.3.0-beta.1"
94
+ "@nx/cypress": "23.3.0-beta.3",
95
+ "@nx/playwright": "23.3.0-beta.3",
96
+ "@nx/vitest": "23.3.0-beta.3",
97
+ "@nx/webpack": "23.3.0-beta.3",
98
+ "nx": "23.3.0-beta.3"
99
99
  },
100
100
  "publishConfig": {
101
101
  "access": "public"