feat: switch project from pnpm to bun

This commit is contained in:
Bohdan Triapitsyn
2025-12-26 16:45:30 +02:00
parent ba0629f955
commit ff874cc33d
17 changed files with 3055 additions and 12096 deletions
+9 -11
View File
@@ -84,14 +84,13 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup pnpm - name: Setup bun
uses: pnpm/action-setup@v4 uses: oven-sh/setup-bun@v2
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '20' node-version: '20'
cache: 'pnpm'
- name: Install Rust stable - name: Install Rust stable
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
@@ -102,7 +101,7 @@ jobs:
workspaces: packages/desktop/src-tauri workspaces: packages/desktop/src-tauri
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: bun install --frozen-lockfile
- name: Install Apple Certificate - name: Install Apple Certificate
env: env:
@@ -146,10 +145,10 @@ jobs:
--password "$APPLE_PASSWORD" --password "$APPLE_PASSWORD"
- name: Build UI package - name: Build UI package
run: pnpm -C packages/ui run build run: bun run --cwd packages/ui build
- name: Build Desktop app - name: Build Desktop app
run: pnpm desktop:build run: bun run desktop:build
env: env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
@@ -221,21 +220,20 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup pnpm - name: Setup bun
uses: pnpm/action-setup@v4 uses: oven-sh/setup-bun@v2
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '20' node-version: '20'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: bun install --frozen-lockfile
- name: Build packages - name: Build packages
run: pnpm run build run: bun run build
- name: Create npm tarball - name: Create npm tarball
working-directory: packages/web working-directory: packages/web
+7 -8
View File
@@ -19,31 +19,30 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup pnpm - name: Setup bun
uses: pnpm/action-setup@v4 uses: oven-sh/setup-bun@v2
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '20' node-version: '20'
cache: 'pnpm'
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: bun install --frozen-lockfile
- name: Build VS Code extension - name: Build VS Code extension
run: pnpm -C packages/vscode run build run: bun run --cwd packages/vscode build
- name: Package extension - name: Package extension
run: pnpm -C packages/vscode exec vsce package --no-dependencies run: cd packages/vscode && bunx vsce package --no-dependencies
- name: Publish to VS Code Marketplace - name: Publish to VS Code Marketplace
if: ${{ env.VSCE_PAT != '' }} if: ${{ env.VSCE_PAT != '' }}
run: pnpm -C packages/vscode exec vsce publish -p "$VSCE_PAT" --no-dependencies run: cd packages/vscode && bunx vsce publish -p "$VSCE_PAT" --no-dependencies
- name: Publish to Open VSX - name: Publish to Open VSX
if: ${{ env.OVSX_PAT != '' }} if: ${{ env.OVSX_PAT != '' }}
run: pnpm -C packages/vscode dlx ovsx publish packages/vscode/*.vsix -p "$OVSX_PAT" run: bunx ovsx publish packages/vscode/*.vsix -p "$OVSX_PAT"
- name: Upload VSIX artifact - name: Upload VSIX artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
+7 -7
View File
@@ -60,16 +60,16 @@ Extension in `packages/vscode`: Extension entry in `src/` (ChatViewProvider, bri
Always validate changes: Always validate changes:
```bash ```bash
pnpm -r type-check # TypeScript validation bun run type-check # TypeScript validation
pnpm -r lint # ESLint checks bun run lint # ESLint checks
pnpm -r build # Production build bun run build # Production build
``` ```
### Building ### Building
```bash ```bash
pnpm run build # Build all packages bun run build # Build all packages
pnpm run desktop:build # Build desktop app bun run desktop:build # Build desktop app
pnpm vscode:build # Build VS Code extension bun run vscode:build # Build VS Code extension
``` ```
## Communication & Output Discipline (MANDATORY) ## Communication & Output Discipline (MANDATORY)
@@ -98,7 +98,7 @@ SDK-managed SSE with AsyncGenerator, temp->real session ID swap (optimistic UI),
### Lint & Type Safety ### Lint & Type Safety
- Never land code that introduces new ESLint or TypeScript errors - Never land code that introduces new ESLint or TypeScript errors
- Run `pnpm run lint` and `pnpm run type-check` before finalizing changes - Run `bun run lint` and `bun run type-check` before finalizing changes
- Adding `eslint-disable` requires justification in a comment explaining why typing is impossible - Adding `eslint-disable` requires justification in a comment explaining why typing is impossible
- Do **not** use `any` or `unknown` casts as escape hatches; build narrow adapter interfaces instead - Do **not** use `any` or `unknown` casts as escape hatches; build narrow adapter interfaces instead
- Refactors or new features must keep existing lint/type baselines green - Refactors or new features must keep existing lint/type baselines green
+8 -8
View File
@@ -5,27 +5,27 @@
```bash ```bash
git clone https://github.com/btriapitsyn/openchamber.git git clone https://github.com/btriapitsyn/openchamber.git
cd openchamber cd openchamber
pnpm install bun install
# Web development # Web development
pnpm run dev:web:full bun run dev:web:full
# Desktop app (Tauri) # Desktop app (Tauri)
pnpm desktop:dev bun run desktop:dev
# VS Code extension # VS Code extension
pnpm vscode:build && code --extensionDevelopmentPath="$(pwd)/packages/vscode" bun run vscode:build && code --extensionDevelopmentPath="$(pwd)/packages/vscode"
# Production build # Production build
pnpm run build bun run build
``` ```
## Before Submitting ## Before Submitting
```bash ```bash
pnpm -r type-check # Must pass bun run type-check # Must pass
pnpm -r lint # Must pass bun run lint # Must pass
pnpm -r build # Must succeed bun run build # Must succeed
``` ```
## Code Style ## Code Style
+2 -2
View File
@@ -73,7 +73,7 @@ The whole project was built entirely with AI coding agents under my supervision.
### VS Code Extension ### VS Code Extension
Install from [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=fedaykindev.openchamber) or search "OpenChamber" in Extensions. Install from [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=fedaykindev.openchamber) / [Open VSX Registry](https://open-vsx.org/extension/FedaykinDev/openchamber) or search "OpenChamber" in Extensions.
### CLI (Web Server) ### CLI (Web Server)
@@ -82,7 +82,7 @@ Install from [VS Code Marketplace](https://marketplace.visualstudio.com/items?it
curl -fsSL https://raw.githubusercontent.com/btriapitsyn/openchamber/main/scripts/install.sh | bash curl -fsSL https://raw.githubusercontent.com/btriapitsyn/openchamber/main/scripts/install.sh | bash
# Or install manually # Or install manually
pnpm add -g @openchamber/web # or npm, yarn, bun bun add -g @openchamber/web # or npm, pnpm, yarn
``` ```
```bash ```bash
+2980
View File
File diff suppressed because it is too large Load Diff
+27 -27
View File
@@ -4,7 +4,7 @@
"description": "OpenChamber monorepo workspace for web, ui, and desktop runtimes", "description": "OpenChamber monorepo workspace for web, ui, and desktop runtimes",
"private": true, "private": true,
"type": "module", "type": "module",
"packageManager": "pnpm@10.22.0", "packageManager": "bun@1.3.5",
"workspaces": [ "workspaces": [
"packages/*" "packages/*"
], ],
@@ -21,36 +21,36 @@
"author": "Bohdan Triapitsyn", "author": "Bohdan Triapitsyn",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "pnpm --if-present run --recursive --filter \"./packages/*\" build", "build": "bun run --filter '*' build",
"build:web": "pnpm -C packages/web run build", "build:web": "bun run --cwd packages/web build",
"build:ui": "pnpm -C packages/ui run build", "build:ui": "bun run --cwd packages/ui build",
"build:desktop": "pnpm -C packages/desktop run build", "build:desktop": "bun run --cwd packages/desktop build",
"type-check": "pnpm --if-present run --recursive --filter \"./packages/*\" type-check", "type-check": "bun run --filter '*' type-check",
"type-check:web": "pnpm -C packages/web run type-check", "type-check:web": "bun run --cwd packages/web type-check",
"type-check:ui": "pnpm -C packages/ui run type-check", "type-check:ui": "bun run --cwd packages/ui type-check",
"type-check:desktop": "pnpm -C packages/desktop run type-check", "type-check:desktop": "bun run --cwd packages/desktop type-check",
"lint": "pnpm --if-present run --recursive --filter \"./packages/*\" lint", "lint": "bun run --filter '*' lint",
"lint:web": "pnpm -C packages/web run lint", "lint:web": "bun run --cwd packages/web lint",
"lint:ui": "pnpm -C packages/ui run lint", "lint:ui": "bun run --cwd packages/ui lint",
"lint:desktop": "pnpm -C packages/desktop run lint", "lint:desktop": "bun run --cwd packages/desktop lint",
"clean": "pnpm --if-present run --recursive --filter \"./packages/*\" clean", "clean": "bun run --filter '*' clean",
"dev:web": "pnpm -C packages/web run build:watch", "dev:web": "bun run --cwd packages/web build:watch",
"dev:web:server": "pnpm -C packages/web run dev:server:watch", "dev:web:server": "bun run --cwd packages/web dev:server:watch",
"dev:web:full": "concurrently -n \"api,build\" -c \"cyan,magenta\" \"pnpm -C packages/web run dev:server:watch\" \"pnpm -C packages/web run build:watch\"", "dev:web:full": "concurrently -n \"api,build\" -c \"cyan,magenta\" \"bun run --cwd packages/web dev:server:watch\" \"bun run --cwd packages/web build:watch\"",
"start:web": "pnpm -C packages/web run start", "start:web": "bun run --cwd packages/web start",
"pack:web": "pnpm -C packages/web pack --pack-destination .", "pack:web": "bun pm pack --cwd packages/web",
"desktop:start-cli": "node ./packages/desktop/scripts/opencode-cli.mjs start", "desktop:start-cli": "node ./packages/desktop/scripts/opencode-cli.mjs start",
"desktop:stop-cli": "node ./packages/desktop/scripts/opencode-cli.mjs stop", "desktop:stop-cli": "node ./packages/desktop/scripts/opencode-cli.mjs stop",
"desktop:dev": "node ./packages/desktop/scripts/desktop-dev.mjs", "desktop:dev": "node ./packages/desktop/scripts/desktop-dev.mjs",
"desktop:build": "pnpm -C packages/desktop build && pnpm -C packages/desktop tauri build", "desktop:build": "bun run --cwd packages/desktop build && bun run --cwd packages/desktop tauri build",
"desktop:lint": "pnpm -C packages/desktop run lint && cargo fmt --manifest-path packages/desktop/src-tauri/Cargo.toml -- --check && cargo clippy --manifest-path packages/desktop/src-tauri/Cargo.toml -- -D warnings", "desktop:lint": "bun run --cwd packages/desktop lint && cargo fmt --manifest-path packages/desktop/src-tauri/Cargo.toml -- --check && cargo clippy --manifest-path packages/desktop/src-tauri/Cargo.toml -- -D warnings",
"desktop:type-check": "pnpm -C packages/desktop run type-check && cargo fmt --manifest-path packages/desktop/src-tauri/Cargo.toml -- --check && cargo clippy --manifest-path packages/desktop/src-tauri/Cargo.toml -- -D warnings", "desktop:type-check": "bun run --cwd packages/desktop type-check && cargo fmt --manifest-path packages/desktop/src-tauri/Cargo.toml -- --check && cargo clippy --manifest-path packages/desktop/src-tauri/Cargo.toml -- -D warnings",
"vscode:dev": "pnpm -C packages/vscode run dev", "vscode:dev": "bun run --cwd packages/vscode dev",
"vscode:build": "pnpm -C packages/vscode run build", "vscode:build": "bun run --cwd packages/vscode build",
"vscode:package": "pnpm -C packages/vscode run package", "vscode:package": "bun run --cwd packages/vscode package",
"vscode:type-check": "pnpm -C packages/vscode run type-check", "vscode:type-check": "bun run --cwd packages/vscode type-check",
"version:bump": "node scripts/bump-version.mjs", "version:bump": "node scripts/bump-version.mjs",
"release:prepare": "pnpm run build && pnpm run type-check && pnpm run lint" "release:prepare": "bun run build && bun run type-check && bun run lint"
}, },
"dependencies": { "dependencies": {
"@fontsource/ibm-plex-mono": "^5.2.7", "@fontsource/ibm-plex-mono": "^5.2.7",
+2 -2
View File
@@ -43,8 +43,8 @@ Currently available for macOS (Apple Silicon).
```bash ```bash
git clone https://github.com/btriapitsyn/openchamber.git git clone https://github.com/btriapitsyn/openchamber.git
cd openchamber cd openchamber
pnpm install bun install
pnpm run desktop:dev bun run desktop:dev
``` ```
## License ## License
+1 -1
View File
@@ -21,7 +21,7 @@ function spawnProcess(command, args, opts = {}) {
async function main() { async function main() {
await startCli(); await startCli();
const tauriProcess = spawnProcess('pnpm', ['-C', desktopDir, 'tauri', 'dev', '--features', 'devtools']); const tauriProcess = spawnProcess('bun', ['--cwd', desktopDir, 'tauri', 'dev', '--features', 'devtools']);
let cleaning = false; let cleaning = false;
+1 -1
View File
@@ -2847,7 +2847,7 @@ dependencies = [
[[package]] [[package]]
name = "openchamber-desktop" name = "openchamber-desktop"
version = "1.3.4" version = "1.3.5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum",
+2 -2
View File
@@ -4,8 +4,8 @@
"version": "1.3.5", "version": "1.3.5",
"identifier": "ai.opencode.openchamber", "identifier": "ai.opencode.openchamber",
"build": { "build": {
"beforeDevCommand": "pnpm dev", "beforeDevCommand": "bun run dev",
"beforeBuildCommand": "pnpm build", "beforeBuildCommand": "bun run build",
"devUrl": "http://127.0.0.1:1421", "devUrl": "http://127.0.0.1:1421",
"frontendDist": "../dist" "frontendDist": "../dist"
}, },
+3 -3
View File
@@ -50,9 +50,9 @@ OpenChamber inside VS Code: embeds the OpenChamber chat UI in the activity bar a
## Development ## Development
```bash ```bash
pnpm install bun install
pnpm -C packages/vscode run build # build extension + webview bun run --cwd packages/vscode build # build extension + webview
pnpm -C packages/vscode exec vsce package --no-dependencies cd packages/vscode && bunx vsce package --no-dependencies
``` ```
## Local Install ## Local Install
+4 -4
View File
@@ -75,15 +75,15 @@
} }
}, },
"scripts": { "scripts": {
"vscode:prepublish": "pnpm run build", "vscode:prepublish": "bun run build",
"build": "pnpm run build:extension && pnpm run build:webview", "build": "bun run build:extension && bun run build:webview",
"build:extension": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node --minify", "build:extension": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node --minify",
"build:webview": "VITE_OPENCODE_URL=/api vite build", "build:webview": "VITE_OPENCODE_URL=/api vite build",
"dev": "concurrently -n \"ext,web\" -c \"cyan,magenta\" \"pnpm run watch:extension\" \"pnpm run watch:webview\"", "dev": "concurrently -n \"ext,web\" -c \"cyan,magenta\" \"bun run watch:extension\" \"bun run watch:webview\"",
"watch:extension": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node --watch --sourcemap", "watch:extension": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node --watch --sourcemap",
"watch:webview": "vite build --watch", "watch:webview": "vite build --watch",
"type-check": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.webview.json", "type-check": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.webview.json",
"lint": "pnpm dlx eslint --ext .ts,.tsx src webview", "lint": "bunx eslint --ext .ts,.tsx src webview",
"package": "vsce package --no-dependencies" "package": "vsce package --no-dependencies"
}, },
"devDependencies": { "devDependencies": {
+1 -1
View File
@@ -13,7 +13,7 @@ https://github.com/btriapitsyn/openchamber
curl -fsSL https://raw.githubusercontent.com/btriapitsyn/openchamber/main/scripts/install.sh | bash curl -fsSL https://raw.githubusercontent.com/btriapitsyn/openchamber/main/scripts/install.sh | bash
# Or install manually # Or install manually
npm add -g @openchamber/web # or pnpm, yarn, bun bun add -g @openchamber/web # or npm, pnpm, yarn
``` ```
## Usage ## Usage
+1 -1
View File
@@ -12,7 +12,7 @@
"access": "public" "access": "public"
}, },
"scripts": { "scripts": {
"dev": "pnpm run build:watch", "dev": "bun run build:watch",
"dev:server": "node server/index.js --port 3001", "dev:server": "node server/index.js --port 3001",
"dev:server:watch": "nodemon --watch server --ext js --exec \"node server/index.js --port 3001\"", "dev:server:watch": "nodemon --watch server --ext js --exec \"node server/index.js --port 3001\"",
"build": "vite build", "build": "vite build",
-12006
View File
File diff suppressed because it is too large Load Diff
-12
View File
@@ -1,12 +0,0 @@
packages:
- packages/*
onlyBuiltDependencies:
- '@heroui/shared-utils'
- '@ibm/plex'
- '@tailwindcss/oxide'
- '@vscode/vsce-sign'
- electron
- esbuild
- keytar
- node-pty