Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3b32d84
Configure platform contexts for ApiLink index resolution
viktorkombov May 29, 2026
80b1b35
refactor(platform-context): simplify API docs version handling
viktorkombov Jun 2, 2026
ee9b8ae
Merge branch 'master' into vkombov/configure-apilink-index-resolution
ChronosSF Jun 2, 2026
1c68209
feat: resolve ApiLink from local registry
viktorkombov Jun 2, 2026
8665960
Merge branch 'vkombov/configure-apilink-index-resolution' of https://…
viktorkombov Jun 2, 2026
8b7eda3
fix(platform-context): remove redundant URL replacement in getPlatfor…
viktorkombov Jun 2, 2026
312a018
Remove Api Links props
viktorkombov Jun 2, 2026
b176046
Update React registry
viktorkombov Jun 3, 2026
72cb93f
Fixed additional API links
viktorkombov Jun 3, 2026
54fdc46
Update Angular registry
viktorkombov Jun 3, 2026
1411869
List missing members
viktorkombov Jun 3, 2026
9c01d66
Merge branch 'master' into vkombov/configure-apilink-index-resolution
viktorkombov Jun 4, 2026
bae7810
Merge branch 'master' into vkombov/configure-apilink-index-resolution
dobromirts Jun 4, 2026
718f1c1
Remove prefixed, suffix, and exclude props from ApiLink components
Zneeky Jun 4, 2026
d111e84
Update React registry
viktorkombov Jun 3, 2026
aee86c8
Fixed additional API links
viktorkombov Jun 3, 2026
913126a
Update Angular registry
viktorkombov Jun 3, 2026
16892ff
List missing members
viktorkombov Jun 3, 2026
55c0b5d
Remove Api Links props
viktorkombov Jun 2, 2026
b7bc82c
Merge remote-tracking branch 'origin/vkombov/remove-api-links-unused-…
Zneeky Jun 4, 2026
dad0542
Merge branch 'vkombov/remove-api-links-unused-props' into aahmedov/st…
Zneeky Jun 4, 2026
c13f388
Merge pull request #293 from IgniteUI/aahmedov/strip-apilink-prefixed…
viktorkombov Jun 4, 2026
9dd9014
Fix spacing issues in sync scripts
viktorkombov Jun 4, 2026
1f0dd1a
Fix a bug with ApiLink imports that accidentally landed inside platfo…
viktorkombov Jun 4, 2026
e72c43d
Change imports order
viktorkombov Jun 4, 2026
0213a76
Add .gitattributes to enforce LF line endings for MD and MDX files
dobromirts Jun 4, 2026
95d7803
Merge pull request #294 from IgniteUI/vkombov/remove-api-links-unused…
dobromirts Jun 4, 2026
20a4a1f
Improve markdown file normalization by using file descriptors for rea…
viktorkombov Jun 4, 2026
5a77198
Merge branch 'master' of https://github.com/IgniteUI/docs-template in…
viktorkombov Jun 4, 2026
1dd5591
Add angular auto generated changes
viktorkombov Jun 4, 2026
13a3b75
Fix typo in conditional formatting method references in data-analysis…
viktorkombov Jun 5, 2026
c1e6747
Refactor Angular sync process in check-mdx-links script to use npm sc…
viktorkombov Jun 5, 2026
a00669c
Enhance ApiLink resolution by returning member details and improving …
viktorkombov Jun 5, 2026
c117cf2
Remove unnecessary properties from ApiLink components
viktorkombov Jun 5, 2026
7ff7ca4
feat: add API link check reports for React and Web Components
viktorkombov Jun 5, 2026
03da3b4
Potential fix for pull request finding 'CodeQL / Incomplete string es…
viktorkombov Jun 5, 2026
112fe44
Merge branch 'master' into vkombov/configure-apilink-index-resolution
viktorkombov Jun 5, 2026
65adb92
chore(api-links): clean registry migration tooling
viktorkombov Jun 8, 2026
0668271
Use one source of truth for platform configurations
viktorkombov Jun 8, 2026
c045ad8
Merge branch 'vkombov/configure-apilink-index-resolution' of https://…
viktorkombov Jun 8, 2026
1f4a796
refactor(api-links): update ApiLink usage to remove deprecated ApiRef…
viktorkombov Jun 9, 2026
4875156
chore(*): updating to v20 for new api link resolution
ChronosSF Jun 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 120 additions & 40 deletions docs/xplat/src/lib/platform-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,29 @@ export interface ApiPackageConfig {
*/
noPackagePrefix?: boolean;
/**
* Optional suffix appended to the class name before lowercasing, e.g.
* Angular DV packages append "Component" so `CategoryChart` resolves to
* `igniteui_angular_charts.igxcategorychartcomponent.html`.
* Only applied when `prefixed={true}`.
* When true the class name casing is preserved as-is (no .toLowerCase()).
* New api-docs routes use PascalCase symbol names.
*/
preserveCase?: boolean;
/**
* Preferred class-name suffix used by ApiLink. The generated registry tries
* both the suffixed and unsuffixed names, so this does not mean every API
* symbol is expected to have the suffix.
*/
classSuffix?: string;
/**
* When true, member anchor names are PascalCase (first letter uppercased).
* Blazor API docs use PascalCase anchors.
*/
pascalCaseMembers?: boolean;
}

