fix publish: generate platform packages manually, add optionalDependencies

Skip napi prepublish/artifacts commands that require GitHub API auth.
Instead, create platform package.json files and copy binaries directly.
Add optionalDependencies to main package so npm/bun auto-selects the
right binary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-04-02 11:52:12 -07:00
co-authored by Claude Opus 4.6
parent a1c62eb24e
commit 9154085e2c
2 changed files with 45 additions and 15 deletions
+9 -3
View File
@@ -4,6 +4,10 @@
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
"files": [
"index.js",
"index.d.ts"
],
"repository": {
"type": "git",
"url": "https://github.com/firecrawl/pdf-inspector"
@@ -22,11 +26,13 @@
"name": "@firecrawl/pdf-inspector-js"
}
},
"optionalDependencies": {
"@firecrawl/pdf-inspector-js-linux-x64-gnu": "0.2.0",
"@firecrawl/pdf-inspector-js-darwin-arm64": "0.2.0"
},
"scripts": {
"build": "napi build --platform --release",
"build:debug": "napi build --platform",
"prepublishOnly": "napi prepublish -t npm",
"artifacts": "napi artifacts"
"build:debug": "napi build --platform"
},
"devDependencies": {
"@napi-rs/cli": "^3.4.1"