@apify/docusaurus-plugin-typedoc-api 4.2.5 → 4.2.6

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 (43) hide show
  1. package/assets/styles-8ad572ec.css +44 -0
  2. package/lib/components/ApiItem.js +53 -29
  3. package/lib/components/ApiItem.js.map +1 -1
  4. package/lib/components/ApiItemLayout.js +15 -8
  5. package/lib/components/ApiItemLayout.js.map +1 -1
  6. package/lib/components/ApiOptionsLayout.js +35 -0
  7. package/lib/components/ApiOptionsLayout.js.map +1 -0
  8. package/lib/components/Comment.js +3 -0
  9. package/lib/components/Comment.js.map +1 -1
  10. package/lib/components/Member.js +4 -1
  11. package/lib/components/Member.js.map +1 -1
  12. package/lib/components/MemberSignatureBody.js +57 -16
  13. package/lib/components/MemberSignatureBody.js.map +1 -1
  14. package/lib/components/MemberSignatureTitle.js +11 -1
  15. package/lib/components/MemberSignatureTitle.js.map +1 -1
  16. package/lib/components/Type.js +3 -1
  17. package/lib/components/Type.js.map +1 -1
  18. package/lib/index.js +4 -14
  19. package/lib/index.js.map +1 -1
  20. package/lib/plugin/data.js +37 -0
  21. package/lib/plugin/data.js.map +1 -1
  22. package/package.json +2 -1
  23. package/src/components/ApiItem.tsx +48 -32
  24. package/src/components/ApiItemLayout.tsx +11 -6
  25. package/src/components/ApiOptionsLayout.tsx +22 -0
  26. package/src/components/Comment.tsx +3 -0
  27. package/src/components/Member.tsx +6 -2
  28. package/src/components/MemberSignatureBody.tsx +67 -16
  29. package/src/components/MemberSignatureTitle.tsx +14 -1
  30. package/src/components/Type.tsx +3 -1
  31. package/src/components/styles.css +44 -0
  32. package/src/index.ts +11 -19
  33. package/src/plugin/data.ts +36 -1
  34. package/src/types.ts +5 -1
  35. package/lib/plugin/python-generator/index.js +0 -23
  36. package/lib/plugin/python-generator/index.js.map +0 -1
  37. package/lib/plugin/python-generator/pydoc-markdown.js +0 -72
  38. package/lib/plugin/python-generator/pydoc-markdown.js.map +0 -1
  39. package/lib/plugin/python-generator/transform-docs.js +0 -393
  40. package/lib/plugin/python-generator/transform-docs.js.map +0 -1
  41. package/src/plugin/python-generator/index.ts +0 -18
  42. package/src/plugin/python-generator/pydoc-markdown.ts +0 -70
  43. package/src/plugin/python-generator/transform-docs.ts +0 -417
package/src/index.ts CHANGED
@@ -13,12 +13,12 @@ import {
13
13
  generateJson,
14
14
  loadPackageJsonAndDocs,
15
15
  } from './plugin/data';
16
- import { generateJsonFromPythonProject } from './plugin/python-generator';
17
16
  import { extractSidebar } from './plugin/sidebar';
18
17
  import { getVersionedDocsDirPath, readVersionsMetadata } from './plugin/version';
19
18
  import type {
20
19
  ApiOptions,
21
20
  DocusaurusPluginTypeDocApiOptions,
21
+ GlobalData,
22
22
  LoadedContent,
23
23
  PackageEntryConfig,
24
24
  PackageReflectionGroup,
@@ -149,19 +149,12 @@ export default function typedocApiPlugin(
149
149
 
150
150
  console.log(`[${prefix}]:`, 'Generating docs...');
151
151
 
152
- if (options.python) {
153
- await generateJsonFromPythonProject({
154
- projectRoot,
155
- outFile: path.join(outDir, 'api-typedoc.json'),
156
- });
157
- } else {
158
- await generateJson(
159
- projectRoot,
160
- entryPoints,
161
- path.join(outDir, 'api-typedoc.json'),
162
- options,
163
- );
164
- }
152
+ await generateJson(
153
+ projectRoot,
154
+ entryPoints,
155
+ path.join(outDir, 'api-typedoc.json'),
156
+ options,
157
+ );
165
158
 
166
159
  console.log(`[${prefix}]:`, 'Persisting packages...');
167
160
 
@@ -207,11 +200,6 @@ export default function typedocApiPlugin(
207
200
  fs.mkdirSync(context.generatedFilesDir, { recursive: true });
208
201
  }
209
202
  fs.copyFileSync(options.pathToCurrentVersionTypedocJSON, outFile);
210
- } else if (options.python) {
211
- await generateJsonFromPythonProject({
212
- projectRoot,
213
- outFile,
214
- });
215
203
  } else {
216
204
  await generateJson(projectRoot, entryPoints, outFile, options);
217
205
  }
@@ -277,6 +265,10 @@ export default function typedocApiPlugin(
277
265
  return;
278
266
  }
279
267
 
268
+ actions.setGlobalData({
269
+ isPython: !!options.python,
270
+ } as GlobalData);
271
+
280
272
  const docs: PropVersionDocs = {};
281
273
 
282
274
  // Create an index of versions for quick lookups.
@@ -1,7 +1,7 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
3
  import * as TypeDoc from 'typedoc';
4
- import { JSONOutput, ReflectionKind } from 'typedoc';
4
+ import { type InlineTagDisplayPart, type JSONOutput, ReflectionKind } from 'typedoc'
5
5
  import ts from 'typescript';
6
6
  import { normalizeUrl } from '@docusaurus/utils';
7
7
  import type {
@@ -110,7 +110,42 @@ export function createReflectionMap(
110
110
  ): TSDDeclarationReflectionMap {
111
111
  const map: TSDDeclarationReflectionMap = {};
112
112
 
113
+ // eslint-disable-next-line complexity
113
114
  items.forEach((item) => {
115
+ // Add @reference categories to reflection.
116
+ const referenceCategories: Record<string, { title: string; children: number[] }> = {};
117
+ for (const tag of item.comment?.blockTags ?? []) {
118
+ if (tag.tag === '@reference' && tag.content.length >= 2 && tag.content[0].kind === 'text') {
119
+ const categoryName = tag.content[0].text.trim();
120
+ const ref = (tag.content as InlineTagDisplayPart[]).find((t) => t.tag === '@link');
121
+
122
+ if (ref && typeof ref.target === 'number') {
123
+ if (!(categoryName in referenceCategories)) {
124
+ referenceCategories[categoryName] = { title: categoryName, children: [] };
125
+ }
126
+
127
+ if (!referenceCategories[categoryName].children.includes(ref.target)) {
128
+ referenceCategories[categoryName].children.push(ref.target);
129
+ }
130
+ }
131
+ }
132
+ }
133
+
134
+ // Update categories with reference categories.
135
+ if (!item.categories) {
136
+ // eslint-disable-next-line no-param-reassign
137
+ item.categories = [];
138
+ }
139
+ for (const category of Object.values(referenceCategories)) {
140
+ if (category.children.length > 0) {
141
+ const index = item.categories.findIndex((c) => c.title === category.title);
142
+ if (index === -1) {
143
+ item.categories.push(category);
144
+ }
145
+ }
146
+ }
147
+
148
+ // Add item.
114
149
  map[item.id] = item;
115
150
  });
116
151
 
package/src/types.ts CHANGED
@@ -32,7 +32,7 @@ export interface DocusaurusPluginTypeDocApiOptions
32
32
  typedocOptions?: Partial<TypeDocOptions>;
33
33
 
34
34
  /**
35
- * Switches the processing mode to Python-specific pipeline.
35
+ * Enables the Python-specific rendering patches.
36
36
  */
37
37
  python: boolean;
38
38
 
@@ -45,6 +45,10 @@ export interface DocusaurusPluginTypeDocApiOptions
45
45
  routeBasePath?: string;
46
46
  }
47
47
 
48
+ export interface GlobalData {
49
+ isPython: boolean;
50
+ }
51
+
48
52
  // CONFIG
49
53
 
50
54
  export interface PackageEntryConfig {
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- const zx = require('zx');
4
- const pydocMarkdown = require('./pydoc-markdown.js');
5
- const transformDocs = require('./transform-docs.js');
6
- async function generateJsonFromPythonProject({
7
- outFile,
8
- projectRoot
9
- }) {
10
- const pydocJson = await pydocMarkdown.parseWithPydocMarkdown({
11
- projectRoot
12
- });
13
- await zx.spinner('Converting the Python JSON AST to a TypeDoc-compliant file...', async () => {
14
- await transformDocs.pydocToTypedoc({
15
- moduleName: 'python',
16
- // TODO: get from project config files or passed options
17
- outFile,
18
- pydocJson
19
- });
20
- });
21
- }
22
- exports.generateJsonFromPythonProject = generateJsonFromPythonProject;
23
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/plugin/python-generator/index.ts"],"sourcesContent":null,"names":["parseWithPydocMarkdown","spinner","pydocToTypedoc"],"mappings":";;;;;;AAGO,eAAe,6BAA6B,CAAC;AACpD,EAAE,OAAO;AACT,EAAE,WAAW;AACb,CAAC,EAAE;AACH,EAAE,MAAM,SAAS,GAAG,MAAMA,oCAAsB,CAAC;AACjD,IAAI,WAAW;AACf,GAAG,CAAC,CAAC;AACL,EAAE,MAAMC,UAAO,CAAC,+DAA+D,EAAE,YAAY;AAC7F,IAAI,MAAMC,4BAAc,CAAC;AACzB,MAAM,UAAU,EAAE,QAAQ;AAC1B;AACA,MAAM,OAAO;AACb,MAAM,SAAS;AACf,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL;;;;"}
@@ -1,72 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('node:fs');
4
- const path = require('node:path');
5
- const zx = require('zx');
6
- const _interopDefault = e => e && e.__esModule ? e : {
7
- default: e
8
- };
9
- const path__default = /*#__PURE__*/_interopDefault(path);
10
-
11
- /**
12
- * Generates the pydoc-markdown configuration file
13
- * @returns The pydoc-markdown configuration file as a string
14
- */
15
- function getConfigYml({
16
- projectRoot
17
- }) {
18
- return `
19
- loaders:
20
- - type: python
21
- search_path: ["${projectRoot}"]
22
- processors:
23
- - type: filter
24
- skip_empty_modules: true
25
- - type: crossref
26
- renderer:
27
- type: docusaurus
28
- docs_base_path: docs
29
- relative_output_path: reference
30
- relative_sidebar_path: sidebar.json
31
- sidebar_top_level_label: null
32
- `;
33
- }
34
- async function parseWithPydocMarkdown({
35
- projectRoot
36
- }) {
37
- // Check whether the user has Python and pydoc-markdown installed
38
- for (const cmd of ['python', 'pydoc-markdown']) {
39
- try {
40
- // eslint-disable-next-line no-await-in-loop
41
- await zx.spinner(`Checking for ${cmd}...`, () => zx.$`${cmd} --version`);
42
- } catch {
43
- throw new Error(`Please install ${cmd} to use this plugin with Python projects.`);
44
- }
45
- }
46
- ;
47
-
48
- // Generate the JSON file
49
- try {
50
- const configYml = getConfigYml({
51
- projectRoot
52
- });
53
- const configPath = path__default.default.join(__dirname, 'pydoc-markdown.temp.yml');
54
- fs.writeFileSync(configPath, configYml);
55
- let pydoc = null;
56
- await zx.spinner('Parsing the Python project into a JSON AST...', async () => {
57
- pydoc = await zx.$`pydoc-markdown --quiet --dump ${configPath}`;
58
- });
59
- fs.rmSync(configPath);
60
-
61
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
62
- let json = await pydoc.text();
63
- json = json.replaceAll(path__default.default.resolve(projectRoot), 'REPO_ROOT_PLACEHOLDER');
64
- return json;
65
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
- } catch (error) {
67
- // eslint-disable-next-line
68
- throw new Error(`Failed to generate JSON file from Python project:\n\t${error.stderr.split('\n').slice(-2).join('\n')}`);
69
- }
70
- }
71
- exports.parseWithPydocMarkdown = parseWithPydocMarkdown;
72
- //# sourceMappingURL=pydoc-markdown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pydoc-markdown.js","sources":["../../../src/plugin/python-generator/pydoc-markdown.ts"],"sourcesContent":null,"names":["spinner","$","path","writeFileSync","rmSync"],"mappings":";;;;;;;;;;AAIA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC;AACtB,EAAE,WAAW;AACb,CAAC,EAAE;AACH,EAAE,OAAO,CAAC;AACV;AACA;AACA,mBAAmB,EAAE,WAAW,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF,CAAC;AACM,eAAe,sBAAsB,CAAC;AAC7C,EAAE,WAAW;AACb,CAAC,EAAE;AACH;AACA,EAAE,KAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE;AAClD,IAAI,IAAI;AACR;AACA,MAAM,MAAMA,UAAO,CAAC,CAAC,aAAa,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,MAAMC,IAAC,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;AACzE,KAAK,CAAC,MAAM;AACZ,MAAM,MAAM,IAAI,KAAK,CAAC,CAAC,eAAe,EAAE,GAAG,CAAC,yCAAyC,CAAC,CAAC,CAAC;AACxF,KAAK;AACL,GAAG;AACH,EAAE,CAAC;AACH;AACA;AACA,EAAE,IAAI;AACN,IAAI,MAAM,SAAS,GAAG,YAAY,CAAC;AACnC,MAAM,WAAW;AACjB,KAAK,CAAC,CAAC;AACP,IAAI,MAAM,UAAU,GAAGC,qBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;AACvE,IAAIC,gBAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AACzC,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC;AACrB,IAAI,MAAMH,UAAO,CAAC,+CAA+C,EAAE,YAAY;AAC/E,MAAM,KAAK,GAAG,MAAMC,IAAC,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAC,CAAC;AACnE,KAAK,CAAC,CAAC;AACP,IAAIG,SAAM,CAAC,UAAU,CAAC,CAAC;AACvB;AACA;AACA,IAAI,IAAI,IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;AAClC,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAACF,qBAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,uBAAuB,CAAC,CAAC;AAC/E,IAAI,OAAO,IAAI,CAAC;AAChB;AACA,GAAG,CAAC,OAAO,KAAK,EAAE;AAClB;AACA,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,qDAAqD,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7H,GAAG;AACH;;;;"}
@@ -1,393 +0,0 @@
1
- 'use strict';
2
-
3
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
7
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
9
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
11
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
12
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
14
- const fs = require('node:fs');
15
- const zx = require('zx');
16
- const _interopDefault = e => e && e.__esModule ? e : {
17
- default: e
18
- };
19
- const fs__default = /*#__PURE__*/_interopDefault(fs);
20
-
21
- /* eslint-disable */
22
- const REPO_ROOT_PLACEHOLDER = 'REPO_ROOT_PLACEHOLDER';
23
-
24
- // TODO: Make these parametrizable (gitRepoUrls array option)
25
- const APIFY_CLIENT_REPO_URL = 'https://github.com/apify/apify-client-python';
26
- const APIFY_SDK_REPO_URL = 'https://github.com/apify/apify-sdk-python';
27
- const APIFY_SHARED_REPO_URL = 'https://github.com/apify/apify-shared-python';
28
- const CRAWLEE_PYTHON_REPO_URL = 'https://github.com/apify/crawlee-python';
29
- const REPO_URL_PER_PACKAGE = {
30
- 'apify': APIFY_SDK_REPO_URL,
31
- 'apify_client': APIFY_CLIENT_REPO_URL,
32
- 'apify_shared': APIFY_SHARED_REPO_URL,
33
- 'crawlee': CRAWLEE_PYTHON_REPO_URL
34
- };
35
- const TAG_PER_PACKAGE = {};
36
- let MODULE_SHORTCUTS = {};
37
- async function initPackageTags({
38
- moduleName
39
- }) {
40
- // For each package, get the installed version, and set the tag to the corresponding version
41
- for (const pkg of ['apify', 'apify_client', 'apify_shared']) {
42
- try {
43
- const packageVersion = await zx.$`python -c 'import ${pkg}; print(${pkg}.__version__)'`;
44
- if (packageVersion.exitCode === 0) {
45
- TAG_PER_PACKAGE[pkg] = `v${await packageVersion.text()}`;
46
- }
47
- } catch (e) {
48
- console.warn(`Failed to get version of package ${pkg}`);
49
- }
50
- }
51
- if (!moduleName) {
52
- const thisPackagePyprojectToml = fs__default.default.readFileSync('../pyproject.toml', 'utf8');
53
- moduleName = thisPackagePyprojectToml.match(/^name = "(.+)"$/m)?.[1];
54
- }
55
-
56
- // For the current package, set the tag to 'master'
57
- TAG_PER_PACKAGE[moduleName] = 'master';
58
- return TAG_PER_PACKAGE;
59
- }
60
- async function initModuleShortcuts() {
61
- if (!fs__default.default.existsSync('./module_shortcuts.json')) {
62
- return console.warn('No module_shortcuts.json file found, skipping module shortcuts.');
63
- }
64
- MODULE_SHORTCUTS = JSON.parse(fs__default.default.readFileSync('./module_shortcuts.json', 'utf8'));
65
- }
66
-
67
- // Taken from https://github.com/TypeStrong/typedoc/blob/v0.23.24/src/lib/models/reflections/kind.ts, modified
68
- const TYPEDOC_KINDS = {
69
- 'class': {
70
- kind: 128,
71
- kindString: 'Class'
72
- },
73
- 'function': {
74
- kind: 2048,
75
- kindString: 'Method'
76
- },
77
- 'data': {
78
- kind: 1024,
79
- kindString: 'Property'
80
- },
81
- 'enum': {
82
- kind: 8,
83
- kindString: 'Enumeration'
84
- },
85
- 'enumValue': {
86
- kind: 16,
87
- kindString: 'Enumeration Member'
88
- }
89
- };
90
- const GROUP_ORDER = ['Main Classes', 'Helper Classes', 'Errors', 'Constructors', 'Methods', 'Properties', 'Constants', 'Enumeration Members'];
91
- const groupSort = (g1, g2) => {
92
- if (GROUP_ORDER.includes(g1) && GROUP_ORDER.includes(g2)) {
93
- return GROUP_ORDER.indexOf(g1) - GROUP_ORDER.indexOf(g2);
94
- }
95
- return g1.localeCompare(g2);
96
- };
97
- function getGroupName(object) {
98
- const groupPredicates = {
99
- 'Errors': x => x.name.toLowerCase().includes('error'),
100
- 'Main Classes': x => ['Dataset', 'KeyValueStore', 'RequestQueue'].includes(x.name) || x.name.endsWith('Crawler'),
101
- 'Helper Classes': x => x.kindString === 'Class',
102
- 'Methods': x => x.kindString === 'Method',
103
- 'Constructors': x => x.kindString === 'Constructor',
104
- 'Properties': x => x.kindString === 'Property',
105
- 'Constants': x => x.kindString === 'Enumeration',
106
- 'Enumeration Members': x => x.kindString === 'Enumeration Member'
107
- };
108
- const _Object$entries$find = Object.entries(groupPredicates).find(([_, predicate]) => predicate(object)),
109
- _Object$entries$find2 = _slicedToArray(_Object$entries$find, 1),
110
- group = _Object$entries$find2[0];
111
- return group;
112
- }
113
-
114
- // Strips the Optional[] type from the type string, and replaces generic types with just the main type
115
- function getBaseType(type) {
116
- return type?.replace(/Optional\[(.*)\]/g, '$1').replace('ListPage[Dict]', 'ListPage');
117
- }
118
-
119
- // Returns whether a type is a custom class, or a primitive type
120
- function isCustomClass(type) {
121
- return !['dict', 'list', 'str', 'int', 'float', 'bool'].includes(type.toLowerCase());
122
- }
123
-
124
- // Infer the Typedoc type from the docspec type
125
- function inferTypedocType(docspecType) {
126
- const typeWithoutOptional = getBaseType(docspecType);
127
- if (!typeWithoutOptional) {
128
- return undefined;
129
- }
130
-
131
- // Typically, if a type is a custom class, it will be a reference in Typedoc
132
- return isCustomClass(typeWithoutOptional) ? {
133
- type: 'reference',
134
- name: docspecType
135
- } : {
136
- type: 'intrinsic',
137
- name: docspecType
138
- };
139
- }
140
-
141
- // Sorts the groups of a Typedoc member, and sorts the children of each group
142
- function sortChildren(typedocMember) {
143
- for (let group of typedocMember.groups) {
144
- group.children.sort((a, b) => {
145
- const firstName = typedocMember.children.find(x => x.id === a).name;
146
- const secondName = typedocMember.children.find(x => x.id === b).name;
147
- return firstName.localeCompare(secondName);
148
- });
149
- }
150
- typedocMember.groups.sort((a, b) => groupSort(a.title, b.title));
151
- }
152
-
153
- // Parses the arguments and return value description of a method from its docstring
154
- function extractArgsAndReturns(docstring) {
155
- const parameters = (docstring.split('Args:')[1] ?? '').split('Returns:')[0] // Get the part between Args: and Returns:
156
- .split(/(^|\n)\s*([\w]+)\s*\(.*?\)\s*:\s*/) // Magic regex which splits the arguments into an array, and removes the argument types
157
- .filter(x => x.length > 1) // Remove empty strings
158
- .reduce((acc, curr, idx, arr) => {
159
- // Collect the argument names and types into an object
160
- if (idx % 2 === 0) {
161
- return _objectSpread(_objectSpread({}, acc), {}, {
162
- [curr]: arr[idx + 1]
163
- }); // If the index is even, the current string is an argument name, and the next string is its type
164
- }
165
- return acc;
166
- }, {});
167
- const returns = (docstring.split('Returns:')[1] ?? '').split('Raises:')[0] // Get the part between Returns: and Raises:
168
- .split(':')[1]?.trim() || undefined; // Split the return value into its type and description, return description
169
-
170
- return {
171
- parameters,
172
- returns
173
- };
174
- }
175
-
176
- // Objects with decorators named 'ignore_docs' or with empty docstrings will be ignored
177
- function isHidden(member) {
178
- return member.decorations?.some(d => d.name === 'ignore_docs') || member.name === 'ignore_docs';
179
- }
180
-
181
- // Each object in the Typedoc structure has an unique ID,
182
- // we'll just increment it for each object we convert
183
- let oid = 1;
184
- const symbolIdMap = [];
185
-
186
- // Converts a docspec object to a Typedoc object, including all its children
187
- function convertObject(obj, parent, module) {
188
- const rootModuleName = module.name.split('.')[0];
189
- for (let member of obj.members ?? []) {
190
- let typedocKind = TYPEDOC_KINDS[member.type];
191
- if (member.bases?.includes('Enum')) {
192
- typedocKind = TYPEDOC_KINDS['enum'];
193
- }
194
- let typedocType = inferTypedocType(member.datatype);
195
- if (member.decorations?.some(d => ['property', 'dualproperty'].includes(d.name))) {
196
- typedocKind = TYPEDOC_KINDS['data'];
197
- typedocType = inferTypedocType(member.return_type ?? member.datatype);
198
- }
199
- if (parent.kindString === 'Enumeration') {
200
- typedocKind = TYPEDOC_KINDS['enumValue'];
201
- typedocType = {
202
- type: 'literal',
203
- value: member.value
204
- };
205
- }
206
- if (member.type in TYPEDOC_KINDS && !isHidden(member)) {
207
- // Get the URL of the member in GitHub
208
- const repoBaseUrl = `${REPO_URL_PER_PACKAGE[rootModuleName]}/blob/${TAG_PER_PACKAGE[rootModuleName] ?? 'master'}`;
209
- const filePathInRepo = member.location.filename.replace(REPO_ROOT_PLACEHOLDER, '');
210
- const fileGitHubUrl = member.location.filename.replace(REPO_ROOT_PLACEHOLDER, repoBaseUrl);
211
- const memberGitHubUrl = `${fileGitHubUrl}#L${member.location.lineno}`;
212
- symbolIdMap.push({
213
- qualifiedName: member.name,
214
- sourceFileName: filePathInRepo
215
- });
216
-
217
- // Get the module name of the member, and check if it has a shortcut (reexport from an ancestor module)
218
- const fullName = `${module.name}.${member.name}`;
219
- let moduleName = module.name;
220
- if (fullName in MODULE_SHORTCUTS) {
221
- moduleName = MODULE_SHORTCUTS[fullName].replace(`.${member.name}`, '');
222
- }
223
-
224
- // Create the Typedoc member object
225
- let typedocMember = _objectSpread(_objectSpread({
226
- id: oid++,
227
- name: member.name,
228
- module: moduleName
229
- }, typedocKind), {}, {
230
- flags: {},
231
- comment: member.docstring ? {
232
- summary: [{
233
- kind: 'text',
234
- text: member.docstring?.content
235
- }]
236
- } : undefined,
237
- type: typedocType,
238
- children: [],
239
- groups: [],
240
- sources: [{
241
- filename: filePathInRepo,
242
- line: member.location.lineno,
243
- character: 1,
244
- url: memberGitHubUrl
245
- }],
246
- signatures: []
247
- });
248
- if (typedocMember.kindString === 'Method') {
249
- const _extractArgsAndReturn = extractArgsAndReturns(member.docstring?.content ?? ''),
250
- parameters = _extractArgsAndReturn.parameters,
251
- returns = _extractArgsAndReturn.returns;
252
- typedocMember.signatures = [{
253
- id: oid++,
254
- name: member.name,
255
- modifiers: member.modifiers ?? [],
256
- kind: 4096,
257
- kindString: 'Call signature',
258
- flags: {},
259
- comment: member.docstring ? {
260
- summary: [{
261
- kind: 'text',
262
- text: member.docstring?.content.replace(/\**(Args|Arguments|Returns)[\s\S]+/, '')
263
- }],
264
- blockTags: returns ? [{
265
- tag: '@returns',
266
- content: [{
267
- kind: 'text',
268
- text: returns
269
- }]
270
- }] : undefined
271
- } : undefined,
272
- type: inferTypedocType(member.return_type),
273
- parameters: member.args.filter(arg => arg.name !== 'self' && arg.name !== 'cls').map(arg => ({
274
- id: oid++,
275
- name: arg.name,
276
- kind: 32768,
277
- kindString: 'Parameter',
278
- flags: {
279
- isOptional: arg.datatype?.includes('Optional') ? 'true' : undefined,
280
- 'keyword-only': arg.type === 'KEYWORD_ONLY' ? 'true' : undefined
281
- },
282
- type: inferTypedocType(arg.datatype),
283
- comment: parameters[arg.name] ? {
284
- summary: [{
285
- kind: 'text',
286
- text: parameters[arg.name]
287
- }]
288
- } : undefined,
289
- defaultValue: arg.default_value
290
- }))
291
- }];
292
- }
293
- if (typedocMember.name === '__init__') {
294
- typedocMember.kind = 512;
295
- typedocMember.kindString = 'Constructor';
296
- }
297
- convertObject(member, typedocMember, module);
298
- const groupName = getGroupName(typedocMember);
299
- const group = parent.groups.find(g => g.title === groupName);
300
- if (group) {
301
- group.children.push(typedocMember.id);
302
- } else {
303
- parent.groups.push({
304
- title: groupName,
305
- children: [typedocMember.id]
306
- });
307
- }
308
- sortChildren(typedocMember);
309
- parent.children.push(typedocMember);
310
- }
311
- }
312
- }
313
- async function pydocToTypedoc({
314
- pydocFile,
315
- pydocJson,
316
- outFile,
317
- moduleName
318
- }) {
319
- await initPackageTags({
320
- moduleName
321
- });
322
- await initModuleShortcuts();
323
-
324
- // Root object of the Typedoc structure
325
- const typedocApiReference = {
326
- 'id': 0,
327
- 'name': 'apify-client',
328
- 'kind': 1,
329
- 'kindString': 'Project',
330
- 'flags': {},
331
- 'originalName': '',
332
- 'children': [],
333
- 'groups': [],
334
- 'sources': [{
335
- 'fileName': 'src/index.ts',
336
- 'line': 1,
337
- 'character': 0,
338
- 'url': `http://example.com/blob/123456/src/dummy.py`
339
- }],
340
- 'symbolIdMap': {}
341
- };
342
-
343
- // Load the docspec dump files of this module and of apify-shared
344
- const thisPackageDocspecDump = pydocJson ?? fs__default.default.readFileSync(pydocFile, 'utf8');
345
- const thisPackageModules = thisPackageDocspecDump.split('\n').filter(line => line !== '');
346
-
347
- // Convert all the modules, store them in the root object
348
- for (const module of [...thisPackageModules]) {
349
- const parsedModule = JSON.parse(module);
350
- convertObject(parsedModule, typedocApiReference, parsedModule);
351
- }
352
- ;
353
-
354
- // Recursively fix references (collect names->ids of all the named entities and then inject those in the reference objects)
355
- const namesToIds = {};
356
- function collectIds(obj) {
357
- for (const child of obj.children ?? []) {
358
- namesToIds[child.name] = child.id;
359
- collectIds(child);
360
- }
361
- }
362
- collectIds(typedocApiReference);
363
- function fixRefs(obj) {
364
- for (const child of obj.children ?? []) {
365
- if (child.type?.type === 'reference') {
366
- child.type.id = namesToIds[child.type.name];
367
- }
368
- if (child.signatures) {
369
- for (const sig of child.signatures) {
370
- for (const param of sig.parameters ?? []) {
371
- if (param.type?.type === 'reference') {
372
- param.type.id = namesToIds[param.type.name];
373
- }
374
- }
375
- if (sig.type?.type === 'reference') {
376
- sig.type.id = namesToIds[sig.type.name];
377
- }
378
- }
379
- }
380
- fixRefs(child);
381
- }
382
- }
383
- fixRefs(typedocApiReference);
384
-
385
- // Sort the children of the root object
386
- sortChildren(typedocApiReference);
387
- typedocApiReference.symbolIdMap = Object.fromEntries(Object.entries(symbolIdMap));
388
-
389
- // Write the Typedoc structure to the output file
390
- fs__default.default.writeFileSync(outFile, JSON.stringify(typedocApiReference, null, 4));
391
- }
392
- exports.pydocToTypedoc = pydocToTypedoc;
393
- //# sourceMappingURL=transform-docs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform-docs.js","sources":["../../../src/plugin/python-generator/transform-docs.ts"],"sourcesContent":null,"names":["$","fs"],"mappings":";;;;;;;;;AAAA;AAGA,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AACtD;AACA;AACA,MAAM,qBAAqB,GAAG,8CAA8C,CAAC;AAC7E,MAAM,kBAAkB,GAAG,2CAA2C,CAAC;AACvE,MAAM,qBAAqB,GAAG,8CAA8C,CAAC;AAC7E,MAAM,uBAAuB,GAAG,yCAAyC,CAAC;AAC1E,MAAM,oBAAoB,GAAG;AAC7B,EAAE,OAAO,EAAE,kBAAkB;AAC7B,EAAE,cAAc,EAAE,qBAAqB;AACvC,EAAE,cAAc,EAAE,qBAAqB;AACvC,EAAE,SAAS,EAAE,uBAAuB;AACpC,CAAC,CAAC;AACF,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,IAAI,gBAAgB,GAAG,EAAE,CAAC;AAC1B,eAAe,eAAe,CAAC;AAC/B,EAAE,UAAU;AACZ,CAAC,EAAE;AACH;AACA,EAAE,KAAK,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,cAAc,CAAC,EAAE;AAC/D,IAAI,IAAI;AACR,MAAM,MAAM,cAAc,GAAG,MA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