Skip to content

Commit

Permalink
Switch to use Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed Apr 26, 2024
1 parent 1b2d6e7 commit a66dd50
Show file tree
Hide file tree
Showing 23 changed files with 467 additions and 17,106 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable unicorn/prefer-module */
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "unicorn"],
extends: [
"plugin:unicorn/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
rules: {
"prefer-const": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-unused-vars": "off",
"no-var": "off",
"unicorn/no-null": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/filename-case": "off",
"unicorn/prevent-abbreviations": "off",
},
};
22 changes: 0 additions & 22 deletions .eslintrc.js

This file was deleted.

13 changes: 1 addition & 12 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
# These are supported funding model platforms

github: sergiodxa # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: sergiodxa # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: sergiodxa # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
github: sergiodxa
24 changes: 12 additions & 12 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
changelog:
categories:
- title: Documentation Changes
labels:
- documentation
- title: New Features
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Other Changes
labels:
- "*"
- title: Documentation Changes
labels:
- documentation
- title: New Features
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Other Changes
labels:
- "*"
36 changes: 19 additions & 17 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@ on:
workflow_dispatch:
inputs:
version:
description: "Type of version (major / minor / patch)"
description: "Semver type of new version (major / minor / patch)"
required: true
type: choice
options:
- major
- minor
- patch

jobs:
bump-version:
name: Bump version
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Setup Node.js
uses: actions/setup-node@v2

- uses: oven-sh/setup-bun@v1
- run: bun install

- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Setup Git
run: |
git config user.name '${{ secrets.GIT_USER_NAME }}'
git config user.email '${{ secrets.GIT_USER_EMAIL }}'
- name: bump version
run: npm version ${{ github.event.inputs.version }}
node-version: "lts/*"

- run: |
git config user.name 'Sergio Xalambrí'
git config user.email '[email protected]'
- name: Push latest version
run: git push origin main --follow-tags
- run: npm version ${{ github.event.inputs.version }}
- run: git push origin main --follow-tags
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on: [push]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run build

typecheck:
name: Typechecker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run typecheck

format:
name: Formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bunx prettier --check .

test:
name: Unit and Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun test

lint:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run lint
82 changes: 0 additions & 82 deletions .github/workflows/main.yml

This file was deleted.

16 changes: 10 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ on:
types: [published]

jobs:
build:
publish-npm:
name: "Publish to npm"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run build

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: "lts/*"
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/build
.gitignore
bun.lockb
4 changes: 0 additions & 4 deletions .prettierrc.js

This file was deleted.

8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Setup

Run `npm install` to install the dependencies.
Run `bun install` to install the dependencies.

Run the tests with `npm run test`.
Run the tests with `bun test`.

Run the linter with `npm run lint`.
Run the linter with `bun run lint`.

Run the typechecker with `npm run typecheck`.
Run the typechecker with `bun run typecheck`.
Loading

0 comments on commit a66dd50

Please sign in to comment.