feat: add build-local script, bump @tinacms/cli to 2.3.1#332
Open
kulesy wants to merge 1 commit into
Open
Conversation
Adds a build-local script that produces a deployable build without needing real Tina Cloud credentials: "build-local": "tinacms build --content=local --skip-cloud-checks -c \"next build\"" --content=local (introduced in @tinacms/cli@2.3.0 via tinacms/tinacms#6636) indexes content from the filesystem during the build while generating a production-shaped client that points at TinaCloud at runtime — so the artifact is deployable as-is. Useful for: - CI smoke tests on fork PRs (no secrets needed) - Faster local production builds - Verifying the build pipeline without provisioning a cloud project The existing postbuild hook (pagefind + next-sitemap) runs automatically after build-local too, so the produced artifact is search-ready. The existing build-local-pagefind script is preserved untouched (it does not actually use local mode despite the name — separate cleanup). Bumps @tinacms/cli from ^2.2.3 to ^2.3.1 and tinacms from ^3.7.3 to ^3.8.1 to pick up the flag. Verified locally with dummy NEXT_PUBLIC_TINA_CLIENT_ID / TINA_TOKEN / NEXT_PUBLIC_TINA_BRANCH env vars: 42/42 pages prerender clean, zero Tina Cloud network calls. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Adds a
build-localscript and bumps the Tina deps so it works:Why
The other Tina starters ship a
build-localscript that lets contributors and CI build the project without provisioning a real TinaCloud project.tina-docshas abuild-local-pagefindscript, but despite the name it doesn't actually use local mode — it'stinacms build && next build && npx pagefind ..., which still calls TinaCloud the same way asbuild. So there's no real fork-safe/no-secrets build path today.The
--content=localflag (added in@tinacms/cli@2.3.0via tinacms/tinacms#6636) is the right tool: it indexes content from the filesystem during the build so no GraphQL network calls happen, but generates a production-shaped client that points at TinaCloud at runtime — so the build artifact is deployable as-is.This makes the template:
NEXT_PUBLIC_TINA_CLIENT_ID/TINA_TOKENenv varsThe existing
postbuildhook (pagefind + next-sitemap) still runs automatically afterbuild-local, so the produced artifact is search-ready.A note on
build-local-pagefindThat script is preserved untouched in this PR (it does the same thing as
build+postbuildminus the explicit echo lines, but with pagefind output written to a different path). It's misnamed and largely redundant with thepostbuildstep. Cleaning it up is worth a separate small PR — I didn't want to expand the scope here.Verification
Result: ✓ 42/42 pages prerendered clean (including all
/docs/api-documentation/*SSG routes), zero Tina Cloud network calls.Test plan
pnpm installresolves to@tinacms/cli@2.3.1andtinacms@3.8.1pnpm run buildstill works with real Tina Cloud creds (unchanged script)pnpm run build-localworks with dummy/no credspnpm run devstill works (unchanged script)🤖 Generated with Claude Code