Repository navigation
Expose public bb-app SDK - #343
Merged
Merged
Conversation
ymichael
marked this pull request as ready for review
June 24, 2026 16:58
SawyerHood
added a commit
that referenced
this pull request
Jun 25, 2026
## Problem The packaged desktop app crashes at startup: ``` Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/bb-app.js' is not defined by "exports" in .../node_modules/bb-app/package.json imported from .../dist/bb-app-bridge.mjs ``` ## Root cause The desktop bridge (`apps/desktop/src/bb-app-bridge.ts`) boots the app via a side-effect import of the launcher entry: ```ts import "bb-app/dist/bb-app.js"; ``` Before #343, `bb-app` had no `exports` field, so Node allowed any deep import. #343 ("Expose public bb-app SDK") added an `exports` map declaring only the `"."` entry. Once `exports` is present, Node's exports encapsulation rejects every subpath that isn't listed — breaking the bridge's deep import. `npx bb-app` is unaffected because it launches through the `bin` field (a direct file path that bypasses module-exports resolution), which is why only the desktop app failed. ## Fix Add the `./dist/bb-app.js` subpath to the `exports` map. Verified with `import.meta.resolve` that both the deep launcher import and the root SDK entry resolve correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.
Summary
bb-apppackage viaimport { BBSdk } from "bb-app"@bb/sdk, withbb thread waitdelegating to itdist/index.js/dist/index.d.ts, document the SDK, and add tarball smoke coverage for JS/TS imports plus a live SDK status callValidation
pnpm exec turbo run typecheck --filter=@bb/sdk --filter=@bb/cli --filter=bb-app --filter=@bb/server-contractpnpm exec turbo run test --filter=@bb/sdk --forcepnpm exec turbo run test --filter=@bb/server-contract --forcepnpm exec turbo run test --filter=@bb/cli --forcepnpm exec turbo run test --filter=bb-app --forcepnpm exec turbo run build --filter=bb-app --forcepnpm exec turbo run smoke:tarball --filter=bb-app --forcegit diff --check