Repository navigation
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Rename `mod dev` to `mod relay "dev"` in the root justfile so it no longer collides with the top-level `dev:` recipe. The dev/ directory contains relay tooling, so `just relay root` / `just relay auth-token` are semantically clearer anyway. - Remove the top-level `native:` recipe and add `default: dev` to native/justfile so `just native` still runs the Tauri dev app without clashing with `mod native`. - Drop `--bun` from `bun vite build`. Bun's runtime auto-loads .env.development into process.env, which shadows Vite's --mode-based env resolution and caused the production build to ship `http://localhost:3000` as `VITE_API_URL`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WalkthroughThe pull request updates configuration and task automation across multiple files. The staging environment variable Pre-merge checks:
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
app/justfile (2)
22-23: Confirm--bunis intentional only fordev.
bun --bun vite devkeeps Bun as the runtime here, which means.env.developmentis auto-loaded intoprocess.env. That's fine for dev (mode isdevelopmentanyway), but worth noting the asymmetry withbuild— if dev ever needs--modeoverrides, the same shadowing bug will resurface. A short comment mirroring the one above would help future readers.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/justfile` around lines 22 - 23, Add a short comment above the dev target explaining that the dev task intentionally runs "bun --bun vite dev" to use Bun as the runtime so .env.development is auto-loaded into process.env, and note the asymmetry with the build target (which does not use --bun) and the potential for future "--mode" overrides to reintroduce env shadowing; reference the dev target and the "bun --bun vite dev" command so future readers understand this is deliberate and where to change it if they need consistent behavior with build.
11-14: Build fix looks correct; consider asserting it in CI.Dropping
--bunfrombun vite buildis the right fix — Bun's auto-loading of.env.developmentintoprocess.envwas shadowing Vite's--mode-based resolution and leakingVITE_API_URL=http://localhost:3000into prod bundles. To prevent regressions, consider a tiny post-build grep in the deploy recipe (e.g., fail iflocalhost:3000appears indist/) so a future re-introduction of--bunhere is caught immediately.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/justfile` around lines 11 - 14, Add a CI-safe assertion to catch reintroduction of Bun's env leakage by extending the build/deploy flow: in the existing just recipe named build env="development" (or in the deploy recipe that runs after it) add a post-build check that searches the generated dist/ files for the string "localhost:3000" and fails the recipe (exit non-zero) if found; implement this as a simple grep/ack command with a clear error message so future changes that re-add `--bun` or otherwise leak development URLs will break CI immediately.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/justfile`:
- Around line 22-23: Add a short comment above the dev target explaining that
the dev task intentionally runs "bun --bun vite dev" to use Bun as the runtime
so .env.development is auto-loaded into process.env, and note the asymmetry with
the build target (which does not use --bun) and the potential for future
"--mode" overrides to reintroduce env shadowing; reference the dev target and
the "bun --bun vite dev" command so future readers understand this is deliberate
and where to change it if they need consistent behavior with build.
- Around line 11-14: Add a CI-safe assertion to catch reintroduction of Bun's
env leakage by extending the build/deploy flow: in the existing just recipe
named build env="development" (or in the deploy recipe that runs after it) add a
post-build check that searches the generated dist/ files for the string
"localhost:3000" and fails the recipe (exit non-zero) if found; implement this
as a simple grep/ack command with a clear error message so future changes that
re-add `--bun` or otherwise leak development URLs will break CI immediately.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: defc2bec-64a2-4af9-8f44-d88a6ffd90c5
📒 Files selected for processing (4)
api/wrangler.jsoncapp/justfilejustfilenative/justfile
Bun's auto-dotenv only loads .env.development when NODE_ENV is unset or "development". Setting NODE_ENV=production before `bun --bun vite build` points the auto-loader at the nonexistent .env.production, leaving process.env clean so Vite's --mode resolution wins. This matches what Vite does internally for any `vite build` invocation anyway. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Rechecked the original goal on current main. The existing The old dev-runtime comment is superseded because the current dev recipe remains unchanged. I am declining a blanket post-build ban on The PR is now a draft awaiting the maintainer's close-or-retain decision. No source changes were pushed. (Written by GPT-6.1 Sol with xhigh) |
|
Closing as superseded, following the maintainer's delegated choice to use the recommended course. Current main already resolves the module/default conflicts and its live build embeds (Written by GPT-6.1 Sol with xhigh) |
Problem
This PR predates the current justfile layout. Current
mainalready resolves the module/default-recipe conflicts, and its live app build selects the correct API environment.Approach
No additional runtime or environment change is recommended. The remote source remains at 4331055. A local conflict-resolution checkpoint was preserved without pushing it.
Impact
No new source changes were pushed. No public API or wire change.
Alternatives
Keep the current
bun vite build --mode liverecipe. Forcing Vite to run under Bun reproduces the environment leak, but current main does not force that runtime. Adding--bunand then compensating withNODE_ENV=productionadds behavior without a current requirement.Validation
At unchanged 171ed63:
bun vite build --mode liveembedshttps://api.hang.liveand nohttp://localhost:3000, with the Nix shell's Bun 1.3.1 and with the migration's Bun 1.4.2.NODE_ENV=developmentstill embeds the correct live API.bun --bun vite build --mode livereproduces the localhost API leak.just --dry-run devandjust --dry-run nativeresolve the existing module/default recipes. Neither service was started.quest gate just buildpasses.quest gate just checkpasses API/app TypeScript, Biome, and both metadata tests, then fails at native formatting because this host has no real Cargo behind its wrapper. The unchanged-base and local merged-head runs both reportmbx[error]: could not find the real Cargo after excluding /home/kixelated/.local/share/mbx/bin/cargo. moq-dev/hang.live#32 already adds the explicit Rust toolchain.Review
No new source head was pushed or submitted for local review. The original PR head is not ready to land; the current implementation need is superseded.
Waiting
(Written by GPT-6.1 Sol with xhigh)