Skip to content

Commit

Permalink
chore/switch-to-bun-biome (#2)
Browse files Browse the repository at this point in the history
## Description

Switch from ESLint, Prettier, and Vitest to Biome and Bun.

## Overview of Changes

- Install and configure Biome and Bun
- Remove ESLint, Prettier, and Vitest dependencies
- Update code to fix breaking changes
  • Loading branch information
mikerourke authored Jan 16, 2025
2 parents 287ccbc + f638811 commit 8b3228c
Show file tree
Hide file tree
Showing 23 changed files with 204 additions and 8,927 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 22
cache: "npm"
bun-version: latest

- name: Install Dependencies
run: npm install

# Ensure a new version doesn't get published to npm if it doesn't
# pass all required checks/validation:
- name: Run Checks
run: npm run typecheck && npm run prettier:ci && npm run eslint && npm run vitest -- --run
run: bun install

- name: Build
run: npm run build
run: bun run build

- name: Publish to npm
uses: laserware/propellant@v1.0.2
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy Documentation Site

on:
Expand All @@ -8,7 +7,6 @@ on:
# Allows you to run this workflow manually from the Actions tab:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
permissions:
contents: read
pages: write
Expand All @@ -32,22 +30,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 22
bun-version: latest

- name: Install dependencies
run: npm install
- name: Install Dependencies
run: bun install

- name: Build static files
- name: Build Static Files
id: build
run: npm run docs:generate
run: bun run docs:generate

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: "site"
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,19 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 22
cache: "npm"
bun-version: latest

- name: Install dependencies
run: npm install
- name: Install Dependencies
run: bun install

- name: ESLint
run: npm run eslint

- name: Check Formatting
run: npm run prettier:ci
- name: Run Biome Checks
run: bun run ci

- name: Check Types
run: npm run typecheck
run: bun run typecheck

- name: Run Tests
run: npm run vitest -- --run
- name: Run Unit Tests
run: bun test
56 changes: 56 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"lineWidth": 80,
"ignore": ["./package.json"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noUselessElse": "off",
"noParameterAssign": "off",
"noNonNullAssertion": "off"
},
"suspicious": {
"noExplicitAny": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"overrides": [
{
"include": ["src/**/*.test.ts"],
"formatter": {
"lineWidth": 100
},
"linter": {
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off"
}
}
}
}
]
}
Binary file added bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
preload = ["./test.setup.ts"]
1 change: 0 additions & 1 deletion declarations.d.ts

This file was deleted.

17 changes: 0 additions & 17 deletions eslint.config.mjs

This file was deleted.

Loading

0 comments on commit 8b3228c

Please sign in to comment.