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 #57

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
23 changes: 11 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
workflow_run:
workflows:
- ESLint
- Spec
types:
- completed
push:
Expand Down Expand Up @@ -36,29 +36,28 @@ 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: Sanitize
run: rm -rf 'dist/{config,data,utils}'

- name: Prettify
run: pnpm prettier 'dist/index.d.ts' --write
run: bun prettier 'dist/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
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Files
*.md
pnpm-lock.yaml

# *rc
.ecrc


# Ignores
.gitignore
.prettierignore
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
"notify",
"plugin"
],
"packageManager": "pnpm@9.7.0",
"engines": {
"node": ">=20.0.0",
"pnpm": ">=9.0.0"
"bun": ">=1.0.0"
},
"type": "module",
"types": "dist/index.d.ts",
Expand All @@ -50,7 +48,7 @@
"dist/index.js"
],
"scripts": {
"init": "pnpm i && husky"
"init": "bun i && husky"
},
"dependencies": {
"chalk": "^5.3.0",
Expand All @@ -68,6 +66,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 @@ -97,8 +96,6 @@
"rollup-plugin-copy": "^3.5.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