mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 15:24:19 +00:00
build: migrate from pnpm to bun as package manager
Keep pnpm for publish workflow only (publishConfig overrides + provenance). Bun handles install, run, and exec for all other workflows. - Add workspaces field to root package.json for bun workspace support - Replace pnpm setup with oven-sh/setup-bun in CI and release workflows - Update all scripts to use bun run / bun run --filter / bunx - Replace npx with bunx in lefthook hooks - Update CONTRIBUTING.md with bun commands - Delete pnpm-lock.yaml, add bun.lock - Keep pnpm-workspace.yaml for publish workflow compatibility Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
Vance Ingalls
co-authored by
Claude Opus 4.6
parent
a6c5e08abb
commit
0c1d344e3f
+20
-38
@@ -39,15 +39,12 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm build
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run build
|
||||
|
||||
lint-and-format:
|
||||
name: Lint & Format
|
||||
@@ -55,16 +52,13 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm lint
|
||||
- run: pnpm format:check
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run lint
|
||||
- run: bun run format:check
|
||||
|
||||
typecheck:
|
||||
name: Typecheck
|
||||
@@ -74,16 +68,13 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm build
|
||||
- run: pnpm -r typecheck
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run build
|
||||
- run: bun run --filter '*' typecheck
|
||||
|
||||
test-core:
|
||||
name: "Test: core"
|
||||
@@ -93,15 +84,12 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm --filter @hyperframes/core test -- --coverage
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run --filter @hyperframes/core test -- --coverage
|
||||
|
||||
test-engine:
|
||||
name: "Test: engine"
|
||||
@@ -111,15 +99,12 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm --filter @hyperframes/engine test
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run --filter @hyperframes/engine test
|
||||
|
||||
test-runtime-contract:
|
||||
name: "Test: runtime contract"
|
||||
@@ -129,15 +114,12 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm --filter @hyperframes/core test:hyperframe-runtime-ci
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run --filter @hyperframes/core test:hyperframe-runtime-ci
|
||||
|
||||
semantic-pr-title:
|
||||
name: Semantic PR title
|
||||
|
||||
@@ -18,17 +18,14 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: bun install --frozen-lockfile
|
||||
|
||||
- name: Bump versions
|
||||
run: pnpm set-version ${{ inputs.version }}
|
||||
run: bun run set-version ${{ inputs.version }}
|
||||
|
||||
- name: Create release PR
|
||||
env:
|
||||
|
||||
+16
-16
@@ -6,38 +6,38 @@ Thanks for your interest in contributing to Hyperframes! This guide will help yo
|
||||
|
||||
1. Fork the repository
|
||||
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/hyperframes.git`
|
||||
3. Install dependencies: `pnpm install`
|
||||
3. Install dependencies: `bun install`
|
||||
4. Create a branch: `git checkout -b my-feature`
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
pnpm install # Install all dependencies
|
||||
pnpm dev # Run the studio (composition editor)
|
||||
pnpm build # Build all packages
|
||||
pnpm -r typecheck # Type-check all packages
|
||||
pnpm lint # Lint all packages
|
||||
pnpm format:check # Check formatting
|
||||
bun install # Install all dependencies
|
||||
bun run dev # Run the studio (composition editor)
|
||||
bun run build # Build all packages
|
||||
bun run --filter '*' typecheck # Type-check all packages
|
||||
bun run lint # Lint all packages
|
||||
bun run format:check # Check formatting
|
||||
```
|
||||
|
||||
### Running Tests
|
||||
|
||||
```bash
|
||||
pnpm --filter @hyperframes/core test # Core unit tests (vitest)
|
||||
pnpm --filter @hyperframes/engine test # Engine unit tests (vitest)
|
||||
pnpm --filter @hyperframes/core test:hyperframe-runtime-ci # Runtime contract tests
|
||||
bun run --filter @hyperframes/core test # Core unit tests (vitest)
|
||||
bun run --filter @hyperframes/engine test # Engine unit tests (vitest)
|
||||
bun run --filter @hyperframes/core test:hyperframe-runtime-ci # Runtime contract tests
|
||||
```
|
||||
|
||||
### Linting & Formatting
|
||||
|
||||
```bash
|
||||
pnpm lint # Run oxlint
|
||||
pnpm lint:fix # Run oxlint with auto-fix
|
||||
pnpm format # Format all files with oxfmt
|
||||
pnpm format:check # Check formatting without writing
|
||||
bun run lint # Run oxlint
|
||||
bun run lint:fix # Run oxlint with auto-fix
|
||||
bun run format # Format all files with oxfmt
|
||||
bun run format:check # Check formatting without writing
|
||||
```
|
||||
|
||||
Git hooks (via [lefthook](https://github.com/evilmartians/lefthook)) run automatically after `pnpm install` and enforce linting + formatting on staged files before each commit.
|
||||
Git hooks (via [lefthook](https://github.com/evilmartians/lefthook)) run automatically after `bun install` and enforce linting + formatting on staged files before each commit.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
@@ -71,7 +71,7 @@ All packages use **fixed versioning** — every release bumps all packages to th
|
||||
|
||||
```bash
|
||||
# Bump versions, commit to a branch, create PR
|
||||
pnpm set-version 0.2.0
|
||||
bun run set-version 0.2.0
|
||||
git checkout -b release/v0.2.0
|
||||
git add packages/*/package.json
|
||||
git commit -m "chore: release v0.2.0"
|
||||
|
||||
+3
-3
@@ -3,12 +3,12 @@ pre-commit:
|
||||
commands:
|
||||
lint:
|
||||
glob: "*.{js,jsx,ts,tsx}"
|
||||
run: npx oxlint {staged_files}
|
||||
run: bunx oxlint {staged_files}
|
||||
format:
|
||||
glob: "*.{js,jsx,ts,tsx,json,css,md,yaml,yml}"
|
||||
run: npx oxfmt --check {staged_files}
|
||||
run: bunx oxfmt --check {staged_files}
|
||||
|
||||
commit-msg:
|
||||
commands:
|
||||
commitlint:
|
||||
run: npx commitlint --edit "{1}"
|
||||
run: bunx commitlint --edit "{1}"
|
||||
|
||||
+9
-11
@@ -1,14 +1,17 @@
|
||||
{
|
||||
"name": "hyperframes-monorepo",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "pnpm studio",
|
||||
"build": "pnpm -r build",
|
||||
"build:producer": "pnpm --filter @hyperframes/producer build",
|
||||
"studio": "pnpm --filter @hyperframes/studio dev",
|
||||
"build:hyperframes-runtime": "pnpm --filter @hyperframes/core build:hyperframes-runtime",
|
||||
"build:hyperframes-runtime:modular": "pnpm --filter @hyperframes/core build:hyperframes-runtime:modular",
|
||||
"dev": "bun run studio",
|
||||
"build": "bun run --filter '*' build",
|
||||
"build:producer": "bun run --filter @hyperframes/producer build",
|
||||
"studio": "bun run --filter @hyperframes/studio dev",
|
||||
"build:hyperframes-runtime": "bun run --filter @hyperframes/core build:hyperframes-runtime",
|
||||
"build:hyperframes-runtime:modular": "bun run --filter @hyperframes/core build:hyperframes-runtime:modular",
|
||||
"set-version": "tsx scripts/set-version.ts",
|
||||
"lint": "oxlint .",
|
||||
"lint:fix": "oxlint --fix .",
|
||||
@@ -28,10 +31,5 @@
|
||||
"oxlint": "^1.56.0",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"lefthook"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "tsx src/cli.ts",
|
||||
"build": "pnpm build:studio && tsup && pnpm build:runtime && pnpm build:copy",
|
||||
"build:studio": "cd ../studio && pnpm build",
|
||||
"build": "bun run build:studio && tsup && bun run build:runtime && bun run build:copy",
|
||||
"build:studio": "cd ../studio && bun run build",
|
||||
"build:runtime": "tsx scripts/build-runtime.ts",
|
||||
"build:copy": "mkdir -p dist/studio dist/docs dist/templates && cp -r ../studio/dist/* dist/studio/ && cp -r src/templates/warm-grain src/templates/play-mode src/templates/swiss-grid src/templates/vignelli dist/templates/ && (cp src/docs/*.md dist/docs/ 2>/dev/null || true)",
|
||||
"typecheck": "tsc --noEmit"
|
||||
|
||||
@@ -61,7 +61,7 @@ export default defineCommand({
|
||||
});
|
||||
|
||||
/**
|
||||
* Dev mode: spawn pnpm studio from the monorepo (existing behavior).
|
||||
* Dev mode: spawn studio from the monorepo (existing behavior).
|
||||
*/
|
||||
async function runDevMode(dir: string): Promise<void> {
|
||||
// Find monorepo root by navigating from packages/cli/src/commands/
|
||||
@@ -105,7 +105,7 @@ async function runDevMode(dir: string): Promise<void> {
|
||||
|
||||
// Run the new consolidated studio (single Vite dev server with API plugin)
|
||||
const studioPkgDir = join(repoRoot, "packages", "studio");
|
||||
const child = spawn("pnpm", ["exec", "vite"], {
|
||||
const child = spawn("bunx", ["vite"], {
|
||||
cwd: studioPkgDir,
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc && pnpm build:hyperframes-runtime",
|
||||
"build": "tsc && bun run build:hyperframes-runtime",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
@@ -61,10 +61,10 @@
|
||||
"test:hyperframe-runtime-parity": "tsx scripts/test-hyperframe-runtime-parity.ts",
|
||||
"test:hyperframe-runtime-security": "tsx scripts/test-hyperframe-runtime-security.ts",
|
||||
"test:hyperframe-linter": "tsx scripts/test-hyperframe-linter.ts",
|
||||
"test:hyperframe-runtime-ci": "pnpm build:hyperframes-runtime && pnpm test:hyperframe-runtime-contract && pnpm test:hyperframe-runtime-behavior && pnpm test:hyperframe-runtime-seek && pnpm test:hyperframe-runtime-duration-guards && pnpm test:hyperframe-runtime-parity && pnpm test:hyperframe-runtime-security",
|
||||
"test:hyperframe-runtime-ci": "bun run build:hyperframes-runtime && bun run test:hyperframe-runtime-contract && bun run test:hyperframe-runtime-behavior && bun run test:hyperframe-runtime-seek && bun run test:hyperframe-runtime-duration-guards && bun run test:hyperframe-runtime-parity && bun run test:hyperframe-runtime-security",
|
||||
"check:hyperframe-html": "tsx scripts/check-hyperframe-static.ts",
|
||||
"debug:timeline": "tsx scripts/debug-timeline.ts",
|
||||
"prepublishOnly": "pnpm build"
|
||||
"prepublishOnly": "bun run build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jsdom": "^28.0.0",
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm -w build:hyperframes-runtime:modular && node build.mjs",
|
||||
"build": "bun run --cwd ../.. build:hyperframes-runtime:modular && node build.mjs",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"parity:check": "tsx src/parity-harness.ts",
|
||||
"parity:fixtures": "tsx src/parity-fixtures.ts",
|
||||
|
||||
Generated
-6683
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user