Add package manager support to init scaffolding#226
Add package manager support to init scaffolding#226xstelea wants to merge 1 commit intomattpocock:mainfrom
Conversation
Allow users to select npm, pnpm, yarn, or bun during `sandcastle init` via a new `--package-manager` flag or interactive prompt. Dockerfiles are patched with corepack/bun install lines, and all generated .ts/.md files have npm references rewritten to the chosen package manager. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| const lines = getNextStepsLines("simple-loop"); | ||
| const joined = lines.join("\n"); | ||
| expect(joined).toContain("npm install"); | ||
| expect(joined).toContain("onSandboxReady"); |
There was a problem hiding this comment.
Accidental removal, will restore it.
|
This is a good idea in theory. I'm just not sure whether I want it for right now. Since there will be probably a lot of churn in the repo, I'm wondering whether I want this relatively inessential feature now or whether I want to keep this PR for reference and implement it later. Was this something that felt like a friction point in the setup for you? |
Makes sense. Feel free to close the PR My reason for this change was to enable feedback loops through pre-commit hooks. There is probably an alternative way to solve this by directly editing the main.ts file. |
|
Hey @mattpocock!, wanted to share something we hit today that's directly related to this PR. We're following the same plan → implement + review → merge orchestration you use in this repo, adapted for our pnpm monorepo. Since the default Dockerfile only has npm, our agents ran into trouble. During one run, the Implementer agent couldn't find pnpm, tried a few things, and landed on The Reviewer crash caused Hard to diagnose because the exit 128 doesn't hint at ownership, the root cause happened in a different agent phase, and 14/15 parallel issues succeeded so the run looked healthy. Fix was simple — added this before RUN corepack enable && corepack prepare pnpm@9.15.4 --activateI think the Dockerfile generation part of this PR would prevent this class of failure out of the box. Even if the full init rewrite isn't a priority, having the right corepack/bun lines in the generated Dockerfile addresses a correctness issue, not just convenience. |
Allow users to select npm, pnpm, yarn, or bun during
sandcastle initvia a new--package-managerflag or interactive prompt. Dockerfiles are patched with corepack/bun install lines, and all generated .ts/.md files have npm references rewritten to the chosen package manager.