Repository navigation
fix(mcp): serve only the newest API snapshot per package (#1862) - #1874
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change to serve only the newest API snapshot per package.
No open issues 🎉
What changed in this PR
This PR addresses #1862 by making the MCP server serve only the newest API snapshot per package, preventing older Angular definitions and React placeholder entries from appearing as current APIs.
Changes:
- Adds numeric version-folder ordering and newest-snapshot selection, with regression tests.
- Updates all four framework exporters to select the newest snapshot and remove older exported versions.
- Deletes stale bundled API snapshots.
Paths below are relative to packages/igniteui-mcp/igniteui-doc-mcp/.
| File | Description |
|---|---|
src/lib/api-doc-loader.ts |
Orders version folders and loads only the newest snapshot per package. |
src/__tests__/lib/api-doc-loader.test.ts |
Tests version ordering and exclusion of older snapshot entries. |
scripts/lib/api-export.ts |
Adds shared snapshot selection and pruning helpers. |
scripts/export-wc-api.ts |
Exports only the newest Web Components snapshot per package. |
scripts/export-react-api.ts |
Exports only the newest React snapshot per package. |
scripts/export-blazor-api.ts |
Exports only the newest Blazor snapshot per package. |
scripts/export-angular-api.ts |
Exports only the newest Angular snapshot while preserving deduplication. |
docs/react-api/igniteui-react/18.0.0/llms-full.txt |
Removes an outdated React placeholder snapshot. |
docs/react-api/igniteui-react/17.5.0/llms-full.txt |
Removes an outdated React placeholder snapshot. |
docs/angular-api/igniteui-angular/9.0.x/llms-full.txt |
Removes the legacy Angular snapshot that overwrote current definitions. |
Review effort: Balanced
kdinev
previously approved these changes
Nov 5, 2026
kdinev
approved these changes
Nov 5, 2026
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.
Description
get_api_referenceandsearch_apianswered Angular lookups from the igniteui-angular 9.0.x API snapshot for many current components (IgxTabsComponent,IgxGridComponent,IgxComboComponent, …), and served React placeholder entries fromigniteui-react17.5.0 / 18.0.0 (IgrPieChart,IgrDataGrid,createGrid, …).Cause:
ApiDocLoader.parseLlmsFullTxtloaded every{version}folder of a package into one map keyed by name, so the last folder read won.readdirSyncreturns15.1.x, 21.0.x, 22.0.0, 9.0.x(string order), so 9.0.x overwrote 22.0.0. Names that only exist in old snapshots (e.g.IgxTabsGroupComponent) were served as current.The old snapshots were removed once before (51a419e, May 20) but came back with #1750, because the export scripts copy every version folder from the api-docs build.
Changes:
src/lib/api-doc-loader.ts): loads only the newest snapshot per package. NewcompareVersionNamesorders folders by version (9.0.x < 15.1.x < 21.0.x < 22.0.0 < latest;xcounts as 0).scripts/export-{angular,react,wc,blazor}-api.ts): export only the newest version per package and remove older exported version folders, so a re-export no longer brings stale snapshots back. Shared helper inscripts/lib/api-export.tsreusescompareVersionNames.docs/angular-api/igniteui-angular/9.0.x,15.1.x,21.0.xdocs/react-api/igniteui-react/17.5.0,18.0.0No tool takes a version parameter, so nothing depended on the older snapshots.
Related Issue
Closes #1862
Type of Change
Affected Packages
igniteui-cli(packages/cli)@igniteui/cli-core(packages/core)@igniteui/angular-templates(packages/igx-templates)@igniteui/angular-schematics(packages/ng-schematics)@igniteui/mcp-server(packages/igniteui-mcp)Checklist
vitest run: 19 files, 440 tests passed; full rootnpm run testnot run)npm run build) — onlytsc --noEmitfor the MCP package and the changed scriptsnpm run lint) — ESLint on the changed files:api-doc-loader.tsclean; the other changed files are excluded by the repo's ESLint ignore patternsAdditional Context
Loader run against the real
docs/*-apidata after the change:New tests in
src/__tests__/lib/api-doc-loader.test.ts:9.0.x < 15.1.x < 21.0.x < 22.0.0 < latest)The export scripts were not run end to end (they need the
blazor/api-docsAstro build, anddotnetfor Blazor).newestVersionDir/pruneOtherVersionswere checked on a temporary directory.Follow-up (not in this PR): the React
pie-chartdoc links toIgrPieChart, which now returns "not found" instead of the placeholder. The real class appears to come from a React charts package that isn't in the bundled API data.🤖 Generated with Claude Code