fix(mcp): publish API reference docs and load latest version#1701
Open
dkalinovInfra wants to merge 9 commits into
Open
fix(mcp): publish API reference docs and load latest version#1701dkalinovInfra wants to merge 9 commits into
dkalinovInfra wants to merge 9 commits into
Conversation
…erver, and templates
…se latest versions
…erver, templates, and schematics
…, templates, and schematics
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes API reference availability for the published @igniteui/mcp-server package by ensuring the generated llms-full.txt API snapshots are packaged correctly and that the runtime loader consistently prefers the newest version when multiple version directories exist. It also updates CI to build these API docs during release publishing.
Changes:
- Added shared version ranking/picking logic and updated
ApiDocLoaderto load only the latest version per package. - Updated API-doc export scripts to emit only the latest version per package and introduced a patch step to pin overrides in the
api-docssubmodule before installing/building. - Updated release workflow to build MCP API docs at publish time and improved checkout/setup actions.
Reviewed changes
Copilot reviewed 18 out of 30 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/igniteui-mcp/igniteui-doc-mcp/src/lib/version-picker.ts | Introduces shared version directory comparison and “latest” selection logic. |
| packages/igniteui-mcp/igniteui-doc-mcp/src/lib/api-doc-loader.ts | Loads only the latest version per package to prevent older snapshots overwriting newer data. |
| packages/igniteui-mcp/igniteui-doc-mcp/src/tests/lib/version-picker.test.ts | Adds tests for version ranking and latest selection behavior. |
| packages/igniteui-mcp/igniteui-doc-mcp/src/tests/lib/api-doc-loader.test.ts | Adds regression coverage for multi-version package directories. |
| packages/igniteui-mcp/igniteui-doc-mcp/scripts/patch-api-docs-overrides.ts | Patches api-docs submodule package.json overrides to work around upstream dependency breakage. |
| packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-angular-api.ts | Exports only the latest Angular API snapshot per package. |
| packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-react-api.ts | Exports only the latest React API snapshot per package. |
| packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-wc-api.ts | Exports only the latest Web Components API snapshot per package. |
| packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-blazor-api.ts | Exports only the latest Blazor API snapshot per package. |
| packages/igniteui-mcp/igniteui-doc-mcp/package.json | Ensures API snapshot files are published and wires doc-build + patching into build:docs:all. |
| packages/igniteui-mcp/.gitignore | Ignores generated API snapshot directories under igniteui-doc-mcp/docs/*-api. |
| .github/workflows/npm-publish.yml | Builds MCP API docs during releases; updates actions; configures auth for private submodules. |
| packages/igniteui-mcp/igniteui-doc-mcp/docs/webcomponents-api/igniteui-grid-lite/latest/llms-full.txt | Removes checked-in generated API snapshot (now built during release). |
| packages/igniteui-mcp/igniteui-doc-mcp/docs/webcomponents-api/igniteui-dockmanager/latest/llms-full.txt | Removes checked-in generated API snapshot (now built during release). |
| packages/igniteui-mcp/igniteui-doc-mcp/docs/react-api/igniteui-react-dockmanager/19.5.1/llms-full.txt | Removes checked-in generated API snapshot (now built during release). |
| packages/igniteui-mcp/igniteui-doc-mcp/docs/blazor-api/IgniteUI.Blazor.GridLite/25.1.x/llms-full.txt | Removes checked-in generated API snapshot (now built during release). |
| packages/igniteui-mcp/igniteui-doc-mcp/docs/blazor-api/IgniteUI.Blazor.Documents.Core/25.1.x/llms-full.txt | Removes checked-in generated API snapshot (now built during release). |
| packages/igniteui-mcp/igniteui-doc-mcp/docs/angular-api/igniteui-angular-layouts/latest/llms-full.txt | Removes checked-in generated API snapshot (now built during release). |
| packages/igniteui-mcp/igniteui-doc-mcp/docs/angular-api/igniteui-angular-gauges/latest/llms-full.txt | Removes checked-in generated API snapshot (now built during release). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Fixes two bugs preventing API reference data from working in the published
@igniteui/mcp-serverpackage, plus the CI changes needed to build those docs at release time.Bug 1 —
filesfield shipped the wrong glob. Thefilesarray inpackages/igniteui-mcp/igniteui-doc-mcp/package.jsonreferenceddocs/<framework>/api/...with.md/.jsonextensions, but the actual on-disk layout isdocs/<framework>-api/<pkg>/<ver>/llms-full.txt. The published tarball contained zero API entries, soget_api_reference/search_apireturned "API reference not available" for every platform. Updatedfilesto match the real paths and added the missingdocs/blazor-api/entry.Bug 2 —
ApiDocLoaderversion collision. Entries were keyed${platform}:${componentName}andreaddirSynclex-ordering meant older versions (9.0.x) silently overwrote newer ones (21.0.x) for any package with multiple version subdirs.IgxGridComponentwas returning the v9 entry, missing fields added later (e.g.groupingDone). Fix has two parts:scripts/export-{angular,react,wc,blazor}-api.tsnow copy only the highest-ranked version per package and delete any older versions from the on-disk output directory. The published tarball shrinks accordingly (Angular drops9.0.x~193 KB +15.1.x~500 KB).ApiDocLoader.parseLlmsFullTxtpicks the latest version when iterating, so older snapshots leaking onto disk locally cannot mask newer data.src/lib/version-picker.tsso they agree on what "latest" means. Ranking: literallatest> parsable<major>.<minor|x>.<patch|x>(numeric descending,xoutranks any concrete number) > lex fallback.CI changes (
.github/workflows/npm-publish.yml).actions/checkoutandactions/setup-nodeto@v4.Build MCP API docsstep that runsbuild:docs:allso the tarball contains freshllms-full.txtfiles at publish time.secrets.CLASSIC_PAT_GITHUBso the inlinegit submodule update --init blazor/api-docscan authenticate to the privateIgniteUI/api-docssubmodule.scripts/patch-api-docs-overrides.tsthat pins@astrojs/sitemap@^3.7.2andzod@^4.3.6in the submodule'spackage.jsonbefore itsnpm install— works around an upstream Astroz.function(...).optional is not a functionruntime error.Related Issue
Closes #
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
npm run test)npm run build)npm run lint)Additional Context
src/__tests__/lib/version-picker.test.ts(12 cases — semver ordering,latestprecedence,xin minor and patch slots, empty-input throw, input-not-mutated) and a regression test insrc/__tests__/lib/api-doc-loader.test.tsfor the multi-version scenario.npm pack --dry-runinpackages/igniteui-mcp/igniteui-doc-mcp/now listsdocs/*-api/**/llms-full.txtentries (was zero before thefilesfix).CLASSIC_PAT_GITHUBrepo secret withreposcope on theIgniteUIorg is required for the workflow to clone the privateIgniteUI/api-docssubmodule. Token expiration will cause future releases to fail until rotated — long term, consider migrating to a GitHub App so this isn't a recurring concern.