mirror of
https://github.com/acamarata/temporal-hijri.git
synced 2026-06-30 19:04:29 +00:00
- Replace O(n) while-loops in dateAdd() with O(1) modular arithmetic - Implement overflow option handling in dateFromFields, yearMonthFromFields, monthDayFromFields - Add fields() method per Temporal Calendar Protocol - Extract shared borrow logic from dateUntil() into borrowHijriDiff helper - Replace magic number 1444 with REFERENCE_YEAR constant - Convert test suites to node:test runner with describe/it blocks - Add tests for dateUntil, dateAdd with days/weeks, overflow reject/constrain, fields(), yearMonthFromFields, monthDayFromFields - Add ESLint + Prettier with typescript-eslint config - Add lint job to CI workflow - Add noImplicitReturns and noFallthroughCasesInSwitch to tsconfig - Disable unused sourcemap generation in tsup - Update .editorconfig to include .mts and .cts extensions - Add missing AI agent dirs to .gitignore
76 lines
1.9 KiB
YAML
76 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test (Node ${{ matrix.node }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node: [20, 22, 24]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm run build
|
|
- run: node --test test.mjs
|
|
- run: node --test test-cjs.cjs
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm run lint
|
|
- run: pnpm run format:check
|
|
|
|
typecheck:
|
|
name: Typecheck
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm run typecheck
|
|
|
|
pack-check:
|
|
name: Pack check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm run build
|
|
- name: Verify pack contents
|
|
run: |
|
|
npm pack --dry-run 2>&1 | tee pack-output.txt
|
|
grep "dist/index.cjs" pack-output.txt
|
|
grep "dist/index.mjs" pack-output.txt
|
|
grep "dist/index.d.ts" pack-output.txt
|
|
grep "dist/index.d.mts" pack-output.txt
|
|
grep "README.md" pack-output.txt
|
|
grep "CHANGELOG.md" pack-output.txt
|
|
grep "LICENSE" pack-output.txt
|