fix(client-typescript): build and publish the app-sdk subpath export - #2025
fix(client-typescript): build and publish the app-sdk subpath export#2025nishant-k02 wants to merge 1 commit into
Conversation
src/app-sdk is a sibling of src/client, not nested inside it, so
tsconfig.{cjs,esm,types}.json's `include: ["./src/client/**/*"]` silently
excluded it from every build pass. dist/**/app-sdk was never produced, so
`import ... from 'rocketride/app-sdk'` failed on any real install despite
the subpath being declared in package.json's exports and fully documented
in docs/README-apps.md.
Add "./src/app-sdk/**/*" to all three build tsconfigs, mirroring the same
pattern tsconfig.cli.json already uses for src/cli. This shifts
TypeScript's inferred rootDir from ./src/client to ./src, which also moves
the existing "." and "./analytics" export outputs one level deeper (to
dist/<target>/client/...) — update package.json's main/module/types and
those two exports entries to match. exports["./app-sdk"] needs no change,
since app-sdk was never nested under client.
Verified with a clean ./builder client-typescript:build, npm pack, fresh
install, and require()/import() against the real built tarball for all
three subpaths (., ./app-sdk, ./analytics).
Fixes rocketride-org#2024
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe client TypeScript build now includes ChangesClient package build and exports
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized change adds the missing app-sdk build output and updates package entry paths for the adjusted layout; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #2024
Problem
rocketride/app-sdkis declared inpackages/client-typescript/package.json'sexportsmap and fully documented indocs/README-apps.md, but the published npm package (rocketride@1.3.0) ships noapp-sdkbuild output —import ... from 'rocketride/app-sdk'fails on any real install.Root cause
src/app-sdkis a sibling ofsrc/client, not nested inside it. The basetsconfig.json'sinclude: ["./src/client/**/*"]— extended bytsconfig.cjs.json,tsconfig.esm.json, andtsconfig.types.json— never covered it, so all three build passes silently skip it anddist/**/app-sdkis never produced.tsconfig.cli.jsonalready hit this same shape of problem forsrc/cliand works around it by including both./src/cli/**/*and./src/client/**/*— you can see the effect in its existingbinpath,./dist/cli/cli/rocketride.js(doublecli/, from TypeScript inferringrootDiras./srconce two sibling directories are compiled together).Fix
"./src/app-sdk/**/*"to all three build tsconfigs, mirroring the existingtsconfig.cli.jsonpattern.rootDirfrom./src/clientto./src, which also moves the existing.and./analyticsoutputs one level deeper (dist/<target>/client/...). Updatedpackage.json'smain/module/typesand theexports["."]/exports["./analytics"]entries to match.exports["./app-sdk"]needed no change — it was already declared at the correct (unnested) path.tests/build-config.test.ts— a regression guard that derives the expected module list fromsrc/*directories that have their ownindex.ts, and checks each is present in every build tsconfig'sincludearray, plus checks thepackage.jsonpaths agree with the rootDir-nesting rule above. Note:ts-jestdoesn't enforce a tsconfig'sincludethe waytsc -pdoes, so a plain unit test importing fromsrc/app-sdkwould not have caught this originally — only checking the packaging config itself does.Verification
ws://localhost:5565isn't available in this environment — unrelated to this change), zero new regressions, +8 new passing tests../builder client-typescript:buildend to end (including the contract-floor gate increate-package, which passed — no public API surface changed).npm pack'd the real output, installed the tarball into a fresh scratch project, and confirmedrequire('rocketride'),require('rocketride/app-sdk'),import('rocketride/app-sdk'), andrequire('rocketride/analytics')all resolve correctly via real Node module resolution.(Note:
app-sdk's hook functions areexport declare function— intentionally no runtime body; they're substituted by the real shell host via Module Federation. That's expected/by-design, not something this PR changes — the bug was purely that the module couldn't be resolved at all.)Summary by CodeRabbit
Bug Fixes
Tests