bunfig preloads scripts/preload-env.ts which loaded dw .env.local files
BEFORE pw could rename them, so pw inherited the dev DB URL and dev.ts
auto-set EMULATE_GOOGLE_URL. The previous stash-rename approach raced
the preload and lost. Now: preload-env.ts honours PW_MODE=1 and skips
.env.local loading; pw sets EMULATE_GOOGLE_URL='' so dev.ts's ??
fallback can't reinstate emulate; the stash dance is gone. A 'bun pw
restore' command remains for one-time cleanup of pre-fix .pw-stash
files.
Adds a lightweight script to run an existing dw worktree with production
environment variables from Infisical. Key behaviors:
- Reuses dw registry for worktree number / port / alias discovery
- Temporarily stashes .env.local files so preload-env.ts cannot
override Infisical-injected prod secrets with dev Neon branch URLs
- Restores stashed .env.local files on exit (SIGINT/SIGTERM/child exit)
- Only overrides SQS queue URLs to local ElasticMQ (avoids consuming
prod messages); everything else (DB, Redis, Stripe) flows from Infisical
- Provides pw identify and pw restore subcommands