Skip to content

feat(mcp): build docs from igniteui-documentation - #1827

Merged
kdinev merged 7 commits into
masterfrom
dkalinov/migrate-docs-submodules
Oct 1, 2026
Merged

kdinev merged 7 commits into
masterfrom
dkalinov/migrate-docs-submodules

Conversation

@dkalinovInfra

Copy link
Copy Markdown
Contributor

Description

The MCP server's doc pipeline now builds from IgniteUI/igniteui-documentation. It replaces the two archived repos the pipeline used before: igniteui-docfx (Angular) and igniteui-xplat-docs (React / Web Components / Blazor). Both were archived on 2026-06-08.

Why: the pipeline still built from the frozen submodules, so no doc change made since June reached the MCP database. For example, the CLI MCP topics will never pick up resolve_import until this lands.

What changed

  • Submodules: angular/igniteui-docfx and common/igniteui-xplat-docs are replaced by one submodule, common/igniteui-documentation. It follows master, the production branch, through switch-submodules.sh.
  • New exporter: scripts/export-docs.ts --framework <fw> replaces the four export-*-docs.ts scripts.
    • It runs the docs repo's own generate scripts. These use Node built-ins only and need no npm install.
    • For Angular it also runs the sync step that copies shared pages from xplat.
    • It reads the framework's toc.json and writes the same flat .md files and TOC sidecar as before.
  • MDX conversion: new module scripts/lib/mdx-convert.ts. It converts the .mdx content back into the shape the existing pipeline steps were built around:
    • {Component*} and docConfig.json placeholders are resolved. This is a port of the docs site's vitePluginPlatformTokens, because generate.mjs leaves them in the shared grid pages.
    • <Sample src> becomes the <code-view> tag the inject scripts already parse, so sample injection is unchanged. Angular keeps the {environment:<base>} route URLs; the other frameworks use github-src.
    • <ApiLink> / <ApiRef> become mcp:get_api_reference links directly. Types missing from the bundled API data become code text.
    • <DocsAside> and <FaqItem> become plain markdown labels. Images, badges, MDX imports and {/* */} comments are dropped. Code fences are never touched.
  • Doc names stay stable for get_doc, aliases and baselines:
    • Angular pages that moved folders (inputs/badge, inputs/button-group, layouts/avatar) keep their old names.
    • pivotgrid/ still produces pivotGrid-… names.
    • React, Web Components and Blazor get a theming-grid → grid-theming-grid alias.
  • Submodule cleanup: the Angular sync step overwrites tracked files and adds untracked files in the submodule. The exporter undoes both, so the submodule can still be pulled.
  • CI (build-framework-docs action): every framework checks out the new submodule. The .NET setup and the gulp build:xplat-* step are removed.
  • Cleanup:
    • removed walkTocYaml, js-yaml and @types/js-yaml, since toc.yml no longer exists
    • the TOC tests now use walkTocJson
  • vite added as a dev dependency. vitest 5 requires it as a peer, and without it the MCP test suite already failed from a clean install on master.
  • Docs: updated CLAUDE.md and DEVELOPMENT.md, added knowledgebase entry 36, and marked xplat-docs-architecture.md as historical.

Not in this PR: the regenerated DB and baselines. The converted text differs from the old docfx/gulp output in nearly every file: the diff against docs_baseline/ reports every doc as changed. So the first run of build-docs-db in full mode recompresses all ~1,300 docs (a paid OpenAI batch). That run opens its own PR with the DB, baselines and group summaries.

Related Issue

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring / code cleanup
  • Build / CI configuration 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

  • I have tested my changes locally (npm run test)
  • I have built the project successfully (npm run build)
  • I have run the linter (npm run lint)
  • I have added/updated tests as needed
  • My changes do not introduce new warnings or errors

What was actually run:

  • npm run build: passes.
  • MCP vitest suite (npx vitest run in packages/igniteui-mcp/igniteui-doc-mcp): 409/409 pass, including 12 new mdx-convert tests.
  • npm run jasmine: 602 specs, 11 failures. They are the existing ng-schematics "Update X.Y.Z" migration failures that also happen on master; none involve the changed code.
  • npm run test was not run as a whole: its lint step crashes locally with an ajv error that also happens on master.
  • Lint: ESLint on the changed src/tools/doc-tools.ts is clean. The new script and test files fall under the repo's ESLint ignore patterns, like the existing pipeline scripts.
  • Typecheck: export-docs.ts passes tsc --strict.

Additional Context

Local dry run of export → inject → rewrite, against igniteui-documentation@master (d9cac9d, 2026-09-25):

