@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.
Files changed (280) hide show
  1. package/README.md +38 -296
  2. package/lib/components/AnchorLink.d.ts +5 -0
  3. package/lib/components/AnchorLink.d.ts.map +1 -0
  4. package/lib/components/AnchorLink.js +7 -26
  5. package/lib/components/AnchorLink.js.map +1 -1
  6. package/lib/components/ApiChangelog.d.ts +6 -0
  7. package/lib/components/ApiChangelog.d.ts.map +1 -0
  8. package/lib/components/ApiChangelog.js +7 -24
  9. package/lib/components/ApiChangelog.js.map +1 -1
  10. package/lib/components/ApiDataContext.d.ts +6 -0
  11. package/lib/components/ApiDataContext.d.ts.map +1 -0
  12. package/lib/components/ApiDataContext.js +12 -15
  13. package/lib/components/ApiDataContext.js.map +1 -1
  14. package/lib/components/ApiIndex.d.ts +14 -0
  15. package/lib/components/ApiIndex.d.ts.map +1 -0
  16. package/lib/components/ApiIndex.js +33 -93
  17. package/lib/components/ApiIndex.js.map +1 -1
  18. package/lib/components/ApiItem.d.ts +6 -0
  19. package/lib/components/ApiItem.d.ts.map +1 -0
  20. package/lib/components/ApiItem.js +131 -191
  21. package/lib/components/ApiItem.js.map +1 -1
  22. package/lib/components/ApiItemLayout.d.ts +14 -0
  23. package/lib/components/ApiItemLayout.d.ts.map +1 -0
  24. package/lib/components/ApiItemLayout.js +21 -97
  25. package/lib/components/ApiItemLayout.js.map +1 -1
  26. package/lib/components/ApiOptionsContext.d.ts +5 -0
  27. package/lib/components/ApiOptionsContext.d.ts.map +1 -0
  28. package/lib/components/ApiOptionsContext.js +5 -9
  29. package/lib/components/ApiOptionsContext.js.map +1 -1
  30. package/lib/components/ApiOptionsLayout.d.ts +4 -0
  31. package/lib/components/ApiOptionsLayout.d.ts.map +1 -0
  32. package/lib/components/ApiOptionsLayout.js +10 -34
  33. package/lib/components/ApiOptionsLayout.js.map +1 -1
  34. package/lib/components/ApiPage.d.ts +11 -0
  35. package/lib/components/ApiPage.d.ts.map +1 -0
  36. package/lib/components/ApiPage.js +50 -63
  37. package/lib/components/ApiPage.js.map +1 -1
  38. package/lib/components/Breadcrumb.d.ts +7 -0
  39. package/lib/components/Breadcrumb.d.ts.map +1 -0
  40. package/lib/components/Breadcrumb.js +17 -49
  41. package/lib/components/Breadcrumb.js.map +1 -1
  42. package/lib/components/Comment.d.ts +10 -0
  43. package/lib/components/Comment.d.ts.map +1 -0
  44. package/lib/components/Comment.js +33 -60
  45. package/lib/components/Comment.js.map +1 -1
  46. package/lib/components/CommentBadges.d.ts +9 -0
  47. package/lib/components/CommentBadges.d.ts.map +1 -0
  48. package/lib/components/CommentBadges.js +16 -28
  49. package/lib/components/CommentBadges.js.map +1 -1
  50. package/lib/components/DefaultValue.d.ts +10 -0
  51. package/lib/components/DefaultValue.d.ts.map +1 -0
  52. package/lib/components/DefaultValue.js +25 -55
  53. package/lib/components/DefaultValue.js.map +1 -1
  54. package/lib/components/Flags.d.ts +6 -0
  55. package/lib/components/Flags.d.ts.map +1 -0
  56. package/lib/components/Flags.js +11 -22
  57. package/lib/components/Flags.js.map +1 -1
  58. package/lib/components/Footer.d.ts +2 -0
  59. package/lib/components/Footer.d.ts.map +1 -0
  60. package/lib/components/Footer.js +4 -16
  61. package/lib/components/Footer.js.map +1 -1
  62. package/lib/components/Hierarchy.d.ts +6 -0
  63. package/lib/components/Hierarchy.d.ts.map +1 -0
  64. package/lib/components/Hierarchy.js +5 -25
  65. package/lib/components/Hierarchy.js.map +1 -1
  66. package/lib/components/Icon.d.ts +6 -0
  67. package/lib/components/Icon.d.ts.map +1 -0
  68. package/lib/components/Icon.js +10 -21
  69. package/lib/components/Icon.js.map +1 -1
  70. package/lib/components/Index.d.ts +9 -0
  71. package/lib/components/Index.d.ts.map +1 -0
  72. package/lib/components/Index.js +30 -113
  73. package/lib/components/Index.js.map +1 -1
  74. package/lib/components/Markdown.d.ts +5 -0
  75. package/lib/components/Markdown.d.ts.map +1 -0
  76. package/lib/components/Markdown.js +138 -202
  77. package/lib/components/Markdown.js.map +1 -1
  78. package/lib/components/Member.d.ts +5 -0
  79. package/lib/components/Member.d.ts.map +1 -0
  80. package/lib/components/Member.js +40 -69
  81. package/lib/components/Member.js.map +1 -1
  82. package/lib/components/MemberDeclaration.d.ts +5 -0
  83. package/lib/components/MemberDeclaration.d.ts.map +1 -0
  84. package/lib/components/MemberDeclaration.js +20 -71
  85. package/lib/components/MemberDeclaration.js.map +1 -1
  86. package/lib/components/MemberGetterSetter.d.ts +8 -0
  87. package/lib/components/MemberGetterSetter.d.ts.map +1 -0
  88. package/lib/components/MemberGetterSetter.js +13 -68
  89. package/lib/components/MemberGetterSetter.js.map +1 -1
  90. package/lib/components/MemberReference.d.ts +6 -0
  91. package/lib/components/MemberReference.d.ts.map +1 -0
  92. package/lib/components/MemberReference.js +18 -48
  93. package/lib/components/MemberReference.js.map +1 -1
  94. package/lib/components/MemberSignatureBody.d.ts +9 -0
  95. package/lib/components/MemberSignatureBody.d.ts.map +1 -0
  96. package/lib/components/MemberSignatureBody.js +85 -182
  97. package/lib/components/MemberSignatureBody.js.map +1 -1
  98. package/lib/components/MemberSignatureTitle.d.ts +11 -0
  99. package/lib/components/MemberSignatureTitle.d.ts.map +1 -0
  100. package/lib/components/MemberSignatureTitle.js +27 -81
  101. package/lib/components/MemberSignatureTitle.js.map +1 -1
  102. package/lib/components/MemberSignatures.d.ts +7 -0
  103. package/lib/components/MemberSignatures.d.ts.map +1 -0
  104. package/lib/components/MemberSignatures.js +18 -66
  105. package/lib/components/MemberSignatures.js.map +1 -1
  106. package/lib/components/MemberSources.d.ts +7 -0
  107. package/lib/components/MemberSources.d.ts.map +1 -0
  108. package/lib/components/MemberSources.js +10 -34
  109. package/lib/components/MemberSources.js.map +1 -1
  110. package/lib/components/Members.d.ts +6 -0
  111. package/lib/components/Members.d.ts.map +1 -0
  112. package/lib/components/Members.js +29 -49
  113. package/lib/components/Members.js.map +1 -1
  114. package/lib/components/MembersGroup.d.ts +6 -0
  115. package/lib/components/MembersGroup.d.ts.map +1 -0
  116. package/lib/components/MembersGroup.js +16 -40
  117. package/lib/components/MembersGroup.js.map +1 -1
  118. package/lib/components/Parameter.d.ts +6 -0
  119. package/lib/components/Parameter.d.ts.map +1 -0
  120. package/lib/components/Parameter.js +35 -171
  121. package/lib/components/Parameter.js.map +1 -1
  122. package/lib/components/Reflection.d.ts +6 -0
  123. package/lib/components/Reflection.d.ts.map +1 -0
  124. package/lib/components/Reflection.js +29 -132
  125. package/lib/components/Reflection.js.map +1 -1
  126. package/lib/components/SourceLink.d.ts +10 -0
  127. package/lib/components/SourceLink.d.ts.map +1 -0
  128. package/lib/components/SourceLink.js +16 -36
  129. package/lib/components/SourceLink.js.map +1 -1
  130. package/lib/components/Type.d.ts +12 -0
  131. package/lib/components/Type.d.ts.map +1 -0
  132. package/lib/components/Type.js +142 -464
  133. package/lib/components/Type.js.map +1 -1
  134. package/lib/components/TypeAndParent.d.ts +6 -0
  135. package/lib/components/TypeAndParent.d.ts.map +1 -0
  136. package/lib/components/TypeAndParent.js +11 -27
  137. package/lib/components/TypeAndParent.js.map +1 -1
  138. package/lib/components/TypeParameters.d.ts +6 -0
  139. package/lib/components/TypeParameters.d.ts.map +1 -0
  140. package/lib/components/TypeParameters.js +10 -38
  141. package/lib/components/TypeParameters.js.map +1 -1
  142. package/lib/components/TypeParametersGeneric.d.ts +6 -0
  143. package/lib/components/TypeParametersGeneric.d.ts.map +1 -0
  144. package/lib/components/TypeParametersGeneric.js +8 -27
  145. package/lib/components/TypeParametersGeneric.js.map +1 -1
  146. package/lib/components/VersionBanner.d.ts +2 -0
  147. package/lib/components/VersionBanner.d.ts.map +1 -0
  148. package/lib/components/VersionBanner.js +18 -49
  149. package/lib/components/VersionBanner.js.map +1 -1
  150. package/lib/hooks/useBreadcrumbs.d.ts +2 -0
  151. package/lib/hooks/useBreadcrumbs.d.ts.map +1 -0
  152. package/lib/hooks/useBreadcrumbs.js +5 -8
  153. package/lib/hooks/useBreadcrumbs.js.map +1 -1
  154. package/lib/hooks/useGitRefName.d.ts +2 -0
  155. package/lib/hooks/useGitRefName.d.ts.map +1 -0
  156. package/lib/hooks/useGitRefName.js +5 -8
  157. package/lib/hooks/useGitRefName.js.map +1 -1
  158. package/lib/hooks/useMinimalLayout.d.ts +2 -0
  159. package/lib/hooks/useMinimalLayout.d.ts.map +1 -0
  160. package/lib/hooks/useMinimalLayout.js +5 -8
  161. package/lib/hooks/useMinimalLayout.js.map +1 -1
  162. package/lib/hooks/useReflection.d.ts +4 -0
  163. package/lib/hooks/useReflection.d.ts.map +1 -0
  164. package/lib/hooks/useReflection.js +15 -21
  165. package/lib/hooks/useReflection.js.map +1 -1
  166. package/lib/hooks/useReflectionMap.d.ts +3 -0
  167. package/lib/hooks/useReflectionMap.d.ts.map +1 -0
  168. package/lib/hooks/useReflectionMap.js +5 -8
  169. package/lib/hooks/useReflectionMap.js.map +1 -1
  170. package/lib/index.d.ts +4 -0
  171. package/lib/index.d.ts.map +1 -0
  172. package/lib/index.js +349 -361
  173. package/lib/index.js.map +1 -1
  174. package/lib/markdownLoader.d.ts +6 -0
  175. package/lib/markdownLoader.d.ts.map +1 -0
  176. package/lib/markdownLoader.js +6 -10
  177. package/lib/markdownLoader.js.map +1 -1
  178. package/lib/plugin/data.d.ts +21 -0
  179. package/lib/plugin/data.d.ts.map +1 -0
  180. package/lib/plugin/data.js +391 -429
  181. package/lib/plugin/data.js.map +1 -1
  182. package/lib/plugin/python/consts.d.ts +35 -0
  183. package/lib/plugin/python/consts.d.ts.map +1 -0
  184. package/lib/plugin/python/consts.js +44 -44
  185. package/lib/plugin/python/consts.js.map +1 -1
  186. package/lib/plugin/python/index.d.ts +12 -0
  187. package/lib/plugin/python/index.d.ts.map +1 -0
  188. package/lib/plugin/python/index.js +25 -36
  189. package/lib/plugin/python/index.js.map +1 -1
  190. package/lib/plugin/python/inheritance.d.ts +42 -0
  191. package/lib/plugin/python/inheritance.d.ts.map +1 -0
  192. package/lib/plugin/python/inheritance.js +148 -153
  193. package/lib/plugin/python/inheritance.js.map +1 -1
  194. package/lib/plugin/python/packageVersions.d.ts +7 -0
  195. package/lib/plugin/python/packageVersions.d.ts.map +1 -0
  196. package/lib/plugin/python/packageVersions.js +30 -38
  197. package/lib/plugin/python/packageVersions.js.map +1 -1
  198. package/lib/plugin/python/transformation.d.ts +90 -0
  199. package/lib/plugin/python/transformation.d.ts.map +1 -0
  200. package/lib/plugin/python/transformation.js +424 -391
  201. package/lib/plugin/python/transformation.js.map +1 -1
  202. package/lib/plugin/python/type-parsing/index.d.ts +34 -0
  203. package/lib/plugin/python/type-parsing/index.d.ts.map +1 -0
  204. package/lib/plugin/python/type-parsing/index.js +78 -85
  205. package/lib/plugin/python/type-parsing/index.js.map +1 -1
  206. package/lib/plugin/python/types.d.ts +107 -0
  207. package/lib/plugin/python/types.d.ts.map +1 -0
  208. package/lib/plugin/python/types.js +2 -2
  209. package/lib/plugin/python/types.js.map +1 -1
  210. package/lib/plugin/python/utils.d.ts +40 -0
  211. package/lib/plugin/python/utils.d.ts.map +1 -0
  212. package/lib/plugin/python/utils.js +74 -73
  213. package/lib/plugin/python/utils.js.map +1 -1
  214. package/lib/plugin/sidebar.d.ts +6 -0
  215. package/lib/plugin/sidebar.d.ts.map +1 -0
  216. package/lib/plugin/sidebar.js +94 -96
  217. package/lib/plugin/sidebar.js.map +1 -1
  218. package/lib/plugin/structure/0.23.d.ts +3 -0
  219. package/lib/plugin/structure/0.23.d.ts.map +1 -0
  220. package/lib/plugin/structure/0.23.js +33 -41
  221. package/lib/plugin/structure/0.23.js.map +1 -1
  222. package/lib/plugin/url.d.ts +6 -0
  223. package/lib/plugin/url.d.ts.map +1 -0
  224. package/lib/plugin/url.js +36 -46
  225. package/lib/plugin/url.js.map +1 -1
  226. package/lib/plugin/version.d.ts +5 -0
  227. package/lib/plugin/version.d.ts.map +1 -0
  228. package/lib/plugin/version.js +73 -78
  229. package/lib/plugin/version.js.map +1 -1
  230. package/lib/types.d.ts +142 -0
  231. package/lib/types.d.ts.map +1 -0
  232. package/lib/types.js +2 -2
  233. package/lib/types.js.map +1 -1
  234. package/lib/utils/helpers.d.ts +2 -0
  235. package/lib/utils/helpers.d.ts.map +1 -0
  236. package/lib/utils/helpers.js +5 -7
  237. package/lib/utils/helpers.js.map +1 -1
  238. package/lib/utils/hierarchy.d.ts +8 -0
  239. package/lib/utils/hierarchy.d.ts.map +1 -0
  240. package/lib/utils/hierarchy.js +31 -33
  241. package/lib/utils/hierarchy.js.map +1 -1
  242. package/lib/utils/icons.d.ts +5 -0
  243. package/lib/utils/icons.d.ts.map +1 -0
  244. package/lib/utils/icons.js +82 -114
  245. package/lib/utils/icons.js.map +1 -1
  246. package/lib/utils/links.d.ts +2 -0
  247. package/lib/utils/links.d.ts.map +1 -0
  248. package/lib/utils/links.js +24 -41
  249. package/lib/utils/links.js.map +1 -1
  250. package/lib/utils/markdown.d.ts +4 -0
  251. package/lib/utils/markdown.d.ts.map +1 -0
  252. package/lib/utils/markdown.js +45 -54
  253. package/lib/utils/markdown.js.map +1 -1
  254. package/lib/utils/reexports.d.ts +5 -0
  255. package/lib/utils/reexports.d.ts.map +1 -0
  256. package/lib/utils/reexports.js +90 -90
  257. package/lib/utils/reexports.js.map +1 -1
  258. package/lib/utils/removeScopes.d.ts +2 -0
  259. package/lib/utils/removeScopes.d.ts.map +1 -0
  260. package/lib/utils/removeScopes.js +7 -0
  261. package/lib/utils/removeScopes.js.map +1 -0
  262. package/lib/utils/visibility.d.ts +6 -0
  263. package/lib/utils/visibility.d.ts.map +1 -0
  264. package/lib/utils/visibility.js +14 -19
  265. package/lib/utils/visibility.js.map +1 -1
  266. package/package.json +29 -17
  267. package/python-scripts/docspec-gen/google_docstring_processor.py +54 -20
  268. package/src/components/ApiIndex.tsx +1 -1
  269. package/src/index.ts +2 -2
  270. package/src/plugin/data.ts +3 -3
  271. package/src/plugin/python/index.ts +3 -3
  272. package/src/plugin/python/packageVersions.ts +3 -3
  273. package/src/plugin/python/transformation.ts +89 -15
  274. package/src/plugin/python/types.ts +3 -4
  275. package/src/plugin/sidebar.ts +1 -1
  276. package/src/plugin/url.ts +1 -1
  277. package/src/plugin/version.ts +1 -1
  278. package/src/utils/links.ts +1 -12
  279. package/src/utils/removeScopes.ts +10 -0
  280. /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
- * TODO
452
- * This structure is created in the `google` docstring format, which is a JSON object with the following structure:
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
- docstring.text = parsedDocstring.text;
461
- const parsedArguments = (parsedDocstring.sections?.find(
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
- docstring.args =
466
- parsedArguments?.reduce<Record<string, string>>((acc, arg) => {
467
- acc[arg.param] = arg.desc;
468
- return acc;
469
- }, {}) ?? {};
470
-
471
- const returnTypes =
472
- docstring.sections?.find((section) => Object.keys(section)[0] === 'Returns')?.Returns ?? [];
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.returns = returnTypes.join('\n');
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
- text: string;
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 =
@@ -7,7 +7,7 @@ import type {
7
7
  TSDDeclarationReflection,
8
8
  TSDDeclarationReflectionMap,
9
9
  } from '../types';
10
- import { removeScopes } from '../utils/links';
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
@@ -1,4 +1,4 @@
1
- import path from 'path';
1
+ import path from 'node:path';
2
2
  import { JSONOutput, ReflectionKind } from 'typedoc';
3
3
  import type { ResolvedPackageConfig } from '../types';
4
4
 
@@ -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,
@@ -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
 
@@ -0,0 +1,10 @@
1
+ export function removeScopes(text: string, scopes: string[]): string {
2
+ if (scopes.length === 0) {
3
+ return text;
4
+ }
5
+
6
+ return scopes.reduce(
7
+ (value, scope) => value.replace(new RegExp(`^(${scope}-|@${scope}/)`), ''),
8
+ text,
9
+ );
10
+ }