@apify/docusaurus-plugin-typedoc-api 4.4.12 → 5.0.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 (277) 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 +80 -0
  199. package/lib/plugin/python/transformation.d.ts.map +1 -0
  200. package/lib/plugin/python/transformation.js +350 -392
  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 +112 -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 +24 -17
  267. package/src/components/ApiIndex.tsx +1 -1
  268. package/src/index.ts +2 -2
  269. package/src/plugin/data.ts +3 -3
  270. package/src/plugin/python/index.ts +3 -3
  271. package/src/plugin/python/packageVersions.ts +3 -3
  272. package/src/plugin/sidebar.ts +1 -1
  273. package/src/plugin/url.ts +1 -1
  274. package/src/plugin/version.ts +1 -1
  275. package/src/utils/links.ts +1 -12
  276. package/src/utils/removeScopes.ts +10 -0
  277. /package/{assets/styles-8ad572ec.css → lib/components/styles.css} +0 -0
package/README.md CHANGED
@@ -1,312 +1,54 @@
1
- # docusaurus-plugin-typedoc-api
1
+ # Apify's fork of `docusaurus-plugin-typedoc-api`
2
2
 
3
- [![Build Status](https://travis-ci.org/milesj/docusaurus-plugin-typedoc-api.svg?branch=master)](https://travis-ci.org/milesj/docusaurus-plugin-typedoc-api)
4
- [![npm version](https://badge.fury.io/js/docusaurus-plugin-typedoc-api.svg)](https://www.npmjs.com/package/docusaurus-plugin-typedoc-api)
5
- [![npm deps](https://david-dm.org/milesj/docusaurus-plugin-typedoc-api.svg?path=packages/plugin)](https://www.npmjs.com/package/docusaurus-plugin-typedoc-api)
6
-
7
- A Docusaurus plugin for generating source code `/api/*` routes, powered by
8
- [TypeDoc](https://typedoc.org/).
9
-
10
- The plugin has been designed to document your public API by default (anything exported from a
11
- package's entry point), so any private, protected, or internal code will not be generated.
12
-
13
- ## Requirements
14
-
15
- - `typescript` >= v4
16
- - `@docusaurus/core` >= v2.0.0
17
- - `@docusaurus/preset-classic` >= v2.0.0
18
-
19
- ## Examples
20
-
21
- - [Boost](https://github.com/milesj/boost) - https://boostlib.dev/api
22
-
23
- ## Installation
24
-
25
- ```
26
- yarn add --dev docusaurus-plugin-typedoc-api
27
- ```
28
-
29
- Open your `docusaurus.config.js` and make the following changes:
30
-
31
- - Add a link to the API route under `themeConfig.navbar.items` and `themeConfig.footer.links` (if
32
- desired).
33
-
34
- ```js
35
- module.exports = {
36
- // ...
37
- themeConfig: {
38
- // ...
39
- navbar: {
40
- // ...
41
- items: [
42
- // ...
43
- {
44
- to: 'api',
45
- label: 'API',
46
- position: 'left',
47
- },
48
- ],
49
- },
50
- },
51
- };
52
- ```
53
-
54
- - Configure the plugin in your `plugins` list. The `projectRoot` and `packages` options are
55
- required.
56
-
57
- ```js
58
- module.exports = {
59
- // ...
60
- plugins: [
61
- [
62
- 'docusaurus-plugin-typedoc-api',
63
- {
64
- projectRoot: path.join(__dirname, '..'),
65
- // Monorepo
66
- packages: ['packages/example', 'packages/other'],
67
- // Polyrepo
68
- packages: ['.'],
69
- },
70
- ],
71
- ],
72
- };
73
- ```
74
-
75
- ## Configuration
76
-
77
- The following options are available to the plugin:
78
-
79
- - `projectRoot` (`string`) - Absolute path to the project root where `tsconfig.json` is located.
80
- _(Required)_
81
- - `packages` (`(string | PackageConfig)[]`) - List of packages relative to the project root.
82
- _(Required)_
83
- - `banner` (`string`) - Banner message to display at the top of the index page. Supports HTML.
84
- - `changelogName` (`string`) - Name of the changelog file within a package. Defaults to
85
- `CHANGELOG.md`.
86
- - `changelogs` (`boolean`) - Include and render the changelog file from every package. Defaults to
87
- `false`.
88
- - `exclude` (`string[]`) - List of glob patterns to exclude unwanted packages. This is necessary
89
- when using TypeScript project references.
90
- - `gitRefName` (`string`) - GitHub repository ref name to point the API links to. Defaults to
91
- `master`.
92
- - `minimal` (`boolean`) - Render a minimal layout and reduce the amount of information displayed.
93
- Defaults to `false`.
94
- - `packageJsonName` (`string`) - Name of the `package.json file`. Defaults to `package.json`.
95
- - `readmeName` (`string`) - Name of the readme file within a package. Defaults to `README.md`.
96
- - `readmes` (`boolean`) - Include and render the readme file from every package. Defaults to
97
- `false`.
98
- - `rehypePlugins` (`MDXPlugin[]`) - List of rehype plugins to use for
99
- [MDX compilation](https://mdxjs.com/docs/extending-mdx).
100
- - `remarkPlugins` (`MDXPlugin[]`) - List of remark plugins to use for
101
- [MDX compilation](https://mdxjs.com/docs/extending-mdx).
102
- - `removeScopes` (`string[]`) - Package scopes and prefixes to remove when displaying the package
103
- name in the sidebar and index. For example, `boost` will remove `@boost/` and `boost-`.
104
- - `sortPackages` (`(a, d) => number`) - Function to sort the package list in the sidebar and on the
105
- index page. Defaults to alphabetical.
106
- - `sortSidebar` (`(a, d) => number`) - Function to sort the categories and items within each
107
- sidebar, excluding "Overview" and "Changelog". Defaults to alphabetical.
108
- - `tsconfigName` (`string`) - Name of the TypeScript config file in the project root. Defaults to
109
- `tsconfig.json`.
110
- - `typedocOptions` (`object`) - [TypeDoc options](https://typedoc.org/guides/options/#input-options)
111
- to pass to the compiler. Only supports a small subset of options, primarily around visibility
112
- exclusion.
113
-
114
- ### Packages
115
-
116
- The `packages` option has been designed to support multiple packages, with multiple entry points per
117
- package. By default the option accepts a list of strings, where each value is a relative path to a
118
- package folder, and a default entry point of `src/index.ts`.
119
-
120
- ```js
121
- module.exports = {
122
- packages: ['packages/core', 'packages/react'],
123
- };
124
- ```
125
-
126
- However, an object can be provided to customize the entry point. All entry point file paths are
127
- relative to the package folder, and support 2 formats:
128
-
129
- - **Index imports** - Consumers can only import from the package index. This is typically an entry
130
- point like `src/index.ts`.
131
- - **Deep imports** - Consumers can import anything from the package using its file path. Glob the
132
- entire package by only passing the folder name like `src/`. _(This is useful for component
133
- libraries)_
134
-
135
- ```js
136
- module.exports = {
137
- packages: [
138
- 'packages/core',
139
- {
140
- path: 'packages/react',
141
- // Index only imports allowed
142
- // import {} from 'package'
143
- entry: 'src/index.tsx',
144
- // Deep imports allowed
145
- // import {} from 'package/some/nested/file'
146
- entry: 'src/',
147
- },
148
- ],
149
- };
150
- ```
151
-
152
- When _not_ using deep imports, multiple entry points can be defined by passing a map of objects to
153
- `entry`, where each key is a sub-path that can be imported from the package (excluding the `index`).
154
- Each entry object requires a `path` and a `label`, which is used for categorizing and sidebars.
155
-
156
- ```js
157
- module.exports = {
158
- packages: [
159
- 'packages/core',
160
- {
161
- path: 'packages/react',
162
- entry: {
163
- // import {} from 'package'
164
- index: 'src/index.tsx',
165
- // import {} from 'package/client'
166
- client: { path: 'src/client.tsx', label: 'Client' },
167
- // import {} from 'package/server'
168
- server: { path: 'src/server.tsx', label: 'Server' },
169
- // import {} from 'package/server/test'
170
- 'server/test': { path: 'src/server/test-utils.tsx', label: 'Server test utils' },
171
- },
172
- },
173
- ],
174
- };
175
- ```
176
-
177
- > Index entry points don't require a label, so a file path can be passed directly.
178
-
179
- ## Linking
180
-
181
- This plugin supports API and documentation linking within source code docblocks via the `@apilink`
182
- and `@doclink` tokens respectively. This works in a similar fashion to
183
- [TypeDoc's `@link` resolution](https://typedoc.org/guides/link-resolution/), but also supports
184
- Docusaurus versioning and routing patterns.
185
-
186
- ### `@apilink`
187
-
188
- When linking to other APIs, you must reference them by class name, function name, property, etc,
189
- _instead of_ the actual `/api` route.
190
-
191
- ```sh
192
- # Maps to /api/<package>/class/Registry#register
193
- {@apilink Registry.register}
194
- {@apilink Registry.register | Text to use as the label}
195
- ```
196
-
197
- ### `@doclink`
198
-
199
- When linking to documentation pages, you must reference the article by its URL identifier without
200
- the `/docs` prefix.
201
-
202
- ```sh
203
- # Maps to /docs/commands/setup
204
- {@doclink commands/setup}
205
- {@doclink commands/setup | Text to use as the label}
206
- ```
3
+ This is a fork of
4
+ [docusaurus-plugin-typedoc-api](https://github.com/milesj/docusaurus-plugin-typedoc-api) adjusted
5
+ for our usecases with rendering library documentation in [Apify Docs](https://docs.apify.com).
207
6
 
208
- ## Versioning
7
+ ## Publishing
209
8
 
210
- This plugin supports API versioning by piggy-backing off the built-in
211
- [docs versioning implementation](https://docusaurus.io/docs/versioning), which is a _requirement_
212
- for this to work correctly.
9
+ There is no CI yet, so you have to publish updated versions of the package manually.
213
10
 
214
- To begin, version your docs with the built-in command:
11
+ 1. bump version in `packages/plugin/package.json`
12
+ 2. `yarn build` in root
13
+ 3. `cd packages/plugin && npm publish`
215
14
 
216
- ```shell
217
- yarn docusaurus docs:version 1.2.3
218
- ```
219
-
220
- Once the markdown files are generated, run our versioning command _with the same version used
221
- previously_:
222
-
223
- ```shell
224
- yarn docusaurus api:version 1.2.3
225
- ```
15
+ # Original readme
226
16
 
227
- This will create multiple JSON files in the `versioned_docs/version-1.2.3` directory. Be sure to
228
- commit these files to your repo.
17
+ > ## This project is no longer actively maintained! TypeScript and TypeDoc continually release breaking changes that make keeping this project in a workable state very difficult. It's not worth my time, so if you need this project, I suggest forking it.
229
18
 
230
- > When versioning, the current state of your branch will be used as that version's API. To
231
- > update/regenerate old versions, you'll need to checkout an old commit, re-version, and copy the
232
- > generated files to the latest branch.
233
-
234
- ### Navigation
235
-
236
- Our API is unable to use the
237
- [`docsVersionDropdown`](https://docusaurus.io/docs/api/themes/configuration#navbar-docs-version-dropdown)
238
- navigation type, as it's hardcoded in Docusaurus core. However, you can create a custom version
239
- dropdown like so:
240
-
241
- ```js
242
- const versions = require('./versions.json');
19
+ ![Build](https://github.com/milesj/docusaurus-plugin-typedoc-api/actions/workflows/build.yml/badge.svg?branch=master)
20
+ [![npm version](https://badge.fury.io/js/docusaurus-plugin-typedoc-api.svg)](https://www.npmjs.com/package/docusaurus-plugin-typedoc-api)
243
21
 
244
- module.exports = {
245
- // ...
246
- themeConfig: {
247
- // ...
248
- navbar: {
249
- // ...
250
- items: [
251
- // ...
252
- {
253
- type: 'dropdown',
254
- to: 'api',
255
- label: 'API',
256
- position: 'left',
257
- items: [
258
- { label: 'Next', to: 'api/next' },
259
- ...versions.map((version, i) => ({
260
- label: version,
261
- to: i === 0 ? 'api' : `api/${version}`,
262
- })),
263
- ],
264
- },
265
- ],
266
- },
267
- },
268
- };
269
- ```
22
+ A Docusaurus plugin for generating source code `/api/*` routes, powered by
23
+ [TypeDoc](https://typedoc.org/).
270
24
 
271
- > This workaround isn't perfect and may be buggy. Use at your own risk!
25
+ ## Documentation
272
26
 
273
- ### Sidebars
27
+ View the [official readme](./packages/plugin/README.md) for more information on installation and
28
+ usage.
274
29
 
275
- When we generate API routes, we also dynamically generate and associate a sidebar with each route.
276
- This cannot be overridden, but can be customized with some basic options (like categories and
277
- sorting).
30
+ ## Contributing
278
31
 
279
- If you'd like to reference the generated sidebar in your `sidebars.ts`, we write the sidebar to a
280
- file located at `.docusaurus/api-sidebar-<id>-<version>.js`. The `<id>` token defaults to "default"
281
- and `<version>` to "current".
32
+ Since this repository doesn't have a public API, nor is its source code organized in a way to
33
+ utilize TypeDoc, we rely on the types provided by [Boost](https://github.com/milesj/boost). To
34
+ contribute, you'll need to clone the Boost project relative to this project as a sibling.
282
35
 
283
- ```ts
284
- import apiSidebar from './.docusaurus/api-sidebar-default-current';
36
+ ```bash
37
+ # Setup plugin
38
+ git clone git@github.com:milesj/docusaurus-plugin-typedoc-api.git
39
+ cd docusaurus-plugin-typedoc-api
40
+ yarn install
41
+ yarn run pack
285
42
 
286
- export default {
287
- api: apiSidebar,
288
- };
43
+ # Setup Boost
44
+ cd ..
45
+ git clone git@github.com:milesj/boost.git
46
+ cd boost
47
+ yarn install
48
+ yarn run pack
289
49
  ```
290
50
 
291
- ### Caveats
292
-
293
- - Each version in `versioned_docs` (or `versions.json`) _must_ contain the generated API JSON files,
294
- otherwise the build will fail.
295
- - The header/footer API links are _not_ version aware, as their values are static.
296
- - We suggest only versioning major versions, as the size of these JSON files and the webpack build
297
- will get very large very fast.
298
-
299
- ## Comparison
300
-
301
- There's another plugin called
302
- [docusaurus-plugin-typedoc](https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/docusaurus-plugin-typedoc),
303
- that offers a similar solution. However, there are many differences between that package and this
304
- one, with the biggest being that theirs generates markdown files and `/docs/api/...` styled routes,
305
- while ours renders custom React pages with `/api/...` styled routes. Some other differences are:
306
-
307
- - An index of all packages.
308
- - Readme inclusion and rendering.
309
- - Custom styles, sections, and headings.
310
- - Multiple function and method signatures.
311
- - [Versioning](#versioning)!
312
- - And probably more....
51
+ After both projects are setup, you can make modifications to this project and then verify the
52
+ changes by starting the Docusaurus server with `yarn run docs`. _However_, hot reloading does not
53
+ work, so you'll unfortunately need to run this command over and over again... haven't spent the time
54
+ improving this yet.
@@ -0,0 +1,5 @@
1
+ export interface AnchorLinkProps {
2
+ id: string;
3
+ }
4
+ export declare function AnchorLink({ id }: AnchorLinkProps): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=AnchorLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnchorLink.d.ts","sourceRoot":"","sources":["../../src/components/AnchorLink.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC/B,EAAE,EAAE,MAAM,CAAC;CACX;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,2CASjD"}
@@ -1,27 +1,8 @@
1
- 'use strict';
2
-
3
- const Link = require('@docusaurus/Link');
4
- const useBrokenLinks = require('@docusaurus/useBrokenLinks');
5
- const jsxRuntime = require('react/jsx-runtime');
6
- const _interopDefault = e => e && e.__esModule ? e : {
7
- default: e
8
- };
9
- const Link__default = /*#__PURE__*/_interopDefault(Link);
10
- const useBrokenLinks__default = /*#__PURE__*/_interopDefault(useBrokenLinks);
11
- function AnchorLink({
12
- id
13
- }) {
14
- useBrokenLinks__default.default().collectAnchor(id);
15
- return /*#__PURE__*/jsxRuntime.jsxs(Link__default.default, {
16
- className: "tsd-anchor",
17
- href: `#${id}`,
18
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
19
- className: "tsd-anchor-id",
20
- id: id
21
- }), /*#__PURE__*/jsxRuntime.jsx("i", {
22
- className: "codicon codicon-symbol-numeric"
23
- })]
24
- });
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Link from '@docusaurus/Link';
3
+ import useBrokenLinks from '@docusaurus/useBrokenLinks';
4
+ export function AnchorLink({ id }) {
5
+ useBrokenLinks().collectAnchor(id);
6
+ return (_jsxs(Link, { className: "tsd-anchor", href: `#${id}`, children: [_jsx("span", { className: "tsd-anchor-id", id: id }), _jsx("i", { className: "codicon codicon-symbol-numeric" })] }));
25
7
  }
26
- exports.AnchorLink = AnchorLink;
27
- //# sourceMappingURL=AnchorLink.js.map
8
+ //# sourceMappingURL=AnchorLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnchorLink.js","sources":["../../src/components/AnchorLink.tsx"],"sourcesContent":null,"names":["useBrokenLinks","_jsxs","Link","_jsx"],"mappings":";;;;;;;;;;;AAGO,SAAS,UAAU,CAAC;AAC3B,EAAE,EAAE;AACJ,CAAC,EAAE;AACH,EAAEA,+BAAc,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AACrC,EAAE,oBAAoBC,eAAK,CAACC,qBAAI,EAAE;AAClC,IAAI,SAAS,EAAE,YAAY;AAC3B,IAAI,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClB,IAAI,QAAQ,EAAE,cAAcC,cAAI,CAAC,MAAM,EAAE;AACzC,MAAM,SAAS,EAAE,eAAe;AAChC,MAAM,EAAE,EAAE,EAAE;AACZ,KAAK,CAAC,eAAeA,cAAI,CAAC,GAAG,EAAE;AAC/B,MAAM,SAAS,EAAE,gCAAgC;AACjD,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL;;;;"}
1
+ {"version":3,"file":"AnchorLink.js","sourceRoot":"","sources":["../../src/components/AnchorLink.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAMxD,MAAM,UAAU,UAAU,CAAC,EAAE,EAAE,EAAmB;IACjD,cAAc,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAEnC,OAAO,CACN,MAAC,IAAI,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAE,IAAI,EAAE,EAAE,aAC1C,eAAM,SAAS,EAAC,eAAe,EAAC,EAAE,EAAE,EAAE,GAAI,EAC1C,YAAG,SAAS,EAAC,gCAAgC,GAAG,IAC1C,CACP,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Props as DocItemProps } from '@theme/DocItem';
2
+ export interface ApiChangelogProps extends Pick<DocItemProps, 'route'> {
3
+ changelog: DocItemProps['content'];
4
+ }
5
+ export default function ApiChangelog({ changelog: Changelog, route }: ApiChangelogProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=ApiChangelog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiChangelog.d.ts","sourceRoot":"","sources":["../../src/components/ApiChangelog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI5D,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;IACrE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CACnC;AAID,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,iBAAiB,2CAatF"}
@@ -1,26 +1,9 @@
1
- 'use strict';
2
-
3
- const themeCommon = require('@docusaurus/theme-common');
4
- const ApiItemLayout = require('./ApiItemLayout.js');
5
- const jsxRuntime = require('react/jsx-runtime');
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PageMetadata } from '@docusaurus/theme-common';
3
+ import ApiItemLayout from './ApiItemLayout';
6
4
  const emptyToc = [];
7
- function ApiChangelog({
8
- changelog: Changelog,
9
- route
10
- }) {
11
- return /*#__PURE__*/jsxRuntime.jsx(ApiItemLayout, {
12
- heading: "Changelog",
13
- pageMetadata: /*#__PURE__*/jsxRuntime.jsx(themeCommon.PageMetadata, {
14
- description: Changelog.contentTitle,
15
- title: "Changelog | API"
16
- }),
17
- route: route,
18
- toc: Changelog.toc ?? emptyToc,
19
- children: /*#__PURE__*/jsxRuntime.jsx("section", {
20
- className: "tsd-readme",
21
- children: /*#__PURE__*/jsxRuntime.jsx(Changelog, {})
22
- })
23
- });
5
+ export default function ApiChangelog({ changelog: Changelog, route }) {
6
+ var _a;
7
+ return (_jsx(ApiItemLayout, { heading: "Changelog", pageMetadata: _jsx(PageMetadata, { description: Changelog.contentTitle, title: "Changelog | API" }), route: route, toc: (_a = Changelog.toc) !== null && _a !== void 0 ? _a : emptyToc, children: _jsx("section", { className: "tsd-readme", children: _jsx(Changelog, {}) }) }));
24
8
  }
25
- module.exports = ApiChangelog;
26
- //# sourceMappingURL=ApiChangelog.js.map
9
+ //# sourceMappingURL=ApiChangelog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiChangelog.js","sources":["../../src/components/ApiChangelog.tsx"],"sourcesContent":null,"names":["_jsx","PageMetadata"],"mappings":";;;;;;AAGA,MAAM,QAAQ,GAAG,EAAE,CAAC;AACL,SAAS,YAAY,CAAC;AACrC,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,KAAK;AACP,CAAC,EAAE;AACH,EAAE,oBAAoBA,cAAI,CAAC,aAAa,EAAE;AAC1C,IAAI,OAAO,EAAE,WAAW;AACxB,IAAI,YAAY,eAAeA,cAAI,CAACC,wBAAY,EAAE;AAClD,MAAM,WAAW,EAAE,SAAS,CAAC,YAAY;AACzC,MAAM,KAAK,EAAE,iBAAiB;AAC9B,KAAK,CAAC;AACN,IAAI,KAAK,EAAE,KAAK;AAChB,IAAI,GAAG,EAAE,SAAS,CAAC,GAAG,IAAI,QAAQ;AAClC,IAAI,QAAQ,eAAeD,cAAI,CAAC,SAAS,EAAE;AAC3C,MAAM,SAAS,EAAE,YAAY;AAC7B,MAAM,QAAQ,eAAeA,cAAI,CAAC,SAAS,EAAE,EAAE,CAAC;AAChD,KAAK,CAAC;AACN,GAAG,CAAC,CAAC;AACL;;;;"}
1
+ {"version":3,"file":"ApiChangelog.js","sourceRoot":"","sources":["../../src/components/ApiChangelog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAM5C,MAAM,QAAQ,GAAc,EAAE,CAAC;AAE/B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAqB;;IACtF,OAAO,CACN,KAAC,aAAa,IACb,OAAO,EAAC,WAAW,EACnB,YAAY,EAAE,KAAC,YAAY,IAAC,WAAW,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,EAAC,iBAAiB,GAAG,EAC3F,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,MAAA,SAAS,CAAC,GAAG,mCAAI,QAAQ,YAE9B,kBAAS,SAAS,EAAC,YAAY,YAC9B,KAAC,SAAS,KAAG,GACJ,GACK,CAChB,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ApiOptions, TSDDeclarationReflectionMap } from '../types';
2
+ export declare const ApiDataContext: import("react").Context<{
3
+ options: ApiOptions;
4
+ reflections: TSDDeclarationReflectionMap;
5
+ }>;
6
+ //# sourceMappingURL=ApiDataContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiDataContext.d.ts","sourceRoot":"","sources":["../../src/components/ApiDataContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAExE,eAAO,MAAM,cAAc;aACjB,UAAU;iBACN,2BAA2B;EAWvC,CAAC"}
@@ -1,16 +1,13 @@
1
- 'use strict';
2
-
3
- const react = require('react');
4
- const ApiDataContext = /*#__PURE__*/react.createContext({
5
- options: {
6
- banner: '',
7
- breadcrumbs: true,
8
- gitRefName: 'master',
9
- minimal: false,
10
- pluginId: 'default',
11
- scopes: []
12
- },
13
- reflections: {}
1
+ import { createContext } from 'react';
2
+ export const ApiDataContext = createContext({
3
+ options: {
4
+ banner: '',
5
+ breadcrumbs: true,
6
+ gitRefName: 'master',
7
+ minimal: false,
8
+ pluginId: 'default',
9
+ scopes: [],
10
+ },
11
+ reflections: {},
14
12
  });
15
- exports.ApiDataContext = ApiDataContext;
16
- //# sourceMappingURL=ApiDataContext.js.map
13
+ //# sourceMappingURL=ApiDataContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiDataContext.js","sources":["../../src/components/ApiDataContext.ts"],"sourcesContent":null,"names":["createContext"],"mappings":";;;;AACY,MAAC,cAAc,gBAAgBA,mBAAa,CAAC;AACzD,EAAE,OAAO,EAAE;AACX,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,WAAW,EAAE,IAAI;AACrB,IAAI,UAAU,EAAE,QAAQ;AACxB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,QAAQ,EAAE,SAAS;AACvB,IAAI,MAAM,EAAE,EAAE;AACd,GAAG;AACH,EAAE,WAAW,EAAE,EAAE;AACjB,CAAC;;;;"}
1
+ {"version":3,"file":"ApiDataContext.js","sourceRoot":"","sources":["../../src/components/ApiDataContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAGxC;IACF,OAAO,EAAE;QACR,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,EAAE;KACV;IACD,WAAW,EAAE,EAAE;CACf,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Props as DocItemProps } from '@theme/DocItem';
2
+ import type { ApiOptions, PackageReflectionGroup } from '../types';
3
+ export interface ApiIndexProps extends Pick<DocItemProps, 'route'> {
4
+ history: {
5
+ location: {
6
+ pathname: string;
7
+ };
8
+ replace: (path: string) => void;
9
+ };
10
+ options: ApiOptions;
11
+ packages: PackageReflectionGroup[];
12
+ }
13
+ export default function ApiIndex({ options, packages, history }: ApiIndexProps): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=ApiIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiIndex.d.ts","sourceRoot":"","sources":["../../src/components/ApiIndex.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAOnE,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;IACjE,OAAO,EAAE;QACR,QAAQ,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;KAChC,CAAC;IACF,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAyBD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,2CAgE7E"}