feat(code-input): export SUPPORTED_LANGUAGES and LANGUAGE_ALIASES#1600
Draft
GabeStah wants to merge 1 commit into
Draft
feat(code-input): export SUPPORTED_LANGUAGES and LANGUAGE_ALIASES#1600GabeStah wants to merge 1 commit into
GabeStah wants to merge 1 commit into
Conversation
Downstream tooling that resolves external language tokens (markdown fence infostrings, paste/import pipelines) onto code field values has had to vendor this list and hand-sync it with the Language selector. Exporting the canonical table (and the alias map) removes the drift.
GabeStah
requested review from
Copilot and
stipsan
and removed request for
a team
July 15, 2026 21:27
🦋 Changeset detectedLatest commit: 8f3d1ea The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds two new public exports to @sanity/code-input—SUPPORTED_LANGUAGES and LANGUAGE_ALIASES—so downstream tooling can import the canonical language/alias tables rather than vendoring and syncing copies.
Changes:
- Re-export
SUPPORTED_LANGUAGESandLANGUAGE_ALIASESfrom the package root entrypoint. - Update the
vitest-package-exportssnapshot to lock in the new public surface. - Add a minor changeset documenting the new additive API.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugins/@sanity/code-input/src/index.ts | Re-exports language constants from the package entrypoint. |
| plugins/@sanity/code-input/src/index.test.ts | Updates exports-manifest snapshot to include the new exports. |
| .changeset/heavy-lions-export.md | Adds a minor changeset describing the new exports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1
to
5
| import {type CodeDefinition, codeSchema, codeTypeName} from './schema' | ||
| export {LANGUAGE_ALIASES, SUPPORTED_LANGUAGES} from './config' | ||
| export {type CodeInput, type CodeInputProps} from './CodeInput' | ||
| export {PreviewCode, type PreviewCodeProps} from './PreviewCode' | ||
| export type {CodeInputLanguage, CodeInputValue, CodeOptions, CodeSchemaType} from './types' |
GabeStah
marked this pull request as draft
July 15, 2026 22:03
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.
Exports the canonical language table (and the alias map) from the package root, with a changeset (minor).
Why
Downstream tooling that maps external language tokens onto
codefield values — markdown fence infostrings, paste/import pipelines — has had to vendor this list and hand-sync it with the Language selector. The concrete consumer today: the docs Studio in sanity-io/www-sanity-io vendors the full table to power its```lang→ code-block input rule (soon via@sanity/block-insert-picker, #1601), and pins it with a drift test that this export turns from "hope it stays in sync" into a direct import.CodeInputLanguage(the entry type) was already exported; this just exposes the values.Verification
Export-manifest snapshot updated (
vitest-package-exports); build, lint, and format pass.🤖 Generated with Claude Code
Note
Low Risk
Additive public API only; no changes to editor behavior or existing exports beyond two new constants.
Overview
@sanity/code-inputnow re-exportsSUPPORTED_LANGUAGESandLANGUAGE_ALIASESfrom the package entry so consumers can use the same canonical language list and alias map as the Studio Language selector (e.g. markdown fence infostrings, import pipelines) instead of maintaining a duplicated copy.The package exports snapshot in
index.test.tsis updated to lock in the new public surface, and a minor changeset records the release.Reviewed by Cursor Bugbot for commit 8f3d1ea. Bugbot is set up for automated code reviews on this repo. Configure here.