@nx/next 19.0.1 → 19.0.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/next",
3
- "version": "19.0.1",
3
+ "version": "19.0.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": {
@@ -34,7 +34,7 @@
34
34
  "next": ">=14.0.0"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "19.0.1",
37
+ "@nx/devkit": "19.0.3",
38
38
  "@babel/plugin-proposal-decorators": "^7.22.7",
39
39
  "@svgr/webpack": "^8.0.1",
40
40
  "chalk": "^4.1.0",
@@ -45,13 +45,13 @@
45
45
  "semver": "^7.5.3",
46
46
  "tslib": "^2.3.0",
47
47
  "webpack-merge": "^5.8.0",
48
- "@nx/js": "19.0.1",
49
- "@nx/eslint": "19.0.1",
50
- "@nx/react": "19.0.1",
51
- "@nx/web": "19.0.1",
52
- "@nx/webpack": "19.0.1",
53
- "@nx/workspace": "19.0.1",
54
- "@nrwl/next": "19.0.1"
48
+ "@nx/js": "19.0.3",
49
+ "@nx/eslint": "19.0.3",
50
+ "@nx/react": "19.0.3",
51
+ "@nx/web": "19.0.3",
52
+ "@nx/webpack": "19.0.3",
53
+ "@nx/workspace": "19.0.3",
54
+ "@nrwl/next": "19.0.3"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public"
@@ -5,9 +5,14 @@
5
5
  import type { NextConfig } from 'next';
6
6
  import type { NextConfigFn } from '../src/utils/config';
7
7
  import { type ProjectGraphProjectNode } from '@nx/devkit';
8
+ export interface SvgrOptions {
9
+ svgo?: boolean;
10
+ titleProp?: boolean;
11
+ ref?: boolean;
12
+ }
8
13
  export interface WithNxOptions extends NextConfig {
9
14
  nx?: {
10
- svgr?: boolean;
15
+ svgr?: boolean | SvgrOptions;
11
16
  babelUpwardRootMode?: boolean;
12
17
  };
13
18
  }
@@ -219,7 +219,13 @@ function getNextConfig(nextConfig = {}, context = getWithNxContext()) {
219
219
  * 5. Add SVGR support if option is on.
220
220
  */
221
221
  // Default SVGR support to be on for projects.
222
- if (nx?.svgr !== false) {
222
+ if (nx?.svgr !== false || typeof nx?.svgr === 'object') {
223
+ const defaultSvgrOptions = {
224
+ svgo: false,
225
+ titleProp: true,
226
+ ref: true,
227
+ };
228
+ const svgrOptions = typeof nx?.svgr === 'object' ? nx.svgr : defaultSvgrOptions;
223
229
  // TODO(v20): Remove file-loader and use `?react` querystring to differentiate between asset and SVGR.
224
230
  // It should be:
225
231
  // use: [{
@@ -253,11 +259,7 @@ function getNextConfig(nextConfig = {}, context = getWithNxContext()) {
253
259
  use: [
254
260
  {
255
261
  loader: require.resolve('@svgr/webpack'),
256
- options: {
257
- svgo: false,
258
- titleProp: true,
259
- ref: true,
260
- },
262
+ options: svgrOptions,
261
263
  },
262
264
  {
263
265
  loader: require.resolve('file-loader'),
@@ -3,7 +3,7 @@ import type { SupportedStyles } from '@nx/react';
3
3
  interface Schema {
4
4
  name: string;
5
5
  /**
6
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19.
6
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20.
7
7
  */
8
8
  project?: string;
9
9
  style: SupportedStyles;
@@ -13,7 +13,7 @@
13
13
  "$default": {
14
14
  "$source": "projectName"
15
15
  },
16
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19."
16
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
17
17
  },
18
18
  "name": {
19
19
  "type": "string",
@@ -29,7 +29,7 @@ async function nextInitGeneratorInternal(host, schema) {
29
29
  schema.addPlugin ??= addPluginDefault;
30
30
  if (schema.addPlugin) {
31
31
  const { createNodes } = await Promise.resolve().then(() => require('../../plugins/plugin'));
32
- await (0, add_plugin_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/next/plugin', createNodes, {
32
+ await (0, add_plugin_1.addPlugin)(host, '@nx/next/plugin', createNodes, {
33
33
  startTargetName: ['start', 'next:start', 'next-start'],
34
34
  buildTargetName: ['build', 'next:build', 'next-build'],
35
35
  devTargetName: ['dev', 'next:dev', 'next-dev'],
@@ -3,7 +3,7 @@ import { SupportedStyles } from '@nx/react';
3
3
  export interface Schema {
4
4
  name: string;
5
5
  /**
6
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19.
6
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20.
7
7
  */
8
8
  project?: string;
9
9
  style: SupportedStyles;
@@ -13,7 +13,7 @@
13
13
  "$default": {
14
14
  "$source": "projectName"
15
15
  },
16
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19."
16
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
17
17
  },
18
18
  "name": {
19
19
  "type": "string",
@@ -97,7 +97,7 @@
97
97
  "type": "boolean",
98
98
  "description": "Create component at the source root rather than its own directory.",
99
99
  "default": false,
100
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19."
100
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
101
101
  },
102
102
  "skipFormat": {
103
103
  "description": "Skip formatting files.",