@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
@@ -1,103 +1,103 @@
1
- 'use strict';
2
-
3
- const cheerio = require('cheerio');
4
- const fs = require('node:fs');
5
- const _interopDefault = e => e && e.__esModule ? e : {
6
- default: e
7
- };
8
- const fs__default = /*#__PURE__*/_interopDefault(fs);
9
-
10
1
  /* eslint-disable */
11
2
  // @ts-nocheck
12
-
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ import { load } from "cheerio";
13
+ import fs from "fs";
13
14
  function decodeBase64UTF8(base64) {
14
- const binString = atob(base64);
15
- const bytes = Uint8Array.from(binString, m => m.codePointAt(0));
16
- return new TextDecoder('utf8').decode(bytes);
15
+ const binString = atob(base64);
16
+ const bytes = Uint8Array.from(binString, (m) => m.codePointAt(0));
17
+ return new TextDecoder('utf8').decode(bytes);
17
18
  }
18
- async function loadExternalApiItem(url) {
19
- console.log(`Loading external API item from ${url}...`);
20
- const response = await fetch(url);
21
- const $ = cheerio.load(await response.text(), {
22
- decodeEntities: false
23
- });
24
- const base64encoded = $('script[type="application/typedoc-data;base64"]')?.first()?.text();
25
- if (!base64encoded) return null;
26
- const jsonData = decodeBase64UTF8(base64encoded);
27
- return JSON.parse(jsonData);
19
+ function loadExternalApiItem(url) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ var _a, _b;
22
+ console.log(`Loading external API item from ${url}...`);
23
+ const response = yield fetch(url);
24
+ const $ = load(yield response.text(), { decodeEntities: false });
25
+ const base64encoded = (_b = (_a = $('script[type="application/typedoc-data;base64"]')) === null || _a === void 0 ? void 0 : _a.first()) === null || _b === void 0 ? void 0 : _b.text();
26
+ if (!base64encoded)
27
+ return null;
28
+ const jsonData = decodeBase64UTF8(base64encoded);
29
+ return JSON.parse(jsonData);
30
+ });
28
31
  }
29
-
30
32
  // Recursively find the maximum numerical `id` property in a JS object
31
33
  function getMaxId(obj) {
32
- let maxId = 0;
33
- for (const key in obj) {
34
- if (typeof obj[key] === 'object') {
35
- maxId = Math.max(maxId, getMaxId(obj[key]));
36
- } else if (key === 'id') {
37
- if (Number.isInteger(obj[key])) {
38
- maxId = Math.max(maxId, obj[key]);
39
- }
34
+ let maxId = 0;
35
+ for (const key in obj) {
36
+ if (typeof obj[key] === 'object') {
37
+ maxId = Math.max(maxId, getMaxId(obj[key]));
38
+ }
39
+ else if (key === 'id') {
40
+ if (Number.isInteger(obj[key])) {
41
+ maxId = Math.max(maxId, obj[key]);
42
+ }
43
+ }
40
44
  }
41
- }
42
- return maxId;
45
+ return maxId;
43
46
  }
44
47
  function incrementIds(obj, increment) {
45
- let max = 0;
46
- for (const key in obj) {
47
- if (key === 'children' && Array.isArray(obj[key]) && obj[key].every(c => typeof c === 'number')) {
48
- obj[key] = obj[key].map(c => c + increment);
49
- max = Math.max(max, ...obj[key]);
50
- } else if (key === 'id' && Number.isInteger(obj[key])) {
51
- obj[key] += increment;
52
- max = Math.max(obj[key], max);
53
- } else if (obj[key] && typeof obj[key] === 'object') {
54
- max = Math.max(incrementIds(obj[key], increment), max);
48
+ let max = 0;
49
+ for (const key in obj) {
50
+ if (key === 'children' && Array.isArray(obj[key]) && obj[key].every((c) => typeof c === 'number')) {
51
+ obj[key] = obj[key].map((c) => c + increment);
52
+ max = Math.max(max, ...obj[key]);
53
+ }
54
+ else if (key === 'id' && Number.isInteger(obj[key])) {
55
+ obj[key] += increment;
56
+ max = Math.max(obj[key], max);
57
+ }
58
+ else if (obj[key] && typeof obj[key] === 'object') {
59
+ max = Math.max(incrementIds(obj[key], increment), max);
60
+ }
55
61
  }
56
- }
57
- return max;
62
+ return max;
58
63
  }
59
- async function injectReexports(typedocJsonFilePath, reexports) {
60
- const typedocJson = JSON.parse(fs__default.default.readFileSync(typedocJsonFilePath, 'utf8'));
61
- let baseId = getMaxId(typedocJson);
62
- const externalApiItems = await Promise.all(reexports.map(async ({
63
- url,
64
- group
65
- }) => ({
66
- externalItem: await loadExternalApiItem(url),
67
- customGroup: group
68
- })));
69
- for (const _ref of externalApiItems) {
70
- const externalItem = _ref.externalItem;
71
- const customGroup = _ref.customGroup;
72
- if (!externalItem) continue;
73
- let item = externalItem.item,
74
- groups = externalItem.groups;
75
-
76
- // Make sure the new item doesn't have any conflicting IDs
77
- baseId = incrementIds(item, baseId);
78
-
79
- // Add the new item to the root children
80
- typedocJson.children.push(item);
81
- if (customGroup) {
82
- groups = [customGroup];
83
- } else if (groups.length === 0) {
84
- groups = ['Reexports'];
85
- }
86
- for (const groupName of groups) {
87
- // Assign the new item into the specified groups
88
- const reexportsGroup = typedocJson.groups.find(g => g.title === groupName);
89
- if (reexportsGroup) {
90
- reexportsGroup.children.push(item.id);
91
- } else {
92
- typedocJson.groups.push({
93
- title: groupName,
94
- children: [item.id]
95
- });
96
- }
97
- }
98
- console.log(`Reexported item ${item.name} from ${item.sources[0].fileName} to ${groups.join(', ')}`);
99
- }
100
- fs__default.default.writeFileSync(typedocJsonFilePath, JSON.stringify(typedocJson, null, 4));
64
+ export function injectReexports(typedocJsonFilePath, reexports) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ const typedocJson = JSON.parse(fs.readFileSync(typedocJsonFilePath, 'utf8'));
67
+ let baseId = getMaxId(typedocJson);
68
+ const externalApiItems = yield Promise.all(reexports.map((_a) => __awaiter(this, [_a], void 0, function* ({ url, group }) {
69
+ return ({
70
+ externalItem: yield loadExternalApiItem(url),
71
+ customGroup: group,
72
+ });
73
+ })));
74
+ for (const { externalItem, customGroup } of externalApiItems) {
75
+ if (!externalItem)
76
+ continue;
77
+ let { item, groups } = externalItem;
78
+ // Make sure the new item doesn't have any conflicting IDs
79
+ baseId = incrementIds(item, baseId);
80
+ // Add the new item to the root children
81
+ typedocJson.children.push(item);
82
+ if (customGroup) {
83
+ groups = [customGroup];
84
+ }
85
+ else if (groups.length === 0) {
86
+ groups = ['Reexports'];
87
+ }
88
+ for (const groupName of groups) {
89
+ // Assign the new item into the specified groups
90
+ const reexportsGroup = typedocJson.groups.find(g => g.title === groupName);
91
+ if (reexportsGroup) {
92
+ reexportsGroup.children.push(item.id);
93
+ }
94
+ else {
95
+ typedocJson.groups.push({ title: groupName, children: [item.id] });
96
+ }
97
+ }
98
+ console.log(`Reexported item ${item.name} from ${item.sources[0].fileName} to ${groups.join(', ')}`);
99
+ }
100
+ fs.writeFileSync(typedocJsonFilePath, JSON.stringify(typedocJson, null, 4));
101
+ });
101
102
  }
