Skip to content

Commit 631ab02

Browse files
committed
Initial project scaffolding and CI
Package config, build toolchain (tsdown dual CJS/ESM), test runner (vitest), linting (eslint, prettier, commitlint), changesets, and GitHub Actions for static quality checks, unit tests, and publishing.
0 parents  commit 631ab02

15 files changed

Lines changed: 4280 additions & 0 deletions

.changeset/config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"access": "public",
6+
"baseBranch": "main"
7+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Publish Preview
2+
on:
3+
pull_request:
4+
branches: [main]
5+
jobs:
6+
preview:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: pnpm/action-setup@v4
11+
- uses: actions/setup-node@v4
12+
with: { node-version: 22, cache: pnpm }
13+
- run: pnpm install --frozen-lockfile
14+
- run: pnpm build
15+
- run: npx pkg-pr-new publish
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [main]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: pnpm/action-setup@v4
11+
- uses: actions/setup-node@v4
12+
with:
13+
node-version: 22
14+
cache: pnpm
15+
registry-url: "https://registry.npmjs.org"
16+
- run: pnpm install --frozen-lockfile
17+
- uses: changesets/action@v1
18+
with:
19+
publish: pnpm release
20+
version: pnpm changeset version
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Static Quality
2+
on:
3+
pull_request:
4+
branches: [main]
5+
push:
6+
branches: [main]
7+
jobs:
8+
prettier:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v4
13+
- uses: actions/setup-node@v4
14+
with: { node-version: 22, cache: pnpm }
15+
- run: pnpm install --frozen-lockfile
16+
- run: pnpm format:check
17+
18+
eslint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: pnpm/action-setup@v4
23+
- uses: actions/setup-node@v4
24+
with: { node-version: 22, cache: pnpm }
25+
- run: pnpm install --frozen-lockfile
26+
- run: pnpm lint
27+
28+
exports:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: pnpm/action-setup@v4
33+
- uses: actions/setup-node@v4
34+
with: { node-version: 22, cache: pnpm }
35+
- run: pnpm install --frozen-lockfile
36+
- run: pnpm build
37+
- run: pnpm test:exports
38+
39+
commitlint:
40+
if: github.event_name == 'pull_request'
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
with: { fetch-depth: 0 }
45+
- uses: pnpm/action-setup@v4
46+
- uses: actions/setup-node@v4
47+
with: { node-version: 22, cache: pnpm }
48+
- run: pnpm install --frozen-lockfile
49+
- run: pnpm commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}

.github/workflows/test-unit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Unit Tests
2+
on:
3+
pull_request:
4+
branches: [main]
5+
push:
6+
branches: [main]
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [20, 22, 24]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: pnpm/action-setup@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
cache: pnpm
20+
- run: pnpm install --frozen-lockfile
21+
- run: pnpm test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
*.tsbuildinfo

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
pnpm-lock.yaml

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "singleQuote": false, "trailingComma": "all", "printWidth": 100 }

commitlint.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
extends: ["@commitlint/config-conventional"],
3+
rules: { "subject-case": [0] },
4+
};

eslint.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import eslint from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import prettier from "eslint-config-prettier";
4+
export default tseslint.config(
5+
eslint.configs.recommended,
6+
...tseslint.configs.recommended,
7+
prettier,
8+
{ ignores: ["dist/", "node_modules/", "fixtures/"] },
9+
{
10+
files: ["*.config.{js,mjs,ts}", "commitlint.config.js"],
11+
languageOptions: { globals: { module: "readonly", require: "readonly" } },
12+
},
13+
);

0 commit comments

Comments
 (0)