diff --git a/.changeset/young-pans-help.md b/.changeset/young-pans-help.md new file mode 100644 index 000000000..966b0a84b --- /dev/null +++ b/.changeset/young-pans-help.md @@ -0,0 +1,5 @@ +--- +"@nomicfoundation/edr": patch +--- + +Added a workaround for an npm bug by using all builds as normal dependencies diff --git a/.github/workflows/edr-npm-release.yml b/.github/workflows/edr-npm-release.yml index 6988f96e8..e3f91a22f 100644 --- a/.github/workflows/edr-npm-release.yml +++ b/.github/workflows/edr-npm-release.yml @@ -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 diff --git a/crates/edr_napi/npm/darwin-arm64/package.json b/crates/edr_napi/npm/darwin-arm64/package.json index 87d06f457..6e10890f8 100644 --- a/crates/edr_napi/npm/darwin-arm64/package.json +++ b/crates/edr_napi/npm/darwin-arm64/package.json @@ -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" diff --git a/crates/edr_napi/npm/darwin-x64/package.json b/crates/edr_napi/npm/darwin-x64/package.json index 4b792b371..ca9f27baf 100644 --- a/crates/edr_napi/npm/darwin-x64/package.json +++ b/crates/edr_napi/npm/darwin-x64/package.json @@ -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" diff --git a/crates/edr_napi/npm/linux-arm64-gnu/package.json b/crates/edr_napi/npm/linux-arm64-gnu/package.json index 705bcc3fd..de6f0de2e 100644 --- a/crates/edr_napi/npm/linux-arm64-gnu/package.json +++ b/crates/edr_napi/npm/linux-arm64-gnu/package.json @@ -5,12 +5,6 @@ "type": "git" }, "version": "0.2.0-alpha.1", - "os": [ - "linux" - ], - "cpu": [ - "arm64" - ], "main": "edr.linux-arm64-gnu.node", "files": [ "edr.linux-arm64-gnu.node" @@ -18,8 +12,5 @@ "license": "MIT", "engines": { "node": ">= 18" - }, - "libc": [ - "glibc" - ] + } } diff --git a/crates/edr_napi/npm/linux-arm64-musl/package.json b/crates/edr_napi/npm/linux-arm64-musl/package.json index f56ff70ef..e484eac78 100644 --- a/crates/edr_napi/npm/linux-arm64-musl/package.json +++ b/crates/edr_napi/npm/linux-arm64-musl/package.json @@ -5,12 +5,6 @@ "type": "git" }, "version": "0.2.0-alpha.1", - "os": [ - "linux" - ], - "cpu": [ - "arm64" - ], "main": "edr.linux-arm64-musl.node", "files": [ "edr.linux-arm64-musl.node" @@ -18,8 +12,5 @@ "license": "MIT", "engines": { "node": ">= 18" - }, - "libc": [ - "musl" - ] + } } diff --git a/crates/edr_napi/npm/linux-x64-gnu/package.json b/crates/edr_napi/npm/linux-x64-gnu/package.json index 695870da4..010239762 100644 --- a/crates/edr_napi/npm/linux-x64-gnu/package.json +++ b/crates/edr_napi/npm/linux-x64-gnu/package.json @@ -5,12 +5,6 @@ "type": "git" }, "version": "0.2.0-alpha.1", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], "main": "edr.linux-x64-gnu.node", "files": [ "edr.linux-x64-gnu.node" @@ -18,8 +12,5 @@ "license": "MIT", "engines": { "node": ">= 18" - }, - "libc": [ - "glibc" - ] + } } diff --git a/crates/edr_napi/npm/linux-x64-musl/package.json b/crates/edr_napi/npm/linux-x64-musl/package.json index 0f68df2cb..5007fc2fe 100644 --- a/crates/edr_napi/npm/linux-x64-musl/package.json +++ b/crates/edr_napi/npm/linux-x64-musl/package.json @@ -5,12 +5,6 @@ "type": "git" }, "version": "0.2.0-alpha.1", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], "main": "edr.linux-x64-musl.node", "files": [ "edr.linux-x64-musl.node" @@ -18,8 +12,5 @@ "license": "MIT", "engines": { "node": ">= 18" - }, - "libc": [ - "musl" - ] + } } diff --git a/crates/edr_napi/npm/win32-x64-msvc/package.json b/crates/edr_napi/npm/win32-x64-msvc/package.json index 58f6d80c8..b96deca3c 100644 --- a/crates/edr_napi/npm/win32-x64-msvc/package.json +++ b/crates/edr_napi/npm/win32-x64-msvc/package.json @@ -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" diff --git a/crates/edr_napi/package.json b/crates/edr_napi/package.json index b654e10dd..88acd7231 100644 --- a/crates/edr_napi/package.json +++ b/crates/edr_napi/package.json @@ -17,11 +17,15 @@ "napi": { "name": "edr", "triples": { + "defaults": false, "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" ] } }, @@ -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", diff --git a/crates/edr_napi/scripts/prepublish.sh b/crates/edr_napi/scripts/prepublish.sh new file mode 100644 index 000000000..3f3c31cc0 --- /dev/null +++ b/crates/edr_napi/scripts/prepublish.sh @@ -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