Skip to content

Commit

Permalink
Merge pull request #233 from mkobayashime/bun
Browse files Browse the repository at this point in the history
Use Bun
  • Loading branch information
mkobayashime authored Nov 13, 2024
2 parents 7110673 + 5836cc1 commit 5df710d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2,209 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: "lts/*"
cache: "pnpm"
bun-version: latest
- run: make node_modules
- run: make lint
- run: make typecheck
- run: make test
Expand All @@ -21,11 +20,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: "lts/*"
cache: "pnpm"
bun-version: latest
- run: make node_modules
- run: make build
- name: Check uncommitted changes
run: git add --intent-to-add . && git diff --exit-code --stat
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
cli = pnpm exec bookmarklets-cli 'src/*.ts'
vitest = pnpm exec vitest
biome = pnpm exec biome
tsx = pnpm exec tsx
cli = bunx bookmarklets-cli 'src/*.ts'
vitest = bunx vitest
biome = bunx biome
tsx = bunx tsx

node_modules: package.json pnpm-*.yaml
pnpm install
@touch node_modules
node_modules: PHONY
bun install

lint: node_modules PHONY
$(biome) check .
Expand Down Expand Up @@ -34,9 +33,9 @@ docgen: node_modules PHONY
@make lint.fix

typecheck: node_modules PHONY
pnpm exec tsc --noEmit
bunx tsc --noEmit

typecheck.watch: node_modules PHONY
pnpm exec tsc --noEmit --watch
bunx tsc --noEmit --watch

PHONY:
Binary file added bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pre-commit:
commands:
lint:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm exec biome check {staged_files}
run: bunx biome check {staged_files}
stage_fixed: true
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "bookmarklets",
"version": "1.0.0",
"packageManager": "[email protected]",
"description": "My daily use bookmarklets",
"main": "index.js",
"author": "Masaki Kobayashi <[email protected]>",
Expand All @@ -23,5 +22,6 @@
},
"scripts": {
"prepare": "lefthook install"
}
},
"trustedDependencies": ["@biomejs/biome"]
}
Loading

0 comments on commit 5df710d

Please sign in to comment.