Skip to content

APR-158: Improve code quality & test coverage in zolvery#3

Merged
JacobSampson merged 4 commits into
mainfrom
agent/engineer/a026fd54
Jun 6, 2026
Merged

APR-158: Improve code quality & test coverage in zolvery#3
JacobSampson merged 4 commits into
mainfrom
agent/engineer/a026fd54

Conversation

@JacobSampson

Copy link
Copy Markdown
Collaborator

Summary

  • Remove 7 orphaned/dead-code files and wire 2 loose modules into barrel exports
  • Replace any types with unknown/typed interfaces across packages/core and apps/server
  • Convert swallowed-error catch blocks to rethrow in core client and server modules
  • Extract hardcoded CDN/API URLs into constants.ts with VITE_* env overrides
  • Add 61 unit tests covering 5 previously-untested modules (auth middleware, app service, app store, date utils, core client/API)

Changes

  • Deleted dead code: settings-drawer.tsx, use-auth.ts, help-content.ts, sns.ts, daily-data-store.ts, game-service.ts, leaderboard-service.ts
  • Wired orphans: leaderboard.ts and types.ts exported from barrel files; date.unit.ts moved to __tests__/
  • Type safety: client.ts, api.ts, event-bus.ts, storage.ts, auth.ts, telemetry.ts, app.ts — replaced any with unknown, Record<string, unknown>, or typed narrowing
  • Error handling: requestData, handleCustomEvent, handleScoreSubmission in client; app-store.ts and initTelemetry in server now rethrow after logging
  • URL extraction: Created apps/client/src/constants.ts with WIDGET_CDN_URL, PEERJS_CDN_URL, GITHUB_REPO_URL; extracted Cognito localhost URLs into LOCALHOST_CALLBACK_URLS in platform constants
  • Tests: auth-middleware.unit.ts (14 tests), app-service.unit.ts (4 tests), app-store.unit.ts (3 tests), date.unit.ts (5 tests), client.test.ts (24 tests), api.test.ts (14 tests)

Test Plan

  • All 35 core tests pass (pnpm --filter @zolver/core test)
  • All 26 server tests pass (pnpm --filter @zolvery/server test)
  • No new typecheck errors introduced in apps/server
  • Pre-existing packages/core typecheck errors (missing events.ts, browser globals) tracked separately

Closes: APR-158

- Remove orphaned/dead-code files and wire loose modules
- Replace any types with unknown/typed interfaces
- Convert swallowed-error catch blocks to rethrow
- Extract hardcoded URLs into constants/env config
- Add unit tests for 5 untested modules (61 tests)
- Fix CI workflow to use pnpm instead of npm
- Update CI to use Node.js 22 for exports support
- Fix ESLint module resolution in pnpm monorepo
- Fix verify.yml to use pnpm instead of npm, Node 22
- Fix typecheck errors from any->unknown replacement
- Add core tsconfig.build.json for declaration emit
- Move events mock to actual events.ts module
- Fix logger API calls (pino merging pattern)
- Fix tsconfig exclude pattern for __tests__
- Un-gitignore pnpm-lock.yaml for frozen installs
- Fix random.ts non-null assertion
@JacobSampson JacobSampson force-pushed the agent/engineer/a026fd54 branch from 97aa145 to 23249ac Compare June 6, 2026 13:39
package.json has packageManager field which pnpm/action-setup@v4
reads automatically; specifying version: 9 conflicts with it
- Fix eslintrc.js to use root:true and direct plugin import
- Replace ExtendedLogger with PinoLogger type
- Fix pino logger call signatures (2-arg form)
- Remove unused NotFoundError import from app-service
- Replace {} generic types with Record<string, unknown>
- Add shamefully-hoist to .npmrc for ESLint resolution
@JacobSampson JacobSampson merged commit 2be824e into main Jun 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant