@tedbrain/vlink 0.1.42 → 0.1.43
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/README.md +15 -9
- package/binaries.json +8 -8
- package/installer.js +45 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@ Codex 一样按当前平台下载对应的 vlink 二进制。推荐统一使用
|
|
|
5
5
|
和 TedBrain 初始化:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx -y @tedbrain/vlink@latest install
|
|
8
|
+
npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
`vlink setup tedbrain`。安装完成后可直接运行:
|
|
11
|
+
该命令会识别平台和架构,始终安装与当前 npm 包版本一致的 vlink,配置用户
|
|
12
|
+
PATH,并启动 `vlink setup tedbrain`。安装完成后可直接运行:
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
vlink --version
|
|
@@ -18,7 +18,13 @@ vlink --version
|
|
|
18
18
|
也可以只把 npm 包作为临时 CLI 使用:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npx -y @tedbrain/vlink@latest --version
|
|
21
|
+
npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest --version
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
手动配置 Agent 时可以只安装或更新 vlink,并跳过 TedBrain 配置向导:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install --no-setup
|
|
22
28
|
```
|
|
23
29
|
|
|
24
30
|
## 下载地址
|
|
@@ -35,19 +41,19 @@ release 不存在或校验失败时,自动回退到 d01 下载服务器:
|
|
|
35
41
|
|
|
36
42
|
```bash
|
|
37
43
|
# 跳过 Gitee,直接使用 d01/自定义下载源
|
|
38
|
-
VLINK_SKIP_GITEE=1 npx -y @tedbrain/vlink@latest install
|
|
44
|
+
VLINK_SKIP_GITEE=1 npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
|
|
39
45
|
|
|
40
46
|
# d01 回退源改用开发通道
|
|
41
|
-
VLINK_DOWNLOAD_CHANNEL=oss-dev npx -y @tedbrain/vlink@latest install
|
|
47
|
+
VLINK_DOWNLOAD_CHANNEL=oss-dev npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
|
|
42
48
|
|
|
43
49
|
# 自定义回退下载根路径(会自动拼接 <channel>/vlink/<version>/vlink-<platform>)
|
|
44
|
-
VLINK_DOWNLOAD_BASE=https://internal.example/downloads npx -y @tedbrain/vlink@latest install
|
|
50
|
+
VLINK_DOWNLOAD_BASE=https://internal.example/downloads npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
|
|
45
51
|
|
|
46
52
|
# 自定义回退下载目录(会自动拼接 vlink-<platform>)
|
|
47
|
-
VLINK_DOWNLOAD_URL=https://internal.example/vlink npx -y @tedbrain/vlink@latest install
|
|
53
|
+
VLINK_DOWNLOAD_URL=https://internal.example/vlink npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
|
|
48
54
|
|
|
49
55
|
# 指定不同版本(同时影响 Gitee release tag 与 d01 回退路径)
|
|
50
|
-
VLINK_VERSION=0.1.21 npx -y @tedbrain/vlink@latest install
|
|
56
|
+
VLINK_VERSION=0.1.21 npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
|
|
51
57
|
```
|
|
52
58
|
|
|
53
59
|
## 平台映射
|
package/binaries.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.43",
|
|
3
3
|
"binaries": {
|
|
4
|
-
"linux-x86_64": "
|
|
5
|
-
"linux-x86_64-glibc2.17": "
|
|
6
|
-
"linux-aarch64": "
|
|
7
|
-
"macos-x86_64": "
|
|
8
|
-
"macos-aarch64": "
|
|
9
|
-
"windows-x86_64.exe": "
|
|
10
|
-
"windows-aarch64.exe": "
|
|
4
|
+
"linux-x86_64": "cea6ec73c69fe0e8e0a0103073298bf26082aeda3e35442194646321df5fb52e",
|
|
5
|
+
"linux-x86_64-glibc2.17": "3641a7c0fcb8d2e14a15dfb2cbb477bc0f4aa0766cb3dd6432cacf9dcbb01388",
|
|
6
|
+
"linux-aarch64": "2f9f607ec7d562424dbb919d5b681fc6c2f37be5a7f98312c567f816f12353af",
|
|
7
|
+
"macos-x86_64": "4381e5e0ba28447367a44f62a23f7f51db7594ebde3938c5466ceacc0108af0f",
|
|
8
|
+
"macos-aarch64": "9b853aa9cc6b33cc366ad90fdb2a8240154b074ad0a115a69607541a088ad6de",
|
|
9
|
+
"windows-x86_64.exe": "8813df57d23b1b4043c955b19113cbbe3451241066cb87f0aceba614b352a207",
|
|
10
|
+
"windows-aarch64.exe": "ebf3f3c9cf1b89ff3651375de58ea53fdc06cb04a057b071ea47ff1a8df7be1d"
|
|
11
11
|
}
|
|
12
12
|
}
|
package/installer.js
CHANGED
|
@@ -346,6 +346,7 @@ async function runInstaller(options = {}) {
|
|
|
346
346
|
const env = options.env || process.env;
|
|
347
347
|
const platform = options.platform || env.VLINK_PLATFORM || process.platform;
|
|
348
348
|
const arch = options.arch || env.VLINK_ARCH || process.arch;
|
|
349
|
+
const skipSetup = Boolean(options.skipSetup);
|
|
349
350
|
const home = options.home || os.homedir();
|
|
350
351
|
const fsImpl = options.fs || fs;
|
|
351
352
|
const output = options.output || process.stderr;
|
|
@@ -381,71 +382,63 @@ async function runInstaller(options = {}) {
|
|
|
381
382
|
});
|
|
382
383
|
|
|
383
384
|
if (vlinkPath) {
|
|
384
|
-
log(
|
|
385
|
+
log(
|
|
386
|
+
`found vlink at ${vlinkPath}; installing vlink ${installModule.VERSION}`,
|
|
387
|
+
output
|
|
388
|
+
);
|
|
385
389
|
} else if (isExecutableFile(targetPath, platform, fsImpl)) {
|
|
386
390
|
vlinkPath = targetPath;
|
|
387
391
|
ensureUserPath(installDir, sharedOptions);
|
|
388
|
-
log(
|
|
392
|
+
log(
|
|
393
|
+
`found vlink at ${vlinkPath}; installing vlink ${installModule.VERSION}`,
|
|
394
|
+
output
|
|
395
|
+
);
|
|
389
396
|
} else {
|
|
390
397
|
log(`installing vlink ${installModule.VERSION}`, output);
|
|
391
|
-
const sourcePath = await ensureBinary({});
|
|
392
|
-
installBinary(sourcePath, targetPath, {
|
|
393
|
-
...sharedOptions,
|
|
394
|
-
stopDaemon: false
|
|
395
|
-
});
|
|
396
|
-
ensureUserPath(installDir, sharedOptions);
|
|
397
|
-
vlinkPath = targetPath;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
} else {
|
|
414
|
-
log('vlink is up to date', output);
|
|
415
|
-
}
|
|
416
|
-
} else {
|
|
417
|
-
log('installed vlink does not support update checks; installing the latest release', output);
|
|
418
|
-
const sourcePath = await ensureBinary({});
|
|
419
|
-
installBinary(sourcePath, targetPath, {
|
|
420
|
-
...sharedOptions,
|
|
421
|
-
stopDaemon: true
|
|
422
|
-
});
|
|
400
|
+
const replacingExisting = Boolean(vlinkPath);
|
|
401
|
+
const installTarget = vlinkPath || targetPath;
|
|
402
|
+
const sourcePath = await ensureBinary({});
|
|
403
|
+
installBinary(sourcePath, installTarget, {
|
|
404
|
+
...sharedOptions,
|
|
405
|
+
stopDaemon: replacingExisting
|
|
406
|
+
});
|
|
407
|
+
if (
|
|
408
|
+
!replacingExisting ||
|
|
409
|
+
samePath(path.dirname(installTarget), installDir, platform)
|
|
410
|
+
) {
|
|
423
411
|
ensureUserPath(installDir, sharedOptions);
|
|
424
|
-
vlinkPath = targetPath;
|
|
425
412
|
}
|
|
413
|
+
vlinkPath = installTarget;
|
|
426
414
|
|
|
427
415
|
vlinkPath = await migrateStaticVlink(vlinkPath, spec, {
|
|
428
416
|
...sharedOptions,
|
|
429
417
|
ensureBinary
|
|
430
418
|
});
|
|
431
419
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
420
|
+
if (skipSetup) {
|
|
421
|
+
log('skipping TedBrain Agent setup', output);
|
|
422
|
+
} else {
|
|
423
|
+
log('starting TedBrain Agent setup', output);
|
|
424
|
+
const setup = spawnSyncImpl(vlinkPath, ['setup', 'tedbrain'], {
|
|
425
|
+
stdio: 'inherit'
|
|
426
|
+
});
|
|
427
|
+
const failure = commandFailure(setup, 'vlink setup tedbrain');
|
|
428
|
+
if (failure) throw new VlinkSetupError(failure);
|
|
429
|
+
}
|
|
438
430
|
|
|
439
|
-
return { installDir, vlinkPath };
|
|
431
|
+
return { installDir, vlinkPath, setupSkipped: skipSetup };
|
|
440
432
|
}
|
|
441
433
|
|
|
442
434
|
function printInstallHelp(output = process.stdout) {
|
|
443
435
|
output.write(
|
|
444
436
|
[
|
|
445
|
-
'Usage: npx -y @tedbrain/vlink@latest install',
|
|
437
|
+
'Usage: npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install [--no-setup]',
|
|
438
|
+
'',
|
|
439
|
+
'Installs or updates vlink and adds it to the user PATH.',
|
|
446
440
|
'',
|
|
447
|
-
'
|
|
448
|
-
'the TedBrain setup wizard.'
|
|
441
|
+
' --no-setup Install without starting the TedBrain setup wizard.'
|
|
449
442
|
].join('\n') + '\n'
|
|
450
443
|
);
|
|
451
444
|
}
|
|
@@ -455,10 +448,16 @@ async function runInstallerFromArgs(args, options = {}) {
|
|
|
455
448
|
printInstallHelp(options.output || process.stdout);
|
|
456
449
|
return null;
|
|
457
450
|
}
|
|
458
|
-
|
|
459
|
-
|
|
451
|
+
|
|
452
|
+
let skipSetup = false;
|
|
453
|
+
for (const arg of args) {
|
|
454
|
+
if (arg === '--no-setup') {
|
|
455
|
+
skipSetup = true;
|
|
456
|
+
} else {
|
|
457
|
+
throw new VlinkSetupError(`unknown install option: ${arg}`);
|
|
458
|
+
}
|
|
460
459
|
}
|
|
461
|
-
return runInstaller(options);
|
|
460
|
+
return runInstaller({ ...options, skipSetup });
|
|
462
461
|
}
|
|
463
462
|
|
|
464
463
|
module.exports = {
|
package/package.json
CHANGED