export interface PlatformContext {
name: PlatformName;
/** Optional compact ApiLink symbol index loaded by the docs host at build time. */
apiLinkIndex?: {
symbols?: Record<string, unknown>;
};
/** Lower-case slug used in URLs, e.g. "angular" */
lower: string;
/** Component class prefix, e.g. "Igx" / "Igr" / "Igc" / "Igb" */
Expand Down Expand Up @@ -67,23 +80,81 @@ export interface PlatformContext {
};
}

function getBuildMode(): string {
return process.env.DOCS_ENV ?? process.env.NODE_ENV ?? 'development';
}

function getApiDocsBaseUrl(): string {
const value = process.env.API_DOCS_BASE_URL
?? (getBuildMode() === 'staging'
? 'https://staging.infragistics.com/api'
: getBuildMode() === 'production'
? 'https://www.infragistics.com/api'
: 'https://staging.infragistics.com/api');
const trimmed = value.replace(/\/+$/, '');
return trimmed.endsWith('/api') ? trimmed : `${trimmed}/api`;
}

const API_DOCS_BASE_URL = getApiDocsBaseUrl();

function getApiLinkIndexName(): string {
return process.env.API_LINK_INDEX_VERSION
?? (getBuildMode() === 'production' ? 'prod-latest' : 'staging-latest');
}

function apiDocsPlatformPath(platform: PlatformName): string {
return platform === 'WebComponents' ? 'webcomponents' : platform.toLowerCase();
}

function apiDocRoot(platform: PlatformName, packageId: string): string {
return `${API_DOCS_BASE_URL}/${apiDocsPlatformPath(platform)}/${packageId}/latest`;
}

function apiPackage(platform: PlatformName, packageId: string, options: Partial<ApiPackageConfig> = {}): ApiPackageConfig {
return {
docRoot: apiDocRoot(platform, packageId),
packageId,
noPackagePrefix: true,
preserveCase: true,
...options,
};
}

function loadApiLinkIndex(platform: PlatformName): PlatformContext['apiLinkIndex'] {
try {
const file = path.resolve(
process.cwd(),
'src',
'data',
'api-link-index',
apiDocsPlatformPath(platform),
`${getApiLinkIndexName()}.json`
);
if (!fs.existsSync(file)) return undefined;
return JSON.parse(fs.readFileSync(file, 'utf-8'));
} catch {
return undefined;
}
}

