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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

version: 2
updates:
- package-ecosystem: 'npm'
- package-ecosystem: 'npm' # pnpm is detected automatically via pnpm-lock.yaml
directory: '/'
schedule:
interval: 'monthly'
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,24 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24
- run: npm ci --ignore-scripts --no-audit --no-fund
- run: npm test
- run: npm run build
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm test
- run: pnpm run build
- name: Bump version from release tag
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
run: |
VERSION=${GITHUB_REF_NAME#v}
npm version $VERSION --no-git-tag-version
pnpm version $VERSION --no-git-tag-version
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git add package.json pnpm-lock.yaml
git commit -m "chore: bump version to $VERSION"
git push origin HEAD:${{ github.event.repository.default_branch }}
- run: npm publish --access public
git push origin HEAD:$DEFAULT_BRANCH
- run: pnpm publish --no-git-checks
58 changes: 34 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
Expand All @@ -9,64 +6,77 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
lint:
name: Lint JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
- run: npm ci --ignore-scripts --no-audit --no-fund
- run: npm run lint
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm run lint

test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
- run: npm ci --ignore-scripts --no-audit --no-fund
- run: npm test
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm test

code-coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
- run: npm ci --ignore-scripts --no-audit --no-fund
- run: npm test
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
with:
token: ${{ secrets.CODECOV_TOKEN }}

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
- run: npm ci --ignore-scripts --no-audit --no-fund
- run: npm run build
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm run build
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

knip:
name: Lint unused code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
- run: npm ci --ignore-scripts --no-audit --no-fund
- run: npm run knip
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm run knip
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Security settings are configured in pnpm-workspace.yaml
3 changes: 2 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"no-warning-comments": "off",
"no-case-declarations": "off",
"no-inline-comments": "off",
"no-useless-return": "warn"
"no-useless-return": "warn",
"require-unicode-regexp": "off"
}
}
1 change: 0 additions & 1 deletion knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { KnipConfig } from 'knip'

const config: KnipConfig = {
project: ['src/**/*.ts'],
ignoreDependencies: ['prettier', '@vitest/coverage-v8'],
}

export default config
Loading
Loading