feat(fullstack init --next): default frontend branch to 'next' on nuxt-base-starter#84
Merged
pascal-klesse merged 2 commits intomainfrom May 3, 2026
Merged
Conversation
…t-base-starter The `next` branch on lenneTech/nuxt-base-starter ships an auth basePath aligned with nest-base (`/api/auth`) instead of nest-server-starter's `/iam`. With `--next`, that's now the implicit default; explicit `--frontend-branch` still wins. Refs: nest-base LLM-test 2026-05-03 friction #5 (auth path blocker). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… with sibling test file
ts-jest treats every test file as part of one TypeScript program, so
two files with top-level `const fs = require('fs')` collide. The
neighbouring `fullstack-init-next-rename.test.ts` already owns the
unprefixed `fs` / `path` names; this commit moves this file's requires
inside the describe block (matching how that file already scopes
`gluegun` / `filesystem` / `patching`).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
lt fullstack init --nextnow cloneslenneTech/nuxt-base-starter#nextby default for the frontend, so the cloned app's Better-AuthbasePath(/api/auth) lines up with the--next(nest-base) backend out of the box.--frontend-branch <ref>(andlt.config'sfrontendBranch) still win — so consumers can still target a custom branch on either the legacy ornext-derived line.--next, behaviour is unchanged:frontendBranchfalls back tocliFrontendBranch || configFrontendBranchand isundefinedif neither is provided.Why
During the nest-base LLM-test on 2026-05-03 (friction log entry #5, blocker), a freshly initialised
lt fullstack init --nextworkspace failed the Better-Auth handshake with a 404 because the frontend kept hitting/iam(themain-branch default ofnuxt-base-starter) while the experimental--nextAPI only serves/api/auth. The user had to discover--frontend-branch nextthemselves to unblock the flow.This wires the default so the two halves of
--nextagree without extra flags.Behaviour
The CLI usage hint emitted by
nonInteractiveHint(...)now mentions the implicit default so scripted callers (Claude Code, CI) discover it without reading source.Implementation
Single-line change in
src/commands/fullstack/init.ts, in the existingfrontendBranchderivation:The value flows unchanged into
frontendHelper.setupNuxt({ branch: frontendBranch, ... })(verified by test 3 below).Test plan
--next(no--frontend-branch): derivation resolves to'next'. The regex test asserts that the derivation references bothcliFrontendBranchandexperimental ? 'next', in that order, so the explicit flag still wins.--next --frontend-branch <ref>: the explicit value wins (covered by ordering assertion:cliFrontendBranchis checked before theexperimentalternary).--next: legacy fallback chain preserved (cliFrontendBranch || configFrontendBranch), sofrontendBranchisundefinedwhen neither is provided.frontendHelper.setupNuxtstill receivesbranch: frontendBranchunchanged.--nextis documented in thenonInteractiveHintso non-interactive callers see the implicit default.npm run test): 161 passed, 1 skipped.bash scripts/check-cli-start.sh): menu appears.Tests follow the source-introspection pattern already established by
__tests__/fullstack-init-next-rename.test.ts— running the full gluegun command in-process would require mocking the entire frontend helper, git, and prompts surface, which adds maintenance cost without buying meaningful coverage for a one-liner derivation. The added tests pin the derivation contract (CLI > config > experimental default > undefined) and the forwarding contract (branch: frontendBranchreachessetupNuxt).Refs: nest-base LLM-test 2026-05-03 friction #5 (auth path blocker).
Generated with the help of Claude Code.