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
5 changes: 5 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Enforce LF for all text files
* text=auto eol=lf

# Keep Windows command scripts with CRLF line endings
*.bat text eol=crlf
*.cmd text eol=crlf
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
branches:
- develop
- 'feature/**'
pull_request:
branches:
- develop
- 'feature/**'
workflow_call:
inputs:
full:
description: 'Run full OS x Node matrix'
required: false
type: boolean
default: false

jobs:
compute-matrix:
name: Compute matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
name_suffix: ${{ steps.set.outputs.name_suffix }}
steps:
- id: set
run: |
if [[ "${{ inputs.full }}" == "true" ]]; then
echo 'matrix={"os":["ubuntu-latest","windows-latest"],"node":[22,24]}' >> $GITHUB_OUTPUT
echo 'name_suffix=(full matrix)' >> $GITHUB_OUTPUT
else
echo 'matrix={"os":["ubuntu-latest"],"node":[22]}' >> $GITHUB_OUTPUT
echo 'name_suffix=' >> $GITHUB_OUTPUT
fi

build-and-test:
name: Build, Lint, Test ${{ needs.compute-matrix.outputs.name_suffix }}
needs: compute-matrix
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.compute-matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure git EOL (Windows)
if: runner.os == 'Windows'
run: |
git config core.autocrlf false
git config core.eol lf

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm run test:ci

- name: Build
run: npm run build:types

- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-node${{ matrix.node }}
path: coverage
97 changes: 97 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: 'Exact version to release (e.g. 1.2.3). Leave empty to auto-bump.'
required: false
type: string
preid:
description: 'Pre-release identifier (e.g. beta, rc). Optional'
required: false
type: string
npm_tag:
description: 'npm dist-tag (e.g. latest, beta)'
required: false
default: 'latest'
type: string

permissions:
contents: write
id-token: write

jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
full: true

release:
name: Release & Publish
runs-on: ubuntu-latest
needs: ci
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
always-auth: true

- name: Install dependencies
run: npm ci

- name: Configure Git user
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Run release-it
env:
DEBUG: release-it:*,@release-it/*
HUSKY: 0
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION_ARG=""
if [ -n "${{ inputs.version }}" ]; then
VERSION_ARG="${{ inputs.version }}"
fi

PREID_ARG=""
if [ -n "${{ inputs.preid }}" ]; then
PREID_ARG="--preRelease=${{ inputs.preid }}"
fi

if [ -n "${{ inputs.npm_tag }}" ]; then
NPM_TAG="${{ inputs.npm_tag }}"
else
NPM_TAG="latest"
fi
NPM_TAG_ARG="--npm.tag=${NPM_TAG}"

npm run release -- --ci $PREID_ARG $NPM_TAG_ARG $VERSION_ARG

- name: Sync main → develop
uses: devmasx/[email protected]
with:
type: now
from_branch: main
target_branch: develop
github_token: ${{ secrets.GITHUB_TOKEN }}
env:
HUSKY: 0

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ lerna-debug.log*

node_modules
dist
dist-types
addon
.adnbn
dist-ssr
*.local
coverage

# Editor directories and files
.vscode/*
Expand Down
5 changes: 5 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

# Husky commit-msg hook: validate commit message with commitlint

npx --no -- commitlint --edit "$1"
7 changes: 7 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

# Husky pre-commit hook: format and run related tests on staged files

npm run lint:fix:aggressive || exit 1;
npm run test || exit 1;
npm run format || exit 1;
7 changes: 7 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

# Husky pre-push hook: typecheck, run full tests, and build

npm run typecheck || exit 1
npm run test:ci || exit 1
npm run build:types || exit 1
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Addon Stack <[email protected]> <[email protected]>
Addon Stack <[email protected]> <[email protected]>
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

21 changes: 0 additions & 21 deletions .prettierrc

This file was deleted.

Loading