@nx/next 23.0.0-beta.22 → 23.0.0-beta.24
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 +9 -0
- package/package.json +10 -10
- package/plugins/component-testing.d.ts.map +1 -1
- package/plugins/component-testing.js +16 -10
- package/plugins/with-nx.d.ts.map +1 -1
- package/plugins/with-nx.js +7 -0
- 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 +3 -1
- package/src/generators/application/files/common/next.config.js__tmpl__ +12 -1
- package/src/generators/application/lib/add-linting.d.ts.map +1 -1
- package/src/generators/application/lib/add-linting.js +1 -1
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +2 -0
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.js +2 -0
- package/src/generators/custom-server/custom-server.d.ts.map +1 -1
- package/src/generators/custom-server/custom-server.js +2 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +3 -1
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +3 -1
- package/src/generators/init/schema.json +1 -1
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +3 -1
- package/src/generators/page/page.d.ts.map +1 -1
- package/src/generators/page/page.js +2 -0
- package/src/migrations/update-22-2-0/ai-instructions-for-next-16.md +845 -0
- package/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +10 -0
- package/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +134 -0
- package/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
- package/src/plugins/plugin.d.ts +3 -3
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +4 -2
- package/src/utils/add-swc-to-custom-server.js +1 -1
- package/src/utils/assert-supported-next-version.d.ts +3 -0
- package/src/utils/assert-supported-next-version.d.ts.map +1 -0
- package/src/utils/assert-supported-next-version.js +8 -0
- package/src/utils/compose-plugins.d.ts.map +1 -1
- package/src/utils/compose-plugins.js +2 -0
- package/src/utils/deprecation.d.ts +7 -0
- package/src/utils/deprecation.d.ts.map +1 -1
- package/src/utils/deprecation.js +36 -1
- package/src/utils/styles.d.ts.map +1 -1
- package/src/utils/styles.js +1 -1
- package/src/utils/versions.d.ts +5 -4
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +6 -5
package/migrations.json
CHANGED
|
@@ -14,11 +14,20 @@
|
|
|
14
14
|
},
|
|
15
15
|
"description": "Create AI Instructions to help migrate users workspaces to Next.js 16.",
|
|
16
16
|
"prompt": "./src/migrations/update-22-2-0/ai-instructions-for-next-16.md"
|
|
17
|
+
},
|
|
18
|
+
"update-23-0-0-migrate-create-nodes-v2-import": {
|
|
19
|
+
"version": "23.0.0-beta.24",
|
|
20
|
+
"description": "Rename imports of `createNodesV2` from `@nx/next/plugin` to the canonical `createNodes` export.",
|
|
21
|
+
"implementation": "./src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes",
|
|
22
|
+
"documentation": "./src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md"
|
|
17
23
|
}
|
|
18
24
|
},
|
|
19
25
|
"packageJsonUpdates": {
|
|
20
26
|
"20.7.1-beta.0": {
|
|
21
27
|
"version": "20.7.1-beta.0",
|
|
28
|
+
"requires": {
|
|
29
|
+
"next": "^15.0.0"
|
|
30
|
+
},
|
|
22
31
|
"packages": {
|
|
23
32
|
"eslint-config-next": {
|
|
24
33
|
"version": "^15.2.4",
|
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.24",
|
|
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,7 +36,7 @@
|
|
|
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.24",
|
|
40
40
|
"@babel/plugin-proposal-decorators": "^7.22.7",
|
|
41
41
|
"@svgr/webpack": "^8.0.1",
|
|
42
42
|
"copy-webpack-plugin": "^14.0.0",
|
|
@@ -44,17 +44,17 @@
|
|
|
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.24",
|
|
48
|
+
"@nx/eslint": "23.0.0-beta.24",
|
|
49
|
+
"@nx/react": "23.0.0-beta.24",
|
|
50
|
+
"@nx/web": "23.0.0-beta.24",
|
|
51
|
+
"@nx/webpack": "23.0.0-beta.24",
|
|
52
52
|
"@phenomnomnominal/tsquery": "~6.2.0"
|
|
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.24",
|
|
56
|
+
"@nx/playwright": "23.0.0-beta.24",
|
|
57
|
+
"nx": "23.0.0-beta.24"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-testing.d.ts","sourceRoot":"","sources":["../../../../packages/next/plugins/component-testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EAC1B,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"component-testing.d.ts","sourceRoot":"","sources":["../../../../packages/next/plugins/component-testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EAC1B,MAAM,oCAAoC,CAAC;AA6B5C,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,yBAAyB,OA6IpC"}
|
|
@@ -6,7 +6,9 @@ const internal_1 = require("@nx/cypress/internal");
|
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const react_1 = require("@nx/react");
|
|
9
|
+
const deprecation_1 = require("@nx/react/src/utils/deprecation");
|
|
9
10
|
const webpack_1 = require("@nx/webpack");
|
|
11
|
+
const internal_3 = require("@nx/webpack/internal");
|
|
10
12
|
const configuration_1 = require("nx/src/config/configuration");
|
|
11
13
|
const path_1 = require("path");
|
|
12
14
|
function nxComponentTestingPreset(pathToConfig, options) {
|
|
@@ -79,16 +81,20 @@ Able to find CT project, ${!!ctProjectConfig}.`);
|
|
|
79
81
|
compiler: options?.compiler || 'swc',
|
|
80
82
|
tsConfig: (0, path_1.join)(ctExecutorContext.root, ctProjectConfig.root, 'tsconfig.json'),
|
|
81
83
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
// Nx composes these helpers internally for the Cypress CT preset; suppress
|
|
85
|
+
// their deprecation warning so it fires only for user-authored configs.
|
|
86
|
+
const webpackConfig = (0, internal_3.suppressWebpackComposeHelperWarnings)(() => (0, deprecation_1.suppressReactComposeHelperWarnings)(() => {
|
|
87
|
+
const configure = (0, webpack_1.composePluginsSync)((0, webpack_1.withNx)({
|
|
88
|
+
target: 'web',
|
|
89
|
+
styles: [],
|
|
90
|
+
scripts: [],
|
|
91
|
+
postcssConfig: ctProjectConfig.root,
|
|
92
|
+
}), (0, react_1.withReact)({}));
|
|
93
|
+
return configure({}, {
|
|
94
|
+
options: webpackOptions,
|
|
95
|
+
context: ctExecutorContext,
|
|
96
|
+
});
|
|
97
|
+
}));
|
|
92
98
|
return {
|
|
93
99
|
...(0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig),
|
|
94
100
|
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
|
package/plugins/with-nx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-nx.d.ts","sourceRoot":"","sources":["../../../../packages/next/plugins/with-nx.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAGL,KAAK,uBAAuB,EAE7B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,EAAE,CAAC,EAAE;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,gBAAgB,CAAC,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACvD,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AA+ED;;GAEG;AACH,iBAAS,MAAM,CACb,WAAW,GAAS,aAAa,EACjC,OAAO,GAAE,aAAkC,GAC1C,YAAY,
|
|
1
|
+
{"version":3,"file":"with-nx.d.ts","sourceRoot":"","sources":["../../../../packages/next/plugins/with-nx.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAGL,KAAK,uBAAuB,EAE7B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,EAAE,CAAC,EAAE;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,gBAAgB,CAAC,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACvD,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AA+ED;;GAEG;AACH,iBAAS,MAAM,CACb,WAAW,GAAS,aAAa,EACjC,OAAO,GAAE,aAAkC,GAC1C,YAAY,CA4Hd;AAED,wBAAgB,aAAa,CAC3B,UAAU,GAAS,aAAa,EAChC,OAAO,GAAE,aAAkC,GAC1C,UAAU,CAiIZ;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,uBAAuB,EAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAC9B,IAAI,GAAG,MAAM,CAcf;AAGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,IAAI,QAM3D;AASD,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/plugins/with-nx.js
CHANGED
|
@@ -113,6 +113,13 @@ function withNx(_nextConfig = {}, context = getWithNxContext()) {
|
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
115
|
const { readCachedProjectGraph, joinPathFragments, offsetFromRoot, workspaceRoot, } = require('@nx/devkit');
|
|
116
|
+
// Resolved from the workspace (not bundled) so the deprecation warning is
|
|
117
|
+
// not inlined into production builds. Reached only on the active Nx-task
|
|
118
|
+
// path; the production-server phase returns above.
|
|
119
|
+
const { warnWithNxDeprecation } = require(require.resolve('@nx/next/src/utils/deprecation', {
|
|
120
|
+
paths: [workspaceRoot],
|
|
121
|
+
}));
|
|
122
|
+
warnWithNxDeprecation();
|
|
116
123
|
// Since this is invoked by an Nx task, the graph is already cached.
|
|
117
124
|
const graph = readCachedProjectGraph();
|
|
118
125
|
const originalTarget = {
|
|
@@ -8,7 +8,7 @@ const path_1 = require("path");
|
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
const custom_server_impl_1 = tslib_1.__importDefault(require("./custom-server.impl"));
|
|
10
10
|
const create_cli_options_1 = require("../../utils/create-cli-options");
|
|
11
|
-
const
|
|
11
|
+
const internal_2 = require("@nx/web/internal");
|
|
12
12
|
const runtime_version_utils_1 = require("../../utils/runtime-version-utils");
|
|
13
13
|
const deprecation_1 = require("../../utils/deprecation");
|
|
14
14
|
async function* serveExecutor(options, context) {
|
|
@@ -93,7 +93,7 @@ async function* serveExecutor(options, context) {
|
|
|
93
93
|
process.on('SIGINT', () => killServer());
|
|
94
94
|
process.on('SIGTERM', () => killServer());
|
|
95
95
|
process.on('SIGHUP', () => killServer());
|
|
96
|
-
await (0,
|
|
96
|
+
await (0, internal_2.waitForPortOpen)(options.port, { host: options.hostname });
|
|
97
97
|
next({
|
|
98
98
|
success: true,
|
|
99
99
|
baseUrl: `http://${options.hostname ?? 'localhost'}:${options.port}`,
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAUpB,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,8BAsH5E"}
|
|
@@ -4,6 +4,7 @@ exports.applicationGenerator = applicationGenerator;
|
|
|
4
4
|
exports.applicationGeneratorInternal = applicationGeneratorInternal;
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
7
8
|
const js_1 = require("@nx/js");
|
|
8
9
|
const versions_1 = require("@nx/react/src/utils/versions");
|
|
9
10
|
const version_utils_1 = require("@nx/react/src/utils/version-utils");
|
|
@@ -30,6 +31,7 @@ async function applicationGenerator(host, schema) {
|
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
async function applicationGeneratorInternal(host, schema) {
|
|
34
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
33
35
|
const tasks = [];
|
|
34
36
|
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
|
|
35
37
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
@@ -88,7 +90,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
88
90
|
devDependencies['@testing-library/react'] = versions_1.testingLibraryReactVersion;
|
|
89
91
|
devDependencies['@testing-library/dom'] = versions_1.testingLibraryDomVersion;
|
|
90
92
|
}
|
|
91
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_2.tsLibVersion }, devDependencies));
|
|
93
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_2.tsLibVersion }, devDependencies, undefined, true));
|
|
92
94
|
}
|
|
93
95
|
(0, internal_2.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.json', {
|
|
94
96
|
jsx: 'preserve',
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
//@ts-check
|
|
2
|
+
<% if (addPlugin) { -%>
|
|
3
|
+
|
|
4
|
+
/** @type {import('next').NextConfig} */
|
|
5
|
+
const nextConfig = {
|
|
6
|
+
// Next.js options go here
|
|
7
|
+
// See: https://nextjs.org/docs/app/api-reference/config/next-config-js
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
module.exports = nextConfig;
|
|
11
|
+
<% } else { -%>
|
|
2
12
|
|
|
3
13
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
4
14
|
const { composePlugins, withNx } = require('@nx/next');
|
|
@@ -8,7 +18,7 @@ const { composePlugins, withNx } = require('@nx/next');
|
|
|
8
18
|
**/
|
|
9
19
|
const nextConfig = {
|
|
10
20
|
// Use this to set Nx-specific options
|
|
11
|
-
// See: https://nx.dev/
|
|
21
|
+
// See: https://nx.dev/docs/technologies/react/next/Guides/next-config-setup
|
|
12
22
|
nx: {},
|
|
13
23
|
};
|
|
14
24
|
|
|
@@ -18,3 +28,4 @@ const plugins = [
|
|
|
18
28
|
];
|
|
19
29
|
|
|
20
30
|
module.exports = composePlugins(...plugins)(nextConfig);
|
|
31
|
+
<% } -%>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-linting.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAgBvD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-linting.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAgBvD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAwG5B"}
|
|
@@ -73,7 +73,7 @@ async function addLinting(host, options) {
|
|
|
73
73
|
...lint_1.extraEslintDependencies.devDependencies,
|
|
74
74
|
'eslint-config-next': eslintConfigNextVersion,
|
|
75
75
|
'@next/eslint-plugin-next': eslintConfigNextVersion,
|
|
76
|
-
}));
|
|
76
|
+
}, undefined, true));
|
|
77
77
|
}
|
|
78
78
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
79
79
|
}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAKjD,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,mDA2BnE;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -5,11 +5,13 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const react_1 = require("@nx/react");
|
|
7
7
|
const styles_1 = require("../../utils/styles");
|
|
8
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
8
9
|
/*
|
|
9
10
|
* This schematic is basically the React one, but for Next we need
|
|
10
11
|
* extra dependencies for css, sass, less style options.
|
|
11
12
|
*/
|
|
12
13
|
async function componentGenerator(host, options) {
|
|
14
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
13
15
|
// we only need to provide the path to get the project, we let the react
|
|
14
16
|
// generator handle the rest
|
|
15
17
|
const { project: projectName } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,IAAI,EAAE,MAAM,YAAY,CAAC;AAWxE,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBA8ClE;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -6,7 +6,9 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
7
7
|
const build_post_target_transformer_1 = require("./lib/build-post-target-transformer");
|
|
8
8
|
const serve_post_target_tranformer_1 = require("./lib/serve-post-target-tranformer");
|
|
9
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
9
10
|
async function convertToInferred(tree, options) {
|
|
11
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(tree);
|
|
10
12
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
11
13
|
const migrationLogs = new internal_1.AggregatedLog();
|
|
12
14
|
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/next/plugin', plugin_1.createNodesV2, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-server.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/custom-server/custom-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,YAAY,CAAC;AAYrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"custom-server.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/custom-server/custom-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,YAAY,CAAC;AAYrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAM9C,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,kBAAkB,uBAiJ5B"}
|
|
@@ -7,7 +7,9 @@ const devkit_2 = require("@nx/devkit");
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
|
|
9
9
|
const internal_2 = require("@nx/js/internal");
|
|
10
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
10
11
|
async function customServerGenerator(host, options) {
|
|
12
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
11
13
|
const project = (0, devkit_2.readProjectConfiguration)(host, options.project);
|
|
12
14
|
const swcServerName = '.server.swcrc';
|
|
13
15
|
const nxJson = (0, devkit_2.readNxJson)(host);
|
package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress-component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/cypress-component-configuration/cypress-component-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAKjB,IAAI,EAGL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cypress-component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/cypress-component-configuration/cypress-component-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAKjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAE,4CAA4C,EAAE,MAAM,UAAU,CAAC;AAExE,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4CAA4C,8BAMtD;AAED,wBAAsB,qCAAqC,CACzD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4CAA4C,8BAqDtD;AA0FD,eAAe,6BAA6B,CAAC"}
|
|
@@ -41,6 +41,7 @@ const react_1 = require("@nx/react");
|
|
|
41
41
|
const ct_utils_1 = require("@nx/react/src/utils/ct-utils");
|
|
42
42
|
const path_1 = require("path");
|
|
43
43
|
const versions_1 = require("../../utils/versions");
|
|
44
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
44
45
|
function cypressComponentConfiguration(tree, options) {
|
|
45
46
|
return cypressComponentConfigurationInternal(tree, {
|
|
46
47
|
addPlugin: false,
|
|
@@ -48,6 +49,7 @@ function cypressComponentConfiguration(tree, options) {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
async function cypressComponentConfigurationInternal(tree, options) {
|
|
52
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(tree);
|
|
51
53
|
const tasks = [];
|
|
52
54
|
const { componentConfigurationGenerator: baseCyCtConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
53
55
|
tasks.push(await baseCyCtConfig(tree, {
|
|
@@ -62,7 +64,7 @@ async function cypressComponentConfigurationInternal(tree, options) {
|
|
|
62
64
|
skipFormat: true,
|
|
63
65
|
addPlugin: options.addPlugin,
|
|
64
66
|
}));
|
|
65
|
-
const { ensureDependencies } = await Promise.resolve().then(() => __importStar(require('@nx/webpack/
|
|
67
|
+
const { ensureDependencies } = await Promise.resolve().then(() => __importStar(require('@nx/webpack/internal')));
|
|
66
68
|
tasks.push(ensureDependencies(tree, { compiler: 'swc', uiFramework: 'react' }));
|
|
67
69
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
68
70
|
if (projectConfig.targets?.['component-test']?.executor ===
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AASpB,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,8BAiDnB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -41,6 +41,7 @@ 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");
|
|
43
43
|
const version_utils_2 = require("../../utils/version-utils");
|
|
44
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
44
45
|
async function updateDependencies(host, schema) {
|
|
45
46
|
const tasks = [];
|
|
46
47
|
tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nx/next'], []));
|
|
@@ -52,13 +53,14 @@ async function updateDependencies(host, schema) {
|
|
|
52
53
|
'react-dom': reactVersions['react-dom'],
|
|
53
54
|
}, {
|
|
54
55
|
'@nx/next': versions_1.nxVersion,
|
|
55
|
-
}, undefined, schema.keepExistingVersions));
|
|
56
|
+
}, undefined, schema.keepExistingVersions ?? true));
|
|
56
57
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
57
58
|
}
|
|
58
59
|
function nextInitGenerator(tree, schema) {
|
|
59
60
|
return nextInitGeneratorInternal(tree, { addPlugin: false, ...schema });
|
|
60
61
|
}
|
|
61
62
|
async function nextInitGeneratorInternal(host, schema) {
|
|
63
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
62
64
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
63
65
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
64
66
|
nxJson.useInferencePlugins !== false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAGjB,IAAI,EAEL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAGjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAUpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAYlC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,8BAMpE;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,8BAwL5E;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -7,6 +7,7 @@ const library_1 = require("@nx/react/src/generators/library/library");
|
|
|
7
7
|
const js_1 = require("@nx/js");
|
|
8
8
|
const versions_1 = require("@nx/react/src/utils/versions");
|
|
9
9
|
const init_1 = require("../init/init");
|
|
10
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
10
11
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
11
12
|
const update_vite_config_1 = require("./lib/update-vite-config");
|
|
12
13
|
const versions_2 = require("../../utils/versions");
|
|
@@ -19,6 +20,7 @@ async function libraryGenerator(host, rawOptions) {
|
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
async function libraryGeneratorInternal(host, rawOptions) {
|
|
23
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
22
24
|
const tasks = [];
|
|
23
25
|
const addTsPlugin = (0, internal_1.shouldConfigureTsSolutionSetup)(host, rawOptions.addPlugin);
|
|
24
26
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
@@ -49,7 +51,7 @@ async function libraryGeneratorInternal(host, rawOptions) {
|
|
|
49
51
|
devDependencies['@testing-library/react'] = versions_1.testingLibraryReactVersion;
|
|
50
52
|
devDependencies['@testing-library/dom'] = versions_1.testingLibraryDomVersion;
|
|
51
53
|
}
|
|
52
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_2.tsLibVersion }, devDependencies));
|
|
54
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_2.tsLibVersion }, devDependencies, undefined, true));
|
|
53
55
|
}
|
|
54
56
|
const indexPath = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src', `index.${options.js ? 'js' : 'ts'}`);
|
|
55
57
|
const indexContent = host.read(indexPath, 'utf-8');
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAIpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mDAwB7D;AAwDD,eAAe,aAAa,CAAC"}
|
|
@@ -5,12 +5,14 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
5
5
|
const react_1 = require("@nx/react");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const styles_1 = require("../../utils/styles");
|
|
8
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
8
9
|
/*
|
|
9
10
|
* This schematic is basically the React component one, but for Next we need
|
|
10
11
|
* extra dependencies for css, sass, less style options, and make sure
|
|
11
12
|
* it is under `pages` folder.
|
|
12
13
|
*/
|
|
13
14
|
async function pageGenerator(host, schema) {
|
|
15
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
14
16
|
const options = await normalizeOptions(host, schema);
|
|
15
17
|
const componentTask = await (0, react_1.componentGenerator)(host, {
|
|
16
18
|
...options,
|