Skip to main content

Publishing VibeTunnel to npm

This guide helps the repository owner publish VibeTunnel to npm as a standalone package.

Prerequisites

  1. npm account with publish access to vibetunnel
  2. Node.js 22.12 through 24.x installed
  3. Apple Silicon Mac for the complete multi-platform package
  4. Docker installed (for Linux builds)
  5. Rustup installed; native/vt-fwd/rust-toolchain.toml pins the forwarder toolchain

Publishing Checklist

1. Update Version

2. Build for npm

3. Test Locally

4. Publish to npm

5. Verify Publication

Package Configuration

The package is configured with:
  • Name: vibetunnel (unscoped)
  • Main: lib/cli.js (entry point)
  • Bin: vibetunnel command
  • Platforms: macOS (x64, arm64) and Linux (x64, arm64)
  • Node: Requires Node.js 22+

Rust Forwarder Outputs

pnpm run build builds the host forwarder and installs it at native/vibetunnel-fwd and bin/vibetunnel-fwd under web/. pnpm run build:npm additionally stages the selected package targets at:
The selected directories are copied unchanged to web/dist-npm/forwarders/ and then into the package archive. At runtime the CLI selects forwarders/<process.platform>-<process.arch>/vibetunnel-fwd; the postinstall script makes that binary executable. A complete macOS build creates all four targets. Filtered and --current-only builds include only their selected targets.

What Gets Published

The npm package includes:
  • ✅ Compiled JavaScript (lib/)
  • ✅ Web UI files (public/)
  • ✅ CLI binary (bin/vibetunnel)
  • ✅ Rust forwarders (forwarders/<platform>-<arch>/vibetunnel-fwd)
  • ✅ Prebuilt native binaries (prebuilds/)
  • ✅ README files (README.md, README.npm.md, README.standalone.md)
  • ✅ Runtime-only Dockerfile for building directly from extracted package contents
  • ✅ Postinstall scripts
Not included:
  • ❌ Source TypeScript files
  • ❌ Test files
  • ❌ Development configs
  • ❌ Mac/iOS app code

Version Management

Follow semantic versioning:
  • Patch (1.0.x): Bug fixes, small improvements
  • Minor (1.x.0): New features, backward compatible
  • Major (x.0.0): Breaking changes
Current version scheme:
  • 1.0.0-beta.X for beta releases
  • 1.0.0 for first stable release

Troubleshooting

Build Fails

Complete multi-platform builds require macOS. On Linux, use pnpm run build:npm -- --current-only or pnpm run build:npm -- --platform linux.

Missing Prebuilds

Permission Denied

Already Published Version

Post-Publishing

After successful publication:
  1. Test with npx: npx vibetunnel --version
  2. Update documentation: Add npm badge to main README
  3. Create GitHub release: Tag the version
  4. Announce: Twitter, Discord, etc.

Automation (Future)

Consider setting up GitHub Actions:

Support

For issues with publishing, check: