switch to single npm package on npmjs.com (firecrawl-pdf-inspector)

Drop platform-specific optional deps — ship all .node binaries in one
package (~4 MB total). Simplifies publishing and consumer install.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-04-02 12:07:36 -07:00
co-authored by Claude Opus 4.6
parent 7dd1a69413
commit be032b0696
3 changed files with 62 additions and 107 deletions
+6 -47
View File
@@ -57,7 +57,7 @@ jobs:
if-no-files-found: error if-no-files-found: error
publish: publish:
name: Publish to GitHub Packages name: Publish to npm
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -76,56 +76,15 @@ jobs:
with: with:
path: napi/artifacts path: napi/artifacts
- name: Prepare and publish - name: Collect binaries and publish
working-directory: napi working-directory: napi
run: | run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
echo "@firecrawl:registry=https://npm.pkg.github.com" >> ~/.npmrc
VERSION=$(node -p "require('./package.json').version") # Copy all .node binaries into the package directory
cp artifacts/bindings-*/*.node .
# Create platform package dirs and package.json files
mkdir -p npm/linux-x64-gnu npm/darwin-arm64
cat > npm/linux-x64-gnu/package.json << PKGEOF
{
"name": "@firecrawl/pdf-inspector-js-linux-x64-gnu",
"version": "${VERSION}",
"os": ["linux"],
"cpu": ["x64"],
"main": "pdf-inspector.linux-x64-gnu.node",
"files": ["pdf-inspector.linux-x64-gnu.node"],
"license": "MIT",
"repository": { "type": "git", "url": "https://github.com/firecrawl/pdf-inspector" },
"publishConfig": { "registry": "https://npm.pkg.github.com", "access": "public" }
}
PKGEOF
cat > npm/darwin-arm64/package.json << PKGEOF
{
"name": "@firecrawl/pdf-inspector-js-darwin-arm64",
"version": "${VERSION}",
"os": ["darwin"],
"cpu": ["arm64"],
"main": "pdf-inspector.darwin-arm64.node",
"files": ["pdf-inspector.darwin-arm64.node"],
"license": "MIT",
"repository": { "type": "git", "url": "https://github.com/firecrawl/pdf-inspector" },
"publishConfig": { "registry": "https://npm.pkg.github.com", "access": "public" }
}
PKGEOF
# Move binaries into platform dirs
cp artifacts/bindings-x86_64-unknown-linux-gnu/*.node npm/linux-x64-gnu/
cp artifacts/bindings-aarch64-apple-darwin/*.node npm/darwin-arm64/
echo "=== Package contents ===" echo "=== Package contents ==="
ls -R npm/ ls -la *.node index.js index.d.ts
# Publish platform packages first, then main package
for dir in npm/*/; do
echo "Publishing $dir"
(cd "$dir" && npm publish --access public)
done
echo "Publishing main package"
npm publish --access public npm publish --access public
+53 -53
View File
@@ -75,8 +75,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-android-arm64') const binding = require('firecrawl-pdf-inspector-android-arm64')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-android-arm64/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-android-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -91,8 +91,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-android-arm-eabi') const binding = require('firecrawl-pdf-inspector-android-arm-eabi')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-android-arm-eabi/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-android-arm-eabi/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -112,8 +112,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-win32-x64-gnu') const binding = require('firecrawl-pdf-inspector-win32-x64-gnu')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-win32-x64-gnu/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-win32-x64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -128,8 +128,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-win32-x64-msvc') const binding = require('firecrawl-pdf-inspector-win32-x64-msvc')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-win32-x64-msvc/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-win32-x64-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -145,8 +145,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-win32-ia32-msvc') const binding = require('firecrawl-pdf-inspector-win32-ia32-msvc')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-win32-ia32-msvc/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-win32-ia32-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -161,8 +161,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-win32-arm64-msvc') const binding = require('firecrawl-pdf-inspector-win32-arm64-msvc')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-win32-arm64-msvc/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-win32-arm64-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -180,8 +180,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-darwin-universal') const binding = require('firecrawl-pdf-inspector-darwin-universal')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-darwin-universal/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-darwin-universal/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -196,8 +196,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-darwin-x64') const binding = require('firecrawl-pdf-inspector-darwin-x64')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-darwin-x64/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-darwin-x64/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -212,8 +212,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-darwin-arm64') const binding = require('firecrawl-pdf-inspector-darwin-arm64')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-darwin-arm64/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-darwin-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -232,8 +232,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-freebsd-x64') const binding = require('firecrawl-pdf-inspector-freebsd-x64')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-freebsd-x64/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-freebsd-x64/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -248,8 +248,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-freebsd-arm64') const binding = require('firecrawl-pdf-inspector-freebsd-arm64')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-freebsd-arm64/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-freebsd-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -269,8 +269,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-x64-musl') const binding = require('firecrawl-pdf-inspector-linux-x64-musl')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-x64-musl/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-x64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -285,8 +285,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-x64-gnu') const binding = require('firecrawl-pdf-inspector-linux-x64-gnu')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-x64-gnu/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-x64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -303,8 +303,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-arm64-musl') const binding = require('firecrawl-pdf-inspector-linux-arm64-musl')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-arm64-musl/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-arm64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -319,8 +319,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-arm64-gnu') const binding = require('firecrawl-pdf-inspector-linux-arm64-gnu')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-arm64-gnu/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-arm64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -337,8 +337,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-arm-musleabihf') const binding = require('firecrawl-pdf-inspector-linux-arm-musleabihf')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-arm-musleabihf/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-arm-musleabihf/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -353,8 +353,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-arm-gnueabihf') const binding = require('firecrawl-pdf-inspector-linux-arm-gnueabihf')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-arm-gnueabihf/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-arm-gnueabihf/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -371,8 +371,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-loong64-musl') const binding = require('firecrawl-pdf-inspector-linux-loong64-musl')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-loong64-musl/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-loong64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -387,8 +387,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-loong64-gnu') const binding = require('firecrawl-pdf-inspector-linux-loong64-gnu')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-loong64-gnu/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-loong64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -405,8 +405,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-riscv64-musl') const binding = require('firecrawl-pdf-inspector-linux-riscv64-musl')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-riscv64-musl/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-riscv64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -421,8 +421,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-riscv64-gnu') const binding = require('firecrawl-pdf-inspector-linux-riscv64-gnu')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-riscv64-gnu/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-riscv64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -438,8 +438,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-ppc64-gnu') const binding = require('firecrawl-pdf-inspector-linux-ppc64-gnu')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-ppc64-gnu/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-ppc64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -454,8 +454,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-linux-s390x-gnu') const binding = require('firecrawl-pdf-inspector-linux-s390x-gnu')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-linux-s390x-gnu/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-linux-s390x-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -474,8 +474,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-openharmony-arm64') const binding = require('firecrawl-pdf-inspector-openharmony-arm64')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-openharmony-arm64/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-openharmony-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -490,8 +490,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-openharmony-x64') const binding = require('firecrawl-pdf-inspector-openharmony-x64')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-openharmony-x64/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-openharmony-x64/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -506,8 +506,8 @@ function requireNative() {
loadErrors.push(e) loadErrors.push(e)
} }
try { try {
const binding = require('@firecrawl/pdf-inspector-js-openharmony-arm') const binding = require('firecrawl-pdf-inspector-openharmony-arm')
const bindingPackageVersion = require('@firecrawl/pdf-inspector-js-openharmony-arm/package.json').version const bindingPackageVersion = require('firecrawl-pdf-inspector-openharmony-arm/package.json').version
if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
@@ -538,7 +538,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
} }
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
try { try {
wasiBinding = require('@firecrawl/pdf-inspector-js-wasm32-wasi') wasiBinding = require('firecrawl-pdf-inspector-wasm32-wasi')
nativeBinding = wasiBinding nativeBinding = wasiBinding
} catch (err) { } catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) { if (process.env.NAPI_RS_FORCE_WASI) {
+3 -7
View File
@@ -1,19 +1,19 @@
{ {
"name": "@firecrawl/pdf-inspector-js", "name": "firecrawl-pdf-inspector",
"version": "0.2.0", "version": "0.2.0",
"main": "index.js", "main": "index.js",
"types": "index.d.ts", "types": "index.d.ts",
"license": "MIT", "license": "MIT",
"files": [ "files": [
"index.js", "index.js",
"index.d.ts" "index.d.ts",
"*.node"
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/firecrawl/pdf-inspector" "url": "https://github.com/firecrawl/pdf-inspector"
}, },
"publishConfig": { "publishConfig": {
"registry": "https://npm.pkg.github.com",
"access": "public" "access": "public"
}, },
"napi": { "napi": {
@@ -26,10 +26,6 @@
"name": "@firecrawl/pdf-inspector-js" "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": { "scripts": {
"build": "napi build --platform --release", "build": "napi build --platform --release",
"build:debug": "napi build --platform" "build:debug": "napi build --platform"