55# Change directories to where the script lives
66cd libs/core
77
8- mkdir -p artifacts
9-
108if [ " $USE_ZIG " = " true" ]; then
119 npx @napi-rs/cli build --platform --target " $1 " --release --zig \
12- --js artifacts /native.cjs \
13- --dts artifacts /native.d.ts \
10+ --js src /native.cjs \
11+ --dts src /native.d.ts \
1412 --js-package-name @kevinmichaelchen/cel-typescript
1513else
1614 npx @napi-rs/cli build --platform --target " $1 " --release \
17- --js artifacts /native.cjs \
18- --dts artifacts /native.d.ts \
15+ --js src /native.cjs \
16+ --dts src /native.d.ts \
1917 --js-package-name @kevinmichaelchen/cel-typescript
2018fi
2119
22- # For local development, copy the binary to artifacts so tests can find them locally
23- cp * .node artifacts
24-
2520# Copy binaries to their respective platform package directories
26- if [[ " $1 " == " aarch64-apple-darwin" ]]; then
27- mkdir -p ../darwin-arm64
28- cp cel-typescript.darwin-arm64.node ../darwin-arm64/
29- echo " Copied binary to darwin-arm64 package"
30- fi
31-
32- if [[ " $1 " == " x86_64-apple-darwin" ]]; then
33- mkdir -p ../darwin-x64
34- cp cel-typescript.darwin-x64.node ../darwin-x64/
35- echo " Copied binary to darwin-x64 package"
36- fi
37-
38- if [[ " $1 " == " x86_64-unknown-linux-gnu" ]]; then
39- mkdir -p ../linux-x64-gnu
40- cp cel-typescript.linux-x64-gnu.node ../linux-x64-gnu/
41- echo " Copied binary to linux-x64-gnu package"
42- fi
43-
44- if [[ " $1 " == " aarch64-unknown-linux-gnu" ]]; then
45- mkdir -p ../linux-arm64-gnu
46- cp cel-typescript.linux-arm64-gnu.node ../linux-arm64-gnu/
47- echo " Copied binary to linux-arm64-gnu package"
48- fi
49-
50- if [[ " $1 " == " x86_64-pc-windows-msvc" ]]; then
51- mkdir -p ../win32-x64-msvc
52- cp cel-typescript.win32-x64-msvc.node ../win32-x64-msvc/
53- echo " Copied binary to win32-x64-msvc package"
54- fi
21+ # Find all .node files in the current directory
22+ echo " ******************************************"
23+ echo " DEBUG: Current directory: $( pwd) "
24+ echo " DEBUG: Files in current directory:"
25+ ls -la * .node || echo " No .node files found"
26+ echo " DEBUG: Attempting to copy platform binaries..."
27+ echo " ******************************************"
28+
29+ for binary in cel-typescript.* .node; do
30+ if [ -f " $binary " ]; then
31+ # Extract the platform identifier (everything between 'cel-typescript.' and '.node')
32+ platform=$( echo " $binary " | sed -E ' s/cel-typescript\.(.+)\.node/\1/' )
33+
34+ # Create target directory if it doesn't exist
35+ mkdir -p " ../$platform "
36+
37+ # Copy binary to the platform directory
38+ cp " $binary " " ../$platform /"
39+
40+ echo " ******************************************"
41+ echo " SUCCESS: Copied $binary to ../$platform /"
42+ echo " ******************************************"
43+ else
44+ echo " WARNING: Pattern matched $binary but it's not a file"
45+ fi
46+ done
47+
48+ echo " ******************************************"
49+ echo " DEBUG: Platform packages after copying:"
50+ ls -la ../* /cel-typescript.* .node || echo " No platform binaries found in packages"
51+ echo " ******************************************"
0 commit comments