Internal documentation for maintainers.
The npm package version and Go binary version are tracked separately in package.json:
version: npm package versionbinaryVersion: Go binary version
-
Ensure all tests pass:
npm test -
Bump npm package version:
npm version patch # or minor, major -
If binary changes are needed, bump
binaryVersioninpackage.jsonand push a tag:git tag binary-v1.0.1 && git push origin binary-v1.0.1GitHub Actions automatically builds and publishes binaries for all platforms.
-
Publish to npm:
npm publish
-
Push version tag:
git push --follow-tags
Binaries are downloaded from GitHub releases during npm install:
npm install # Downloads binaries to ~/.nvu/bin/
npm test # Runs all tests using downloaded binaries
npm run clean # Clear all temp filesTests use NVU_HOME environment variable for isolation:
- Binaries:
~/.nvu/bin/(downloaded from releases) - Test NVU_HOME:
.tmp/commands/or.tmp/binary-test/
For local Go binary development:
# Build for current platform
cd binary && make local
# Build all platforms
cd binary && make release
# Install to ~/.nvu/bin
cd binary && make install- Make changes to
binary/main.go - Build locally:
cd binary && make local - Install:
cd binary && make install - Run tests:
npm test - When ready, bump
binaryVersionin package.json and push tag
Run through this checklist before every release:
npm run prepublishOnly- Compiles without errors
- Creates
dist/directory
npm test- All tests pass (53+ tests)
- No timeouts or hangs
nvu engines tsds test:node --no-timeouts- Tests pass on Node 0.8
- Tests pass on Node 0.10
- Tests pass on Node 0.12
- Tests pass on Node 4+
- No
startsWith/includeserrors (useindexOfinstead)
nvu engines node assets/postinstall.cjs- Runs without syntax errors
- Gracefully handles 404 (binaries not published)
- Shows helpful instructions
make -C binary clean && make -C binary all
ls -la binary/build/- All 6 platform binaries created:
nvu-binary-darwin-arm64nvu-binary-darwin-x64nvu-binary-linux-x64nvu-binary-linux-arm64nvu-binary-win32-x64.exenvu-binary-win32-arm64.exe
# Create test environment
mkdir -p .tmp/smoke-test/installed/v20.0.0/bin
echo '#!/bin/sh
echo "v20.0.0"' > .tmp/smoke-test/installed/v20.0.0/bin/node
chmod +x .tmp/smoke-test/installed/v20.0.0/bin/node
echo "20" > .tmp/smoke-test/.nvmrc
cp binary/build/nvu-binary-darwin-arm64 .tmp/smoke-test/node # use your platform
# Test binary
cd .tmp/smoke-test && NVU_HOME=$(pwd) ./node --version
# Should output: v20.0.0- Binary reads .nvmrc
- Binary finds installed version
- Binary proxies to correct node
# Test help
nvu --help
nvu --version
# Test commands
nvu 22 node --version
nvu default 20
nvu local 18
nvu list
nvu which- Help displays correctly
- Version matches package.json
- Commands work as expected
grep -r "shim" --include="*.ts" --include="*.js" --include="*.cjs" --include="*.go" --include="*.md" . | grep -v node_modules | grep -v "os-shim"- No stray "shim" references (except
os-shimnpm package)
-
Node 0.8+ compatibility: Never use
startsWith,includes,endsWith,padStart,padEndon strings/arrays. UseindexOfinstead. -
Missing dependencies: Run
npm run prepublishOnlyto catch missing deps. -
Binary naming: Binaries in
~/.nvu/bin/are namednode,npm,npx(notnvu-binary). -
Version fields:
versionis npm package version,binaryVersionis Go binary version. Update both as needed.