@vantaloom/cli 0.3.10 → 0.4.0
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/package.json +1 -1
- package/src/cli.mjs +38 -0
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -196,6 +196,9 @@ async function buildRuntimePackage(sourceRoot, packageRoot, options) {
|
|
|
196
196
|
} catch { /* optional: skip if systray build fails */ }
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
// Bundle the EasyTier mesh binaries (P2P virtual network) for the target platform.
|
|
200
|
+
await copyEasyTier(sourceRoot, buildBin, platform)
|
|
201
|
+
|
|
199
202
|
if (options.buildWeb) {
|
|
200
203
|
runPnpm(["--filter", "vantaloom-app", "build"], { cwd: sourceRoot })
|
|
201
204
|
}
|
|
@@ -207,6 +210,41 @@ async function buildRuntimePackage(sourceRoot, packageRoot, options) {
|
|
|
207
210
|
return { platform, version }
|
|
208
211
|
}
|
|
209
212
|
|
|
213
|
+
// copyEasyTier bundles the vendored EasyTier binaries (easytier-core/easytier-cli,
|
|
214
|
+
// plus wintun.dll on Windows) for the target platform into the package bin/ dir.
|
|
215
|
+
async function copyEasyTier(sourceRoot, buildBin, platform) {
|
|
216
|
+
const vendorMap = {
|
|
217
|
+
"win32-x64": "windows-x86_64",
|
|
218
|
+
"darwin-arm64": "macos-aarch64",
|
|
219
|
+
"linux-x64": "linux-x86_64",
|
|
220
|
+
}
|
|
221
|
+
const vendorName = vendorMap[platform]
|
|
222
|
+
if (!vendorName) {
|
|
223
|
+
console.warn(` warning: no EasyTier mapping for ${platform}; mesh disabled for this platform`)
|
|
224
|
+
return
|
|
225
|
+
}
|
|
226
|
+
const srcDir = path.join(sourceRoot, "vendor", "easytier", vendorName, `easytier-${vendorName}`)
|
|
227
|
+
if (!existsSync(srcDir)) {
|
|
228
|
+
console.warn(` warning: EasyTier binaries not found at ${srcDir}; run vendor download first`)
|
|
229
|
+
return
|
|
230
|
+
}
|
|
231
|
+
const isWin = platform.startsWith("win32")
|
|
232
|
+
const files = isWin
|
|
233
|
+
? ["easytier-core.exe", "easytier-cli.exe", "wintun.dll"]
|
|
234
|
+
: ["easytier-core", "easytier-cli"]
|
|
235
|
+
let copied = 0
|
|
236
|
+
for (const f of files) {
|
|
237
|
+
const src = path.join(srcDir, f)
|
|
238
|
+
if (!existsSync(src)) {
|
|
239
|
+
console.warn(` warning: EasyTier file missing: ${f}`)
|
|
240
|
+
continue
|
|
241
|
+
}
|
|
242
|
+
await cp(src, path.join(buildBin, f), { force: true })
|
|
243
|
+
copied++
|
|
244
|
+
}
|
|
245
|
+
console.log(` bundled EasyTier ${vendorName} (${copied} files)`)
|
|
246
|
+
}
|
|
247
|
+
|
|
210
248
|
async function applyPackage(packageRoot, prefix, options) {
|
|
211
249
|
assertRuntimePackage(packageRoot)
|
|
212
250
|
|