chore(examples): make setup.sh work with bun fallback and ts resolution#1955
Closed
sherwinski wants to merge 1 commit into
Closed
chore(examples): make setup.sh work with bun fallback and ts resolution#1955sherwinski wants to merge 1 commit into
sherwinski wants to merge 1 commit into
Conversation
Contributor
Author
|
As mentioned in the PR description, another option would be to just bump the expected vite-plus version used. |
a986bb1 to
9b8b89c
Compare
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>
8417576 to
70c3c65
Compare
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
The demo
examples/setup.shassumed a vite-plus build that shipsvp pm pack,vp add, andvp remove. Older globally-installed vite-plus (e.g. v0.1.14) only shipsvp install, sovp run android/vp run iosfailed with:The SDK build step also failed independently because vite-plus's global
tschelper resolvedrequire('typescript')from vite-plus's ownnode_modulesand couldn't find the SDK's compiler:What
vp pm packonce; prefervpwhen available, otherwise fall back tobun(the repo's pinned package manager) for the pack/add/remove steps. Keepsbun.lockintegrity hashes in sync the same wayvpwould.NODE_PATHfor the build —NODE_PATH="$SDK_ROOT/node_modules" vp run buildso the bundler resolves the project'stypescript.Testing
Ran the patched script end-to-end with
FORCE_SETUP=1against thedemo-no-locationexample: shim correctly fell back tobun, build resolvedtypescript, tarball packed viabun pm pack, re-registered withbun remove/bun add, stamp written, exit 0. Built and launched the app on an emulator and confirmed the no-location behavior (location module excluded,MisconfiguredLocationManagerdiagnostic 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