typedoc 0.24.8 → 0.25.1
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 +6 -2
- package/dist/index.js +6 -1
- package/dist/lib/application.d.ts +13 -11
- package/dist/lib/application.js +455 -347
- package/dist/lib/cli.js +29 -22
- 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/linkResolver.d.ts +5 -2
- package/dist/lib/converter/comments/linkResolver.js +21 -13
- package/dist/lib/converter/comments/parser.js +7 -12
- package/dist/lib/converter/comments/tagName.d.ts +8 -0
- package/dist/lib/converter/comments/tagName.js +62 -0
- package/dist/lib/converter/context.js +1 -2
- package/dist/lib/converter/converter.d.ts +12 -10
- package/dist/lib/converter/converter.js +440 -309
- package/dist/lib/converter/factories/index-signature.js +2 -1
- package/dist/lib/converter/factories/signature.js +3 -4
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +8 -8
- package/dist/lib/converter/plugins/CategoryPlugin.js +294 -200
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +8 -5
- package/dist/lib/converter/plugins/CommentPlugin.js +434 -305
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +3 -3
- package/dist/lib/converter/plugins/GroupPlugin.js +216 -145
- package/dist/lib/converter/plugins/ImplementsPlugin.js +240 -192
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +2 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.js +202 -132
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +111 -43
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +6 -4
- package/dist/lib/converter/plugins/PackagePlugin.js +192 -96
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +6 -5
- package/dist/lib/converter/plugins/SourcePlugin.js +239 -132
- package/dist/lib/converter/plugins/TypePlugin.js +148 -101
- package/dist/lib/converter/symbols.js +16 -4
- package/dist/lib/converter/types.js +16 -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 +29 -12
- 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/ReflectionSymbolId.js +1 -1
- package/dist/lib/models/reflections/abstract.d.ts +6 -1
- package/dist/lib/models/reflections/abstract.js +15 -2
- 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 +1 -0
- package/dist/lib/models/reflections/index.d.ts +1 -1
- package/dist/lib/models/reflections/kind.d.ts +4 -4
- package/dist/lib/models/reflections/kind.js +5 -7
- 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.d.ts +1 -0
- package/dist/lib/output/components.js +10 -3
- package/dist/lib/output/events.d.ts +2 -2
- package/dist/lib/output/index.d.ts +1 -1
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +1 -1
- package/dist/lib/output/plugins/AssetsPlugin.js +112 -44
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +2 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +174 -99
- package/dist/lib/output/plugins/NavigationPlugin.d.ts +6 -0
- package/dist/lib/output/plugins/NavigationPlugin.js +109 -0
- package/dist/lib/output/plugins/index.d.ts +2 -1
- package/dist/lib/output/plugins/index.js +5 -3
- package/dist/lib/output/renderer.d.ts +10 -8
- package/dist/lib/output/renderer.js +317 -203
- package/dist/lib/output/theme.d.ts +1 -1
- package/dist/lib/output/theme.js +64 -18
- package/dist/lib/output/themes/MarkedPlugin.d.ts +4 -4
- package/dist/lib/output/themes/MarkedPlugin.js +224 -145
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +14 -1
- package/dist/lib/output/themes/default/DefaultTheme.js +68 -0
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +43 -44
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +16 -11
- package/dist/lib/output/themes/default/layouts/default.js +2 -0
- package/dist/lib/output/themes/default/partials/comment.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/comment.js +16 -14
- package/dist/lib/output/themes/default/partials/footer.js +1 -1
- package/dist/lib/output/themes/default/partials/header.js +2 -2
- package/dist/lib/output/themes/default/partials/icon.d.ts +4 -1
- package/dist/lib/output/themes/default/partials/icon.js +40 -38
- package/dist/lib/output/themes/default/partials/member.js +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.body.js +2 -2
- package/dist/lib/output/themes/default/partials/navigation.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/navigation.js +36 -56
- package/dist/lib/output/themes/default/partials/parameter.js +3 -3
- 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/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +3 -1
- package/dist/lib/utils/entry-point.d.ts +0 -6
- package/dist/lib/utils/entry-point.js +27 -113
- package/dist/lib/utils/events.js +1 -1
- package/dist/lib/utils/general.js +1 -1
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js +2 -1
- package/dist/lib/utils/jsx.d.ts +1 -1
- package/dist/lib/utils/jsx.js +24 -15
- package/dist/lib/utils/options/declaration.d.ts +5 -1
- package/dist/lib/utils/options/declaration.js +1 -1
- package/dist/lib/utils/options/index.d.ts +1 -1
- package/dist/lib/utils/options/index.js +2 -1
- package/dist/lib/utils/options/options.d.ts +22 -9
- package/dist/lib/utils/options/options.js +27 -15
- package/dist/lib/utils/options/readers/tsconfig.js +2 -7
- 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 +25 -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.d.ts +1 -1
- package/dist/lib/utils/perf.js +36 -31
- 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 +4 -3
- package/static/style.css +26 -10
- package/tsdoc.json +16 -0
|
@@ -1,9 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
41
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
42
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
43
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
44
|
+
};
|
|
45
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
46
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
47
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
48
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
49
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
50
|
};
|
|
8
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
52
|
exports.InheritDocPlugin = void 0;
|
|
@@ -28,140 +71,167 @@ const application_events_1 = require("../../application-events");
|
|
|
28
71
|
* - `@typeParam` block
|
|
29
72
|
* - `@return` block
|
|
30
73
|
*/
|
|
31
|
-
let InheritDocPlugin =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
let InheritDocPlugin = (() => {
|
|
75
|
+
var _InheritDocPlugin_validation_accessor_storage;
|
|
76
|
+
let _classDecorators = [(0, components_1.Component)({ name: "inheritDoc" })];
|
|
77
|
+
let _classDescriptor;
|
|
78
|
+
let _classExtraInitializers = [];
|
|
79
|
+
let _classThis;
|
|
80
|
+
let _classSuper = components_1.ConverterComponent;
|
|
81
|
+
let _instanceExtraInitializers = [];
|
|
82
|
+
let _validation_decorators;
|
|
83
|
+
let _validation_initializers = [];
|
|
84
|
+
var InheritDocPlugin = _classThis = class extends _classSuper {
|
|
85
|
+
constructor() {
|
|
86
|
+
super(...arguments);
|
|
87
|
+
_InheritDocPlugin_validation_accessor_storage.set(this, (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _validation_initializers, void 0)));
|
|
88
|
+
// Key is depended on by Values
|
|
89
|
+
this.dependencies = new utils_1.DefaultMap(() => []);
|
|
90
|
+
}
|
|
91
|
+
get validation() { return __classPrivateFieldGet(this, _InheritDocPlugin_validation_accessor_storage, "f"); }
|
|
92
|
+
set validation(value) { __classPrivateFieldSet(this, _InheritDocPlugin_validation_accessor_storage, value, "f"); }
|
|
93
|
+
/**
|
|
94
|
+
* Create a new InheritDocPlugin instance.
|
|
95
|
+
*/
|
|
96
|
+
initialize() {
|
|
97
|
+
this.owner.on(converter_1.Converter.EVENT_RESOLVE_END, (context) => this.processInheritDoc(context.project));
|
|
98
|
+
this.application.on(application_events_1.ApplicationEvents.REVIVE, this.processInheritDoc, this);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Traverse through reflection descendant to check for `inheritDoc` tag.
|
|
102
|
+
* If encountered, the parameter of the tag is used to determine a source reflection
|
|
103
|
+
* that will provide actual comment.
|
|
104
|
+
*/
|
|
105
|
+
processInheritDoc(project) {
|
|
106
|
+
for (const id in project.reflections) {
|
|
107
|
+
const reflection = project.reflections[id];
|
|
108
|
+
const source = extractInheritDocTagReference(reflection);
|
|
109
|
+
if (!source)
|
|
110
|
+
continue;
|
|
111
|
+
const declRef = (0, declarationReference_1.parseDeclarationReference)(source, 0, source.length);
|
|
112
|
+
if (!declRef || /\S/.test(source.substring(declRef[1]))) {
|
|
113
|
+
this.application.logger.warn(`Declaration reference in @inheritDoc for ${reflection.getFriendlyFullName()} was not fully parsed and may resolve incorrectly.`);
|
|
114
|
+
}
|
|
115
|
+
let sourceRefl = declRef && (0, declarationReferenceResolver_1.resolveDeclarationReference)(reflection, declRef[0]);
|
|
116
|
+
if (reflection instanceof models_1.SignatureReflection) {
|
|
117
|
+
// Assumes that if there are overloads, they are declared in the same order as the parent.
|
|
118
|
+
// TS doesn't check this, but if a user messes this up then they are almost
|
|
119
|
+
// guaranteed to run into bugs where they can't call a method on a child class
|
|
120
|
+
// but if they assign (without a type assertion) that child to a variable of the parent class
|
|
121
|
+
// then they can call the method.
|
|
122
|
+
if (sourceRefl instanceof models_1.DeclarationReflection) {
|
|
123
|
+
const index = reflection.parent
|
|
124
|
+
.getAllSignatures()
|
|
125
|
+
.indexOf(reflection);
|
|
126
|
+
sourceRefl =
|
|
127
|
+
sourceRefl.getAllSignatures()[index] || sourceRefl;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (sourceRefl instanceof models_1.DeclarationReflection &&
|
|
131
|
+
sourceRefl.kindOf(models_1.ReflectionKind.Accessor)) {
|
|
132
|
+
// Accessors, like functions, never have comments on their actual root reflection.
|
|
133
|
+
// If the user didn't specify whether to inherit from the getter or setter, then implicitly
|
|
134
|
+
// try to inherit from the getter, #1968.
|
|
135
|
+
sourceRefl = sourceRefl.getSignature || sourceRefl.setSignature;
|
|
71
136
|
}
|
|
137
|
+
if (!sourceRefl) {
|
|
138
|
+
if (this.validation.invalidLink) {
|
|
139
|
+
this.application.logger.warn(`Failed to find "${source}" to inherit the comment from in the comment for ${reflection.getFullName()}`);
|
|
140
|
+
}
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
this.copyComment(sourceRefl, reflection);
|
|
72
144
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
145
|
+
this.createCircularDependencyWarnings();
|
|
146
|
+
this.dependencies.clear();
|
|
147
|
+
}
|
|
148
|
+
copyComment(source, target) {
|
|
149
|
+
if (!target.comment)
|
|
150
|
+
return;
|
|
151
|
+
if (!source.comment &&
|
|
152
|
+
source instanceof models_1.DeclarationReflection &&
|
|
153
|
+
source.signatures) {
|
|
154
|
+
source = source.signatures[0];
|
|
79
155
|
}
|
|
80
|
-
if (!
|
|
81
|
-
|
|
82
|
-
|
|
156
|
+
if (!source.comment &&
|
|
157
|
+
source instanceof models_1.DeclarationReflection &&
|
|
158
|
+
source.type instanceof models_1.ReflectionType &&
|
|
159
|
+
source.type.declaration.signatures) {
|
|
160
|
+
source = source.type.declaration.signatures[0];
|
|
161
|
+
}
|
|
162
|
+
if (!source.comment) {
|
|
163
|
+
this.application.logger.warn(`${target.getFullName()} tried to copy a comment from ${source.getFullName()} with @inheritDoc, but the source has no associated comment.`);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
// If the source also has a @inheritDoc tag, we can't do anything yet.
|
|
167
|
+
// We'll try again later, once we've resolved the source's @inheritDoc reference.
|
|
168
|
+
if (extractInheritDocTagReference(source)) {
|
|
169
|
+
this.dependencies.get(source).push(target);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
target.comment.removeTags("@inheritDoc");
|
|
173
|
+
target.comment.summary = models_1.Comment.cloneDisplayParts(source.comment.summary);
|
|
174
|
+
const remarks = source.comment.getTag("@remarks");
|
|
175
|
+
if (remarks) {
|
|
176
|
+
target.comment.blockTags.unshift(remarks.clone());
|
|
177
|
+
}
|
|
178
|
+
const returns = source.comment.getTag("@returns");
|
|
179
|
+
if (returns) {
|
|
180
|
+
target.comment.blockTags.push(returns.clone());
|
|
181
|
+
}
|
|
182
|
+
if (source instanceof models_1.SignatureReflection &&
|
|
183
|
+
target instanceof models_1.SignatureReflection) {
|
|
184
|
+
copySummaries(source.parameters, target.parameters);
|
|
185
|
+
copySummaries(source.typeParameters, target.typeParameters);
|
|
186
|
+
}
|
|
187
|
+
else if (source instanceof models_1.DeclarationReflection &&
|
|
188
|
+
target instanceof models_1.DeclarationReflection) {
|
|
189
|
+
copySummaries(source.typeParameters, target.typeParameters);
|
|
190
|
+
}
|
|
191
|
+
// Now copy the comment for anyone who depends on me.
|
|
192
|
+
const dependent = this.dependencies.get(target);
|
|
193
|
+
this.dependencies.delete(target);
|
|
194
|
+
for (const target2 of dependent) {
|
|
195
|
+
this.copyComment(target, target2);
|
|
83
196
|
}
|
|
84
|
-
this.copyComment(sourceRefl, reflection);
|
|
85
|
-
}
|
|
86
|
-
this.createCircularDependencyWarnings();
|
|
87
|
-
this.dependencies.clear();
|
|
88
|
-
}
|
|
89
|
-
copyComment(source, target) {
|
|
90
|
-
if (!target.comment)
|
|
91
|
-
return;
|
|
92
|
-
if (!source.comment &&
|
|
93
|
-
source instanceof models_1.DeclarationReflection &&
|
|
94
|
-
source.signatures) {
|
|
95
|
-
source = source.signatures[0];
|
|
96
|
-
}
|
|
97
|
-
if (!source.comment &&
|
|
98
|
-
source instanceof models_1.DeclarationReflection &&
|
|
99
|
-
source.type instanceof models_1.ReflectionType &&
|
|
100
|
-
source.type.declaration.signatures) {
|
|
101
|
-
source = source.type.declaration.signatures[0];
|
|
102
|
-
}
|
|
103
|
-
if (!source.comment) {
|
|
104
|
-
this.application.logger.warn(`${target.getFullName()} tried to copy a comment from ${source.getFullName()} with @inheritDoc, but the source has no associated comment.`);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
// If the source also has a @inheritDoc tag, we can't do anything yet.
|
|
108
|
-
// We'll try again later, once we've resolved the source's @inheritDoc reference.
|
|
109
|
-
if (extractInheritDocTagReference(source)) {
|
|
110
|
-
this.dependencies.get(source).push(target);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
target.comment.removeTags("@inheritDoc");
|
|
114
|
-
target.comment.summary = models_1.Comment.cloneDisplayParts(source.comment.summary);
|
|
115
|
-
const remarks = source.comment.getTag("@remarks");
|
|
116
|
-
if (remarks) {
|
|
117
|
-
target.comment.blockTags.unshift(remarks.clone());
|
|
118
|
-
}
|
|
119
|
-
const returns = source.comment.getTag("@returns");
|
|
120
|
-
if (returns) {
|
|
121
|
-
target.comment.blockTags.push(returns.clone());
|
|
122
|
-
}
|
|
123
|
-
if (source instanceof models_1.SignatureReflection &&
|
|
124
|
-
target instanceof models_1.SignatureReflection) {
|
|
125
|
-
copySummaries(source.parameters, target.parameters);
|
|
126
|
-
copySummaries(source.typeParameters, target.typeParameters);
|
|
127
|
-
}
|
|
128
|
-
else if (source instanceof models_1.DeclarationReflection &&
|
|
129
|
-
target instanceof models_1.DeclarationReflection) {
|
|
130
|
-
copySummaries(source.typeParameters, target.typeParameters);
|
|
131
|
-
}
|
|
132
|
-
// Now copy the comment for anyone who depends on me.
|
|
133
|
-
const dependent = this.dependencies.get(target);
|
|
134
|
-
this.dependencies.delete(target);
|
|
135
|
-
for (const target2 of dependent) {
|
|
136
|
-
this.copyComment(target, target2);
|
|
137
197
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
198
|
+
createCircularDependencyWarnings() {
|
|
199
|
+
const unwarned = new Set(this.dependencies.keys());
|
|
200
|
+
const generateWarning = (orig) => {
|
|
201
|
+
const parts = [orig.name];
|
|
202
|
+
unwarned.delete(orig);
|
|
203
|
+
let work = orig;
|
|
204
|
+
do {
|
|
205
|
+
work = this.dependencies.get(work)[0];
|
|
206
|
+
unwarned.delete(work);
|
|
207
|
+
parts.push(work.name);
|
|
208
|
+
} while (!this.dependencies.get(work).includes(orig));
|
|
209
|
+
parts.push(orig.name);
|
|
210
|
+
this.application.logger.warn(`@inheritDoc specifies a circular inheritance chain: ${parts
|
|
211
|
+
.reverse()
|
|
212
|
+
.join(" -> ")}`);
|
|
213
|
+
};
|
|
214
|
+
for (const orig of this.dependencies.keys()) {
|
|
215
|
+
if (unwarned.has(orig)) {
|
|
216
|
+
generateWarning(orig);
|
|
217
|
+
}
|
|
158
218
|
}
|
|
159
219
|
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
(
|
|
164
|
-
]
|
|
220
|
+
};
|
|
221
|
+
_InheritDocPlugin_validation_accessor_storage = new WeakMap();
|
|
222
|
+
__setFunctionName(_classThis, "InheritDocPlugin");
|
|
223
|
+
(() => {
|
|
224
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
225
|
+
_validation_decorators = [(0, utils_1.Option)("validation")];
|
|
226
|
+
__esDecorate(_classThis, null, _validation_decorators, { kind: "accessor", name: "validation", static: false, private: false, access: { has: obj => "validation" in obj, get: obj => obj.validation, set: (obj, value) => { obj.validation = value; } }, metadata: _metadata }, _validation_initializers, _instanceExtraInitializers);
|
|
227
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
228
|
+
InheritDocPlugin = _classThis = _classDescriptor.value;
|
|
229
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
230
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
231
|
+
})();
|
|
232
|
+
return InheritDocPlugin = _classThis;
|
|
233
|
+
})();
|
|
234
|
+
exports.InheritDocPlugin = InheritDocPlugin;
|
|
165
235
|
function copySummaries(source, target) {
|
|
166
236
|
for (const [s, t] of (0, array_1.zip)(source || [], target || [])) {
|
|
167
237
|
t.comment = new models_1.Comment(s.comment?.summary);
|
|
@@ -6,7 +6,7 @@ import { ProjectReflection } from "../../models";
|
|
|
6
6
|
* A plugin that resolves `{@link Foo}` tags.
|
|
7
7
|
*/
|
|
8
8
|
export declare class LinkResolverPlugin extends ConverterComponent {
|
|
9
|
-
validation: ValidationOptions;
|
|
9
|
+
accessor validation: ValidationOptions;
|
|
10
10
|
initialize(): void;
|
|
11
11
|
onResolve(context: Context): void;
|
|
12
12
|
resolveLinks(project: ProjectReflection): void;
|
|
@@ -1,9 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
41
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
42
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
43
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
44
|
+
};
|
|
45
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
46
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
47
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
48
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
49
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
50
|
};
|
|
8
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
52
|
exports.LinkResolverPlugin = void 0;
|
|
@@ -16,46 +59,71 @@ const application_events_1 = require("../../application-events");
|
|
|
16
59
|
/**
|
|
17
60
|
* A plugin that resolves `{@link Foo}` tags.
|
|
18
61
|
*/
|
|
19
|
-
let LinkResolverPlugin =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
62
|
+
let LinkResolverPlugin = (() => {
|
|
63
|
+
var _LinkResolverPlugin_validation_accessor_storage;
|
|
64
|
+
let _classDecorators = [(0, components_1.Component)({ name: "link-resolver" })];
|
|
65
|
+
let _classDescriptor;
|
|
66
|
+
let _classExtraInitializers = [];
|
|
67
|
+
let _classThis;
|
|
68
|
+
let _classSuper = components_1.ConverterComponent;
|
|
69
|
+
let _instanceExtraInitializers = [];
|
|
70
|
+
let _validation_decorators;
|
|
71
|
+
let _validation_initializers = [];
|
|
72
|
+
var LinkResolverPlugin = _classThis = class extends _classSuper {
|
|
73
|
+
constructor() {
|
|
74
|
+
super(...arguments);
|
|
75
|
+
_LinkResolverPlugin_validation_accessor_storage.set(this, (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _validation_initializers, void 0)));
|
|
76
|
+
}
|
|
77
|
+
get validation() { return __classPrivateFieldGet(this, _LinkResolverPlugin_validation_accessor_storage, "f"); }
|
|
78
|
+
set validation(value) { __classPrivateFieldSet(this, _LinkResolverPlugin_validation_accessor_storage, value, "f"); }
|
|
79
|
+
initialize() {
|
|
80
|
+
super.initialize();
|
|
81
|
+
this.owner.on(converter_events_1.ConverterEvents.RESOLVE_END, this.onResolve, this, -300);
|
|
82
|
+
this.application.on(application_events_1.ApplicationEvents.REVIVE, this.resolveLinks, this, -300);
|
|
37
83
|
}
|
|
38
|
-
|
|
39
|
-
|
|
84
|
+
onResolve(context) {
|
|
85
|
+
this.resolveLinks(context.project);
|
|
40
86
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
87
|
+
resolveLinks(project) {
|
|
88
|
+
for (const id in project.reflections) {
|
|
89
|
+
const reflection = project.reflections[id];
|
|
90
|
+
if (reflection.comment) {
|
|
91
|
+
this.owner.resolveLinks(reflection.comment, reflection);
|
|
92
|
+
}
|
|
93
|
+
if (reflection instanceof models_1.DeclarationReflection &&
|
|
94
|
+
reflection.readme) {
|
|
95
|
+
reflection.readme = this.owner.resolveLinks(reflection.readme, reflection);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (project.readme) {
|
|
99
|
+
project.readme = this.owner.resolveLinks(project.readme, project);
|
|
100
|
+
}
|
|
101
|
+
for (const { type, owner } of (0, reflections_1.discoverAllReferenceTypes)(project, false)) {
|
|
102
|
+
if (!type.reflection) {
|
|
103
|
+
const resolveResult = this.owner.resolveExternalLink(type.toDeclarationReference(), owner, undefined, type.symbolId);
|
|
104
|
+
switch (typeof resolveResult) {
|
|
105
|
+
case "string":
|
|
106
|
+
type.externalUrl = resolveResult;
|
|
107
|
+
break;
|
|
108
|
+
case "object":
|
|
109
|
+
type.externalUrl = resolveResult.target;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
51
112
|
}
|
|
52
113
|
}
|
|
53
114
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
115
|
+
};
|
|
116
|
+
_LinkResolverPlugin_validation_accessor_storage = new WeakMap();
|
|
117
|
+
__setFunctionName(_classThis, "LinkResolverPlugin");
|
|
118
|
+
(() => {
|
|
119
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
120
|
+
_validation_decorators = [(0, utils_1.Option)("validation")];
|
|
121
|
+
__esDecorate(_classThis, null, _validation_decorators, { kind: "accessor", name: "validation", static: false, private: false, access: { has: obj => "validation" in obj, get: obj => obj.validation, set: (obj, value) => { obj.validation = value; } }, metadata: _metadata }, _validation_initializers, _instanceExtraInitializers);
|
|
122
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
123
|
+
LinkResolverPlugin = _classThis = _classDescriptor.value;
|
|
124
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
125
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
126
|
+
})();
|
|
127
|
+
return LinkResolverPlugin = _classThis;
|
|
128
|
+
})();
|
|
129
|
+
exports.LinkResolverPlugin = LinkResolverPlugin;
|
|
@@ -5,10 +5,11 @@ import { EntryPointStrategy } from "../../utils";
|
|
|
5
5
|
* current project.
|
|
6
6
|
*/
|
|
7
7
|
export declare class PackagePlugin extends ConverterComponent {
|
|
8
|
-
readme: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
accessor readme: string;
|
|
9
|
+
accessor stripYamlFrontmatter: boolean;
|
|
10
|
+
accessor entryPointStrategy: EntryPointStrategy;
|
|
11
|
+
accessor entryPoints: string[];
|
|
12
|
+
accessor includeVersion: boolean;
|
|
12
13
|
/**
|
|
13
14
|
* The file name of the found readme.md file.
|
|
14
15
|
*/
|
|
@@ -24,6 +25,7 @@ export declare class PackagePlugin extends ConverterComponent {
|
|
|
24
25
|
initialize(): void;
|
|
25
26
|
private onRevive;
|
|
26
27
|
private onBegin;
|
|
28
|
+
private processReadmeContents;
|
|
27
29
|
private onBeginResolve;
|
|
28
30
|
private addEntries;
|
|
29
31
|
}
|