Skip to content

T-SWJZ-markdown-contract-core-subpath-revendor

Status: planning/backlog · Impact: low · Complexity: medium

The shell layer’s markdown-contractdist/core vite alias (T-S0TW) is a workaround for a missing upstream export: the package root re-exports the corpus runner (node:fs/node:path), and there is no ./core subpath naming the browser-safe half. Ship the subpath upstream, re-vendor, and delete the alias. Blocking that today is a trap in the re-vendor flow itself: a naive run downgrades the package and drops an API a consumer depends on.

LocationRole today
vendor/markdown-contract-0.2.1.tgzHand-composed artifact (mc 0.2.0 + splitFrontmatter restored); byte-identical copy at solutions/determined/vendor/
solutions/determined/scripts/update-markdown-contract.shRe-vendor script: clones upstream main, builds packages/core, npm packs whatever version that manifest carries — today 0.1.0, a downgrade from the composed 0.2.1 that silently drops splitFrontmatter (used by solutions/determined/apps/vault-triage/src/config.ts)
solutions/determined/packages/shell/nuxt.config.tsCarries the vite alias pointing the bare specifier at dist/core/index.js for every product’s browser build
solutions/determined/packages/vault-contracts/13 schema modules import { contract } from 'markdown-contract' — the package-root specifier the alias rewrites

Upstream (/Users/sksizer2/Developer/markdown-contract, packages/core) already keeps src/core/ and src/runner/ separate; its exports map has ., ./declarative, ./cli, ./cli/run — no ./core.

Upstream markdown-contract exports the browser-safe contract core at ./core (no node:* in its transitive graph), with splitFrontmatter landed on main and the version bumped past the composed 0.2.1. The repo vendors that release, vault-contracts schema modules import markdown-contract/core, and the shell alias is deleted.

  1. Upstream: land splitFrontmatter on main, add the ./core subpath export, bump packages/core to 0.2.2, tag.
  2. Fix update-markdown-contract.sh: fail if the packed version is not newer than the vendored one; write both vendor copies (root vendor/ and solutions/determined/vendor/), or collapse to one dir and update the ten file: specs together.
  3. Re-vendor; bump every file: dependant; bun install.
  4. Rewrite the 13 vault-contracts schema-module imports to markdown-contract/core; keep corpus.ts/check.ts on the root.
  5. Delete the shell alias; bun run proto:build green without it.
LocationKindChange
vendor/markdown-contract-0.2.1.tgzdeleteReplaced by the split-exports release
solutions/determined/vendor/markdown-contract-0.2.1.tgzdeleteSame
solutions/determined/scripts/update-markdown-contract.shmodifyDowngrade guard; handle both vendor locations
solutions/determined/packages/vault-contracts/modifySchema imports move to markdown-contract/core
solutions/determined/packages/shell/nuxt.config.tsmodifyDelete the alias block
  • AC-1: bun run proto:build in solutions/determined exits 0 with no markdown-contract vite alias anywhere in the repo.
  • AC-2: update-markdown-contract.sh refuses to vendor a version older than the one in place.
  • AC-3: apps/vault-triage still typechecks (its splitFrontmatter import survives the re-vendor).
  • Publishing markdown-contract to npm (the vendor README’s documented exit path) — a bigger call than this cleanup.
  • Upstream repo access (/Users/sksizer2/Developer/markdown-contract) — the split happens there first.
  • Surfaced fixing T-S0TW: the alias hoist was chosen over the upstream split precisely because the re-vendor flow would downgrade 0.2.1 → 0.1.0 and drop splitFrontmatter.

← Back to Tasks