Skip to content
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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
pull_request:
branches: [main, release]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm install

- name: Lint (ESLint)
run: npm run lint

- name: Typecheck (TS)
run: npm run lint:ts

- name: Format (Prettier)
run: npm run format

- name: Build
run: npm run build
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish to npm

on:
workflow_dispatch:
inputs:
version:
description: 'Semver increment to apply (patch|minor|major) before publish, or leave empty to use current version'
required: false
default: ''

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Optional version bump
if: ${{ inputs.version != '' }}
run: |
npm version ${{ inputs.version }} -m "chore(release): %s"
git push --follow-tags

- name: Lint (ESLint)
run: npm run lint

- name: Typecheck (TS)
run: npm run lint:ts

- name: Format check (Prettier)
run: npm run format:check

- name: Build
run: npm run build

- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# dependencies
node_modules/

# builds
dist/
playground/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# bun lockfile
bun.lockb
bunlockb
bun.lock

# editor
.vscode/
.idea/
.DS_Store

# env
.env
.env.*
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"arrowParens": "always",
"tabWidth": 2,
"endOfLine": "auto"
}
Loading