@nx/next 23.1.1 → 23.1.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.
@@ -7,16 +7,17 @@ const devkit_1 = require("@nx/devkit");
7
7
  const internal_2 = require("@nx/js/internal");
8
8
  const react_1 = require("@nx/react");
9
9
  const internal_3 = require("@nx/react/internal");
10
- const webpack_1 = require("@nx/webpack");
11
- const internal_4 = require("@nx/webpack/internal");
12
- const configuration_1 = require("nx/src/config/configuration");
13
10
  const path_1 = require("path");
11
+ const internal_4 = require("@nx/devkit/internal");
14
12
  function nxComponentTestingPreset(pathToConfig, options) {
15
13
  if (global.NX_GRAPH_CREATION) {
16
14
  // this is only used by plugins, so we don't need the component testing
17
15
  // options, cast to any to avoid type errors
18
16
  return (0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig);
19
17
  }
18
+ (0, internal_3.assertPackageIsInstalled)('@nx/webpack', '@nx/next/plugins/component-testing');
19
+ const { composePluginsSync, withNx, } = require('@nx/webpack');
20
+ const { suppressWebpackComposeHelperWarnings, } = require('@nx/webpack/internal');
20
21
  const graph = (0, devkit_1.readCachedProjectGraph)();
21
22
  const { targets: ctTargets, name: ctProjectName } = (0, internal_1.getProjectConfigByPath)(graph, pathToConfig);
22
23
  const ctTargetName = options?.ctTargetName || 'component-test';
@@ -39,7 +40,7 @@ function nxComponentTestingPreset(pathToConfig, options) {
39
40
  cwd: process.cwd(),
40
41
  root: devkit_1.workspaceRoot,
41
42
  projectsConfigurations: (0, devkit_1.readProjectsConfigurationFromProjectGraph)(graph),
42
- nxJsonConfiguration: (0, configuration_1.readNxJson)(devkit_1.workspaceRoot),
43
+ nxJsonConfiguration: (0, internal_4.readNxJsonFromDisk)(devkit_1.workspaceRoot),
43
44
  isVerbose: false,
44
45
  projectName: ctProjectName,
45
46
  projectGraph: graph,
@@ -83,8 +84,8 @@ Able to find CT project, ${!!ctProjectConfig}.`);
83
84
  };
84
85
  // Nx composes these helpers internally for the Cypress CT preset; suppress
85
86
  // their deprecation warning so it fires only for user-authored configs.
86
- const webpackConfig = (0, internal_4.suppressWebpackComposeHelperWarnings)(() => (0, internal_3.suppressReactComposeHelperWarnings)(() => {
87
- const configure = (0, webpack_1.composePluginsSync)((0, webpack_1.withNx)({
87
+ const webpackConfig = suppressWebpackComposeHelperWarnings(() => (0, internal_3.suppressReactComposeHelperWarnings)(() => {
88
+ const configure = composePluginsSync(withNx({
88
89
  target: 'web',
89
90
  styles: [],
90
91
  scripts: [],
@@ -103,7 +103,7 @@ function withNx(_nextConfig = {}, context = getWithNxContext()) {
103
103
  if (!graph.dependencies[project])
104
104
  return;
105
105
  const { readTsConfigPaths } = require('@nx/js');
106
- const { findAllProjectNodeDependencies, } = require('nx/src/utils/project-graph-utils');
106
+ const { findAllProjectNodeDependencies, } = require('@nx/devkit/internal');
107
107
  const paths = readTsConfigPaths();
108
108
  const deps = findAllProjectNodeDependencies(project);
109
109
  nextConfig.transpilePackages ??= [];
@@ -1,3 +1,3 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
- import type { PackageJson } from 'nx/src/utils/package-json';
2
+ import { type PackageJson } from '@nx/devkit/internal';
3
3
  export declare function updatePackageJson(packageJson: PackageJson, context: ExecutorContext): void;
@@ -7,7 +7,6 @@ const devkit_1 = require("@nx/devkit");
7
7
  const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
8
8
  const js_1 = require("@nx/js");
9
9
  const internal_2 = require("@nx/react/internal");
10
- const internal_3 = require("@nx/react/internal");
11
10
  const normalize_options_1 = require("./lib/normalize-options");
12
11
  const add_e2e_1 = require("./lib/add-e2e");
13
12
  const add_jest_1 = require("./lib/add-jest");
@@ -20,7 +19,7 @@ const add_linting_1 = require("./lib/add-linting");
20
19
  const custom_server_1 = require("../custom-server/custom-server");
21
20
  const update_cypress_tsconfig_1 = require("./lib/update-cypress-tsconfig");
22
21
  const versions_1 = require("../../utils/versions");
23
- const internal_4 = require("@nx/js/internal");
22
+ const internal_3 = require("@nx/js/internal");
24
23
  const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
25
24
  const jest_config_util_1 = require("../../utils/jest-config-util");
26
25
  async function applicationGenerator(host, schema) {
@@ -33,7 +32,7 @@ async function applicationGenerator(host, schema) {
33
32
  async function applicationGeneratorInternal(host, schema) {
34
33
  (0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
35
34
  const tasks = [];
36
- const addTsPlugin = (0, internal_4.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
35
+ const addTsPlugin = (0, internal_3.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
37
36
  const jsInitTask = await (0, js_1.initGenerator)(host, {
38
37
  js: schema.js,
39
38
  skipPackageJson: schema.skipPackageJson,
@@ -54,7 +53,7 @@ async function applicationGeneratorInternal(host, schema) {
54
53
  // If we are using the new TS solution
55
54
  // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
56
55
  if (options.isTsSolutionSetup) {
57
- await (0, internal_4.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
56
+ await (0, internal_3.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
58
57
  }
59
58
  const lintTask = await (0, add_linting_1.addLinting)(host, options);
60
59
  tasks.push(lintTask);
@@ -81,7 +80,7 @@ async function applicationGeneratorInternal(host, schema) {
81
80
  });
82
81
  }
83
82
  if (!options.skipPackageJson) {
84
- const reactVersions = await (0, internal_3.getReactDependenciesVersionsToInstall)(host);
83
+ const reactVersions = await (0, internal_2.getReactDependenciesVersionsToInstall)(host);
85
84
  const devDependencies = {
86
85
  '@types/react': reactVersions['@types/react'],
87
86
  '@types/react-dom': reactVersions['@types/react-dom'],
@@ -92,14 +91,14 @@ async function applicationGeneratorInternal(host, schema) {
92
91
  }
93
92
  tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_1.tsLibVersion }, devDependencies, undefined, true));
94
93
  }
95
- (0, internal_4.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.json', {
94
+ (0, internal_3.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.json', {
96
95
  jsx: 'preserve',
97
96
  module: 'esnext',
98
97
  moduleResolution: 'bundler',
99
98
  }, options.linter === 'eslint'
100
99
  ? ['.next', 'eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
101
100
  : ['.next'], options.src ? 'src' : '.');
102
- (0, internal_4.sortPackageJsonFields)(host, options.appProjectRoot);
101
+ (0, internal_3.sortPackageJsonFields)(host, options.appProjectRoot);
103
102
  if (!options.skipFormat) {
104
103
  await (0, devkit_1.formatFiles)(host);
105
104
  }
@@ -3,21 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.customServerGenerator = customServerGenerator;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const internal_1 = require("@nx/devkit/internal");
6
- const devkit_2 = require("@nx/devkit");
7
6
  const path_1 = require("path");
8
7
  const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
9
8
  const internal_2 = require("@nx/js/internal");
10
9
  const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
11
10
  async function customServerGenerator(host, options) {
12
11
  (0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
13
- const project = (0, devkit_2.readProjectConfiguration)(host, options.project);
12
+ const project = (0, devkit_1.readProjectConfiguration)(host, options.project);
14
13
  const swcServerName = '.server.swcrc';
15
- const nxJson = (0, devkit_2.readNxJson)(host);
14
+ const nxJson = (0, devkit_1.readNxJson)(host);
16
15
  const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
17
16
  ? p === '@nx/next/plugin'
18
17
  : p.plugin === '@nx/next/plugin');
19
18
  if (project.targets?.build?.executor !== '@nx/next:build' && !hasPlugin) {
20
- devkit_2.logger.error(`Project ${options.project} is not a Next.js project. Did you generate it with "nx g @nx/next:app"?`);
19
+ devkit_1.logger.error(`Project ${options.project} is not a Next.js project. Did you generate it with "nx g @nx/next:app"?`);
21
20
  return;
22
21
  }
23
22
  // In Nx 18 next artifacts are inside the project root .next/ & dist/ (for custom server)
@@ -28,22 +27,22 @@ async function customServerGenerator(host, options) {
28
27
  !project.targets?.build?.configurations?.development ||
29
28
  !project.targets?.build?.configurations?.production) &&
30
29
  !hasPlugin) {
31
- devkit_2.logger.error(`Project ${options.project} has invalid config. Did you generate it with "nx g @nx/next:app"?`);
30
+ devkit_1.logger.error(`Project ${options.project} has invalid config. Did you generate it with "nx g @nx/next:app"?`);
32
31
  return;
33
32
  }
34
33
  if (project.targets?.['build-custom-server'] ||
35
34
  project.targets?.['serve-custom-server']) {
36
- devkit_2.logger.warn(`Project ${options.project} has custom server targets already: build-custom-server, serve-custom-server. Remove these targets from project and try again.`);
35
+ devkit_1.logger.warn(`Project ${options.project} has custom server targets already: build-custom-server, serve-custom-server. Remove these targets from project and try again.`);
37
36
  return;
38
37
  }
39
38
  // In Nx 18 next artifacts are inside the project root .next/ & dist/ (for custom server)
40
39
  // So we need ensure the mapping is correct from dist to the project root
41
40
  const projectPathFromDist = hasPlugin
42
- ? `../../${(0, devkit_2.offsetFromRoot)(project.root)}${project.root}`
43
- : `${(0, devkit_2.offsetFromRoot)(`dist/${project.root}`)}${project.root}`;
44
- const offset = (0, devkit_2.offsetFromRoot)(project.root);
41
+ ? `../../${(0, devkit_1.offsetFromRoot)(project.root)}${project.root}`
42
+ : `${(0, devkit_1.offsetFromRoot)(`dist/${project.root}`)}${project.root}`;
43
+ const offset = (0, devkit_1.offsetFromRoot)(project.root);
45
44
  const isTsSolution = (0, internal_2.isUsingTsSolutionSetup)(host);
46
- (0, devkit_2.generateFiles)(host, (0, path_1.join)(__dirname, 'files'), project.root, {
45
+ (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, 'files'), project.root, {
47
46
  ...options,
48
47
  hasPlugin,
49
48
  projectPathFromDist,
@@ -98,23 +97,23 @@ async function customServerGenerator(host, options) {
98
97
  },
99
98
  },
100
99
  };
101
- (0, devkit_2.updateProjectConfiguration)(host, options.project, project);
102
- (0, devkit_2.updateJson)(host, 'nx.json', (json) => {
100
+ (0, devkit_1.updateProjectConfiguration)(host, options.project, project);
101
+ (0, devkit_1.updateJson)(host, 'nx.json', (json) => {
103
102
  if (!json.tasksRunnerOptions?.default?.options?.cacheableOperations?.includes('build-custom-server') &&
104
103
  json.tasksRunnerOptions?.default?.options?.cacheableOperations) {
105
104
  json.tasksRunnerOptions.default.options.cacheableOperations.push('build-custom-server');
106
105
  }
107
106
  return json;
108
107
  });
109
- const updatedNxJson = (0, devkit_2.readNxJson)(host) ?? {};
108
+ const updatedNxJson = (0, devkit_1.readNxJson)(host) ?? {};
110
109
  (0, internal_1.upsertTargetDefault)(host, updatedNxJson, {
111
110
  target: 'build-custom-server',
112
111
  cache: true,
113
112
  });
114
- (0, devkit_2.updateNxJson)(host, updatedNxJson);
113
+ (0, devkit_1.updateNxJson)(host, updatedNxJson);
115
114
  if (options.compiler === 'swc') {
116
115
  // Update app swc to exlude server files
117
- (0, devkit_2.updateJson)(host, (0, path_1.join)(project.root, '.swcrc'), (json) => {
116
+ (0, devkit_1.updateJson)(host, (0, path_1.join)(project.root, '.swcrc'), (json) => {
118
117
  json.exclude = [...(json.exclude ?? []), 'server/**'];
119
118
  return json;
120
119
  });
@@ -43,10 +43,6 @@ async function libraryGeneratorInternal(host, rawOptions) {
43
43
  tasks.push(libTask);
44
44
  if (!options.skipPackageJson) {
45
45
  const devDependencies = {};
46
- if (options.linter === 'eslint') {
47
- devDependencies['eslint-config-next'] = versions_1.eslintConfigNextVersion;
48
- devDependencies['@next/eslint-plugin-next'] = versions_1.eslintConfigNextVersion;
49
- }
50
46
  if (options.unitTestRunner && options.unitTestRunner !== 'none') {
51
47
  devDependencies['@testing-library/react'] = internal_1.testingLibraryReactVersion;
52
48
  devDependencies['@testing-library/dom'] = internal_1.testingLibraryDomVersion;
@@ -71,6 +67,27 @@ export async function HelloServer() {
71
67
  if (!options.skipTsConfig && !isTsSolutionSetup) {
72
68
  (0, js_1.addTsConfigPath)(host, `${options.importPath}/server`, [serverEntryPath]);
73
69
  }
70
+ const isBuildable = (options.bundler && options.bundler !== 'none') ||
71
+ options.buildable ||
72
+ options.publishable;
73
+ if (isTsSolutionSetup && !isBuildable) {
74
+ // Non-buildable libs resolve `.` straight to source, so `./server` does the same.
75
+ const packageJsonPath = (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json');
76
+ if (host.exists(packageJsonPath)) {
77
+ (0, devkit_1.updateJson)(host, packageJsonPath, (json) => {
78
+ json.exports ??= {};
79
+ const serverSource = `./src/server.${options.js ? 'js' : 'ts'}`;
80
+ json.exports['./server'] = options.js
81
+ ? serverSource
82
+ : {
83
+ types: serverSource,
84
+ import: serverSource,
85
+ default: serverSource,
86
+ };
87
+ return json;
88
+ });
89
+ }
90
+ }
74
91
  // Configure Vite and package.json for server entry point when using Vite bundler
75
92
  if (options.bundler === 'vite') {
76
93
  // Update vite.config.mts to support multiple entry points
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "cli": "nx",
4
- "$id": "NxReactLibrary",
5
- "title": "Create a React Library for Nx",
6
- "description": "Create a React Library for an Nx workspace.",
4
+ "$id": "NxNextLibrary",
5
+ "title": "Create a Next.js Library for Nx",
6
+ "description": "Create a Next.js library for an Nx workspace. Same output as `@nx/react:library`, plus a `server` entry point for React Server Components and the Next.js type declarations.",
7
7
  "type": "object",
8
8
  "properties": {
9
9
  "directory": {
@@ -0,0 +1,2 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export default function addSvgrWebpackIfUsed(tree: Tree): Promise<import("@nx/devkit").GeneratorCallback>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = addSvgrWebpackIfUsed;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const versions_1 = require("../../utils/versions");
6
+ // The Nx 22 `add-svgr-to-next-config` migration inlined a `withSvgr` helper
7
+ // that resolves `@svgr/webpack` into user next configs, but never added the
8
+ // package to the workspace - it only resolved transitively through `@nx/next`.
9
+ // Now that `@nx/next` no longer depends on it, backfill it where a next config
10
+ // actually references it.
11
+ const nextConfigFileNames = [
12
+ 'next.config.js',
13
+ 'next.config.cjs',
14
+ 'next.config.mjs',
15
+ 'next.config.ts',
16
+ ];
17
+ async function addSvgrWebpackIfUsed(tree) {
18
+ let needsSvgr = false;
19
+ for (const [, project] of (0, devkit_1.getProjects)(tree)) {
20
+ for (const fileName of nextConfigFileNames) {
21
+ const path = (0, devkit_1.joinPathFragments)(project.root, fileName);
22
+ needsSvgr ||=
23
+ tree.exists(path) && tree.read(path, 'utf-8').includes('@svgr/webpack');
24
+ }
25
+ if (needsSvgr) {
26
+ break;
27
+ }
28
+ }
29
+ if (!needsSvgr) {
30
+ return;
31
+ }
32
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@svgr/webpack': versions_1.svgrWebpackVersion }, undefined, true);
33
+ }
@@ -0,0 +1,28 @@
1
+ #### Add `@svgr/webpack` If Used
2
+
3
+ Adds `@svgr/webpack` to the workspace when a next config references it.
4
+
5
+ `@svgr/webpack` is no longer a dependency of `@nx/next`, so workspaces whose next configs resolve it - which is what the Nx 22 `add-svgr-to-next-config` migration inlined - must declare it themselves. This migration backfills it for those workspaces. Workspaces that already have `@svgr/webpack` are left untouched.
6
+
7
+ #### Examples
8
+
9
+ ##### Before
10
+
11
+ ```jsonc title="package.json"
12
+ {
13
+ "devDependencies": {
14
+ "@nx/next": "23.1.0",
15
+ },
16
+ }
17
+ ```
18
+
19
+ ##### After
20
+
21
+ ```jsonc title="package.json"
22
+ {
23
+ "devDependencies": {
24
+ "@nx/next": "23.1.0",
25
+ "@svgr/webpack": "^8.0.1",
26
+ },
27
+ }
28
+ ```
@@ -6,8 +6,6 @@ const devkit_1 = require("@nx/devkit");
6
6
  const js_1 = require("@nx/js");
7
7
  const internal_2 = require("@nx/js/internal");
8
8
  const fs_1 = require("fs");
9
- const devkit_internals_1 = require("nx/src/devkit-internals");
10
- const cache_directory_1 = require("nx/src/utils/cache-directory");
11
9
  const path_1 = require("path");
12
10
  const nextConfigBlob = '**/next.config.{ts,js,cjs,mjs}';
13
11
  /**
@@ -20,8 +18,8 @@ exports.createDependencies = createDependencies;
20
18
  exports.createNodes = [
21
19
  nextConfigBlob,
22
20
  async (configFiles, options, context) => {
23
- const optionsHash = (0, devkit_internals_1.hashObject)(options);
24
- const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `next-${optionsHash}.json`);
21
+ const optionsHash = (0, internal_1.hashObject)(options);
22
+ const cachePath = (0, path_1.join)(internal_1.workspaceDataDirectory, `next-${optionsHash}.json`);
25
23
  const targetsCache = new internal_1.PluginCache(cachePath);
26
24
  const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
27
25
  const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
@@ -1,2 +1,2 @@
1
- import { Tree } from 'nx/src/generators/tree';
1
+ import { Tree } from '@nx/devkit';
2
2
  export declare function addGitIgnoreEntry(host: Tree): void;
@@ -2,24 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createCopyPlugin = createCopyPlugin;
4
4
  const CopyWebpackPlugin = require('copy-webpack-plugin');
5
- const path_1 = require("nx/src/utils/path");
6
- const path_2 = require("path");
5
+ const path_1 = require("path");
7
6
  const fs_1 = require("fs");
7
+ const devkit_1 = require("@nx/devkit");
8
8
  function normalizeAssets(assets, root, sourceRoot) {
9
9
  return assets.map((asset) => {
10
10
  if (typeof asset === 'string') {
11
- const assetPath = (0, path_1.normalizePath)(asset);
12
- const resolvedAssetPath = (0, path_2.resolve)(root, assetPath);
13
- const resolvedSourceRoot = (0, path_2.resolve)(root, sourceRoot);
11
+ const assetPath = (0, devkit_1.normalizePath)(asset);
12
+ const resolvedAssetPath = (0, path_1.resolve)(root, assetPath);
13
+ const resolvedSourceRoot = (0, path_1.resolve)(root, sourceRoot);
14
14
  if (!resolvedAssetPath.startsWith(resolvedSourceRoot)) {
15
15
  throw new Error(`The ${resolvedAssetPath} asset path must start with the project source root: ${sourceRoot}`);
16
16
  }
17
17
  const isDirectory = (0, fs_1.statSync)(resolvedAssetPath).isDirectory();
18
18
  const input = isDirectory
19
19
  ? resolvedAssetPath
20
- : (0, path_2.dirname)(resolvedAssetPath);
21
- const output = (0, path_2.relative)(resolvedSourceRoot, (0, path_2.resolve)(root, input));
22
- const glob = isDirectory ? '**/*' : (0, path_2.basename)(resolvedAssetPath);
20
+ : (0, path_1.dirname)(resolvedAssetPath);
21
+ const output = (0, path_1.relative)(resolvedSourceRoot, (0, path_1.resolve)(root, input));
22
+ const glob = isDirectory ? '**/*' : (0, path_1.basename)(resolvedAssetPath);
23
23
  return {
24
24
  input,
25
25
  output,
@@ -30,8 +30,8 @@ function normalizeAssets(assets, root, sourceRoot) {
30
30
  if (asset.output.startsWith('..')) {
31
31
  throw new Error('An asset cannot be written to a location outside of the output path.');
32
32
  }
33
- const assetPath = (0, path_1.normalizePath)(asset.input);
34
- const resolvedAssetPath = (0, path_2.resolve)(root, assetPath);
33
+ const assetPath = (0, devkit_1.normalizePath)(asset.input);
34
+ const resolvedAssetPath = (0, path_1.resolve)(root, assetPath);
35
35
  return {
36
36
  ...asset,
37
37
  input: resolvedAssetPath,
@@ -46,7 +46,7 @@ function createCopyPlugin(assets, root, sourceRoot) {
46
46
  patterns: normalizeAssets(assets, root, sourceRoot).map((asset) => {
47
47
  return {
48
48
  context: asset.input,
49
- to: (0, path_2.join)('../public', asset.output),
49
+ to: (0, path_1.join)('../public', asset.output),
50
50
  from: asset.glob,
51
51
  globOptions: {
52
52
  ignore: [
@@ -10,3 +10,4 @@ export declare const eslintConfigNext14Version = "^15.5.18";
10
10
  export declare const eslintConfigNextVersion = "^16.1.6";
11
11
  export declare const sassVersion = "1.97.2";
12
12
  export declare const tsLibVersion = "^2.3.0";
13
+ export declare const svgrWebpackVersion = "^8.0.1";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tsLibVersion = exports.sassVersion = exports.eslintConfigNextVersion = exports.eslintConfigNext14Version = exports.eslintConfigNext15Version = exports.eslintConfigNext16Version = exports.nextVersion = exports.next14Version = exports.next15Version = exports.next16Version = exports.minSupportedNextVersion = exports.nxVersion = void 0;
3
+ exports.svgrWebpackVersion = exports.tsLibVersion = exports.sassVersion = exports.eslintConfigNextVersion = exports.eslintConfigNext14Version = exports.eslintConfigNext15Version = exports.eslintConfigNext16Version = exports.nextVersion = exports.next14Version = exports.next15Version = exports.next16Version = exports.minSupportedNextVersion = exports.nxVersion = void 0;
4
4
  const path_1 = require("path");
5
5
  exports.nxVersion = require((0, path_1.join)('@nx/next', 'package.json')).version;
6
6
  exports.minSupportedNextVersion = '14.0.0';
@@ -15,3 +15,4 @@ exports.eslintConfigNext14Version = '^15.5.18';
15
15
  exports.eslintConfigNextVersion = exports.eslintConfigNext16Version;
16
16
  exports.sassVersion = '1.97.2';
17
17
  exports.tsLibVersion = '^2.3.0';
18
+ exports.svgrWebpackVersion = '^8.0.1';
package/generators.json CHANGED
@@ -31,7 +31,7 @@
31
31
  "schema": "./dist/src/generators/library/schema.json",
32
32
  "aliases": ["lib"],
33
33
  "x-type": "library",
34
- "description": "Create a library."
34
+ "description": "Create a Next.js library."
35
35
  },
36
36
  "custom-server": {
37
37
  "factory": "./dist/src/generators/custom-server/custom-server#customServerGenerator",
package/migrations.json CHANGED
@@ -29,6 +29,12 @@
29
29
  "description": "Create AI instructions to help migrate workspaces from Next.js 14 to 15.",
30
30
  "prompt": "./dist/src/migrations/update-23-1-0/ai-instructions-for-next-15.md",
31
31
  "documentation": "./dist/src/migrations/update-23-1-0/upgrade-to-next-15.md"
32
+ },
33
+ "update-23-2-0-add-svgr-webpack-if-used": {
34
+ "version": "23.2.0-beta.4",
35
+ "description": "Add `@svgr/webpack` when a next config references it.",
36
+ "implementation": "./dist/src/migrations/update-23-2-0/add-svgr-webpack-if-used",
37
+ "documentation": "./dist/src/migrations/update-23-2-0/add-svgr-webpack-if-used.md"
32
38
  }
33
39
  },
34
40
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "23.1.1",
3
+ "version": "23.1.2",
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": {
@@ -67,28 +67,33 @@
67
67
  "supportsOptionalMigrations": true
68
68
  },
69
69
  "peerDependencies": {
70
- "next": ">=14.0.0 <17.0.0"
70
+ "next": ">=14.0.0 <17.0.0",
71
+ "@nx/webpack": "23.1.2"
72
+ },
73
+ "peerDependenciesMeta": {
74
+ "@nx/webpack": {
75
+ "optional": true
76
+ }
71
77
  },
72
78
  "dependencies": {
73
79
  "@babel/plugin-proposal-decorators": "^7.22.7",
74
- "@svgr/webpack": "^8.0.1",
75
80
  "copy-webpack-plugin": "^14.0.0",
76
81
  "ignore": "^7.0.5",
77
82
  "semver": "^7.6.3",
78
83
  "tslib": "^2.3.0",
79
84
  "webpack-merge": "^5.8.0",
80
85
  "@phenomnomnominal/tsquery": "~6.2.0",
81
- "@nx/devkit": "23.1.1",
82
- "@nx/js": "23.1.1",
83
- "@nx/eslint": "23.1.1",
84
- "@nx/react": "23.1.1",
85
- "@nx/web": "23.1.1",
86
- "@nx/webpack": "23.1.1"
86
+ "@nx/devkit": "23.1.2",
87
+ "@nx/js": "23.1.2",
88
+ "@nx/eslint": "23.1.2",
89
+ "@nx/react": "23.1.2",
90
+ "@nx/web": "23.1.2"
87
91
  },
88
92
  "devDependencies": {
89
- "@nx/cypress": "23.1.1",
90
- "@nx/playwright": "23.1.1",
91
- "nx": "23.1.1"
93
+ "@nx/cypress": "23.1.2",
94
+ "@nx/webpack": "23.1.2",
95
+ "@nx/playwright": "23.1.2",
96
+ "nx": "23.1.2"
92
97
  },
93
98
  "publishConfig": {
94
99
  "access": "public"