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

View file

@ -34,10 +34,11 @@
"pretest": "tsup",
"test": "node --test test.mjs && node --test test-cjs.cjs",
"lint": "eslint .",
"format": "prettier --write .",
"format:check": "prettier --check .",
"format": "prettier --write src/",
"format:check": "prettier --check src/",
"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": {
"type": "git",

View file

@ -53,8 +53,6 @@ export function qiblaAngle(lat: number, lng: number): number {
return (Math.atan2(y, x) / DEG + 360) % 360;
}
/**
* 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;
/** 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. */
export const COMPASS_NAMES = [
@ -27,4 +36,3 @@ export type CompassAbbr = (typeof COMPASS_ABBR)[number];
/** Compass full name type. */
export type CompassName = (typeof COMPASS_NAMES)[number];