Skip to content

fix(setup): bootstrap automated setup on a clean clone + fix doc/script drift#11

Merged
chriskehayias merged 1 commit into
mainfrom
fix/setup-bootstrap-and-docs
May 31, 2026
Merged

fix(setup): bootstrap automated setup on a clean clone + fix doc/script drift#11
chriskehayias merged 1 commit into
mainfrom
fix/setup-bootstrap-and-docs

Conversation

@chriskehayias
Copy link
Copy Markdown
Contributor

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.ts imports chalk and @inquirer/prompts (devDependencies) at the top level before anything is installed. Several documented values had also drifted from what the script actually does.

Blockers

  • Bootstrap on a clean clone — new 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 invoke the bootstrap.
  • Document pnpm bootstrapcorepack enable added to Prerequisites, Quick Setup, and Manual Setup (pnpm was a listed prereq with no install path).

Correctness

  • pnpm update is now opt-in via --update (it ran by default and mutated the committed lockfile, defeating reproducibility).
  • MP type-generation failure is a warning, not fatal, when committed models/ already exist — an unreachable tenant no longer fails setup on a project that builds fine.
  • Clone detection parses the owner/repo slug and matches exactly, with the real repo added to the patterns (it previously matched only by substring accident).

Doc/script consistency

  • Node version unified to v20.9 across README and setup.ts.
  • README Quick Setup step list rewritten to match the script's actual 9 steps.
  • "Quick Setup with Claude Code" → "Quick Setup (Automated)".
  • Suggested client-ID defaults aligned to MPNextWidgets (was TM.Widgets/MPNext).
  • OIDC_CLIENT_ID/SECRET marked optional in setup.ts (src/lib/auth.ts:45-46 falls back to the MP API credentials).
  • Generated auth secrets now use base64url to match the documented format.
  • Documented VITE_ORG_NAME; added a pnpm approve-builds troubleshooting note; clarified that committed MP models decouple the build from a live tenant.

Minor

  • /api/embed/session returns 400 on empty/malformed JSON bodies instead of 500.

Testing

  • pnpm setup:check runs end-to-end through the new bootstrap.
  • tsc --noEmit passes clean; ESLint clean on the changed route.

🤖 Generated with Claude Code

…/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>
@chriskehayias chriskehayias merged commit be52e90 into main May 31, 2026
1 check passed
@chriskehayias chriskehayias deleted the fix/setup-bootstrap-and-docs branch May 31, 2026 15:27
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants