@nx/next 16.8.0-beta.2 → 16.8.0-beta.4
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.8.0-beta.
|
|
3
|
+
"version": "16.8.0-beta.4",
|
|
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.22.7",
|
|
38
|
-
"@nrwl/next": "16.8.0-beta.
|
|
39
|
-
"@nx/devkit": "16.8.0-beta.
|
|
40
|
-
"@nx/js": "16.8.0-beta.
|
|
41
|
-
"@nx/linter": "16.8.0-beta.
|
|
42
|
-
"@nx/react": "16.8.0-beta.
|
|
43
|
-
"@nx/web": "16.8.0-beta.
|
|
44
|
-
"@nx/workspace": "16.8.0-beta.
|
|
38
|
+
"@nrwl/next": "16.8.0-beta.4",
|
|
39
|
+
"@nx/devkit": "16.8.0-beta.4",
|
|
40
|
+
"@nx/js": "16.8.0-beta.4",
|
|
41
|
+
"@nx/linter": "16.8.0-beta.4",
|
|
42
|
+
"@nx/react": "16.8.0-beta.4",
|
|
43
|
+
"@nx/web": "16.8.0-beta.4",
|
|
44
|
+
"@nx/workspace": "16.8.0-beta.4",
|
|
45
45
|
"@svgr/webpack": "^8.0.1",
|
|
46
46
|
"chalk": "^4.1.0",
|
|
47
47
|
"copy-webpack-plugin": "^10.2.4",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"type": "commonjs",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "c9aad2dc8c2b34531cf61549bff872e68c481e4e"
|
|
60
60
|
}
|
package/plugins/with-nx.js
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withNx = exports.forNextVersion = exports.getAliasForProject = exports.getNextConfig = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const baseNXEnvironmentVariables = [
|
|
6
|
+
'NX_BASE',
|
|
7
|
+
'NX_CACHE_DIRECTORY',
|
|
8
|
+
'NX_CACHE_PROJECT_GRAPH',
|
|
9
|
+
'NX_DAEMON',
|
|
10
|
+
'NX_DEFAULT_PROJECT',
|
|
11
|
+
'NX_HEAD',
|
|
12
|
+
'NX_PERF_LOGGING',
|
|
13
|
+
'NX_PROFILE',
|
|
14
|
+
'NX_PROJECT_GRAPH_CACHE_DIRECTORY',
|
|
15
|
+
'NX_PROJECT_GRAPH_MAX_WORKERS',
|
|
16
|
+
'NX_RUNNER',
|
|
17
|
+
'NX_SKIP_NX_CACHE',
|
|
18
|
+
'NX_TASKS_RUNNER',
|
|
19
|
+
'NX_TASKS_RUNNER_DYNAMIC_OUTPUT',
|
|
20
|
+
'NX_VERBOSE_LOGGING',
|
|
21
|
+
'NX_DRY_RUN',
|
|
22
|
+
'NX_INTERACTIVE',
|
|
23
|
+
'NX_GENERATE_QUIET',
|
|
24
|
+
'NX_PREFER_TS_NODE',
|
|
25
|
+
'NX_TASK_TARGET_PROJECT',
|
|
26
|
+
'NX_TASK_TARGET_TARGET',
|
|
27
|
+
'NX_TASK_TARGET_CONFIGURATION',
|
|
28
|
+
'NX_CLI_SET',
|
|
29
|
+
'NX_LOAD_DOT_ENV_FILES',
|
|
30
|
+
'NX_WORKSPACE_ROOT',
|
|
31
|
+
'NX_TASK_HASH',
|
|
32
|
+
'NX_NEXT_DIR',
|
|
33
|
+
];
|
|
5
34
|
function regexEqual(x, y) {
|
|
6
35
|
return (x instanceof RegExp &&
|
|
7
36
|
y instanceof RegExp &&
|
|
@@ -244,6 +273,9 @@ function getNextConfig(nextConfig = {}, context = getWithNxContext()) {
|
|
|
244
273
|
} });
|
|
245
274
|
}
|
|
246
275
|
exports.getNextConfig = getNextConfig;
|
|
276
|
+
function getNonBaseVariables(oldEnv) {
|
|
277
|
+
return Object.keys(oldEnv).filter((env) => !baseNXEnvironmentVariables.includes(env));
|
|
278
|
+
}
|
|
247
279
|
function getNxEnvironmentVariables() {
|
|
248
280
|
return Object.keys(process.env)
|
|
249
281
|
.filter((env) => /^NX_/i.test(env))
|
|
@@ -252,6 +284,10 @@ function getNxEnvironmentVariables() {
|
|
|
252
284
|
return env;
|
|
253
285
|
}, {});
|
|
254
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
* TODO(v18)
|
|
289
|
+
* @deprecated Use Next.js 9.4+ built-in support for environment variables. Reference https://nextjs.org/docs/pages/api-reference/next-config-js/env
|
|
290
|
+
*/
|
|
255
291
|
function addNxEnvVariables(config) {
|
|
256
292
|
var _a;
|
|
257
293
|
const maybeDefinePlugin = (_a = config.plugins) === null || _a === void 0 ? void 0 : _a.find((plugin) => {
|
|
@@ -264,6 +300,10 @@ function addNxEnvVariables(config) {
|
|
|
264
300
|
.map(([name, value]) => [`process.env.${name}`, `"${value}"`])
|
|
265
301
|
.filter(([name]) => !maybeDefinePlugin.definitions[name])
|
|
266
302
|
.forEach(([name, value]) => (maybeDefinePlugin.definitions[name] = value));
|
|
303
|
+
const vars = getNonBaseVariables(env);
|
|
304
|
+
if (vars.length > 0) {
|
|
305
|
+
console.warn(`Warning, in Nx 18 environment variables starting with NX_ will not be available in the browser, and currently will not work with @nx/next:server executor.\nPlease rename the following environment variables: ${vars.join(', ')} using Next.js' built-in support for environment variables. Reference https://nextjs.org/docs/pages/api-reference/next-config-js/env`);
|
|
306
|
+
}
|
|
267
307
|
}
|
|
268
308
|
}
|
|
269
309
|
function getAliasForProject(node, paths) {
|
|
@@ -62,8 +62,9 @@ function buildExecutor(options, context) {
|
|
|
62
62
|
(0, update_package_json_1.updatePackageJson)(builtPackageJson, context);
|
|
63
63
|
(0, devkit_1.writeJsonFile)(`${options.outputPath}/package.json`, builtPackageJson);
|
|
64
64
|
if (options.generateLockfile) {
|
|
65
|
-
const
|
|
66
|
-
(0,
|
|
65
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.root);
|
|
66
|
+
const lockFile = (0, js_1.createLockFile)(builtPackageJson, context.projectGraph, packageManager);
|
|
67
|
+
(0, fs_extra_1.writeFileSync)(`${options.outputPath}/${(0, js_1.getLockFileName)(packageManager)}`, lockFile, {
|
|
67
68
|
encoding: 'utf-8',
|
|
68
69
|
});
|
|
69
70
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.customServerSchematic = exports.customServerGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const path_1 = require("path");
|
|
6
7
|
function customServerGenerator(host, options) {
|
|
7
8
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
8
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -26,7 +27,7 @@ function customServerGenerator(host, options) {
|
|
|
26
27
|
devkit_1.logger.warn(`Project ${options.project} has custom server targets already: build-custom-server, serve-custom-server. Remove these targets from project and try again.`);
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
|
-
(0, devkit_1.generateFiles)(host, (0,
|
|
30
|
+
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, 'files'), project.root, Object.assign(Object.assign({}, options), { offsetFromRoot: (0, devkit_1.offsetFromRoot)(project.root), projectRoot: project.root, tmpl: '' }));
|
|
30
31
|
project.targets.build.dependsOn = ['build-custom-server'];
|
|
31
32
|
project.targets.serve.options.customServerTarget = `${options.project}:serve-custom-server`;
|
|
32
33
|
project.targets.serve.configurations.development.customServerTarget = `${options.project}:serve-custom-server:development`;
|