fix(monty-js): publish the component facade declaration in dist #1008
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 409 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.360
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1008"
general
weight: 0.35
davidhewitt
Fixes #982
scripts/build-component.mjsbuilds two declarations for the WASI component: Jco's raw one, and a small facade that re-exports the WIT types withexport * from './interfaces/pydantic-monty-worker.js'. Only the facade is imported by the library —host.tspullsDispatchResultandRequestfrom it,transport.tspullsConfigureRequest— and only the facade was written into the TypeScript source tree.dist/got Jco's version, which declares justImportObject,Rootandinstantiate.The shipped
dist/worker/host.d.tsanddist/worker/transport.d.tstherefore import names that./component/monty.component.jsdoes not export. Against@pydantic/monty@1.1.0,import { Monty } from '@pydantic/monty/wasm'withskipLibCheck: false:The fix
build-component.mjswrites the facade intodist/as well, replacing Jco'smonty.component.d.ts(nothing imports it). Both copies are byte-identical, and the file list Jco returns is otherwise unchanged.make check-wasm-typesgainsnpm run check:dist-types: askipLibCheck: falsepass over the builtdist/worker/index.d.ts, in a newtsconfig.dist.json. The package's owntsconfig.jsonbuilds fromts, so it can never catch this. I confirmed the new check reports the three TS2305 errors against the published 1.1.0distand is clean against adistbuilt with this change.npm run lint(oxlint +tsc -p __test__/tsconfig.json) andprettier --checkare clean.<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Fixes #982: consumers of
@pydantic/monty/wasmno longer hit TS2305 errors onDispatchResult,Request, andConfigureRequestwhen compiling withskipLibCheck: false.Previously the published
dist/worker/component/monty.component.d.tswas Jco's generated declaration, not the facade that re-exports the WIT types, sohost.d.tsandtransport.d.tsshipped dangling imports.distin place of Jco's declaration, which nothing imports.npm run check:dist-types, a strict consumer-side pass over the built declarations, run bymake check-wasm-types.<sup>Written for commit e78543d4b6a824f9f8ab4510bdd2256e22322d6e. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/pydantic/monty/pull/1008?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->