Skip to content

fix(catalog): extract catalog from bundles with $-prefixed vars - #22

Merged
BrainerVirus merged 1 commit into
mainfrom
fix/catalog-extract-dollar-bindings
Sep 2, 2026
Merged

fix(catalog): extract catalog from bundles with $-prefixed vars#22
BrainerVirus merged 1 commit into
mainfrom
fix/catalog-extract-dollar-bindings

Conversation

@BrainerVirus

Copy link
Copy Markdown
Owner

Problem

command-code@1.40.1 changed its minified bundle shape: provider/spec constants are now declared as $R="vercel-ai-gateway"-style $-prefixed variables. extractStringBindings used \b word-boundary regexes, and \b never fires before $ (not a word char) — the alias was parsed as R (or dropped), so evaluating the model catalog threw $R is not definedCould not evaluate model catalog.

Every Catalog sync run since 1.40.1 shipped failed at this step (runs #24/#23/#22), which also spammed "the repository has disabled issues" while the catalog-break issue path fell over.

Changes

  • src/catalog.ts: extractStringBindings regexes use explicit lookbehind/lookahead boundaries so $R="..." binds correctly (66→67 models; adds claude-fable-5-1).
  • src/catalog-break.ts: normalize v-prefixed version in break-issue titles.
  • scripts/analyze-release-scope.ts: treat chore(scope) commits that touch product files as patch releases (keeps chore(catalog) sync commits shipping; scope-less chore stays inert).
  • Regression unit tests for all three.

Verified: full real-bundle extraction succeeds (67 entries), bun run check green (154 tests).

Issues are now enabled on the repo, so the automation's catalog-break issue flow works going forward.

command-code 1.40.1 minifies provider constants as $R="vercel-ai-gateway"; the \b boundary in extractStringBindings never fires before "$", so the provider alias was captured as "R" (or skipped) and evaluating the model catalog threw $R is not defined. Use lookbehind/lookahead boundaries that honor "$" names.

Also normalize catalog-break titles when npm metadata returns a "v"-prefixed version, and treat chore(scope) commits that touch product files as patch releases so models.json syncs keep publishing.
@BrainerVirus
BrainerVirus merged commit d4df15f into main Sep 2, 2026
5 checks passed
@BrainerVirus
BrainerVirus deleted the fix/catalog-extract-dollar-bindings branch September 2, 2026 12:40
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.7.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant