@nx/next 20.3.1 → 20.4.0-beta.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2024 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2025 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "20.3.1",
3
+ "version": "20.4.0-beta.0",
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": "20.3.1",
38
+ "@nx/devkit": "20.4.0-beta.0",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.0.1",
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": "20.3.1",
48
- "@nx/eslint": "20.3.1",
49
- "@nx/react": "20.3.1",
50
- "@nx/web": "20.3.1",
51
- "@nx/webpack": "20.3.1",
47
+ "@nx/js": "20.4.0-beta.0",
48
+ "@nx/eslint": "20.4.0-beta.0",
49
+ "@nx/react": "20.4.0-beta.0",
50
+ "@nx/web": "20.4.0-beta.0",
51
+ "@nx/webpack": "20.4.0-beta.0",
52
52
  "@phenomnomnominal/tsquery": "~5.0.1"
53
53
  },
54
54
  "publishConfig": {
@@ -38,6 +38,16 @@ async function nextInitGeneratorInternal(host, schema) {
38
38
  'next:serve-static',
39
39
  'next-serve-static',
40
40
  ],
41
+ buildDepsTargetName: [
42
+ 'build-deps',
43
+ 'next:build-deps',
44
+ 'next-build-deps',
45
+ ],
46
+ watchDepsTargetName: [
47
+ 'watch-deps',
48
+ 'next:watch-deps',
49
+ 'next-watch-deps',
50
+ ],
41
51
  }, schema.updatePackageScripts);
42
52
  }
43
53
  (0, add_gitignore_entry_1.addGitIgnoreEntry)(host);
@@ -4,6 +4,8 @@ export interface NextPluginOptions {
4
4
  devTargetName?: string;
5
5
  startTargetName?: string;
6
6
  serveStaticTargetName?: string;
7
+ buildDepsTargetName?: string;
8
+ watchDepsTargetName?: string;
7
9
  }
8
10
  /**
9
11
  * @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
@@ -10,6 +10,8 @@ const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculat
10
10
  const js_1 = require("@nx/js");
11
11
  const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
12
12
  const devkit_internals_1 = require("nx/src/devkit-internals");
13
+ const util_1 = require("@nx/js/src/plugins/typescript/util");
14
+ const pmc = (0, devkit_1.getPackageManagerCommand)();
13
15
  const nextConfigBlob = '**/next.config.{ts,js,cjs,mjs}';
14
16
  function readTargetsCache(cachePath) {
15
17
  return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
@@ -86,6 +88,7 @@ async function buildNextTargets(nextConfigPath, projectRoot, options, context) {
86
88
  targets[options.devTargetName] = getDevTargetConfig(projectRoot);
87
89
  targets[options.startTargetName] = getStartTargetConfig(options, projectRoot);
88
90
  targets[options.serveStaticTargetName] = getStaticServeTargetConfig(options);
91
+ (0, util_1.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
89
92
  return targets;
90
93
  }
91
94
  async function getBuildTargetConfig(namedInputs, projectRoot, nextConfig) {