@apify/docusaurus-plugin-typedoc-api 4.4.12 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -296
- package/lib/components/AnchorLink.d.ts +5 -0
- package/lib/components/AnchorLink.d.ts.map +1 -0
- package/lib/components/AnchorLink.js +7 -26
- package/lib/components/AnchorLink.js.map +1 -1
- package/lib/components/ApiChangelog.d.ts +6 -0
- package/lib/components/ApiChangelog.d.ts.map +1 -0
- package/lib/components/ApiChangelog.js +7 -24
- package/lib/components/ApiChangelog.js.map +1 -1
- package/lib/components/ApiDataContext.d.ts +6 -0
- package/lib/components/ApiDataContext.d.ts.map +1 -0
- package/lib/components/ApiDataContext.js +12 -15
- package/lib/components/ApiDataContext.js.map +1 -1
- package/lib/components/ApiIndex.d.ts +14 -0
- package/lib/components/ApiIndex.d.ts.map +1 -0
- package/lib/components/ApiIndex.js +33 -93
- package/lib/components/ApiIndex.js.map +1 -1
- package/lib/components/ApiItem.d.ts +6 -0
- package/lib/components/ApiItem.d.ts.map +1 -0
- package/lib/components/ApiItem.js +131 -191
- package/lib/components/ApiItem.js.map +1 -1
- package/lib/components/ApiItemLayout.d.ts +14 -0
- package/lib/components/ApiItemLayout.d.ts.map +1 -0
- package/lib/components/ApiItemLayout.js +21 -97
- package/lib/components/ApiItemLayout.js.map +1 -1
- package/lib/components/ApiOptionsContext.d.ts +5 -0
- package/lib/components/ApiOptionsContext.d.ts.map +1 -0
- package/lib/components/ApiOptionsContext.js +5 -9
- package/lib/components/ApiOptionsContext.js.map +1 -1
- package/lib/components/ApiOptionsLayout.d.ts +4 -0
- package/lib/components/ApiOptionsLayout.d.ts.map +1 -0
- package/lib/components/ApiOptionsLayout.js +10 -34
- package/lib/components/ApiOptionsLayout.js.map +1 -1
- package/lib/components/ApiPage.d.ts +11 -0
- package/lib/components/ApiPage.d.ts.map +1 -0
- package/lib/components/ApiPage.js +50 -63
- package/lib/components/ApiPage.js.map +1 -1
- package/lib/components/Breadcrumb.d.ts +7 -0
- package/lib/components/Breadcrumb.d.ts.map +1 -0
- package/lib/components/Breadcrumb.js +17 -49
- package/lib/components/Breadcrumb.js.map +1 -1
- package/lib/components/Comment.d.ts +10 -0
- package/lib/components/Comment.d.ts.map +1 -0
- package/lib/components/Comment.js +33 -60
- package/lib/components/Comment.js.map +1 -1
- package/lib/components/CommentBadges.d.ts +9 -0
- package/lib/components/CommentBadges.d.ts.map +1 -0
- package/lib/components/CommentBadges.js +16 -28
- package/lib/components/CommentBadges.js.map +1 -1
- package/lib/components/DefaultValue.d.ts +10 -0
- package/lib/components/DefaultValue.d.ts.map +1 -0
- package/lib/components/DefaultValue.js +25 -55
- package/lib/components/DefaultValue.js.map +1 -1
- package/lib/components/Flags.d.ts +6 -0
- package/lib/components/Flags.d.ts.map +1 -0
- package/lib/components/Flags.js +11 -22
- package/lib/components/Flags.js.map +1 -1
- package/lib/components/Footer.d.ts +2 -0
- package/lib/components/Footer.d.ts.map +1 -0
- package/lib/components/Footer.js +4 -16
- package/lib/components/Footer.js.map +1 -1
- package/lib/components/Hierarchy.d.ts +6 -0
- package/lib/components/Hierarchy.d.ts.map +1 -0
- package/lib/components/Hierarchy.js +5 -25
- package/lib/components/Hierarchy.js.map +1 -1
- package/lib/components/Icon.d.ts +6 -0
- package/lib/components/Icon.d.ts.map +1 -0
- package/lib/components/Icon.js +10 -21
- package/lib/components/Icon.js.map +1 -1
- package/lib/components/Index.d.ts +9 -0
- package/lib/components/Index.d.ts.map +1 -0
- package/lib/components/Index.js +30 -113
- package/lib/components/Index.js.map +1 -1
- package/lib/components/Markdown.d.ts +5 -0
- package/lib/components/Markdown.d.ts.map +1 -0
- package/lib/components/Markdown.js +138 -202
- package/lib/components/Markdown.js.map +1 -1
- package/lib/components/Member.d.ts +5 -0
- package/lib/components/Member.d.ts.map +1 -0
- package/lib/components/Member.js +40 -69
- package/lib/components/Member.js.map +1 -1
- package/lib/components/MemberDeclaration.d.ts +5 -0
- package/lib/components/MemberDeclaration.d.ts.map +1 -0
- package/lib/components/MemberDeclaration.js +20 -71
- package/lib/components/MemberDeclaration.js.map +1 -1
- package/lib/components/MemberGetterSetter.d.ts +8 -0
- package/lib/components/MemberGetterSetter.d.ts.map +1 -0
- package/lib/components/MemberGetterSetter.js +13 -68
- package/lib/components/MemberGetterSetter.js.map +1 -1
- package/lib/components/MemberReference.d.ts +6 -0
- package/lib/components/MemberReference.d.ts.map +1 -0
- package/lib/components/MemberReference.js +18 -48
- package/lib/components/MemberReference.js.map +1 -1
- package/lib/components/MemberSignatureBody.d.ts +9 -0
- package/lib/components/MemberSignatureBody.d.ts.map +1 -0
- package/lib/components/MemberSignatureBody.js +85 -182
- package/lib/components/MemberSignatureBody.js.map +1 -1
- package/lib/components/MemberSignatureTitle.d.ts +11 -0
- package/lib/components/MemberSignatureTitle.d.ts.map +1 -0
- package/lib/components/MemberSignatureTitle.js +27 -81
- package/lib/components/MemberSignatureTitle.js.map +1 -1
- package/lib/components/MemberSignatures.d.ts +7 -0
- package/lib/components/MemberSignatures.d.ts.map +1 -0
- package/lib/components/MemberSignatures.js +18 -66
- package/lib/components/MemberSignatures.js.map +1 -1
- package/lib/components/MemberSources.d.ts +7 -0
- package/lib/components/MemberSources.d.ts.map +1 -0
- package/lib/components/MemberSources.js +10 -34
- package/lib/components/MemberSources.js.map +1 -1
- package/lib/components/Members.d.ts +6 -0
- package/lib/components/Members.d.ts.map +1 -0
- package/lib/components/Members.js +29 -49
- package/lib/components/Members.js.map +1 -1
- package/lib/components/MembersGroup.d.ts +6 -0
- package/lib/components/MembersGroup.d.ts.map +1 -0
- package/lib/components/MembersGroup.js +16 -40
- package/lib/components/MembersGroup.js.map +1 -1
- package/lib/components/Parameter.d.ts +6 -0
- package/lib/components/Parameter.d.ts.map +1 -0
- package/lib/components/Parameter.js +35 -171
- package/lib/components/Parameter.js.map +1 -1
- package/lib/components/Reflection.d.ts +6 -0
- package/lib/components/Reflection.d.ts.map +1 -0
- package/lib/components/Reflection.js +29 -132
- package/lib/components/Reflection.js.map +1 -1
- package/lib/components/SourceLink.d.ts +10 -0
- package/lib/components/SourceLink.d.ts.map +1 -0
- package/lib/components/SourceLink.js +16 -36
- package/lib/components/SourceLink.js.map +1 -1
- package/lib/components/Type.d.ts +12 -0
- package/lib/components/Type.d.ts.map +1 -0
- package/lib/components/Type.js +142 -464
- package/lib/components/Type.js.map +1 -1
- package/lib/components/TypeAndParent.d.ts +6 -0
- package/lib/components/TypeAndParent.d.ts.map +1 -0
- package/lib/components/TypeAndParent.js +11 -27
- package/lib/components/TypeAndParent.js.map +1 -1
- package/lib/components/TypeParameters.d.ts +6 -0
- package/lib/components/TypeParameters.d.ts.map +1 -0
- package/lib/components/TypeParameters.js +10 -38
- package/lib/components/TypeParameters.js.map +1 -1
- package/lib/components/TypeParametersGeneric.d.ts +6 -0
- package/lib/components/TypeParametersGeneric.d.ts.map +1 -0
- package/lib/components/TypeParametersGeneric.js +8 -27
- package/lib/components/TypeParametersGeneric.js.map +1 -1
- package/lib/components/VersionBanner.d.ts +2 -0
- package/lib/components/VersionBanner.d.ts.map +1 -0
- package/lib/components/VersionBanner.js +18 -49
- package/lib/components/VersionBanner.js.map +1 -1
- package/lib/hooks/useBreadcrumbs.d.ts +2 -0
- package/lib/hooks/useBreadcrumbs.d.ts.map +1 -0
- package/lib/hooks/useBreadcrumbs.js +5 -8
- package/lib/hooks/useBreadcrumbs.js.map +1 -1
- package/lib/hooks/useGitRefName.d.ts +2 -0
- package/lib/hooks/useGitRefName.d.ts.map +1 -0
- package/lib/hooks/useGitRefName.js +5 -8
- package/lib/hooks/useGitRefName.js.map +1 -1
- package/lib/hooks/useMinimalLayout.d.ts +2 -0
- package/lib/hooks/useMinimalLayout.d.ts.map +1 -0
- package/lib/hooks/useMinimalLayout.js +5 -8
- package/lib/hooks/useMinimalLayout.js.map +1 -1
- package/lib/hooks/useReflection.d.ts +4 -0
- package/lib/hooks/useReflection.d.ts.map +1 -0
- package/lib/hooks/useReflection.js +15 -21
- package/lib/hooks/useReflection.js.map +1 -1
- package/lib/hooks/useReflectionMap.d.ts +3 -0
- package/lib/hooks/useReflectionMap.d.ts.map +1 -0
- package/lib/hooks/useReflectionMap.js +5 -8
- package/lib/hooks/useReflectionMap.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +349 -361
- package/lib/index.js.map +1 -1
- package/lib/markdownLoader.d.ts +6 -0
- package/lib/markdownLoader.d.ts.map +1 -0
- package/lib/markdownLoader.js +6 -10
- package/lib/markdownLoader.js.map +1 -1
- package/lib/plugin/data.d.ts +21 -0
- package/lib/plugin/data.d.ts.map +1 -0
- package/lib/plugin/data.js +391 -429
- package/lib/plugin/data.js.map +1 -1
- package/lib/plugin/python/consts.d.ts +35 -0
- package/lib/plugin/python/consts.d.ts.map +1 -0
- package/lib/plugin/python/consts.js +44 -44
- package/lib/plugin/python/consts.js.map +1 -1
- package/lib/plugin/python/index.d.ts +12 -0
- package/lib/plugin/python/index.d.ts.map +1 -0
- package/lib/plugin/python/index.js +25 -36
- package/lib/plugin/python/index.js.map +1 -1
- package/lib/plugin/python/inheritance.d.ts +42 -0
- package/lib/plugin/python/inheritance.d.ts.map +1 -0
- package/lib/plugin/python/inheritance.js +148 -153
- package/lib/plugin/python/inheritance.js.map +1 -1
- package/lib/plugin/python/packageVersions.d.ts +7 -0
- package/lib/plugin/python/packageVersions.d.ts.map +1 -0
- package/lib/plugin/python/packageVersions.js +30 -38
- package/lib/plugin/python/packageVersions.js.map +1 -1
- package/lib/plugin/python/transformation.d.ts +90 -0
- package/lib/plugin/python/transformation.d.ts.map +1 -0
- package/lib/plugin/python/transformation.js +424 -391
- package/lib/plugin/python/transformation.js.map +1 -1
- package/lib/plugin/python/type-parsing/index.d.ts +34 -0
- package/lib/plugin/python/type-parsing/index.d.ts.map +1 -0
- package/lib/plugin/python/type-parsing/index.js +78 -85
- package/lib/plugin/python/type-parsing/index.js.map +1 -1
- package/lib/plugin/python/types.d.ts +107 -0
- package/lib/plugin/python/types.d.ts.map +1 -0
- package/lib/plugin/python/types.js +2 -2
- package/lib/plugin/python/types.js.map +1 -1
- package/lib/plugin/python/utils.d.ts +40 -0
- package/lib/plugin/python/utils.d.ts.map +1 -0
- package/lib/plugin/python/utils.js +74 -73
- package/lib/plugin/python/utils.js.map +1 -1
- package/lib/plugin/sidebar.d.ts +6 -0
- package/lib/plugin/sidebar.d.ts.map +1 -0
- package/lib/plugin/sidebar.js +94 -96
- package/lib/plugin/sidebar.js.map +1 -1
- package/lib/plugin/structure/0.23.d.ts +3 -0
- package/lib/plugin/structure/0.23.d.ts.map +1 -0
- package/lib/plugin/structure/0.23.js +33 -41
- package/lib/plugin/structure/0.23.js.map +1 -1
- package/lib/plugin/url.d.ts +6 -0
- package/lib/plugin/url.d.ts.map +1 -0
- package/lib/plugin/url.js +36 -46
- package/lib/plugin/url.js.map +1 -1
- package/lib/plugin/version.d.ts +5 -0
- package/lib/plugin/version.d.ts.map +1 -0
- package/lib/plugin/version.js +73 -78
- package/lib/plugin/version.js.map +1 -1
- package/lib/types.d.ts +142 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -2
- package/lib/types.js.map +1 -1
- package/lib/utils/helpers.d.ts +2 -0
- package/lib/utils/helpers.d.ts.map +1 -0
- package/lib/utils/helpers.js +5 -7
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/hierarchy.d.ts +8 -0
- package/lib/utils/hierarchy.d.ts.map +1 -0
- package/lib/utils/hierarchy.js +31 -33
- package/lib/utils/hierarchy.js.map +1 -1
- package/lib/utils/icons.d.ts +5 -0
- package/lib/utils/icons.d.ts.map +1 -0
- package/lib/utils/icons.js +82 -114
- package/lib/utils/icons.js.map +1 -1
- package/lib/utils/links.d.ts +2 -0
- package/lib/utils/links.d.ts.map +1 -0
- package/lib/utils/links.js +24 -41
- package/lib/utils/links.js.map +1 -1
- package/lib/utils/markdown.d.ts +4 -0
- package/lib/utils/markdown.d.ts.map +1 -0
- package/lib/utils/markdown.js +45 -54
- package/lib/utils/markdown.js.map +1 -1
- package/lib/utils/reexports.d.ts +5 -0
- package/lib/utils/reexports.d.ts.map +1 -0
- package/lib/utils/reexports.js +90 -90
- package/lib/utils/reexports.js.map +1 -1
- package/lib/utils/removeScopes.d.ts +2 -0
- package/lib/utils/removeScopes.d.ts.map +1 -0
- package/lib/utils/removeScopes.js +7 -0
- package/lib/utils/removeScopes.js.map +1 -0
- package/lib/utils/visibility.d.ts +6 -0
- package/lib/utils/visibility.d.ts.map +1 -0
- package/lib/utils/visibility.js +14 -19
- package/lib/utils/visibility.js.map +1 -1
- package/package.json +29 -17
- package/python-scripts/docspec-gen/google_docstring_processor.py +54 -20
- package/src/components/ApiIndex.tsx +1 -1
- package/src/index.ts +2 -2
- package/src/plugin/data.ts +3 -3
- package/src/plugin/python/index.ts +3 -3
- package/src/plugin/python/packageVersions.ts +3 -3
- package/src/plugin/python/transformation.ts +89 -15
- package/src/plugin/python/types.ts +3 -4
- package/src/plugin/sidebar.ts +1 -1
- package/src/plugin/url.ts +1 -1
- package/src/plugin/version.ts +1 -1
- package/src/utils/links.ts +1 -12
- package/src/utils/removeScopes.ts +10 -0
- /package/{assets/styles-8ad572ec.css → lib/components/styles.css} +0 -0
package/lib/utils/reexports.js
CHANGED
|
@@ -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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
103
|
-
//# sourceMappingURL=reexports.js.map
|
|
103
|
+
//# sourceMappingURL=reexports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reexports.js","sources":["../../src/utils/reexports.ts"],"
|
|
1
|
+
{"version":3,"file":"reexports.js","sourceRoot":"","sources":["../../src/utils/reexports.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,cAAc;;;;;;;;;;AAEd,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;AAQpB,SAAS,gBAAgB,CAAC,MAAc;IACpC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAED,SAAe,mBAAmB,CAAC,GAAW;;;QAC1C,OAAO,CAAC,GAAG,CAAC,kCAAkC,GAAG,KAAK,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAElC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,QAAQ,CA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,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 @@
|
|
|
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 @@
|
|
|
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"}
|
package/lib/utils/visibility.js
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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"],"
|
|
1
|
+
{"version":3,"file":"visibility.js","sourceRoot":"","sources":["../../src/utils/visibility.ts"],"names":[],"mappings":"AAGA,+FAA+F;AAC/F,MAAM,UAAU,cAAc,CAAC,EAAU,EAAE,WAAwC;IAClF,MAAM,UAAU,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;IAEnC,OAAO,OAAO,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,KAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,+HAA+H;AAC/H,MAAM,UAAU,kCAAkC,CACjD,QAAuC,EACvC,WAAwC;;IAExC,IAAI,gBAAgB,GAAG,IAAI,CAAC;IAE5B,MAAA,QAAQ,CAAC,QAAQ,0CAAE,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACpC,gBAAgB,KAAhB,gBAAgB,GAAK,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,EAAC;IACzD,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AACzB,CAAC;AAED,4HAA4H;AAC5H,MAAM,UAAU,+BAA+B,CAC9C,KAAiC,EACjC,WAAwC;;IAExC,OAAO,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
|
-
"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
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
"
|
|
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
|
-
"
|
|
109
|
-
"
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
161
|
+
_commit_section()
|
|
142
162
|
else:
|
|
143
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
220
|
+
current_section_lines[-1]["desc"] += "\n" + stripped
|
|
186
221
|
multiline_argument_offset = 0
|
|
187
222
|
else:
|
|
188
|
-
|
|
223
|
+
current_section_lines.append(stripped)
|
|
189
224
|
|
|
190
225
|
_commit()
|
|
191
226
|
node.docstring.content = json.dumps({
|
|
192
|
-
"
|
|
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/
|
|
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';
|
package/src/plugin/data.ts
CHANGED
|
@@ -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.
|