const PLATFORMS: Record<PlatformName, PlatformContext> = {
Angular: {
name: 'Angular',
apiLinkIndex: loadApiLinkIndex('Angular'),
lower: 'angular',
prefix: 'Igx',
productName: 'Ignite UI for Angular',
productSpinal: 'ignite-ui-angular',
apiPackages: {
core: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/docs/typescript/latest', packageId: 'igniteui-angular', noPackagePrefix: true },
charts: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/api/docs/typescript/latest', packageId: 'igniteui_angular_charts', classSuffix: 'Component' },
grids: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/docs/typescript/latest', packageId: 'igniteui-angular-grids', noPackagePrefix: true },
gauges: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/api/docs/typescript/latest', packageId: 'igniteui_angular_gauges', classSuffix: 'Component' },
maps: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/api/docs/typescript/latest', packageId: 'igniteui_angular_maps', classSuffix: 'Component' },
excel: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/api/docs/typescript/latest', packageId: 'igniteui_angular_excel', classSuffix: 'Component' },
spreadsheet: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/api/docs/typescript/latest', packageId: 'igniteui_angular_spreadsheet', classSuffix: 'Component' },
inputs: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/docs/typescript/latest', packageId: 'igniteui-angular', noPackagePrefix: true },
layouts: { docRoot: 'https://www.infragistics.com/products/ignite-ui-angular/docs/typescript/latest', packageId: 'igniteui-angular', noPackagePrefix: true },
core: apiPackage('Angular', 'igniteui-angular', { classSuffix: 'Component' }),
charts: apiPackage('Angular', 'igniteui-angular-charts', { classSuffix: 'Component' }),
grids: apiPackage('Angular', 'igniteui-angular', { classSuffix: 'Component' }),
gauges: apiPackage('Angular', 'igniteui-angular-gauges', { classSuffix: 'Component' }),
maps: apiPackage('Angular', 'igniteui-angular-maps', { classSuffix: 'Component' }),
excel: apiPackage('Angular', 'igniteui-angular-excel', { classSuffix: 'Component' }),
spreadsheet: apiPackage('Angular', 'igniteui-angular-spreadsheet', { classSuffix: 'Component' }),
inputs: apiPackage('Angular', 'igniteui-angular', { classSuffix: 'Component' }),
layouts: apiPackage('Angular', 'igniteui-angular', { classSuffix: 'Component' }),
},
packages: {
common: 'igniteui-angular',
Expand All @@ -100,21 +171,23 @@ const PLATFORMS: Record<PlatformName, PlatformContext> = {
},
React: {
name: 'React',
apiLinkIndex: loadApiLinkIndex('React'),
lower: 'react',
prefix: 'Igr',
productName: 'Ignite UI for React',
productSpinal: 'ignite-ui-react',
apiPackages: {
core: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/docs/typescript/latest', packageId: 'igniteui-react' },
charts: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/api/docs/typescript/latest', packageId: 'igniteui_react_charts' },
grids: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/docs/typescript/latest', packageId: 'igniteui-react-grids' },
gauges: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/api/docs/typescript/latest', packageId: 'igniteui_react_gauges' },
maps: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/api/docs/typescript/latest', packageId: 'igniteui_react_maps' },
inputs: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/api/docs/typescript/latest', packageId: 'igniteui_react_inputs' },
layouts: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/api/docs/typescript/latest', packageId: 'igniteui_react_layouts' },
excel: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/api/docs/typescript/latest', packageId: 'igniteui_react_excel' },
spreadsheet: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/api/docs/typescript/latest', packageId: 'igniteui_react_spreadsheet' },
datasources: { docRoot: 'https://www.infragistics.com/products/ignite-ui-react/api/docs/typescript/latest', packageId: 'igniteui_react_datasources' },
core: apiPackage('React', 'igniteui-react'),
charts: apiPackage('React', 'igniteui-react-charts'),
grids: apiPackage('React', 'igniteui-react-grids'),
gauges: apiPackage('React', 'igniteui-react-gauges'),
maps: apiPackage('React', 'igniteui-react-maps'),
inputs: apiPackage('React', 'igniteui-react-inputs'),
layouts: apiPackage('React', 'igniteui-react-layouts'),
excel: apiPackage('React', 'igniteui-react-excel'),
spreadsheet: apiPackage('React', 'igniteui-react-spreadsheet'),
datasources: apiPackage('React', 'igniteui-react-datasources'),
dockmanager: apiPackage('React', 'igniteui-react-dockmanager'),
},
packages: {
common: '@infragistics/igniteui-react',
Expand All @@ -131,21 +204,24 @@ const PLATFORMS: Record<PlatformName, PlatformContext> = {
},
WebComponents: {
name: 'WebComponents',
apiLinkIndex: loadApiLinkIndex('WebComponents'),
lower: 'webcomponents',
prefix: 'Igc',
productName: 'Ignite UI for Web Components',
productSpinal: 'ignite-ui-web-components',
apiPackages: {
core: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/docs/typescript/latest', packageId: 'igniteui-webcomponents' },
charts: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_charts' },
grids: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_data_grids' },
gauges: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_gauges' },
maps: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_maps' },
inputs: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_inputs' },
layouts: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_layouts' },
excel: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_excel' },
spreadsheet: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_spreadsheet' },
datasources: { docRoot: 'https://www.infragistics.com/products/ignite-ui-web-components/api/docs/typescript/latest', packageId: 'igniteui_webcomponents_datasources' },
core: apiPackage('WebComponents', 'igniteui-webcomponents', { classSuffix: 'Component' }),
charts: apiPackage('WebComponents', 'igniteui-webcomponents-charts', { classSuffix: 'Component' }),
grids: apiPackage('WebComponents', 'igniteui-webcomponents-grids', { classSuffix: 'Component' }),
gauges: apiPackage('WebComponents', 'igniteui-webcomponents-gauges', { classSuffix: 'Component' }),
maps: apiPackage('WebComponents', 'igniteui-webcomponents-maps', { classSuffix: 'Component' }),
inputs: apiPackage('WebComponents', 'igniteui-webcomponents-inputs', { classSuffix: 'Component' }),
layouts: apiPackage('WebComponents', 'igniteui-webcomponents-layouts', { classSuffix: 'Component' }),
excel: apiPackage('WebComponents', 'igniteui-webcomponents-excel', { classSuffix: 'Component' }),
spreadsheet: apiPackage('WebComponents', 'igniteui-webcomponents-spreadsheet', { classSuffix: 'Component' }),
datasources: apiPackage('WebComponents', 'igniteui-webcomponents-datasources', { classSuffix: 'Component' }),
dockmanager: apiPackage('WebComponents', 'igniteui-dockmanager', { classSuffix: 'Component' }),
gridlite: apiPackage('WebComponents', 'igniteui-grid-lite', { classSuffix: 'Component' }),
},
packages: {
common: 'igniteui-webcomponents',
Expand All @@ -162,18 +238,22 @@ const PLATFORMS: Record<PlatformName, PlatformContext> = {
},
Blazor: {
name: 'Blazor',
apiLinkIndex: loadApiLinkIndex('Blazor'),
lower: 'blazor',
prefix: 'Igb',
productName: 'Ignite UI for Blazor',
productSpinal: 'ignite-ui-blazor',
apiPackages: {
core: { docRoot: 'https://www.infragistics.com/products/ignite-ui-blazor/docs/typescript/latest', packageId: 'igniteui-blazor' },
charts: { docRoot: 'https://www.infragistics.com/products/ignite-ui-blazor/api/docs/typescript/latest', packageId: 'igniteui_blazor_charts' },
grids: { docRoot: 'https://www.infragistics.com/products/ignite-ui-blazor/api/docs/typescript/latest', packageId: 'igniteui_blazor_data_grids' },
gauges: { docRoot: 'https://www.infragistics.com/products/ignite-ui-blazor/api/docs/typescript/latest', packageId: 'igniteui_blazor_gauges' },
maps: { docRoot: 'https://www.infragistics.com/products/ignite-ui-blazor/api/docs/typescript/latest', packageId: 'igniteui_blazor_maps' },
excel: { docRoot: 'https://www.infragistics.com/products/ignite-ui-blazor/api/docs/typescript/latest', packageId: 'igniteui_blazor_excel' },
spreadsheet: { docRoot: 'https://www.infragistics.com/products/ignite-ui-blazor/api/docs/typescript/latest', packageId: 'igniteui_blazor_spreadsheet' },
core: apiPackage('Blazor', 'IgniteUI.Blazor', { pascalCaseMembers: true }),
charts: apiPackage('Blazor', 'IgniteUI.Blazor', { pascalCaseMembers: true }),
grids: apiPackage('Blazor', 'IgniteUI.Blazor', { pascalCaseMembers: true }),
gauges: apiPackage('Blazor', 'IgniteUI.Blazor', { pascalCaseMembers: true }),
maps: apiPackage('Blazor', 'IgniteUI.Blazor', { pascalCaseMembers: true }),
excel: apiPackage('Blazor', 'IgniteUI.Blazor.Documents.Excel', { pascalCaseMembers: true }),
spreadsheet: apiPackage('Blazor', 'IgniteUI.Blazor', { pascalCaseMembers: true }),
documentsCore: apiPackage('Blazor', 'IgniteUI.Blazor.Documents.Core', { pascalCaseMembers: true }),
lite: apiPackage('Blazor', 'IgniteUI.Blazor.Lite', { pascalCaseMembers: true }),
gridlite: apiPackage('Blazor', 'IgniteUI.Blazor.GridLite', { pascalCaseMembers: true }),
},
packages: {
common: 'IgniteUI.Blazor',
Expand Down
1 change: 1 addition & 0 deletions src/data/api-link-index/angular/staging-latest.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/data/api-link-index/blazor/staging-latest.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/data/api-link-index/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"files": [
"angular/staging-latest.json",
"blazor/staging-latest.json",
"react/staging-latest.json",
"webcomponents/staging-latest.json"
]
}
1 change: 1 addition & 0 deletions src/data/api-link-index/react/staging-latest.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/data/api-link-index/webcomponents/staging-latest.json

Large diffs are not rendered by default.

47 changes: 41 additions & 6 deletions src/lib/platform-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,37 @@
let _ctx: PlatformContext | null = null;
let _env: Record<string, string> | null = null;


function getBuildMode(): string {
return process.env.DOCS_ENV ?? process.env.NODE_ENV ?? 'development';
}

function getApiDocsBaseUrl(): string {
const mode = getBuildMode();
const value = process.env.API_DOCS_BASE_URL
?? (mode === 'production'
? 'https://www.infragistics.com/api'
: 'https://staging.infragistics.com/api');

const trimmed = value.replace(/\/+$/, '');
return trimmed.endsWith('/api') ? trimmed : `${trimmed}/api`;
}

function getApiLinkIndexName(): string {
return process.env.API_LINK_INDEX_VERSION
?? (getBuildMode() === 'production' ? 'prod-latest' : 'staging-latest');
}

function loadApiLinkIndex(platformSlug: string): PlatformContext['apiLinkIndex'] {
try {
const file = path.resolve(process.cwd(), 'src', 'data', 'api-link-index', platformSlug, `${getApiLinkIndexName()}.json`);
if (!fs.existsSync(file)) return undefined;
return JSON.parse(fs.readFileSync(file, 'utf-8'));
} catch {
return undefined;
}
}

/**
* Returns the platform context for the current build.
* Resolution order: PLATFORM env var → .platform.json → 'React' default.
Expand All @@ -186,17 +217,21 @@
} catch { /* use default */ }
}

const mode = process.env.DOCS_ENV ?? process.env.NODE_ENV ?? 'development';
const apiHost = mode === 'production'
? 'https://www.infragistics.com'
: 'https://staging.infragistics.com';
const apiDocsBaseUrl = getApiDocsBaseUrl();

const base = PLATFORMS[name];
_ctx = {
...base,
apiLinkIndex: loadApiLinkIndex(base.lower),
apiPackages: Object.fromEntries(
Object.entries(base.apiPackages).map(([key, pkg]) => [
key,
{ ...pkg, docRoot: pkg.docRoot.replace('https://staging.infragistics.com', apiHost) },
{
...pkg,
docRoot: pkg.docRoot
.replace('https://staging.infragistics.com/api', apiDocsBaseUrl)
.replace(/\/latest$/, '/latest'),

Check warning

Code scanning / CodeQL

Replacement of a substring with itself Medium

This replaces '/latest' with itself.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
},
])
),
};
Expand All @@ -216,7 +251,7 @@

const { name } = getPlatformContext();
const lang = process.env.LANG_CODE ?? 'en';
const mode = process.env.DOCS_ENV ?? process.env.NODE_ENV ?? 'development';
const mode = getBuildMode();

// Primary: generated/environment.json (written by generate.mjs when present)
try {
Expand Down
Loading