Framework Docs exported Baseline today Samples injected API links resolved
Angular 376 376 1035 (4 warnings, same 4 as today) 59%
React 294 287 774 (22 dropped) 55%
Web Components 300 299 812 (21 dropped) 85%
Blazor 281 270 763 (19 dropped) 98%
  • Every TOC entry was found. No {…} placeholders or MDX tags are left in the output.
  • Dropped samples: most are samples the docs reference that exist upstream but not in my local examples checkouts, which are from July. Examples are inputs/badge/*, layouts/avatar/* and inputs/chip/outlined. CI moves the examples submodules to their latest commit, so these should resolve there. A few, such as grids/*/row-drag-to-grid, are missing upstream too.
  • Unresolved API links are chart, map and spreadsheet types (CategoryChart, DataChart, GeographicMap, …). Their packages aren't in the bundled API data, so they become code text instead of links.

Follow-ups

  • Run build-docs-db in full mode on this branch and review the result before merging. Run validate:<fw> on a sample, because compression hasn't seen the new input shape (**Note:** labels, llms.description frontmatter, mcp: links).
  • Ask the docs team to keep generate.mjs, sync-generated.mjs and the token pass stable. Also report the Angular sync step overwriting layouts/avatar.mdx and the docs that reference missing samples.
  • Document resolve_import and the MCP registry listings in the docs repo's cli-mcp.mdx, so they reach the DB.
  • Two broken aliases that predate this PR are left alone. Angular range-slider points to a missing slider doc (the real one is slider-slider). Blazor has zoom-slider aliases for a doc it doesn't have.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 12:19
@coveralls

coveralls commented Oct 1, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 94.559%. remained the same — dkalinov/migrate-docs-submodules into master

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The exporter can discard existing submodule edits, and MDX normalization mutates fenced code content.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Migrates the MCP documentation pipeline to the unified igniteui-documentation source.

Changes:

  • Adds a shared MDX exporter and converter for all frameworks.
  • Updates submodules, CI, aliases, tests, and dependencies.
  • Removes legacy DocFX/xplat exporters and updates documentation.
File Description
.gitmodules Replaces archived documentation submodules.
.github/​actions/​build-framework-docs/​action.yml Updates CI checkout and build steps.
yarn.lock Locks Vite and transitive dependencies.
switch-submodules.sh Switches the new documentation submodule.
package.json Routes pipelines through the unified exporter.
scripts/​export-docs.ts Implements framework-neutral export.
scripts/​lib/​mdx-convert.ts Converts MDX components to pipeline Markdown.
scripts/​lib/​toc-index.ts Removes obsolete YAML TOC handling.
scripts/​export-angular-docs.ts Removes the legacy Angular exporter.
scripts/​export-react-docs.ts Removes the legacy React exporter.
scripts/​export-wc-docs.ts Removes the legacy Web Components exporter.
scripts/​export-blazor-docs.ts Removes the legacy Blazor exporter.
src/​tools/​doc-tools.ts Adds stable grid-theming aliases.
src/​__tests__/​scripts/​mdx-convert.test.ts Tests MDX conversion behavior.
src/​__tests__/​scripts/​toc-index.test.ts Updates tests for JSON TOCs.
src/​__tests__/​scripts/​toc-sidecar.test.ts Updates sidecar tests for JSON TOCs.
CLAUDE.md Documents the new architecture.
DEVELOPMENT.md Updates pipeline development guidance.
docs/​knowledgebase.md Records the source migration.
docs/​xplat-docs-architecture.md Marks the old architecture historical.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/igniteui-mcp/igniteui-doc-mcp/scripts/export-docs.ts
Comment thread packages/igniteui-mcp/igniteui-doc-mcp/scripts/lib/mdx-convert.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The converter currently breaks Angular API links using the unmapped dvApiBaseUrl placeholder.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (2)

Comment on lines +52 to +56
const LEGACY_ENV: Record<string, string> = {
infragisticsBaseUrl: "https://www.infragistics.com",
sassApiUrl: "https://www.infragistics.com/products/ignite-ui-angular/docs/sass/latest",
angularApiUrl: "https://www.infragistics.com/products/ignite-ui-angular/docs/typescript/latest",
AngularApiUrl: "https://www.infragistics.com/products/ignite-ui-angular/docs/typescript/latest",

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Angular cleanup can silently discard pre-existing tracked edits in the documentation submodule.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Add coverage for theming-grid aliases across supported frameworks

packages/​igniteui-mcp/​igniteui-doc-mcp/​src/​tools/​doc-tools.ts:130

The new theming-grid aliases are untested even though applyDocAlias has direct per-framework coverage in src/__tests__/tools/doc-tools.test.ts:187-252. Add assertions for React, Web Components, and Blazor so this compatibility mapping cannot silently regress.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The end-to-end full database recompression and quality validation identified as required before merging have not yet been completed.

Review effort: Balanced
Findings: 1 High severity

Open (1)

@kdinev
kdinev enabled auto-merge (squash) October 1, 2026 15:59
@kdinev
kdinev merged commit fb1edca into master Oct 1, 2026
4 checks passed
@kdinev
kdinev deleted the dkalinov/migrate-docs-submodules branch October 1, 2026 16:05
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.

4 participants