102
- exports.injectReexports = injectReexports;
103
- //# sourceMappingURL=reexports.js.map
103
+ //# sourceMappingURL=reexports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reexports.js","sources":["../../src/utils/reexports.ts"],"sourcesContent":null,"names":["load","fs"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AAGA,SAAS,gBAAgB,CAAC,MAAM,EAAE;AAClC,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;AACjC,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,EAAE,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC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;YAED,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,CAAC,IAAI,SAAS,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzG,CAAC;QAED,EAAE,CAAC,aAAa,CAAC,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC;CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function removeScopes(text: string, scopes: string[]): string;
2
+ //# sourceMappingURL=removeScopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeScopes.d.ts","sourceRoot":"","sources":["../../src/utils/removeScopes.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CASnE"}
@@ -0,0 +1,7 @@
1
+ export function removeScopes(text, scopes) {
2
+ if (scopes.length === 0) {
3
+ return text;
4
+ }
5
+ return scopes.reduce((value, scope) => value.replace(new RegExp(`^(${scope}-|@${scope}/)`), ''), text);
6
+ }
7
+ //# sourceMappingURL=removeScopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeScopes.js","sourceRoot":"","sources":["../../src/utils/removeScopes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,MAAgB;IAC1D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CACnB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,KAAK,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC,EAC1E,IAAI,CACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { JSONOutput } from 'typedoc';
2
+ import type { TSDDeclarationReflectionMap } from '../types';
3
+ export declare function hasOwnDocument(id: number, reflections: TSDDeclarationReflectionMap): boolean;
4
+ export declare function allCategoryChildrenHaveOwnDocument(category: JSONOutput.ReflectionCategory, reflections: TSDDeclarationReflectionMap): boolean;
5
+ export declare function allGroupChildrenHaveOwnDocument(group: JSONOutput.ReflectionGroup, reflections: TSDDeclarationReflectionMap): boolean;
6
+ //# sourceMappingURL=visibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../src/utils/visibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAG5D,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,2BAA2B,GAAG,OAAO,CAI5F;AAGD,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,UAAU,CAAC,kBAAkB,EACvC,WAAW,EAAE,2BAA2B,GACtC,OAAO,CAQT;AAGD,wBAAgB,+BAA+B,CAC9C,KAAK,EAAE,UAAU,CAAC,eAAe,EACjC,WAAW,EAAE,2BAA2B,GACtC,OAAO,CAET"}
@@ -1,25 +1,20 @@
1
- 'use strict';
2
-
3
1
  // https://github.com/TypeStrong/typedoc/blob/master/src/lib/output/themes/DefaultTheme.ts#L264
4
- function hasOwnDocument(id, reflections) {
5
- const reflection = reflections[id];
6
- return Boolean(reflection?.permalink && !reflection.permalink.includes('#'));
2
+ export function hasOwnDocument(id, reflections) {
3
+ const reflection = reflections[id];
4
+ return Boolean((reflection === null || reflection === void 0 ? void 0 : reflection.permalink) && !reflection.permalink.includes('#'));
7
5
  }
8
-
9
6
  // https://github.com/TypeStrong/typedoc/blob/2103f347c9cba40fcaa1f67e36f7cea0bdea2f0f/src/lib/models/ReflectionCategory.ts#L44
10
- function allCategoryChildrenHaveOwnDocument(category, reflections) {
11
- let onlyOwnDocuments = true;
12
- category.children?.forEach(child => {
13
- onlyOwnDocuments &&= hasOwnDocument(child, reflections);
14
- });
15
- return onlyOwnDocuments;
7
+ export function allCategoryChildrenHaveOwnDocument(category, reflections) {
8
+ var _a;
9
+ let onlyOwnDocuments = true;
10
+ (_a = category.children) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
11
+ onlyOwnDocuments && (onlyOwnDocuments = hasOwnDocument(child, reflections));
12
+ });
13
+ return onlyOwnDocuments;
16
14
  }
17
-
18
15
  // https://github.com/TypeStrong/typedoc/blob/2103f347c9cba40fcaa1f67e36f7cea0bdea2f0f/src/lib/models/ReflectionGroup.ts#L81
19
- function allGroupChildrenHaveOwnDocument(group, reflections) {
20
- return Boolean(group.children?.every(child => hasOwnDocument(child, reflections)));
16
+ export function allGroupChildrenHaveOwnDocument(group, reflections) {
17
+ var _a;
18
+ return Boolean((_a = group.children) === null || _a === void 0 ? void 0 : _a.every((child) => hasOwnDocument(child, reflections)));
21
19
  }
22
- exports.allCategoryChildrenHaveOwnDocument = allCategoryChildrenHaveOwnDocument;
23
- exports.allGroupChildrenHaveOwnDocument = allGroupChildrenHaveOwnDocument;
24
- exports.hasOwnDocument = hasOwnDocument;
25
- //# sourceMappingURL=visibility.js.map
20
+ //# sourceMappingURL=visibility.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"visibility.js","sources":["../../src/utils/visibility.ts"],"sourcesContent":null,"names":[],"mappings":";;AAAA;AACO,SAAS,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE;AAChD,EAAE,MAAM,UAAU,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;AACrC,EAAE,OAAO,OAAO,CAAC,UAAU,EAAE,SAAS,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/E,CAAC;AACD;AACA;AACO,SAAS,kCAAkC,CAAC,QAA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AO,OAAO,CAAC,MAAA,KAAK,CAAC,QAAQ,0CAAE,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@apify/docusaurus-plugin-typedoc-api",
3
- "version": "4.4.12",
4
- "description": "Docusaurus plugin that provides source code API documentation powered by TypeDoc. ",
3
+ "version": "5.1.0",
4
+ "description": "Docusaurus plugin that provides source code API documentation powered by TypeDoc.",
5
+ "workspaces": [
6
+ "playground/website"
7
+ ],
5
8
  "keywords": [
6
9
  "docusaurus",
7
10
  "plugin",
@@ -17,25 +20,21 @@
17
20
  "main": "./lib/index.js",
18
21
  "types": "./lib/index.d.ts",
19
22
  "files": [
20
- "assets/**/*",
21
23
  "lib/**/*",
22
24
  "python-scripts/**/*",
23
- "src/**/*",
24
- "styles.css"
25
+ "src/**/*"
25
26
  ],
26
27
  "engines": {
27
28
  "node": ">=16.12.0"
28
29
  },
29
- "packemon": {
30
- "format": "lib",
31
- "platform": "node",
32
- "externals": [
33
- "@theme/*",
34
- "@docusaurus/*",
35
- "@vscode/*",
36
- "css$",
37
- "cheerio*"
38
- ]
30
+ "scripts": {
31
+ "clean": "rimraf lib",
32
+ "build": "yarn clean && tsc -p tsconfig.build.json && cp src/components/styles.css lib/components/",
33
+ "check": "yarn type && yarn lint",
34
+ "type": "tsc --noEmit",
35
+ "lint": "eslint --cache --color --fix --ext .ts,.tsx src/",
36
+ "format": "prettier --write .",
37
+ "release": "yarn build && yarn check && npm publish"
39
38
  },
40
39
  "peerDependencies": {
41
40
  "@docusaurus/core": "^3.8.1",
@@ -50,7 +49,9 @@
50
49
  "typescript": "^5.0.0"
51
50
  },
52
51
  "dependencies": {
52
+ "@docusaurus/theme-common": "^3.9.2",
53
53
  "@vscode/codicons": "^0.0.35",
54
+ "cheerio": "^1.2.0",
54
55
  "html-entities": "2.3.2",
55
56
  "marked": "^9.1.6",
56
57
  "marked-smartypants": "^1.1.5",
@@ -58,13 +59,24 @@
58
59
  "zx": "^8.1.4"
59
60
  },
60
61
  "devDependencies": {
62
+ "@docusaurus/mdx-loader": "^3.9.2",
61
63
  "@docusaurus/module-type-aliases": "^3.8.1",
62
64
  "@docusaurus/plugin-content-docs": "^3.8.1",
65
+ "@docusaurus/preset-classic": "^3.9.2",
66
+ "@docusaurus/theme-classic": "^3.9.2",
63
67
  "@docusaurus/tsconfig": "^3.8.1",
64
68
  "@docusaurus/types": "^3.8.1",
65
69
  "@docusaurus/utils": "^3.8.1",
70
+ "@types/marked": "^6.0.0",
71
+ "@types/react": "^18.3.3",
72
+ "eslint": "^8.56.0",
73
+ "eslint-config-moon": "^2.0.14",
74
+ "prettier": "^3.3.3",
75
+ "prettier-config-moon": "^1.1.2",
66
76
  "react": "^18.2.0",
67
77
  "react-dom": "^18.2.0",
68
- "typescript": "^5.3.3"
69
- }
78
+ "rimraf": "^5.0.5",
79
+ "typescript": "^5.5.4"
80
+ },
81
+ "packageManager": "yarn@4.9.2"
70
82
  }
@@ -95,8 +95,6 @@ class ApifyGoogleProcessor(Processor):
95
95
  "Keyword Args:": "Arguments",
96
96
  "Keyword Arguments:": "Arguments",
97
97
  "Methods:": "Methods",
98
- "Note:": "Notes",
99
- "Notes:": "Notes",
100
98
  "Other Parameters:": "Arguments",
101
99
  "Parameters:": "Arguments",
102
100
  "Return:": "Returns",
@@ -105,8 +103,11 @@ class ApifyGoogleProcessor(Processor):
105
103
  "References:": "References",
106
104
  "See Also:": "See Also",
107
105
  "Todo:": "Todo",
108
- "Warning:": "Warnings",
109
- "Warnings:": "Warnings",
106
+ "Note:": "Note",
107
+ "Tip:": "Tip",
108
+ "Info:": "Info",
109
+ "Warning:": "Warning",
110
+ "Danger:": "Danger",
110
111
  "Warns:": "Warns",
111
112
  "Yield:": "Yields",
112
113
  "Yields:": "Yields",
@@ -128,69 +129,102 @@ class ApifyGoogleProcessor(Processor):
128
129
  if not node.docstring:
129
130
  return
130
131
 
131
- lines = []
132
- sections = []
133
- current_lines: t.List[str] = []
132
+ content = [] # Interleaved list of text strings and section dicts
133
+ current_text_lines: t.List[str] = []
134
+ current_section_lines: t.List[str] = []
134
135
  in_codeblock = False
135
136
  keyword = None
137
+ keyword_indent = None
136
138
  multiline_argument_offset = -1
137
139
  state = { 'param_indent': None }
138
140
 
141
+ def _commit_text():
142
+ """Commit accumulated text lines to content."""
143
+ if current_text_lines:
144
+ text = "\n".join(current_text_lines)
145
+ if text.strip():
146
+ content.append(text)
147
+ current_text_lines.clear()
148
+
149
+ def _commit_section():
150
+ """Commit accumulated section to content."""
151
+ nonlocal keyword, keyword_indent
152
+ if keyword:
153
+ content.append({keyword: list(current_section_lines)})
154
+ current_section_lines.clear()
155
+ keyword = None
156
+ keyword_indent = None
157
+
139
158
  def _commit():
159
+ nonlocal keyword, keyword_indent
140
160
  if keyword:
141
- sections.append({keyword: list(current_lines)})
161
+ _commit_section()
142
162
  else:
143
- lines.extend(current_lines)
144
- current_lines.clear()
163
+ _commit_text()
145
164
 
146
165
  def is_continuation(line: str) -> bool:
147
166
  if state.get('param_indent') is None:
148
167
  state['param_indent'] = self.get_indent_size(line)
149
168
  return False
150
-
169
+
151
170
  return self.get_indent_size(line) > state.get('param_indent')
152
171
 
153
172
  for line in node.docstring.content.split("\n"):
154
173
  multiline_argument_offset += 1
155
174
  if line.lstrip().startswith("```"):
156
175
  in_codeblock = not in_codeblock
157
- current_lines.append(line)
176
+ if keyword:
177
+ current_section_lines.append(line)
178
+ else:
179
+ current_text_lines.append(line)
158
180
  if not in_codeblock:
159
181
  _commit()
160
182
  continue
161
183
 
162
184
  if in_codeblock:
163
- current_lines.append(line)
185
+ if keyword:
186
+ current_section_lines.append(line)
187
+ else:
188
+ current_text_lines.append(line)
164
189
  continue
165
190
 
166
191
  stripped = line.strip()
192
+ line_indent = self.get_indent_size(line)
193
+
167
194
  if stripped in self._keywords_map:
168
195
  _commit()
169
196
  keyword = self._keywords_map[stripped]
197
+ keyword_indent = line_indent
198
+ continue
199
+
200
+ # Check if we've exited the current section (line at same or less indent than keyword)
201
+ if keyword is not None and stripped and line_indent <= keyword_indent:
202
+ _commit()
203
+ # Process this line as regular text
204
+ current_text_lines.append(stripped)
170
205
  continue
171
206
 
172
207
  if keyword is None:
173
- lines.append(stripped)
208
+ current_text_lines.append(stripped)
174
209
  continue
175
210
 
176
211
  for param_re in self._param_res:
177
212
  param_match = param_re.match(stripped)
178
213
  if param_match and not is_continuation(line):
179
- current_lines.append(param_match.groupdict())
214
+ current_section_lines.append(param_match.groupdict())
180
215
  multiline_argument_offset = 0
181
216
  break
182
217
 
183
218
  if not param_match:
184
219
  if multiline_argument_offset == 1:
185
- current_lines[-1]["desc"] += "\n" + stripped
220
+ current_section_lines[-1]["desc"] += "\n" + stripped
186
221
  multiline_argument_offset = 0
187
222
  else:
188
- current_lines.append(stripped)
223
+ current_section_lines.append(stripped)
189
224
 
190
225
  _commit()
191
226
  node.docstring.content = json.dumps({
192
- "text": "\n".join(lines),
193
- "sections": sections,
227
+ "content": content,
194
228
  }, indent=None)
195
-
229
+
196
230
 
@@ -7,7 +7,7 @@ import type * as Preset from '@docusaurus/preset-classic';
7
7
  import type { Props as DocItemProps } from '@theme/DocItem';
8
8
  import Heading from '@theme/Heading';
9
9
  import type { ApiOptions, PackageReflectionGroup } from '../types';
10
- import { removeScopes } from '../utils/links';
10
+ import { removeScopes } from '../utils/removeScopes';
11
11
  import { VersionBanner } from './VersionBanner';
12
12
 
13
13
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-console, sort-keys */
2
2
 
3
- import fs from 'fs';
4
- import path from 'path';
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
5
  import type { Options as MDXLoaderOptions } from '@docusaurus/mdx-loader';
6
6
  import type { PropVersionDocs, PropVersionMetadata } from '@docusaurus/plugin-content-docs';
7
7
  import { CURRENT_VERSION_NAME } from '@docusaurus/plugin-content-docs/server';
@@ -1,6 +1,6 @@
1
- import { spawnSync } from 'child_process';
2
- import fs from 'fs';
3
- import path from 'path';
1
+ import { spawnSync } from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
4
  import * as TypeDoc from 'typedoc';
5
5
  import { type InlineTagDisplayPart, type JSONOutput, ReflectionKind } from 'typedoc';
6
6
  import ts from 'typescript';
@@ -1,6 +1,6 @@
1
- import childProcess from 'child_process';
2
- import fs from 'fs';
3
- import path from 'path';
1
+ import childProcess from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
4
  import { DocspecTransformer } from './transformation';
5
5
  import type { DocspecObject } from './types';
6
6
 
@@ -1,6 +1,6 @@
1
- import childProcess from 'child_process';
2
- import fs from 'fs';
3
- import path from 'path';
1
+ import childProcess from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
4
 
5
5
  /**
6
6
  * Looks for the installed versions of the given packages and returns them as a dictionary.