Skip to content

fix(client-typescript): build and publish the app-sdk subpath export - #2025

Open
nishant-k02 wants to merge 1 commit into
rocketride-org:developfrom
nishant-k02:fix/RR-2024-app-sdk-npm-packaging
Open

fix(client-typescript): build and publish the app-sdk subpath export#2025
nishant-k02 wants to merge 1 commit into
rocketride-org:developfrom
nishant-k02:fix/RR-2024-app-sdk-npm-packaging

Conversation

@nishant-k02

@nishant-k02 nishant-k02 commented Aug 17, 2026

Copy link
Copy Markdown

Fixes #2024

Problem

rocketride/app-sdk is declared in packages/client-typescript/package.json's exports map and fully documented in docs/README-apps.md, but the published npm package (rocketride@1.3.0) ships no app-sdk build output — import ... from 'rocketride/app-sdk' fails on any real install.

Root cause

src/app-sdk is a sibling of src/client, not nested inside it. The base tsconfig.json's include: ["./src/client/**/*"] — extended by tsconfig.cjs.json, tsconfig.esm.json, and tsconfig.types.json — never covered it, so all three build passes silently skip it and dist/**/app-sdk is never produced.

tsconfig.cli.json already hit this same shape of problem for src/cli and works around it by including both ./src/cli/**/* and ./src/client/**/* — you can see the effect in its existing bin path, ./dist/cli/cli/rocketride.js (double cli/, from TypeScript inferring rootDir as ./src once two sibling directories are compiled together).

Fix

  1. Add "./src/app-sdk/**/*" to all three build tsconfigs, mirroring the existing tsconfig.cli.json pattern.
  2. This shifts the inferred rootDir from ./src/client to ./src, which also moves the existing . and ./analytics outputs one level deeper (dist/<target>/client/...). Updated package.json's main/module/types and the exports["."]/exports["./analytics"] entries to match. exports["./app-sdk"] needed no change — it was already declared at the correct (unnested) path.
  3. Added tests/build-config.test.ts — a regression guard that derives the expected module list from src/* directories that have their own index.ts, and checks each is present in every build tsconfig's include array, plus checks the package.json paths agree with the rootDir-nesting rule above. Note: ts-jest doesn't enforce a tsconfig's include the way tsc -p does, so a plain unit test importing from src/app-sdk would not have caught this originally — only checking the packaging config itself does.

Verification

  • Confirmed the test fails without the fix (7/8 red) and passes with it (8/8 green).
  • Ran the full existing suite before and after: same 66 pre-existing failures both times (a live engine server at ws://localhost:5565 isn't available in this environment — unrelated to this change), zero new regressions, +8 new passing tests.
  • Ran the real ./builder client-typescript:build end to end (including the contract-floor gate in create-package, which passed — no public API surface changed).
  • npm pack'd the real output, installed the tarball into a fresh scratch project, and confirmed require('rocketride'), require('rocketride/app-sdk'), import('rocketride/app-sdk'), and require('rocketride/analytics') all resolve correctly via real Node module resolution.

(Note: app-sdk's hook functions are export 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

    • Corrected package entry points so CommonJS, ESM, and TypeScript consumers can reliably access client and analytics functionality.
    • Ensured client and app SDK modules are included in compiled builds and generated type declarations.
  • Tests

    • Added build configuration checks covering module inclusion and public package exports.

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
@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2efd7a33-e028-4f7c-9ca8-4d8b9af5aa09

📥 Commits

Reviewing files that changed from the base of the PR and between 1b39432 and d1f3add.

📒 Files selected for processing (5)
  • packages/client-typescript/package.json
  • packages/client-typescript/tests/build-config.test.ts
  • packages/client-typescript/tsconfig.cjs.json
  • packages/client-typescript/tsconfig.esm.json
  • packages/client-typescript/tsconfig.types.json

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The client TypeScript build now includes app-sdk and client source trees. Package root and analytics exports point to nested client outputs. New tests validate module inclusion and package paths.

Changes

Client package build and exports

Layer / File(s) Summary
Build source inclusion
packages/client-typescript/tsconfig.*.json
The CommonJS, ESM, and declaration builds include src/app-sdk and src/client.
Package entry-point updates
packages/client-typescript/package.json
Root and ./analytics paths now resolve through dist/client.
Build configuration regression coverage
packages/client-typescript/tests/build-config.test.ts
Tests discover module roots, verify build include entries, and validate package paths for client, analytics, and app-sdk.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to d1f3a

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: builder

Suggested reviewers: jmaionchi, stepmikhaylov, rod-christensen

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the client-typescript build and publication fix for the app-sdk subpath export.
Linked Issues check ✅ Passed The changes satisfy issue #2024 by including app-sdk in all builds, updating affected paths, preserving its export, and adding regression coverage.
Out of Scope Changes check ✅ Passed All changes support the linked issue by fixing build inclusion, package paths, and regression coverage; no unrelated changes are evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:client-typescript TypeScript client SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rocketride@1.3.0: 'rocketride/app-sdk' subpath export is never built, import fails on any real install

1 participant