chore(previews): make dev-mobile ports configurable and tighten SST env types#651
Draft
Barnabas A Nsoh (ayinloya) wants to merge 4 commits into
Draft
chore(previews): make dev-mobile ports configurable and tighten SST env types#651Barnabas A Nsoh (ayinloya) wants to merge 4 commits into
Barnabas A Nsoh (ayinloya) wants to merge 4 commits into
Conversation
…ability Allow overriding the embed and previews app ports via EMBED_PORT and APP_PORT (with optional .env support), validate that the chosen ports are numeric and free before starting tunnels, and switch the embed sidecar to a built bundle served by 'serve' so the tunneled origin matches what mobile devices will hit.
🔍 Semgrep Security Scan Results✅ No security findings detected by |
|
This branch has been deployed to s3 / cloudfront. ✅ Preview URL for Smart Camera Web: ✅ Preview URL for Embed: ✅ Preview URL for Web Client (Sandbox): ✅ Preview URL for Web Client (Production): |
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
Internal dev-tooling improvements to the
previews/workspace. Split out of #650 so the 11.4.5 release PR only contains the user-facing Selfie fix and version bumps.Changes
previews/scripts/dev-mobile.shpreviews/.envso contributors can persist their port choices.EMBED_PORT(default8000) andAPP_PORT(default5173) overrides.lsof) before launching tunnels — fail fast with a clear message instead of getting a half-running tunnel.npm run build+npx serveinstead ofnpm start, so the tunneled origin matches what mobile devices actually load.APP_PORTthrough tosst dev … vite:dev -- --port "$APP_PORT".previews/sst-env.d.tsEmbedUrlassst.sst.Secret(wassst.sst.Linkable) to match how it's wired insst.config.ts.WafWebAclArn(alsosst.sst.Secret) so TS stops complaining when the WAF link is referenced.Scope
previews/(private workspace; not published).Notes / follow-ups
A couple of nits worth knowing about (not blockers, can be addressed in review or a follow-up):
dev-mobile.shstill references the old hard-coded ports — worth updating.is_port_in_usesilently returns false iflsofisn't installed; consider acommand -v lsofguard with a warning.servebinary is fetched on demand vianpx; adding--yeswould avoid the interactive prompt on first run.Testing
Manual:
EMBED_PORT=9000 APP_PORT=5180 ./previews/scripts/dev-mobile.sh— both tunnels come up on the chosen ports.main.