feat(dev): one-click dev auto-login + quieter npm run dev#3009
Open
cqnykamp wants to merge 6 commits into
Open
feat(dev): one-click dev auto-login + quieter npm run dev#3009cqnykamp wants to merge 6 commits into
cqnykamp wants to merge 6 commits into
Conversation
Adds a dev-only sign-in shortcut so `npm run dev` no longer requires hunting the mock magic-link out of the API console. - apps/app: opening `/?autologin=true` on the local dev server signs in as a fixed dev user (dev@doenet.org), then strips the param so a refresh doesn't re-fire it and logout stays sticky. Gated on `import.meta.env.MODE === "development"` (not `DEV`, which is false here because the dev script forces NODE_ENV=production), so it is stripped from every real build. - scripts/dev-ready-banner.js: prints the worktree-correct auto-login URL once the API port is listening. - api: harden the test-auth bypass guard behind it. New isTestAuthBypassEnabled() fails closed (requires flag === "true") and is never enabled when NODE_ENV === "production", with unit tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three sources of noise in the concurrently-driven dev stack: - Cryptic [0]/[1] index prefixes -> label processes with short colored names (shared/api/app/web) via concurrently -n/-c. - Per-workspace `> pkg@ver dev` / command echoes -> npm --silent on each workspace dev command (and the shared prebuild). - The `[vite] page reload .../shared/dist/*.js` flood and info lines -> Vite logLevel "warn", scoped to `command === "serve"` so `vite build` and CI output are unchanged. Our banner already prints the app URL. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
getTextEncoder() fell back to `await import("util")` when TextEncoder was
undefined — only reachable on Node < 11. TextEncoder is a global in all
browsers and in Node >= 11, and this repo requires Node 24, so the branch
was dead code. It also put a Node builtin in the browser module graph,
producing a spurious "util has been externalized" Vite dev warning.
Use the global TextEncoder directly. Behavior is unchanged; the dev
warning is removed at its source (no @vite-ignore suppression needed).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Quieting Vite removed the app's own "Local:" line, so the app URL only appeared in the banner while api/web each printed their own URL in their own format. List all three (app/api/web) in the banner instead, aligned and with the app marked as the clickable auto-login link, so there is one consistent place to read them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What this does
Makes local development smoother in two ways:
npm run devprints a link you can click to sign straight into the app as a dev user — no more copying the mock magic-link out of the console. Logging out and refreshing keeps you logged out, as expected.npm run dev. Trimmed the startup/reload noise so the terminal is much easier to scan.Both are local-dev conveniences only — there's no change to how the app behaves in production.
🤖 Generated with Claude Code