Skip to content

Commit 6723841

Browse files
committed
chore(deps): replace uuid, pify, temp-dir with native Node.js APIs
- uuid → crypto.randomUUID() - pify → util.promisify() - temp-dir → fs.realpathSync(os.tmpdir())
1 parent 5ad1cf8 commit 6723841

4 files changed

Lines changed: 7 additions & 41 deletions

File tree

libs/core/src/lib/conventional-commits/get-changelog-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import npa from "npm-package-arg";
2-
import pify from "pify";
2+
import { promisify } from "node:util";
33
import log from "../npmlog";
44
import { ValidationError } from "../validation-error";
55
import { ChangelogPresetConfig } from "./constants";
@@ -94,7 +94,7 @@ async function resolveConfigPromise(presetPackageName: string, presetConfig: obj
9494
config = config(presetConfig);
9595
} catch (_) {
9696
// legacy presets export an errback function instead of Q.all()
97-
config = pify(config)();
97+
config = promisify(config)();
9898
}
9999
}
100100

libs/core/src/lib/temp-write.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
*
44
* Embedded here into lerna directly because we cannot yet migrate to ESM only, and we needed to bump outdated deps.
55
*/
6+
import { randomUUID } from "node:crypto";
67
import fs from "node:fs";
8+
import os from "node:os";
79
import isStream from "is-stream";
810
import path from "path";
9-
import tempDir from "temp-dir";
10-
import * as uuid from "uuid";
1111

12-
const tempfile = (filePath: any) => path.join(tempDir, uuid.v4(), filePath || "");
12+
const tempDir = fs.realpathSync(os.tmpdir());
13+
14+
const tempfile = (filePath: any) => path.join(tempDir, randomUUID(), filePath || "");
1315

1416
const writeStream = async (filePath: any, fileContent: any) =>
1517
new Promise((resolve, reject) => {

package-lock.json

Lines changed: 0 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/lerna/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
"p-reduce": "2.1.0",
9191
"p-waterfall": "2.1.1",
9292
"pacote": "21.0.1",
93-
"pify": "5.0.0",
9493
"read-cmd-shim": "4.0.0",
9594
"semver": "7.7.2",
9695
"set-blocking": "^2.0.0",
@@ -99,12 +98,10 @@
9998
"ssri": "12.0.0",
10099
"string-width": "^4.2.3",
101100
"tar": "7.5.11",
102-
"temp-dir": "1.0.0",
103101
"through": "2.3.8",
104102
"tinyglobby": "0.2.12",
105103
"typescript": ">=3 < 6",
106104
"upath": "2.0.1",
107-
"uuid": "^11.1.0",
108105
"validate-npm-package-license": "3.0.4",
109106
"validate-npm-package-name": "6.0.2",
110107
"wide-align": "1.1.5",

0 commit comments

Comments
 (0)