fix(cli): adapt to shadcn template drift breaking TanStack Start and Next.js scaffolds - #34
Open
envindavsorg wants to merge 1 commit into
Open
Conversation
…folds
TanStack Start scaffolds aborted with "Could not mount ExternalLinkGuard
in the TanStack Start root route." The upstream template now ships a
notFoundComponent with its own <main> before RootDocument, and the
scroll-container battery's "upgrade an existing <main>" regex matched
the first <main> in the file — tagging the 404 page's element instead of
wrapping {children}, which left nothing for the external-link-guard
battery to mount into. The upgrade path now only targets a <main> that
directly wraps the route content ({children}, <App />, <Outlet />,
<slot />) across all five templates.
Next.js scaffolds aborted with ENOENT on next.config.mjs. The template
now generates a typed next.config.ts and a plain "next dev" script
without --turbopack. The adapter now resolves next.config.{ts,mjs,js},
patches the typed config shape, and appends -p 1420 to any "next dev"
script that doesn't already pin a port.
Verified with the simple test matrix: all five templates scaffold and
build cleanly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@envindavsorg is attempting to deploy a commit to the agmmnn's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
when will merge it, i cant create project with nextjs template |
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.
Problem
bun create tauri-uicurrently fails for two of the five templates because the upstream shadcn templates changed shape:TanStack Start — scaffolding always aborts with:
The generated
src/routes/__root.tsxnow ships anotFoundComponentcontaining its own<main className="container mx-auto p-4 pt-16">, declared beforeRootDocument. The scroll-container battery's "upgrade an existing<main>" regex matched the first<main>in the file, so it tagged the 404 page's element withdata-ui-scroll-containerinstead of wrapping{children}. The external-link-guard battery then couldn't find<main…>{children}</main>and threw, aborting the whole scaffold.Next.js — scaffolding aborts with
ENOENT: no such file or directory, open '…/next.config.mjs'. The template now generates a typednext.config.ts(const nextConfig: NextConfig = {}) and a plain"dev": "next dev"script without--turbopack, so the static-export patch crashed and the-p 1420port rewrite silently no-opped.Fix
batteries/scroll-container.ts: the upgrade path now only targets a<main>that directly wraps the route content ({children},<App />,<Outlet />,<slot />) via a lookahead anchor passed per template, leaving unrelated<main>elements (like the Start 404 page) untouched. Also hardened the idempotency check so a previously upgraded<main>carrying extra attributes is still detected.adapters/next.ts: resolvesnext.config.ts/.mjs/.js(first match), patches both the typed and untyped empty-config shapes, and appends-p 1420to anynext devscript that doesn't already pin a port.Verification
--template startbefore the fix.--template start --no-starter --size-optimize --workflow) scaffolds successfully and the generated app passesbun install && bun run build.node scripts/test-create-tauri-ui-simple.mjs) passes for all five templates:oxlint/oxfmt --check/tsc --noEmitclean (the single pre-existinglibRootwarning on master is untouched).create-tauri-ui).