@nrwl/js 15.4.0-rc.0 → 15.4.0-rc.1
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [15.4.0-rc.
|
|
6
|
+
# [15.4.0-rc.1](https://github.com/nrwl/nx/compare/15.3.3...15.4.0-rc.1) (2022-12-21)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/js",
|
|
3
|
-
"version": "15.4.0-rc.
|
|
3
|
+
"version": "15.4.0-rc.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@jest/reporters": "28.1.1",
|
|
38
38
|
"@jest/test-result": "28.1.3",
|
|
39
39
|
"@jest/types": "28.1.3",
|
|
40
|
-
"@nrwl/devkit": "15.4.0-rc.
|
|
41
|
-
"@nrwl/linter": "15.4.0-rc.
|
|
42
|
-
"@nrwl/workspace": "15.4.0-rc.
|
|
40
|
+
"@nrwl/devkit": "15.4.0-rc.1",
|
|
41
|
+
"@nrwl/linter": "15.4.0-rc.1",
|
|
42
|
+
"@nrwl/workspace": "15.4.0-rc.1",
|
|
43
43
|
"@types/node": "18.11.9",
|
|
44
44
|
"@typescript-eslint/parser": "5.38.1",
|
|
45
45
|
"@yarnpkg/lockfile": "1.1.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
80
|
"types": "./src/index.d.ts",
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "84cc1c1b3a56c72a4d8f68ded12a178a82e656fa"
|
|
82
82
|
}
|
|
@@ -16,4 +16,4 @@ export interface UpdatePackageJsonOption {
|
|
|
16
16
|
buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
|
|
17
17
|
}
|
|
18
18
|
export declare function updatePackageJson(options: UpdatePackageJsonOption, context: ExecutorContext, target: ProjectGraphProjectNode, dependencies: DependentBuildableProjectNode[]): void;
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function getUpdatedPackageJsonContent(packageJson: PackageJson, options: UpdatePackageJsonOption): PackageJson;
|
|
@@ -1,75 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getUpdatedPackageJsonContent = exports.updatePackageJson = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const buildable_libs_utils_1 = require("@nrwl/workspace/src/utilities/buildable-libs-utils");
|
|
5
6
|
const path_1 = require("path");
|
|
6
|
-
const
|
|
7
|
-
const fs_extra_1 = require("fs-extra");
|
|
8
|
-
const operators_1 = require("nx/src/project-graph/operators");
|
|
7
|
+
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
9
8
|
function getMainFileDirRelativeToProjectRoot(main, projectRoot) {
|
|
10
9
|
const mainFileDir = (0, path_1.dirname)(main);
|
|
11
10
|
const relativeDir = (0, devkit_1.normalizePath)((0, path_1.relative)(projectRoot, mainFileDir));
|
|
12
11
|
return relativeDir === '' ? `./` : `./${relativeDir}/`;
|
|
13
12
|
}
|
|
14
13
|
function updatePackageJson(options, context, target, dependencies) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
// make custom modifications to package.json
|
|
21
|
-
updatePackageJsonContent(packageJson, options);
|
|
14
|
+
const pathToPackageJson = (0, path_1.join)(context.root, options.projectRoot, 'package.json');
|
|
15
|
+
const packageJson = (0, fileutils_1.fileExists)(pathToPackageJson)
|
|
16
|
+
? (0, devkit_1.readJsonFile)(pathToPackageJson)
|
|
17
|
+
: { name: context.projectName };
|
|
22
18
|
if (options.excludeLibsInPackageJson) {
|
|
23
19
|
dependencies = dependencies.filter((dep) => dep.node.type !== 'lib');
|
|
24
20
|
}
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
(0, devkit_1.writeJsonFile)(`${options.outputPath}/package.json`, getUpdatedPackageJsonContent(packageJson, options));
|
|
22
|
+
if (dependencies.length > 0 &&
|
|
23
|
+
options.updateBuildableProjectDepsInPackageJson) {
|
|
24
|
+
(0, buildable_libs_utils_1.updateBuildableProjectPackageJsonDependencies)(context.root, context.projectName, context.targetName, context.configurationName, target, dependencies, options.buildableProjectDepsInPackageJsonType);
|
|
27
25
|
}
|
|
28
|
-
(0, devkit_1.writeJsonFile)(`${options.outputPath}/package.json`, packageJson);
|
|
29
|
-
const lockFile = (0, devkit_1.createLockFile)(packageJson);
|
|
30
|
-
(0, fs_extra_1.writeFileSync)(`${options.outputPath}/${(0, lock_file_1.getLockFileName)()}`, lockFile, {
|
|
31
|
-
encoding: 'utf-8',
|
|
32
|
-
});
|
|
33
26
|
}
|
|
34
27
|
exports.updatePackageJson = updatePackageJson;
|
|
35
|
-
function
|
|
36
|
-
const workspacePackageJson = (0, devkit_1.readJsonFile)((0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, 'package.json'));
|
|
37
|
-
dependencies.forEach((entry) => {
|
|
38
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
39
|
-
if ((0, operators_1.isNpmProject)(entry.node)) {
|
|
40
|
-
const { packageName, version } = entry.node.data;
|
|
41
|
-
if (((_a = packageJson.dependencies) === null || _a === void 0 ? void 0 : _a[packageName]) ||
|
|
42
|
-
((_b = packageJson.devDependencies) === null || _b === void 0 ? void 0 : _b[packageName]) ||
|
|
43
|
-
((_c = packageJson.peerDependencies) === null || _c === void 0 ? void 0 : _c[packageName])) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if ((_d = workspacePackageJson.devDependencies) === null || _d === void 0 ? void 0 : _d[packageName]) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
(_e = packageJson[propType]) !== null && _e !== void 0 ? _e : (packageJson[propType] = {});
|
|
50
|
-
packageJson[propType][packageName] = version;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
const packageName = entry.name;
|
|
54
|
-
if (!((_f = packageJson.dependencies) === null || _f === void 0 ? void 0 : _f[packageName]) &&
|
|
55
|
-
!((_g = packageJson.peerDependencies) === null || _g === void 0 ? void 0 : _g[packageName])) {
|
|
56
|
-
const outputs = (0, devkit_1.getOutputsForTargetAndConfiguration)({
|
|
57
|
-
overrides: {},
|
|
58
|
-
target: {
|
|
59
|
-
project: projectName,
|
|
60
|
-
target: targetName,
|
|
61
|
-
configuration: configurationName,
|
|
62
|
-
},
|
|
63
|
-
}, entry.node);
|
|
64
|
-
const depPackageJsonPath = (0, path_1.join)(root, outputs[0], 'package.json');
|
|
65
|
-
const version = (0, devkit_1.readJsonFile)(depPackageJsonPath).version;
|
|
66
|
-
(_h = packageJson[propType]) !== null && _h !== void 0 ? _h : (packageJson[propType] = {});
|
|
67
|
-
packageJson[propType][packageName] = version;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function updatePackageJsonContent(packageJson, options) {
|
|
28
|
+
function getUpdatedPackageJsonContent(packageJson, options) {
|
|
73
29
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
74
30
|
var _o, _p;
|
|
75
31
|
// Default is CJS unless esm is explicitly passed.
|
|
@@ -122,5 +78,5 @@ function updatePackageJsonContent(packageJson, options) {
|
|
|
122
78
|
}
|
|
123
79
|
return packageJson;
|
|
124
80
|
}
|
|
125
|
-
exports.
|
|
81
|
+
exports.getUpdatedPackageJsonContent = getUpdatedPackageJsonContent;
|
|
126
82
|
//# sourceMappingURL=update-package-json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-package-json.js","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/package-json/update-package-json.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"update-package-json.js","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/package-json/update-package-json.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AACtB,6FAG4D;AAC5D,+BAAgE;AAChE,sDAAoD;AAGpD,SAAS,mCAAmC,CAC1C,IAAY,EACZ,WAAmB;IAEnB,MAAM,WAAW,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC;IAClC,MAAM,WAAW,GAAG,IAAA,sBAAa,EAAC,IAAA,eAAQ,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IACtE,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,GAAG,CAAC;AACzD,CAAC;AAkBD,SAAgB,iBAAiB,CAC/B,OAAgC,EAChC,OAAwB,EACxB,MAA+B,EAC/B,YAA6C;IAE7C,MAAM,iBAAiB,GAAG,IAAA,WAAI,EAC5B,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,WAAW,EACnB,cAAc,CACf,CAAC;IAEF,MAAM,WAAW,GAAG,IAAA,sBAAU,EAAC,iBAAiB,CAAC;QAC/C,CAAC,CAAC,IAAA,qBAAY,EAAC,iBAAiB,CAAC;QACjC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAElC,IAAI,OAAO,CAAC,wBAAwB,EAAE;QACpC,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;KACtE;IAED,IAAA,sBAAa,EAC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