@nx/next 19.0.0-beta.0 → 19.0.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": "19.0.0-beta.
|
|
3
|
+
"version": "19.0.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, 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": "19.0.0-beta.
|
|
37
|
+
"@nx/devkit": "19.0.0-beta.2",
|
|
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
|
"semver": "^7.5.3",
|
|
46
46
|
"tslib": "^2.3.0",
|
|
47
47
|
"webpack-merge": "^5.8.0",
|
|
48
|
-
"@nx/js": "19.0.0-beta.
|
|
49
|
-
"@nx/eslint": "19.0.0-beta.
|
|
50
|
-
"@nx/react": "19.0.0-beta.
|
|
51
|
-
"@nx/web": "19.0.0-beta.
|
|
52
|
-
"@nx/webpack": "19.0.0-beta.
|
|
53
|
-
"@nx/workspace": "19.0.0-beta.
|
|
54
|
-
"@nrwl/next": "19.0.0-beta.
|
|
48
|
+
"@nx/js": "19.0.0-beta.2",
|
|
49
|
+
"@nx/eslint": "19.0.0-beta.2",
|
|
50
|
+
"@nx/react": "19.0.0-beta.2",
|
|
51
|
+
"@nx/web": "19.0.0-beta.2",
|
|
52
|
+
"@nx/webpack": "19.0.0-beta.2",
|
|
53
|
+
"@nx/workspace": "19.0.0-beta.2",
|
|
54
|
+
"@nrwl/next": "19.0.0-beta.2"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
@@ -19,7 +19,8 @@ exports.default = serveExecutor;
|
|
|
19
19
|
async function* runCustomServer(root, options, context) {
|
|
20
20
|
process.env.NX_NEXT_DIR ??= root;
|
|
21
21
|
process.env.NX_NEXT_PUBLIC_DIR = (0, path_1.join)(root, 'public');
|
|
22
|
-
const
|
|
22
|
+
const httpProtocol = options.customServerHttps ? 'https' : 'http';
|
|
23
|
+
const baseUrl = `${httpProtocol}://${options.hostname || 'localhost'}:${options.port}`;
|
|
23
24
|
const customServerBuild = await (0, devkit_1.runExecutor)((0, devkit_1.parseTargetString)(options.customServerTarget, context), {
|
|
24
25
|
watch: options.dev ? true : false,
|
|
25
26
|
}, context);
|
|
@@ -56,6 +56,10 @@
|
|
|
56
56
|
"experimentalHttps": {
|
|
57
57
|
"type": "boolean",
|
|
58
58
|
"description": "Enable HTTPS support for the Next.js development server."
|
|
59
|
+
},
|
|
60
|
+
"customServerHttps:": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"description": "Enable HTTPS support for the custom server."
|
|
59
63
|
}
|
|
60
64
|
},
|
|
61
65
|
"required": ["buildTarget"],
|
package/src/plugins/plugin.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { CreateDependencies, CreateNodes } from '@nx/devkit';
|
|
3
2
|
export interface NextPluginOptions {
|
|
4
3
|
buildTargetName?: string;
|
|
@@ -8,4 +7,3 @@ export interface NextPluginOptions {
|
|
|
8
7
|
}
|
|
9
8
|
export declare const createDependencies: CreateDependencies;
|
|
10
9
|
export declare const createNodes: CreateNodes<NextPluginOptions>;
|
|
11
|
-
export declare function loadEsmModule<T>(modulePath: string | URL): Promise<T>;
|
package/src/plugins/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createNodes = exports.createDependencies = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
@@ -8,6 +8,7 @@ const fs_1 = require("fs");
|
|
|
8
8
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
9
9
|
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
10
10
|
const js_1 = require("@nx/js");
|
|
11
|
+
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
11
12
|
const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'next.hash');
|
|
12
13
|
const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
|
|
13
14
|
const calculatedTargets = {};
|
|
@@ -127,16 +128,9 @@ async function getOutputs(projectRoot, nextConfig) {
|
|
|
127
128
|
return `{workspaceRoot}/${projectRoot}/${dir}`;
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
|
-
|
|
131
|
+
function getNextConfig(configFilePath, context) {
|
|
131
132
|
const resolvedPath = (0, path_1.join)(context.workspaceRoot, configFilePath);
|
|
132
|
-
|
|
133
|
-
if ((0, path_1.extname)(configFilePath) === '.mjs') {
|
|
134
|
-
module = await loadEsmModule(resolvedPath);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
module = load(resolvedPath);
|
|
138
|
-
}
|
|
139
|
-
return module.default ?? module;
|
|
133
|
+
return (0, config_utils_1.loadConfigFile)(resolvedPath);
|
|
140
134
|
}
|
|
141
135
|
function normalizeOptions(options) {
|
|
142
136
|
options ??= {};
|
|
@@ -156,29 +150,3 @@ function getInputs(namedInputs) {
|
|
|
156
150
|
},
|
|
157
151
|
];
|
|
158
152
|
}
|
|
159
|
-
const packageInstallationDirectories = ['node_modules', '.yarn'];
|
|
160
|
-
/**
|
|
161
|
-
* Load the module after ensuring that the require cache is cleared.
|
|
162
|
-
*/
|
|
163
|
-
function load(path) {
|
|
164
|
-
// Clear cache if the path is in the cache
|
|
165
|
-
if (require.cache[path]) {
|
|
166
|
-
for (const key of Object.keys(require.cache)) {
|
|
167
|
-
if (!packageInstallationDirectories.some((dir) => key.includes(dir))) {
|
|
168
|
-
delete require.cache[key];
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
// Then require
|
|
173
|
-
return require(path);
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Lazily compiled dynamic import loader function.
|
|
177
|
-
*/
|
|
178
|
-
let dynamicLoad;
|
|
179
|
-
function loadEsmModule(modulePath) {
|
|
180
|
-
const modulePathWithCacheBust = `${modulePath}?version=${Date.now()}`;
|
|
181
|
-
dynamicLoad ??= new Function('modulePath', `return import(modulePath);`);
|
|
182
|
-
return dynamicLoad(modulePathWithCacheBust);
|
|
183
|
-
}
|
|
184
|
-
exports.loadEsmModule = loadEsmModule;
|
package/src/utils/types.d.ts
CHANGED