@nx/next 18.1.0 → 18.1.1
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": "18.1.
|
|
3
|
+
"version": "18.1.1",
|
|
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": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"next": ">=14.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nx/devkit": "18.1.
|
|
37
|
+
"@nx/devkit": "18.1.1",
|
|
38
38
|
"@babel/plugin-proposal-decorators": "^7.22.7",
|
|
39
39
|
"@svgr/webpack": "^8.0.1",
|
|
40
40
|
"chalk": "^4.1.0",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"url-loader": "^4.1.1",
|
|
46
46
|
"tslib": "^2.3.0",
|
|
47
47
|
"webpack-merge": "^5.8.0",
|
|
48
|
-
"@nx/js": "18.1.
|
|
49
|
-
"@nx/eslint": "18.1.
|
|
50
|
-
"@nx/react": "18.1.
|
|
51
|
-
"@nx/web": "18.1.
|
|
52
|
-
"@nx/webpack": "18.1.
|
|
53
|
-
"@nx/workspace": "18.1.
|
|
54
|
-
"@nrwl/next": "18.1.
|
|
48
|
+
"@nx/js": "18.1.1",
|
|
49
|
+
"@nx/eslint": "18.1.1",
|
|
50
|
+
"@nx/react": "18.1.1",
|
|
51
|
+
"@nx/web": "18.1.1",
|
|
52
|
+
"@nx/webpack": "18.1.1",
|
|
53
|
+
"@nx/workspace": "18.1.1",
|
|
54
|
+
"@nrwl/next": "18.1.1"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
@@ -12,6 +12,7 @@ const create_next_config_file_1 = require("./lib/create-next-config-file");
|
|
|
12
12
|
const check_project_1 = require("./lib/check-project");
|
|
13
13
|
const child_process_1 = require("child_process");
|
|
14
14
|
const create_cli_options_1 = require("../../utils/create-cli-options");
|
|
15
|
+
const exit_codes_1 = require("nx/src/utils/exit-codes");
|
|
15
16
|
let childProcess;
|
|
16
17
|
async function buildExecutor(options, context) {
|
|
17
18
|
// Cast to any to overwrite NODE_ENV
|
|
@@ -34,9 +35,14 @@ async function buildExecutor(options, context) {
|
|
|
34
35
|
try {
|
|
35
36
|
await runCliBuild(devkit_1.workspaceRoot, projectRoot, options);
|
|
36
37
|
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
catch ({ error, code, signal }) {
|
|
39
|
+
if (code || signal) {
|
|
40
|
+
devkit_1.logger.error(`Build process exited due to ${code ? 'code ' + code : ''} ${code && signal ? 'and' : ''} ${signal ? 'signal ' + signal : ''}`);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
devkit_1.logger.error(`Error occurred while trying to run the build command`);
|
|
44
|
+
devkit_1.logger.error(error);
|
|
45
|
+
}
|
|
40
46
|
return { success: false };
|
|
41
47
|
}
|
|
42
48
|
finally {
|
|
@@ -85,21 +91,26 @@ function runCliBuild(workspaceRoot, projectRoot, options) {
|
|
|
85
91
|
return new Promise((resolve, reject) => {
|
|
86
92
|
childProcess = (0, child_process_1.fork)(require.resolve('next/dist/bin/next'), ['build', ...args], {
|
|
87
93
|
cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
|
|
88
|
-
stdio: 'inherit',
|
|
94
|
+
stdio: ['ignore', 'inherit', 'inherit', 'ipc'],
|
|
89
95
|
env: process.env,
|
|
90
96
|
});
|
|
91
97
|
// Ensure the child process is killed when the parent exits
|
|
92
98
|
process.on('exit', () => childProcess.kill());
|
|
93
|
-
process.on('SIGTERM', () =>
|
|
99
|
+
process.on('SIGTERM', (signal) => {
|
|
100
|
+
reject({ code: (0, exit_codes_1.signalToCode)(signal), signal });
|
|
101
|
+
});
|
|
102
|
+
process.on('SIGINT', (signal) => {
|
|
103
|
+
reject({ code: (0, exit_codes_1.signalToCode)(signal), signal });
|
|
104
|
+
});
|
|
94
105
|
childProcess.on('error', (err) => {
|
|
95
|
-
reject(err);
|
|
106
|
+
reject({ error: err });
|
|
96
107
|
});
|
|
97
|
-
childProcess.on('exit', (code) => {
|
|
108
|
+
childProcess.on('exit', (code, signal) => {
|
|
98
109
|
if (code === 0) {
|
|
99
|
-
resolve(code);
|
|
110
|
+
resolve({ code, signal });
|
|
100
111
|
}
|
|
101
112
|
else {
|
|
102
|
-
reject(code);
|
|
113
|
+
reject({ code, signal });
|
|
103
114
|
}
|
|
104
115
|
});
|
|
105
116
|
});
|
|
@@ -11,7 +11,7 @@ async function* serveExecutor(options, context) {
|
|
|
11
11
|
const buildOptions = (0, devkit_1.readTargetOptions)((0, devkit_1.parseTargetString)(options.buildTarget, context), context);
|
|
12
12
|
const projectRoot = context.workspace.projects[context.projectName].root;
|
|
13
13
|
// This is required for the default custom server to work. See the @nx/next:app generator.
|
|
14
|
-
const nextDir = (0, path_1.resolve)(context.root, buildOptions.outputPath);
|
|
14
|
+
const nextDir = !options.dev && (0, path_1.resolve)(context.root, buildOptions.outputPath);
|
|
15
15
|
process.env.NX_NEXT_DIR ??= options.dev ? projectRoot : nextDir;
|
|
16
16
|
if (options.customServerTarget) {
|
|
17
17
|
return yield* (0, custom_server_impl_1.default)(options, context);
|