@nx/next 23.0.0-rc.3 → 23.0.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.
|
@@ -107,9 +107,9 @@ async function getNextE2EWebServerInfo(tree, projectName, configFilePath, isPlug
|
|
|
107
107
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
108
108
|
let e2ePort = isPluginBeingAdded ? 3000 : 4200;
|
|
109
109
|
const defaultServeTarget = isPluginBeingAdded ? 'dev' : 'serve';
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
e2ePort =
|
|
110
|
+
if (nxJson.targetDefaults?.[defaultServeTarget] &&
|
|
111
|
+
nxJson.targetDefaults?.[defaultServeTarget].options?.port) {
|
|
112
|
+
e2ePort = nxJson.targetDefaults?.[defaultServeTarget].options?.port;
|
|
113
113
|
}
|
|
114
114
|
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
115
115
|
plugin: '@nx/next/plugin',
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.customServerGenerator = customServerGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const internal_1 = require("@nx/devkit/internal");
|
|
6
5
|
const devkit_2 = require("@nx/devkit");
|
|
7
6
|
const path_1 = require("path");
|
|
8
7
|
const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
|
|
9
|
-
const
|
|
8
|
+
const internal_1 = require("@nx/js/internal");
|
|
10
9
|
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
11
10
|
async function customServerGenerator(host, options) {
|
|
12
11
|
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
@@ -42,7 +41,7 @@ async function customServerGenerator(host, options) {
|
|
|
42
41
|
? `../../${(0, devkit_2.offsetFromRoot)(project.root)}${project.root}`
|
|
43
42
|
: `${(0, devkit_2.offsetFromRoot)(`dist/${project.root}`)}${project.root}`;
|
|
44
43
|
const offset = (0, devkit_2.offsetFromRoot)(project.root);
|
|
45
|
-
const isTsSolution = (0,
|
|
44
|
+
const isTsSolution = (0, internal_1.isUsingTsSolutionSetup)(host);
|
|
46
45
|
(0, devkit_2.generateFiles)(host, (0, path_1.join)(__dirname, 'files'), project.root, {
|
|
47
46
|
...options,
|
|
48
47
|
hasPlugin,
|
|
@@ -104,14 +103,11 @@ async function customServerGenerator(host, options) {
|
|
|
104
103
|
json.tasksRunnerOptions?.default?.options?.cacheableOperations) {
|
|
105
104
|
json.tasksRunnerOptions.default.options.cacheableOperations.push('build-custom-server');
|
|
106
105
|
}
|
|
106
|
+
json.targetDefaults ??= {};
|
|
107
|
+
json.targetDefaults['build-custom-server'] ??= {};
|
|
108
|
+
json.targetDefaults['build-custom-server'].cache ??= true;
|
|
107
109
|
return json;
|
|
108
110
|
});
|
|
109
|
-
const updatedNxJson = (0, devkit_2.readNxJson)(host) ?? {};
|
|
110
|
-
(0, internal_1.upsertTargetDefault)(host, updatedNxJson, {
|
|
111
|
-
target: 'build-custom-server',
|
|
112
|
-
cache: true,
|
|
113
|
-
});
|
|
114
|
-
(0, devkit_2.updateNxJson)(host, updatedNxJson);
|
|
115
111
|
if (options.compiler === 'swc') {
|
|
116
112
|
// Update app swc to exlude server files
|
|
117
113
|
(0, devkit_2.updateJson)(host, (0, path_1.join)(project.root, '.swcrc'), (json) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/next",
|
|
3
|
-
"version": "23.0.0
|
|
3
|
+
"version": "23.0.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": {
|
|
@@ -78,17 +78,17 @@
|
|
|
78
78
|
"tslib": "^2.3.0",
|
|
79
79
|
"webpack-merge": "^5.8.0",
|
|
80
80
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
81
|
-
"@nx/devkit": "23.0.0
|
|
82
|
-
"@nx/js": "23.0.0
|
|
83
|
-
"@nx/eslint": "23.0.0
|
|
84
|
-
"@nx/react": "23.0.0
|
|
85
|
-
"@nx/web": "23.0.0
|
|
86
|
-
"@nx/webpack": "23.0.0
|
|
81
|
+
"@nx/devkit": "23.0.0",
|
|
82
|
+
"@nx/js": "23.0.0",
|
|
83
|
+
"@nx/eslint": "23.0.0",
|
|
84
|
+
"@nx/react": "23.0.0",
|
|
85
|
+
"@nx/web": "23.0.0",
|
|
86
|
+
"@nx/webpack": "23.0.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@nx/cypress": "23.0.0
|
|
90
|
-
"@nx/playwright": "23.0.0
|
|
91
|
-
"nx": "23.0.0
|
|
89
|
+
"@nx/cypress": "23.0.0",
|
|
90
|
+
"@nx/playwright": "23.0.0",
|
|
91
|
+
"nx": "23.0.0"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|