Skip to content

PR: ApiLink migration from igniteui-xplat-docs + residual fix tooling#181

Open
viktorkombov wants to merge 3 commits into
masterfrom
vkombov/api-link-residual-fixes
Open

PR: ApiLink migration from igniteui-xplat-docs + residual fix tooling#181
viktorkombov wants to merge 3 commits into
masterfrom
vkombov/api-link-residual-fixes

Conversation

@viktorkombov
Copy link
Copy Markdown
Contributor

@viktorkombov viktorkombov commented May 20, 2026

⚠️ Depends on the astro-components PR (adds excludeSuffixFor / excludePrefixFor to ApiLink.astro) being merged first.

What this PR does

The main deliverable is converting ~4,100 bare backtick type references across 489 xplat MDX files into <ApiLink> components using the igniteui-xplat-docs apiMap — the same source the original xplat-docs gulpfile used. This was driven by a new migration script (docs/xplat/scripts/resolve-api-links.mjs) that reads each file's mentionedTypes: frontmatter and replaces every matching `TypeName` / `memberName` with an <ApiLink> tag. 171 files have mentionedTypes and were processed.

On top of the migration, this PR:

  • Fixes 440+ broken React API links caused by wrong kind, missing prefixed={false}, and type names that don't exist in React TypeDoc
  • Adds new validation tooling that lets you find and bulk-fix broken links without rebuilding

Content changes

xplat (docs/xplat/src/content/) — 489 MDX files

