fix(setup): bootstrap automated setup on a clean clone + fix doc/script drift#11
Merged
Merged
Conversation
…/script drift Addresses an external setup-instruction evaluation. The marquee "automated setup" crashed on a fresh clone (chalk/inquirer are devDependencies imported at the top of setup.ts before any install), and several docs/script values had drifted apart. Blockers - Add scripts/setup-bootstrap.mjs: a zero-dependency Node entry point that gates Node >=20.9, enables pnpm via corepack if missing, runs pnpm install when node_modules is absent, then hands off to setup.ts. package.json setup/setup:check now run the bootstrap, so setup works on a clean clone. - Document `corepack enable` in Prerequisites, Quick Setup, and Manual Setup (pnpm was listed as a prereq with no install path). Correctness - Make `pnpm update` opt-in via --update (was run by default and mutated the committed lockfile, defeating reproducibility). - Treat MP type-generation failure as a warning (not fatal) when committed models/ already exist, so an unreachable tenant doesn't fail setup. - Tighten template-clone detection: parse the owner/repo slug and match exactly, and add the real MPNext-Widgets repo to the patterns (previously matched only by substring accident). Doc/script consistency - Unify Node version to v20.9 across README and setup.ts messages. - Rewrite README Quick Setup step list to match the script's actual 9 steps. - Rename "Quick Setup with Claude Code" -> "Quick Setup (Automated)". - Align suggested client-ID defaults to MPNextWidgets (was TM.Widgets/MPNext). - Mark OIDC_CLIENT_ID/SECRET optional in setup.ts (auth.ts falls back to the MP API credentials). - Use base64url for generated auth secrets to match the documented format. - Document VITE_ORG_NAME and add a `pnpm approve-builds` troubleshooting note. - Clarify that committed MP models decouple the build from a live tenant. Minor - /api/embed/session now returns 400 on empty/malformed JSON bodies instead of 500. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced May 31, 2026
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
Addresses an external evaluation of the project's setup instructions. The headline problem: the advertised "automated setup" crashed on a fresh clone, because
scripts/setup.tsimportschalkand@inquirer/prompts(devDependencies) at the top level before anything is installed. Several documented values had also drifted from what the script actually does.Blockers
scripts/setup-bootstrap.mjs, a zero-dependency Node entry point that gates Node ≥20.9, enables pnpm viacorepackif missing, runspnpm installwhennode_modulesis absent, then hands off tosetup.ts.package.jsonsetup/setup:checknow invoke the bootstrap.corepack enableadded to Prerequisites, Quick Setup, and Manual Setup (pnpm was a listed prereq with no install path).Correctness
pnpm updateis now opt-in via--update(it ran by default and mutated the committed lockfile, defeating reproducibility).models/already exist — an unreachable tenant no longer fails setup on a project that builds fine.owner/reposlug and matches exactly, with the real repo added to the patterns (it previously matched only by substring accident).Doc/script consistency
setup.ts.MPNextWidgets(wasTM.Widgets/MPNext).OIDC_CLIENT_ID/SECRETmarked optional insetup.ts(src/lib/auth.ts:45-46falls back to the MP API credentials).base64urlto match the documented format.VITE_ORG_NAME; added apnpm approve-buildstroubleshooting note; clarified that committed MP models decouple the build from a live tenant.Minor
/api/embed/sessionreturns 400 on empty/malformed JSON bodies instead of 500.Testing
pnpm setup:checkruns end-to-end through the new bootstrap.tsc --noEmitpasses clean; ESLint clean on the changed route.🤖 Generated with Claude Code