@apify/docusaurus-plugin-typedoc-api 4.4.12 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -296
- package/lib/components/AnchorLink.d.ts +5 -0
- package/lib/components/AnchorLink.d.ts.map +1 -0
- package/lib/components/AnchorLink.js +7 -26
- package/lib/components/AnchorLink.js.map +1 -1
- package/lib/components/ApiChangelog.d.ts +6 -0
- package/lib/components/ApiChangelog.d.ts.map +1 -0
- package/lib/components/ApiChangelog.js +7 -24
- package/lib/components/ApiChangelog.js.map +1 -1
- package/lib/components/ApiDataContext.d.ts +6 -0
- package/lib/components/ApiDataContext.d.ts.map +1 -0
- package/lib/components/ApiDataContext.js +12 -15
- package/lib/components/ApiDataContext.js.map +1 -1
- package/lib/components/ApiIndex.d.ts +14 -0
- package/lib/components/ApiIndex.d.ts.map +1 -0
- package/lib/components/ApiIndex.js +33 -93
- package/lib/components/ApiIndex.js.map +1 -1
- package/lib/components/ApiItem.d.ts +6 -0
- package/lib/components/ApiItem.d.ts.map +1 -0
- package/lib/components/ApiItem.js +131 -191
- package/lib/components/ApiItem.js.map +1 -1
- package/lib/components/ApiItemLayout.d.ts +14 -0
- package/lib/components/ApiItemLayout.d.ts.map +1 -0
- package/lib/components/ApiItemLayout.js +21 -97
- package/lib/components/ApiItemLayout.js.map +1 -1
- package/lib/components/ApiOptionsContext.d.ts +5 -0
- package/lib/components/ApiOptionsContext.d.ts.map +1 -0
- package/lib/components/ApiOptionsContext.js +5 -9
- package/lib/components/ApiOptionsContext.js.map +1 -1
- package/lib/components/ApiOptionsLayout.d.ts +4 -0
- package/lib/components/ApiOptionsLayout.d.ts.map +1 -0
- package/lib/components/ApiOptionsLayout.js +10 -34
- package/lib/components/ApiOptionsLayout.js.map +1 -1
- package/lib/components/ApiPage.d.ts +11 -0
- package/lib/components/ApiPage.d.ts.map +1 -0
- package/lib/components/ApiPage.js +50 -63
- package/lib/components/ApiPage.js.map +1 -1
- package/lib/components/Breadcrumb.d.ts +7 -0
- package/lib/components/Breadcrumb.d.ts.map +1 -0
- package/lib/components/Breadcrumb.js +17 -49
- package/lib/components/Breadcrumb.js.map +1 -1
- package/lib/components/Comment.d.ts +10 -0
- package/lib/components/Comment.d.ts.map +1 -0
- package/lib/components/Comment.js +33 -60
- package/lib/components/Comment.js.map +1 -1
- package/lib/components/CommentBadges.d.ts +9 -0
- package/lib/components/CommentBadges.d.ts.map +1 -0
- package/lib/components/CommentBadges.js +16 -28
- package/lib/components/CommentBadges.js.map +1 -1
- package/lib/components/DefaultValue.d.ts +10 -0
- package/lib/components/DefaultValue.d.ts.map +1 -0
- package/lib/components/DefaultValue.js +25 -55
- package/lib/components/DefaultValue.js.map +1 -1
- package/lib/components/Flags.d.ts +6 -0
- package/lib/components/Flags.d.ts.map +1 -0
- package/lib/components/Flags.js +11 -22
- package/lib/components/Flags.js.map +1 -1
- package/lib/components/Footer.d.ts +2 -0
- package/lib/components/Footer.d.ts.map +1 -0
- package/lib/components/Footer.js +4 -16
- package/lib/components/Footer.js.map +1 -1
- package/lib/components/Hierarchy.d.ts +6 -0
- package/lib/components/Hierarchy.d.ts.map +1 -0
- package/lib/components/Hierarchy.js +5 -25
- package/lib/components/Hierarchy.js.map +1 -1
- package/lib/components/Icon.d.ts +6 -0
- package/lib/components/Icon.d.ts.map +1 -0
- package/lib/components/Icon.js +10 -21
- package/lib/components/Icon.js.map +1 -1
- package/lib/components/Index.d.ts +9 -0
- package/lib/components/Index.d.ts.map +1 -0
- package/lib/components/Index.js +30 -113
- package/lib/components/Index.js.map +1 -1
- package/lib/components/Markdown.d.ts +5 -0
- package/lib/components/Markdown.d.ts.map +1 -0
- package/lib/components/Markdown.js +138 -202
- package/lib/components/Markdown.js.map +1 -1
- package/lib/components/Member.d.ts +5 -0
- package/lib/components/Member.d.ts.map +1 -0
- package/lib/components/Member.js +40 -69
- package/lib/components/Member.js.map +1 -1
- package/lib/components/MemberDeclaration.d.ts +5 -0
- package/lib/components/MemberDeclaration.d.ts.map +1 -0
- package/lib/components/MemberDeclaration.js +20 -71
- package/lib/components/MemberDeclaration.js.map +1 -1
- package/lib/components/MemberGetterSetter.d.ts +8 -0
- package/lib/components/MemberGetterSetter.d.ts.map +1 -0
- package/lib/components/MemberGetterSetter.js +13 -68
- package/lib/components/MemberGetterSetter.js.map +1 -1
- package/lib/components/MemberReference.d.ts +6 -0
- package/lib/components/MemberReference.d.ts.map +1 -0
- package/lib/components/MemberReference.js +18 -48
- package/lib/components/MemberReference.js.map +1 -1
- package/lib/components/MemberSignatureBody.d.ts +9 -0
- package/lib/components/MemberSignatureBody.d.ts.map +1 -0
- package/lib/components/MemberSignatureBody.js +85 -182
- package/lib/components/MemberSignatureBody.js.map +1 -1
- package/lib/components/MemberSignatureTitle.d.ts +11 -0
- package/lib/components/MemberSignatureTitle.d.ts.map +1 -0
- package/lib/components/MemberSignatureTitle.js +27 -81
- package/lib/components/MemberSignatureTitle.js.map +1 -1
- package/lib/components/MemberSignatures.d.ts +7 -0
- package/lib/components/MemberSignatures.d.ts.map +1 -0
- package/lib/components/MemberSignatures.js +18 -66
- package/lib/components/MemberSignatures.js.map +1 -1
- package/lib/components/MemberSources.d.ts +7 -0
- package/lib/components/MemberSources.d.ts.map +1 -0
- package/lib/components/MemberSources.js +10 -34
- package/lib/components/MemberSources.js.map +1 -1
- package/lib/components/Members.d.ts +6 -0
- package/lib/components/Members.d.ts.map +1 -0
- package/lib/components/Members.js +29 -49
- package/lib/components/Members.js.map +1 -1
- package/lib/components/MembersGroup.d.ts +6 -0
- package/lib/components/MembersGroup.d.ts.map +1 -0
- package/lib/components/MembersGroup.js +16 -40
- package/lib/components/MembersGroup.js.map +1 -1
- package/lib/components/Parameter.d.ts +6 -0
- package/lib/components/Parameter.d.ts.map +1 -0
- package/lib/components/Parameter.js +35 -171
- package/lib/components/Parameter.js.map +1 -1
- package/lib/components/Reflection.d.ts +6 -0
- package/lib/components/Reflection.d.ts.map +1 -0
- package/lib/components/Reflection.js +29 -132
- package/lib/components/Reflection.js.map +1 -1
- package/lib/components/SourceLink.d.ts +10 -0
- package/lib/components/SourceLink.d.ts.map +1 -0
- package/lib/components/SourceLink.js +16 -36
- package/lib/components/SourceLink.js.map +1 -1
- package/lib/components/Type.d.ts +12 -0
- package/lib/components/Type.d.ts.map +1 -0
- package/lib/components/Type.js +142 -464
- package/lib/components/Type.js.map +1 -1
- package/lib/components/TypeAndParent.d.ts +6 -0
- package/lib/components/TypeAndParent.d.ts.map +1 -0
- package/lib/components/TypeAndParent.js +11 -27
- package/lib/components/TypeAndParent.js.map +1 -1
- package/lib/components/TypeParameters.d.ts +6 -0
- package/lib/components/TypeParameters.d.ts.map +1 -0
- package/lib/components/TypeParameters.js +10 -38
- package/lib/components/TypeParameters.js.map +1 -1
- package/lib/components/TypeParametersGeneric.d.ts +6 -0
- package/lib/components/TypeParametersGeneric.d.ts.map +1 -0
- package/lib/components/TypeParametersGeneric.js +8 -27
- package/lib/components/TypeParametersGeneric.js.map +1 -1
- package/lib/components/VersionBanner.d.ts +2 -0
- package/lib/components/VersionBanner.d.ts.map +1 -0
- package/lib/components/VersionBanner.js +18 -49
- package/lib/components/VersionBanner.js.map +1 -1
- package/lib/hooks/useBreadcrumbs.d.ts +2 -0
- package/lib/hooks/useBreadcrumbs.d.ts.map +1 -0
- package/lib/hooks/useBreadcrumbs.js +5 -8
- package/lib/hooks/useBreadcrumbs.js.map +1 -1
- package/lib/hooks/useGitRefName.d.ts +2 -0
- package/lib/hooks/useGitRefName.d.ts.map +1 -0
- package/lib/hooks/useGitRefName.js +5 -8
- package/lib/hooks/useGitRefName.js.map +1 -1
- package/lib/hooks/useMinimalLayout.d.ts +2 -0
- package/lib/hooks/useMinimalLayout.d.ts.map +1 -0
- package/lib/hooks/useMinimalLayout.js +5 -8
- package/lib/hooks/useMinimalLayout.js.map +1 -1
- package/lib/hooks/useReflection.d.ts +4 -0
- package/lib/hooks/useReflection.d.ts.map +1 -0
- package/lib/hooks/useReflection.js +15 -21
- package/lib/hooks/useReflection.js.map +1 -1
- package/lib/hooks/useReflectionMap.d.ts +3 -0
- package/lib/hooks/useReflectionMap.d.ts.map +1 -0
- package/lib/hooks/useReflectionMap.js +5 -8
- package/lib/hooks/useReflectionMap.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +349 -361
- package/lib/index.js.map +1 -1
- package/lib/markdownLoader.d.ts +6 -0
- package/lib/markdownLoader.d.ts.map +1 -0
- package/lib/markdownLoader.js +6 -10
- package/lib/markdownLoader.js.map +1 -1
- package/lib/plugin/data.d.ts +21 -0
- package/lib/plugin/data.d.ts.map +1 -0
- package/lib/plugin/data.js +391 -429
- package/lib/plugin/data.js.map +1 -1
- package/lib/plugin/python/consts.d.ts +35 -0
- package/lib/plugin/python/consts.d.ts.map +1 -0
- package/lib/plugin/python/consts.js +44 -44
- package/lib/plugin/python/consts.js.map +1 -1
- package/lib/plugin/python/index.d.ts +12 -0
- package/lib/plugin/python/index.d.ts.map +1 -0
- package/lib/plugin/python/index.js +25 -36
- package/lib/plugin/python/index.js.map +1 -1
- package/lib/plugin/python/inheritance.d.ts +42 -0
- package/lib/plugin/python/inheritance.d.ts.map +1 -0
- package/lib/plugin/python/inheritance.js +148 -153
- package/lib/plugin/python/inheritance.js.map +1 -1
- package/lib/plugin/python/packageVersions.d.ts +7 -0
- package/lib/plugin/python/packageVersions.d.ts.map +1 -0
- package/lib/plugin/python/packageVersions.js +30 -38
- package/lib/plugin/python/packageVersions.js.map +1 -1
- package/lib/plugin/python/transformation.d.ts +90 -0
- package/lib/plugin/python/transformation.d.ts.map +1 -0
- package/lib/plugin/python/transformation.js +424 -391
- package/lib/plugin/python/transformation.js.map +1 -1
- package/lib/plugin/python/type-parsing/index.d.ts +34 -0
- package/lib/plugin/python/type-parsing/index.d.ts.map +1 -0
- package/lib/plugin/python/type-parsing/index.js +78 -85
- package/lib/plugin/python/type-parsing/index.js.map +1 -1
- package/lib/plugin/python/types.d.ts +107 -0
- package/lib/plugin/python/types.d.ts.map +1 -0
- package/lib/plugin/python/types.js +2 -2
- package/lib/plugin/python/types.js.map +1 -1
- package/lib/plugin/python/utils.d.ts +40 -0
- package/lib/plugin/python/utils.d.ts.map +1 -0
- package/lib/plugin/python/utils.js +74 -73
- package/lib/plugin/python/utils.js.map +1 -1
- package/lib/plugin/sidebar.d.ts +6 -0
- package/lib/plugin/sidebar.d.ts.map +1 -0
- package/lib/plugin/sidebar.js +94 -96
- package/lib/plugin/sidebar.js.map +1 -1
- package/lib/plugin/structure/0.23.d.ts +3 -0
- package/lib/plugin/structure/0.23.d.ts.map +1 -0
- package/lib/plugin/structure/0.23.js +33 -41
- package/lib/plugin/structure/0.23.js.map +1 -1
- package/lib/plugin/url.d.ts +6 -0
- package/lib/plugin/url.d.ts.map +1 -0
- package/lib/plugin/url.js +36 -46
- package/lib/plugin/url.js.map +1 -1
- package/lib/plugin/version.d.ts +5 -0
- package/lib/plugin/version.d.ts.map +1 -0
- package/lib/plugin/version.js +73 -78
- package/lib/plugin/version.js.map +1 -1
- package/lib/types.d.ts +142 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -2
- package/lib/types.js.map +1 -1
- package/lib/utils/helpers.d.ts +2 -0
- package/lib/utils/helpers.d.ts.map +1 -0
- package/lib/utils/helpers.js +5 -7
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/hierarchy.d.ts +8 -0
- package/lib/utils/hierarchy.d.ts.map +1 -0
- package/lib/utils/hierarchy.js +31 -33
- package/lib/utils/hierarchy.js.map +1 -1
- package/lib/utils/icons.d.ts +5 -0
- package/lib/utils/icons.d.ts.map +1 -0
- package/lib/utils/icons.js +82 -114
- package/lib/utils/icons.js.map +1 -1
- package/lib/utils/links.d.ts +2 -0
- package/lib/utils/links.d.ts.map +1 -0
- package/lib/utils/links.js +24 -41
- package/lib/utils/links.js.map +1 -1
- package/lib/utils/markdown.d.ts +4 -0
- package/lib/utils/markdown.d.ts.map +1 -0
- package/lib/utils/markdown.js +45 -54
- package/lib/utils/markdown.js.map +1 -1
- package/lib/utils/reexports.d.ts +5 -0
- package/lib/utils/reexports.d.ts.map +1 -0
- package/lib/utils/reexports.js +90 -90
- package/lib/utils/reexports.js.map +1 -1
- package/lib/utils/removeScopes.d.ts +2 -0
- package/lib/utils/removeScopes.d.ts.map +1 -0
- package/lib/utils/removeScopes.js +7 -0
- package/lib/utils/removeScopes.js.map +1 -0
- package/lib/utils/visibility.d.ts +6 -0
- package/lib/utils/visibility.d.ts.map +1 -0
- package/lib/utils/visibility.js +14 -19
- package/lib/utils/visibility.js.map +1 -1
- package/package.json +29 -17
- package/python-scripts/docspec-gen/google_docstring_processor.py +54 -20
- package/src/components/ApiIndex.tsx +1 -1
- package/src/index.ts +2 -2
- package/src/plugin/data.ts +3 -3
- package/src/plugin/python/index.ts +3 -3
- package/src/plugin/python/packageVersions.ts +3 -3
- package/src/plugin/python/transformation.ts +89 -15
- package/src/plugin/python/types.ts +3 -4
- package/src/plugin/sidebar.ts +1 -1
- package/src/plugin/url.ts +1 -1
- package/src/plugin/version.ts +1 -1
- package/src/utils/links.ts +1 -12
- package/src/utils/removeScopes.ts +10 -0
- /package/{assets/styles-8ad572ec.css → lib/components/styles.css} +0 -0
|
@@ -86,6 +86,19 @@ export class SymbolIdTracker {
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
export class DocspecTransformer {
|
|
89
|
+
/**
|
|
90
|
+
* Maps Google-style docstring section names to Docusaurus admonition types.
|
|
91
|
+
* Only sections that semantically match admonition purposes are included.
|
|
92
|
+
* Sections like Raises, Yields, Attributes are technical documentation, not admonitions.
|
|
93
|
+
*/
|
|
94
|
+
private static readonly SECTION_TO_ADMONITION: Record<string, string> = {
|
|
95
|
+
Danger: 'danger',
|
|
96
|
+
Info: 'info',
|
|
97
|
+
Note: 'note',
|
|
98
|
+
Tip: 'tip',
|
|
99
|
+
Warning: 'warning',
|
|
100
|
+
};
|
|
101
|
+
|
|
89
102
|
private pythonTypeResolver: PythonTypeResolver;
|
|
90
103
|
|
|
91
104
|
private inheritanceGraph: InheritanceGraph;
|
|
@@ -444,12 +457,42 @@ export class DocspecTransformer {
|
|
|
444
457
|
return { filePathInRepo };
|
|
445
458
|
}
|
|
446
459
|
|
|
460
|
+
/**
|
|
461
|
+
* Converts a docstring section to Docusaurus admonition markdown format.
|
|
462
|
+
*/
|
|
463
|
+
private sectionToAdmonition(sectionName: string, content: unknown[]): string {
|
|
464
|
+
const admonitionType = DocspecTransformer.SECTION_TO_ADMONITION[sectionName];
|
|
465
|
+
if (!admonitionType) {
|
|
466
|
+
return '';
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
const contentText = content
|
|
470
|
+
.map((item) => {
|
|
471
|
+
if (typeof item === 'string') {
|
|
472
|
+
return item;
|
|
473
|
+
}
|
|
474
|
+
if (typeof item === 'object' && item !== null && 'desc' in item) {
|
|
475
|
+
const obj = item as { param?: string; desc: string };
|
|
476
|
+
return obj.param ? `**${obj.param}**: ${obj.desc}` : obj.desc;
|
|
477
|
+
}
|
|
478
|
+
return '';
|
|
479
|
+
})
|
|
480
|
+
.filter(Boolean)
|
|
481
|
+
.join('\n');
|
|
482
|
+
|
|
483
|
+
if (!contentText) {
|
|
484
|
+
return '';
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return `:::${admonitionType} ${sectionName}\n${contentText}\n:::`;
|
|
488
|
+
}
|
|
489
|
+
|
|
447
490
|
/**
|
|
448
491
|
* If possible, parses the `.docstring` property of the passed object. If the docstring is a stringified JSON object,
|
|
449
492
|
* it extracts the `args` and `returns` sections and adds them to the returned object.
|
|
450
493
|
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
494
|
+
* The docstring format is a JSON object with a `content` array that contains interleaved text strings
|
|
495
|
+
* and section objects, preserving the original order from the docstring.
|
|
453
496
|
*/
|
|
454
497
|
private parseDocstring(docspecMember: DocspecObject): TypeDocDocstring {
|
|
455
498
|
const docstring: TypeDocDocstring = { text: docspecMember.docstring?.content ?? '' };
|
|
@@ -457,21 +500,52 @@ export class DocspecTransformer {
|
|
|
457
500
|
try {
|
|
458
501
|
const parsedDocstring = JSON.parse(docstring.text) as DocspecDocstring;
|
|
459
502
|
|
|
460
|
-
|
|
461
|
-
const
|
|
462
|
-
(section) => Object.keys(section)[0] === 'Arguments',
|
|
463
|
-
)?.Arguments ?? []) as DocspecDocstring['args'];
|
|
503
|
+
// Build the text output by processing content items in order
|
|
504
|
+
const textParts: string[] = [];
|
|
464
505
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
506
|
+
for (const item of parsedDocstring.content ?? []) {
|
|
507
|
+
if (typeof item === 'string') {
|
|
508
|
+
// Regular text content
|
|
509
|
+
textParts.push(item);
|
|
510
|
+
} else {
|
|
511
|
+
// Section object
|
|
512
|
+
const sectionName = Object.keys(item)[0];
|
|
513
|
+
const sectionContent = item[sectionName] as unknown[];
|
|
514
|
+
|
|
515
|
+
if (sectionName === 'Arguments') {
|
|
516
|
+
// Extract arguments for parameter documentation
|
|
517
|
+
const parsedArguments = sectionContent as { param: string; desc: string }[];
|
|
518
|
+
docstring.args =
|
|
519
|
+
parsedArguments?.reduce<Record<string, string>>((acc, arg) => {
|
|
520
|
+
acc[arg.param] = arg.desc;
|
|
521
|
+
return acc;
|
|
522
|
+
}, {}) ?? {};
|
|
523
|
+
} else if (sectionName === 'Returns') {
|
|
524
|
+
// Extract return type documentation
|
|
525
|
+
docstring.returns = sectionContent
|
|
526
|
+
.map((returnsItem) => {
|
|
527
|
+
if (typeof returnsItem === 'string') {
|
|
528
|
+
return returnsItem;
|
|
529
|
+
}
|
|
530
|
+
if (typeof returnsItem === 'object' && returnsItem !== null && 'param' in returnsItem && 'desc' in returnsItem) {
|
|
531
|
+
const obj = returnsItem as { param: string; desc: string };
|
|
532
|
+
return `${obj.param}: ${obj.desc}`;
|
|
533
|
+
}
|
|
534
|
+
return '';
|
|
535
|
+
})
|
|
536
|
+
.filter(Boolean)
|
|
537
|
+
.join('\n');
|
|
538
|
+
} else {
|
|
539
|
+
// Convert other sections to admonitions inline
|
|
540
|
+
const admonition = this.sectionToAdmonition(sectionName, sectionContent);
|
|
541
|
+
if (admonition) {
|
|
542
|
+
textParts.push(admonition);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
473
547
|
|
|
474
|
-
docstring.
|
|
548
|
+
docstring.text = textParts.join('\n\n');
|
|
475
549
|
} catch {
|
|
476
550
|
// Do nothing
|
|
477
551
|
}
|
|
@@ -71,11 +71,10 @@ export interface TypeDocDocstring {
|
|
|
71
71
|
sections?: Record<string, any[]>[];
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
export type DocspecDocstringContentItem = Record<string, any[]> | string;
|
|
75
|
+
|
|
74
76
|
export interface DocspecDocstring {
|
|
75
|
-
|
|
76
|
-
returns?: string;
|
|
77
|
-
args?: { param: string; desc: string }[];
|
|
78
|
-
sections?: Record<string, any[]>[];
|
|
77
|
+
content: DocspecDocstringContentItem[];
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
export type TypeDocType =
|
package/src/plugin/sidebar.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
TSDDeclarationReflection,
|
|
8
8
|
TSDDeclarationReflectionMap,
|
|
9
9
|
} from '../types';
|
|
10
|
-
import { removeScopes } from '../utils/
|
|
10
|
+
import { removeScopes } from '../utils/removeScopes';
|
|
11
11
|
import { createReflectionMap } from './data';
|
|
12
12
|
|
|
13
13
|
export function groupSidebarItems(
|
package/src/plugin/url.ts
CHANGED
package/src/plugin/version.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// BASED ON: https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-plugin-content-docs/src/versions.ts
|
|
2
2
|
|
|
3
|
-
import path from 'path';
|
|
3
|
+
import path from 'node:path';
|
|
4
4
|
import type { PluginOptions as DocusaurusNativePluginOptions } from '@docusaurus/plugin-content-docs';
|
|
5
5
|
import {
|
|
6
6
|
CURRENT_VERSION_NAME,
|
package/src/utils/links.ts
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
1
|
+
import fs from 'node:fs';
|
|
2
2
|
import { TypedocJSONFile } from '../types';
|
|
3
3
|
|
|
4
|
-
export function removeScopes(text: string, scopes: string[]): string {
|
|
5
|
-
if (scopes.length === 0) {
|
|
6
|
-
return text;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return scopes.reduce(
|
|
10
|
-
(value, scope) => value.replace(new RegExp(`^(${scope}-|@${scope}/)`), ''),
|
|
11
|
-
text,
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
4
|
export function injectGitRevision(typedocJsonFilePath: string, gitRevision: string): void {
|
|
16
5
|
const typedocJson = JSON.parse(fs.readFileSync(typedocJsonFilePath, 'utf8')) as TypedocJSONFile;
|
|
17
6
|
|
|
File without changes
|