Skip to content

Commit

Permalink
chore: use Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
mkobayashime committed Dec 1, 2024
1 parent 4f0d435 commit a8799e8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 3,460 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "pnpm"
bun-version: latest
- run: make node_modules
- run: make lint
- run: make typecheck
- run: pnpm exec depcheck --ignore-bin-package
- run: bunx depcheck --ignore-bin-package
- uses: wagoid/commitlint-github-action@v6
- run: make build
test:
name: Test
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
- name: Simple test
run: make test
- name: Build for E2E
run: make build
- run: bun link
- uses: actions/checkout@v4
with:
repository: mkobayashime/bookmarklets
path: repo-bookmarklets
- name: E2E
working-directory: ./repo-bookmarklets
run: >
corepack enable &&
make node_modules &&
pnpm add -D ../ && make lint.fix &&
git config user.email 'email' && git config user.name 'name' &&
git add . && git commit -m 'Use local cli' &&
bun link bookmarklets-cli &&
make build &&
git add -N . && git diff --exit-code --stat
5 changes: 3 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: make node_modules
- run: make build
- run: npm publish --provenance --access public
Expand Down
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
biome = pnpm exec biome
rollup = pnpm exec rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript
tsc = pnpm exec tsc
vitest = pnpm exec vitest

node_modules: package.json pnpm-*.yaml
pnpm install
@touch node_modules
biome = bunx biome
rollup = bunx rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript
tsc = bunx tsc
vitest = bunx vitest

node_modules: PHONY
bun install

lint: node_modules PHONY
$(biome) check .
Expand Down
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
@@ -1,4 +1,4 @@
commit-msg:
commands:
commitlint:
run: pnpm exec commitlint --edit
run: bunx commitlint --edit
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "bookmarklets-cli",
"version": "1.1.0",
"packageManager": "pnpm@9.13.0",
"author": "Masaki Kobayashi",
"license": "MIT",
"private": false,
Expand Down
Loading

0 comments on commit a8799e8

Please sign in to comment.