@nx/next 16.8.0-beta.1 → 16.8.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 +9 -10
- package/src/executors/build/build.impl.d.ts +0 -1
- package/src/executors/build/build.impl.js +0 -1
- package/src/executors/export/export.impl.d.ts +0 -1
- package/src/executors/export/export.impl.js +0 -1
- package/src/executors/server/custom-server.impl.d.ts +0 -1
- package/src/executors/server/custom-server.impl.js +0 -1
- package/src/executors/server/server.impl.d.ts +0 -1
- package/src/executors/server/server.impl.js +0 -1
- package/src/generators/application/lib/add-linting.js +33 -40
- package/src/generators/application/lib/normalize-options.js +2 -14
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.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": {
|
|
@@ -35,17 +35,16 @@
|
|
|
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.2",
|
|
39
|
+
"@nx/devkit": "16.8.0-beta.2",
|
|
40
|
+
"@nx/js": "16.8.0-beta.2",
|
|
41
|
+
"@nx/linter": "16.8.0-beta.2",
|
|
42
|
+
"@nx/react": "16.8.0-beta.2",
|
|
43
|
+
"@nx/web": "16.8.0-beta.2",
|
|
44
|
+
"@nx/workspace": "16.8.0-beta.2",
|
|
45
45
|
"@svgr/webpack": "^8.0.1",
|
|
46
46
|
"chalk": "^4.1.0",
|
|
47
47
|
"copy-webpack-plugin": "^10.2.4",
|
|
48
|
-
"dotenv": "~16.3.1",
|
|
49
48
|
"fs-extra": "^11.1.0",
|
|
50
49
|
"ignore": "^5.0.4",
|
|
51
50
|
"semver": "7.5.3",
|
|
@@ -57,5 +56,5 @@
|
|
|
57
56
|
"access": "public"
|
|
58
57
|
},
|
|
59
58
|
"type": "commonjs",
|
|
60
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "9bcc04742f9e1516d8c1ddbfb1907770c347876f"
|
|
61
60
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
require("dotenv/config");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const export_1 = require("next/dist/export");
|
|
7
6
|
const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
require("dotenv/config");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const path_1 = require("path");
|
|
7
6
|
const child_process_1 = require("child_process");
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const linter_1 = require("@nx/linter");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const lint_1 = require("@nx/react/src/utils/lint");
|
|
8
|
+
const eslint_file_1 = require("@nx/linter/src/generators/utils/eslint-file");
|
|
8
9
|
function addLinting(host, options) {
|
|
9
10
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
11
|
const lintTask = yield (0, linter_1.lintProjectGenerator)(host, {
|
|
@@ -18,46 +19,38 @@ function addLinting(host, options) {
|
|
|
18
19
|
skipFormat: true,
|
|
19
20
|
rootProject: options.rootProject,
|
|
20
21
|
});
|
|
21
|
-
if (options.linter === linter_1.Linter.EsLint) {
|
|
22
|
-
(0,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
json.extends = json.extends.filter((name) => name !== 'plugin:@nx/react' && name !== 'plugin:@nrwl/nx/react');
|
|
54
|
-
json.extends.unshift('plugin:@nx/react-typescript');
|
|
55
|
-
if (!json.env) {
|
|
56
|
-
json.env = {};
|
|
57
|
-
}
|
|
58
|
-
json.env.jest = true;
|
|
59
|
-
return json;
|
|
60
|
-
});
|
|
22
|
+
if (options.linter === linter_1.Linter.EsLint && (0, eslint_file_1.isEslintConfigSupported)(host)) {
|
|
23
|
+
(0, eslint_file_1.addExtendsToLintConfig)(host, options.appProjectRoot, [
|
|
24
|
+
'plugin:@nx/react-typescript',
|
|
25
|
+
'next',
|
|
26
|
+
'next/core-web-vitals',
|
|
27
|
+
]);
|
|
28
|
+
// Turn off @next/next/no-html-link-for-pages since there is an issue with nextjs throwing linting errors
|
|
29
|
+
// TODO(nicholas): remove after Vercel updates nextjs linter to only lint ["*.ts", "*.tsx", "*.js", "*.jsx"]
|
|
30
|
+
(0, eslint_file_1.addOverrideToLintConfig)(host, options.appProjectRoot, {
|
|
31
|
+
files: ['*.*'],
|
|
32
|
+
rules: {
|
|
33
|
+
'@next/next/no-html-link-for-pages': 'off',
|
|
34
|
+
},
|
|
35
|
+
}, { insertAtTheEnd: false });
|
|
36
|
+
(0, eslint_file_1.updateOverrideInLintConfig)(host, options.appProjectRoot, (o) => Array.isArray(o.files) &&
|
|
37
|
+
o.files.some((f) => f.match(/\*\.ts$/)) &&
|
|
38
|
+
o.files.some((f) => f.match(/\*\.tsx$/)) &&
|
|
39
|
+
o.files.some((f) => f.match(/\*\.js$/)) &&
|
|
40
|
+
o.files.some((f) => f.match(/\*\.jsx$/)), (o) => (Object.assign(Object.assign({}, o), { rules: Object.assign(Object.assign({}, o.rules), { '@next/next/no-html-link-for-pages': [
|
|
41
|
+
'error',
|
|
42
|
+
`${options.appProjectRoot}/pages`,
|
|
43
|
+
] }) })));
|
|
44
|
+
// add jest specific config
|
|
45
|
+
if (options.unitTestRunner === 'jest') {
|
|
46
|
+
(0, eslint_file_1.addOverrideToLintConfig)(host, options.appProjectRoot, {
|
|
47
|
+
files: ['*.spec.ts', '*.spec.tsx', '*.spec.js', '*.spec.jsx'],
|
|
48
|
+
env: {
|
|
49
|
+
jest: true,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
(0, eslint_file_1.addIgnoresToLintConfig)(host, options.appProjectRoot, ['.next/**/*']);
|
|
61
54
|
}
|
|
62
55
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
63
56
|
return (0, devkit_1.runTasksInSerial)(lintTask, installTask);
|
|
@@ -19,20 +19,8 @@ function normalizeOptions(host, options) {
|
|
|
19
19
|
});
|
|
20
20
|
options.rootProject = appProjectRoot === '.';
|
|
21
21
|
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (!options.rootProject) {
|
|
25
|
-
const projectNameAndRoot = yield (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
26
|
-
name: `${options.name}-e2e`,
|
|
27
|
-
projectType: 'application',
|
|
28
|
-
directory: options.directory,
|
|
29
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
30
|
-
rootProject: options.rootProject,
|
|
31
|
-
callingGenerator: '@nx/next:application',
|
|
32
|
-
});
|
|
33
|
-
e2eProjectName = projectNameAndRoot.projectName;
|
|
34
|
-
e2eProjectRoot = projectNameAndRoot.projectRoot;
|
|
35
|
-
}
|
|
22
|
+
const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
23
|
+
const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
36
24
|
const name = (0, devkit_1.names)(options.name).fileName;
|
|
37
25
|
const outputPath = (0, devkit_1.joinPathFragments)('dist', appProjectRoot, ...(options.rootProject ? [name] : []));
|
|
38
26
|
const parsedTags = options.tags
|