chore(i18n-doc): export InternationalizedArrayItem#581
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 6072c7e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5e7f41b to
6072c7e
Compare
There was a problem hiding this comment.
Pull request overview
Exports a shared InternationalizedArrayItem type from sanity-plugin-internationalized-array and updates @sanity/document-internationalization to consume it, reducing duplicated/parallel type definitions across plugins.
Changes:
- Introduce and export
InternationalizedArrayItem(and a runtime_typeguard) insanity-plugin-internationalized-array. - Replace internal usage of the old
Valuetype withInternationalizedArrayItemacross utils, components, field actions, schema validation, and test helpers. - Update
@sanity/document-internationalization’sTranslationReferenceto extend the sharedInternationalizedArrayItem<Reference>type.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/sanity-plugin-internationalized-array/src/utils/createAddLanguagePatches.ts | Switches patch generation to use InternationalizedArrayItem and validates derived _type via a new guard. |
| plugins/sanity-plugin-internationalized-array/src/utils/createAddAllTitle.ts | Updates function signature to accept InternationalizedArrayItem[]. |
| plugins/sanity-plugin-internationalized-array/src/utils/checkAllLanguagesArePresent.ts | Updates value typing to InternationalizedArrayItem[]. |
| plugins/sanity-plugin-internationalized-array/src/types.ts | Adds InternationalizedArrayItem + isInternationalizedArrayItemType, deprecates Value. |
| plugins/sanity-plugin-internationalized-array/src/test/helpers.ts | Updates test factories to return InternationalizedArrayItem. |
| plugins/sanity-plugin-internationalized-array/src/schema/array.ts | Updates validation generics and duplicate tracking types to InternationalizedArrayItem[]. |
| plugins/sanity-plugin-internationalized-array/src/index.test.ts | Updates exports snapshot to include the new runtime guard export. |
| plugins/sanity-plugin-internationalized-array/src/fieldActions/index.ts | Updates useFormValue assertions to InternationalizedArrayItem[]. |
| plugins/sanity-plugin-internationalized-array/src/components/InternationalizedArray.tsx | Refactors prop/value typing to align with InternationalizedArrayItem. |
| plugins/sanity-plugin-internationalized-array/src/components/AddButtons.tsx | Updates prop typing to InternationalizedArrayItem[]. |
| plugins/@sanity/document-internationalization/src/types.ts | Replaces KeyedObject usage with the shared InternationalizedArrayItem<Reference> type. |
| .changeset/internationalized-array-export-array-item.md | Declares a patch release for exporting InternationalizedArrayItem. |
| .changeset/document-i18n-consume-array-item-type.md | Declares a patch release for consuming InternationalizedArrayItem in document i18n. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Reducing footprint of #567
Export InternationalizedArrayItem from sanity-plugin-internationalized-array and update @sanity/document-internationalization to consume the shared type.
What to review
Testing