@tsdown/exe 0.21.0 → 0.21.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/dist/index.d.mts +3 -4
- package/dist/index.mjs +2 -12
- package/package.json +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Logger } from "tsdown/internal";
|
|
2
|
+
|
|
1
3
|
//#region src/platform.d.ts
|
|
2
4
|
type ExePlatform = "win" | "darwin" | "linux";
|
|
3
5
|
type ExeArch = "x64" | "arm64";
|
|
@@ -39,9 +41,6 @@ declare function getCacheDir(): string;
|
|
|
39
41
|
declare function getCachedBinaryPath(target: ExeTarget): string;
|
|
40
42
|
//#endregion
|
|
41
43
|
//#region src/download.d.ts
|
|
42
|
-
|
|
43
|
-
info: (...args: any[]) => void;
|
|
44
|
-
}
|
|
45
|
-
declare function resolveNodeBinary(target: ExeTarget, logger?: MinimalLogger): Promise<string>;
|
|
44
|
+
declare function resolveNodeBinary(target: ExeTarget, logger?: Logger): Promise<string>;
|
|
46
45
|
//#endregion
|
|
47
46
|
export { type ExeArch, type ExeExtensionOptions, type ExePlatform, type ExeTarget, getCacheDir, getCachedBinaryPath, getTargetSuffix, resolveNodeBinary };
|
package/dist/index.mjs
CHANGED
|
@@ -2,9 +2,10 @@ import os from "node:os";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { Buffer } from "node:buffer";
|
|
5
|
-
import {
|
|
5
|
+
import { chmod, mkdir, rename, writeFile } from "node:fs/promises";
|
|
6
6
|
import { createDebug } from "obug";
|
|
7
7
|
import { x } from "tinyexec";
|
|
8
|
+
import { fsExists, fsRemove } from "tsdown/internal";
|
|
8
9
|
import satisfies from "semver/functions/satisfies.js";
|
|
9
10
|
import valid from "semver/functions/valid.js";
|
|
10
11
|
//#region src/cache.ts
|
|
@@ -24,17 +25,6 @@ function getCachedBinaryPath(target) {
|
|
|
24
25
|
return path.join(cacheDir, "node", `v${target.nodeVersion}`, `${target.platform}-${target.arch}`, binName);
|
|
25
26
|
}
|
|
26
27
|
//#endregion
|
|
27
|
-
//#region ../../src/utils/fs.ts
|
|
28
|
-
function fsExists(path) {
|
|
29
|
-
return access(path).then(() => true, () => false);
|
|
30
|
-
}
|
|
31
|
-
function fsRemove(path) {
|
|
32
|
-
return rm(path, {
|
|
33
|
-
force: true,
|
|
34
|
-
recursive: true
|
|
35
|
-
}).catch(() => {});
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
28
|
//#region src/platform.ts
|
|
39
29
|
function getArchiveExtension(platform) {
|
|
40
30
|
if (platform === "win") return "zip";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsdown/exe",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.21.
|
|
4
|
+
"version": "0.21.1",
|
|
5
5
|
"description": "Cross-platform executable building for tsdown",
|
|
6
6
|
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -37,12 +37,15 @@
|
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=20.19.0"
|
|
39
39
|
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"tsdown": "0.21.1"
|
|
42
|
+
},
|
|
40
43
|
"dependencies": {
|
|
41
44
|
"obug": "^2.1.1",
|
|
42
45
|
"semver": "^7.7.4",
|
|
43
46
|
"tinyexec": "^1.0.2"
|
|
44
47
|
},
|
|
45
48
|
"scripts": {
|
|
46
|
-
"build": "
|
|
49
|
+
"build": "node -C dev ../../src/run.ts -c ../../tsdown.config.ts -F ."
|
|
47
50
|
}
|
|
48
51
|
}
|