ci(build): repo-wide verify:dist self-check (and fix a live un-inlined JSON bundle)#111
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsfiles guarded this for booking/ticketing only.What
scripts/verify-dist.ts(pnpm verify:dist,pnpm verify): imports every publishable@otaip/*bundle and hard-fails onMODULE_NOT_FOUND, naming the package + cause. Wired into CI (after build) and as a pre-publish gate inpublish.yml.main:@otaip/agents-exchangeshipped a brokendist—involuntary-rebook/rebook-engine.tsloadedeu-countries.jsonviacreateRequire, which tsup never copies intodist. Importing the package threwMODULE_NOT_FOUND. Fixed to a plain ESM JSON import (esbuild inlines it) + added a matchingdist-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