@nx/next 21.0.0-beta.10 → 21.0.0-beta.12

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": "21.0.0-beta.10",
3
+ "version": "21.0.0-beta.12",
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": "21.0.0-beta.10",
38
+ "@nx/devkit": "21.0.0-beta.12",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.1.0",
41
41
  "copy-webpack-plugin": "^10.2.4",
@@ -44,11 +44,11 @@
44
44
  "semver": "^7.5.3",
45
45
  "tslib": "^2.3.0",
46
46
  "webpack-merge": "^5.8.0",
47
- "@nx/js": "21.0.0-beta.10",
48
- "@nx/eslint": "21.0.0-beta.10",
49
- "@nx/react": "21.0.0-beta.10",
50
- "@nx/web": "21.0.0-beta.10",
51
- "@nx/webpack": "21.0.0-beta.10",
47
+ "@nx/js": "21.0.0-beta.12",
48
+ "@nx/eslint": "21.0.0-beta.12",
49
+ "@nx/react": "21.0.0-beta.12",
50
+ "@nx/web": "21.0.0-beta.12",
51
+ "@nx/webpack": "21.0.0-beta.12",
52
52
  "@phenomnomnominal/tsquery": "~5.0.1"
53
53
  },
54
54
  "publishConfig": {
@@ -14,9 +14,8 @@ export interface SvgrOptions {
14
14
  export interface WithNxOptions extends NextConfig {
15
15
  nx?: {
16
16
  /**
17
- * @deprecated Next.js via turbo conflicts with how webpack handles the import of SVGs.
18
- * It is best to configure SVGR manually with the `@svgr/webpack` loader.
19
- * We will remove this option in Nx 21.
17
+ * @deprecated Add SVGR support in your Webpack configuration without relying on Nx. See https://react-svgr.com/docs/webpack/
18
+ * TODO(v22): Remove this option and migrate userland webpack config to explicitly configure @svgr/webpack
20
19
  * */
21
20
  svgr?: boolean | SvgrOptions;
22
21
  babelUpwardRootMode?: boolean;
@@ -241,26 +241,7 @@ function getNextConfig(nextConfig = {}, context = getWithNxContext()) {
241
241
  ref: true,
242
242
  };
243
243
  const svgrOptions = typeof nx?.svgr === 'object' ? nx.svgr : defaultSvgrOptions;
244
- // TODO(v21): Remove file-loader and use `?react` querystring to differentiate between asset and SVGR.
245
- // It should be:
246
- // use: [{
247
- // test: /\.svg$/i,
248
- // type: 'asset',
249
- // resourceQuery: /react/, // *.svg?react
250
- // },
251
- // {
252
- // test: /\.svg$/i,
253
- // issuer: /\.[jt]sx?$/,
254
- // resourceQuery: { not: [/react/] }, // exclude react component if *.svg?react
255
- // use: ['@svgr/webpack'],
256
- // }],
257
- // See:
258
- // - SVGR: https://react-svgr.com/docs/webpack/#use-svgr-and-asset-svg-in-the-same-project
259
- // - Vite: https://www.npmjs.com/package/vite-plugin-svgr
260
- // - Rsbuild: https://github.com/web-infra-dev/rsbuild/pull/1783
261
- // Note: We also need a migration for any projects that are using SVGR to convert
262
- // `import { ReactComponent as X } from './x.svg` to
263
- // `import X from './x.svg?react';
244
+ // TODO(v22): Remove SVGR support
264
245
  config.module.rules.push({
265
246
  test: /\.svg$/,
266
247
  issuer: { not: /\.(css|scss|sass)$/ },
@@ -12,11 +12,9 @@ const { withLess } = require('@nx/next/plugins/with-less');
12
12
  * @type {import('@nx/next/plugins/with-nx').WithNxOptions}
13
13
  **/
14
14
  const nextConfig = {
15
- nx: {
16
- // Set this to true if you would like to to use SVGR
17
- // See: https://github.com/gregberge/svgr
18
- svgr: false,
19
- },
15
+ // Use this to set Nx-specific options
16
+ // See: https://nx.dev/recipes/next/next-config-setup
17
+ nx: {},
20
18
  };
21
19
 
22
20
  const plugins = [
@@ -36,11 +34,9 @@ module.exports = composePlugins(...plugins)(nextConfig);
36
34
  * @type {import('@nx/next/plugins/with-nx').WithNxOptions}
37
35
  **/
38
36
  const nextConfig = {
39
- nx: {
40
- // Set this to true if you would like to to use SVGR
41
- // See: https://github.com/gregberge/svgr
42
- svgr: false,
43
- },
37
+ // Use this to set Nx-specific options
38
+ // See: https://nx.dev/recipes/next/next-config-setup
39
+ nx: {},
44
40
  <% if (style === 'styled-components') { %>
45
41
  compiler: {
46
42
  // For other options, see https://styled-components.com/docs/tooling#babel-plugin
@@ -66,11 +62,9 @@ module.exports = composePlugins(...plugins)(nextConfig);
66
62
  * @type {import('@nx/next/plugins/with-nx').WithNxOptions}
67
63
  **/
68
64
  const nextConfig = {
69
- nx: {
70
- // Set this to true if you would like to use SVGR
71
- // See: https://github.com/gregberge/svgr
72
- svgr: false,
73
- },
65
+ // Use this to set Nx-specific options
66
+ // See: https://nx.dev/recipes/next/next-config-setup
67
+ nx: {},
74
68
  };
75
69
 
76
70
  const plugins = [
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addE2e = addE2e;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const e2e_web_server_info_utils_1 = require("@nx/devkit/src/generators/e2e-web-server-info-utils");
6
- const eslint_1 = require("@nx/eslint");
7
6
  const web_1 = require("@nx/web");
8
7
  const versions_1 = require("../../../utils/versions");
9
8
  async function addE2e(host, options) {
@@ -47,7 +46,7 @@ async function addE2e(host, options) {
47
46
  }
48
47
  const e2eTask = await configurationGenerator(host, {
49
48
  ...options,
50
- linter: eslint_1.Linter.EsLint,
49
+ linter: 'eslint',
51
50
  project: options.e2eProjectName,
52
51
  directory: 'src',
53
52
  skipFormat: true,
@@ -23,7 +23,7 @@ async function addLinting(host, options) {
23
23
  setParserOptionsProject: options.setParserOptionsProject,
24
24
  addPlugin: options.addPlugin,
25
25
  }));
26
- if (options.linter === eslint_1.Linter.EsLint && (0, eslint_file_1.isEslintConfigSupported)(host)) {
26
+ if (options.linter === 'eslint' && (0, eslint_file_1.isEslintConfigSupported)(host)) {
27
27
  if ((0, flat_config_1.useFlatConfig)(host)) {
28
28
  (0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react-typescript');
29
29
  // Since Next.js does not support flat configs yet, we need to use compat fixup.
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = normalizeOptions;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
- const eslint_1 = require("@nx/eslint");
7
6
  const assertion_1 = require("@nx/react/src/utils/assertion");
8
7
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
9
8
  async function normalizeOptions(host, options) {
@@ -43,7 +42,7 @@ async function normalizeOptions(host, options) {
43
42
  e2eProjectRoot,
44
43
  e2eTestRunner: options.e2eTestRunner || 'playwright',
45
44
  fileName,
46
- linter: options.linter || eslint_1.Linter.EsLint,
45
+ linter: options.linter || 'eslint',
47
46
  outputPath,
48
47
  parsedTags,
49
48
  projectName: appProjectName,