@nx/next 23.0.0-beta.4 → 23.0.0-beta.6
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 +11 -11
- package/src/executors/build/build.impl.d.ts.map +1 -1
- package/src/executors/build/build.impl.js +1 -2
- package/src/executors/server/server.impl.d.ts.map +1 -1
- package/src/executors/server/server.impl.js +2 -2
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +2 -2
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-e2e.js +2 -2
- package/src/generators/application/lib/add-project.d.ts.map +1 -1
- package/src/generators/application/lib/add-project.js +2 -2
- package/src/generators/application/lib/normalize-options.js +3 -3
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +2 -2
- package/src/generators/convert-to-inferred/convert-to-inferred.js +4 -5
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +1 -1
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.js +6 -6
- package/src/generators/convert-to-inferred/lib/serve-post-target-tranformer.d.ts +1 -2
- package/src/generators/convert-to-inferred/lib/serve-post-target-tranformer.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/lib/update-next-config.d.ts +1 -1
- package/src/generators/convert-to-inferred/lib/update-next-config.d.ts.map +1 -1
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +2 -2
- package/src/generators/library/lib/normalize-options.js +3 -3
- package/src/generators/page/page.d.ts.map +1 -1
- package/src/generators/page/page.js +4 -4
- package/src/migrations/update-22-0-0/add-svgr-to-next-config.d.ts.map +1 -1
- package/src/migrations/update-22-0-0/add-svgr-to-next-config.js +2 -2
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +15 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/next",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.6",
|
|
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": {
|
|
@@ -36,25 +36,25 @@
|
|
|
36
36
|
"next": ">=14.0.0 <17.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@nx/devkit": "23.0.0-beta.
|
|
39
|
+
"@nx/devkit": "23.0.0-beta.6",
|
|
40
40
|
"@babel/plugin-proposal-decorators": "^7.22.7",
|
|
41
41
|
"@svgr/webpack": "^8.1.0",
|
|
42
42
|
"copy-webpack-plugin": "^14.0.0",
|
|
43
|
-
"ignore": "^
|
|
43
|
+
"ignore": "^7.0.5",
|
|
44
44
|
"semver": "^7.6.3",
|
|
45
45
|
"tslib": "^2.3.0",
|
|
46
46
|
"webpack-merge": "^5.8.0",
|
|
47
|
-
"@nx/js": "23.0.0-beta.
|
|
48
|
-
"@nx/eslint": "23.0.0-beta.
|
|
49
|
-
"@nx/react": "23.0.0-beta.
|
|
50
|
-
"@nx/web": "23.0.0-beta.
|
|
51
|
-
"@nx/webpack": "23.0.0-beta.
|
|
47
|
+
"@nx/js": "23.0.0-beta.6",
|
|
48
|
+
"@nx/eslint": "23.0.0-beta.6",
|
|
49
|
+
"@nx/react": "23.0.0-beta.6",
|
|
50
|
+
"@nx/web": "23.0.0-beta.6",
|
|
51
|
+
"@nx/webpack": "23.0.0-beta.6",
|
|
52
52
|
"@phenomnomnominal/tsquery": "~6.1.4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@nx/cypress": "23.0.0-beta.
|
|
56
|
-
"@nx/playwright": "23.0.0-beta.
|
|
57
|
-
"nx": "23.0.0-beta.
|
|
55
|
+
"@nx/cypress": "23.0.0-beta.6",
|
|
56
|
+
"@nx/playwright": "23.0.0-beta.6",
|
|
57
|
+
"nx": "23.0.0-beta.6"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/executors/build/build.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAKhB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"build.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/executors/build/build.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAKhB,MAAM,YAAY,CAAC;AAUpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAQ5D,wBAA8B,aAAa,CACzC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe;;GAoGzB"}
|
|
@@ -7,7 +7,6 @@ const path_1 = require("path");
|
|
|
7
7
|
const node_fs_1 = require("node:fs");
|
|
8
8
|
const promises_1 = require("node:fs/promises");
|
|
9
9
|
const semver_1 = require("semver");
|
|
10
|
-
const semver_2 = require("@nx/devkit/src/utils/semver");
|
|
11
10
|
const update_package_json_1 = require("./lib/update-package-json");
|
|
12
11
|
const create_next_config_file_1 = require("./lib/create-next-config-file");
|
|
13
12
|
const check_project_1 = require("./lib/check-project");
|
|
@@ -30,7 +29,7 @@ async function buildExecutor(options, context) {
|
|
|
30
29
|
const reactDomVersion = packageJson?.dependencies?.['react-dom'] ??
|
|
31
30
|
rootPackageJson.dependencies?.['react-dom'];
|
|
32
31
|
const hasReact18 = reactDomVersion &&
|
|
33
|
-
(0, semver_1.gte)((0,
|
|
32
|
+
(0, semver_1.gte)((0, internal_1.checkAndCleanWithSemver)('react-dom', reactDomVersion), '18.0.0');
|
|
34
33
|
if (hasReact18) {
|
|
35
34
|
process.env['__NEXT_REACT_ROOT'] ||= 'true';
|
|
36
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/executors/server/server.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/executors/server/server.impl.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAEL,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAO3B,wBAA+B,aAAa,CAC1C,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe;;;cAqHzB"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = serveExecutor;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const child_process_1 = require("child_process");
|
|
8
9
|
const custom_server_impl_1 = tslib_1.__importDefault(require("./custom-server.impl"));
|
|
9
10
|
const create_cli_options_1 = require("../../utils/create-cli-options");
|
|
10
|
-
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
11
11
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
12
12
|
const runtime_version_utils_1 = require("../../utils/runtime-version-utils");
|
|
13
13
|
async function* serveExecutor(options, context) {
|
|
@@ -64,7 +64,7 @@ async function* serveExecutor(options, context) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
const nextBin = require.resolve('next/dist/bin/next');
|
|
67
|
-
yield* (0,
|
|
67
|
+
yield* (0, internal_1.createAsyncIterable)(async ({ done, next, error }) => {
|
|
68
68
|
const server = (0, child_process_1.fork)(nextBin, [
|
|
69
69
|
mode,
|
|
70
70
|
...args,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/application/application.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/application/application.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AASpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAsBlC,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMpE;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAkH5E"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.applicationGenerator = applicationGenerator;
|
|
4
4
|
exports.applicationGeneratorInternal = applicationGeneratorInternal;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const js_1 = require("@nx/js");
|
|
7
8
|
const versions_1 = require("@nx/react/src/utils/versions");
|
|
@@ -18,7 +19,6 @@ const add_linting_1 = require("./lib/add-linting");
|
|
|
18
19
|
const custom_server_1 = require("../custom-server/custom-server");
|
|
19
20
|
const update_cypress_tsconfig_1 = require("./lib/update-cypress-tsconfig");
|
|
20
21
|
const versions_2 = require("../../utils/versions");
|
|
21
|
-
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
22
22
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
23
23
|
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
24
24
|
const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
|
|
@@ -103,7 +103,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
103
103
|
await (0, devkit_1.formatFiles)(host);
|
|
104
104
|
}
|
|
105
105
|
tasks.push(() => {
|
|
106
|
-
(0,
|
|
106
|
+
(0, internal_1.logShowProjectCommand)(options.projectName);
|
|
107
107
|
});
|
|
108
108
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
109
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,IAAI,EACJ,iBAAiB,EAElB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,wBAAsB,MAAM,CAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CA8H5B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addE2e = addE2e;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const e2e_web_server_info_utils_1 = require("@nx/devkit/src/generators/e2e-web-server-info-utils");
|
|
6
6
|
const web_1 = require("@nx/web");
|
|
7
7
|
const versions_1 = require("../../../utils/versions");
|
|
8
8
|
async function addE2e(host, options) {
|
|
@@ -111,7 +111,7 @@ async function getNextE2EWebServerInfo(tree, projectName, configFilePath, isPlug
|
|
|
111
111
|
nxJson.targetDefaults?.[defaultServeTarget].options?.port) {
|
|
112
112
|
e2ePort = nxJson.targetDefaults?.[defaultServeTarget].options?.port;
|
|
113
113
|
}
|
|
114
|
-
return (0,
|
|
114
|
+
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
115
115
|
plugin: '@nx/next/plugin',
|
|
116
116
|
serveTargetName: 'devTargetName',
|
|
117
117
|
serveStaticTargetName: 'startTargetName',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-project.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-project.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-project.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAKL,IAAI,EAEL,MAAM,YAAY,CAAC;AAMpB,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,QA2F/D"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addProject = addProject;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
|
7
7
|
const react_1 = require("@nx/react");
|
|
8
8
|
function addProject(host, options) {
|
|
@@ -14,7 +14,7 @@ function addProject(host, options) {
|
|
|
14
14
|
? p === '@nx/next/plugin'
|
|
15
15
|
: p.plugin === '@nx/next/plugin');
|
|
16
16
|
if (!hasPlugin) {
|
|
17
|
-
(0,
|
|
17
|
+
(0, internal_1.addBuildTargetDefaults)(host, '@nx/next:build');
|
|
18
18
|
targets.build = {
|
|
19
19
|
executor: '@nx/next:build',
|
|
20
20
|
outputs: ['{options.outputPath}'],
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const assertion_1 = require("@nx/react/src/utils/assertion");
|
|
7
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
8
8
|
async function normalizeOptions(host, options) {
|
|
9
|
-
await (0,
|
|
10
|
-
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0,
|
|
9
|
+
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
10
|
+
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
11
11
|
name: options.name,
|
|
12
12
|
projectType: 'application',
|
|
13
13
|
directory: options.directory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/component/component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/component/component.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIjD,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAMD,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDA0BnE;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.componentGenerator = componentGenerator;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
6
6
|
const react_1 = require("@nx/react");
|
|
7
7
|
const styles_1 = require("../../utils/styles");
|
|
8
8
|
/*
|
|
@@ -12,7 +12,7 @@ const styles_1 = require("../../utils/styles");
|
|
|
12
12
|
async function componentGenerator(host, options) {
|
|
13
13
|
// we only need to provide the path to get the project, we let the react
|
|
14
14
|
// generator handle the rest
|
|
15
|
-
const { project: projectName } = await (0,
|
|
15
|
+
const { project: projectName } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
16
16
|
path: options.path,
|
|
17
17
|
});
|
|
18
18
|
const componentInstall = await (0, react_1.componentGenerator)(host, {
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToInferred = convertToInferred;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
8
7
|
const build_post_target_transformer_1 = require("./lib/build-post-target-transformer");
|
|
9
8
|
const serve_post_target_tranformer_1 = require("./lib/serve-post-target-tranformer");
|
|
10
9
|
async function convertToInferred(tree, options) {
|
|
11
10
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
12
|
-
const migrationLogs = new
|
|
13
|
-
const migratedProjects = await (0,
|
|
11
|
+
const migrationLogs = new internal_1.AggregatedLog();
|
|
12
|
+
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/next/plugin', plugin_1.createNodesV2, {
|
|
14
13
|
buildTargetName: 'build',
|
|
15
14
|
devTargetName: 'dev',
|
|
16
15
|
startTargetName: 'start',
|
|
@@ -32,7 +31,7 @@ async function convertToInferred(tree, options) {
|
|
|
32
31
|
},
|
|
33
32
|
], options.project);
|
|
34
33
|
if (migratedProjects.size === 0) {
|
|
35
|
-
throw new
|
|
34
|
+
throw new internal_1.NoTargetsToMigrateError();
|
|
36
35
|
}
|
|
37
36
|
if (!options.skipFormat) {
|
|
38
37
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TargetConfiguration, Tree } from '@nx/devkit';
|
|
2
|
-
import { AggregatedLog } from '@nx/devkit/
|
|
2
|
+
import { AggregatedLog } from '@nx/devkit/internal';
|
|
3
3
|
import { NextBuildBuilderOptions } from '../../../utils/types';
|
|
4
4
|
export declare function buildPostTargetTransformer(migrationLogs: AggregatedLog): (target: TargetConfiguration<NextBuildBuilderOptions>, tree: Tree, projectDetails: {
|
|
5
5
|
projectName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/convert-to-inferred/lib/build-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"build-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/convert-to-inferred/lib/build-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EACL,aAAa,EAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,aAAa,IAEnE,QAAQ,mBAAmB,CAAC,uBAAuB,CAAC,EACpD,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,kDAgEnD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildPostTargetTransformer = buildPostTargetTransformer;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const update_next_config_1 = require("./update-next-config");
|
|
6
6
|
function buildPostTargetTransformer(migrationLogs) {
|
|
7
7
|
return (target, tree, projectDetails, inferredTargetConfiguration) => {
|
|
@@ -27,7 +27,7 @@ function buildPostTargetTransformer(migrationLogs) {
|
|
|
27
27
|
}
|
|
28
28
|
if (target.outputs) {
|
|
29
29
|
target.outputs = target.outputs.filter((out) => !out.includes('options.outputPath'));
|
|
30
|
-
(0,
|
|
30
|
+
(0, internal_1.processTargetOutputs)(target, [], inferredTargetConfiguration, {
|
|
31
31
|
projectName: projectDetails.projectName,
|
|
32
32
|
projectRoot: projectDetails.root,
|
|
33
33
|
});
|
|
@@ -61,8 +61,8 @@ function handlePropertiesFromTargetOptions(options, projectDetails, migrationLog
|
|
|
61
61
|
if ('fileReplacements' in options) {
|
|
62
62
|
configMap['fileReplacements'] = options.fileReplacements.map(({ replace: replacePath, with: withPath }) => {
|
|
63
63
|
return {
|
|
64
|
-
replace: (0,
|
|
65
|
-
with: (0,
|
|
64
|
+
replace: (0, internal_1.toProjectRelativePath)(replacePath, projectDetails.root),
|
|
65
|
+
with: (0, internal_1.toProjectRelativePath)(withPath, projectDetails.root),
|
|
66
66
|
};
|
|
67
67
|
});
|
|
68
68
|
delete options.fileReplacements;
|
|
@@ -74,8 +74,8 @@ function handlePropertiesFromTargetOptions(options, projectDetails, migrationLog
|
|
|
74
74
|
configMap['assets'] = options.assets.map((asset) => {
|
|
75
75
|
return {
|
|
76
76
|
...asset,
|
|
77
|
-
input: (0,
|
|
78
|
-
output: (0,
|
|
77
|
+
input: (0, internal_1.toProjectRelativePath)(asset.input, projectDetails.root),
|
|
78
|
+
output: (0, internal_1.toProjectRelativePath)(asset.output, projectDetails.root),
|
|
79
79
|
};
|
|
80
80
|
});
|
|
81
81
|
delete options.assets;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TargetConfiguration, Tree } from '@nx/devkit';
|
|
2
|
-
import { AggregatedLog } from '@nx/devkit/
|
|
2
|
+
import { AggregatedLog, type InferredTargetConfiguration } from '@nx/devkit/internal';
|
|
3
3
|
import type { NextServeBuilderOptions } from '../../../utils/types';
|
|
4
|
-
import type { InferredTargetConfiguration } from '@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator';
|
|
5
4
|
export declare function servePosTargetTransformer(migrationLogs: AggregatedLog): (target: TargetConfiguration<NextServeBuilderOptions>, _tree: Tree, projectDetails: {
|
|
6
5
|
projectName: string;
|
|
7
6
|
root: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-post-target-tranformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/convert-to-inferred/lib/serve-post-target-tranformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"serve-post-target-tranformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/convert-to-inferred/lib/serve-post-target-tranformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EACL,aAAa,EACb,KAAK,2BAA2B,EACjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,aAAa,IAElE,QAAQ,mBAAmB,CAAC,uBAAuB,CAAC,EACpD,OAAO,IAAI,EACX,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,2BAA2B,kDAoC3D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { AggregatedLog } from '@nx/devkit/
|
|
2
|
+
import { AggregatedLog } from '@nx/devkit/internal';
|
|
3
3
|
export declare function updateNextConfig(tree: Tree, updatedConfigFileContents: string, project: {
|
|
4
4
|
projectName: string;
|
|
5
5
|
root: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-next-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/convert-to-inferred/lib/update-next-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"update-next-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/convert-to-inferred/lib/update-next-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKpD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,EACV,yBAAyB,EAAE,MAAM,EACjC,OAAO,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC9C,aAAa,EAAE,aAAa,QA6G7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/init/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EAGV,MAAM,YAAY,CAAC;AAQpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAgC3C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,8BAE/D;AAED,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,8BA+CnB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -35,8 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.nextInitGenerator = nextInitGenerator;
|
|
37
37
|
exports.nextInitGeneratorInternal = nextInitGeneratorInternal;
|
|
38
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
38
39
|
const devkit_1 = require("@nx/devkit");
|
|
39
|
-
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
40
40
|
const version_utils_1 = require("@nx/react/src/utils/version-utils");
|
|
41
41
|
const add_gitignore_entry_1 = require("../../utils/add-gitignore-entry");
|
|
42
42
|
const versions_1 = require("../../utils/versions");
|
|
@@ -65,7 +65,7 @@ async function nextInitGeneratorInternal(host, schema) {
|
|
|
65
65
|
schema.addPlugin ??= addPluginDefault;
|
|
66
66
|
if (schema.addPlugin) {
|
|
67
67
|
const { createNodesV2 } = await Promise.resolve().then(() => __importStar(require('../../plugins/plugin')));
|
|
68
|
-
await (0,
|
|
68
|
+
await (0, internal_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/next/plugin', createNodesV2, {
|
|
69
69
|
startTargetName: ['start', 'next:start', 'next-start'],
|
|
70
70
|
buildTargetName: ['build', 'next:build', 'next-build'],
|
|
71
71
|
devTargetName: ['dev', 'next:dev', 'next-dev'],
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
|
-
await (0,
|
|
9
|
-
const { projectRoot, importPath } = await (0,
|
|
8
|
+
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
9
|
+
const { projectRoot, importPath } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
10
10
|
name: options.name,
|
|
11
11
|
projectType: 'library',
|
|
12
12
|
directory: options.directory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/page/page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/page/page.ts"],"names":[],"mappings":"AAKA,OAAO,EAKL,IAAI,EACL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mDAuB7D;AAuDD,eAAe,aAAa,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pageGenerator = pageGenerator;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const react_1 = require("@nx/react");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const styles_1 = require("../../utils/styles");
|
|
7
|
-
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
8
8
|
/*
|
|
9
9
|
* This schematic is basically the React component one, but for Next we need
|
|
10
10
|
* extra dependencies for css, sass, less style options, and make sure
|
|
@@ -33,7 +33,7 @@ async function pageGenerator(host, schema) {
|
|
|
33
33
|
}
|
|
34
34
|
async function normalizeOptions(host, options) {
|
|
35
35
|
// Get the project name first so we can determine the router directory
|
|
36
|
-
const { project: determinedProjectName } = await (0,
|
|
36
|
+
const { project: determinedProjectName } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
37
37
|
name: options.name,
|
|
38
38
|
path: options.path,
|
|
39
39
|
});
|
|
@@ -50,7 +50,7 @@ async function normalizeOptions(host, options) {
|
|
|
50
50
|
else {
|
|
51
51
|
// the user must have cd into a previously created directory, we need to
|
|
52
52
|
// resolve the cwd to get it
|
|
53
|
-
const cwd = (0,
|
|
53
|
+
const cwd = (0, internal_1.getRelativeCwd)();
|
|
54
54
|
if (cwd !== '.' && cwd !== '') {
|
|
55
55
|
pageSymbolName = cwd.split('/').pop();
|
|
56
56
|
}
|
|
@@ -62,7 +62,7 @@ async function normalizeOptions(host, options) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
const fileName = options.fileName || (isAppRouter ? 'page' : 'index');
|
|
65
|
-
const { project: projectName, filePath } = await (0,
|
|
65
|
+
const { project: projectName, filePath } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
66
66
|
name: pageSymbolName,
|
|
67
67
|
path: (0, devkit_1.joinPathFragments)(options.path, `${fileName}.${options.js ? 'jsx' : 'tsx'}`),
|
|
68
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-svgr-to-next-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-22-0-0/add-svgr-to-next-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-svgr-to-next-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-22-0-0/add-svgr-to-next-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,IAAI,EAMV,MAAM,YAAY,CAAC;AAIpB,wBAA8B,mBAAmB,CAAC,IAAI,EAAE,IAAI,iBAyQ3D"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = addSvgrToNextConfig;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
7
7
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
8
8
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
9
9
|
async function addSvgrToNextConfig(tree) {
|
|
10
10
|
const projects = new Map();
|
|
11
11
|
// Find all Next.js projects using withNx that have svgr explicitly set to true or an options object
|
|
12
|
-
(0,
|
|
12
|
+
(0, internal_1.forEachExecutorOptions)(tree, '@nx/next:build', (options, project, target) => {
|
|
13
13
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
14
14
|
const nextConfigPath = `${projectConfig.root}/next.config.js`;
|
|
15
15
|
if (!tree.exists(nextConfigPath))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/next/src/plugins/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/next/src/plugins/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAKd,MAAM,YAAY,CAAC;AASpB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAMD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,iBAAiB,CA+BxD,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = exports.createNodes = exports.createDependencies = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
6
|
-
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
7
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
8
6
|
const js_1 = require("@nx/js");
|
|
9
7
|
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
10
8
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
@@ -13,16 +11,6 @@ const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
|
13
11
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
14
12
|
const path_1 = require("path");
|
|
15
13
|
const nextConfigBlob = '**/next.config.{ts,js,cjs,mjs}';
|
|
16
|
-
function readTargetsCache(cachePath) {
|
|
17
|
-
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
18
|
-
}
|
|
19
|
-
function writeTargetsToCache(cachePath, targetsCache) {
|
|
20
|
-
const oldCache = readTargetsCache(cachePath);
|
|
21
|
-
(0, devkit_1.writeJsonFile)(cachePath, {
|
|
22
|
-
...oldCache,
|
|
23
|
-
...targetsCache,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
14
|
/**
|
|
27
15
|
* @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
|
|
28
16
|
*/
|
|
@@ -35,19 +23,21 @@ exports.createNodes = [
|
|
|
35
23
|
async (configFiles, options, context) => {
|
|
36
24
|
const optionsHash = (0, devkit_internals_1.hashObject)(options);
|
|
37
25
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `next-${optionsHash}.json`);
|
|
38
|
-
const targetsCache =
|
|
26
|
+
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
39
27
|
const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
|
|
40
|
-
const
|
|
28
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
29
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
30
|
+
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
41
31
|
try {
|
|
42
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup, pmc), configFiles, options, context);
|
|
32
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup, pmc, lockFileName), configFiles, options, context);
|
|
43
33
|
}
|
|
44
34
|
finally {
|
|
45
|
-
|
|
35
|
+
targetsCache.writeToDisk();
|
|
46
36
|
}
|
|
47
37
|
},
|
|
48
38
|
];
|
|
49
39
|
exports.createNodesV2 = exports.createNodes;
|
|
50
|
-
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc) {
|
|
40
|
+
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc, lockFileName) {
|
|
51
41
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
52
42
|
// Do not create a project if package.json and project.json isn't there.
|
|
53
43
|
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
@@ -56,20 +46,22 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
56
46
|
return {};
|
|
57
47
|
}
|
|
58
48
|
options = normalizeOptions(options);
|
|
59
|
-
const hash = await (0,
|
|
60
|
-
targetsCache
|
|
49
|
+
const hash = await (0, internal_1.calculateHashForCreateNodes)(projectRoot, options, context, [lockFileName]);
|
|
50
|
+
if (!targetsCache.has(hash)) {
|
|
51
|
+
targetsCache.set(hash, await buildNextTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc));
|
|
52
|
+
}
|
|
61
53
|
return {
|
|
62
54
|
projects: {
|
|
63
55
|
[projectRoot]: {
|
|
64
56
|
root: projectRoot,
|
|
65
|
-
targets: targetsCache
|
|
57
|
+
targets: targetsCache.get(hash),
|
|
66
58
|
},
|
|
67
59
|
},
|
|
68
60
|
};
|
|
69
61
|
}
|
|
70
62
|
async function buildNextTargets(nextConfigPath, projectRoot, options, context, isTsSolutionSetup, pmc) {
|
|
71
63
|
const nextConfig = await getNextConfig(nextConfigPath, context);
|
|
72
|
-
const namedInputs = (0,
|
|
64
|
+
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
73
65
|
const targets = {};
|
|
74
66
|
targets[options.buildTargetName] = await getBuildTargetConfig(namedInputs, projectRoot, nextConfig, isTsSolutionSetup);
|
|
75
67
|
targets[options.devTargetName] = getDevTargetConfig(projectRoot, isTsSolutionSetup);
|
|
@@ -147,7 +139,7 @@ async function getOutputs(projectRoot, nextConfig) {
|
|
|
147
139
|
}
|
|
148
140
|
function getNextConfig(configFilePath, context) {
|
|
149
141
|
const resolvedPath = (0, path_1.join)(context.workspaceRoot, configFilePath);
|
|
150
|
-
return (0,
|
|
142
|
+
return (0, internal_1.loadConfigFile)(resolvedPath);
|
|
151
143
|
}
|
|
152
144
|
function normalizeOptions(options) {
|
|
153
145
|
options ??= {};
|