Skip to content

Tech debt: pnpm check is unusable — @astrojs/check not installed, 14 pre-existing type errors surface when it is #54

Description

@khurchla

Surfaced while shipping the v0.1.0 fix-set (issues #43#47). Not in scope for v0.1.0 — captured for post-launch.

What I observed

CLAUDE.md documents pnpm check as one of the project's commands, but running it on the v0.1.0 branch (and on main HEAD before any of the #43#47 work) prompts:

Astro will run the following command: pnpm add @astrojs/check typescript

Once @astrojs/check + typescript are installed, pnpm check surfaces 14 pre-existing TypeScript errors across files I did not touch in the v0.1.0 fix-set. Stashing my changes and rerunning produced an identical 14-error count on baseline main, so none of them was introduced by #43#47. I rolled back the @astrojs/check install to keep the v0.1.0 diff scoped to the user-facing fixes; relying on pnpm test + pnpm build for verification on this release.

The 14 errors live in 5 files

File Lines (approx) Nature
e2e/perf.test.ts 17 ts(2353)reducedMotion not a known property on Playwright's Fixtures<...> type
src/components/CardReview.stories.ts 1 ts(2307) — cannot find module @storybook/svelte
src/components/ScramblerCard.stories.ts 1, 28, 39, 50 ts(2307) @storybook/svelte missing + three ts(7006) implicit-any args
src/components/bio/BioExploration.stories.ts 1, 36, 50, 66, 81 same shape — missing module + four implicit-any args
src/pages/writing.astro 40 ts(2322)class:draft not in LiHTMLAttributes
tests/webmcp/reliability.test.ts 34, 72 ts(2322) — vitest Mock<...> returning { success: boolean, ... } doesn't fit the discriminated ToolResult<...> union; needs success: true as const or explicit return type

Why this should be tackled

pnpm check being silently broken in the baseline means three things slip:

  1. Type regressions in production source files (e.g. writing.astro) ride along into releases.
  2. Storybook for Svelte components is unimportable as configured — the stories almost certainly don't render in the current Storybook setup. The plotted "Storybook 8" stack in CLAUDE.md may be drifting from what's actually installed.
  3. New contributors hitting pnpm check get a setup prompt + a wall of errors as their first signal, which is a bad first-run.

Proposed scope for the follow-up

  1. Add @astrojs/check + a pinned typescript to devDependencies so the documented command runs without a prompt.
  2. Fix the 14 errors:
    • Stories: install (or re-pin) the correct @storybook/svelte package + add explicit args types.
    • writing.astro: drop the class:draft directive (Astro syntax doesn't support it on raw HTML elements) — replace with class={isDraft ? 'draft' : undefined}.
    • perf.test.ts: remove the unrecognised reducedMotion fixture key (or migrate to the Playwright option that replaced it).
    • reliability.test.ts: tighten the mock return shapes to success: true as const / success: false as const.
  3. Wire pnpm check into CI as a required step alongside pnpm test so any future drift fails the PR.

None of this is user-visible — pure DX / typecheck hygiene — which is why it's flagged for post-launch rather than blocking the v0.1.0 cut.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions