@nx/next 22.7.0-beta.1 → 22.7.0-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "22.7.0-beta.1",
3
+ "version": "22.7.0-beta.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": {
@@ -35,7 +35,7 @@
35
35
  "next": ">=14.0.0 <17.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "22.7.0-beta.1",
38
+ "@nx/devkit": "22.7.0-beta.2",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.1.0",
41
41
  "copy-webpack-plugin": "^14.0.0",
@@ -43,17 +43,17 @@
43
43
  "semver": "^7.6.3",
44
44
  "tslib": "^2.3.0",
45
45
  "webpack-merge": "^5.8.0",
46
- "@nx/js": "22.7.0-beta.1",
47
- "@nx/eslint": "22.7.0-beta.1",
48
- "@nx/react": "22.7.0-beta.1",
49
- "@nx/web": "22.7.0-beta.1",
50
- "@nx/webpack": "22.7.0-beta.1",
46
+ "@nx/js": "22.7.0-beta.2",
47
+ "@nx/eslint": "22.7.0-beta.2",
48
+ "@nx/react": "22.7.0-beta.2",
49
+ "@nx/web": "22.7.0-beta.2",
50
+ "@nx/webpack": "22.7.0-beta.2",
51
51
  "@phenomnomnominal/tsquery": "~6.1.4"
52
52
  },