Migration from igniteui-xplat-docs:

  • ~4,100 backtick type/member references converted to <ApiLink pkg="..." type="..." member="..." /> across charts, geo-map, excel library, gauges, sparkline, data grid, tree, list
  • Conversion used igniteui-xplat-docs apiMap/*.json to determine package, kind, and correct member names
  • mentionedTypes: frontmatter drives which types each file can reference

React residual fixes (440+ links):

  • pkg= aliases corrected: inputs/layouts/grids remapped to the actual published React packages
  • Enum types marked with prefixed={false} (React enums have no Igr prefix)
  • Generic arity stripped from type names (`IgxList<T>`IgxList)
  • Types absent from React TypeDoc wrapped with exclude="React" or demoted to plain backticks
  • Types that are class in apiMap but interface in React TypeDoc — added per-platform kind="interface" split

Platform-specific fixes:

  • exclude="Angular" / exclude="Angular,WebComponents" on types absent from those platforms (spreadsheet, excel members, some grid types)
  • JP pages: exclude="Angular" added where missing on GroupingExpression / GroupByRowSelectorTemplateDetails
  • xplat grids: list.mdx, tree.mdx — added exclude="WebComponents" on WC-absent types

angular (docs/angular/src/content/) — 190 MDX files (EN + JP)

  • ~600 new <ApiLink> tags added (charts, geo-map, spreadsheet, gauges, excel, radial/linear gauge) matching the igniteui-xplat-docs originals
  • JP pages synced from xplat via sync-generated.mjs; angular-specific JP hand-written pages (groupby, grids) fixed separately
  • exclude="Angular" / exclude="Angular,Blazor,WebComponents" added on types that don't exist in the Angular TypeDoc

New content pages

Added as part of the branch (separate commits):

  • AI toolchain pages: ai/ai-assisted-development-overview, ai/cli-mcp, ai/maker-framework, ai/theming-mcp, ai/skills — EN + JP
  • JP changelogs: Angular/React/WC/Blazor GA + SR sections
  • layouts/splitter — new WC/React topic + JP
  • general/general-step-by-step-guide-using-cli
  • general/general-how-to-mcp-e2e
  • jp/layouts/navigation-drawer, jp/layouts/navbar, jp/layouts/toolbar, and other JP pages backfilled

New scripts

docs/xplat/scripts/resolve-api-links.mjsmain migration driver

Converts inline `TypeName` / `memberName` backtick references in xplat MDX to <ApiLink> using igniteui-xplat-docs apiMap/*.json. Requires ../igniteui-xplat-docs to be checked out as a sibling repo.

cd docs/xplat
node scripts/resolve-api-links.mjs           # process all en/jp/kr files
node scripts/resolve-api-links.mjs --dry-run # preview only
node scripts/resolve-api-links.mjs --file src/content/en/components/charts/chart-api.mdx

docs/xplat/scripts/fix-api-link-attrs.mjs

Post-pass over already-emitted <ApiLink> tags to fix attributes: adds prefixed={false} for enums, strips generic arity from type names, reclassifies kind="class"kind="interface" for types that are actually interfaces.

scripts/check-mdx-links.mjsprimary validation tool

Validates all <ApiLink> tags in MDX source by resolving their staging URLs using the same logic as ApiLink.astro, then HTTP-checking each URL. No build required.

  • Angular: syncs generated content first (sync-generated.mjs), then checks docs/angular/src/content/
  • All other platforms: checks docs/xplat/src/content/
  • For each broken URL probes 3 variants (no-suffix, no-prefix, no-both) and outputs the exact prop fix
  • Writes mdx-link-report-{platform}.md consumed by apply-mdx-report-fixes.mjs
npm run check-mdx-links:report          # all platforms → mdx-link-report-*.md
npm run check-mdx-links:report:angular  # Angular only  → mdx-link-report-angular.md
npm run check-mdx-links:report:react
npm run check-mdx-links:report:wc
npm run check-mdx-links:report:blazor

scripts/apply-mdx-report-fixes.mjs

Reads mdx-link-report-*.md and bulk-applies exclude, excludeSuffixFor, and excludePrefixFor to the matching <ApiLink> tags in MDX source. Merges fixes across platforms (e.g. Angular + WC both needing excludeSuffixForexcludeSuffixFor="Angular,WebComponents"). Angular fix paths are remapped to xplat source automatically.

node --experimental-strip-types scripts/apply-mdx-report-fixes.mjs
node --experimental-strip-types scripts/apply-mdx-report-fixes.mjs --dry-run

scripts/apply-excludes.mjs

Reads mdx-link-report-*.md and applies only exclude="Platform" fixes (symbol absent from API entirely). For suffix/prefix fixes use apply-mdx-report-fixes.mjs instead.

scripts/apply-react-platform-fixes.mjs

Report-driven fixer for React-specific issues: either emits a 2-platform split (kind="interface" for React, original for other platforms) or wraps the tag in <PlatformBlock for="Angular,Blazor,WebComponents"> for types missing from React TypeDoc entirely.

scripts/check-api-links.mjs (enhanced)

The existing dist/HTML crawler now probes URL variants for each broken link. For class-segment URLs with known suffixes (Component, Module, Directive, etc.) it tries no-suffix, interfaces+no-suffix, and interfaces and reports which resolves — with a concrete In ApiLink: set kind="interface" / suffix={false} hint in console, MD, and JSON output.

npm run check-api-links:report:angular   # requires angular:build-staging first
npm run check-api-links:report:blazor    # requires blazor build

New ApiLink props (ApiLink.astro — astro-components PR)

Prop Effect
excludeSuffixFor="Angular,WebComponents" URL built without classSuffix for listed platforms — link stays active
excludePrefixFor="Angular" URL built without platform prefix (Igx/Igr/…) for listed platforms — link stays active

When to use each:

Situation Fix
Type absent from platform entirely exclude="Platform"
Type present but wrong suffix excludeSuffixFor="Platform"
Type present but wrong prefix excludePrefixFor="Platform"
All platforms affected suffix={false} / prefixed={false}

Validation results

Platform Source OK Broken
Angular docs/angular/src/content/ (after sync) 2060 0
React docs/xplat/src/content/ 1681 0
Web Components docs/xplat/src/content/ (run check-mdx-links:report:wc)
Blazor docs/xplat/src/content/ 1627 125

Blazor 125 broken: types absent from Blazor staging API (need exclude="Blazor"). Run apply-excludes.mjs after reviewing mdx-link-report-blazor.md.


src/lib/platform-context.ts updates

Package aliases added/corrected for React (inputs-react, layouts-react, grids-react packages) and any new packages from the xplat migration.


Skills updated

  • .github/skills/xplat-docs-api-links/SKILL.md — added excludeSuffixFor/excludePrefixFor prop rows + decision guide
  • .github/skills/xplat-docs-api-map-sync/SKILL.md — new skill documenting how to sync docConfig.json from igniteui-xplat-docs and run the resolvers
  • .github/skills/xplat-docs-platform-block/SKILL.md — updated with PlatformBlock nesting rules for the new MDX patterns

Fixes applied across MDX, platform-context, and migration script:
- React inputs/layouts/data-grids aliased to actual published packages
- Migration script emits prefixed={false} for enums; strips generic arity
- Post-pass script reclassifies class -> interface for mis-tagged types
- Spreadsheet ApiLinks no longer get incorrect prefixed={false}
- Genuinely missing types demoted to plain backticks
Result: 0 broken / 1681 OK React links.
Base automatically changed from aahmedov/Xplat-docs-updates-migration to master May 21, 2026 07:55
@viktorkombov viktorkombov changed the title fix(api-links): resolve 440+ broken React API links PR: ApiLink migration from igniteui-xplat-docs + residual fix tooling May 21, 2026
@viktorkombov viktorkombov added the ❌ status: awaiting-test PRs awaiting manual verification label May 21, 2026
- Replaced instances of `IgrDockManager`, `IgrContentPane`, `IgrSplitPane`, `IgrTabGroupPane`, and `IgrDocumentHost` with <ApiLink> components in dock manager documentation.
- Updated toolbar documentation to reflect changes in component names and added <ApiLink> for `IgrToolbar`.
- Modified calendar documentation to use <ApiLink> for `IgrDateRangeDescriptor` and related properties.
- Changed references from `IgrSpreadsheetAction` to `SpreadsheetAction` in clipboard and commands documentation.
- Updated spreadsheet configuration documentation to use <ApiLink> for `SpreadsheetSelection` and `SpreadsheetCellRange`.
- Adjusted update guide to replace `IgrInput` and `IgrButton` with <ApiLink> components for clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant