vx-tool-bun

Crates.iovx-tool-bun
lib.rsvx-tool-bun
version0.4.0
created_at2025-06-19 10:55:44.066548+00
updated_at2025-06-19 13:59:03.16714+00
descriptionBun package manager support for vx
homepagehttps://github.com/loonghao/vx
repositoryhttps://github.com/loonghao/vx
max_upload_size
id1718191
size32,711
Hal (loonghao)

documentation

README

vx-pm-bun

Crates.io Documentation License: MIT

Bun package manager and runtime support for the vx universal tool manager.

Status

🚧 Under Development - This crate is currently under development and not yet implemented.

Overview

vx-pm-bun will provide Bun package manager and runtime support for vx, enabling ultra-fast JavaScript/TypeScript development with built-in bundling, testing, and package management through the vx interface.

Planned Features

  • Bun Runtime: Fast JavaScript/TypeScript runtime
  • Package Manager: Lightning-fast package installation
  • Built-in Bundler: Zero-configuration bundling
  • Test Runner: Built-in test runner with Jest compatibility
  • TypeScript Support: Native TypeScript execution
  • Hot Reloading: Fast development server with hot reloading
  • Web APIs: Node.js and Web API compatibility

Planned Commands

Runtime

# Execute JavaScript/TypeScript (planned)
vx bun run script.js
vx bun run script.ts
vx bun --version

# REPL (planned)
vx bun repl

Package Management

# Install packages (planned)
vx bun install
vx bun add express
vx bun add --dev @types/node
vx bun remove express

# Update packages (planned)
vx bun update
vx bun outdated

Development Server

# Development server (planned)
vx bun dev
vx bun --hot run server.ts
vx bun --watch run script.ts

Bundling

# Build and bundle (planned)
vx bun build ./src/index.ts --outdir ./dist
vx bun build --minify --target browser
vx bun build --format esm --splitting

Testing

# Test runner (planned)
vx bun test
vx bun test --watch
vx bun test --coverage

Current Status

This crate is currently in the planning phase. JavaScript/Node.js development is currently supported through:

Development Roadmap

  1. Phase 1: Basic Bun runtime and package manager
  2. Phase 2: Development server and hot reloading
  3. Phase 3: Built-in bundler and build tools
  4. Phase 4: Test runner and advanced features

Bun Advantages (Planned)

Performance

  • 3x faster than Node.js for many workloads
  • 20x faster package installation than npm
  • Native bundling without external tools
  • Fast startup with optimized runtime

Developer Experience

  • Zero configuration: Works out of the box
  • TypeScript native: No compilation step needed
  • Hot reloading: Instant feedback during development
  • All-in-one: Runtime, package manager, bundler, and test runner

Compatibility

  • Node.js APIs: Drop-in replacement for most Node.js code
  • npm packages: Compatible with existing npm ecosystem
  • Web APIs: Fetch, WebSocket, and other Web APIs built-in

Feature Comparison

Feature Node.js + NPM (Available) Bun (Planned)
JavaScript Runtime 🚧
TypeScript Support ⚠️ (requires compilation) 🚧 (native)
Package Manager 🚧
Bundler ❌ (external tools) 🚧 (built-in)
Test Runner ❌ (external tools) 🚧 (built-in)
Hot Reloading ❌ (external tools) 🚧 (built-in)
Performance ⚠️ 🚧 (3x faster)

Contributing

This crate is not yet implemented. If you're interested in contributing to Bun support in vx, please:

  1. Check the main project issues
  2. Join the discussion about Bun runtime and package manager support
  3. See the contributing guidelines

Alternative Solutions

While this crate is under development, consider these alternatives:

Node.js + NPM (Available Now)

# Use Node.js and NPM for JavaScript development
vx npm install express
vx node server.js
vx npm run dev

System Bun

# Use system Bun with vx
vx --use-system-path bun --version
vx --use-system-path bun install
vx --use-system-path bun run dev

Configuration (Planned)

Project Configuration (.vx.toml)

# Planned configuration
[tools]
bun = "latest"

[bun]
auto_install = true
prefer_bun = true         # Prefer bun over node for JS execution

Bun Configuration (bunfig.toml)

# Planned Bun configuration integration
[install]
registry = "https://registry.npmjs.org/"
cache = "~/.bun/install/cache"

[run]
bun = true
hot = true

[test]
coverage = true

Use Cases (Planned)

Full-Stack Development

# Frontend + Backend with Bun (planned)
vx bun create next-app frontend
vx bun create hono-app backend

# Development
vx bun dev                # Start dev server
vx bun test              # Run tests
vx bun build             # Build for production

TypeScript Development

# Native TypeScript execution (planned)
vx bun run server.ts     # No compilation needed
vx bun test *.test.ts    # Test TypeScript directly
vx bun build src/index.ts --outdir dist

Package Development

# Library development (planned)
vx bun init
vx bun add --dev typescript
vx bun build --format esm,cjs
vx bun test
vx bun publish

Performance Benchmarks (Expected)

Package Installation

# npm (current)
time vx npm install      # ~30 seconds

# bun (planned)
time vx bun install      # ~1.5 seconds (20x faster)

Runtime Performance

# Node.js (current)
time vx node server.js   # baseline

# Bun (planned)
time vx bun run server.js # 3x faster startup

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related Crates

Commit count: 240

cargo fmt