@nx/next 23.0.0-beta.11 → 23.0.0-beta.13
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 +10 -10
- package/plugins/component-testing.js +2 -2
- package/src/generators/application/application.js +5 -6
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-e2e.js +3 -3
- package/src/generators/application/lib/create-application-files.js +3 -3
- package/src/generators/application/lib/normalize-options.js +2 -2
- package/src/generators/custom-server/custom-server.d.ts.map +1 -1
- package/src/generators/custom-server/custom-server.js +9 -5
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +2 -2
- package/src/generators/library/lib/normalize-options.js +2 -2
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +7 -8
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +3 -4
- package/src/utils/add-swc-to-custom-server.d.ts.map +1 -1
- package/src/utils/add-swc-to-custom-server.js +6 -7
- package/tailwind.js +4 -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.13",
|
|
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.13",
|
|
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.13",
|
|
48
|
+
"@nx/eslint": "23.0.0-beta.13",
|
|
49
|
+
"@nx/react": "23.0.0-beta.13",
|
|
50
|
+
"@nx/web": "23.0.0-beta.13",
|
|
51
|
+
"@nx/webpack": "23.0.0-beta.13",
|
|
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.13",
|
|
56
|
+
"@nx/playwright": "23.0.0-beta.13",
|
|
57
|
+
"nx": "23.0.0-beta.13"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
@@ -4,7 +4,7 @@ exports.nxComponentTestingPreset = nxComponentTestingPreset;
|
|
|
4
4
|
const cypress_preset_1 = require("@nx/cypress/plugins/cypress-preset");
|
|
5
5
|
const ct_helpers_1 = require("@nx/cypress/src/utils/ct-helpers");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
const react_1 = require("@nx/react");
|
|
9
9
|
const webpack_1 = require("@nx/webpack");
|
|
10
10
|
const configuration_1 = require("nx/src/config/configuration");
|
|
@@ -69,7 +69,7 @@ Able to find CT project, ${!!ctProjectConfig}.`);
|
|
|
69
69
|
const webpackOptions = {
|
|
70
70
|
root: ctExecutorContext.root,
|
|
71
71
|
projectRoot: ctProjectConfig.root,
|
|
72
|
-
sourceRoot: (0,
|
|
72
|
+
sourceRoot: (0, internal_1.getProjectSourceRoot)(ctProjectConfig),
|
|
73
73
|
main: '',
|
|
74
74
|
useTsconfigPaths: undefined,
|
|
75
75
|
fileReplacements: buildFileReplacements,
|
|
@@ -19,8 +19,7 @@ const add_linting_1 = require("./lib/add-linting");
|
|
|
19
19
|
const custom_server_1 = require("../custom-server/custom-server");
|
|
20
20
|
const update_cypress_tsconfig_1 = require("./lib/update-cypress-tsconfig");
|
|
21
21
|
const versions_2 = require("../../utils/versions");
|
|
22
|
-
const
|
|
23
|
-
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
22
|
+
const internal_2 = require("@nx/js/internal");
|
|
24
23
|
const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
|
|
25
24
|
const jest_config_util_1 = require("../../utils/jest-config-util");
|
|
26
25
|
async function applicationGenerator(host, schema) {
|
|
@@ -32,7 +31,7 @@ async function applicationGenerator(host, schema) {
|
|
|
32
31
|
}
|
|
33
32
|
async function applicationGeneratorInternal(host, schema) {
|
|
34
33
|
const tasks = [];
|
|
35
|
-
const addTsPlugin = (0,
|
|
34
|
+
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
|
|
36
35
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
37
36
|
js: schema.js,
|
|
38
37
|
skipPackageJson: schema.skipPackageJson,
|
|
@@ -53,7 +52,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
53
52
|
// If we are using the new TS solution
|
|
54
53
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
55
54
|
if (options.isTsSolutionSetup) {
|
|
56
|
-
await (0,
|
|
55
|
+
await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
|
|
57
56
|
}
|
|
58
57
|
const lintTask = await (0, add_linting_1.addLinting)(host, options);
|
|
59
58
|
tasks.push(lintTask);
|
|
@@ -91,14 +90,14 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
91
90
|
}
|
|
92
91
|
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_2.tsLibVersion }, devDependencies));
|
|
93
92
|
}
|
|
94
|
-
(0,
|
|
93
|
+
(0, internal_2.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.json', {
|
|
95
94
|
jsx: 'preserve',
|
|
96
95
|
module: 'esnext',
|
|
97
96
|
moduleResolution: 'bundler',
|
|
98
97
|
}, options.linter === 'eslint'
|
|
99
98
|
? ['.next', 'eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
100
99
|
: ['.next'], options.src ? 'src' : '.');
|
|
101
|
-
(0,
|
|
100
|
+
(0, internal_2.sortPackageJsonFields)(host, options.appProjectRoot);
|
|
102
101
|
if (!options.skipFormat) {
|
|
103
102
|
await (0, devkit_1.formatFiles)(host);
|
|
104
103
|
}
|
|
@@ -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":"AAIA,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"}
|
|
@@ -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
|
+
const serveTargetOptions = (0, internal_1.readTargetDefaultsForTarget)(defaultServeTarget, nxJson.targetDefaults)?.options;
|
|
111
|
+
if (serveTargetOptions?.port) {
|
|
112
|
+
e2ePort = serveTargetOptions.port;
|
|
113
113
|
}
|
|
114
114
|
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
115
115
|
plugin: '@nx/next/plugin',
|
|
@@ -5,13 +5,13 @@ const path_1 = require("path");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
const create_application_files_helpers_1 = require("./create-application-files.helpers");
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@nx/js/internal");
|
|
9
9
|
const version_utils_1 = require("../../../utils/version-utils");
|
|
10
10
|
async function createApplicationFiles(host, options) {
|
|
11
11
|
const offsetFromRoot = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
|
|
12
12
|
const layoutTypeSrcPath = (0, devkit_1.joinPathFragments)(offsetFromRoot, options.appProjectRoot, '.next/types/**/*.ts');
|
|
13
13
|
const layoutTypeDistPath = (0, devkit_1.joinPathFragments)(offsetFromRoot, options.outputPath, '.next/types/**/*.ts');
|
|
14
|
-
const rootPath = options.rootProject || (0,
|
|
14
|
+
const rootPath = options.rootProject || (0, internal_1.isUsingTsSolutionSetup)(host)
|
|
15
15
|
? options.src
|
|
16
16
|
? 'src/'
|
|
17
17
|
: options.appDir
|
|
@@ -33,7 +33,7 @@ async function createApplicationFiles(host, options) {
|
|
|
33
33
|
styleContent: (0, create_application_files_helpers_1.createStyleRules)(),
|
|
34
34
|
pageStyleContent: `.page {}`,
|
|
35
35
|
stylesExt: 'css',
|
|
36
|
-
isUsingTsSolutionSetup: (0,
|
|
36
|
+
isUsingTsSolutionSetup: (0, internal_1.isUsingTsSolutionSetup)(host),
|
|
37
37
|
isNext16: await (0, version_utils_1.isNext16)(host),
|
|
38
38
|
};
|
|
39
39
|
const generatedAppFilePath = options.src
|
|
@@ -4,7 +4,7 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const assertion_1 = require("@nx/react/src/utils/assertion");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
async function normalizeOptions(host, options) {
|
|
9
9
|
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
10
10
|
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
@@ -18,7 +18,7 @@ async function normalizeOptions(host, options) {
|
|
|
18
18
|
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
19
19
|
nxJson.useInferencePlugins !== false;
|
|
20
20
|
options.addPlugin ??= addPlugin;
|
|
21
|
-
const isTsSolutionSetup = options.useTsSolution || (0,
|
|
21
|
+
const isTsSolutionSetup = options.useTsSolution || (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
22
22
|
const appProjectName = !isTsSolutionSetup || options.name ? projectName : importPath;
|
|
23
23
|
const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
24
24
|
const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
@@ -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;
|
|
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;AAK9C,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,kBAAkB,uBAgJ5B"}
|
|
@@ -2,10 +2,11 @@
|
|
|
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");
|
|
5
6
|
const devkit_2 = require("@nx/devkit");
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
|
|
8
|
-
const
|
|
9
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
10
|
async function customServerGenerator(host, options) {
|
|
10
11
|
const project = (0, devkit_2.readProjectConfiguration)(host, options.project);
|
|
11
12
|
const swcServerName = '.server.swcrc';
|
|
@@ -39,7 +40,7 @@ async function customServerGenerator(host, options) {
|
|
|
39
40
|
? `../../${(0, devkit_2.offsetFromRoot)(project.root)}${project.root}`
|
|
40
41
|
: `${(0, devkit_2.offsetFromRoot)(`dist/${project.root}`)}${project.root}`;
|
|
41
42
|
const offset = (0, devkit_2.offsetFromRoot)(project.root);
|
|
42
|
-
const isTsSolution = (0,
|
|
43
|
+
const isTsSolution = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
43
44
|
(0, devkit_2.generateFiles)(host, (0, path_1.join)(__dirname, 'files'), project.root, {
|
|
44
45
|
...options,
|
|
45
46
|
hasPlugin,
|
|
@@ -101,11 +102,14 @@ async function customServerGenerator(host, options) {
|
|
|
101
102
|
json.tasksRunnerOptions?.default?.options?.cacheableOperations) {
|
|
102
103
|
json.tasksRunnerOptions.default.options.cacheableOperations.push('build-custom-server');
|
|
103
104
|
}
|
|
104
|
-
json.targetDefaults ??= {};
|
|
105
|
-
json.targetDefaults['build-custom-server'] ??= {};
|
|
106
|
-
json.targetDefaults['build-custom-server'].cache ??= true;
|
|
107
105
|
return json;
|
|
108
106
|
});
|
|
107
|
+
const updatedNxJson = (0, devkit_2.readNxJson)(host) ?? {};
|
|
108
|
+
(0, internal_1.upsertTargetDefault)(host, updatedNxJson, {
|
|
109
|
+
target: 'build-custom-server',
|
|
110
|
+
cache: true,
|
|
111
|
+
});
|
|
112
|
+
(0, devkit_2.updateNxJson)(host, updatedNxJson);
|
|
109
113
|
if (options.compiler === 'swc') {
|
|
110
114
|
// Update app swc to exlude server files
|
|
111
115
|
(0, devkit_2.updateJson)(host, (0, path_1.join)(project.root, '.swcrc'), (json) => {
|
|
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.cypressComponentConfiguration = cypressComponentConfiguration;
|
|
37
37
|
exports.cypressComponentConfigurationInternal = cypressComponentConfigurationInternal;
|
|
38
38
|
const devkit_1 = require("@nx/devkit");
|
|
39
|
-
const
|
|
39
|
+
const internal_1 = require("@nx/js/internal");
|
|
40
40
|
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");
|
|
@@ -100,7 +100,7 @@ ${isUsingTailwind
|
|
|
100
100
|
`);
|
|
101
101
|
if (opts.generateTests) {
|
|
102
102
|
const filePaths = [];
|
|
103
|
-
const sourceRoot = (0,
|
|
103
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(projectConfig, tree);
|
|
104
104
|
(0, devkit_1.visitNotIgnoredFiles)(tree, sourceRoot, (filePath) => {
|
|
105
105
|
const fromProjectRootPath = (0, path_1.relative)(projectConfig.root, filePath);
|
|
106
106
|
// we don't generate tests for pages/server-side/appDir components
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
8
|
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
9
9
|
const { projectRoot, importPath } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
@@ -16,7 +16,7 @@ async function normalizeOptions(host, options) {
|
|
|
16
16
|
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
17
17
|
nxJson.useInferencePlugins !== false;
|
|
18
18
|
options.addPlugin ??= addPlugin;
|
|
19
|
-
const isUsingTsSolutionConfig = (0,
|
|
19
|
+
const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
20
20
|
return {
|
|
21
21
|
...options,
|
|
22
22
|
importPath,
|
|
@@ -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;AASpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,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;AASpB,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,8BAoL5E;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -10,8 +10,7 @@ const init_1 = require("../init/init");
|
|
|
10
10
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
11
11
|
const update_vite_config_1 = require("./lib/update-vite-config");
|
|
12
12
|
const versions_2 = require("../../utils/versions");
|
|
13
|
-
const
|
|
14
|
-
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
13
|
+
const internal_1 = require("@nx/js/internal");
|
|
15
14
|
async function libraryGenerator(host, rawOptions) {
|
|
16
15
|
return await libraryGeneratorInternal(host, {
|
|
17
16
|
addPlugin: false,
|
|
@@ -21,7 +20,7 @@ async function libraryGenerator(host, rawOptions) {
|
|
|
21
20
|
}
|
|
22
21
|
async function libraryGeneratorInternal(host, rawOptions) {
|
|
23
22
|
const tasks = [];
|
|
24
|
-
const addTsPlugin = (0,
|
|
23
|
+
const addTsPlugin = (0, internal_1.shouldConfigureTsSolutionSetup)(host, rawOptions.addPlugin);
|
|
25
24
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
26
25
|
js: rawOptions.js,
|
|
27
26
|
addTsPlugin,
|
|
@@ -66,7 +65,7 @@ export async function HelloServer() {
|
|
|
66
65
|
return <h1>Hello Server</h1>;
|
|
67
66
|
}
|
|
68
67
|
`);
|
|
69
|
-
const isTsSolutionSetup = (0,
|
|
68
|
+
const isTsSolutionSetup = (0, internal_1.isUsingTsSolutionSetup)(host);
|
|
70
69
|
if (!options.skipTsConfig && !isTsSolutionSetup) {
|
|
71
70
|
(0, js_1.addTsConfigPath)(host, `${options.importPath}/server`, [serverEntryPath]);
|
|
72
71
|
}
|
|
@@ -86,7 +85,7 @@ export async function HelloServer() {
|
|
|
86
85
|
const serverExport = {};
|
|
87
86
|
// For TS Solution setups, include development condition
|
|
88
87
|
if (isTsSolutionSetup) {
|
|
89
|
-
const customConditionName = (0,
|
|
88
|
+
const customConditionName = (0, internal_1.getDefinedCustomConditionName)(host);
|
|
90
89
|
serverExport[customConditionName] = './src/server.ts';
|
|
91
90
|
}
|
|
92
91
|
serverExport.types = './dist/server.d.ts';
|
|
@@ -113,7 +112,7 @@ export async function HelloServer() {
|
|
|
113
112
|
];
|
|
114
113
|
return json;
|
|
115
114
|
});
|
|
116
|
-
(0,
|
|
115
|
+
(0, internal_1.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
|
|
117
116
|
jsx: 'react-jsx',
|
|
118
117
|
module: 'esnext',
|
|
119
118
|
moduleResolution: 'bundler',
|
|
@@ -121,9 +120,9 @@ export async function HelloServer() {
|
|
|
121
120
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
122
121
|
: undefined);
|
|
123
122
|
if (options.isUsingTsSolutionConfig) {
|
|
124
|
-
await (0,
|
|
123
|
+
await (0, internal_1.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
|
|
125
124
|
}
|
|
126
|
-
(0,
|
|
125
|
+
(0, internal_1.sortPackageJsonFields)(host, options.projectRoot);
|
|
127
126
|
if (!options.skipFormat) {
|
|
128
127
|
await (0, devkit_1.formatFiles)(host);
|
|
129
128
|
}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAWpB,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
|
@@ -4,8 +4,7 @@ exports.createNodesV2 = exports.createNodes = exports.createDependencies = void
|
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
8
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
8
|
const fs_1 = require("fs");
|
|
10
9
|
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
11
10
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
@@ -24,7 +23,7 @@ exports.createNodes = [
|
|
|
24
23
|
const optionsHash = (0, devkit_internals_1.hashObject)(options);
|
|
25
24
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `next-${optionsHash}.json`);
|
|
26
25
|
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
27
|
-
const isTsSolutionSetup = (0,
|
|
26
|
+
const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
|
|
28
27
|
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
29
28
|
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
30
29
|
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
@@ -68,7 +67,7 @@ async function buildNextTargets(nextConfigPath, projectRoot, options, context, i
|
|
|
68
67
|
const startTarget = getStartTargetConfig(options, projectRoot);
|
|
69
68
|
targets[options.startTargetName] = startTarget;
|
|
70
69
|
targets[options.serveStaticTargetName] = startTarget;
|
|
71
|
-
(0,
|
|
70
|
+
(0, internal_2.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
|
|
72
71
|
return targets;
|
|
73
72
|
}
|
|
74
73
|
async function getBuildTargetConfig(namedInputs, projectRoot, nextConfig, isTsSolutionSetup) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-swc-to-custom-server.d.ts","sourceRoot":"","sources":["../../../../../packages/next/src/utils/add-swc-to-custom-server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"add-swc-to-custom-server.d.ts","sourceRoot":"","sources":["../../../../../packages/next/src/utils/add-swc-to-custom-server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAQpB,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,aAAa,SAAW,EACxB,gBAAgB,GAAE,MAAM,EAAO,cAyBhC"}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configureForSwc = configureForSwc;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const add_swc_config_1 = require("@nx/js/src/utils/swc/add-swc-config");
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
6
|
function configureForSwc(tree, projectRoot, swcConfigName = '.swcrc', additonalExludes = []) {
|
|
8
7
|
const swcConfigPath = (0, devkit_1.joinPathFragments)(projectRoot, swcConfigName);
|
|
9
8
|
const rootPackageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
@@ -13,7 +12,7 @@ function configureForSwc(tree, projectRoot, swcConfigName = '.swcrc', additonalE
|
|
|
13
12
|
rootPackageJson.devDependencies?.['@swc/cli'];
|
|
14
13
|
if (!tree.exists(swcConfigPath)) {
|
|
15
14
|
// We need to create a swc config file specific for custom server
|
|
16
|
-
(0,
|
|
15
|
+
(0, internal_1.addSwcConfig)(tree, projectRoot, 'commonjs', false, swcConfigName, [
|
|
17
16
|
...additonalExludes,
|
|
18
17
|
'.*.d.ts$',
|
|
19
18
|
]);
|
|
@@ -25,10 +24,10 @@ function configureForSwc(tree, projectRoot, swcConfigName = '.swcrc', additonalE
|
|
|
25
24
|
}
|
|
26
25
|
function addSwcDependencies(tree) {
|
|
27
26
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
28
|
-
'@swc/helpers':
|
|
27
|
+
'@swc/helpers': internal_1.swcHelpersVersion,
|
|
29
28
|
}, {
|
|
30
|
-
'@swc-node/register':
|
|
31
|
-
'@swc/cli':
|
|
32
|
-
'@swc/core':
|
|
29
|
+
'@swc-node/register': internal_1.swcNodeVersion,
|
|
30
|
+
'@swc/cli': internal_1.swcCliVersion,
|
|
31
|
+
'@swc/core': internal_1.swcCoreVersion,
|
|
33
32
|
});
|
|
34
33
|
}
|
package/tailwind.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createGlobPatternsForDependencies = createGlobPatternsForDependencies;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/js/internal");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
let hasWarned = false;
|
|
7
7
|
/**
|
|
@@ -23,8 +23,8 @@ function createGlobPatternsForDependencies(dirPath, fileGlobPatternToInclude = '
|
|
|
23
23
|
if (majorVersion >= 4) {
|
|
24
24
|
try {
|
|
25
25
|
return [
|
|
26
|
-
...(0,
|
|
27
|
-
...(0,
|
|
26
|
+
...(0, internal_1.createGlobPatternsForDependencies)(dirPath, fileGlobPatternToInclude).map((glob) => (0, path_1.relative)(dirPath, glob)),
|
|
27
|
+
...(0, internal_1.createGlobPatternsForDependencies)(dirPath, fileGlobPatternToExclude).map((glob) => `!${(0, path_1.relative)(dirPath, glob)}`),
|
|
28
28
|
];
|
|
29
29
|
}
|
|
30
30
|
catch (e) {
|
|
@@ -44,7 +44,7 @@ function createGlobPatternsForDependencies(dirPath, fileGlobPatternToInclude = '
|
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
46
|
try {
|
|
47
|
-
return (0,
|
|
47
|
+
return (0, internal_1.createGlobPatternsForDependencies)(dirPath, fileGlobPatternToInclude);
|
|
48
48
|
}
|
|
49
49
|
catch (e) {
|
|
50
50
|
/**
|