Skip to content

Commit 5a8c225

Browse files
chore: stuff
1 parent bb02006 commit 5a8c225

File tree

5 files changed

+50
-10
lines changed

5 files changed

+50
-10
lines changed

.github/workflows/CI.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,15 @@ jobs:
210210
211211
# Set the core package version too
212212
jq ".version = \"$VERSION\"" libs/core/package.json > tmp.json && mv tmp.json libs/core/package.json
213+
214+
# Update the optionalDependencies in the core package to use version numbers instead of file paths
215+
node -e "const pkg = require('./libs/core/package.json'); \
216+
if (pkg.optionalDependencies) { \
217+
Object.keys(pkg.optionalDependencies).forEach(dep => { \
218+
pkg.optionalDependencies[dep] = '$VERSION'; \
219+
}); \
220+
require('fs').writeFileSync('./libs/core/package.json', JSON.stringify(pkg, null, 2)); \
221+
}"
213222
else
214223
echo "Not a tag push, skipping version update"
215224
fi

libs/core/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
"engines": {
2727
"node": ">=18.0.0"
2828
},
29+
"optionalDependencies": {
30+
"@kevinmichaelchen/cel-typescript-darwin-arm64": "file:../darwin-arm64",
31+
"@kevinmichaelchen/cel-typescript-darwin-x64": "file:../darwin-x64",
32+
"@kevinmichaelchen/cel-typescript-linux-x64-gnu": "file:../linux-x64-gnu",
33+
"@kevinmichaelchen/cel-typescript-linux-arm64-gnu": "file:../linux-arm64-gnu",
34+
"@kevinmichaelchen/cel-typescript-win32-x64-msvc": "file:../win32-x64-msvc"
35+
},
2936
"exports": {
3037
".": {
3138
"import": "./dist/src/index.js",

libs/core/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
}
4343
},
4444
"test": {
45+
"cache": false,
4546
"executor": "nx:run-commands",
4647
"options": {
4748
"command": "vitest run"

libs/core/scripts/build.sh

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,36 @@ else
1919
--js-package-name @kevinmichaelchen/cel-typescript
2020
fi
2121

22-
# TODO we only want to do this locally so unit tests pass
22+
# For local development, copy the binary to artifacts so tests can find them locally
2323
cp *.node artifacts
2424

25-
# TODO we do not want to put binaries into dist
26-
mkdir -p dist/artifacts
27-
cp -r artifacts/ dist/artifacts
25+
# 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

package-lock.json

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)