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: use bun 🐰 #68

Merged
merged 6 commits into from
Jul 15, 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
10 changes: 10 additions & 0 deletions .changeset/bright-games-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@tablex/core": patch
---

Use bun for everything:

- For running package scripts
- For bundling
- In CI
- For future testing purposes
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If applicable, add screenshots to help explain your problem.
**System Info (please complete the following information):**

- TableX Release: [e.g. Latest]
- Output of `pnpm tauri:info` [e.g. 22]
- Output of `bun tauri:info` [e.g. 22]

**Additional context**
Add any other context about the problem here.
25 changes: 0 additions & 25 deletions .github/actions/setup-node-pnpm/action.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ jobs:
with:
fetch-depth: 0

- name: Setup Node & PNPM
uses: ./.github/actions/setup-node-pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: pnpm install --frozen-lock
run: bun install --frozen-lock

- name: Create Release Pull Request
uses: changesets/action@v1
with:
commit: "chore: version pump 🔖"
publish: pnpm changeset tag
publish: bunx changeset tag
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
31 changes: 12 additions & 19 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,39 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
sparse-checkout: |
.github/actions

- name: Setup Node & PNPM
uses: ./.github/actions/setup-node-pnpm

- name: Enable Corepack
run: corepack enable
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install commitlint
run: |
pnpm add -w @commitlint/{cli,config-conventional}
bun add @commitlint/{cli,config-conventional}
- name: Validate latest commit
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose
run: bunx commitlint --from HEAD~1 --to HEAD --verbose
- name: Validate PR commits
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
run: bunx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
eslint-prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Setup Node & PNPM
uses: ./.github/actions/setup-node-pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: pnpm install --frozen-lock

- name: Enable Corepack
run: corepack enable
run: bun install --frozen-lock

- name: Run Lint
run: pnpm ts:lint
run: bun ts:lint

- name: Run Prettier
run: pnpm format:check
run: bun format:check
clippy:
runs-on: ubuntu-22.04
steps:
Expand All @@ -68,7 +62,6 @@ jobs:
sparse-checkout: |
apps/core/src-tauri
crates
.github/actions

- name: Install tauri specific dependencies
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
crates
packages
scripts
.github/actions

- name: Checkout MetaX's repo
uses: actions/checkout@v4
Expand All @@ -65,11 +64,12 @@ jobs:
- name: Rust cache
uses: swatinem/rust-cache@v2

- name: Setup Node & PNPM
uses: ./.github/actions/setup-node-pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: pnpm install --frozen-lock
run: bun install --frozen-lock

- name: Setup Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -97,5 +97,5 @@ jobs:
with:
releaseId: ${{ github.event.release.id || github.event.inputs.release-id }}
projectPath: ./apps/core
tauriScript: pnpm tauri
tauriScript: bunx tauri
args: --config src-tauri/tauri.conf.sidecar.json --features metax --target ${{matrix.target}} ${{ matrix.target == 'aarch64-pc-windows-msvc' && '--bundles nsis' || ''}}
10 changes: 5 additions & 5 deletions .github/workflows/test-astro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
apps/web
apps/core/package.json
packages
.github/actions

- name: Setup Node & PNPM
uses: ./.github/actions/setup-node-pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: pnpm install --frozen-lock
run: bun install --frozen-lock

- name: Run Astro build
run: pnpm astro:build
run: bun astro:build
15 changes: 5 additions & 10 deletions .github/workflows/test-tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
apps/core
crates
packages
.github/actions

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
Expand All @@ -71,18 +65,19 @@ jobs:
- name: Rust cache
uses: swatinem/rust-cache@v2

- name: Setup Node & PNPM
uses: ./.github/actions/setup-node-pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: pnpm install --frozen-lock
run: bun install --frozen-lock

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: ./apps/core
tauriScript: pnpm tauri
tauriScript: bunx tauri
includeRelease: false
includeDebug: true
args: --target ${{matrix.target}} ${{ matrix.target == 'aarch64-pc-windows-msvc' && '--bundles nsis' || ''}}
2 changes: 1 addition & 1 deletion .husky/commit-msg
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1} --verbose
bunx --no -- commitlint --edit ${1} --verbose
4 changes: 2 additions & 2 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint
pnpm format:check
bun lint
bun format:check
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ pnpm-lock.yaml
**/components/ui
**/*.gen.ts
.all-contributorsrc
.astro
apps/core/src/bindings.ts
8 changes: 4 additions & 4 deletions apps/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"version": "0.3.7",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"dev": "bunx --bun vite",
"build": "bunx --bun vite build",
"lint": "bunx eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "bunx --bun vite preview"
},
"dependencies": {
"@hookform/resolvers": "^3.3.2",
Expand Down
13 changes: 6 additions & 7 deletions apps/core/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": {
"beforeBuildCommand": "pnpm build",
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "bun run build",
"beforeDevCommand": "bun dev",
"frontendDist": "../dist",
"devUrl": "http://localhost:5173"
},
Expand All @@ -12,9 +12,7 @@
"copyright": "",
"targets": "all",
"externalBin": [],
"icon": [
"icons/icon.ico"
],
"icon": ["icons/icon.ico"],
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
Expand All @@ -29,7 +27,7 @@
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"shortDescription": "Cross-Platform table viewer written in rust",
"linux": {
"deb": {
"depends": []
Expand Down Expand Up @@ -66,4 +64,5 @@
"capabilities": ["main-capability"]
}
}
}
}

12 changes: 6 additions & 6 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"check": "astro check",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
"dev": "bunx --bun astro dev",
"start": "bunx --bun astro dev",
"check": "bunx --bun astro check",
"build": "bunx --bun astro check && bunx --bun astro build",
"preview": "bunx --bun astro preview",
"astro": "bunx --bun astro"
},
"dependencies": {
"@astrojs/check": "^0.5.4",
Expand Down
Binary file added bun.lockb
Binary file not shown.
Loading
Loading