T-S0TW-markdown-contract-browser-import
Status: closed/done · Impact: medium · Complexity: small
product-media and product-search fail nuxt generate: their client
bundles reach the vendored markdown-contract package, whose
dist/runner/corpus.js imports node:path (sep), and Vite’s browser
external stub rejects it. This blocks the full proto:build sweep (the e2e
prep step) and any CI lane that builds every product.
| Location | Role today |
|---|---|
vendor/markdown-contract-0.2.1.tgz | The vendored release. Its dist/runner/ (the conformance-test half) imports node:path and is not split from the browser-safe contract core |
solutions/determined/packages/vault-contracts/package.json | Depends on the tgz via file:; every shape module does import { contract } from 'markdown-contract' |
solutions/determined/experiences/media | Extends into product-media; a client-side vault-contracts import drags the whole tgz into the bundle |
solutions/determined/products/media | nuxt generate fails on the node:path import |
solutions/determined/products/search | Same failure, same chain |
Proposed
Section titled “Proposed”Both products build. markdown-contract’s browser-reachable surface has no
Node imports: the runner half lives behind its own subpath export that
browser bundles never resolve, or the two experiences stop importing
vault-contracts from client code.
Approach
Section titled “Approach”- Trace the client-side import: which media/search module pulls
vault-contractsinto the browser bundle, and does it need the contract objects there at all? If not, move the import server-side and stop. - Otherwise split upstream:
markdown-contract(its own repo) exports the contract core at.with no Node imports and the runner at./runner; cut a new release, re-vendor the tgz, bumpvault-contracts. - Re-run
bun run proto:buildinsolutions/determined; all products green.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
vendor/markdown-contract-0.2.1.tgz | delete | Replaced by a split-exports release (if step 2 is needed) |
solutions/determined/packages/vault-contracts/package.json | modify | Bump the vendored dep |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
bun run proto:buildinsolutions/determinedexits 0 —product-mediaandproduct-searchincluded. - AC-2: No
node:specifier resolves into either product’s client bundle frommarkdown-contract.
Out of scope
Section titled “Out of scope”augmented_web’s separate build breakage (T-WORD).
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”- Surfaced by the json-canvas promotion’s full product sweep (PR #1308 verification); pre-existing on main, fallout of the M-6TQL markdown-util extraction era.