ci: corepack before setup-node, scope prettier to src/, emit d.mts

This commit is contained in:
Aric Camarata 2026-05-29 20:05:31 -04:00
parent df2cc65aed
commit d0a04896b9
4 changed files with 22 additions and 15 deletions

View file

@ -15,12 +15,12 @@ jobs:
node-version: [20, 22, 24] node-version: [20, 22, 24]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: pnpm cache: pnpm
- name: Enable corepack
run: corepack enable
- run: pnpm install --frozen-lockfile - run: pnpm install --frozen-lockfile
- run: pnpm build - run: pnpm build
- run: node --test test.mjs - run: node --test test.mjs
@ -31,12 +31,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 24 node-version: 24
cache: pnpm cache: pnpm
- name: Enable corepack
run: corepack enable
- run: pnpm install --frozen-lockfile - run: pnpm install --frozen-lockfile
- run: pnpm run lint - run: pnpm run lint
- run: pnpm run format:check - run: pnpm run format:check
@ -46,12 +46,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 24 node-version: 24
cache: pnpm cache: pnpm
- name: Enable corepack
run: corepack enable
- run: pnpm install --frozen-lockfile - run: pnpm install --frozen-lockfile
- run: pnpm run typecheck - run: pnpm run typecheck
@ -60,12 +60,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 24 node-version: 24
cache: pnpm cache: pnpm
- name: Enable corepack
run: corepack enable
- run: pnpm install --frozen-lockfile - run: pnpm install --frozen-lockfile
- run: pnpm build - run: pnpm build
- name: Verify pack contents - name: Verify pack contents

View file

@ -34,10 +34,11 @@
"pretest": "tsup", "pretest": "tsup",
"test": "node --test test.mjs && node --test test-cjs.cjs", "test": "node --test test.mjs && node --test test-cjs.cjs",
"lint": "eslint .", "lint": "eslint .",
"format": "prettier --write .", "format": "prettier --write src/",
"format:check": "prettier --check .", "format:check": "prettier --check src/",
"prepublishOnly": "tsup", "prepublishOnly": "tsup",
"coverage": "c8 --reporter=lcov --reporter=text node --test" "coverage": "c8 --reporter=lcov --reporter=text node --test",
"postbuild": "cp dist/index.d.ts dist/index.d.mts"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -53,8 +53,6 @@ export function qiblaAngle(lat: number, lng: number): number {
return (Math.atan2(y, x) / DEG + 360) % 360; return (Math.atan2(y, x) / DEG + 360) % 360;
} }
/** /**
* Eight-point compass abbreviation for a bearing. * Eight-point compass abbreviation for a bearing.
* *

View file

@ -8,7 +8,16 @@ export const KAABA_LNG = 39.82615;
export const EARTH_RADIUS_KM = 6371; export const EARTH_RADIUS_KM = 6371;
/** Eight-point compass abbreviations. */ /** Eight-point compass abbreviations. */
export const COMPASS_ABBR = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] as const; export const COMPASS_ABBR = [
"N",
"NE",
"E",
"SE",
"S",
"SW",
"W",
"NW",
] as const;
/** Eight-point compass full names. */ /** Eight-point compass full names. */
export const COMPASS_NAMES = [ export const COMPASS_NAMES = [
@ -27,4 +36,3 @@ export type CompassAbbr = (typeof COMPASS_ABBR)[number];
/** Compass full name type. */ /** Compass full name type. */
export type CompassName = (typeof COMPASS_NAMES)[number]; export type CompassName = (typeof COMPASS_NAMES)[number];