mirror of
https://github.com/earendil-works/pi.git
synced 2026-06-18 15:54:04 +08:00
chore: merge main into async-file-tools
This commit is contained in:
@@ -108,15 +108,10 @@ for platform in "${PLATFORMS[@]}"; do
|
||||
# Bun compiled executables only embed worker scripts when they are passed as
|
||||
# explicit build entrypoints. The runtime can still use new URL(...), but the
|
||||
# worker must be present in the compiled executable.
|
||||
#
|
||||
# Externalize koffi to avoid embedding all 18 platform .node files (~74MB)
|
||||
# into every binary. Koffi is only used on Windows for VT input and the
|
||||
# call site has a try/catch fallback. For Windows builds, we copy the
|
||||
# appropriate .node file alongside the binary below.
|
||||
if [[ "$platform" == windows-* ]]; then
|
||||
bun build --compile --external koffi --target=bun-$platform ./dist/bun/cli.js ./dist/utils/image-resize-worker.js --outfile binaries/$platform/pi.exe
|
||||
bun build --compile --target=bun-$platform ./dist/bun/cli.js ./dist/utils/image-resize-worker.js --outfile binaries/$platform/pi.exe
|
||||
else
|
||||
bun build --compile --external koffi --target=bun-$platform ./dist/bun/cli.js ./dist/utils/image-resize-worker.js --outfile binaries/$platform/pi
|
||||
bun build --compile --target=bun-$platform ./dist/bun/cli.js ./dist/utils/image-resize-worker.js --outfile binaries/$platform/pi
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -136,17 +131,15 @@ for platform in "${PLATFORMS[@]}"; do
|
||||
cp -r docs binaries/$platform/
|
||||
cp -r examples binaries/$platform/
|
||||
|
||||
# Copy koffi native module for Windows (needed for VT input support)
|
||||
# Copy Windows VT input native helper next to compiled Windows binaries.
|
||||
if [[ "$platform" == windows-* ]]; then
|
||||
if [[ "$platform" == "windows-arm64" ]]; then
|
||||
koffi_arch_dir="win32_arm64"
|
||||
win32_arch_dir="win32-arm64"
|
||||
else
|
||||
koffi_arch_dir="win32_x64"
|
||||
win32_arch_dir="win32-x64"
|
||||
fi
|
||||
mkdir -p binaries/$platform/node_modules/koffi/build/koffi/$koffi_arch_dir
|
||||
cp ../../node_modules/koffi/index.js binaries/$platform/node_modules/koffi/
|
||||
cp ../../node_modules/koffi/package.json binaries/$platform/node_modules/koffi/
|
||||
cp ../../node_modules/koffi/build/koffi/$koffi_arch_dir/koffi.node binaries/$platform/node_modules/koffi/build/koffi/$koffi_arch_dir/
|
||||
mkdir -p binaries/$platform/native/win32/prebuilds/$win32_arch_dir
|
||||
cp ../tui/native/win32/prebuilds/$win32_arch_dir/win32-console-mode.node binaries/$platform/native/win32/prebuilds/$win32_arch_dir/
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user