Skip to content

Commit

Permalink
[build] Replace bun with pnpm (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamChou19815 authored Jan 28, 2025
1 parent d6df0ea commit f5bdc82
Show file tree
Hide file tree
Showing 8 changed files with 2,205 additions and 1,845 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
- name: Bun Install
run: bun install --frozen-lockfile
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.0.0
- name: pnpm install
run: pnpm install --frozen-lockfile
- name: Generate Static Site
run: bun ssg
run: pnpm ssg

test:
runs-on: ubuntu-latest
Expand All @@ -24,14 +27,17 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22.x
- uses: oven-sh/setup-bun@v1
- name: Bun Install
run: bun install --frozen-lockfile
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.0.0
- name: pnpm install
run: pnpm install --frozen-lockfile
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
key: cargo-build-wasm
- name: Setup wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build and Test WASM
run: bun bw
run: pnpm bw
Binary file removed bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/samlang-wasm/setup-generated-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function autoComplete(
kind: number;
}>;" > samlang-demo/index.d.ts

../../node_modules/.bin/esbuild ./lazy-index.js --bundle --outfile=samlang-demo/index.js --format=esm
../../packages/samlang-vscode/node_modules/.bin/esbuild ./lazy-index.js --bundle --outfile=samlang-demo/index.js --format=esm
node samlang-wasm.test.mjs --experimental-wasm-modules

# Cleanup outputs
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"bw": "cd crates/samlang-wasm && ./setup-generated-package.sh",
"rt": "rm -f target/llvm-cov-target/*.profraw && cargo th",
"bench": "cargo b -p samlang-cli --release && time BENCHMARK_REPEAT=10000 ./target/release/samlang-cli",
"ssg": "bun run --cwd packages/samlang-website ssg",
"webdev": "bun run --cwd packages/samlang-website dev"
"ssg": "pnpm --filter samlang-website ssg",
"webdev": "pnpm --filter samlang-website dev"
},
"devDependencies": {
"bun-types": "^1.1.2"
}
"packageManager": "[email protected]"
}
Loading

0 comments on commit f5bdc82

Please sign in to comment.