@volcengine/ark-cli 1.0.46-prerelease.174e36f8e896 → 1.0.46-prerelease.46bd0d6dcc58
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/manifest.json +15 -15
- package/package.json +10 -2
- package/scripts/run.js +51 -22
package/manifest.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.46-prerelease.
|
|
2
|
+
"version": "1.0.46-prerelease.46bd0d6dcc58",
|
|
3
3
|
"platforms": {
|
|
4
4
|
"darwin-amd64": {
|
|
5
|
-
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.
|
|
6
|
-
"sha256": "
|
|
5
|
+
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.46bd0d6dcc58/arkcli-1.0.46-prerelease.46bd0d6dcc58-darwin-amd64",
|
|
6
|
+
"sha256": "a15a2e1907422627fa031ea8be46e01446bc6b72ece0f03558a6b88c62598599"
|
|
7
7
|
},
|
|
8
8
|
"darwin-arm64": {
|
|
9
|
-
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.
|
|
10
|
-
"sha256": "
|
|
9
|
+
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.46bd0d6dcc58/arkcli-1.0.46-prerelease.46bd0d6dcc58-darwin-arm64",
|
|
10
|
+
"sha256": "76ac7070fff6851e290895e38e219c66105b3fa0990f7d48c5d4b246b79e98e6"
|
|
11
11
|
},
|
|
12
12
|
"linux-amd64": {
|
|
13
|
-
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.
|
|
14
|
-
"sha256": "
|
|
13
|
+
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.46bd0d6dcc58/arkcli-1.0.46-prerelease.46bd0d6dcc58-linux-amd64",
|
|
14
|
+
"sha256": "c7100a385086235b9d505be52ac8072305020dfedae5a161526b59e37159c0be"
|
|
15
15
|
},
|
|
16
16
|
"linux-arm64": {
|
|
17
|
-
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.
|
|
18
|
-
"sha256": "
|
|
17
|
+
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.46bd0d6dcc58/arkcli-1.0.46-prerelease.46bd0d6dcc58-linux-arm64",
|
|
18
|
+
"sha256": "de345d949150e09b53090078035221e13f0f290a9fd8ac95401e3a1d6d491f0f"
|
|
19
19
|
},
|
|
20
20
|
"windows-amd64": {
|
|
21
|
-
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.
|
|
22
|
-
"sha256": "
|
|
21
|
+
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.46bd0d6dcc58/arkcli-1.0.46-prerelease.46bd0d6dcc58-windows-amd64.exe",
|
|
22
|
+
"sha256": "d36d1ba5592bc373303c7c2bd4bfe9c130599aa98f76a7a5d268ebb11042abc2"
|
|
23
23
|
},
|
|
24
24
|
"windows-arm64": {
|
|
25
|
-
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.
|
|
26
|
-
"sha256": "
|
|
25
|
+
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.46bd0d6dcc58/arkcli-1.0.46-prerelease.46bd0d6dcc58-windows-arm64.exe",
|
|
26
|
+
"sha256": "60bf3e8463d0fc9088b524cc9d613fdba661b6f4c6d655a3ce7e93d16849d390"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"skills": {
|
|
30
30
|
"primary": {
|
|
31
|
-
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.
|
|
31
|
+
"url": "https://lf3-static.bytednsdoc.com/obj/eden-cn/psjryh/ljhwZthlaukjlkulzlp/prerelease/1.0.46-prerelease.46bd0d6dcc58/skills.tar.gz",
|
|
32
32
|
"sha256": "587b0421f4ac6d2633e7159574e22be1517285f6afc448d70484f3b58d7a1b76",
|
|
33
33
|
"kind": "cdn"
|
|
34
34
|
},
|
|
35
|
-
"tag": "v1.0.46-prerelease.
|
|
35
|
+
"tag": "v1.0.46-prerelease.46bd0d6dcc58"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volcengine/ark-cli",
|
|
3
|
-
"version": "1.0.46-prerelease.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.46-prerelease.46bd0d6dcc58",
|
|
4
|
+
"description": "\u706b\u5c71\u65b9\u821f ARK \u5e73\u53f0\u547d\u4ee4\u884c\u5de5\u5177",
|
|
5
5
|
"bin": {
|
|
6
6
|
"arkcli": "scripts/run.js"
|
|
7
7
|
},
|
|
@@ -29,5 +29,13 @@
|
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "git+https://github.com/volcengine/ark-cli.git"
|
|
32
|
+
},
|
|
33
|
+
"optionalDependencies": {
|
|
34
|
+
"@volcengine/ark-cli-darwin-x64": "1.0.46-prerelease.46bd0d6dcc58",
|
|
35
|
+
"@volcengine/ark-cli-darwin-arm64": "1.0.46-prerelease.46bd0d6dcc58",
|
|
36
|
+
"@volcengine/ark-cli-linux-x64": "1.0.46-prerelease.46bd0d6dcc58",
|
|
37
|
+
"@volcengine/ark-cli-linux-arm64": "1.0.46-prerelease.46bd0d6dcc58",
|
|
38
|
+
"@volcengine/ark-cli-win32-x64": "1.0.46-prerelease.46bd0d6dcc58",
|
|
39
|
+
"@volcengine/ark-cli-win32-arm64": "1.0.46-prerelease.46bd0d6dcc58"
|
|
32
40
|
}
|
|
33
41
|
}
|
package/scripts/run.js
CHANGED
|
@@ -1,37 +1,66 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
const path = require("path");
|
|
2
|
+
"use strict";
|
|
3
|
+
// npm installs the matching optional platform package without lifecycle scripts.
|
|
4
|
+
// Keep the historical bin/ layout for already installed and composite-updated CLI.
|
|
6
5
|
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
7
|
const { execFileSync } = require("child_process");
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const arch = archMap[process.arch];
|
|
13
|
-
|
|
8
|
+
const PACKAGE_NAME = "@volcengine/ark-cli";
|
|
9
|
+
const root = path.resolve(__dirname, "..");
|
|
10
|
+
const platform = { darwin: "darwin", linux: "linux", win32: "windows" }[process.platform];
|
|
11
|
+
const arch = { x64: "amd64", arm64: "arm64" }[process.arch];
|
|
14
12
|
if (!platform || !arch) {
|
|
15
|
-
console.error(
|
|
13
|
+
console.error(`${PACKAGE_NAME}: unsupported platform ${process.platform}-${process.arch}`);
|
|
16
14
|
process.exit(1);
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
const ext = platform === "windows" ? ".exe" : "";
|
|
20
|
-
|
|
17
|
+
let binary = path.join(root, "bin", `arkcli-${platform}-${arch}${ext}`);
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
function regularFile(file, maxBytes) {
|
|
20
|
+
for (let current = file; ; current = path.dirname(current)) {
|
|
21
|
+
const stat = fs.lstatSync(current);
|
|
22
|
+
if (stat.isSymbolicLink()) throw new Error(`refuse symlink: ${current}`);
|
|
23
|
+
if (current === file) {
|
|
24
|
+
if (!stat.isFile() || stat.size <= 0 || (maxBytes && stat.size > maxBytes)) throw new Error(`invalid file: ${file}`);
|
|
25
|
+
} else if (!stat.isDirectory()) throw new Error(`invalid directory: ${current}`);
|
|
26
|
+
if (current === root) break;
|
|
27
|
+
if (current === path.dirname(current)) throw new Error("platform package escapes its owner");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function metadata(file) {
|
|
31
|
+
regularFile(file, 1024 * 1024);
|
|
32
|
+
return JSON.parse(fs.readFileSync(file, "utf8"));
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
let legacy = true;
|
|
36
|
+
try { fs.lstatSync(binary); } catch (err) {
|
|
37
|
+
if (err.code !== "ENOENT") throw err;
|
|
38
|
+
legacy = false;
|
|
39
|
+
}
|
|
40
|
+
if (!legacy) {
|
|
41
|
+
const parent = metadata(path.join(root, "package.json"));
|
|
42
|
+
const name = `${PACKAGE_NAME}-${process.platform}-${process.arch}`;
|
|
43
|
+
if (parent.name !== PACKAGE_NAME || !parent.version || parent.optionalDependencies?.[name] !== parent.version) {
|
|
44
|
+
throw new Error("missing exact-version platform dependency declaration");
|
|
45
|
+
}
|
|
46
|
+
const childRoot = path.join(root, "node_modules", name);
|
|
47
|
+
const child = metadata(path.join(childRoot, "package.json"));
|
|
48
|
+
if (child.name !== name || child.version !== parent.version ||
|
|
49
|
+
!Array.isArray(child.os) || child.os.length !== 1 || child.os[0] !== process.platform ||
|
|
50
|
+
!Array.isArray(child.cpu) || child.cpu.length !== 1 || child.cpu[0] !== process.arch) {
|
|
51
|
+
throw new Error("platform package identity/version mismatch");
|
|
52
|
+
}
|
|
53
|
+
binary = path.join(childRoot, "bin", `arkcli-${platform}-${arch}${ext}`);
|
|
54
|
+
}
|
|
55
|
+
regularFile(binary);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.error(`${PACKAGE_NAME}: platform binary unavailable: ${err.message}\n` +
|
|
58
|
+
`Reinstall with optional dependencies enabled:\n npm install -g ${PACKAGE_NAME} --include=optional`);
|
|
30
59
|
process.exit(1);
|
|
31
60
|
}
|
|
32
|
-
|
|
33
61
|
try {
|
|
34
62
|
execFileSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
35
63
|
} catch (err) {
|
|
64
|
+
if (err.signal) process.kill(process.pid, err.signal);
|
|
36
65
|
process.exit(Number.isInteger(err.status) ? err.status : 1);
|
|
37
66
|
}
|