diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60bc085..66c3365 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/package.json b/package.json index 1cac879..253d18b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index 43da950..904dc7d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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. * diff --git a/src/types.ts b/src/types.ts index a2b59e4..fcfa402 100644 --- a/src/types.ts +++ b/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]; -