Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include all builds as normal dependencies #449

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/young-pans-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/edr": patch
---

Added a workaround for an npm bug by using all builds as normal dependencies
4 changes: 4 additions & 0 deletions .github/workflows/edr-npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ jobs:
uses: actions/download-artifact@v3
with:
path: ./crates/edr_napi/artifacts
- name: Install sponge
run: |
sudo apt-get update
sudo apt-get install -y moreutils
- name: Move artifacts
run: pnpm artifacts
- name: Publish
Expand Down
6 changes: 0 additions & 6 deletions crates/edr_napi/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
"type": "git"
},
"version": "0.2.0-alpha.1",
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"main": "edr.darwin-arm64.node",
"files": [
"edr.darwin-arm64.node"
Expand Down
6 changes: 0 additions & 6 deletions crates/edr_napi/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
"type": "git"
},
"version": "0.2.0-alpha.1",
"os": [
"darwin"
],
"cpu": [
"x64"
],
"main": "edr.darwin-x64.node",
"files": [
"edr.darwin-x64.node"
Expand Down
11 changes: 1 addition & 10 deletions crates/edr_napi/npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
"type": "git"
},
"version": "0.2.0-alpha.1",
"os": [
"linux"
],
"cpu": [
"arm64"
],
"main": "edr.linux-arm64-gnu.node",
"files": [
"edr.linux-arm64-gnu.node"
],
"license": "MIT",
"engines": {
"node": ">= 18"
},
"libc": [
"glibc"
]
}
}
11 changes: 1 addition & 10 deletions crates/edr_napi/npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
"type": "git"
},
"version": "0.2.0-alpha.1",
"os": [
"linux"
],
"cpu": [
"arm64"
],
"main": "edr.linux-arm64-musl.node",
"files": [
"edr.linux-arm64-musl.node"
],
"license": "MIT",
"engines": {
"node": ">= 18"
},
"libc": [
"musl"
]
}
}
11 changes: 1 addition & 10 deletions crates/edr_napi/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
"type": "git"
},
"version": "0.2.0-alpha.1",
"os": [
"linux"
],
"cpu": [
"x64"
],
"main": "edr.linux-x64-gnu.node",
"files": [
"edr.linux-x64-gnu.node"
],
"license": "MIT",
"engines": {
"node": ">= 18"
},
"libc": [
"glibc"
]
}
}
11 changes: 1 addition & 10 deletions crates/edr_napi/npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
"type": "git"
},
"version": "0.2.0-alpha.1",
"os": [
"linux"
],
"cpu": [
"x64"
],
"main": "edr.linux-x64-musl.node",
"files": [
"edr.linux-x64-musl.node"
],
"license": "MIT",
"engines": {
"node": ">= 18"
},
"libc": [
"musl"
]
}
}
6 changes: 0 additions & 6 deletions crates/edr_napi/npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
"type": "git"
},
"version": "0.2.0-alpha.1",
"os": [
"win32"
],
"cpu": [
"x64"
],
"main": "edr.win32-x64-msvc.node",
"files": [
"edr.win32-x64-msvc.node"
Expand Down
8 changes: 6 additions & 2 deletions crates/edr_napi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
"napi": {
"name": "edr",
"triples": {
"defaults": false,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change isn't strictly necessary for this PR, but while working on this I noticed that slang does it and I think it makes sense. This way we don't rely on napi-rs's defaults that might change without us noticing it.

"additional": [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"x86_64-unknown-linux-musl"
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"x86_64-pc-windows-msvc"
]
}
},
Expand All @@ -47,7 +51,7 @@
"build:debug": "napi build --platform",
"build:tracing": "napi build --platform --release --features tracing",
"build:scenarios": "napi build --platform --release --features scenarios",
"prepublishOnly": "napi prepublish -t npm --skip-gh-release",
"prepublishOnly": "bash scripts/prepublish.sh",
"universal": "napi universal",
"version": "napi version",
"pretest": "pnpm build",
Expand Down
9 changes: 9 additions & 0 deletions crates/edr_napi/scripts/prepublish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e
set -o pipefail

pnpm napi prepublish -t npm --skip-gh-release

# rename optionalDependencies key to dependencies
jq 'with_entries(if .key == "optionalDependencies" then .key = "dependencies" else . end)' package.json | sponge package.json
Loading