Skip to content

Commit

Permalink
Modernize package setup (#295)
Browse files Browse the repository at this point in the history
* Modernize package setup

- Use Bun instead of npm and jest
- Use Biome instead of ESLint and Prettier
- Add TypeDoc
- Update TSConfig configuration
- Remove Authorizer

* Create exports.ts

---------

Co-authored-by: Sergio Xalambrí <sergio@silverback.ventures>
  • Loading branch information
sergiodxa and sergiodxa-silverback authored Sep 20, 2024
1 parent a2287ac commit f1bc31a
Show file tree
Hide file tree
Showing 36 changed files with 1,093 additions and 25,136 deletions.
33 changes: 0 additions & 33 deletions .eslintrc.js

This file was deleted.

20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
reviewers:
- "sergiodxa"
assignees:
- "sergiodxa"

- package-ecosystem: npm
directory: /
schedule:
interval: "weekly"
reviewers:
- "sergiodxa"
assignees:
- "sergiodxa"
33 changes: 18 additions & 15 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
changelog:
categories:
- title: Documentation Changes
labels:
- documentation
- title: New Strategy
labels:
- strategy
- title: New Features
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Other Changes
labels:
- "*"
- title: New Features
labels:
- enhancement
- title: Documentation Changes
labels:
- documentation
- title: Bug Fixes
labels:
- bug
- title: Example
labels:
- example
- title: Deprecations
labels:
- deprecated
- title: Other Changes
labels:
- "*"
34 changes: 16 additions & 18 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,34 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Semver type of new version (major / minor / patch)'
description: "Type of version to bump"
required: true
type: choice
options:
- major
- minor
- patch
- 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@v2
- run: bun install --frozen-lockfile

- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Setup Git
run: |
node-version: "lts/*"

- run: |
git config user.name 'Sergio Xalambrí'
git config user.email 'hello@sergiodxa.com'
- name: bump version
run: npm version ${{ github.event.inputs.version }}
- name: Push latest version
run: git push origin main --follow-tags
- run: npm version ${{ github.event.inputs.version }}
- run: bun run quality:fix
- 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@v2
- run: bun install --frozen-lockfile
- run: bun run build

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

quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run quality

test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun test

exports:
name: Verify Exports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run exports
24 changes: 24 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Enable auto-merge for Dependabot PRs

on:
pull_request:
types: opened

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
33 changes: 33 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy Documentation

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "docs"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bunx typedoc
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: "./docs"
- uses: actions/deploy-pages@v4
id: deployment
82 changes: 0 additions & 82 deletions .github/workflows/main.yml

This file was deleted.

17 changes: 11 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ 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@v2
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run exports

- 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}}
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/node_modules
/build
/coverage

*.log
.DS_Store
/node_modules
4 changes: 0 additions & 4 deletions .prettierrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
Loading

0 comments on commit f1bc31a

Please sign in to comment.