Repository navigation
refactor(scripts): use Bun.YAML.parse in generate-provider-docs - #1241
Merged
Merged
Conversation
Replace the 150-line hand-rolled block-YAML reader (indentOf, stripInlineComment, parseScalar, tokenize, parseMap, parseSeq, parseNode, subtreeLines, findKeyIndex) with Bun.YAML.parse of components.schemas.Provider. Same error messages, same enum fallback to Object.keys(configs). Drops the runs-under-node promise, the pathToFileURL entrypoint fallback, and the unreachable x-provider-configs error branch, and documents the Bun requirement in the header.
Contributor
|
🗑️ Preview environment destroyed. |
inference-gateway-maintainer
Bot
marked this pull request as ready for review
November 16, 2026 15:30
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
November 16, 2026 15:30
8 tasks
inference-gateway-releaser Bot
added a commit
that referenced
this pull request
Nov 17, 2026
## [0.9.27](0.9.26...0.9.27) (2026-11-17) ### ♻️ Improvements * **scripts:** use Bun.YAML.parse in generate-provider-docs ([#1241](#1241)) ([bdfad7c](bdfad7c)) * **vitepress:** derive Mermaid lazy-chunk regexes from one constant ([#1243](#1243)) ([65de689](65de689)) ### 🐛 Bug Fixes * **ci:** reuse generate:check in the drift job and cover sdks.md ([#1245](#1245)) ([b34ee2d](b34ee2d)) ### 👷 CI * align Dependabot schedule and grouping ([#1231](#1231)) ([40f417f](40f417f)) * set up orchestrators from repos.yaml ([#1246](#1246)) ([6e03863](6e03863)) ### 📚 Documentation * **api:** document messages api and nullable stop_reason ([#1268](#1268)) ([02e10df](02e10df)) * **api:** document nullable and optional stream chunk fields ([#1267](#1267)) ([a0923a4](a0923a4)) * **cli:** cover plan-mode web tools and the WebFetch scratchpad redirect ([#1248](#1248)) ([cdfa57e](cdfa57e)) * **cli:** surface the skills, plugins and hooks runnable examples ([#1258](#1258)) ([78c2686](78c2686)) * document bash path-check text exemptions ([#1234](#1234)) ([395c17c](395c17c)) * document kernel-confined bash writes in CLI sandbox ([#1235](#1235)) ([2a78ac0](2a78ac0)) * document the Video, PreserveSpeech and StartOffsetSeconds inputs on the Go SDK CreateVideo ([#1223](#1223)) ([264018f](264018f)) * dubbing a video with mirelo through the videos api ([#1214](#1214)) ([cf0141c](cf0141c)) * dubvideo tool and the video_to_sfx dub switch ([#1222](#1222)) ([ac93910](ac93910)) * elevenlabs video scoring on the sfx endpoint ([#1215](#1215)) ([8469b96](8469b96)) * go sdk CreateSFX and CreateMusic are shipped ([#1225](#1225)) ([48d348f](48d348f)) * image edits through elevenlabs and avatars with one key ([#1211](#1211)) ([df745fc](df745fc)) * link the CLI media-audio and media-video examples ([#1228](#1228)) ([aee7e9e](aee7e9e)) * link the subagents and ag-ui runnable examples ([#1256](#1256)) ([534af1c](534af1c)) * **observability:** add gateway tracing walkthrough with Jaeger ([#1250](#1250)) ([54951f7](54951f7)) * **operator:** document Gateway server and MCP request timeouts ([#1254](#1254)) ([aff281e](aff281e)) * **operator:** mirelo provider block for spec.audio ([#1209](#1209)) ([c3f03b8](c3f03b8)) * **operator:** wire GPU runtime as openai provider, drop custom ([#1253](#1253)) ([7334cdf](7334cdf)) * repoint example links to domain-first layout ([#1217](#1217)) ([d596bb5](d596bb5)) * resending a prompt and conversation rewind frames ([#1203](#1203)) ([63a42b2](63a42b2)) * scoring a video on the sound-effects endpoint ([#1210](#1210)) ([1d03ef9](1d03ef9)) * **sdks:** bump TypeScript SDK to 0.30.0 and note pin upgrade ([#1265](#1265)) ([bd42f1a](bd42f1a)) * **sdks:** document Go SDK audio modes, keys and examples ([#1266](#1266)) ([98601de](98601de)) * **sdks:** read python stream chunks as plain json ([#1264](#1264)) ([93276e5](93276e5)) * speech through the gateway and spec.audio ([#1201](#1201)) ([979ae1e](979ae1e)) * videotosfx tool and the sfx scoring budget ([#1221](#1221)) ([4e08dc8](4e08dc8)) * wav output for elevenlabs speech ([#1208](#1208)) ([d36e358](d36e358)) ### 🔧 Miscellaneous * **deps-dev:** bump prettier from 3.9.10 to 3.10.1 in the bun group ([#1226](#1226)) ([d82d26e](d82d26e)) * **deps:** bump bun to 1.4.4 ([#1242](#1242)) ([f5cf0fc](f5cf0fc)) * **deps:** bump flox dependencies to latest ([#1229](#1229)) ([c0b5858](c0b5858)) * **deps:** bump flox dependencies to latest ([#1230](#1230)) ([1cf291c](1cf291c)) * **deps:** resolve wrangler via devDependencies instead of pinned bunx literals ([#1244](#1244)) ([35c4c29](35c4c29))
Contributor
|
🎉 This PR is included in version 0.9.27 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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 #1238
Summary
Replace the hand-rolled block-YAML reader in
scripts/generate-provider-docs.mjswith a singleBun.YAML.parse(schemaText)call that readscomponents.schemas.Providerstraight out of the parsed document. The script already runs only under Bun (shebang, Taskfile, CI), so the "runs under both bun and node (>=18)" promise, thepathToFileURLentrypoint fallback for older node, and ~150 lines of tokenizer/parser code go away.extractProviderModelkeeps its signature andbuildProvidersis untouched; observed behavior is preserved (same error message for a missing/empty Provider schema, sameenumIdsfallback toObject.keys(configs)).Note:
Bun.YAML.parsewas verified empirically here on the installed Bun 1.3.13 (one minor below the 1.3.14 pinned in.bun-version, and the API has shipped since 1.2.x). The sandbox cannot download the pinned 1.3.14 build to run it directly; the repo's CI runs bun 1.3.14 per.bun-versionand will exercise it.no docs ticket: internal-only refactor
Changes
extractProviderModelnow parses the schema withBun.YAML.parseand readscomponents.schemas.Providervia optional chaining; it still returns{ enumIds, configs }with the enum falling back toObject.keys(configs)when absent.indentOf,stripInlineComment,parseScalar,tokenize,parseMap,parseSeq,parseNode,subtreeLines,findKeyIndexand the "Minimal block-YAML reader" banner (~150 lines). The unreachable "x-provider-configs extension" branch merged into the existing locator error, which both failing cases already threw.if (import.meta.main)andpathToFileURLimport removed.x-provider-configs, and enum fallback fromx-provider-configskeys (also covers flow mappings/sequences the old reader rejected).Verification
bun test- 15 tests pass (all 7 renderers still byte-match the committed docs from the fixture).bun run format:check,bun run lint:md,bun run buildpass.inference-gateway/schemasmainopenapi.yamlwith no diff in the five generated pages (see run log).