npm-publish
Publishing duroxide-node to npm. Use when releasing a new version, building platform binaries, or publishing to the npm registry.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Publishing duroxide-node to npm. Use when releasing a new version, building platform binaries, or publishing to the npm registry.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | npm-publish |
| description | Publishing duroxide-node to npm. Use when releasing a new version, building platform binaries, or publishing to the npm registry. |
Before publishing, verify ALL of the following:
cd duroxide-node
# Clippy — must pass with zero warnings
cargo clippy --all-targets
# Release build via napi
npx napi build --platform --release
# All 52 tests must pass (requires DATABASE_URL in .env)
npm run test:all
CHANGELOG.md must have an entry for the new versionVerify README.md contains a link to CHANGELOG.md:
> See [CHANGELOG.md](CHANGELOG.md) for release notes.
Update version in package.json and all platform package.json files:
# Bump version (also updates npm/npm/*/package.json)
npx napi version
Or manually update package.json version field and ensure optionalDependencies versions match.
Three platforms are supported:
npx napi build --platform --release
cp duroxide.darwin-arm64.node npm/npm/darwin-arm64/
rustup target add x86_64-apple-darwin # one-time
npx napi build --platform --release --target x86_64-apple-darwin
cp duroxide.darwin-x64.node npm/npm/darwin-x64/
docker run --rm -v "$(pwd):/build" -w /build --platform linux/amd64 rust:latest bash -c "
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - &&
apt-get install -y nodejs &&
npm install &&
npx napi build --platform --release --target x86_64-unknown-linux-gnu
"
cp duroxide.linux-x64-gnu.node npm/npm/linux-x64-gnu/
Not currently built. Can be added with cargo-xwin in a Linux Docker container.
Platform packages MUST be published before the main package (npm resolves optionalDependencies at install time).
# Requires an npm Automation token (bypasses 2FA)
AUTH="--//registry.npmjs.org/:_authToken=<TOKEN>"
cd npm/npm/darwin-arm64 && npm publish --access public $AUTH && cd -
cd npm/npm/darwin-x64 && npm publish --access public $AUTH && cd -
cd npm/npm/linux-x64-gnu && npm publish --access public $AUTH && cd -
cd duroxide-node
npm publish --access public $AUTH
The prepublishOnly script runs napi prepublish -t npm automatically, which verifies platform binaries exist.
⚠️ A release is NOT complete until ALL packages are verified on npm. The main duroxide package depends on platform binary packages via optionalDependencies. If any platform package is missing, the install will silently succeed but the native binary won't load at runtime.
Step 3a: Verify all platform packages exist on npm
VERSION="<NEW_VERSION>" # e.g., 0.1.14
for pkg in duroxide-darwin-arm64 duroxide-darwin-x64 duroxide-linux-x64-gnu duroxide-windows-x64; do
echo -n "$pkg@$VERSION: "
npm view "$pkg@$VERSION" version 2>/dev/null && echo "✅" || echo "❌ MISSING — DO NOT PROCEED"
done
If ANY platform package shows ❌, STOP and fix before continuing. The most common failure mode is version skew — the platform package.json files (npm/npm/*/package.json) were not bumped to match the main package.json version. This causes npm publish to try re-publishing an old version, which npm rejects with E403, and the || true in CI silently swallows the error.
Step 3b: Verify main package
npm view "duroxide@$VERSION" version
Step 3c: Integration test in a clean directory
cd /tmp && mkdir test-duroxide && cd test-duroxide
npm install duroxide@$VERSION
node -e "const d = require('duroxide'); console.log('loaded:', Object.keys(d).slice(0,5))"
rm -rf /tmp/test-duroxide
All three steps must pass. If Step 3c fails with a missing native binary error, one of the platform packages is broken.
When bumping versions, update optionalDependencies in the main package.json to match:
"optionalDependencies": {
"duroxide-darwin-arm64": "<NEW_VERSION>",
"duroxide-darwin-x64": "<NEW_VERSION>",
"duroxide-linux-x64-gnu": "<NEW_VERSION>",
"duroxide-win32-x64-msvc": "<NEW_VERSION>"
}
cargo clippy --all-targets — zero warningsnpx napi build --platform --release — clean buildnpm run test:all — all tests passCHANGELOG.md — updated for new versionREADME.md — links to CHANGELOG.mdpackage.json + ALL platform packages (npm/npm/*/package.json)npm/npm/*/npm view <pkg>@<version>)npm view duroxide@<version>)npm install duroxide in a clean directory — native binary loads