Skip to content

Revert "Make languageNamed accept display names and extensions again" (#2883)#2911

Merged
schani merged 1 commit into
masterfrom
revert/language-named-fuzzy-matching
Jul 10, 2026
Merged

Revert "Make languageNamed accept display names and extensions again" (#2883)#2911
schani merged 1 commit into
masterfrom
revert/language-named-fuzzy-matching

Conversation

@schani

@schani schani commented Jul 10, 2026

Copy link
Copy Markdown
Member

Reverts #2883 (merge commit 9013ecd) at the maintainer's request: reintroducing fuzzy language-name matching (display names like "C++"/"JSON Schema" and file extensions like "kt" in languageNamed(), with undefined instead of throwing on unknown names) was a mistake.

After this revert, languageNamed()/isLanguageName() are back to the strict v23.1.0+ behavior: they match only the lowercase entries of each language's names array, and languageNamed() throws on unknown names.

This also removes test/unit/language-named.test.ts, which tested the fuzzy behavior.

Note for app.quicktype.io: #2883 was originally motivated by the web app passing localStorage-stored display names to languageNamed(), which made returning users hit a blank page. With this revert that strict behavior returns, so the app should normalize/migrate stored language names on its side.

PR #2907, which documented the fuzzy isLanguageName() semantics, has been closed for the same reason.

Verification

  • Clean revert of the merge commit (git revert -m 1), no conflicts.
  • npm run build clean; npm run test:unit passes 50/50.

🤖 Generated with Claude Code

…splay-names"

This reverts commit 9013ecd, reversing
changes made to 8969b56.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@schani
schani merged commit 01e36d7 into master Jul 10, 2026
23 checks passed
@schani
schani deleted the revert/language-named-fuzzy-matching branch July 10, 2026 21:59
schani added a commit that referenced this pull request Jul 10, 2026
Conflicts and resolutions:

- packages/quicktype-core/src/RendererOptions/types.ts: master (#2910)
  removed the type-only "command-line-args" import that leaked into
  published declarations; this branch had added a ".js" extension to
  the neighboring relative import. Took master's removal plus the
  extension on the surviving import.

- test/unit/core-package.test.ts: both sides appended tests to the same
  describe block — this branch's five dual CJS/ESM packaging tests,
  master's declaration-file dependency hygiene tests (#2910). Kept
  both; the declaration scan now also covers the new dist/esm tree.

- package-lock.json auto-merged to exactly master's content (this
  branch adds no dependencies); re-ran npm install to confirm it
  regenerates unchanged.

The #2911 revert of fuzzy language-name matching and the #2909 switch
to upstream typescript-json-schema merged cleanly (the import-extension
codemod never touched quicktype-typescript-input).

Verified from clean dist: root npm run build emits both legs including
dist/esm's {"type": "module"} marker; all 59 unit tests pass; the
packed tarball still works from scratch consumers (CJS require →
dist/index.js and ESM import → dist/esm/index.js, both generating
code) and typechecks under moduleResolution nodenext in both module
modes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant