Skip to content

Commit

Permalink
fix(image): update napi to fix electron create Buffer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jan 29, 2023
1 parent b2b8bbe commit a37586d
Show file tree
Hide file tree
Showing 5 changed files with 457 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ jobs:
curl -qL https://www.npmjs.com/install.sh | sh
npm install --location=global --ignore-scripts yarn
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
sh rustup.sh -y --profile minimal --default-toolchain beta
export PATH="/usr/local/cargo/bin:$PATH"
echo "~~~~ rustc --version ~~~~"
rustc --version
Expand Down Expand Up @@ -266,7 +266,7 @@ jobs:
check-latest: true
cache: yarn
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
run: yarn install --immutable
- name: Download artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -279,7 +279,9 @@ jobs:
run: ls -R .
shell: bash
- name: Test bindings
run: yarn test
run: |
yarn test
yarn electron electron.js
test-linux-x64-gnu-binding:
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
needs:
Expand All @@ -301,7 +303,7 @@ jobs:
check-latest: true
cache: yarn
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
run: yarn install --immutable
- name: Download artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -314,7 +316,7 @@ jobs:
run: ls -R .
shell: bash
- name: Test bindings
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn test
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn test && yarn electron electron.js
test-linux-x64-musl-binding:
name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }}
needs:
Expand Down
8 changes: 8 additions & 0 deletions electron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import('./example.mjs')
.then(() => {
process.exit(0)
})
.catch((e) => {
console.error(e)
process.exit(1)
})
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"ava": "^5.1.0",
"blurhash": "^2.0.4",
"chalk": "^5.2.0",
"electron": "^22.1.0",
"lerna": "^6.3.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.1",
Expand All @@ -33,7 +34,8 @@
"format:prettier": "prettier . -w",
"format:rs": "cargo fmt",
"format:toml": "taplo format",
"test": "ava"
"test": "ava",
"test:electron": "yarn electron electron.js"
},
"prettier": {
"printWidth": 120,
Expand Down
2 changes: 1 addition & 1 deletion packages/binding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ image = { version = "0.24", default-features = false, features = [
"openexr",
] }
jpeg-decoder = "0.3"
libavif = { version = "0.10", default-features = false, features = [
libavif = { version = "=0.10.1", default-features = false, features = [
"codec-aom",
] }
libc = "0.2"
Expand Down

0 comments on commit a37586d

Please sign in to comment.