@nx/next 17.2.5 → 17.3.0-beta.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/migrations.json +6 -0
- package/package.json +8 -8
- package/src/executors/server/schema.json +4 -0
- package/src/executors/server/server.impl.js +2 -1
- package/src/generators/application/lib/add-linting.js +0 -8
- package/src/generators/page/page.js +18 -2
- package/src/generators/page/schema.d.ts +1 -1
- package/src/migrations/update-17-2-7/remove-eslint-rules-patch.d.ts +2 -0
- package/src/migrations/update-17-2-7/remove-eslint-rules-patch.js +13 -0
- package/src/utils/types.d.ts +1 -0
package/migrations.json
CHANGED
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
"version": "16.4.0-beta.3",
|
|
24
24
|
"description": "Update package.json moving @nx/next from dependency to devDependency",
|
|
25
25
|
"implementation": "./src/migrations/update-16-4-0/update-nx-next-dependency"
|
|
26
|
+
},
|
|
27
|
+
"update-17-2-7": {
|
|
28
|
+
"cli": "nx",
|
|
29
|
+
"version": "17.2.7",
|
|
30
|
+
"description": "Remove patched eslint rule for @next/next/no-html-link-for-pages",
|
|
31
|
+
"implementation": "./src/migrations/update-17-2-7/remove-eslint-rules-patch"
|
|
26
32
|
}
|
|
27
33
|
},
|
|
28
34
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/next",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.3.0-beta.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": ">=13.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nx/devkit": "
|
|
37
|
+
"@nx/devkit": "17.3.0-beta.1",
|
|
38
38
|
"@babel/plugin-proposal-decorators": "^7.22.7",
|
|
39
39
|
"@svgr/webpack": "^8.0.1",
|
|
40
40
|
"chalk": "^4.1.0",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"url-loader": "^4.1.1",
|
|
46
46
|
"tslib": "^2.3.0",
|
|
47
47
|
"webpack-merge": "^5.8.0",
|
|
48
|
-
"@nx/js": "
|
|
49
|
-
"@nx/eslint": "
|
|
50
|
-
"@nx/react": "
|
|
51
|
-
"@nx/web": "
|
|
52
|
-
"@nx/workspace": "
|
|
53
|
-
"@nrwl/next": "
|
|
48
|
+
"@nx/js": "17.3.0-beta.1",
|
|
49
|
+
"@nx/eslint": "17.3.0-beta.1",
|
|
50
|
+
"@nx/react": "17.3.0-beta.1",
|
|
51
|
+
"@nx/web": "17.3.0-beta.1",
|
|
52
|
+
"@nx/workspace": "17.3.0-beta.1",
|
|
53
|
+
"@nrwl/next": "17.3.0-beta.1"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
"turbo": {
|
|
53
53
|
"type": "boolean",
|
|
54
54
|
"description": "Activate the incremental bundler for Next.js, which is implemented in Rust. Please note, this feature is exclusively available in development mode."
|
|
55
|
+
},
|
|
56
|
+
"experimentalHttps": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"description": "Enable HTTPS support for the Next.js development server."
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
61
|
"required": ["buildTarget"],
|
|
@@ -32,9 +32,10 @@ async function* serveExecutor(options, context) {
|
|
|
32
32
|
const nextDir = (0, path_1.resolve)(context.root, buildOptions.outputPath);
|
|
33
33
|
const mode = options.dev ? 'dev' : 'start';
|
|
34
34
|
const turbo = options.turbo && options.dev ? '--turbo' : '';
|
|
35
|
+
const experimentalHttps = options.experimentalHttps && options.dev ? '--experimental-https' : '';
|
|
35
36
|
const nextBin = require.resolve('next/dist/bin/next');
|
|
36
37
|
yield* (0, async_iterable_1.createAsyncIterable)(async ({ done, next, error }) => {
|
|
37
|
-
const server = (0, child_process_1.fork)(nextBin, [mode, ...args, turbo], {
|
|
38
|
+
const server = (0, child_process_1.fork)(nextBin, [mode, ...args, turbo, experimentalHttps], {
|
|
38
39
|
cwd: options.dev ? projectRoot : nextDir,
|
|
39
40
|
stdio: 'inherit',
|
|
40
41
|
});
|
|
@@ -23,14 +23,6 @@ async function addLinting(host, options) {
|
|
|
23
23
|
'next',
|
|
24
24
|
'next/core-web-vitals',
|
|
25
25
|
]);
|
|
26
|
-
// Turn off @next/next/no-html-link-for-pages since there is an issue with nextjs throwing linting errors
|
|
27
|
-
// TODO(nicholas): remove after Vercel updates nextjs linter to only lint ["*.ts", "*.tsx", "*.js", "*.jsx"]
|
|
28
|
-
(0, eslint_file_1.addOverrideToLintConfig)(host, options.appProjectRoot, {
|
|
29
|
-
files: ['*.*'],
|
|
30
|
-
rules: {
|
|
31
|
-
'@next/next/no-html-link-for-pages': 'off',
|
|
32
|
-
},
|
|
33
|
-
}, { insertAtTheEnd: false });
|
|
34
26
|
(0, eslint_file_1.updateOverrideInLintConfig)(host, options.appProjectRoot, (o) => Array.isArray(o.files) &&
|
|
35
27
|
o.files.some((f) => f.match(/\*\.ts$/)) &&
|
|
36
28
|
o.files.some((f) => f.match(/\*\.tsx$/)) &&
|
|
@@ -43,18 +43,34 @@ exports.pageGeneratorInternal = pageGeneratorInternal;
|
|
|
43
43
|
async function normalizeOptions(host, options) {
|
|
44
44
|
let isAppRouter;
|
|
45
45
|
let derivedDirectory;
|
|
46
|
+
let routerDirectory;
|
|
46
47
|
if (options.project) {
|
|
47
48
|
// Legacy behavior, detect app vs page router from specified project.
|
|
48
49
|
// TODO(v18): remove this logic
|
|
49
50
|
const project = (0, devkit_1.readProjectConfiguration)(host, options.project);
|
|
50
51
|
// app/ is a reserved folder in nextjs so it is safe to check it's existence
|
|
51
|
-
isAppRouter =
|
|
52
|
-
|
|
52
|
+
isAppRouter =
|
|
53
|
+
host.exists(`${project.root}/app`) ||
|
|
54
|
+
host.exists(`${project.root}/src/app`);
|
|
55
|
+
routerDirectory = isAppRouter ? 'app' : 'pages';
|
|
53
56
|
derivedDirectory = options.directory
|
|
54
57
|
? `${routerDirectory}/${options.directory}`
|
|
55
58
|
: `${routerDirectory}`;
|
|
56
59
|
}
|
|
57
60
|
else {
|
|
61
|
+
// Get the project name first so we can determine the router directory
|
|
62
|
+
const { project: determinedProjectName } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
63
|
+
artifactType: 'page',
|
|
64
|
+
callingGenerator: '@nx/next:page',
|
|
65
|
+
name: options.name,
|
|
66
|
+
directory: options.directory,
|
|
67
|
+
});
|
|
68
|
+
const project = (0, devkit_1.readProjectConfiguration)(host, determinedProjectName);
|
|
69
|
+
// app/ is a reserved folder in nextjs so it is safe to check it's existence
|
|
70
|
+
isAppRouter =
|
|
71
|
+
host.exists(`${project.root}/app`) ||
|
|
72
|
+
host.exists(`${project.root}/src/app`);
|
|
73
|
+
routerDirectory = isAppRouter ? 'app' : 'pages';
|
|
58
74
|
// New behavior, use directory as is without detecting whether we're using app or pages router.
|
|
59
75
|
derivedDirectory = options.directory;
|
|
60
76
|
}
|
|
@@ -5,7 +5,7 @@ export interface Schema {
|
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v18.
|
|
7
7
|
*/
|
|
8
|
-
project
|
|
8
|
+
project?: string;
|
|
9
9
|
style: SupportedStyles;
|
|
10
10
|
directory?: string;
|
|
11
11
|
fileName?: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
|
|
5
|
+
async function update(tree) {
|
|
6
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
7
|
+
projects.forEach((project) => {
|
|
8
|
+
(0, eslint_file_1.updateOverrideInLintConfig)(tree, project.root, (o) => o.rules?.['@next/next/no-html-link-for-pages'] &&
|
|
9
|
+
o.files?.includes('**/*.*'), (o) => undefined);
|
|
10
|
+
});
|
|
11
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
12
|
+
}
|
|
13
|
+
exports.default = update;
|
package/src/utils/types.d.ts
CHANGED