Skip to content

ci(build): repo-wide verify:dist self-check (and fix a live un-inlined JSON bundle)#111

Merged
telivity-otaip merged 1 commit into
mainfrom
pr2-verify-dist
May 30, 2026
Merged

ci(build): repo-wide verify:dist self-check (and fix a live un-inlined JSON bundle)#111
telivity-otaip merged 1 commit into
mainfrom
pr2-verify-dist

Conversation

@telivity-otaip
Copy link
Copy Markdown
Collaborator

Why

Field feedback: the bundling build silently breaks data-dependent agents — only a subset register and the consumer gets a plausible-but-wrong result instead of an error. Two per-package dist-runtime.test.ts files guarded this for booking/ticketing only.

What

  • New scripts/verify-dist.ts (pnpm verify:dist, pnpm verify): imports every publishable @otaip/* bundle and hard-fails on MODULE_NOT_FOUND, naming the package + cause. Wired into CI (after build) and as a pre-publish gate in publish.yml.
  • It caught a real bug on main: @otaip/agents-exchange shipped a broken distinvoluntary-rebook/rebook-engine.ts loaded eu-countries.json via createRequire, which tsup never copies into dist. Importing the package threw MODULE_NOT_FOUND. Fixed to a plain ESM JSON import (esbuild inlines it) + added a matching dist-runtime.test.ts.

Verify

pnpm -r run build && pnpm verify:dist → all 16 bundles load; exchange/involuntary-rebook tests (39) and the new dist-runtime test pass.

🤖 Generated with Claude Code

…in exchange

`pnpm verify:dist` imports every published @otaip/* bundle and hard-fails
on MODULE_NOT_FOUND, generalising the per-package dist-runtime tests to
the whole workspace. Wired into CI (after build) and as a pre-publish gate.

It immediately caught a live bug: agents-exchange's involuntary-rebook
engine loaded ./data/eu-countries.json via createRequire, which tsup does
not copy into dist — so importing @otaip/agents-exchange threw
MODULE_NOT_FOUND. Converted to a plain ESM JSON import (the booking/
ticketing convention, inlined by esbuild) and added a matching
dist-runtime.test.ts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@telivity-otaip telivity-otaip merged commit 56bc01d into main May 30, 2026
1 check passed
@telivity-otaip telivity-otaip deleted the pr2-verify-dist branch May 30, 2026 09:10
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.

1 participant