Skip to content

fix(mcp, verify): a type check writes the declarations it reads first - #262

Merged
alekswebnet merged 1 commit into
mainfrom
fix/mcp-typecheck-alone
Nov 20, 2026
Merged

alekswebnet merged 1 commit into
mainfrom
fix/mcp-typecheck-alone

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #261.

What changes

  • mcp's typecheck runs pnpm --filter @missing-elements/h5p-verify --filter @missing-elements/h5p-author run types before tsc -p tsconfig.json. Without verify's types/, TypeScript checked verify.mjs itself under mcp's Node-only lib and failed on window and document. That stopped mcp 0.4.0's publish (run 44726189991), where verify was not being released and so nothing wrote its types.
  • verify's types builds the player's declarations first (tsc -b in packages/player), as the author's types always has. Alone, from a checkout with no types/, verify's own typecheck failed the same way.
  • design/build.md: a fourth rule under the declarations: a package's typecheck writes the declarations it reads first, and passes alone.

Checked

With every types/ folder and every build-info file deleted before each run:

  • each package's typecheck alone: mcp, verify, author, embed, cmi5, normalize, player, runtime, vscode, all pass;
  • before the fix, mcp failed with the 22 errors of the publish run, and verify with 1;
  • pnpm -r typecheck passes;
  • mcp's tests: 21. verify still packs (its prepack runs types).

After merging

Run publish.yml again. It skips normalize 1.5.0 and author 0.15.0, which are on npm, and publishes h5p-mcp 0.4.0. Its version needs no bump: 0.4.0 never reached npm.


Summary by cubic

Fixes #261: each package's typecheck now writes the declarations it reads first, so it passes alone from a clean checkout with no types/ folders.

  • mcp's typecheck runs verify's and author's types before tsc. Without verify's declarations, TypeScript fell back to verify.mjs under mcp's Node-only lib and failed on window and document, stopping the mcp 0.4.0 publish when verify wasn't released.
  • verify's types now builds the player's declarations first (tsc -b in packages/player), as author's already did.
  • design/build.md documents the rule that a typecheck writes what it reads.
  • Publish should be run again to release h5p-mcp 0.4.0, which never reached npm.

Written for commit 3f58053. Summary will update on new commits.

View guided diff Turn on auto-fix

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@alekswebnet
alekswebnet merged commit 03db629 into main Nov 20, 2026
12 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.

h5p-mcp 0.4.0 did not publish: its type check needs the verifier's generated types

1 participant