53
53
  "devDependencies": {
54
- "@nx/cypress": "22.7.0-beta.1",
55
- "@nx/playwright": "22.7.0-beta.1",
56
- "nx": "22.7.0-beta.1"
54
+ "@nx/cypress": "22.7.0-beta.2",
55
+ "@nx/playwright": "22.7.0-beta.2",
56
+ "nx": "22.7.0-beta.2"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.getNextConfig = getNextConfig;
4
37
  exports.getAliasForProject = getAliasForProject;
@@ -62,7 +95,7 @@ function getNxContext(graph, target) {
62
95
  */
63
96
  function withNx(_nextConfig = {}, context = getWithNxContext()) {
64
97
  return async (phase) => {
65
- const { PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER } = await Promise.resolve().then(() => require('next/constants'));
98
+ const { PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER } = await Promise.resolve().then(() => __importStar(require('next/constants')));
66
99
  // Three scenarios where we want to skip graph creation:
67
100
  // 1. Running production server means the build is already done so we just need to start the Next.js server.
68
101
  // 2. During graph creation (i.e. create nodes), we won't have a graph to read, and it is not needed anyway since it's a build-time concern.
@@ -6,8 +6,9 @@ exports.findNextConfigPath = findNextConfigPath;
6
6
  exports.getRelativeFilesToCopy = getRelativeFilesToCopy;
7
7
  exports.getRelativeImports = getRelativeImports;
8
8
  exports.ensureFileExtensions = ensureFileExtensions;
9
+ const tslib_1 = require("tslib");
9
10
  const devkit_1 = require("@nx/devkit");
10
- const ts = require("typescript");
11
+ const ts = tslib_1.__importStar(require("typescript"));
11
12
  const node_fs_1 = require("node:fs");
12
13
  const path_1 = require("path");
13
14
  const js_1 = require("@nx/js");
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = serveExecutor;
4
+ const tslib_1 = require("tslib");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const path_1 = require("path");
6
7
  const child_process_1 = require("child_process");
7
- const custom_server_impl_1 = require("./custom-server.impl");
8
+ const custom_server_impl_1 = tslib_1.__importDefault(require("./custom-server.impl"));
8
9
  const create_cli_options_1 = require("../../utils/create-cli-options");
9
10
  const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
10
11
  const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
@@ -1 +1 @@
1
- {"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-linting.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAgBvD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAiG5B"}
1
+ {"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-linting.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAgBvD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAkG5B"}
@@ -25,7 +25,7 @@ async function addLinting(host, options) {
25
25
  }));
26
26
  if (options.linter === 'eslint' && (0, eslint_file_1.isEslintConfigSupported)(host)) {
27
27
  if ((0, flat_config_1.useFlatConfig)(host)) {
28
- (0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react-typescript');
28
+ (0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react-typescript', { checkBaseConfig: true });
29
29
  if (await (0, version_utils_1.isNext16)(host)) {
30
30
  (0, eslint_file_1.addPluginsToLintConfig)(host, options.appProjectRoot, ['@next/next']);
31
31
  }
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateNextConfig = updateNextConfig;
4
+ const tslib_1 = require("tslib");
4
5
  const utils_1 = require("./utils");
5
6
  const tsquery_1 = require("@phenomnomnominal/tsquery");
6
- const ts = require("typescript");
7
+ const ts = tslib_1.__importStar(require("typescript"));
7
8
  function updateNextConfig(tree, updatedConfigFileContents, project, migrationLogs) {
8
9
  const nextConfigPath = (0, utils_1.findNextConfigPath)(tree, project.root);
9
10
  if (!nextConfigPath) {
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.cypressComponentConfiguration = cypressComponentConfiguration;
4
37
  exports.cypressComponentConfigurationInternal = cypressComponentConfigurationInternal;
@@ -29,7 +62,7 @@ async function cypressComponentConfigurationInternal(tree, options) {
29
62
  skipFormat: true,
30
63
  addPlugin: options.addPlugin,
31
64
  }));
32
- const { ensureDependencies } = await Promise.resolve().then(() => require('@nx/webpack/src/utils/ensure-dependencies'));
65
+ const { ensureDependencies } = await Promise.resolve().then(() => __importStar(require('@nx/webpack/src/utils/ensure-dependencies')));
33
66
  tasks.push(ensureDependencies(tree, { compiler: 'swc', uiFramework: 'react' }));
34
67
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
35
68
  if (projectConfig.targets?.['component-test']?.executor ===
@@ -47,8 +80,8 @@ async function cypressComponentConfigurationInternal(tree, options) {
47
80
  return (0, devkit_1.runTasksInSerial)(...tasks);
48
81
  }
49
82
  async function addFiles(tree, projectConfig, opts) {
50
- const { addMountDefinition, addDefaultCTConfig } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/config'));
51
- const { getInstalledCypressMajorVersion } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/versions'));
83
+ const { addMountDefinition, addDefaultCTConfig } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/src/utils/config')));
84
+ const { getInstalledCypressMajorVersion } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/src/utils/versions')));
52
85
  const installedCypressMajorVersion = getInstalledCypressMajorVersion(tree);
53
86
  const ctFile = (0, devkit_1.joinPathFragments)(projectConfig.root, 'cypress', 'support', 'component.ts');
54
87
  const updatedCommandFile = await addMountDefinition(tree.read(ctFile, 'utf-8'));
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.nextInitGenerator = nextInitGenerator;
4
37
  exports.nextInitGeneratorInternal = nextInitGeneratorInternal;
@@ -31,7 +64,7 @@ async function nextInitGeneratorInternal(host, schema) {
31
64
  nxJson.useInferencePlugins !== false;
32
65
  schema.addPlugin ??= addPluginDefault;
33
66
  if (schema.addPlugin) {
34
- const { createNodesV2 } = await Promise.resolve().then(() => require('../../plugins/plugin'));
67
+ const { createNodesV2 } = await Promise.resolve().then(() => __importStar(require('../../plugins/plugin')));
35
68
  await (0, add_plugin_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/next/plugin', createNodesV2, {
36
69
  startTargetName: ['start', 'next:start', 'next-start'],
37
70
  buildTargetName: ['build', 'next:build', 'next-build'],
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = addSvgrToNextConfig;
4
+ const tslib_1 = require("tslib");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
7
  const tsquery_1 = require("@phenomnomnominal/tsquery");
7
- const ts = require("typescript");
8
+ const ts = tslib_1.__importStar(require("typescript"));
8
9
  async function addSvgrToNextConfig(tree) {
9
10
  const projects = new Map();
10
11
  // Find all Next.js projects using withNx that have svgr explicitly set to true or an options object
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addGitIgnoreEntry = addGitIgnoreEntry;
4
- const ignore_1 = require("ignore");
4
+ const tslib_1 = require("tslib");
5
+ const ignore_1 = tslib_1.__importDefault(require("ignore"));
5
6
  function addGitIgnoreEntry(host) {
6
7
  if (!host.exists('.gitignore')) {
7
8
  return;