From 55a7a92737a3e00261ed35bea2ce2854b369ecfb Mon Sep 17 00:00:00 2001 From: Owen Simpson Date: Sat, 7 Feb 2026 13:10:17 -0500 Subject: [PATCH 1/3] precommit --- .husky/pre-commit | 14 +++++++++++++- bun.lockb | Bin 324938 -> 326482 bytes package.json | 8 ++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index e640892e..6c7b04c9 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,13 @@ -bun lint --fix \ No newline at end of file +staged_changes=$(git diff --name-only) + +# Run lint + format (auto-fix) +bunx lint-staged + +# Check if lint-staged made any changes +if [ -n "$(git diff --name-only)" ]; then + echo "🚨 Lint or format applied fixes. Stage them and commit again." + git diff --name-only | while read -r f; do + printf '\033[31m%s\033[0m\n' "$f" + done + exit 1 +fi \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 8c44b5f6dfcc05ac04cc785f4f4726cd905122b7..a3fff7aee06a11422e198d1e709767ffb8720637 100755 GIT binary patch delta 16499 zcmeI4cUTnJ*6ypix`9R+K~#dEf*27bg9tQ;fT*B2=1~+71qToT1BL--bj$%u-R2w^ za~d&>IY&fvM8^O|Pz)d{=I>qIyJtA}JLf*ny?>v2d|7+__NrYwRdrQYZ!bJEzxK|2 zo^z|43#!7mm%sn~b(Oeg89U`1-hJJY`d?;-jPANS-@K6~`NT)1KwGVxK8+Q5*1N{` zHP7<82wxDg+rS#b#-_!@#it9xsxvyjDYzPZ_X3?wO&pSu79TGpC8lSjxe3C|X@X#a zeEZ9SP#gBiaGm`KzaIP@KkCXafTi*+l5}<_^5JJ?A4G-)GMrO%ftI?AY{#p*g2uqs zLO$Q&?|3_KDsWDLAbbZ~3`=n%QsOfbljDU!*L3`OvaaGAx9Duz&>?Zu3Grj&<6?v? zK{#3{2?TlMp$Y|YD`9g(~t3)%ivSNV-gbM60l=pI(CJ%ydem6z@Nj?e){+v z#8btl!BWrZE0mm=oEYacG$k$}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DYT_3OmH$SLanY82I3GaW)OsZ6ySk!Q7!T$hU!jCWj diff --git a/package.json b/package.json index 73f5caec..8c63c3ee 100644 --- a/package.json +++ b/package.json @@ -17,15 +17,15 @@ "dev": "bun --watch ./src/index.ts", "typecheck": "tsc --noEmit", "lint": "eslint . --ext .ts,.json", - "format": "prettier '**/*.{ts,json}'", + "format": "bun prettier '**/*.{ts,json}' --write", "docs": "bun run ./open-api/generate.ts", "compile": "bun build --compile --sourcemap ./src/index.ts --outfile $1" }, "lint-staged": { "*.{ts,json}": [ - "eslint --fix" - ], - "*.js": "eslint --cache --fix" + "bun run lint --fix --max-warnings=0", + "bun run format" + ] }, "devDependencies": { "@asteasolutions/zod-to-openapi": "^6.3.1", From 5a9fa0d151abcac9102f5ec0fe78ab1f4b591448 Mon Sep 17 00:00:00 2001 From: Owen Simpson Date: Sat, 7 Feb 2026 13:18:32 -0500 Subject: [PATCH 2/3] re-org tests --- .github/workflows/static-checks.yml | 14 +++++++++++++- .husky/pre-commit | 18 +++++++++++------- package.json | 5 +++-- {src => tests}/auth/admin.test.ts | 4 ++-- {src => tests}/core/RaidHubRoute.test.ts | 2 +- .../integrations/bungie/client.test.ts | 4 ++-- .../integrations/postgres/postgres.test.ts | 0 .../lib/utils/internal-api-client.test.ts | 2 +- .../middleware/cache-control.test.ts | 2 +- {src => tests}/routes/admin/query.test.ts | 2 +- .../admin/reporting/instance-standing.test.ts | 2 +- {src => tests}/routes/authorize/admin.test.ts | 2 +- {src => tests}/routes/authorize/user.test.ts | 2 +- {src => tests}/routes/clanStats.test.ts | 2 +- {src => tests}/routes/instance.test.ts | 2 +- {src => tests}/routes/leaderboard/clan.test.ts | 2 +- .../routes/leaderboard}/contest.test.ts | 2 +- .../routes/leaderboard}/first.test.ts | 2 +- .../routes/leaderboard}/global.test.ts | 2 +- .../routes/leaderboard}/pantheon.test.ts | 2 +- .../routes/leaderboard}/raid.test.ts | 2 +- {src => tests}/routes/manifest.test.ts | 2 +- .../metrics/dailyPlayerPopulation.test.ts | 2 +- .../metrics/weaponsRollingWeekRoute.test.ts | 2 +- {src => tests}/routes/pgcr.test.ts | 2 +- .../routes/player}/basic.test.ts | 2 +- .../routes/player}/history.test.ts | 2 +- .../routes/player}/instances.test.ts | 2 +- .../routes/player}/profile.test.ts | 2 +- {src => tests}/routes/player/search.test.ts | 2 +- .../routes/player}/teammates.test.ts | 2 +- {src => tests}/routes/status.test.ts | 2 +- {src => tests}/services/atlas/atlas.test.ts | 2 +- {src => tests}/services/clans/clan.test.ts | 2 +- .../services/clans/leaderboard.test.ts | 2 +- .../services/floodgates/floodgates.test.ts | 2 +- .../services/instance/instance.test.ts | 2 +- .../services/leaderboard/contest.test.ts | 0 .../services/leaderboard/first.test.ts | 0 .../services/leaderboard/global.test.ts | 0 .../services/leaderboard/pantheon.test.ts | 0 .../services/leaderboard/raid.test.ts | 0 .../services/manifest/definitions.test.ts | 2 +- .../metrics/daily-player-population.test.ts | 0 .../metrics/rolling-weapon-meta.test.ts | 2 +- {src => tests}/services/pgcr.test.ts | 2 +- .../services/player-instances/history.test.ts | 2 +- .../player-instances/instances.test.ts | 2 +- .../player-instances/teammates.test.ts | 2 +- {src => tests}/services/player.test.ts | 2 +- .../services/reporting/standing.test.ts | 2 +- .../services/search/player-search.test.ts | 2 +- tsconfig.json | 2 +- 53 files changed, 72 insertions(+), 55 deletions(-) rename {src => tests}/auth/admin.test.ts (95%) rename {src => tests}/core/RaidHubRoute.test.ts (99%) rename {src => tests}/integrations/bungie/client.test.ts (95%) rename {src => tests}/integrations/postgres/postgres.test.ts (100%) rename {src => tests}/lib/utils/internal-api-client.test.ts (97%) rename {src => tests}/middleware/cache-control.test.ts (94%) rename {src => tests}/routes/admin/query.test.ts (97%) rename {src => tests}/routes/admin/reporting/instance-standing.test.ts (90%) rename {src => tests}/routes/authorize/admin.test.ts (94%) rename {src => tests}/routes/authorize/user.test.ts (95%) rename {src => tests}/routes/clanStats.test.ts (98%) rename {src => tests}/routes/instance.test.ts (97%) rename {src => tests}/routes/leaderboard/clan.test.ts (93%) rename {src/routes/leaderboard/team => tests/routes/leaderboard}/contest.test.ts (95%) rename {src/routes/leaderboard/team => tests/routes/leaderboard}/first.test.ts (95%) rename {src/routes/leaderboard/individual => tests/routes/leaderboard}/global.test.ts (96%) rename {src/routes/leaderboard/individual => tests/routes/leaderboard}/pantheon.test.ts (95%) rename {src/routes/leaderboard/individual => tests/routes/leaderboard}/raid.test.ts (95%) rename {src => tests}/routes/manifest.test.ts (78%) rename {src => tests}/routes/metrics/dailyPlayerPopulation.test.ts (84%) rename {src => tests}/routes/metrics/weaponsRollingWeekRoute.test.ts (92%) rename {src => tests}/routes/pgcr.test.ts (94%) rename {src/routes/player/membershipId => tests/routes/player}/basic.test.ts (90%) rename {src/routes/player/membershipId => tests/routes/player}/history.test.ts (97%) rename {src/routes/player/membershipId => tests/routes/player}/instances.test.ts (97%) rename {src/routes/player/membershipId => tests/routes/player}/profile.test.ts (95%) rename {src => tests}/routes/player/search.test.ts (96%) rename {src/routes/player/membershipId => tests/routes/player}/teammates.test.ts (95%) rename {src => tests}/routes/status.test.ts (99%) rename {src => tests}/services/atlas/atlas.test.ts (98%) rename {src => tests}/services/clans/clan.test.ts (92%) rename {src => tests}/services/clans/leaderboard.test.ts (91%) rename {src => tests}/services/floodgates/floodgates.test.ts (98%) rename {src => tests}/services/instance/instance.test.ts (99%) rename {src => tests}/services/leaderboard/contest.test.ts (100%) rename {src => tests}/services/leaderboard/first.test.ts (100%) rename {src => tests}/services/leaderboard/global.test.ts (100%) rename {src => tests}/services/leaderboard/pantheon.test.ts (100%) rename {src => tests}/services/leaderboard/raid.test.ts (100%) rename {src => tests}/services/manifest/definitions.test.ts (98%) rename {src => tests}/services/metrics/daily-player-population.test.ts (100%) rename {src => tests}/services/metrics/rolling-weapon-meta.test.ts (90%) rename {src => tests}/services/pgcr.test.ts (91%) rename {src => tests}/services/player-instances/history.test.ts (97%) rename {src => tests}/services/player-instances/instances.test.ts (99%) rename {src => tests}/services/player-instances/teammates.test.ts (90%) rename {src => tests}/services/player.test.ts (98%) rename {src => tests}/services/reporting/standing.test.ts (97%) rename {src => tests}/services/search/player-search.test.ts (95%) diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index b04ec333..f03a5e41 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -32,7 +32,19 @@ jobs: bun install --frozen-lockfile - name: Lint - run: bun lint + run: bun run lint --max-warnings=0 + formatt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + + - name: Bun Install + run: | + bun install --frozen-lockfile + + - name: Format + run: bun run format --check verify-open-api-doc: runs-on: ubuntu-latest diff --git a/.husky/pre-commit b/.husky/pre-commit index 6c7b04c9..31f0716a 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,13 +1,17 @@ -staged_changes=$(git diff --name-only) +# Get staged .ts and .json files +staged=$(git diff --cached --name-only | grep -E '\.(ts|json)$' || true) -# Run lint + format (auto-fix) -bunx lint-staged +if [ -n "$staged" ]; then + echo "$staged" | xargs bunx eslint --fix --max-warnings=0 || exit 1 + echo "$staged" | xargs bunx prettier --write +fi -# Check if lint-staged made any changes -if [ -n "$(git diff --name-only)" ]; then +diff=$(git diff --name-only) + +if [ -n "$diff" ]; then echo "🚨 Lint or format applied fixes. Stage them and commit again." - git diff --name-only | while read -r f; do + echo "$diff" | while read -r f; do printf '\033[31m%s\033[0m\n' "$f" done exit 1 -fi \ No newline at end of file +fi diff --git a/package.json b/package.json index 8c63c3ee..301a1199 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "scripts": { "prepare": "husky", "dev": "bun --watch ./src/index.ts", + "test": "bun test tests/", "typecheck": "tsc --noEmit", "lint": "eslint . --ext .ts,.json", "format": "bun prettier '**/*.{ts,json}' --write", @@ -23,8 +24,8 @@ }, "lint-staged": { "*.{ts,json}": [ - "bun run lint --fix --max-warnings=0", - "bun run format" + "eslint --fix --max-warnings=0", + "prettier --write" ] }, "devDependencies": { diff --git a/src/auth/admin.test.ts b/tests/auth/admin.test.ts similarity index 95% rename from src/auth/admin.test.ts rename to tests/auth/admin.test.ts index 9971d4ac..d42b347c 100644 --- a/src/auth/admin.test.ts +++ b/tests/auth/admin.test.ts @@ -1,8 +1,8 @@ import { describe, expect, test } from "bun:test" import express from "express" import request from "supertest" -import { adminProtected } from "./admin" -import { generateJWT } from "./jwt" +import { adminProtected } from "@/auth/admin" +import { generateJWT } from "@/auth/jwt" const app = express() diff --git a/src/core/RaidHubRoute.test.ts b/tests/core/RaidHubRoute.test.ts similarity index 99% rename from src/core/RaidHubRoute.test.ts rename to tests/core/RaidHubRoute.test.ts index 743cab18..042e6da1 100644 --- a/src/core/RaidHubRoute.test.ts +++ b/tests/core/RaidHubRoute.test.ts @@ -9,7 +9,7 @@ import express from "express" import request from "supertest" import { z } from "zod" -import { RaidHubRoute } from "./RaidHubRoute" +import { RaidHubRoute } from "@/core/RaidHubRoute" const app = express() diff --git a/src/integrations/bungie/client.test.ts b/tests/integrations/bungie/client.test.ts similarity index 95% rename from src/integrations/bungie/client.test.ts rename to tests/integrations/bungie/client.test.ts index df8bf5e1..2aa0051f 100644 --- a/src/integrations/bungie/client.test.ts +++ b/tests/integrations/bungie/client.test.ts @@ -1,7 +1,7 @@ import { afterAll, beforeEach, describe, expect, spyOn, test } from "bun:test" import { getDestinyManifest, transferItem } from "bungie-net-core/endpoints/Destiny2" -import { bungiePlatformHttp } from "./client" -import { BungieApiError } from "./error" +import { bungiePlatformHttp } from "@/integrations/bungie/client" +import { BungieApiError } from "@/integrations/bungie/error" describe("bungie http client", () => { const bungieHttp = bungiePlatformHttp({ diff --git a/src/integrations/postgres/postgres.test.ts b/tests/integrations/postgres/postgres.test.ts similarity index 100% rename from src/integrations/postgres/postgres.test.ts rename to tests/integrations/postgres/postgres.test.ts diff --git a/src/lib/utils/internal-api-client.test.ts b/tests/lib/utils/internal-api-client.test.ts similarity index 97% rename from src/lib/utils/internal-api-client.test.ts rename to tests/lib/utils/internal-api-client.test.ts index 0a6650b5..465b31fe 100644 --- a/src/lib/utils/internal-api-client.test.ts +++ b/tests/lib/utils/internal-api-client.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeEach, describe, expect, spyOn, test } from "bun:test" -import { InternalApiError, internalApiFetch } from "./internal-api-client" +import { InternalApiError, internalApiFetch } from "@/lib/utils/internal-api-client" describe("internalApiFetch", () => { const spyFetch = spyOn(globalThis, "fetch") diff --git a/src/middleware/cache-control.test.ts b/tests/middleware/cache-control.test.ts similarity index 94% rename from src/middleware/cache-control.test.ts rename to tests/middleware/cache-control.test.ts index 28f7d11e..790a6816 100644 --- a/src/middleware/cache-control.test.ts +++ b/tests/middleware/cache-control.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "bun:test" import express from "express" import request from "supertest" -import { cacheControl } from "./cache-control" +import { cacheControl } from "@/middleware/cache-control" const app = express() diff --git a/src/routes/admin/query.test.ts b/tests/routes/admin/query.test.ts similarity index 97% rename from src/routes/admin/query.test.ts rename to tests/routes/admin/query.test.ts index ef5ab815..c987c58c 100644 --- a/src/routes/admin/query.test.ts +++ b/tests/routes/admin/query.test.ts @@ -1,6 +1,6 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { describe, test } from "bun:test" -import { adminQueryRoute } from "./query" +import { adminQueryRoute } from "@/routes/admin/query" describe("admin query 200", () => { const t = async (query: string, type: string, ignoreCost?: boolean) => { diff --git a/src/routes/admin/reporting/instance-standing.test.ts b/tests/routes/admin/reporting/instance-standing.test.ts similarity index 90% rename from src/routes/admin/reporting/instance-standing.test.ts rename to tests/routes/admin/reporting/instance-standing.test.ts index 3cac426b..7564e242 100644 --- a/src/routes/admin/reporting/instance-standing.test.ts +++ b/tests/routes/admin/reporting/instance-standing.test.ts @@ -1,7 +1,7 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { ErrorCode } from "@/schema/errors/ErrorCode" import { describe, expect, test } from "bun:test" -import { reportingStandingInstanceRoute } from "./instance-standing" +import { reportingStandingInstanceRoute } from "@/routes/admin/reporting/instance-standing" describe("instance standing 200", () => { const t = async (instanceId: string) => { diff --git a/src/routes/authorize/admin.test.ts b/tests/routes/authorize/admin.test.ts similarity index 94% rename from src/routes/authorize/admin.test.ts rename to tests/routes/authorize/admin.test.ts index b1b8d8c8..42e9f106 100644 --- a/src/routes/authorize/admin.test.ts +++ b/tests/routes/authorize/admin.test.ts @@ -1,7 +1,7 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" import jwt from "jsonwebtoken" -import { adminAuthorizationRoute } from "./admin" +import { adminAuthorizationRoute } from "@/routes/authorize/admin" describe("authorize 200", () => { test("admin", async () => { diff --git a/src/routes/authorize/user.test.ts b/tests/routes/authorize/user.test.ts similarity index 95% rename from src/routes/authorize/user.test.ts rename to tests/routes/authorize/user.test.ts index 251d3968..98fea001 100644 --- a/src/routes/authorize/user.test.ts +++ b/tests/routes/authorize/user.test.ts @@ -1,7 +1,7 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" import jwt from "jsonwebtoken" -import { userAuthorizationRoute } from "./user" +import { userAuthorizationRoute } from "@/routes/authorize/user" describe("authorize 200", () => { test("user", async () => { diff --git a/src/routes/clanStats.test.ts b/tests/routes/clanStats.test.ts similarity index 98% rename from src/routes/clanStats.test.ts rename to tests/routes/clanStats.test.ts index defe8671..202acf66 100644 --- a/src/routes/clanStats.test.ts +++ b/tests/routes/clanStats.test.ts @@ -5,7 +5,7 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { ErrorCode } from "@/schema/errors/ErrorCode" import { afterAll, beforeEach, describe, expect, spyOn, test } from "bun:test" import { PlatformErrorCodes } from "bungie-net-core/enums" -import { clanStatsRoute } from "./clanStats" +import { clanStatsRoute } from "@/routes/clanStats" describe("clan 200", () => { const spyClanQueueSend = spyOn(clanQueue, "send") diff --git a/src/routes/instance.test.ts b/tests/routes/instance.test.ts similarity index 97% rename from src/routes/instance.test.ts rename to tests/routes/instance.test.ts index 00e48f16..85f8758c 100644 --- a/src/routes/instance.test.ts +++ b/tests/routes/instance.test.ts @@ -3,7 +3,7 @@ import { afterAll, beforeEach, describe, expect, spyOn, test } from "bun:test" import { instanceCharacterQueue, playersQueue } from "@/integrations/rabbitmq/queues" import { expectErr, expectOk } from "@/lib/test-utils" -import { instanceRoute } from "./instance" +import { instanceRoute } from "@/routes/instance" describe("activity 200", () => { const spyCharQueueSend = spyOn(instanceCharacterQueue, "sendJson") diff --git a/src/routes/leaderboard/clan.test.ts b/tests/routes/leaderboard/clan.test.ts similarity index 93% rename from src/routes/leaderboard/clan.test.ts rename to tests/routes/leaderboard/clan.test.ts index d8fa6dac..19902c22 100644 --- a/src/routes/leaderboard/clan.test.ts +++ b/tests/routes/leaderboard/clan.test.ts @@ -1,6 +1,6 @@ import { expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { clanLeaderboardRoute } from "./clan" +import { clanLeaderboardRoute } from "@/routes/leaderboard/clan" describe("clan leaderboard 200", () => { const t = async (query?: Record) => { diff --git a/src/routes/leaderboard/team/contest.test.ts b/tests/routes/leaderboard/contest.test.ts similarity index 95% rename from src/routes/leaderboard/team/contest.test.ts rename to tests/routes/leaderboard/contest.test.ts index 3c7bf432..1be75f0a 100644 --- a/src/routes/leaderboard/team/contest.test.ts +++ b/tests/routes/leaderboard/contest.test.ts @@ -1,6 +1,6 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { leaderboardTeamContestRoute } from "./contest" +import { leaderboardTeamContestRoute } from "@/routes/leaderboard/team/contest" describe("contest leaderboard 200", () => { const t = async ( diff --git a/src/routes/leaderboard/team/first.test.ts b/tests/routes/leaderboard/first.test.ts similarity index 95% rename from src/routes/leaderboard/team/first.test.ts rename to tests/routes/leaderboard/first.test.ts index afeea4f4..bebc59d5 100644 --- a/src/routes/leaderboard/team/first.test.ts +++ b/tests/routes/leaderboard/first.test.ts @@ -1,6 +1,6 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { leaderboardTeamFirstActivityVersionRoute } from "./first" +import { leaderboardTeamFirstActivityVersionRoute } from "@/routes/leaderboard/team/first" describe("first leaderboard 200", () => { const t = async ( diff --git a/src/routes/leaderboard/individual/global.test.ts b/tests/routes/leaderboard/global.test.ts similarity index 96% rename from src/routes/leaderboard/individual/global.test.ts rename to tests/routes/leaderboard/global.test.ts index dccabab6..e808e07c 100644 --- a/src/routes/leaderboard/individual/global.test.ts +++ b/tests/routes/leaderboard/global.test.ts @@ -1,6 +1,6 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { leaderboardIndividualGlobalRoute } from "./global" +import { leaderboardIndividualGlobalRoute } from "@/routes/leaderboard/individual/global" describe("global leaderboard 200", () => { const t = async ( diff --git a/src/routes/leaderboard/individual/pantheon.test.ts b/tests/routes/leaderboard/pantheon.test.ts similarity index 95% rename from src/routes/leaderboard/individual/pantheon.test.ts rename to tests/routes/leaderboard/pantheon.test.ts index 823eac3d..ff5bfb35 100644 --- a/src/routes/leaderboard/individual/pantheon.test.ts +++ b/tests/routes/leaderboard/pantheon.test.ts @@ -1,6 +1,6 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { leaderboardIndividualPantheonRoute } from "./pantheon" +import { leaderboardIndividualPantheonRoute } from "@/routes/leaderboard/individual/pantheon" describe("pantheon leaderboard 200", () => { const t = async ( diff --git a/src/routes/leaderboard/individual/raid.test.ts b/tests/routes/leaderboard/raid.test.ts similarity index 95% rename from src/routes/leaderboard/individual/raid.test.ts rename to tests/routes/leaderboard/raid.test.ts index 2c7dc551..9f612478 100644 --- a/src/routes/leaderboard/individual/raid.test.ts +++ b/tests/routes/leaderboard/raid.test.ts @@ -1,6 +1,6 @@ import { expectErr, expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { leaderboardIndividualRaidRoute } from "./raid" +import { leaderboardIndividualRaidRoute } from "@/routes/leaderboard/individual/raid" describe("raid leaderboard 200", () => { const t = async ( diff --git a/src/routes/manifest.test.ts b/tests/routes/manifest.test.ts similarity index 78% rename from src/routes/manifest.test.ts rename to tests/routes/manifest.test.ts index b9a860e4..66dc2684 100644 --- a/src/routes/manifest.test.ts +++ b/tests/routes/manifest.test.ts @@ -1,6 +1,6 @@ import { expectOk } from "@/lib/test-utils" import { test } from "bun:test" -import { manifestRoute } from "./manifest" +import { manifestRoute } from "@/routes/manifest" test("manifest 200", async () => { const result = await manifestRoute.$mock() diff --git a/src/routes/metrics/dailyPlayerPopulation.test.ts b/tests/routes/metrics/dailyPlayerPopulation.test.ts similarity index 84% rename from src/routes/metrics/dailyPlayerPopulation.test.ts rename to tests/routes/metrics/dailyPlayerPopulation.test.ts index 2ca0a85e..e47167bb 100644 --- a/src/routes/metrics/dailyPlayerPopulation.test.ts +++ b/tests/routes/metrics/dailyPlayerPopulation.test.ts @@ -1,6 +1,6 @@ import { expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { dailyPlayerPopulationRoute } from "./dailyPlayerPopulation" +import { dailyPlayerPopulationRoute } from "@/routes/metrics/dailyPlayerPopulation" describe("player population 200", () => { test("it works", async () => { diff --git a/src/routes/metrics/weaponsRollingWeekRoute.test.ts b/tests/routes/metrics/weaponsRollingWeekRoute.test.ts similarity index 92% rename from src/routes/metrics/weaponsRollingWeekRoute.test.ts rename to tests/routes/metrics/weaponsRollingWeekRoute.test.ts index 8bb24f69..bfab554c 100644 --- a/src/routes/metrics/weaponsRollingWeekRoute.test.ts +++ b/tests/routes/metrics/weaponsRollingWeekRoute.test.ts @@ -1,6 +1,6 @@ import { expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { weaponsRollingWeekRoute } from "./weaponsRollingWeek" +import { weaponsRollingWeekRoute } from "@/routes/metrics/weaponsRollingWeek" describe("weekly weapon meta 200", () => { const t = async (query: unknown) => { diff --git a/src/routes/pgcr.test.ts b/tests/routes/pgcr.test.ts similarity index 94% rename from src/routes/pgcr.test.ts rename to tests/routes/pgcr.test.ts index c4a0ee21..c83782c5 100644 --- a/src/routes/pgcr.test.ts +++ b/tests/routes/pgcr.test.ts @@ -2,7 +2,7 @@ import { describe, test } from "bun:test" import { expectErr, expectOk } from "@/lib/test-utils" -import { pgcrRoute } from "./pgcr" +import { pgcrRoute } from "@/routes/pgcr" describe("pgcr 200", () => { const t = async (instanceId: string) => { diff --git a/src/routes/player/membershipId/basic.test.ts b/tests/routes/player/basic.test.ts similarity index 90% rename from src/routes/player/membershipId/basic.test.ts rename to tests/routes/player/basic.test.ts index 263ca3c4..4f67c73e 100644 --- a/src/routes/player/membershipId/basic.test.ts +++ b/tests/routes/player/basic.test.ts @@ -2,7 +2,7 @@ import { describe, test } from "bun:test" import { expectErr, expectOk } from "@/lib/test-utils" -import { playerBasicRoute } from "./basic" +import { playerBasicRoute } from "@/routes/player/membershipId/basic" describe("player basic 200", () => { const t = async (membershipId: string) => { diff --git a/src/routes/player/membershipId/history.test.ts b/tests/routes/player/history.test.ts similarity index 97% rename from src/routes/player/membershipId/history.test.ts rename to tests/routes/player/history.test.ts index e1ebf319..5cccd0fa 100644 --- a/src/routes/player/membershipId/history.test.ts +++ b/tests/routes/player/history.test.ts @@ -5,7 +5,7 @@ import { expectErr, expectOk } from "@/lib/test-utils" import express from "express" import request from "supertest" -import { playerHistoryRoute } from "./history" +import { playerHistoryRoute } from "@/routes/player/membershipId/history" describe("player activities 200", () => { const t = async (membershipId: string, cursor?: Date) => { diff --git a/src/routes/player/membershipId/instances.test.ts b/tests/routes/player/instances.test.ts similarity index 97% rename from src/routes/player/membershipId/instances.test.ts rename to tests/routes/player/instances.test.ts index a3a3f8fe..eaa1ac60 100644 --- a/src/routes/player/membershipId/instances.test.ts +++ b/tests/routes/player/instances.test.ts @@ -4,7 +4,7 @@ import { generateJWT } from "@/auth/jwt" import { expectErr, expectOk } from "@/lib/test-utils" import { ErrorCode } from "@/schema/errors/ErrorCode" -import { playerInstancesRoute } from "./instances" +import { playerInstancesRoute } from "@/routes/player/membershipId/instances" describe("instances 200", () => { const membershipId = "4611686018488107374" diff --git a/src/routes/player/membershipId/profile.test.ts b/tests/routes/player/profile.test.ts similarity index 95% rename from src/routes/player/membershipId/profile.test.ts rename to tests/routes/player/profile.test.ts index 52e09712..0b667feb 100644 --- a/src/routes/player/membershipId/profile.test.ts +++ b/tests/routes/player/profile.test.ts @@ -3,7 +3,7 @@ import { describe, test } from "bun:test" import { generateJWT } from "@/auth/jwt" import { expectErr, expectOk } from "@/lib/test-utils" -import { playerProfileRoute } from "./profile" +import { playerProfileRoute } from "@/routes/player/membershipId/profile" describe("player profile 200", () => { const t = async (membershipId: string) => { diff --git a/src/routes/player/search.test.ts b/tests/routes/player/search.test.ts similarity index 96% rename from src/routes/player/search.test.ts rename to tests/routes/player/search.test.ts index b44cf0d1..36bc9274 100644 --- a/src/routes/player/search.test.ts +++ b/tests/routes/player/search.test.ts @@ -1,6 +1,6 @@ import { expectOk } from "@/lib/test-utils" import { describe, expect, test } from "bun:test" -import { playerSearchRoute } from "./search" +import { playerSearchRoute } from "@/routes/player/search" describe("player search 200", () => { const t = async (query: unknown) => { diff --git a/src/routes/player/membershipId/teammates.test.ts b/tests/routes/player/teammates.test.ts similarity index 95% rename from src/routes/player/membershipId/teammates.test.ts rename to tests/routes/player/teammates.test.ts index 3ebdccba..48a2e24f 100644 --- a/src/routes/player/membershipId/teammates.test.ts +++ b/tests/routes/player/teammates.test.ts @@ -3,7 +3,7 @@ import { describe, test } from "bun:test" import { generateJWT } from "@/auth/jwt" import { expectErr, expectOk } from "@/lib/test-utils" -import { playerTeammatesRoute } from "./teammates" +import { playerTeammatesRoute } from "@/routes/player/membershipId/teammates" describe("teammates 200", () => { const t = async (membershipId: string) => { diff --git a/src/routes/status.test.ts b/tests/routes/status.test.ts similarity index 99% rename from src/routes/status.test.ts rename to tests/routes/status.test.ts index 8947c610..ff6b6801 100644 --- a/src/routes/status.test.ts +++ b/tests/routes/status.test.ts @@ -8,7 +8,7 @@ import * as BungieCoreEndpoints from "bungie-net-core/endpoints/Core" import { BungieNetResponse } from "bungie-net-core/interfaces" import { CoreSettingsConfiguration } from "bungie-net-core/models" -import { statusRoute, statusState } from "./status" +import { statusRoute, statusState } from "@/routes/status" describe("status 200", async () => { const spyGetAtlasStatus = spyOn(AtlasModule, "getAtlasStatus") diff --git a/src/services/atlas/atlas.test.ts b/tests/services/atlas/atlas.test.ts similarity index 98% rename from src/services/atlas/atlas.test.ts rename to tests/services/atlas/atlas.test.ts index a8410eb6..cc532866 100644 --- a/src/services/atlas/atlas.test.ts +++ b/tests/services/atlas/atlas.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeEach, describe, expect, spyOn, test } from "bun:test" -import { getAtlasStatus } from "." +import { getAtlasStatus } from "@/services/atlas" describe("getAtlasStatus with mock", () => { const spyFetch = spyOn(globalThis, "fetch") diff --git a/src/services/clans/clan.test.ts b/tests/services/clans/clan.test.ts similarity index 92% rename from src/services/clans/clan.test.ts rename to tests/services/clans/clan.test.ts index 4c8c5108..da8c58e7 100644 --- a/src/services/clans/clan.test.ts +++ b/tests/services/clans/clan.test.ts @@ -1,7 +1,7 @@ import { getClanMembers } from "@/integrations/bungie" import { zClanStats } from "@/schema/components/Clan" import { describe, expect, test } from "bun:test" -import { getClanStats } from "./clan-stats" +import { getClanStats } from "@/services/clans/clan-stats" describe("getClanStats", () => { test("returns the correct shape", async () => { diff --git a/src/services/clans/leaderboard.test.ts b/tests/services/clans/leaderboard.test.ts similarity index 91% rename from src/services/clans/leaderboard.test.ts rename to tests/services/clans/leaderboard.test.ts index cb0cd6ec..28152245 100644 --- a/src/services/clans/leaderboard.test.ts +++ b/tests/services/clans/leaderboard.test.ts @@ -1,7 +1,7 @@ import { zClanLeaderboardEntry } from "@/schema/components/Clan" import { describe, expect, test } from "bun:test" import { z } from "zod" -import { getClanLeaderboard } from "./leaderboard" +import { getClanLeaderboard } from "@/services/clans/leaderboard" describe("getClanLeaderboard", () => { test("returns the correct shape", async () => { diff --git a/src/services/floodgates/floodgates.test.ts b/tests/services/floodgates/floodgates.test.ts similarity index 98% rename from src/services/floodgates/floodgates.test.ts rename to tests/services/floodgates/floodgates.test.ts index ed34a765..39d39195 100644 --- a/src/services/floodgates/floodgates.test.ts +++ b/tests/services/floodgates/floodgates.test.ts @@ -1,6 +1,6 @@ import * as MockRabbitAPI from "@/integrations/rabbitmq/api" import { afterAll, beforeEach, describe, expect, spyOn, test } from "bun:test" -import { getFloodgatesRecentId, getFloodgatesStatus } from "." +import { getFloodgatesRecentId, getFloodgatesStatus } from "@/services/floodgates" describe("getFloodgatesRecentId with mock", () => { const spyFetch = spyOn(globalThis, "fetch") diff --git a/src/services/instance/instance.test.ts b/tests/services/instance/instance.test.ts similarity index 99% rename from src/services/instance/instance.test.ts rename to tests/services/instance/instance.test.ts index fd77a738..f99739b2 100644 --- a/src/services/instance/instance.test.ts +++ b/tests/services/instance/instance.test.ts @@ -8,7 +8,7 @@ import { getInstanceExtended, getInstanceMetadataByHash, getLeaderboardEntryForInstance -} from "./instance" +} from "@/services/instance/instance" describe("getInstance", () => { test("returns the correct shape", async () => { diff --git a/src/services/leaderboard/contest.test.ts b/tests/services/leaderboard/contest.test.ts similarity index 100% rename from src/services/leaderboard/contest.test.ts rename to tests/services/leaderboard/contest.test.ts diff --git a/src/services/leaderboard/first.test.ts b/tests/services/leaderboard/first.test.ts similarity index 100% rename from src/services/leaderboard/first.test.ts rename to tests/services/leaderboard/first.test.ts diff --git a/src/services/leaderboard/global.test.ts b/tests/services/leaderboard/global.test.ts similarity index 100% rename from src/services/leaderboard/global.test.ts rename to tests/services/leaderboard/global.test.ts diff --git a/src/services/leaderboard/pantheon.test.ts b/tests/services/leaderboard/pantheon.test.ts similarity index 100% rename from src/services/leaderboard/pantheon.test.ts rename to tests/services/leaderboard/pantheon.test.ts diff --git a/src/services/leaderboard/raid.test.ts b/tests/services/leaderboard/raid.test.ts similarity index 100% rename from src/services/leaderboard/raid.test.ts rename to tests/services/leaderboard/raid.test.ts diff --git a/src/services/manifest/definitions.test.ts b/tests/services/manifest/definitions.test.ts similarity index 98% rename from src/services/manifest/definitions.test.ts rename to tests/services/manifest/definitions.test.ts index cc2601b1..5d5c871c 100644 --- a/src/services/manifest/definitions.test.ts +++ b/tests/services/manifest/definitions.test.ts @@ -12,7 +12,7 @@ import { listFeatDefinitions, listHashes, listVersionDefinitions -} from "./definitions" +} from "@/services/manifest/definitions" describe("getRaidId", () => { test("returns the correct shape", async () => { diff --git a/src/services/metrics/daily-player-population.test.ts b/tests/services/metrics/daily-player-population.test.ts similarity index 100% rename from src/services/metrics/daily-player-population.test.ts rename to tests/services/metrics/daily-player-population.test.ts diff --git a/src/services/metrics/rolling-weapon-meta.test.ts b/tests/services/metrics/rolling-weapon-meta.test.ts similarity index 90% rename from src/services/metrics/rolling-weapon-meta.test.ts rename to tests/services/metrics/rolling-weapon-meta.test.ts index 3dd78a60..800ca66d 100644 --- a/src/services/metrics/rolling-weapon-meta.test.ts +++ b/tests/services/metrics/rolling-weapon-meta.test.ts @@ -1,7 +1,7 @@ import { zWeaponMetric } from "@/schema/components/Metrics" import { describe, expect, test } from "bun:test" import { z } from "zod" -import { getRollingWeaponMeta } from "./rolling-weapon-meta" +import { getRollingWeaponMeta } from "@/services/metrics/rolling-weapon-meta" describe("getRollingWeaponMeta", () => { test("returns the correct shape", async () => { diff --git a/src/services/pgcr.test.ts b/tests/services/pgcr.test.ts similarity index 91% rename from src/services/pgcr.test.ts rename to tests/services/pgcr.test.ts index 022df1c1..1be495c2 100644 --- a/src/services/pgcr.test.ts +++ b/tests/services/pgcr.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "bun:test" import { z } from "zod" -import { getRawCompressedPGCR } from "./pgcr" +import { getRawCompressedPGCR } from "@/services/pgcr" describe("getRawCompressedPGCR", () => { test("returns the correct shape", async () => { diff --git a/src/services/player-instances/history.test.ts b/tests/services/player-instances/history.test.ts similarity index 97% rename from src/services/player-instances/history.test.ts rename to tests/services/player-instances/history.test.ts index 9c00c944..c61c7c26 100644 --- a/src/services/player-instances/history.test.ts +++ b/tests/services/player-instances/history.test.ts @@ -2,7 +2,7 @@ import { zInstanceForPlayer } from "@/schema/components/InstanceForPlayer" import { getInstancePlayerInfo } from "@/services/instance/instance" import { describe, expect, test } from "bun:test" import { z } from "zod" -import { getActivities } from "./history" +import { getActivities } from "@/services/player-instances/history" describe("getActivities", () => { test("returns the correct shape", async () => { diff --git a/src/services/player-instances/instances.test.ts b/tests/services/player-instances/instances.test.ts similarity index 99% rename from src/services/player-instances/instances.test.ts rename to tests/services/player-instances/instances.test.ts index ef76612d..cbc4df0e 100644 --- a/src/services/player-instances/instances.test.ts +++ b/tests/services/player-instances/instances.test.ts @@ -2,7 +2,7 @@ import { zInstanceWithPlayers } from "@/schema/components/InstanceWithPlayers" import { getInstancePlayerInfo } from "@/services/instance/instance" import { describe, expect, test } from "bun:test" import { z } from "zod" -import { getInstances } from "./instances" +import { getInstances } from "@/services/player-instances/instances" describe("getInstances", () => { test("returns the correct shape", async () => { diff --git a/src/services/player-instances/teammates.test.ts b/tests/services/player-instances/teammates.test.ts similarity index 90% rename from src/services/player-instances/teammates.test.ts rename to tests/services/player-instances/teammates.test.ts index 271273ee..b7943f70 100644 --- a/src/services/player-instances/teammates.test.ts +++ b/tests/services/player-instances/teammates.test.ts @@ -1,7 +1,7 @@ import { zTeammate } from "@/schema/components/Teammate" import { describe, expect, test } from "bun:test" import { z } from "zod" -import { getTeammates } from "./teammates" +import { getTeammates } from "@/services/player-instances/teammates" describe("getTeammates", () => { test("returns the correct shape", async () => { diff --git a/src/services/player.test.ts b/tests/services/player.test.ts similarity index 98% rename from src/services/player.test.ts rename to tests/services/player.test.ts index ee620b2e..db468b9e 100644 --- a/src/services/player.test.ts +++ b/tests/services/player.test.ts @@ -14,7 +14,7 @@ import { getPlayerActivityStats, getPlayerGlobalStats, getWorldFirstEntries -} from "./player" +} from "@/services/player" describe("getPlayer", () => { test("returns the correct shape", async () => { diff --git a/src/services/reporting/standing.test.ts b/tests/services/reporting/standing.test.ts similarity index 97% rename from src/services/reporting/standing.test.ts rename to tests/services/reporting/standing.test.ts index b0b58d2b..7281daf6 100644 --- a/src/services/reporting/standing.test.ts +++ b/tests/services/reporting/standing.test.ts @@ -5,7 +5,7 @@ import { } from "@/schema/components/InstanceStanding" import { describe, expect, test } from "bun:test" import { z } from "zod" -import { getInstanceBlacklist, getInstanceFlags, getInstancePlayersStanding } from "./standing" +import { getInstanceBlacklist, getInstanceFlags, getInstancePlayersStanding } from "@/services/reporting/standing" describe("getInstanceFlags", () => { test("returns the correct shape", async () => { diff --git a/src/services/search/player-search.test.ts b/tests/services/search/player-search.test.ts similarity index 95% rename from src/services/search/player-search.test.ts rename to tests/services/search/player-search.test.ts index 8c6aaafd..9b259d7a 100644 --- a/src/services/search/player-search.test.ts +++ b/tests/services/search/player-search.test.ts @@ -1,7 +1,7 @@ import { zPlayerInfo } from "@/schema/components/PlayerInfo" import { describe, expect, test } from "bun:test" import { z } from "zod" -import { searchForPlayer } from "./player-search" +import { searchForPlayer } from "@/services/search/player-search" describe("searchForPlayer", () => { test("returns the correct shape", async () => { diff --git a/tsconfig.json b/tsconfig.json index 8018138d..bfa26fad 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,7 +32,7 @@ }, "include": [ "src/**/*.ts", - "src/**/*.test.ts", + "tests/**/*.ts", "open-api/generate.ts", "api-keys.json" ] From 27b9576fe0f510590f3e0d0008f35dbe3086ffc8 Mon Sep 17 00:00:00 2001 From: Owen Simpson Date: Mon, 9 Feb 2026 18:58:48 -0500 Subject: [PATCH 3/3] new precomm --- .husky/pre-commit | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 31f0716a..78573e1c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,17 +1,39 @@ +# Restore stashed unstaged changes. On conflict, restore working tree and re-apply stash. +restore_stash() { + if git stash apply stash@{0} 2>/dev/null; then + git stash drop stash@{0} + else + git restore . + git stash pop + echo "⚠️ Lint/format fixes conflicted with unstaged changes; restored your working tree." + exit 1 + fi +} + # Get staged .ts and .json files staged=$(git diff --cached --name-only | grep -E '\.(ts|json)$' || true) if [ -n "$staged" ]; then - echo "$staged" | xargs bunx eslint --fix --max-warnings=0 || exit 1 + stash_used= + # Stash unstaged changes so lint/format only see staged content + if ! git diff --quiet; then + git stash push -m "pre-commit: unstaged changes" --keep-index + stash_used=1 + fi + + echo "$staged" | xargs bunx eslint --fix --max-warnings=0 || { [ -n "$stash_used" ] && restore_stash; exit 1; } echo "$staged" | xargs bunx prettier --write -fi -diff=$(git diff --name-only) + # Fail if lint/format changed any of the files we ran on + diff=$(echo "$staged" | xargs git diff --name-only -- 2>/dev/null | sort -u) + if [ -n "$diff" ]; then + [ -n "$stash_used" ] && restore_stash + echo "🚨 Lint or format applied fixes. Stage them and commit again." + echo "$diff" | while read -r f; do + printf '\033[31m%s\033[0m\n' "$f" + done + exit 1 + fi -if [ -n "$diff" ]; then - echo "🚨 Lint or format applied fixes. Stage them and commit again." - echo "$diff" | while read -r f; do - printf '\033[31m%s\033[0m\n' "$f" - done - exit 1 + [ -n "$stash_used" ] && restore_stash fi