Skip to content

feat(fullstack init --next): auto-run bun run rename after nest-base clone#83

Merged
pascal-klesse merged 1 commit intomainfrom
feat/next-auto-rename
Apr 30, 2026
Merged

feat(fullstack init --next): auto-run bun run rename after nest-base clone#83
pascal-klesse merged 1 commit intomainfrom
feat/next-auto-rename

Conversation

@pascal-klesse
Copy link
Copy Markdown
Member

Summary

  • lt fullstack init --next now runs bun run rename <projectDir> inside projects/api/ automatically after the nest-base clone, removing a manual follow-up step that agents and humans repeatedly skipped.
  • Failure is non-fatal: the workspace is still usable and the warning surfaces the exact retry command.
  • The pre-existing experimental setupServerForFullstack patches package.json to name = projectDir, which would make the rename planner treat projectDir as the old slug and silently skip the README/portless/compose rewrites. To work around that without changing server.ts, init.ts resets the name back to "nest-base" immediately before invoking the rename, so the planner sees the canonical starting state across all four files.

Why

The nest-base template ships hard-coded nest-base references in four files (package.json, README.md, portless.yml, docker-compose.yml). The repo's bun run rename patches all four idempotently, but until now consumers had to remember to invoke it themselves. Friction-log driven tests kept surfacing the gap.

The script depends only on node:fs, node:path, and project-local TS files, so Bun runs it cleanly before bun install has to happen — verified against scripts/rename-project.ts and src/core/setup/project-rename-runner.ts in the nest-server-reload sources.

Test plan

  • Added __tests__/fullstack-init-next-rename.test.ts covering: rename invocation is wired in, the experimental flag gates it, the Next-section no longer prompts the user to rename manually, and the package.json reset preserves description/version while flipping name.
  • npm run lint clean
  • npm test — 157 passed, 1 skipped (the previously-flaky config-json-validity.test.ts TS2451 conflict actually clears on this branch because the new test scopes its gluegun import inside the describe)
  • Pre-push hook (lint + jest) passes

Out of scope

  • A smoke-test workflow for the full lt fullstack init --next flow belongs in a separate PR.

🤖 Generated with Claude Code

…e clone

The experimental nest-base template hard-codes `nest-base` in four files
(package.json, README.md, portless.yml, docker-compose.yml). The repo
ships `bun run rename <name>` to patch them all idempotently, but until
now consumers had to remember to invoke it themselves. Friction-log
runs kept surfacing the gap: agents skip the manual step, half the
workspace still says "nest-base".

The CLI already knows the desired name from --name, so it now runs
the rename automatically after the API clone. Failure is non-fatal —
the workspace is still usable and the warning prints the exact command
to retry.

Restore the package.json `name` to "nest-base" first: setupServer-
ForFullstack pre-patches it to projectDir, which would make the rename
planner treat projectDir as the old slug and skip the README/portless/
compose rewrites. Resetting before the run gives the planner a coherent
canonical starting state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pascal-klesse pascal-klesse merged commit a5335d9 into main Apr 30, 2026
1 check passed
@pascal-klesse pascal-klesse deleted the feat/next-auto-rename branch April 30, 2026 12:25
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.

1 participant