fix(init): respect --minimal flag for agent rule files (#26051)

## Summary
- Fixes `bun init --minimal` creating Cursor rules files and CLAUDE.md
when it shouldn't
- Adds regression test to verify `--minimal` only creates package.json
and tsconfig.json

## Test plan
- [x] Verify test fails with system bun (unfixed): `USE_SYSTEM_BUN=1 bun
test test/cli/init/init.test.ts -t "bun init --minimal"`
- [x] Verify test passes with debug build: `bun bd test
test/cli/init/init.test.ts -t "bun init --minimal"`
- [x] All existing init tests pass: `bun bd test
test/cli/init/init.test.ts`

Fixes #26050

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
robobun
2026-01-13 18:33:42 -08:00
committed by GitHub
parent fbd800551b
commit ab009fe00d
2 changed files with 33 additions and 1 deletions

View File

@@ -791,7 +791,9 @@ pub const InitCommand = struct {
switch (template) {
.blank, .typescript_library => {
Template.createAgentRule();
if (!minimal) {
Template.createAgentRule();
}
if (package_json_file != null and !did_load_package_json) {
Output.prettyln(" + <r><d>package.json<r>", .{});