@nx/next 19.6.1 → 19.6.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/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # Nx: Smart Monorepos · Fast CI
24
24
 
25
- Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
25
+ Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
26
26
 
27
27
  This package is a [Next.js plugin for Nx](https://nx.dev/next/overview).
28
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "19.6.1",
3
+ "version": "19.6.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": {
@@ -35,7 +35,7 @@
35
35
  "next": ">=14.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "19.6.1",
38
+ "@nx/devkit": "19.6.3",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.0.1",
41
41
  "chalk": "^4.1.0",
@@ -46,14 +46,14 @@
46
46
  "semver": "^7.5.3",
47
47
  "tslib": "^2.3.0",
48
48
  "webpack-merge": "^5.8.0",
49
- "@nx/js": "19.6.1",
50
- "@nx/eslint": "19.6.1",
51
- "@nx/react": "19.6.1",
52
- "@nx/web": "19.6.1",
53
- "@nx/webpack": "19.6.1",
54
- "@nx/workspace": "19.6.1",
49
+ "@nx/js": "19.6.3",
50
+ "@nx/eslint": "19.6.3",
51
+ "@nx/react": "19.6.3",
52
+ "@nx/web": "19.6.3",
53
+ "@nx/webpack": "19.6.3",
54
+ "@nx/workspace": "19.6.3",
55
55
  "@phenomnomnominal/tsquery": "~5.0.1",
56
- "@nrwl/next": "19.6.1"
56
+ "@nrwl/next": "19.6.3"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
@@ -62,12 +62,15 @@ function getNxContext(graph, target) {
62
62
  function withNx(_nextConfig = {}, context = getWithNxContext()) {
63
63
  return async (phase) => {
64
64
  const { PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER } = await Promise.resolve().then(() => require('next/constants'));
65
- // Two scenarios where we want to skip graph creation:
65
+ // Three scenarios where we want to skip graph creation:
66
66
  // 1. Running production server means the build is already done so we just need to start the Next.js server.
67
67
  // 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.
68
+ // 3. Running outside of Nx, we don't have a graph to read.
68
69
  //
69
70
  // NOTE: Avoid any `require(...)` or `import(...)` statements here. Development dependencies are not available at production runtime.
70
- if (PHASE_PRODUCTION_SERVER === phase || global.NX_GRAPH_CREATION) {
71
+ if (PHASE_PRODUCTION_SERVER === phase ||
72
+ global.NX_GRAPH_CREATION ||
73
+ !process.env.NX_TASK_TARGET_TARGET) {
71
74
  const { nx, ...validNextConfig } = _nextConfig;
72
75
  return {
73
76
  distDir: '.next',
@@ -58,6 +58,7 @@ async function buildExecutor(options, context) {
58
58
  target: context.targetName,
59
59
  root: context.root,
60
60
  isProduction: !options.includeDevDependenciesInPackageJson, // By default we remove devDependencies since this is a production build.
61
+ skipPackageManager: options.skipPackageManager,
61
62
  });
62
63
  // Update `package.json` to reflect how users should run the build artifacts
63
64
  builtPackageJson.scripts = {
@@ -58,6 +58,10 @@
58
58
  "default": false,
59
59
  "x-priority": "internal"
60
60
  },
61
+ "skipPackageManager": {
62
+ "type": "boolean",
63
+ "description": "Do not add a `packageManager` entry to the generated package.json file."
64
+ },
61
65
  "debug": {
62
66
  "type": "boolean",
63
67
  "description": "Enable Next.js debug build logging"
@@ -1,5 +1,5 @@
1
1
  import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
2
- import type { Linter } from '@nx/eslint';
2
+ import type { Linter, LinterType } from '@nx/eslint';
3
3
  import type { SupportedStyles } from '@nx/react';
4
4
 
5
5
  export interface Schema {
@@ -11,7 +11,7 @@ export interface Schema {
11
11
  tags?: string;
12
12
  unitTestRunner?: 'jest' | 'none';
13
13
  e2eTestRunner?: 'cypress' | 'playwright' | 'none';
14
- linter?: Linter;
14
+ linter?: Linter | LinterType;
15
15
  js?: boolean;
16
16
  setParserOptionsProject?: boolean;
17
17
  swc?: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
2
- import type { Linter } from '@nx/eslint';
2
+ import type { Linter, LinterType } from '@nx/eslint';
3
3
  import type { SupportedStyles } from '@nx/react';
4
4
 
5
5
  export interface Schema {
@@ -13,8 +13,8 @@ export interface Schema {
13
13
  pascalCaseFiles?: boolean;
14
14
  routing?: boolean;
15
15
  appProject?: string;
16
- unitTestRunner: 'jest' | 'none';
17
- linter: Linter;
16
+ unitTestRunner: 'jest' | 'vitest' | 'none';
17
+ linter: Linter | LinterType;
18
18
  component?: boolean;
19
19
  publishable?: boolean;
20
20
  buildable?: boolean;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.configureForSwc = configureForSwc;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const versions_1 = require("./versions");
5
+ const versions_1 = require("@nx/js/src/utils/versions");
6
6
  const add_swc_config_1 = require("@nx/js/src/utils/swc/add-swc-config");
7
7
  function configureForSwc(tree, projectRoot) {
8
8
  const swcConfigPath = (0, devkit_1.joinPathFragments)(projectRoot, '.swcrc');
@@ -28,7 +28,9 @@ function configureForSwc(tree, projectRoot) {
28
28
  }
29
29
  }
30
30
  function addSwcDependencies(tree) {
31
- return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
31
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {
32
+ '@swc/helpers': versions_1.swcHelpersVersion,
33
+ }, {
32
34
  '@swc-node/register': versions_1.swcNodeVersion,
33
35
  '@swc/cli': versions_1.swcCliVersion,
34
36
  '@swc/core': versions_1.swcCoreVersion,
@@ -21,18 +21,19 @@ export interface FileReplacement {
21
21
  with: string;
22
22
  }
23
23
  export interface NextBuildBuilderOptions {
24
- outputPath: string;
25
- fileReplacements: FileReplacement[];
26
24
  assets?: any[];
27
- nextConfig?: string;
28
25
  buildLibsFromSource?: boolean;
29
- includeDevDependenciesInPackageJson?: boolean;
30
- generateLockfile?: boolean;
31
- watch?: boolean;
32
26
  debug?: boolean;
33
- profile?: boolean;
34
27
  experimentalAppOnly?: boolean;
35
28
  experimentalBuildMode?: 'compile' | 'generate';
29
+ fileReplacements: FileReplacement[];
30
+ generateLockfile?: boolean;
31
+ includeDevDependenciesInPackageJson?: boolean;
32
+ nextConfig?: string;
33
+ outputPath: string;
34
+ profile?: boolean;
35
+ skipPackageManager?: boolean;
36
+ watch?: boolean;
36
37
  }
37
38
  export interface NextServeBuilderOptions {
38
39
  dev: boolean;
@@ -6,7 +6,3 @@ export declare const lessLoader = "11.1.0";
6
6
  export declare const emotionServerVersion = "11.11.0";
7
7
  export declare const babelPluginStyledComponentsVersion = "1.10.7";
8
8
  export declare const tsLibVersion = "^2.3.0";
9
- export declare const swcCliVersion = "~0.1.62";
10
- export declare const swcCoreVersion = "~1.3.85";
11
- export declare const swcHelpersVersion = "~0.5.2";
12
- export declare const swcNodeVersion = "~1.8.0";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.swcNodeVersion = exports.swcHelpersVersion = exports.swcCoreVersion = exports.swcCliVersion = exports.tsLibVersion = exports.babelPluginStyledComponentsVersion = exports.emotionServerVersion = exports.lessLoader = exports.sassVersion = exports.eslintConfigNextVersion = exports.nextVersion = exports.nxVersion = void 0;
3
+ exports.tsLibVersion = exports.babelPluginStyledComponentsVersion = exports.emotionServerVersion = exports.lessLoader = exports.sassVersion = exports.eslintConfigNextVersion = exports.nextVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
5
  exports.nextVersion = '14.2.3';
6
6
  exports.eslintConfigNextVersion = '14.2.3';
@@ -9,7 +9,3 @@ exports.lessLoader = '11.1.0';
9
9
  exports.emotionServerVersion = '11.11.0';
10
10
  exports.babelPluginStyledComponentsVersion = '1.10.7';
11
11
  exports.tsLibVersion = '^2.3.0';
12
- exports.swcCliVersion = '~0.1.62';
13
- exports.swcCoreVersion = '~1.3.85';
14
- exports.swcHelpersVersion = '~0.5.2';
15
- exports.swcNodeVersion = '~1.8.0';