typedoc 0.27.7 → 0.27.9
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/dist/lib/application.js +1 -1
- package/dist/lib/internationalization/internationalization.js +3 -1
- package/dist/lib/internationalization/locales/en.cjs +4 -1
- package/dist/lib/internationalization/locales/en.d.cts +4 -1
- package/dist/lib/output/formatter.js +6 -1
- package/dist/lib/output/plugins/AssetsPlugin.js +2 -1
- package/dist/lib/output/themes/MarkedPlugin.js +5 -3
- package/dist/lib/output/themes/default/layouts/default.js +3 -0
- package/dist/lib/utils/options/declaration.d.ts +18 -12
- package/dist/lib/utils/options/declaration.js +37 -10
- package/dist/lib/utils/options/sources/typedoc.js +11 -4
- package/dist/lib/validation/documentation.d.ts +1 -1
- package/dist/lib/validation/documentation.js +11 -1
- package/package.json +3 -3
package/dist/lib/application.js
CHANGED
|
@@ -520,7 +520,7 @@ let Application = (() => {
|
|
|
520
520
|
validateExports(project, this.logger, this.options.getValue("intentionallyNotExported"));
|
|
521
521
|
}
|
|
522
522
|
if (checks.notDocumented) {
|
|
523
|
-
validateDocumentation(project, this.logger, this.options.getValue("requiredToBeDocumented"));
|
|
523
|
+
validateDocumentation(project, this.logger, this.options.getValue("requiredToBeDocumented"), this.options.getValue("intentionallyNotDocumented"));
|
|
524
524
|
}
|
|
525
525
|
if (checks.invalidLink) {
|
|
526
526
|
validateLinks(project, this.logger);
|
|
@@ -61,6 +61,7 @@ module.exports = {
|
|
|
61
61
|
failed_to_resolve_link_to_0_in_document_1_may_have_meant_2: `Failed to resolve link to "{0}" in document {1}. You may have wanted "{2}"`,
|
|
62
62
|
type_0_defined_in_1_is_referenced_by_2_but_not_included_in_docs: `{0}, defined in {1}, is referenced by {2} but not included in the documentation`,
|
|
63
63
|
reflection_0_kind_1_defined_in_2_does_not_have_any_documentation: `{0} ({1}), defined in {2}, does not have any documentation`,
|
|
64
|
+
invalid_intentionally_not_documented_names_0: "The following qualified reflection names were marked as intentionally not documented, but were either not referenced in the documentation, or were documented:\n\t{0}",
|
|
64
65
|
invalid_intentionally_not_exported_symbols_0: "The following symbols were marked as intentionally not exported, but were either not referenced in the documentation, or were exported:\n\t{0}",
|
|
65
66
|
reflection_0_has_unused_mergeModuleWith_tag: "{0} has a @mergeModuleWith tag which could not be resolved",
|
|
66
67
|
reflection_0_links_to_1_with_text_2_but_resolved_to_3: `"{0}" links to "{1}" with text "{2}" which exists but does not have a link in the documentation, will link to "{3}" instead.`,
|
|
@@ -217,6 +218,7 @@ module.exports = {
|
|
|
217
218
|
help_searchGroupBoosts: 'Configure search to give a relevance boost to selected kinds (eg "class")',
|
|
218
219
|
help_useFirstParagraphOfCommentAsSummary: "If set and no @summary tag is specified, TypeDoc will use the first paragraph of comments as the short summary in the module/namespace view",
|
|
219
220
|
help_jsDocCompatibility: "Sets compatibility options for comment parsing that increase similarity with JSDoc comments",
|
|
221
|
+
help_suppressCommentWarningsInDeclarationFiles: "Prevents warnings due to unspecified tags from being reported in comments within .d.ts files.",
|
|
220
222
|
help_commentStyle: "Determines how TypeDoc searches for comments",
|
|
221
223
|
help_useTsLinkResolution: "Use TypeScript's link resolution when determining where @link tags point. This only applies to JSDoc style comments",
|
|
222
224
|
help_preserveLinkText: "If set, @link tags without link text will use the text content as the link. If not set, will use the target reflection name",
|
|
@@ -243,6 +245,7 @@ module.exports = {
|
|
|
243
245
|
help_treatValidationWarningsAsErrors: "If set, warnings emitted during validation will be treated as errors. This option cannot be used to disable treatWarningsAsErrors for validation warnings",
|
|
244
246
|
help_intentionallyNotExported: "A list of types which should not produce 'referenced but not documented' warnings",
|
|
245
247
|
help_requiredToBeDocumented: "A list of reflection kinds that must be documented",
|
|
248
|
+
help_intentionallyNotDocumented: "A list of full reflection names which should not produce warnings about not being documented",
|
|
246
249
|
help_validation: "Specify which validation steps TypeDoc should perform on your generated documentation",
|
|
247
250
|
// ==================================================================
|
|
248
251
|
// Option validation
|
|
@@ -262,7 +265,7 @@ module.exports = {
|
|
|
262
265
|
highlightLanguages_contains_invalid_languages_0: "highlightLanguages contains invalid languages: {0}, run typedoc --help for a list of supported languages",
|
|
263
266
|
hostedBaseUrl_must_start_with_http: "hostedBaseUrl must start with http:// or https://",
|
|
264
267
|
useHostedBaseUrlForAbsoluteLinks_requires_hostedBaseUrl: "The useHostedBaseUrlForAbsoluteLinks option requires that hostedBaseUrl be set",
|
|
265
|
-
favicon_must_have_one_of_the_following_extensions_0: "Favicon must have
|
|
268
|
+
favicon_must_have_one_of_the_following_extensions_0: "Favicon must have one of the following extensions: {0}",
|
|
266
269
|
option_0_must_be_an_object: "The '{0}' option must be a non-array object",
|
|
267
270
|
option_0_must_be_a_function: "The '{0}' option must be a function",
|
|
268
271
|
option_0_must_be_object_with_urls: `{0} must be an object with string labels as keys and URL values`,
|
|
@@ -56,6 +56,7 @@ declare const _default: {
|
|
|
56
56
|
readonly failed_to_resolve_link_to_0_in_document_1_may_have_meant_2: "Failed to resolve link to \"{0}\" in document {1}. You may have wanted \"{2}\"";
|
|
57
57
|
readonly type_0_defined_in_1_is_referenced_by_2_but_not_included_in_docs: "{0}, defined in {1}, is referenced by {2} but not included in the documentation";
|
|
58
58
|
readonly reflection_0_kind_1_defined_in_2_does_not_have_any_documentation: "{0} ({1}), defined in {2}, does not have any documentation";
|
|
59
|
+
readonly invalid_intentionally_not_documented_names_0: "The following qualified reflection names were marked as intentionally not documented, but were either not referenced in the documentation, or were documented:\n\t{0}";
|
|
59
60
|
readonly invalid_intentionally_not_exported_symbols_0: "The following symbols were marked as intentionally not exported, but were either not referenced in the documentation, or were exported:\n\t{0}";
|
|
60
61
|
readonly reflection_0_has_unused_mergeModuleWith_tag: "{0} has a @mergeModuleWith tag which could not be resolved";
|
|
61
62
|
readonly reflection_0_links_to_1_with_text_2_but_resolved_to_3: "\"{0}\" links to \"{1}\" with text \"{2}\" which exists but does not have a link in the documentation, will link to \"{3}\" instead.";
|
|
@@ -204,6 +205,7 @@ declare const _default: {
|
|
|
204
205
|
readonly help_searchGroupBoosts: "Configure search to give a relevance boost to selected kinds (eg \"class\")";
|
|
205
206
|
readonly help_useFirstParagraphOfCommentAsSummary: "If set and no @summary tag is specified, TypeDoc will use the first paragraph of comments as the short summary in the module/namespace view";
|
|
206
207
|
readonly help_jsDocCompatibility: "Sets compatibility options for comment parsing that increase similarity with JSDoc comments";
|
|
208
|
+
readonly help_suppressCommentWarningsInDeclarationFiles: "Prevents warnings due to unspecified tags from being reported in comments within .d.ts files.";
|
|
207
209
|
readonly help_commentStyle: "Determines how TypeDoc searches for comments";
|
|
208
210
|
readonly help_useTsLinkResolution: "Use TypeScript's link resolution when determining where @link tags point. This only applies to JSDoc style comments";
|
|
209
211
|
readonly help_preserveLinkText: "If set, @link tags without link text will use the text content as the link. If not set, will use the target reflection name";
|
|
@@ -230,6 +232,7 @@ declare const _default: {
|
|
|
230
232
|
readonly help_treatValidationWarningsAsErrors: "If set, warnings emitted during validation will be treated as errors. This option cannot be used to disable treatWarningsAsErrors for validation warnings";
|
|
231
233
|
readonly help_intentionallyNotExported: "A list of types which should not produce 'referenced but not documented' warnings";
|
|
232
234
|
readonly help_requiredToBeDocumented: "A list of reflection kinds that must be documented";
|
|
235
|
+
readonly help_intentionallyNotDocumented: "A list of full reflection names which should not produce warnings about not being documented";
|
|
233
236
|
readonly help_validation: "Specify which validation steps TypeDoc should perform on your generated documentation";
|
|
234
237
|
readonly unknown_option_0_you_may_have_meant_1: "Unknown option '{0}' You may have meant:\n\t{1}";
|
|
235
238
|
readonly option_0_must_be_between_1_and_2: "{0} must be between {1} and {2}";
|
|
@@ -246,7 +249,7 @@ declare const _default: {
|
|
|
246
249
|
readonly highlightLanguages_contains_invalid_languages_0: "highlightLanguages contains invalid languages: {0}, run typedoc --help for a list of supported languages";
|
|
247
250
|
readonly hostedBaseUrl_must_start_with_http: "hostedBaseUrl must start with http:// or https://";
|
|
248
251
|
readonly useHostedBaseUrlForAbsoluteLinks_requires_hostedBaseUrl: "The useHostedBaseUrlForAbsoluteLinks option requires that hostedBaseUrl be set";
|
|
249
|
-
readonly favicon_must_have_one_of_the_following_extensions_0: "Favicon must have
|
|
252
|
+
readonly favicon_must_have_one_of_the_following_extensions_0: "Favicon must have one of the following extensions: {0}";
|
|
250
253
|
readonly option_0_must_be_an_object: "The '{0}' option must be a non-array object";
|
|
251
254
|
readonly option_0_must_be_a_function: "The '{0}' option must be a function";
|
|
252
255
|
readonly option_0_must_be_object_with_urls: "{0} must be an object with string labels as keys and URL values";
|
|
@@ -332,7 +332,12 @@ const typeBuilder = {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
else if (type.externalUrl) {
|
|
335
|
-
|
|
335
|
+
if (type.externalUrl === "#") {
|
|
336
|
+
name = simpleElement(JSX.createElement("span", { class: "tsd-signature-type external" }, type.name));
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
name = simpleElement(JSX.createElement("a", { href: type.externalUrl, class: "tsd-signature-type external", target: "_blank" }, type.name));
|
|
340
|
+
}
|
|
336
341
|
}
|
|
337
342
|
else if (type.refersToTypeParameter) {
|
|
338
343
|
name = simpleElement(JSX.createElement("span", { class: "tsd-signature-type tsd-kind-type-parameter" }, type.name));
|
|
@@ -102,7 +102,8 @@ let AssetsPlugin = (() => {
|
|
|
102
102
|
}
|
|
103
103
|
onRenderBegin(event) {
|
|
104
104
|
const dest = join(event.outputDirectory, "assets");
|
|
105
|
-
if (
|
|
105
|
+
if (!/^https?:\/\//i.test(this.favicon) &&
|
|
106
|
+
[".ico", ".png", ".svg"].includes(extname(this.favicon))) {
|
|
106
107
|
copySync(this.favicon, join(dest, "favicon" + extname(this.favicon)));
|
|
107
108
|
}
|
|
108
109
|
if (this.customCss) {
|
|
@@ -190,11 +190,13 @@ let MarkedPlugin = (() => {
|
|
|
190
190
|
}
|
|
191
191
|
if (useHtml) {
|
|
192
192
|
const text = part.tag === "@linkcode" ? `<code>${part.text}</code>` : part.text;
|
|
193
|
-
result.push(
|
|
193
|
+
result.push(url
|
|
194
|
+
? `<a href="${url}"${kindClass ? ` class="${kindClass}"` : ""}>${text}</a>`
|
|
195
|
+
: part.text);
|
|
194
196
|
}
|
|
195
197
|
else {
|
|
196
198
|
const text = part.tag === "@linkcode" ? "`" + part.text + "`" : part.text;
|
|
197
|
-
result.push(`[${text}](${url})`);
|
|
199
|
+
result.push(url ? `[${text}](${url})` : text);
|
|
198
200
|
}
|
|
199
201
|
}
|
|
200
202
|
else {
|
|
@@ -323,7 +325,7 @@ let MarkedPlugin = (() => {
|
|
|
323
325
|
// the introduction of support for customized routers whenever
|
|
324
326
|
// that becomes a real thing.
|
|
325
327
|
if (this.markdownLinkExternal &&
|
|
326
|
-
|
|
328
|
+
/^https?:\/\//i.test(href) &&
|
|
327
329
|
!(href + "/").startsWith(this.hostedBaseUrl)) {
|
|
328
330
|
token.attrSet("target", "_blank");
|
|
329
331
|
const classes = token.attrGet("class")?.split(" ") || [];
|
|
@@ -5,6 +5,9 @@ function favicon(context) {
|
|
|
5
5
|
const fav = context.options.getValue("favicon");
|
|
6
6
|
if (!fav)
|
|
7
7
|
return null;
|
|
8
|
+
if (/^https?:\/\//i.test(fav)) {
|
|
9
|
+
return JSX.createElement("link", { rel: "icon", href: fav });
|
|
10
|
+
}
|
|
8
11
|
switch (extname(fav)) {
|
|
9
12
|
case ".ico":
|
|
10
13
|
return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.ico", true) });
|
|
@@ -198,6 +198,7 @@ export interface TypeDocOptionMap {
|
|
|
198
198
|
intentionallyNotExported: string[];
|
|
199
199
|
validation: ValidationOptions;
|
|
200
200
|
requiredToBeDocumented: ReflectionKind.KindString[];
|
|
201
|
+
intentionallyNotDocumented: string[];
|
|
201
202
|
watch: boolean;
|
|
202
203
|
preserveWatchOutput: boolean;
|
|
203
204
|
help: boolean;
|
|
@@ -276,31 +277,35 @@ export declare enum ParameterType {
|
|
|
276
277
|
* Resolved according to the config directory.
|
|
277
278
|
*/
|
|
278
279
|
Path = 1,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Resolved according to the config directory unless it starts with https?://
|
|
282
|
+
*/
|
|
283
|
+
UrlOrPath = 2,
|
|
284
|
+
Number = 3,
|
|
285
|
+
Boolean = 4,
|
|
286
|
+
Map = 5,
|
|
287
|
+
Mixed = 6,
|
|
288
|
+
Array = 7,
|
|
284
289
|
/**
|
|
285
290
|
* Resolved according to the config directory.
|
|
286
291
|
*/
|
|
287
|
-
PathArray =
|
|
292
|
+
PathArray = 8,
|
|
288
293
|
/**
|
|
289
294
|
* Resolved according to the config directory if it starts with `.`
|
|
290
295
|
*/
|
|
291
|
-
ModuleArray =
|
|
296
|
+
ModuleArray = 9,
|
|
292
297
|
/**
|
|
293
298
|
* Resolved according to the config directory unless it starts with `**`, after skipping any leading `!` and `#` characters.
|
|
294
299
|
*/
|
|
295
|
-
GlobArray =
|
|
300
|
+
GlobArray = 10,
|
|
296
301
|
/**
|
|
297
302
|
* An object which partially merges user-set values into the defaults.
|
|
298
303
|
*/
|
|
299
|
-
Object =
|
|
304
|
+
Object = 11,
|
|
300
305
|
/**
|
|
301
306
|
* An object with true/false flags
|
|
302
307
|
*/
|
|
303
|
-
Flags =
|
|
308
|
+
Flags = 12
|
|
304
309
|
}
|
|
305
310
|
export interface DeclarationOptionBase {
|
|
306
311
|
/**
|
|
@@ -331,9 +336,9 @@ export interface StringDeclarationOption extends DeclarationOptionBase {
|
|
|
331
336
|
* Specifies the resolution strategy. If `Path` is provided, values will be resolved according to their
|
|
332
337
|
* location in a file. If `String` or no value is provided, values will not be resolved.
|
|
333
338
|
*/
|
|
334
|
-
type?: ParameterType.String | ParameterType.Path;
|
|
339
|
+
type?: ParameterType.String | ParameterType.Path | ParameterType.UrlOrPath;
|
|
335
340
|
/**
|
|
336
|
-
* If not specified defaults to the empty string for
|
|
341
|
+
* If not specified defaults to the empty string for all types.
|
|
337
342
|
*/
|
|
338
343
|
defaultValue?: string;
|
|
339
344
|
/**
|
|
@@ -443,6 +448,7 @@ export type DeclarationOption = StringDeclarationOption | NumberDeclarationOptio
|
|
|
443
448
|
export interface ParameterTypeToOptionTypeMap {
|
|
444
449
|
[ParameterType.String]: string;
|
|
445
450
|
[ParameterType.Path]: string;
|
|
451
|
+
[ParameterType.UrlOrPath]: string;
|
|
446
452
|
[ParameterType.Number]: number;
|
|
447
453
|
[ParameterType.Boolean]: boolean;
|
|
448
454
|
[ParameterType.Mixed]: unknown;
|
|
@@ -27,31 +27,35 @@ export var ParameterType;
|
|
|
27
27
|
* Resolved according to the config directory.
|
|
28
28
|
*/
|
|
29
29
|
ParameterType[ParameterType["Path"] = 1] = "Path";
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
ParameterType[ParameterType["
|
|
34
|
-
ParameterType[ParameterType["
|
|
30
|
+
/**
|
|
31
|
+
* Resolved according to the config directory unless it starts with https?://
|
|
32
|
+
*/
|
|
33
|
+
ParameterType[ParameterType["UrlOrPath"] = 2] = "UrlOrPath";
|
|
34
|
+
ParameterType[ParameterType["Number"] = 3] = "Number";
|
|
35
|
+
ParameterType[ParameterType["Boolean"] = 4] = "Boolean";
|
|
36
|
+
ParameterType[ParameterType["Map"] = 5] = "Map";
|
|
37
|
+
ParameterType[ParameterType["Mixed"] = 6] = "Mixed";
|
|
38
|
+
ParameterType[ParameterType["Array"] = 7] = "Array";
|
|
35
39
|
/**
|
|
36
40
|
* Resolved according to the config directory.
|
|
37
41
|
*/
|
|
38
|
-
ParameterType[ParameterType["PathArray"] =
|
|
42
|
+
ParameterType[ParameterType["PathArray"] = 8] = "PathArray";
|
|
39
43
|
/**
|
|
40
44
|
* Resolved according to the config directory if it starts with `.`
|
|
41
45
|
*/
|
|
42
|
-
ParameterType[ParameterType["ModuleArray"] =
|
|
46
|
+
ParameterType[ParameterType["ModuleArray"] = 9] = "ModuleArray";
|
|
43
47
|
/**
|
|
44
48
|
* Resolved according to the config directory unless it starts with `**`, after skipping any leading `!` and `#` characters.
|
|
45
49
|
*/
|
|
46
|
-
ParameterType[ParameterType["GlobArray"] =
|
|
50
|
+
ParameterType[ParameterType["GlobArray"] = 10] = "GlobArray";
|
|
47
51
|
/**
|
|
48
52
|
* An object which partially merges user-set values into the defaults.
|
|
49
53
|
*/
|
|
50
|
-
ParameterType[ParameterType["Object"] =
|
|
54
|
+
ParameterType[ParameterType["Object"] = 11] = "Object";
|
|
51
55
|
/**
|
|
52
56
|
* An object with true/false flags
|
|
53
57
|
*/
|
|
54
|
-
ParameterType[ParameterType["Flags"] =
|
|
58
|
+
ParameterType[ParameterType["Flags"] = 12] = "Flags";
|
|
55
59
|
})(ParameterType || (ParameterType = {}));
|
|
56
60
|
const converters = {
|
|
57
61
|
[ParameterType.String](value, option, i18n) {
|
|
@@ -67,6 +71,17 @@ const converters = {
|
|
|
67
71
|
option.validate?.(stringValue, i18n);
|
|
68
72
|
return stringValue;
|
|
69
73
|
},
|
|
74
|
+
[ParameterType.UrlOrPath](value, option, i18n, configPath) {
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
76
|
+
const stringValue = value == null ? "" : String(value);
|
|
77
|
+
if (/^https?:\/\//i.test(stringValue)) {
|
|
78
|
+
option.validate?.(stringValue, i18n);
|
|
79
|
+
return stringValue;
|
|
80
|
+
}
|
|
81
|
+
const resolved = resolve(configPath, stringValue);
|
|
82
|
+
option.validate?.(resolved, i18n);
|
|
83
|
+
return resolved;
|
|
84
|
+
},
|
|
70
85
|
[ParameterType.Number](value, option, i18n) {
|
|
71
86
|
const numValue = parseInt(String(value), 10) || 0;
|
|
72
87
|
if (!valueIsWithinBounds(numValue, option.minValue, option.maxValue)) {
|
|
@@ -206,6 +221,18 @@ const defaultGetters = {
|
|
|
206
221
|
? defaultStr
|
|
207
222
|
: join(process.cwd(), defaultStr);
|
|
208
223
|
},
|
|
224
|
+
[ParameterType.UrlOrPath](option) {
|
|
225
|
+
const defaultStr = option.defaultValue ?? "";
|
|
226
|
+
if (defaultStr == "") {
|
|
227
|
+
return "";
|
|
228
|
+
}
|
|
229
|
+
if (/^https?:\/\//i.test(defaultStr)) {
|
|
230
|
+
return defaultStr;
|
|
231
|
+
}
|
|
232
|
+
return isAbsolute(defaultStr)
|
|
233
|
+
? defaultStr
|
|
234
|
+
: join(process.cwd(), defaultStr);
|
|
235
|
+
},
|
|
209
236
|
[ParameterType.Number](option) {
|
|
210
237
|
return option.defaultValue ?? 0;
|
|
211
238
|
},
|
|
@@ -411,11 +411,12 @@ export function addTypeDocOptions(options) {
|
|
|
411
411
|
help: (i18n) => i18n.help_favicon(),
|
|
412
412
|
validate(value, i18n) {
|
|
413
413
|
const allowedExtension = [".ico", ".png", ".svg"];
|
|
414
|
-
if (
|
|
414
|
+
if (!/^https?:\/\//i.test(value) &&
|
|
415
|
+
!allowedExtension.includes(extname(value))) {
|
|
415
416
|
throw new Error(i18n.favicon_must_have_one_of_the_following_extensions_0(allowedExtension.join(", ")));
|
|
416
417
|
}
|
|
417
418
|
},
|
|
418
|
-
type: ParameterType.
|
|
419
|
+
type: ParameterType.UrlOrPath,
|
|
419
420
|
});
|
|
420
421
|
options.addDeclaration({
|
|
421
422
|
name: "sourceLinkExternal",
|
|
@@ -438,7 +439,7 @@ export function addTypeDocOptions(options) {
|
|
|
438
439
|
name: "hostedBaseUrl",
|
|
439
440
|
help: (i18n) => i18n.help_hostedBaseUrl(),
|
|
440
441
|
validate(value, i18n) {
|
|
441
|
-
if (
|
|
442
|
+
if (!/^https?:\/\//i.test(value)) {
|
|
442
443
|
throw new Error(i18n.hostedBaseUrl_must_start_with_http());
|
|
443
444
|
}
|
|
444
445
|
},
|
|
@@ -634,7 +635,7 @@ export function addTypeDocOptions(options) {
|
|
|
634
635
|
});
|
|
635
636
|
options.addDeclaration({
|
|
636
637
|
name: "suppressCommentWarningsInDeclarationFiles",
|
|
637
|
-
help: (i18n) => i18n.
|
|
638
|
+
help: (i18n) => i18n.help_suppressCommentWarningsInDeclarationFiles(),
|
|
638
639
|
type: ParameterType.Boolean,
|
|
639
640
|
defaultValue: true,
|
|
640
641
|
});
|
|
@@ -839,6 +840,12 @@ export function addTypeDocOptions(options) {
|
|
|
839
840
|
},
|
|
840
841
|
defaultValue: OptionDefaults.requiredToBeDocumented,
|
|
841
842
|
});
|
|
843
|
+
options.addDeclaration({
|
|
844
|
+
name: "intentionallyNotDocumented",
|
|
845
|
+
help: (i18n) => i18n.help_intentionallyNotDocumented(),
|
|
846
|
+
type: ParameterType.Array,
|
|
847
|
+
defaultValue: [],
|
|
848
|
+
});
|
|
842
849
|
options.addDeclaration({
|
|
843
850
|
name: "validation",
|
|
844
851
|
help: (i18n) => i18n.help_validation(),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ProjectReflection, ReflectionKind } from "../models/index.js";
|
|
2
2
|
import type { Logger } from "../utils/index.js";
|
|
3
|
-
export declare function validateDocumentation(project: ProjectReflection, logger: Logger, requiredToBeDocumented: readonly ReflectionKind.KindString[]): void;
|
|
3
|
+
export declare function validateDocumentation(project: ProjectReflection, logger: Logger, requiredToBeDocumented: readonly ReflectionKind.KindString[], intentionallyNotDocumented: readonly string[]): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeclarationReflection, ReflectionKind, ReflectionType, } from "../models/index.js";
|
|
2
2
|
import { removeFlag } from "../utils/enum.js";
|
|
3
3
|
import { nicePath } from "../utils/paths.js";
|
|
4
|
-
export function validateDocumentation(project, logger, requiredToBeDocumented) {
|
|
4
|
+
export function validateDocumentation(project, logger, requiredToBeDocumented, intentionallyNotDocumented) {
|
|
5
5
|
let kinds = requiredToBeDocumented.reduce((prev, cur) => prev | ReflectionKind[cur], 0);
|
|
6
6
|
// Functions, Constructors, and Accessors never have comments directly on them.
|
|
7
7
|
// If they are required to be documented, what's really required is that their
|
|
@@ -20,6 +20,7 @@ export function validateDocumentation(project, logger, requiredToBeDocumented) {
|
|
|
20
20
|
}
|
|
21
21
|
const toProcess = project.getReflectionsByKind(kinds);
|
|
22
22
|
const seen = new Set();
|
|
23
|
+
const intentionalUsage = new Set();
|
|
23
24
|
outer: while (toProcess.length) {
|
|
24
25
|
const ref = toProcess.shift();
|
|
25
26
|
if (seen.has(ref))
|
|
@@ -76,7 +77,16 @@ export function validateDocumentation(project, logger, requiredToBeDocumented) {
|
|
|
76
77
|
if (symbolId.fileName.includes("node_modules")) {
|
|
77
78
|
continue;
|
|
78
79
|
}
|
|
80
|
+
const intentionalIndex = intentionallyNotDocumented.indexOf(ref.getFriendlyFullName());
|
|
81
|
+
if (intentionalIndex !== -1) {
|
|
82
|
+
intentionalUsage.add(intentionalIndex);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
79
85
|
logger.warn(logger.i18n.reflection_0_kind_1_defined_in_2_does_not_have_any_documentation(ref.getFriendlyFullName(), ReflectionKind[ref.kind], nicePath(symbolId.fileName)));
|
|
80
86
|
}
|
|
81
87
|
}
|
|
88
|
+
const unusedIntentional = intentionallyNotDocumented.filter((_, i) => !intentionalUsage.has(i));
|
|
89
|
+
if (unusedIntentional.length) {
|
|
90
|
+
logger.warn(logger.i18n.invalid_intentionally_not_documented_names_0(unusedIntentional.join("\n\t")));
|
|
91
|
+
}
|
|
82
92
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typedoc",
|
|
3
3
|
"description": "Create api documentation for TypeScript projects.",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.9",
|
|
5
5
|
"homepage": "https://typedoc.org",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"yaml": "^2.6.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x"
|
|
36
|
+
"typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/lunr": "^2.3.7",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"puppeteer": "^23.6.1",
|
|
50
50
|
"semver": "^7.6.3",
|
|
51
51
|
"tsx": "^4.19.2",
|
|
52
|
-
"typescript": "5.
|
|
52
|
+
"typescript": "5.8.1-rc",
|
|
53
53
|
"typescript-eslint": "^8.15.0"
|
|
54
54
|
},
|
|
55
55
|
"files": [
|