Skip to content

Commit

Permalink
refactor!: migrate to bun (#69)
Browse files Browse the repository at this point in the history
Co-authored-by: nikkeyl <[email protected]>
  • Loading branch information
github-actions[bot] and nikkeyl authored Dec 22, 2024
1 parent 97e5c5e commit 79cf59c
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 9,755 deletions.
1 change: 0 additions & 1 deletion .ecrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"exclude": [
"config.yml",
"CHANGELOG.md",
"pnpm-lock.yaml",
"README.md"
]
}
14 changes: 4 additions & 10 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up PNPM
uses: pnpm/action-setup@v4

- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- name: Set Up Bun
uses: oven-sh/setup-bun@v2

- name: Install Dependencies
run: pnpm i
run: bun i

- name: Extract Commit Message (Push)
if: ${{ github.event_name }} == 'push'
Expand All @@ -41,4 +35,4 @@ jobs:
- name: Lint
run: |
COMMIT_MESSAGE=$(cat commit_message.txt)
echo "$COMMIT_MESSAGE" | pnpm commitlint
echo "$COMMIT_MESSAGE" | bun commitlint
14 changes: 4 additions & 10 deletions .github/workflows/editorconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,11 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up PNPM
uses: pnpm/action-setup@v4

- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- name: Set Up Bun
uses: oven-sh/setup-bun@v2

- name: Install Dependencies
run: pnpm i
run: bun i

- name: Lint
run: pnpm editorconfig-checker
run: bun editorconfig-checker
14 changes: 4 additions & 10 deletions .github/workflows/eslint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up PNPM
uses: pnpm/action-setup@v4

- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- name: Set Up Bun
uses: oven-sh/setup-bun@v2

- name: Install Dependencies
run: pnpm i
run: bun i

- name: Lint
run: pnpm eslint 'src/**/*.ts'
run: bun eslint 'src/**/*.ts'
14 changes: 4 additions & 10 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,11 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up PNPM
uses: pnpm/action-setup@v4

- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- name: Set Up Bun
uses: oven-sh/setup-bun@v2

- name: Install Dependencies
run: pnpm i
run: bun i

- name: Lint
run: pnpm prettier . --check
run: bun prettier . --check
19 changes: 9 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,22 @@ jobs:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}

- name: Set Up PNPM
uses: pnpm/action-setup@v4

- name: Set Up NodeJS
uses: actions/setup-node@v4
- name: Set Up Node
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: lts/*
node-version: latest

- name: Set Up Bun
uses: oven-sh/setup-bun@v2

- name: Install Dependencies
run: pnpm i
run: bun i

- name: Build
run: pnpm rollup -c rollup.config.ts --configPlugin typescript
run: bun rollup -c rollup.config.ts --configPlugin typescript

- name: Create Release
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: pnpm semantic-release
run: bun semantic-release
14 changes: 4 additions & 10 deletions .github/workflows/remark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up PNPM
uses: pnpm/action-setup@v4

- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- name: Set Up Bun
uses: oven-sh/setup-bun@v2

- name: Install Dependencies
run: pnpm i
run: bun i

- name: Lint
run: pnpm remark . --quiet --frail
run: bun remark . --quiet --frail
14 changes: 4 additions & 10 deletions .github/workflows/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up PNPM
uses: pnpm/action-setup@v4

- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- name: Set Up Bun
uses: oven-sh/setup-bun@v2

- name: Install Dependencies
run: pnpm i
run: bun i

- name: Specs
run: pnpm vitest
run: bun test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Directories
node_modules

# Files
bun.lockb
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm --no-install commitlint --edit
bun commitlint --edit
2 changes: 1 addition & 1 deletion .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm git-pull-run --pattern 'package.json' --command 'pnpm i'
bun git-pull-run --pattern 'package.json' --command 'bun i'
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm lint-staged
bun lint-staged
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Files
*.md
pnpm-lock.yaml

# *rc
.ecrc
Expand Down
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@
"next",
"typescript"
],
"packageManager": "[email protected]",
"engines": {
"node": ">=20.0.0",
"pnpm": ">=9.0.0"
"bun": ">=1.0.0"
},
"type": "module",
"types": "index.d.ts",
"imports": {
"#index": "./src/index.ts"
"#src/*": "./src/*"
},
"exports": {
".": "./index.js"
Expand All @@ -46,7 +44,7 @@
"index.js"
],
"scripts": {
"init": "pnpm i && husky"
"init": "bun i && husky"
},
"peerDependencies": {
"next": "^13.0.0 || ^14.0.0 || ^15.0.0"
Expand All @@ -62,6 +60,7 @@
"@rollup/plugin-typescript": "^12.1.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/bun": "^1.1.14",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitest/coverage-v8": "^2.1.8",
Expand Down Expand Up @@ -90,8 +89,6 @@
"rollup": "^4.29.1",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"semantic-release": "^24.2.0",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
"semantic-release": "^24.2.0"
}
}
Loading

0 comments on commit 79cf59c

Please sign in to comment.