Skip to content

chore(examples): make setup.sh work with bun fallback and ts resolution#1955

Closed
sherwinski wants to merge 1 commit into
mainfrom
chore/setup-bun-fallback
Closed

chore(examples): make setup.sh work with bun fallback and ts resolution#1955
sherwinski wants to merge 1 commit into
mainfrom
chore/setup-bun-fallback

Conversation

@sherwinski

Copy link
Copy Markdown
Contributor

Why

The demo examples/setup.sh assumed a vite-plus build that ships vp pm pack, vp add, and vp remove. Older globally-installed vite-plus (e.g. v0.1.14) only ships vp install, so vp run android / vp run ios failed with:

error: Command 'pm' not found

The SDK build step also failed independently because vite-plus's global tsc helper resolved require('typescript') from vite-plus's own node_modules and couldn't find the SDK's compiler:

Error: Cannot find module 'typescript'

What

  • Package-manager shim — probe for vp pm pack once; prefer vp when available, otherwise fall back to bun (the repo's pinned package manager) for the pack/add/remove steps. Keeps bun.lock integrity hashes in sync the same way vp would.
  • NODE_PATH for the buildNODE_PATH="$SDK_ROOT/node_modules" vp run build so the bundler resolves the project's typescript.

Testing

Ran the patched script end-to-end with FORCE_SETUP=1 against the demo-no-location example: shim correctly fell back to bun, build resolved typescript, tarball packed via bun pm pack, re-registered with bun remove/bun add, stamp written, exit 0. Built and launched the app on an emulator and confirmed the no-location behavior (location module excluded, MisconfiguredLocationManager diagnostic on tapping the location button).

Note

This is a fallback fix. The cleaner long-term option may be to bump the expected vite-plus version (the one that ships vp pm) and drop the shim — flagging for discussion.

🤖 Generated with Claude Code

@sherwinski sherwinski requested a review from a team as a code owner June 9, 2026 20:48
@sherwinski

Copy link
Copy Markdown
Contributor Author

As mentioned in the PR description, another option would be to just bump the expected vite-plus version used.

Base automatically changed from fadi/sdk-4728 to main June 9, 2026 22:09
@fadi-george

Copy link
Copy Markdown
Collaborator

make small changes for pr to main

The demo setup script assumed a vite-plus build that ships `vp pm pack`,
`vp add`, and `vp remove`, but older globally-installed vite-plus only
ships `vp install`, so `vp run android/ios` failed with
"Command 'pm' not found". The SDK build also failed because vite-plus's
global tsc helper couldn't resolve the SDK's typescript.

- Add a package-manager shim that prefers `vp` and falls back to `bun`
  (the repo's pinned package manager) for pack/add/remove.
- Export NODE_PATH=$SDK_ROOT/node_modules for `vp run build` so the
  bundler resolves the project's typescript.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sherwinski sherwinski force-pushed the chore/setup-bun-fallback branch from 8417576 to 70c3c65 Compare June 9, 2026 23:48
@sherwinski sherwinski closed this Jun 10, 2026
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.

2 participants