fix(mcp, verify): a type check writes the declarations it reads first
Merged
AL
3d ago+12+12+01234567890123456789-3-3-0123456789
Closes #261.
What changes
- mcp's
typecheckrunspnpm --filter @missing-elements/h5p-verify --filter @missing-elements/h5p-author run typesbeforetsc -p tsconfig.json. Without verify'stypes/, TypeScript checkedverify.mjsitself under mcp's Node-onlyliband failed onwindowanddocument. That stopped mcp 0.4.0's publish (run 44726189991), where verify was not being released and so nothing wrote its types. - verify's
typesbuilds the player's declarations first (tsc -bin packages/player), as the author'stypesalways has. Alone, from a checkout with notypes/, verify's owntypecheckfailed the same way. - design/build.md: a fourth rule under the declarations: a package's
typecheckwrites 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
typecheckalone: 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 typecheckpasses;- mcp's tests: 21. verify still packs (its
prepackrunstypes).
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
typecheckruns verify's and author'stypesbeforetsc. Without verify's declarations, TypeScript fell back toverify.mjsunder mcp's Node-onlyliband failed onwindowanddocument, stopping the mcp 0.4.0 publish when verify wasn't released. - verify's
typesnow builds the player's declarations first (tsc -bin packages/player), as author's already did. - design/build.md documents the rule that a
typecheckwrites what it reads. - Publish should be run again to release h5p-mcp 0.4.0, which never reached npm.