Publishing VibeTunnel to npm
This guide helps the repository owner publish VibeTunnel to npm as a standalone package.Prerequisites
- npm account with publish access to
vibetunnel - Node.js 22.12 through 24.x installed
- Apple Silicon Mac for the complete multi-platform package
- Docker installed (for Linux builds)
- Rustup installed;
native/vt-fwd/rust-toolchain.tomlpins 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:
vibetunnelcommand - 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:
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
- ❌ 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
1.0.0-beta.Xfor beta releases1.0.0for first stable release
Troubleshooting
Build Fails
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:- Test with npx:
npx vibetunnel --version - Update documentation: Add npm badge to main README
- Create GitHub release: Tag the version
- Announce: Twitter, Discord, etc.
Automation (Future)
Consider setting up GitHub Actions:Support
For issues with publishing, check:- npm documentation
- GitHub issues
- npm support: support@npmjs.com