workspace-tools 0.26.5 → 0.26.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/CHANGELOG.json +16 -1
- package/CHANGELOG.md +10 -2
- package/lib/lockfile/index.js +2 -2
- package/lib/lockfile/index.js.map +1 -1
- package/lib/lockfile/readYaml.d.ts +1 -0
- package/lib/lockfile/readYaml.js +16 -0
- package/lib/lockfile/readYaml.js.map +1 -0
- package/lib/workspaces/implementations/pnpm.js +2 -2
- package/lib/workspaces/implementations/pnpm.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "workspace-tools",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 16 Sep 2022 23:00:26 GMT",
|
|
6
|
+
"tag": "workspace-tools_v0.26.6",
|
|
7
|
+
"version": "0.26.6",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "elcraig@microsoft.com",
|
|
12
|
+
"package": "workspace-tools",
|
|
13
|
+
"commit": "6580711757c12c6accecb105808d2570418c99ab",
|
|
14
|
+
"comment": "Replace read-yaml-file with js-yaml"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 15 Sep 2022 23:30:21 GMT",
|
|
6
21
|
"tag": "workspace-tools_v0.26.5",
|
|
7
22
|
"version": "0.26.5",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - workspace-tools
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 16 Sep 2022 23:00:26 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.26.6
|
|
8
|
+
|
|
9
|
+
Fri, 16 Sep 2022 23:00:26 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Replace read-yaml-file with js-yaml (elcraig@microsoft.com)
|
|
14
|
+
|
|
7
15
|
## 0.26.5
|
|
8
16
|
|
|
9
|
-
Thu, 15 Sep 2022 23:30:
|
|
17
|
+
Thu, 15 Sep 2022 23:30:21 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
package/lib/lockfile/index.js
CHANGED
|
@@ -33,6 +33,7 @@ const nameAtVersion_1 = require("./nameAtVersion");
|
|
|
33
33
|
Object.defineProperty(exports, "nameAtVersion", { enumerable: true, get: function () { return nameAtVersion_1.nameAtVersion; } });
|
|
34
34
|
const parsePnpmLock_1 = require("./parsePnpmLock");
|
|
35
35
|
const parseNpmLock_1 = require("./parseNpmLock");
|
|
36
|
+
const readYaml_1 = require("./readYaml");
|
|
36
37
|
const memoization = {};
|
|
37
38
|
async function parseLockFile(packageRoot) {
|
|
38
39
|
const yarnLockPath = await (0, find_up_1.default)(["yarn.lock", "common/config/rush/yarn.lock"], { cwd: packageRoot });
|
|
@@ -53,8 +54,7 @@ async function parseLockFile(packageRoot) {
|
|
|
53
54
|
if (memoization[pnpmLockPath]) {
|
|
54
55
|
return memoization[pnpmLockPath];
|
|
55
56
|
}
|
|
56
|
-
const
|
|
57
|
-
const yaml = (await readYamlFile(pnpmLockPath));
|
|
57
|
+
const yaml = (0, readYaml_1.readYaml)(pnpmLockPath);
|
|
58
58
|
const parsed = (0, parsePnpmLock_1.parsePnpmLock)(yaml);
|
|
59
59
|
memoization[pnpmLockPath] = parsed;
|
|
60
60
|
return memoization[pnpmLockPath];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lockfile/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wGAAwG;AACxG,sDA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readYaml<TReturn>(file: string): TReturn;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readYaml = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
function readYaml(file) {
|
|
9
|
+
// This is delay loaded to avoid the perf penalty of parsing YAML utilities any time the package
|
|
10
|
+
// is used (since usage of the YAML utilities is less common).
|
|
11
|
+
const jsYaml = require("js-yaml");
|
|
12
|
+
const content = fs_1.default.readFileSync(file, "utf8");
|
|
13
|
+
return jsYaml.load(content);
|
|
14
|
+
}
|
|
15
|
+
exports.readYaml = readYaml;
|
|
16
|
+
//# sourceMappingURL=readYaml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readYaml.js","sourceRoot":"","sources":["../../src/lockfile/readYaml.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAGpB,SAAgB,QAAQ,CAAU,IAAY;IAC5C,gGAAgG;IAChG,8DAA8D;IAC9D,MAAM,MAAM,GAAsB,OAAO,CAAC,SAAS,CAAC,CAAC;IAErD,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAY,CAAC;AACzC,CAAC;AAPD,4BAOC"}
|
|
@@ -8,6 +8,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const find_up_1 = __importDefault(require("find-up"));
|
|
9
9
|
const getPackagePaths_1 = require("../../getPackagePaths");
|
|
10
10
|
const getWorkspacePackageInfo_1 = require("../getWorkspacePackageInfo");
|
|
11
|
+
const readYaml_1 = require("../../lockfile/readYaml");
|
|
11
12
|
function getPnpmWorkspaceRoot(cwd) {
|
|
12
13
|
const pnpmWorkspacesFile = find_up_1.default.sync("pnpm-workspace.yaml", { cwd });
|
|
13
14
|
if (!pnpmWorkspacesFile) {
|
|
@@ -20,8 +21,7 @@ function getPnpmWorkspaces(cwd) {
|
|
|
20
21
|
try {
|
|
21
22
|
const pnpmWorkspacesRoot = getPnpmWorkspaceRoot(cwd);
|
|
22
23
|
const pnpmWorkspacesFile = path_1.default.join(pnpmWorkspacesRoot, "pnpm-workspace.yaml");
|
|
23
|
-
const
|
|
24
|
-
const pnpmWorkspaces = readYaml(pnpmWorkspacesFile);
|
|
24
|
+
const pnpmWorkspaces = (0, readYaml_1.readYaml)(pnpmWorkspacesFile);
|
|
25
25
|
const packagePaths = (0, getPackagePaths_1.getPackagePaths)(pnpmWorkspacesRoot, pnpmWorkspaces.packages);
|
|
26
26
|
const workspaceInfo = (0, getWorkspacePackageInfo_1.getWorkspacePackageInfo)(packagePaths);
|
|
27
27
|
return workspaceInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnpm.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/pnpm.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,sDAA6B;AAE7B,2DAAwD;AAExD,wEAAqE;
|
|
1
|
+
{"version":3,"file":"pnpm.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/pnpm.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,sDAA6B;AAE7B,2DAAwD;AAExD,wEAAqE;AACrE,sDAAmD;AAMnD,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,MAAM,kBAAkB,GAAG,iBAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAEvE,IAAI,CAAC,kBAAkB,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IAED,OAAO,cAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC1C,CAAC;AARD,oDAQC;AAED,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,IAAI;QACF,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACrD,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;QAEhF,MAAM,cAAc,GAAG,IAAA,mBAAQ,EAAC,kBAAkB,CAAmB,CAAC;QAEtE,MAAM,YAAY,GAAG,IAAA,iCAAe,EAAC,kBAAkB,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;QAClF,MAAM,aAAa,GAAG,IAAA,iDAAuB,EAAC,YAAY,CAAC,CAAC;QAE5D,OAAO,aAAa,CAAC;KACtB;IAAC,MAAM;QACN,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAdD,8CAcC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workspace-tools",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"git-url-parse": "^13.0.0",
|
|
23
23
|
"globby": "^11.0.0",
|
|
24
24
|
"jju": "^1.4.0",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"js-yaml": "^4.1.0",
|
|
26
|
+
"micromatch": "^4.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"workspace-tools-scripts": "*"
|