Skip to content

feat(code-input): export SUPPORTED_LANGUAGES and LANGUAGE_ALIASES#1600

Draft
GabeStah wants to merge 1 commit into
mainfrom
export-code-input-supported-languages
Draft

feat(code-input): export SUPPORTED_LANGUAGES and LANGUAGE_ALIASES#1600
GabeStah wants to merge 1 commit into
mainfrom
export-code-input-supported-languages

Conversation

@GabeStah

@GabeStah GabeStah commented Jul 15, 2026

Copy link
Copy Markdown

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 code field 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-input now re-exports SUPPORTED_LANGUAGES and LANGUAGE_ALIASES from 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.ts is 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.

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
GabeStah requested a review from a team as a code owner July 15, 2026 21:27
@GabeStah
GabeStah requested review from Copilot and stipsan and removed request for a team July 15, 2026 21:27
@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f3d1ea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sanity/code-input Minor

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

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview, Comment Jul 15, 2026 9:27pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two new public exports to @sanity/code-inputSUPPORTED_LANGUAGES and LANGUAGE_ALIASES—so downstream tooling can import the canonical language/alias tables rather than vendoring and syncing copies.

Changes:

  • Re-export SUPPORTED_LANGUAGES and LANGUAGE_ALIASES from the package root entrypoint.
  • Update the vitest-package-exports snapshot 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
GabeStah marked this pull request as draft July 15, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants