@let-value/translate-extract-static 1.1.0 → 1.1.1-beta.2
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/bin/cli.cjs +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/{binary-Do1nEoy8.cjs → binary-B-BK0iD4.cjs} +1 -1
- package/dist/{binary-DLbeeLiM.js → binary-Ceo8ROxg.js} +1 -1
- package/dist/scripts/postinstall.cjs +3 -3
- package/dist/scripts/postinstall.js +4 -4
- package/dist/src/index.cjs +2 -2
- package/dist/src/index.d.cts +1474 -2
- package/dist/src/index.d.ts +1474 -2
- package/dist/src/index.js +2 -2
- package/package.json +2 -2
package/dist/bin/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
3
|
-
const require_binary = require('../binary-
|
|
3
|
+
const require_binary = require('../binary-B-BK0iD4.cjs');
|
|
4
4
|
let node_child_process = require("node:child_process");
|
|
5
5
|
node_child_process = require_chunk.__toESM(node_child_process);
|
|
6
6
|
|
package/dist/bin/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ function getBinaryName(platform$1, arch$1, libc$1) {
|
|
|
14
14
|
return `extract-${platform$1}-${arch$1}${libc$1 ? `-${libc$1}` : ""}${extension}`;
|
|
15
15
|
}
|
|
16
16
|
const binaryName = getBinaryName(platform, arch, libc);
|
|
17
|
-
const binaryPath = (0, node_path.resolve)(root, "
|
|
17
|
+
const binaryPath = (0, node_path.resolve)(root, "prebuilts", binaryName);
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
Object.defineProperty(exports, 'binaryName', {
|
|
@@ -11,7 +11,7 @@ function getBinaryName(platform$1, arch$1, libc$1) {
|
|
|
11
11
|
return `extract-${platform$1}-${arch$1}${libc$1 ? `-${libc$1}` : ""}${extension}`;
|
|
12
12
|
}
|
|
13
13
|
const binaryName = getBinaryName(platform, arch, libc);
|
|
14
|
-
const binaryPath = resolve(root, "
|
|
14
|
+
const binaryPath = resolve(root, "prebuilts", binaryName);
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
export { binaryName, binaryPath, platform };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_binary = require('../binary-
|
|
2
|
+
const require_binary = require('../binary-B-BK0iD4.cjs');
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_chunk.__toESM(node_path);
|
|
5
5
|
let node_fs = require("node:fs");
|
|
@@ -7,7 +7,6 @@ node_fs = require_chunk.__toESM(node_fs);
|
|
|
7
7
|
|
|
8
8
|
//#region scripts/postinstall.ts
|
|
9
9
|
const root = (0, node_path.resolve)(__dirname, "../..");
|
|
10
|
-
const dist = (0, node_path.resolve)(root, "dist");
|
|
11
10
|
const pkg = JSON.parse((0, node_fs.readFileSync)((0, node_path.resolve)(root, "package.json"), "utf8"));
|
|
12
11
|
const repo = "https://github.com/let-value/translate";
|
|
13
12
|
const tag = `v${pkg.version}`;
|
|
@@ -19,13 +18,14 @@ async function downloadBinary() {
|
|
|
19
18
|
signal: AbortSignal.timeout(3e4),
|
|
20
19
|
headers: { "user-agent": "@let-value/translate-extract-static postinstall" }
|
|
21
20
|
});
|
|
21
|
+
if (!response.ok) return false;
|
|
22
|
+
(0, node_fs.mkdirSync)((0, node_path.dirname)(require_binary.binaryPath), { recursive: true });
|
|
22
23
|
(0, node_fs.writeFileSync)(require_binary.binaryPath, Buffer.from(await response.arrayBuffer()));
|
|
23
24
|
if (require_binary.platform !== "win32") (0, node_fs.chmodSync)(require_binary.binaryPath, 493);
|
|
24
25
|
return true;
|
|
25
26
|
} catch {}
|
|
26
27
|
}
|
|
27
28
|
async function main() {
|
|
28
|
-
(0, node_fs.mkdirSync)(dist, { recursive: true });
|
|
29
29
|
if ((0, node_fs.existsSync)(require_binary.binaryPath)) return;
|
|
30
30
|
if (await downloadBinary()) {
|
|
31
31
|
console.log(`Downloaded binary: ${require_binary.binaryName}`);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { binaryName, binaryPath, platform } from "../binary-
|
|
2
|
-
import { resolve } from "node:path";
|
|
1
|
+
import { binaryName, binaryPath, platform } from "../binary-Ceo8ROxg.js";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
3
|
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
|
|
5
5
|
//#region scripts/postinstall.ts
|
|
6
6
|
const root = resolve(import.meta.dirname, "../..");
|
|
7
|
-
const dist = resolve(root, "dist");
|
|
8
7
|
const pkg = JSON.parse(readFileSync(resolve(root, "package.json"), "utf8"));
|
|
9
8
|
const repo = "https://github.com/let-value/translate";
|
|
10
9
|
const tag = `v${pkg.version}`;
|
|
@@ -16,13 +15,14 @@ async function downloadBinary() {
|
|
|
16
15
|
signal: AbortSignal.timeout(3e4),
|
|
17
16
|
headers: { "user-agent": "@let-value/translate-extract-static postinstall" }
|
|
18
17
|
});
|
|
18
|
+
if (!response.ok) return false;
|
|
19
|
+
mkdirSync(dirname(binaryPath), { recursive: true });
|
|
19
20
|
writeFileSync(binaryPath, Buffer.from(await response.arrayBuffer()));
|
|
20
21
|
if (platform !== "win32") chmodSync(binaryPath, 493);
|
|
21
22
|
return true;
|
|
22
23
|
} catch {}
|
|
23
24
|
}
|
|
24
25
|
async function main() {
|
|
25
|
-
mkdirSync(dist, { recursive: true });
|
|
26
26
|
if (existsSync(binaryPath)) return;
|
|
27
27
|
if (await downloadBinary()) {
|
|
28
28
|
console.log(`Downloaded binary: ${binaryName}`);
|
package/dist/src/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_chunk.__toESM(node_path);
|
|
4
4
|
|
|
5
|
-
//#region ../extract/
|
|
5
|
+
//#region ../extract/src/static.ts
|
|
6
6
|
function core(...props) {
|
|
7
7
|
return { static: {
|
|
8
8
|
name: "core",
|
|
@@ -29,7 +29,7 @@ function cleanup(...props) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
//#endregion
|
|
32
|
-
//#region ../extract/
|
|
32
|
+
//#region ../extract/src/configuration.ts
|
|
33
33
|
const defaultPlugins = {
|
|
34
34
|
core,
|
|
35
35
|
po,
|