@nx/node 20.4.0-canary.20250115-0ae8665 → 20.4.0-canary.20250117-cba25da
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/node",
|
|
3
|
-
"version": "20.4.0-canary.
|
|
3
|
+
"version": "20.4.0-canary.20250117-cba25da",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Node Plugin for Nx contains generators to manage Node applications within an Nx workspace.",
|
|
6
6
|
"repository": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"tslib": "^2.3.0",
|
|
35
|
-
"@nx/devkit": "20.4.0-canary.
|
|
36
|
-
"@nx/jest": "20.4.0-canary.
|
|
37
|
-
"@nx/js": "20.4.0-canary.
|
|
38
|
-
"@nx/eslint": "20.4.0-canary.
|
|
35
|
+
"@nx/devkit": "20.4.0-canary.20250117-cba25da",
|
|
36
|
+
"@nx/jest": "20.4.0-canary.20250117-cba25da",
|
|
37
|
+
"@nx/js": "20.4.0-canary.20250117-cba25da",
|
|
38
|
+
"@nx/eslint": "20.4.0-canary.20250117-cba25da"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -19,6 +19,7 @@ const has_webpack_plugin_1 = require("../../utils/has-webpack-plugin");
|
|
|
19
19
|
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
|
20
20
|
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
21
21
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
22
|
+
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
22
23
|
function getWebpackBuildConfig(project, options) {
|
|
23
24
|
return {
|
|
24
25
|
executor: `@nx/webpack:webpack`,
|
|
@@ -440,6 +441,7 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
440
441
|
if (options.isUsingTsSolutionConfig) {
|
|
441
442
|
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
442
443
|
}
|
|
444
|
+
(0, sort_fields_1.sortPackageJsonFields)(tree, options.appProjectRoot);
|
|
443
445
|
if (!options.skipFormat) {
|
|
444
446
|
await (0, devkit_1.formatFiles)(tree);
|
|
445
447
|
}
|
|
@@ -13,6 +13,7 @@ const init_1 = require("../init/init");
|
|
|
13
13
|
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
|
14
14
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
15
15
|
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
16
|
+
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
16
17
|
async function libraryGenerator(tree, schema) {
|
|
17
18
|
return await libraryGeneratorInternal(tree, {
|
|
18
19
|
addPlugin: false,
|
|
@@ -66,6 +67,7 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
66
67
|
if (options.isUsingTsSolutionConfig) {
|
|
67
68
|
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
|
|
68
69
|
}
|
|
70
|
+
(0, sort_fields_1.sortPackageJsonFields)(tree, options.projectRoot);
|
|
69
71
|
if (!schema.skipFormat) {
|
|
70
72
|
await (0, devkit_1.formatFiles)(tree);
|
|
71
73
|
}
|
|
@@ -157,11 +159,15 @@ function ensureDependencies(tree) {
|
|
|
157
159
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, { tslib: versions_1.tslibVersion }, { '@types/node': versions_1.typesNodeVersion });
|
|
158
160
|
}
|
|
159
161
|
function updatePackageJson(tree, options) {
|
|
160
|
-
const
|
|
162
|
+
const packageJsonPath = (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json');
|
|
163
|
+
if (!tree.exists(packageJsonPath)) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const packageJson = (0, devkit_1.readJson)(tree, packageJsonPath);
|
|
161
167
|
if (packageJson.type === 'module') {
|
|
162
168
|
// The @nx/js:lib generator can set the type to 'module' which would
|
|
163
169
|
// potentially break consumers of the library.
|
|
164
170
|
delete packageJson.type;
|
|
165
171
|
}
|
|
166
|
-
(0, devkit_1.writeJson)(tree,
|
|
172
|
+
(0, devkit_1.writeJson)(tree, packageJsonPath, packageJson);
|
|
167
173
|
}
|