feat: set a master locale when creating a repository#208
Merged
Conversation
Add a `--lang` option (default `en-us`) to `prismic init` and `prismic repo create` that sets the new repository's master locale. A freshly created repository has no locale, which blocks adding content and breaks the Migration API until a master locale is added manually. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tomaboro
approved these changes
Jul 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.
Resolves: #207
Description
prismic initandprismic repo createcreate a repository with no locale, so you can't add content until you manually runprismic locale add en-us --master(and the Migration API fails without one).This adds a
--langoption (defaulting toen-us) to both commands that sets the new repository's master locale on creation, making a freshly created repository usable out of the box.Checklist
Preview
How to QA 1
Run
prismic repo create(orprismic repo create --lang fr-fr) and confirm the new repository has a master locale set. The same applies toprismic initwhen it creates a repository.Note
Medium Risk
Touches repository provisioning and locale API calls; a failed upsert leaves a repo without a master locale, though errors are surfaced explicitly.
Overview
New repositories were created without a master locale, blocking content and Migration API use until someone ran
prismic locale addmanually.prismic repo createandprismic init(when it creates a repo) now accept--lang/-l, defaulten-us. SharedcreateRepocallsupsertLocalewithisMaster: trueright aftercreateRepository, with clear errors if locale setup fails.An integration test asserts
--lang fr-frsets the master locale on the new repo.Reviewed by Cursor Bugbot for commit f1ff2f1. 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. ↩