typedoc 0.24.7 → 0.25.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 +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -1
- package/dist/lib/application.d.ts +16 -5
- package/dist/lib/application.js +53 -18
- package/dist/lib/cli.js +25 -21
- package/dist/lib/converter/comments/blockLexer.js +10 -1
- package/dist/lib/converter/comments/declarationReference.js +2 -0
- package/dist/lib/converter/comments/declarationReferenceResolver.js +2 -1
- package/dist/lib/converter/comments/discovery.js +0 -1
- package/dist/lib/converter/comments/lexer.js +1 -1
- package/dist/lib/converter/comments/linkResolver.d.ts +5 -2
- package/dist/lib/converter/comments/linkResolver.js +21 -13
- package/dist/lib/converter/comments/parser.js +2 -1
- package/dist/lib/converter/converter.d.ts +2 -0
- package/dist/lib/converter/converter.js +14 -9
- package/dist/lib/converter/factories/index-signature.js +2 -1
- package/dist/lib/converter/plugins/CategoryPlugin.js +2 -2
- package/dist/lib/converter/plugins/CommentPlugin.js +8 -4
- package/dist/lib/converter/plugins/GroupPlugin.js +3 -3
- package/dist/lib/converter/plugins/ImplementsPlugin.js +8 -6
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +2 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.js +11 -5
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +4 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +2 -2
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +1 -0
- package/dist/lib/converter/plugins/SourcePlugin.js +31 -13
- package/dist/lib/converter/plugins/TypePlugin.js +12 -11
- package/dist/lib/converter/symbols.js +15 -3
- package/dist/lib/converter/types.js +6 -1
- package/dist/lib/converter/utils/nodes.d.ts +2 -2
- package/dist/lib/converter/utils/repository.d.ts +15 -5
- package/dist/lib/converter/utils/repository.js +28 -11
- package/dist/lib/models/ReflectionGroup.d.ts +4 -2
- package/dist/lib/models/ReflectionGroup.js +3 -1
- package/dist/lib/models/comments/comment.d.ts +9 -2
- package/dist/lib/models/comments/comment.js +2 -0
- package/dist/lib/models/reflections/abstract.d.ts +2 -1
- package/dist/lib/models/reflections/abstract.js +4 -3
- package/dist/lib/models/reflections/container.d.ts +3 -0
- package/dist/lib/models/reflections/container.js +4 -1
- package/dist/lib/models/reflections/declaration.d.ts +1 -0
- package/dist/lib/models/reflections/declaration.js +2 -1
- package/dist/lib/models/reflections/kind.d.ts +4 -4
- package/dist/lib/models/reflections/kind.js +7 -9
- package/dist/lib/models/reflections/parameter.d.ts +3 -0
- package/dist/lib/models/reflections/parameter.js +3 -0
- package/dist/lib/models/reflections/project.d.ts +1 -0
- package/dist/lib/models/reflections/project.js +3 -1
- package/dist/lib/models/reflections/reference.d.ts +1 -0
- package/dist/lib/models/reflections/reference.js +1 -0
- package/dist/lib/models/reflections/signature.d.ts +3 -0
- package/dist/lib/models/reflections/signature.js +3 -0
- package/dist/lib/models/reflections/type-parameter.d.ts +3 -0
- package/dist/lib/models/reflections/type-parameter.js +3 -0
- package/dist/lib/models/sources/file.d.ts +2 -0
- package/dist/lib/models/sources/file.js +5 -0
- package/dist/lib/models/types.d.ts +24 -0
- package/dist/lib/models/types.js +21 -0
- package/dist/lib/output/components.js +2 -3
- package/dist/lib/output/events.d.ts +8 -2
- package/dist/lib/output/events.js +10 -4
- package/dist/lib/output/plugins/AssetsPlugin.js +2 -2
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +2 -2
- package/dist/lib/output/renderer.d.ts +2 -0
- package/dist/lib/output/renderer.js +7 -2
- package/dist/lib/output/theme.d.ts +1 -1
- package/dist/lib/output/theme.js +2 -2
- package/dist/lib/output/themes/MarkedPlugin.js +5 -3
- package/dist/lib/output/themes/default/DefaultTheme.js +1 -1
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +4 -8
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +3 -9
- package/dist/lib/output/themes/default/partials/comment.d.ts +3 -1
- package/dist/lib/output/themes/default/partials/comment.js +30 -10
- package/dist/lib/output/themes/default/partials/footer.js +1 -1
- package/dist/lib/output/themes/default/partials/header.js +1 -1
- package/dist/lib/output/themes/default/partials/icon.js +8 -12
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/member.declaration.js +34 -21
- package/dist/lib/output/themes/default/partials/member.js +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.body.js +6 -4
- package/dist/lib/output/themes/default/partials/navigation.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/navigation.js +28 -15
- package/dist/lib/output/themes/default/partials/parameter.js +11 -7
- package/dist/lib/output/themes/default/partials/typeParameters.js +2 -1
- package/dist/lib/output/themes/default/templates/reflection.js +5 -2
- package/dist/lib/output/themes/lib.d.ts +1 -2
- package/dist/lib/output/themes/lib.js +1 -11
- package/dist/lib/serialization/schema.d.ts +37 -1
- package/dist/lib/serialization/serializer.js +1 -1
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +1 -1
- package/dist/lib/utils/entry-point.d.ts +0 -6
- package/dist/lib/utils/entry-point.js +0 -99
- package/dist/lib/utils/jsx.d.ts +4 -1
- package/dist/lib/utils/jsx.js +30 -16
- package/dist/lib/utils/loggers.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +4 -1
- package/dist/lib/utils/options/declaration.js +3 -3
- package/dist/lib/utils/options/options.d.ts +3 -9
- package/dist/lib/utils/options/options.js +5 -13
- package/dist/lib/utils/options/readers/typedoc.d.ts +4 -2
- package/dist/lib/utils/options/readers/typedoc.js +33 -7
- package/dist/lib/utils/options/sources/typedoc.js +15 -4
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
- package/dist/lib/utils/options/tsdoc-defaults.js +4 -0
- package/dist/lib/utils/package-manifest.d.ts +0 -25
- package/dist/lib/utils/package-manifest.js +7 -148
- package/dist/lib/utils/perf.js +26 -11
- package/dist/lib/utils/sort.js +0 -1
- package/dist/lib/validation/links.js +10 -2
- package/package.json +12 -12
- package/static/main.js +1 -1
- package/static/style.css +19 -7
- package/tsdoc.json +16 -0
package/dist/lib/utils/jsx.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @module
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.renderElement = exports.createElement = exports.Raw = exports.Fragment = void 0;
|
|
17
|
+
exports.renderElement = exports.setRenderSettings = exports.createElement = exports.Raw = exports.Fragment = void 0;
|
|
18
18
|
const html_1 = require("./html");
|
|
19
19
|
const jsx_elements_1 = require("./jsx.elements");
|
|
20
20
|
var jsx_elements_2 = require("./jsx.elements");
|
|
@@ -71,7 +71,12 @@ function createElement(tag, props, ...children) {
|
|
|
71
71
|
return { tag, props, children };
|
|
72
72
|
}
|
|
73
73
|
exports.createElement = createElement;
|
|
74
|
-
|
|
74
|
+
let renderPretty = true;
|
|
75
|
+
function setRenderSettings(options) {
|
|
76
|
+
renderPretty = options.pretty;
|
|
77
|
+
}
|
|
78
|
+
exports.setRenderSettings = setRenderSettings;
|
|
79
|
+
const renderElement = function renderElement(element) {
|
|
75
80
|
if (!element) {
|
|
76
81
|
return "";
|
|
77
82
|
}
|
|
@@ -82,22 +87,27 @@ function renderElement(element) {
|
|
|
82
87
|
}
|
|
83
88
|
return renderElement(tag(Object.assign({ children }, props)));
|
|
84
89
|
}
|
|
85
|
-
|
|
90
|
+
let html = "";
|
|
86
91
|
if (tag !== jsx_elements_1.JsxFragment) {
|
|
87
|
-
if (blockElements.has(tag)) {
|
|
88
|
-
html
|
|
92
|
+
if (blockElements.has(tag) && renderPretty) {
|
|
93
|
+
html += "\n";
|
|
89
94
|
}
|
|
90
|
-
html
|
|
95
|
+
html += "<";
|
|
96
|
+
html += tag;
|
|
91
97
|
for (const [key, val] of Object.entries(props ?? {})) {
|
|
92
98
|
if (val == null)
|
|
93
99
|
continue;
|
|
94
100
|
if (typeof val == "boolean") {
|
|
95
101
|
if (val) {
|
|
96
|
-
html
|
|
102
|
+
html += " ";
|
|
103
|
+
html += key;
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
else {
|
|
100
|
-
html
|
|
107
|
+
html += " ";
|
|
108
|
+
html += key;
|
|
109
|
+
html += "=";
|
|
110
|
+
html += JSON.stringify(val);
|
|
101
111
|
}
|
|
102
112
|
}
|
|
103
113
|
}
|
|
@@ -105,23 +115,27 @@ function renderElement(element) {
|
|
|
105
115
|
if (children.length) {
|
|
106
116
|
hasChildren = true;
|
|
107
117
|
if (tag !== jsx_elements_1.JsxFragment)
|
|
108
|
-
html
|
|
118
|
+
html += ">";
|
|
109
119
|
renderChildren(children);
|
|
110
120
|
}
|
|
111
121
|
if (tag !== jsx_elements_1.JsxFragment) {
|
|
112
122
|
if (!hasChildren) {
|
|
113
123
|
if (voidElements.has(tag)) {
|
|
114
|
-
html
|
|
124
|
+
html += "/>";
|
|
115
125
|
}
|
|
116
126
|
else {
|
|
117
|
-
html
|
|
127
|
+
html += "></";
|
|
128
|
+
html += tag;
|
|
129
|
+
html += ">";
|
|
118
130
|
}
|
|
119
131
|
}
|
|
120
132
|
else {
|
|
121
|
-
html
|
|
133
|
+
html += "</";
|
|
134
|
+
html += tag;
|
|
135
|
+
html += ">";
|
|
122
136
|
}
|
|
123
137
|
}
|
|
124
|
-
return html
|
|
138
|
+
return html;
|
|
125
139
|
function renderChildren(children) {
|
|
126
140
|
for (const child of children) {
|
|
127
141
|
if (!child)
|
|
@@ -130,12 +144,12 @@ function renderElement(element) {
|
|
|
130
144
|
renderChildren(child);
|
|
131
145
|
}
|
|
132
146
|
else if (typeof child === "string" || typeof child === "number") {
|
|
133
|
-
html
|
|
147
|
+
html += (0, html_1.escapeHtml)(child.toString());
|
|
134
148
|
}
|
|
135
149
|
else {
|
|
136
|
-
html
|
|
150
|
+
html += renderElement(child);
|
|
137
151
|
}
|
|
138
152
|
}
|
|
139
153
|
}
|
|
140
|
-
}
|
|
154
|
+
};
|
|
141
155
|
exports.renderElement = renderElement;
|
|
@@ -19,7 +19,7 @@ var LogLevel;
|
|
|
19
19
|
LogLevel[LogLevel["Warn"] = 2] = "Warn";
|
|
20
20
|
LogLevel[LogLevel["Error"] = 3] = "Error";
|
|
21
21
|
LogLevel[LogLevel["None"] = 4] = "None";
|
|
22
|
-
})(LogLevel
|
|
22
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
23
23
|
const Colors = {
|
|
24
24
|
red: "\u001b[91m",
|
|
25
25
|
yellow: "\u001b[93m",
|
|
@@ -75,6 +75,7 @@ export interface TypeDocOptionMap {
|
|
|
75
75
|
includeVersion: boolean;
|
|
76
76
|
disableSources: boolean;
|
|
77
77
|
sourceLinkTemplate: string;
|
|
78
|
+
disableGit: boolean;
|
|
78
79
|
gitRevision: string;
|
|
79
80
|
gitRemote: string;
|
|
80
81
|
readme: string;
|
|
@@ -103,6 +104,7 @@ export interface TypeDocOptionMap {
|
|
|
103
104
|
navigation: {
|
|
104
105
|
includeCategories: boolean;
|
|
105
106
|
includeGroups: boolean;
|
|
107
|
+
fullTree: boolean;
|
|
106
108
|
};
|
|
107
109
|
visibilityFilters: ManuallyValidatedOption<{
|
|
108
110
|
protected?: boolean;
|
|
@@ -115,6 +117,7 @@ export interface TypeDocOptionMap {
|
|
|
115
117
|
searchGroupBoosts: ManuallyValidatedOption<Record<string, number>>;
|
|
116
118
|
commentStyle: typeof CommentStyle;
|
|
117
119
|
useTsLinkResolution: boolean;
|
|
120
|
+
preserveLinkText: boolean;
|
|
118
121
|
jsDocCompatibility: JsDocCompatibility;
|
|
119
122
|
blockTags: `@${string}`[];
|
|
120
123
|
inlineTags: `@${string}`[];
|
|
@@ -222,7 +225,7 @@ export declare enum ParameterType {
|
|
|
222
225
|
*/
|
|
223
226
|
GlobArray = 9,
|
|
224
227
|
/**
|
|
225
|
-
* An
|
|
228
|
+
* An object which partially merges user-set values into the defaults.
|
|
226
229
|
*/
|
|
227
230
|
Object = 10,
|
|
228
231
|
/**
|
|
@@ -22,7 +22,7 @@ var ParameterHint;
|
|
|
22
22
|
(function (ParameterHint) {
|
|
23
23
|
ParameterHint[ParameterHint["File"] = 0] = "File";
|
|
24
24
|
ParameterHint[ParameterHint["Directory"] = 1] = "Directory";
|
|
25
|
-
})(ParameterHint
|
|
25
|
+
})(ParameterHint || (exports.ParameterHint = ParameterHint = {}));
|
|
26
26
|
var ParameterType;
|
|
27
27
|
(function (ParameterType) {
|
|
28
28
|
ParameterType[ParameterType["String"] = 0] = "String";
|
|
@@ -48,14 +48,14 @@ var ParameterType;
|
|
|
48
48
|
*/
|
|
49
49
|
ParameterType[ParameterType["GlobArray"] = 9] = "GlobArray";
|
|
50
50
|
/**
|
|
51
|
-
* An
|
|
51
|
+
* An object which partially merges user-set values into the defaults.
|
|
52
52
|
*/
|
|
53
53
|
ParameterType[ParameterType["Object"] = 10] = "Object";
|
|
54
54
|
/**
|
|
55
55
|
* An object with true/false flags
|
|
56
56
|
*/
|
|
57
57
|
ParameterType[ParameterType["Flags"] = 11] = "Flags";
|
|
58
|
-
})(ParameterType
|
|
58
|
+
})(ParameterType || (exports.ParameterType = ParameterType = {}));
|
|
59
59
|
const converters = {
|
|
60
60
|
[ParameterType.String](value, option) {
|
|
61
61
|
const stringValue = value == null ? "" : String(value);
|
|
@@ -38,7 +38,7 @@ export interface OptionsReader {
|
|
|
38
38
|
* @param logger logger to be used to report errors
|
|
39
39
|
* @param cwd the directory which should be treated as the current working directory for option file discovery
|
|
40
40
|
*/
|
|
41
|
-
read(container: Options, logger: Logger, cwd: string): void
|
|
41
|
+
read(container: Options, logger: Logger, cwd: string): void | Promise<void>;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Maintains a collection of option declarations split into TypeDoc options
|
|
@@ -68,12 +68,11 @@ export declare class Options {
|
|
|
68
68
|
private _compilerOptions;
|
|
69
69
|
private _fileNames;
|
|
70
70
|
private _projectReferences;
|
|
71
|
-
private _logger;
|
|
72
71
|
/**
|
|
73
72
|
* In packages mode, the directory of the package being converted.
|
|
74
73
|
*/
|
|
75
74
|
packageDir?: string;
|
|
76
|
-
constructor(
|
|
75
|
+
constructor();
|
|
77
76
|
/**
|
|
78
77
|
* Clones the options, intended for use in packages mode.
|
|
79
78
|
*/
|
|
@@ -100,11 +99,6 @@ export declare class Options {
|
|
|
100
99
|
restore(snapshot: {
|
|
101
100
|
__optionSnapshot: never;
|
|
102
101
|
}): void;
|
|
103
|
-
/**
|
|
104
|
-
* Sets the logger used when an option declaration fails to be added.
|
|
105
|
-
* @param logger
|
|
106
|
-
*/
|
|
107
|
-
setLogger(logger: Logger): void;
|
|
108
102
|
/**
|
|
109
103
|
* Resets the option bag to all default values.
|
|
110
104
|
* If a name is provided, will only reset that name.
|
|
@@ -117,7 +111,7 @@ export declare class Options {
|
|
|
117
111
|
* @param reader
|
|
118
112
|
*/
|
|
119
113
|
addReader(reader: OptionsReader): void;
|
|
120
|
-
read(logger: Logger, cwd?: string): void
|
|
114
|
+
read(logger: Logger, cwd?: string): Promise<void>;
|
|
121
115
|
/**
|
|
122
116
|
* Adds an option declaration to the container with extra type checking to ensure that
|
|
123
117
|
* the runtime type is consistent with the declared type.
|
|
@@ -28,7 +28,7 @@ const optionSnapshots = new WeakMap();
|
|
|
28
28
|
* files.
|
|
29
29
|
*/
|
|
30
30
|
class Options {
|
|
31
|
-
constructor(
|
|
31
|
+
constructor() {
|
|
32
32
|
this._readers = [];
|
|
33
33
|
this._declarations = new Map();
|
|
34
34
|
this._values = {};
|
|
@@ -36,14 +36,13 @@ class Options {
|
|
|
36
36
|
this._compilerOptions = {};
|
|
37
37
|
this._fileNames = [];
|
|
38
38
|
this._projectReferences = [];
|
|
39
|
-
this._logger = logger;
|
|
40
39
|
(0, sources_1.addTypeDocOptions)(this);
|
|
41
40
|
}
|
|
42
41
|
/**
|
|
43
42
|
* Clones the options, intended for use in packages mode.
|
|
44
43
|
*/
|
|
45
44
|
copyForPackage(packageDir) {
|
|
46
|
-
const options = new Options(
|
|
45
|
+
const options = new Options();
|
|
47
46
|
options.packageDir = packageDir;
|
|
48
47
|
options._readers = this._readers.filter((reader) => reader.supportsPackages);
|
|
49
48
|
options._declarations = new Map(this._declarations);
|
|
@@ -82,13 +81,6 @@ class Options {
|
|
|
82
81
|
this._values = JSON.parse(data.values);
|
|
83
82
|
this._setOptions = new Set(data.set);
|
|
84
83
|
}
|
|
85
|
-
/**
|
|
86
|
-
* Sets the logger used when an option declaration fails to be added.
|
|
87
|
-
* @param logger
|
|
88
|
-
*/
|
|
89
|
-
setLogger(logger) {
|
|
90
|
-
this._logger = logger;
|
|
91
|
-
}
|
|
92
84
|
reset(name) {
|
|
93
85
|
if (name != null) {
|
|
94
86
|
const declaration = this.getDeclaration(name);
|
|
@@ -115,15 +107,15 @@ class Options {
|
|
|
115
107
|
addReader(reader) {
|
|
116
108
|
(0, array_1.insertOrderSorted)(this._readers, reader);
|
|
117
109
|
}
|
|
118
|
-
read(logger, cwd = process.cwd()) {
|
|
110
|
+
async read(logger, cwd = process.cwd()) {
|
|
119
111
|
for (const reader of this._readers) {
|
|
120
|
-
reader.read(this, logger, cwd);
|
|
112
|
+
await reader.read(this, logger, cwd);
|
|
121
113
|
}
|
|
122
114
|
}
|
|
123
115
|
addDeclaration(declaration) {
|
|
124
116
|
const decl = this.getDeclaration(declaration.name);
|
|
125
117
|
if (decl) {
|
|
126
|
-
|
|
118
|
+
throw new Error(`The option ${declaration.name} has already been registered`);
|
|
127
119
|
}
|
|
128
120
|
else {
|
|
129
121
|
this._declarations.set(declaration.name, declaration);
|
|
@@ -3,7 +3,9 @@ import type { Logger } from "../../loggers";
|
|
|
3
3
|
import type { Options } from "../options";
|
|
4
4
|
/**
|
|
5
5
|
* Obtains option values from typedoc.json
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* Changes need to happen here at some point. I think we should follow ESLint's new config
|
|
8
|
+
* system eventually: https://eslint.org/blog/2022/08/new-config-system-part-1/
|
|
7
9
|
*/
|
|
8
10
|
export declare class TypeDocReader implements OptionsReader {
|
|
9
11
|
/**
|
|
@@ -15,7 +17,7 @@ export declare class TypeDocReader implements OptionsReader {
|
|
|
15
17
|
/**
|
|
16
18
|
* Read user configuration from a typedoc.json or typedoc.js configuration file.
|
|
17
19
|
*/
|
|
18
|
-
read(container: Options, logger: Logger, cwd: string): void
|
|
20
|
+
read(container: Options, logger: Logger, cwd: string): Promise<void>;
|
|
19
21
|
/**
|
|
20
22
|
* Read the given options file + any extended files.
|
|
21
23
|
* @param file
|
|
@@ -34,9 +34,12 @@ const assert_1 = require("assert");
|
|
|
34
34
|
const paths_1 = require("../../paths");
|
|
35
35
|
const fs_1 = require("../../fs");
|
|
36
36
|
const module_1 = require("module");
|
|
37
|
+
const url_1 = require("url");
|
|
37
38
|
/**
|
|
38
39
|
* Obtains option values from typedoc.json
|
|
39
|
-
*
|
|
40
|
+
*
|
|
41
|
+
* Changes need to happen here at some point. I think we should follow ESLint's new config
|
|
42
|
+
* system eventually: https://eslint.org/blog/2022/08/new-config-system-part-1/
|
|
40
43
|
*/
|
|
41
44
|
class TypeDocReader {
|
|
42
45
|
constructor() {
|
|
@@ -50,7 +53,7 @@ class TypeDocReader {
|
|
|
50
53
|
/**
|
|
51
54
|
* Read user configuration from a typedoc.json or typedoc.js configuration file.
|
|
52
55
|
*/
|
|
53
|
-
read(container, logger, cwd) {
|
|
56
|
+
async read(container, logger, cwd) {
|
|
54
57
|
const path = container.getValue("options") || cwd;
|
|
55
58
|
const file = this.findTypedocFile(path);
|
|
56
59
|
if (!file) {
|
|
@@ -60,7 +63,7 @@ class TypeDocReader {
|
|
|
60
63
|
return;
|
|
61
64
|
}
|
|
62
65
|
const seen = new Set();
|
|
63
|
-
this.readFile(file, container, logger, seen);
|
|
66
|
+
await this.readFile(file, container, logger, seen);
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
66
69
|
* Read the given options file + any extended files.
|
|
@@ -68,7 +71,7 @@ class TypeDocReader {
|
|
|
68
71
|
* @param container
|
|
69
72
|
* @param logger
|
|
70
73
|
*/
|
|
71
|
-
readFile(file, container, logger, seen) {
|
|
74
|
+
async readFile(file, container, logger, seen) {
|
|
72
75
|
if (seen.has(file)) {
|
|
73
76
|
logger.error(`Tried to load the options file ${(0, paths_1.nicePath)(file)} multiple times.`);
|
|
74
77
|
return;
|
|
@@ -86,8 +89,27 @@ class TypeDocReader {
|
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
else {
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
try {
|
|
93
|
+
try {
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
95
|
+
fileContent = await require(file);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (error?.code === "ERR_REQUIRE_ESM") {
|
|
99
|
+
// On Windows, we need to ensure this path is a file path.
|
|
100
|
+
// Or we'll get ERR_UNSUPPORTED_ESM_URL_SCHEME
|
|
101
|
+
const esmPath = (0, url_1.pathToFileURL)(file).toString();
|
|
102
|
+
fileContent = await (await import(esmPath)).default;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
logger.error(`Failed to read ${(0, paths_1.nicePath)(file)}: ${error instanceof Error ? error.message : error}`);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
91
113
|
}
|
|
92
114
|
if (typeof fileContent !== "object" || !fileContent) {
|
|
93
115
|
logger.error(`The root value of ${(0, paths_1.nicePath)(file)} is not an object.`);
|
|
@@ -108,7 +130,7 @@ class TypeDocReader {
|
|
|
108
130
|
logger.error(`Failed to resolve ${extendedFile} to a file in ${(0, paths_1.nicePath)(file)}`);
|
|
109
131
|
continue;
|
|
110
132
|
}
|
|
111
|
-
this.readFile(resolvedParent, container, logger, seen);
|
|
133
|
+
await this.readFile(resolvedParent, container, logger, seen);
|
|
112
134
|
}
|
|
113
135
|
delete data["extends"];
|
|
114
136
|
}
|
|
@@ -138,14 +160,18 @@ class TypeDocReader {
|
|
|
138
160
|
(0, path_1.join)(path, "typedoc.jsonc"),
|
|
139
161
|
(0, path_1.join)(path, "typedoc.config.js"),
|
|
140
162
|
(0, path_1.join)(path, "typedoc.config.cjs"),
|
|
163
|
+
(0, path_1.join)(path, "typedoc.config.mjs"),
|
|
141
164
|
(0, path_1.join)(path, "typedoc.js"),
|
|
142
165
|
(0, path_1.join)(path, "typedoc.cjs"),
|
|
166
|
+
(0, path_1.join)(path, "typedoc.mjs"),
|
|
143
167
|
(0, path_1.join)(path, ".config/typedoc.json"),
|
|
144
168
|
(0, path_1.join)(path, ".config/typedoc.jsonc"),
|
|
145
169
|
(0, path_1.join)(path, ".config/typedoc.config.js"),
|
|
146
170
|
(0, path_1.join)(path, ".config/typedoc.config.cjs"),
|
|
171
|
+
(0, path_1.join)(path, ".config/typedoc.config.mjs"),
|
|
147
172
|
(0, path_1.join)(path, ".config/typedoc.js"),
|
|
148
173
|
(0, path_1.join)(path, ".config/typedoc.cjs"),
|
|
174
|
+
(0, path_1.join)(path, ".config/typedoc.mjs"),
|
|
149
175
|
].find(fs_1.isFile);
|
|
150
176
|
}
|
|
151
177
|
}
|
|
@@ -111,7 +111,6 @@ function addTypeDocOptions(options) {
|
|
|
111
111
|
kind_1.ReflectionKind.TypeLiteral,
|
|
112
112
|
kind_1.ReflectionKind.TypeParameter,
|
|
113
113
|
kind_1.ReflectionKind.Parameter,
|
|
114
|
-
kind_1.ReflectionKind.ObjectLiteral,
|
|
115
114
|
]) {
|
|
116
115
|
valid.delete(kind_1.ReflectionKind[notPermitted]);
|
|
117
116
|
}
|
|
@@ -322,13 +321,18 @@ function addTypeDocOptions(options) {
|
|
|
322
321
|
name: "sourceLinkTemplate",
|
|
323
322
|
help: "Specify a link template to be used when generating source urls. If not set, will be automatically created using the git remote. Supports {path}, {line}, {gitRevision} placeholders.",
|
|
324
323
|
});
|
|
324
|
+
options.addDeclaration({
|
|
325
|
+
name: "disableGit",
|
|
326
|
+
help: "Assume that all can be linked to with the sourceLinkTemplate, sourceLinkTemplate must be set if this is enabled. {path} will be rooted at basePath",
|
|
327
|
+
type: declaration_1.ParameterType.Boolean,
|
|
328
|
+
});
|
|
325
329
|
options.addDeclaration({
|
|
326
330
|
name: "gitRevision",
|
|
327
|
-
help: "Use specified revision instead of the last revision for linking to GitHub/Bitbucket source files.",
|
|
331
|
+
help: "Use specified revision instead of the last revision for linking to GitHub/Bitbucket source files. Has no effect if disableSources is set.",
|
|
328
332
|
});
|
|
329
333
|
options.addDeclaration({
|
|
330
334
|
name: "gitRemote",
|
|
331
|
-
help: "Use the specified remote for linking to GitHub/Bitbucket source files.",
|
|
335
|
+
help: "Use the specified remote for linking to GitHub/Bitbucket source files. Has no effect if disableGit or disableSources is set.",
|
|
332
336
|
defaultValue: "origin",
|
|
333
337
|
});
|
|
334
338
|
options.addDeclaration({
|
|
@@ -414,6 +418,7 @@ function addTypeDocOptions(options) {
|
|
|
414
418
|
defaults: {
|
|
415
419
|
includeCategories: false,
|
|
416
420
|
includeGroups: false,
|
|
421
|
+
fullTree: false,
|
|
417
422
|
},
|
|
418
423
|
});
|
|
419
424
|
options.addDeclaration({
|
|
@@ -499,6 +504,12 @@ function addTypeDocOptions(options) {
|
|
|
499
504
|
type: declaration_1.ParameterType.Boolean,
|
|
500
505
|
defaultValue: true,
|
|
501
506
|
});
|
|
507
|
+
options.addDeclaration({
|
|
508
|
+
name: "preserveLinkText",
|
|
509
|
+
help: "If set, @link tags without link text will use the text content as the link. If not set, will use the target reflection name.",
|
|
510
|
+
type: declaration_1.ParameterType.Boolean,
|
|
511
|
+
defaultValue: true,
|
|
512
|
+
});
|
|
502
513
|
options.addDeclaration({
|
|
503
514
|
name: "blockTags",
|
|
504
515
|
help: "Block tags which TypeDoc should recognize when parsing comments.",
|
|
@@ -539,7 +550,7 @@ function addTypeDocOptions(options) {
|
|
|
539
550
|
name: "categorizeByGroup",
|
|
540
551
|
help: "Specify whether categorization will be done at the group level.",
|
|
541
552
|
type: declaration_1.ParameterType.Boolean,
|
|
542
|
-
defaultValue:
|
|
553
|
+
defaultValue: false,
|
|
543
554
|
});
|
|
544
555
|
options.addDeclaration({
|
|
545
556
|
name: "defaultCategory",
|
|
@@ -3,4 +3,4 @@ export declare const blockTags: readonly ["@deprecated", "@param", "@remarks", "
|
|
|
3
3
|
export declare const tsdocInlineTags: readonly ["@link", "@inheritDoc", "@label"];
|
|
4
4
|
export declare const inlineTags: string[];
|
|
5
5
|
export declare const tsdocModifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual"];
|
|
6
|
-
export declare const modifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual", "@hidden", "@ignore", "@enum", "@event", "@overload", "@namespace", "@interface"];
|
|
6
|
+
export declare const modifierTags: readonly ["@public", "@private", "@protected", "@internal", "@readonly", "@packageDocumentation", "@eventProperty", "@alpha", "@beta", "@experimental", "@sealed", "@override", "@virtual", "@hidden", "@ignore", "@enum", "@event", "@overload", "@namespace", "@interface", "@showCategories", "@hideCategories", "@showGroups", "@hideGroups"];
|
|
@@ -1,36 +1,11 @@
|
|
|
1
1
|
import type { Logger } from "./loggers";
|
|
2
2
|
import type { Minimatch } from "minimatch";
|
|
3
|
-
import { additionalProperties, Infer } from "./validation";
|
|
4
3
|
/**
|
|
5
4
|
* Loads a package.json and validates that it is a JSON Object
|
|
6
5
|
*/
|
|
7
6
|
export declare function loadPackageManifest(logger: Logger, packageJsonPath: string): Record<string, unknown> | undefined;
|
|
8
|
-
declare const typedocPackageManifestConfigSchema: {
|
|
9
|
-
displayName: import("./validation").Optional<StringConstructor>;
|
|
10
|
-
entryPoint: import("./validation").Optional<StringConstructor>;
|
|
11
|
-
readmeFile: import("./validation").Optional<StringConstructor>;
|
|
12
|
-
tsconfig: import("./validation").Optional<StringConstructor>;
|
|
13
|
-
[additionalProperties]: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type TypedocPackageManifestConfig = Infer<typeof typedocPackageManifestConfigSchema>;
|
|
16
|
-
/**
|
|
17
|
-
* Extracts typedoc specific config from a specified package manifest
|
|
18
|
-
*/
|
|
19
|
-
export declare function extractTypedocConfigFromPackageManifest(logger: Logger, packageJsonPath: string): TypedocPackageManifestConfig | undefined;
|
|
20
7
|
/**
|
|
21
8
|
* Given a list of (potentially wildcarded) package paths,
|
|
22
9
|
* return all the actual package folders found.
|
|
23
10
|
*/
|
|
24
11
|
export declare function expandPackages(logger: Logger, packageJsonDir: string, workspaces: string[], exclude: Minimatch[]): string[];
|
|
25
|
-
export declare const ignorePackage: unique symbol;
|
|
26
|
-
/**
|
|
27
|
-
* Given a package.json, attempt to find the TS file that defines its entry point
|
|
28
|
-
* The JS must be built with sourcemaps.
|
|
29
|
-
*
|
|
30
|
-
* When the TS file cannot be determined, the intention is to
|
|
31
|
-
* - Ignore things which don't appear to be `require`-able node packages.
|
|
32
|
-
* - Fail on things which appear to be `require`-able node packages but are missing
|
|
33
|
-
* the necessary metadata for us to document.
|
|
34
|
-
*/
|
|
35
|
-
export declare function getTsEntryPointForPackage(logger: Logger, packageJsonPath: string, packageJson: Record<string, unknown>): string | undefined | typeof ignorePackage;
|
|
36
|
-
export {};
|