mirror of
https://github.com/acamarata/qibla.git
synced 2026-06-30 19:04:28 +00:00
ci: corepack before setup-node, scope prettier to src/, emit d.mts
This commit is contained in:
parent
df2cc65aed
commit
d0a04896b9
4 changed files with 22 additions and 15 deletions
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
12
src/types.ts
12
src/types.ts
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue