Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: migrate to bun #148

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
21 changes: 10 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,25 @@ 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: Prettify
run: pnpm prettier 'index.d.ts' --write
run: bun prettier 'index.d.ts' --write

- 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
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
"validate",
"validator"
],
"packageManager": "pnpm@9.7.0",
"engines": {
"node": ">=20.0.0",
"pnpm": ">=9.0.0"
"bun": ">=1.0.0"
},
"type": "module",
"types": "index.d.ts",
Expand All @@ -46,7 +44,7 @@
"index.js"
],
"scripts": {
"init": "pnpm i && husky"
"init": "bun i && husky"
},
"dependencies": {
"@archoleat/notifier": "^1.1.1",
Expand All @@ -64,6 +62,7 @@
"@rollup/plugin-typescript": "^12.1.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/bun": "^1.1.14",
"@types/node": "^22.10.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
Expand Down Expand Up @@ -92,8 +91,6 @@
"rollup": "^4.28.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"semantic-release": "^24.2.0",
"typescript": "^5.7.2",
"vitest": "^2.1.6"
"semantic-release": "^24.2.0"
}
}
Loading
Loading