feat: turn on the Type Builder in prismic init - #389
Merged
Merged
Conversation
`prismic init` no longer stops on a Legacy Builder repository. It turns on the Type Builder and saves the project's framework, so the editor shows code snippets for that framework. Only repository administrators can turn on the Type Builder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H4jg7fmGVLhLJjo27eC7Mj
1 of 3 tasks
angeloashmore
marked this pull request as ready for review
October 1, 2026 01:01
tomaboro
approved these changes
Oct 1, 2026
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.
Related: DT-3535
Description
Before this PR,
prismic initstopped on a Legacy Builder repository and told the user to contact support.After this PR,
prismic initturns on the Type Builder through prismicio/obelix#2010. It also saves the project's framework, so the editor shows code snippets for that framework. Users who are not administrators get this error:Upgrading legacy slices is in #388.
Checklist
Preview
How to QA 1
Deploy prismicio/obelix#2010 first. Until then, the
inittest "turns on the Type Builder when it is not enabled" fails with a 404.As an administrator, run
npx prismic init --repo <legacy-builder-repo>in a Next.js project. The repository then uses the Type Builder.🤖 Generated with Claude Code
https://claude.ai/code/session_01H4jg7fmGVLhLJjo27eC7Mj
Note
Medium Risk
Init now mutates remote repository settings (Type Builder + framework) via API, with permission-dependent failure modes; behavior change for legacy repos that previously hard-failed.
Overview
prismic initnow enables the Type Builder and aligns repository framework instead of failing with a “contact support” error when a connected repo still uses the Legacy Builder.After the local framework adapter is resolved, init calls a new repository API (
PATCH …/type-builderwith the adapter’s framework id) when Type Builder is off or the remoteframeworkdoes not match the project. Success logs that Type Builder was turned on;ForbiddenRequestErroryields admin-focused errors (legacy builder) or a warning (framework only). TheTypeBuilderRequiredErrortype and its CLI/Sentry handling are removed; repository responses may include an optionalframeworkfield.Reviewed by Cursor Bugbot for commit a8c52fe. Bugbot is set up for automated code reviews on this repo. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