feat(agentic-localization): make localizedSchemaTypes array optional#37
Closed
mattymess wants to merge 1 commit into
Closed
feat(agentic-localization): make localizedSchemaTypes array optional#37mattymess wants to merge 1 commit into
mattymess wants to merge 1 commit into
Conversation
|
@mattymess is attempting to deploy a commit to the Sanity Sandbox Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Found a bug with this, so closing until I have a chance to come back to it. |
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
Make
localizedSchemaTypesoptional in thel10npackage'screateL10n()and stop registering@sanity/document-internationalizationwhen no doc-level types are configured.Why
@sanity/document-internationalizationthrows if itsschemaTypesarray is empty. BecausecreateL10n()always registered it, field-level-only Studios had to keep a placeholder doc-level type to avoid an error from being thrown.Changes
packages/l10n/src/plugin.ts—localizedSchemaTypes?: readonly string[](defaults to[]);documentInternationalization()is only registered when the array is non-empty..claude/skills/sanity-l10n/SKILL.md— note thatlocalizedSchemaTypesis optional and split Job 2 into doc-level vs. field-level guidance.Test plan
localizedSchemaTypesfrom thecreateL10ninitialization