Skip to content

Commit

Permalink
refactor!: migrate to bun 🐇
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
  • Loading branch information
vinayakkulkarni committed May 19, 2024
1 parent d020f90 commit 9c2c2a5
Show file tree
Hide file tree
Showing 23 changed files with 168 additions and 10,005 deletions.
31 changes: 28 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
versioning-strategy: increase
directory: '/'
schedule:
interval: daily
time: '00:00'
timezone: Asia/Calcutta
groups:
npm-development:
dependency-type: development
update-types:
- minor
- patch
npm-production:
dependency-type: production
update-types:
- patch
reviewers:
- vinayakkulkarni
assignees:
Expand All @@ -15,13 +25,23 @@ updates:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `npm` packages
- package-ecosystem: npm
versioning-strategy: increase
directory: '/example'
schedule:
interval: daily
time: '00:00'
timezone: Asia/Calcutta
groups:
npm-development:
dependency-type: development
update-types:
- minor
- patch
npm-production:
dependency-type: production
update-types:
- patch
reviewers:
- vinayakkulkarni
assignees:
Expand All @@ -30,12 +50,17 @@ updates:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '00:00'
timezone: Asia/Calcutta
groups:
actions-minor:
update-types:
- minor
- patch
reviewers:
- vinayakkulkarni
assignees:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automerger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Auto-merge Dependabot PRs 🕺
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}
24 changes: 9 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,37 @@ permissions:

jobs:
ci:
name: 'CI'
runs-on: ubuntu-latest
steps:
- name: Check out repository ✨ (non dependabot)
if: ${{ github.actor != 'dependabot[bot]' }}
uses: actions/checkout@v4

- name: Check out repository 🎉 (dependabot)
if: ${{ github.actor == 'dependabot[bot]' }}
- name: Check out repository 🎉
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node env 📦
uses: actions/setup-node@v3
- name: Setup bun env 🐰
uses: oven-sh/setup-bun@v1
with:
node-version-file: 'package.json'
check-latest: true
cache: 'npm'
bun-version: latest

- name: Install dependencies 🚀
run: npm ci --prefer-offline --no-audit --omit=optional
run: bun install

- name: Run linter(s) 👀
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
continue_on_error: false
git_name: github-actions[bot]
git_email: github-actions[bot]@users.noreply.github.com
auto_fix: false
continue_on_error: false
neutral_check_on_warning: true
stylelint: true
stylelint: false
stylelint_extensions: css,scss,vue
eslint: true
eslint_extensions: js,ts,vue
prettier: true
prettier_extensions: js,ts,vue

- name: Build the package 🎉
run: npm run build
run: bun run build
11 changes: 8 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: 'CodeQL'

on:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main]
branches:
- main
schedule:
- cron: '45 23 * * 2'

Expand All @@ -20,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ['javascript']
language: [javascript]

steps:
- name: Checkout repository
Expand All @@ -30,9 +32,12 @@ jobs:
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:${{ matrix.language }}
17 changes: 6 additions & 11 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,23 @@ jobs:
run:
working-directory: './example/'
steps:
- name: Checkout 🛎️
- name: Check out repository 🎉
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node env 📦
uses: actions/setup-node@v3
with:
node-version: 'current'
check-latest: true
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Setup bun env 🐰
uses: oven-sh/setup-bun@v1

- name: Install dependencies 🚀
run: npm ci --prefer-offline --no-audit --omit=optional
run: bun install

- name: Run build 🏁
run: npm run build
run: bun run build

- name: Deploy to GitHub Pages 🚀
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./example/dist
cname: v-offline.netlify.app
cname: v-spotlight.netlify.app
48 changes: 38 additions & 10 deletions .github/workflows/shipjs-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Ship js trigger

on:
pull_request:
types:
- closed

jobs:
build:
name: Release
publish-to-npm:
name: 'Publishing to NPM ✨'
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
steps:
Expand All @@ -20,19 +22,45 @@ jobs:
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Setup node environment 📦
uses: actions/setup-node@v3
- name: Setup bun env 🐰
uses: oven-sh/setup-bun@v1
with:
node-version-file: 'package.json'
check-latest: true
cache: 'npm'
bun-version: 1.0.25+a8ff7be64

- name: Install dependencies 🚀
run: npm ci --prefer-offline --no-audit --omit=optional
run: bun install

- name: Trigger a release 🥳
run: npx shipjs trigger
- name: Trigger a release (NPM) 🥳
run: bunx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}

publish-to-jsr:
name: 'Publishing to JSR ✨'
runs-on: ubuntu-latest
needs: publish-to-npm
permissions:
contents: read
id-token: write
steps:
- name: Checkout code 🛎
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: Setup bun env 🐰
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install dependencies 🚀
run: bun install

- name: Build the package 🎉
run: bun run build

- name: Trigger a release (JSR) 🥳
run: bunx jsr publish
27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Mark stale issues and pull requests

on:
workflow_dispatch:
schedule:
- cron: '45 2 * * *'

jobs:
stale:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v9
with:
stale-issue-message: |
A stale label has been added to this issue because it has been open 15 days with no activity. To keep this issue open, add a comment within 5 days.
stale-issue-label: 'stale'
exempt-issue-labels: 'bug,blocked,in progress,never-stale'
days-before-issue-stale: 15
days-before-issue-close: 5
stale-pr-message: |
Thank you for your contribution to this project!
A stale label has been added to this pull request because it has been open 45 days with no activity. To keep this PR open, add a comment or push a commit within 10 days.
stale-pr-label: 'stale'
exempt-pr-labels: 'waiting for review,never-stale'
days-before-pr-stale: 45
days-before-pr-close: 10
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

NAME=$(git config user.name)
EMAIL=$(git config user.email)

Expand All @@ -18,4 +15,4 @@ git interpret-trailers --if-exists doNothing --trailer \
"Signed-off-by: $NAME <$EMAIL>" \
--in-place "$1"

npm exec --no -- commitlint --edit $1
bun commitlint --edit $1
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm exec --no -- lint-staged --no-stash
bun lint-staged --no-stash
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
registry=https://registry.npmjs.org/
registry=https://registry.npmjs.org
@jsr:registry=https://npm.jsr.io
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"recommendations": ["Vue.volar"]
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin"
]
}
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"files.eol": "\n",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib",
}
}
Binary file added bun.lockb
Binary file not shown.
Binary file added example/bun.lockb
Binary file not shown.
Loading

0 comments on commit 9c2c2a5

Please sign in to comment.