@nx/next 16.5.0-beta.2 → 16.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "16.5.0-beta.2",
3
+ "version": "16.5.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, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.",
6
6
  "repository": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@babel/plugin-proposal-decorators": "^7.14.5",
38
- "@nrwl/next": "16.5.0-beta.2",
39
- "@nx/devkit": "16.5.0-beta.2",
40
- "@nx/js": "16.5.0-beta.2",
41
- "@nx/linter": "16.5.0-beta.2",
42
- "@nx/react": "16.5.0-beta.2",
43
- "@nx/web": "16.5.0-beta.2",
44
- "@nx/workspace": "16.5.0-beta.2",
38
+ "@nrwl/next": "16.5.0",
39
+ "@nx/devkit": "16.5.0",
40
+ "@nx/js": "16.5.0",
41
+ "@nx/linter": "16.5.0",
42
+ "@nx/react": "16.5.0",
43
+ "@nx/web": "16.5.0",
44
+ "@nx/workspace": "16.5.0",
45
45
  "@svgr/webpack": "^8.0.1",
46
46
  "chalk": "^4.1.0",
47
47
  "copy-webpack-plugin": "^10.2.4",
@@ -60,5 +60,5 @@
60
60
  "access": "public"
61
61
  },
62
62
  "types": "./index.d.ts",
63
- "gitHead": "efdf140459e453c50f06cf287906c4bb3ac49d3d"
63
+ "gitHead": "eaebcc34f92db2200dab0bde2e2e1dde107a47bf"
64
64
  }
@@ -95,6 +95,9 @@ function withNx(_nextConfig = {}, context = getWithNxContext()) {
95
95
  }
96
96
  }
97
97
  });
98
+ // process.env.NX_NEXT_OUTPUT_PATH is set when running @nx/next:build
99
+ options.outputPath =
100
+ process.env.NX_NEXT_OUTPUT_PATH || options.outputPath;
98
101
  // outputPath may be undefined if using run-commands or other executors other than @nx/next:build.
99
102
  // In this case, the user should set distDir in their next.config.js.
100
103
  if (options.outputPath) {
@@ -15,11 +15,11 @@ const check_project_1 = require("./lib/check-project");
15
15
  const child_process_1 = require("child_process");
16
16
  const create_cli_options_1 = require("../../utils/create-cli-options");
17
17
  function buildExecutor(options, context) {
18
- var _a, _b, _c;
19
- var _d, _e;
18
+ var _a, _b, _c, _d;
19
+ var _e, _f, _g;
20
20
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
21
  // Cast to any to overwrite NODE_ENV
22
- (_d = process.env).NODE_ENV || (_d.NODE_ENV = 'production');
22
+ (_e = process.env).NODE_ENV || (_e.NODE_ENV = 'production');
23
23
  const projectRoot = context.projectGraph.nodes[context.projectName].data.root;
24
24
  (0, check_project_1.checkPublicDirectory)(projectRoot);
25
25
  // Set `__NEXT_REACT_ROOT` based on installed ReactDOM version
@@ -32,9 +32,12 @@ function buildExecutor(options, context) {
32
32
  const hasReact18 = reactDomVersion &&
33
33
  (0, semver_1.gte)((0, semver_2.checkAndCleanWithSemver)('react-dom', reactDomVersion), '18.0.0');
34
34
  if (hasReact18) {
35
- (_e = process.env)['__NEXT_REACT_ROOT'] || (_e['__NEXT_REACT_ROOT'] = 'true');
35
+ (_f = process.env)['__NEXT_REACT_ROOT'] || (_f['__NEXT_REACT_ROOT'] = 'true');
36
36
  }
37
- const { experimentalAppOnly, profile, debug } = options;
37
+ const { experimentalAppOnly, profile, debug, outputPath } = options;
38
+ // Set output path here since it can also be set via CLI
39
+ // We can retrieve it inside plugins/with-nx
40
+ (_d = (_g = process.env).NX_NEXT_OUTPUT_PATH) !== null && _d !== void 0 ? _d : (_g.NX_NEXT_OUTPUT_PATH = outputPath);
38
41
  const args = (0, create_cli_options_1.createCliOptions)({ experimentalAppOnly, profile, debug });
39
42
  const command = `npx next build ${args.join(' ')}`;
40
43
  const execSyncOptions = {
@@ -38,8 +38,7 @@
38
38
  },
39
39
  "hostname": {
40
40
  "type": "string",
41
- "description": "Hostname on which the application is served.",
42
- "default": "localhost"
41
+ "description": "Hostname on which the application is served."
43
42
  },
44
43
  "buildLibsFromSource": {
45
44
  "type": "boolean",
@@ -16,7 +16,7 @@ function serveExecutor(options, context) {
16
16
  }
17
17
  const buildOptions = (0, devkit_1.readTargetOptions)((0, devkit_1.parseTargetString)(options.buildTarget, context.projectGraph), context);
18
18
  const projectRoot = context.workspace.projects[context.projectName].root;
19
- const { port, keepAliveTimeout, hostname = 'localhost' } = options;
19
+ const { port, keepAliveTimeout, hostname } = options;
20
20
  // This is required for the default custom server to work. See the @nx/next:app generator.
21
21
  process.env.NX_NEXT_DIR = projectRoot;
22
22
  // Cast to any to overwrite NODE_ENV