typedoc 0.26.11 → 0.27.0-beta.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/bin/package.json +3 -0
- package/bin/typedoc +1 -1
- package/dist/index.d.ts +23 -13
- package/dist/index.js +22 -81
- package/dist/lib/application-events.js +1 -4
- package/dist/lib/application.d.ts +26 -16
- package/dist/lib/application.js +222 -242
- package/dist/lib/cli.js +3 -40
- package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
- package/dist/lib/converter/comments/blockLexer.js +24 -30
- package/dist/lib/converter/comments/declarationReference.js +10 -21
- package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +2 -2
- package/dist/lib/converter/comments/declarationReferenceResolver.js +40 -36
- package/dist/lib/converter/comments/discovery.d.ts +4 -4
- package/dist/lib/converter/comments/discovery.js +154 -172
- package/dist/lib/converter/comments/index.d.ts +4 -4
- package/dist/lib/converter/comments/index.js +39 -50
- package/dist/lib/converter/comments/lexer.d.ts +1 -1
- package/dist/lib/converter/comments/lexer.js +2 -5
- package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
- package/dist/lib/converter/comments/lineLexer.js +12 -15
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
- package/dist/lib/converter/comments/linkResolver.js +14 -21
- package/dist/lib/converter/comments/parser.d.ts +6 -6
- package/dist/lib/converter/comments/parser.js +69 -96
- package/dist/lib/converter/comments/rawLexer.d.ts +1 -1
- package/dist/lib/converter/comments/rawLexer.js +13 -16
- package/dist/lib/converter/comments/tagName.js +1 -4
- package/dist/lib/converter/comments/textParser.d.ts +4 -4
- package/dist/lib/converter/comments/textParser.js +28 -30
- package/dist/lib/converter/components.d.ts +2 -3
- package/dist/lib/converter/components.js +2 -7
- package/dist/lib/converter/context.d.ts +9 -9
- package/dist/lib/converter/context.js +54 -44
- package/dist/lib/converter/convert-expression.js +16 -23
- package/dist/lib/converter/converter-events.d.ts +1 -0
- package/dist/lib/converter/converter-events.js +2 -4
- package/dist/lib/converter/converter.d.ts +16 -13
- package/dist/lib/converter/converter.js +210 -238
- package/dist/lib/converter/factories/index-signature.d.ts +1 -1
- package/dist/lib/converter/factories/index-signature.js +11 -17
- package/dist/lib/converter/factories/signature.d.ts +2 -2
- package/dist/lib/converter/factories/signature.js +95 -106
- package/dist/lib/converter/index.d.ts +6 -7
- package/dist/lib/converter/index.js +3 -11
- package/dist/lib/converter/jsdoc.d.ts +1 -1
- package/dist/lib/converter/jsdoc.js +34 -41
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +6 -21
- package/dist/lib/converter/plugins/CategoryPlugin.js +57 -139
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/CommentPlugin.js +153 -163
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +10 -9
- package/dist/lib/converter/plugins/GroupPlugin.js +87 -124
- package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/ImplementsPlugin.js +255 -321
- package/dist/lib/converter/plugins/IncludePlugin.d.ts +11 -0
- package/dist/lib/converter/plugins/IncludePlugin.js +72 -0
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.js +41 -72
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +5 -5
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +37 -58
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
- package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +49 -0
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +4 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +62 -111
- package/dist/lib/converter/plugins/SourcePlugin.d.ts +3 -5
- package/dist/lib/converter/plugins/SourcePlugin.js +69 -110
- package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -6
- package/dist/lib/converter/plugins/TypePlugin.js +95 -158
- package/dist/lib/converter/plugins/index.d.ts +10 -9
- package/dist/lib/converter/plugins/index.js +10 -21
- package/dist/lib/converter/symbols.d.ts +1 -1
- package/dist/lib/converter/symbols.js +234 -227
- package/dist/lib/converter/types.d.ts +2 -2
- package/dist/lib/converter/types.js +252 -237
- package/dist/lib/converter/utils/nodes.js +5 -13
- package/dist/lib/converter/utils/reflections.d.ts +1 -1
- package/dist/lib/converter/utils/reflections.js +4 -7
- package/dist/lib/converter/utils/repository.d.ts +1 -1
- package/dist/lib/converter/utils/repository.js +103 -97
- package/dist/lib/converter/utils/symbols.js +3 -9
- package/dist/lib/internationalization/index.d.ts +3 -4
- package/dist/lib/internationalization/index.js +3 -8
- package/dist/lib/internationalization/internationalization.d.ts +5 -4
- package/dist/lib/internationalization/internationalization.js +97 -103
- package/dist/lib/internationalization/locale-utils.cjs +8 -0
- package/dist/lib/internationalization/locale-utils.d.cts +8 -0
- package/dist/lib/internationalization/locales/en.cjs +366 -2
- package/dist/lib/internationalization/locales/en.d.cts +339 -2
- package/dist/lib/internationalization/locales/jp.cjs +8 -11
- package/dist/lib/internationalization/locales/jp.d.cts +310 -1
- package/dist/lib/internationalization/locales/ko.cjs +7 -9
- package/dist/lib/internationalization/locales/ko.d.cts +223 -1
- package/dist/lib/internationalization/locales/zh.cjs +7 -10
- package/dist/lib/internationalization/locales/zh.d.cts +381 -1
- package/dist/lib/internationalization/translatable.d.ts +4 -327
- package/dist/lib/internationalization/translatable.js +2 -360
- package/dist/lib/models/FileRegistry.d.ts +20 -9
- package/dist/lib/models/FileRegistry.js +54 -45
- package/dist/lib/models/ReflectionCategory.d.ts +2 -2
- package/dist/lib/models/ReflectionCategory.js +16 -12
- package/dist/lib/models/ReflectionGroup.d.ts +3 -3
- package/dist/lib/models/ReflectionGroup.js +23 -14
- package/dist/lib/models/comments/comment.d.ts +23 -37
- package/dist/lib/models/comments/comment.js +388 -325
- package/dist/lib/models/comments/index.d.ts +2 -2
- package/dist/lib/models/comments/index.js +1 -6
- package/dist/lib/models/index.d.ts +7 -7
- package/dist/lib/models/index.js +7 -23
- package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +2 -2
- package/dist/lib/models/reflections/ReflectionSymbolId.js +42 -34
- package/dist/lib/models/reflections/abstract.d.ts +17 -20
- package/dist/lib/models/reflections/abstract.js +249 -256
- package/dist/lib/models/reflections/container.d.ts +7 -7
- package/dist/lib/models/reflections/container.js +43 -16
- package/dist/lib/models/reflections/declaration.d.ts +15 -12
- package/dist/lib/models/reflections/declaration.js +150 -29
- package/dist/lib/models/reflections/document.d.ts +3 -3
- package/dist/lib/models/reflections/document.js +26 -13
- package/dist/lib/models/reflections/index.d.ts +15 -15
- package/dist/lib/models/reflections/index.js +12 -31
- package/dist/lib/models/reflections/kind.d.ts +1 -1
- package/dist/lib/models/reflections/kind.js +3 -6
- package/dist/lib/models/reflections/parameter.d.ts +5 -4
- package/dist/lib/models/reflections/parameter.js +11 -13
- package/dist/lib/models/reflections/project.d.ts +14 -9
- package/dist/lib/models/reflections/project.js +104 -56
- package/dist/lib/models/reflections/reference.d.ts +3 -3
- package/dist/lib/models/reflections/reference.js +6 -9
- package/dist/lib/models/reflections/signature.d.ts +8 -8
- package/dist/lib/models/reflections/signature.js +35 -14
- package/dist/lib/models/reflections/type-parameter.d.ts +5 -5
- package/dist/lib/models/reflections/type-parameter.js +9 -10
- package/dist/lib/models/reflections/utils.js +1 -4
- package/dist/lib/models/reflections/variant.d.ts +8 -7
- package/dist/lib/models/reflections/variant.js +1 -2
- package/dist/lib/models/sources/file.d.ts +2 -2
- package/dist/lib/models/sources/file.js +22 -5
- package/dist/lib/models/sources/index.d.ts +1 -1
- package/dist/lib/models/sources/index.js +1 -5
- package/dist/lib/models/types.d.ts +26 -13
- package/dist/lib/models/types.js +236 -151
- package/dist/lib/output/components.d.ts +5 -11
- package/dist/lib/output/components.js +84 -125
- package/dist/lib/output/events.d.ts +3 -3
- package/dist/lib/output/events.js +128 -94
- package/dist/lib/output/formatter.d.ts +84 -0
- package/dist/lib/output/formatter.js +619 -0
- package/dist/lib/output/index.d.ts +9 -8
- package/dist/lib/output/index.js +7 -19
- package/dist/lib/output/models/UrlMapping.d.ts +2 -2
- package/dist/lib/output/models/UrlMapping.js +4 -5
- package/dist/lib/output/output.d.ts +13 -0
- package/dist/lib/output/output.js +72 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +7 -8
- package/dist/lib/output/plugins/AssetsPlugin.js +62 -80
- package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/IconsPlugin.js +28 -84
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
- package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
- package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
- package/dist/lib/output/plugins/index.d.ts +6 -6
- package/dist/lib/output/plugins/index.js +6 -15
- package/dist/lib/output/renderer.d.ts +14 -13
- package/dist/lib/output/renderer.js +129 -185
- package/dist/lib/output/theme.d.ts +9 -5
- package/dist/lib/output/theme.js +14 -62
- package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
- package/dist/lib/output/themes/MarkedPlugin.js +152 -117
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
- package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
- package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
- package/dist/lib/output/themes/default/Slugger.js +46 -0
- package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
- package/dist/lib/output/themes/default/layouts/default.js +47 -36
- package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
- package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
- package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
- package/dist/lib/output/themes/default/partials/comment.js +52 -29
- package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/footer.js +11 -14
- package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/header.js +9 -13
- package/dist/lib/output/themes/default/partials/hierarchy.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/hierarchy.js +9 -12
- package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/icon.js +78 -73
- package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/index.js +19 -22
- package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
- package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
- package/dist/lib/output/themes/default/partials/member.js +19 -24
- package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
- package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
- package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
- package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
- package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
- package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/members.js +10 -42
- package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
- package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
- package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/navigation.js +51 -62
- package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
- package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
- package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
- package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
- package/dist/lib/output/themes/default/partials/type.js +8 -388
- package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
- package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
- package/dist/lib/output/themes/default/partials/typeDetails.js +221 -0
- package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
- package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
- package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/document.js +3 -7
- package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/hierarchy.js +10 -13
- package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/index.js +3 -7
- package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
- package/dist/lib/output/themes/default/templates/reflection.js +31 -34
- package/dist/lib/output/themes/lib.d.ts +17 -3
- package/dist/lib/output/themes/lib.js +110 -49
- package/dist/lib/serialization/components.d.ts +2 -5
- package/dist/lib/serialization/components.js +1 -2
- package/dist/lib/serialization/deserializer.d.ts +21 -7
- package/dist/lib/serialization/deserializer.js +138 -123
- package/dist/lib/serialization/events.d.ts +2 -2
- package/dist/lib/serialization/events.js +6 -5
- package/dist/lib/serialization/index.d.ts +5 -5
- package/dist/lib/serialization/index.js +4 -33
- package/dist/lib/serialization/schema.d.ts +8 -2
- package/dist/lib/serialization/schema.js +2 -2
- package/dist/lib/serialization/serializer.d.ts +11 -5
- package/dist/lib/serialization/serializer.js +32 -25
- package/dist/lib/utils/array.d.ts +3 -0
- package/dist/lib/utils/array.js +26 -27
- package/dist/lib/utils/component.d.ts +2 -44
- package/dist/lib/utils/component.js +10 -102
- package/dist/lib/utils/entry-point.d.ts +3 -4
- package/dist/lib/utils/entry-point.js +114 -85
- package/dist/lib/utils/enum.js +6 -14
- package/dist/lib/utils/events.js +6 -12
- package/dist/lib/utils/fs.js +50 -91
- package/dist/lib/utils/general.d.ts +2 -1
- package/dist/lib/utils/general.js +50 -40
- package/dist/lib/utils/highlighter.js +30 -57
- package/dist/lib/utils/hooks.js +7 -13
- package/dist/lib/utils/html-entities.d.ts +8926 -0
- package/dist/lib/utils/html-entities.js +2329 -0
- package/dist/lib/utils/html.d.ts +8 -0
- package/dist/lib/utils/html.js +81 -34
- package/dist/lib/utils/index.d.ts +22 -22
- package/dist/lib/utils/index.js +20 -91
- package/dist/lib/utils/jsx.d.ts +12 -5
- package/dist/lib/utils/jsx.elements.js +1 -4
- package/dist/lib/utils/jsx.js +53 -20
- package/dist/lib/utils/loggers.d.ts +3 -3
- package/dist/lib/utils/loggers.js +36 -46
- package/dist/lib/utils/map.js +6 -13
- package/dist/lib/utils/minimalSourceFile.js +5 -7
- package/dist/lib/utils/options/declaration.d.ts +33 -7
- package/dist/lib/utils/options/declaration.js +20 -22
- package/dist/lib/utils/options/defaults.d.ts +3 -2
- package/dist/lib/utils/options/defaults.js +18 -38
- package/dist/lib/utils/options/help.d.ts +2 -2
- package/dist/lib/utils/options/help.js +7 -10
- package/dist/lib/utils/options/index.d.ts +6 -6
- package/dist/lib/utils/options/index.js +4 -18
- package/dist/lib/utils/options/options.d.ts +8 -5
- package/dist/lib/utils/options/options.js +47 -71
- package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
- package/dist/lib/utils/options/readers/arguments.js +15 -17
- package/dist/lib/utils/options/readers/index.d.ts +4 -4
- package/dist/lib/utils/options/readers/index.js +4 -11
- package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
- package/dist/lib/utils/options/readers/package-json.js +15 -21
- package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
- package/dist/lib/utils/options/readers/tsconfig.js +54 -63
- package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
- package/dist/lib/utils/options/readers/typedoc.js +44 -76
- package/dist/lib/utils/options/sources/index.d.ts +1 -1
- package/dist/lib/utils/options/sources/index.js +1 -5
- package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
- package/dist/lib/utils/options/sources/typedoc.js +220 -196
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
- package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
- package/dist/lib/utils/package-manifest.d.ts +1 -1
- package/dist/lib/utils/package-manifest.js +15 -19
- package/dist/lib/utils/paths.js +9 -15
- package/dist/lib/utils/perf.js +6 -11
- package/dist/lib/utils/plugins.d.ts +1 -1
- package/dist/lib/utils/plugins.js +7 -10
- package/dist/lib/utils/reflections.d.ts +1 -1
- package/dist/lib/utils/reflections.js +9 -12
- package/dist/lib/utils/set.js +2 -6
- package/dist/lib/utils/sort.d.ts +3 -3
- package/dist/lib/utils/sort.js +20 -24
- package/dist/lib/utils/tsconfig.d.ts +1 -1
- package/dist/lib/utils/tsconfig.js +13 -21
- package/dist/lib/utils/tsutils.d.ts +1 -1
- package/dist/lib/utils/tsutils.js +3 -30
- package/dist/lib/utils/validation.js +6 -12
- package/dist/lib/validation/documentation.d.ts +2 -2
- package/dist/lib/validation/documentation.js +26 -29
- package/dist/lib/validation/exports.d.ts +2 -2
- package/dist/lib/validation/exports.js +9 -11
- package/dist/lib/validation/links.d.ts +2 -2
- package/dist/lib/validation/links.js +4 -7
- package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
- package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
- package/package.json +14 -11
- package/static/main.js +4 -4
- package/static/style.css +91 -2
- package/tsdoc.json +30 -0
- package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
- package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
- package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
- package/dist/lib/output/themes/default/partials/parameter.js +0 -79
- package/dist/lib/utils/html-entities.json +0 -2326
|
@@ -1,49 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.EntryPointStrategy = void 0;
|
|
30
|
-
exports.getEntryPoints = getEntryPoints;
|
|
31
|
-
exports.getDocumentEntryPoints = getDocumentEntryPoints;
|
|
32
|
-
exports.getWatchEntryPoints = getWatchEntryPoints;
|
|
33
|
-
exports.getPackageDirectories = getPackageDirectories;
|
|
34
|
-
exports.getExpandedEntryPointsForPaths = getExpandedEntryPointsForPaths;
|
|
35
|
-
const path_1 = require("path");
|
|
36
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
37
|
-
const FS = __importStar(require("fs"));
|
|
38
|
-
const package_manifest_1 = require("./package-manifest");
|
|
39
|
-
const paths_1 = require("./paths");
|
|
40
|
-
const fs_1 = require("./fs");
|
|
41
|
-
const general_1 = require("./general");
|
|
1
|
+
import { dirname, join, relative, resolve } from "path";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
import * as FS from "fs";
|
|
4
|
+
import { expandPackages } from "./package-manifest.js";
|
|
5
|
+
import { createMinimatch, matchesAny, nicePath, normalizePath, } from "./paths.js";
|
|
6
|
+
import { deriveRootDir, discoverPackageJson, getCommonDirectory, glob, isDir, } from "./fs.js";
|
|
7
|
+
import { assertNever } from "./general.js";
|
|
8
|
+
import { resolveAllExports } from "resolve-import/resolve-all-exports";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
42
10
|
/**
|
|
43
11
|
* Defines how entry points are interpreted.
|
|
44
12
|
* @enum
|
|
45
13
|
*/
|
|
46
|
-
|
|
14
|
+
export const EntryPointStrategy = {
|
|
47
15
|
/**
|
|
48
16
|
* The default behavior in v0.22+, expects all provided entry points as being part of a single program.
|
|
49
17
|
* Any directories included in the entry point list will result in `dir/index.([cm][tj]s|[tj]sx?)` being used.
|
|
@@ -64,7 +32,68 @@ exports.EntryPointStrategy = {
|
|
|
64
32
|
*/
|
|
65
33
|
Merge: "merge",
|
|
66
34
|
};
|
|
67
|
-
function
|
|
35
|
+
export async function inferEntryPoints(logger, options) {
|
|
36
|
+
const packageJson = discoverPackageJson(process.cwd());
|
|
37
|
+
if (!packageJson) {
|
|
38
|
+
logger.warn(logger.i18n.no_entry_points_provided());
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
const entries = await resolveAllExports(packageJson.file, {
|
|
42
|
+
conditions: ["typedoc", "import", "node"],
|
|
43
|
+
});
|
|
44
|
+
const pathEntries = Object.entries(entries).map(([k, v]) => {
|
|
45
|
+
if (typeof v === "object") {
|
|
46
|
+
return [k, fileURLToPath(v)];
|
|
47
|
+
}
|
|
48
|
+
return [k, v];
|
|
49
|
+
});
|
|
50
|
+
// resolveAllExports doesn't create a fake export for "main"
|
|
51
|
+
// so do that here if we don't have any exports.
|
|
52
|
+
if (pathEntries.length === 0) {
|
|
53
|
+
if ("main" in packageJson.content &&
|
|
54
|
+
typeof packageJson.content["main"] === "string") {
|
|
55
|
+
pathEntries.push([
|
|
56
|
+
".",
|
|
57
|
+
resolve(dirname(packageJson.file), packageJson.content["main"]),
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const entryPoints = [];
|
|
62
|
+
const programs = getEntryPrograms(pathEntries.map((p) => p[1]), logger, options);
|
|
63
|
+
// See also: addInferredDeclarationMapPaths in ReflectionSymbolId
|
|
64
|
+
const jsToTsSource = new Map();
|
|
65
|
+
for (const program of programs) {
|
|
66
|
+
const opts = program.getCompilerOptions();
|
|
67
|
+
const rootDir = opts.rootDir || getCommonDirectory(program.getRootFileNames());
|
|
68
|
+
const outDir = opts.outDir || rootDir;
|
|
69
|
+
for (const tsFile of program.getRootFileNames()) {
|
|
70
|
+
const jsFile = normalizePath(resolve(outDir, relative(rootDir, tsFile)).replace(/\.([cm]?)[tj]sx?$/, ".$1js"));
|
|
71
|
+
jsToTsSource.set(jsFile, tsFile);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const [name, path] of pathEntries) {
|
|
75
|
+
// Strip leading ./ from the display name
|
|
76
|
+
const displayName = name.replace(/^\.\/?/, "");
|
|
77
|
+
const targetPath = jsToTsSource.get(path) || path;
|
|
78
|
+
const program = programs.find((p) => p.getSourceFile(targetPath));
|
|
79
|
+
if (program) {
|
|
80
|
+
entryPoints.push({
|
|
81
|
+
displayName,
|
|
82
|
+
program,
|
|
83
|
+
sourceFile: program.getSourceFile(targetPath),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
else if (/\.[cm]?js$/.test(path)) {
|
|
87
|
+
logger.warn(logger.i18n.failed_to_resolve_0_to_ts_path(nicePath(path)));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (entryPoints.length === 0) {
|
|
91
|
+
logger.warn(logger.i18n.no_entry_points_provided());
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
return entryPoints;
|
|
95
|
+
}
|
|
96
|
+
export function getEntryPoints(logger, options) {
|
|
68
97
|
if (!options.isSet("entryPoints")) {
|
|
69
98
|
logger.warn(logger.i18n.no_entry_points_provided());
|
|
70
99
|
return [];
|
|
@@ -79,18 +108,18 @@ function getEntryPoints(logger, options) {
|
|
|
79
108
|
let result;
|
|
80
109
|
const strategy = options.getValue("entryPointStrategy");
|
|
81
110
|
switch (strategy) {
|
|
82
|
-
case
|
|
111
|
+
case EntryPointStrategy.Resolve:
|
|
83
112
|
result = getEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options);
|
|
84
113
|
break;
|
|
85
|
-
case
|
|
114
|
+
case EntryPointStrategy.Expand:
|
|
86
115
|
result = getExpandedEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options);
|
|
87
116
|
break;
|
|
88
|
-
case
|
|
89
|
-
case
|
|
117
|
+
case EntryPointStrategy.Merge:
|
|
118
|
+
case EntryPointStrategy.Packages:
|
|
90
119
|
// Doesn't really have entry points in the traditional way of how TypeDoc has dealt with them.
|
|
91
120
|
return [];
|
|
92
121
|
default:
|
|
93
|
-
|
|
122
|
+
assertNever(strategy);
|
|
94
123
|
}
|
|
95
124
|
if (result.length === 0) {
|
|
96
125
|
logger.error(logger.i18n.unable_to_find_any_entry_points());
|
|
@@ -104,7 +133,7 @@ function getEntryPoints(logger, options) {
|
|
|
104
133
|
*
|
|
105
134
|
* @returns A list of `.md` files to include in the documentation as documents.
|
|
106
135
|
*/
|
|
107
|
-
function getDocumentEntryPoints(logger, options) {
|
|
136
|
+
export function getDocumentEntryPoints(logger, options) {
|
|
108
137
|
const docGlobs = options.getValue("projectDocuments");
|
|
109
138
|
if (docGlobs.length === 0) {
|
|
110
139
|
return [];
|
|
@@ -114,34 +143,34 @@ function getDocumentEntryPoints(logger, options) {
|
|
|
114
143
|
// that have at some point or another been used for markdown: https://superuser.com/a/285878
|
|
115
144
|
const supportedFileRegex = /\.(md|markdown)$/;
|
|
116
145
|
const expanded = expandInputFiles(logger, docPaths, options, supportedFileRegex);
|
|
117
|
-
const baseDir = options.getValue("basePath") ||
|
|
146
|
+
const baseDir = options.getValue("basePath") || deriveRootDir(expanded);
|
|
118
147
|
return expanded.map((path) => {
|
|
119
148
|
return {
|
|
120
|
-
displayName:
|
|
149
|
+
displayName: relative(baseDir, path).replace(/\.[^.]+$/, ""),
|
|
121
150
|
path,
|
|
122
151
|
};
|
|
123
152
|
});
|
|
124
153
|
}
|
|
125
|
-
function getWatchEntryPoints(logger, options, program) {
|
|
154
|
+
export function getWatchEntryPoints(logger, options, program) {
|
|
126
155
|
let result;
|
|
127
156
|
const entryPoints = options.getValue("entryPoints");
|
|
128
157
|
const exclude = options.getValue("exclude");
|
|
129
158
|
const strategy = options.getValue("entryPointStrategy");
|
|
130
159
|
switch (strategy) {
|
|
131
|
-
case
|
|
160
|
+
case EntryPointStrategy.Resolve:
|
|
132
161
|
result = getEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options, [program]);
|
|
133
162
|
break;
|
|
134
|
-
case
|
|
163
|
+
case EntryPointStrategy.Expand:
|
|
135
164
|
result = getExpandedEntryPointsForPaths(logger, expandGlobs(entryPoints, exclude, logger), options, [program]);
|
|
136
165
|
break;
|
|
137
|
-
case
|
|
166
|
+
case EntryPointStrategy.Packages:
|
|
138
167
|
logger.error(logger.i18n.watch_does_not_support_packages_mode());
|
|
139
168
|
break;
|
|
140
|
-
case
|
|
169
|
+
case EntryPointStrategy.Merge:
|
|
141
170
|
logger.error(logger.i18n.watch_does_not_support_merge_mode());
|
|
142
171
|
break;
|
|
143
172
|
default:
|
|
144
|
-
|
|
173
|
+
assertNever(strategy);
|
|
145
174
|
}
|
|
146
175
|
if (result && result.length === 0) {
|
|
147
176
|
logger.error(logger.i18n.unable_to_find_any_entry_points());
|
|
@@ -149,25 +178,25 @@ function getWatchEntryPoints(logger, options, program) {
|
|
|
149
178
|
}
|
|
150
179
|
return result;
|
|
151
180
|
}
|
|
152
|
-
function getPackageDirectories(logger, options, packageGlobPaths) {
|
|
153
|
-
const exclude =
|
|
154
|
-
const rootDir =
|
|
181
|
+
export function getPackageDirectories(logger, options, packageGlobPaths) {
|
|
182
|
+
const exclude = createMinimatch(options.getValue("exclude"));
|
|
183
|
+
const rootDir = deriveRootDir(packageGlobPaths);
|
|
155
184
|
// packages arguments are workspace tree roots, or glob patterns
|
|
156
185
|
// This expands them to leave only leaf packages
|
|
157
|
-
return
|
|
186
|
+
return expandPackages(logger, rootDir, packageGlobPaths, exclude);
|
|
158
187
|
}
|
|
159
188
|
function getModuleName(fileName, baseDir) {
|
|
160
|
-
return
|
|
189
|
+
return normalizePath(relative(baseDir, fileName)).replace(/(\/index)?(\.d)?\.([cm][tj]s|[tj]sx?)$/, "");
|
|
161
190
|
}
|
|
162
191
|
/**
|
|
163
192
|
* Converts a list of file-oriented paths in to DocumentationEntryPoints for conversion.
|
|
164
193
|
* This is in contrast with the package-oriented `getEntryPointsForPackages`
|
|
165
194
|
*/
|
|
166
195
|
function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(inputFiles, logger, options)) {
|
|
167
|
-
const baseDir = options.getValue("basePath") ||
|
|
196
|
+
const baseDir = options.getValue("basePath") || deriveRootDir(inputFiles);
|
|
168
197
|
const entryPoints = [];
|
|
169
198
|
let expandSuggestion = true;
|
|
170
|
-
entryLoop: for (const fileOrDir of inputFiles.map(
|
|
199
|
+
entryLoop: for (const fileOrDir of inputFiles.map(normalizePath)) {
|
|
171
200
|
const toCheck = [fileOrDir];
|
|
172
201
|
if (!/\.([cm][tj]s|[tj]sx?)$/.test(fileOrDir)) {
|
|
173
202
|
toCheck.push(`${fileOrDir}/index.ts`, `${fileOrDir}/index.cts`, `${fileOrDir}/index.mts`, `${fileOrDir}/index.tsx`, `${fileOrDir}/index.js`, `${fileOrDir}/index.cjs`, `${fileOrDir}/index.mjs`, `${fileOrDir}/index.jsx`);
|
|
@@ -177,7 +206,7 @@ function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntry
|
|
|
177
206
|
const sourceFile = program.getSourceFile(check);
|
|
178
207
|
if (sourceFile) {
|
|
179
208
|
entryPoints.push({
|
|
180
|
-
displayName: getModuleName(
|
|
209
|
+
displayName: getModuleName(resolve(check), baseDir),
|
|
181
210
|
sourceFile,
|
|
182
211
|
program,
|
|
183
212
|
});
|
|
@@ -185,15 +214,15 @@ function getEntryPointsForPaths(logger, inputFiles, options, programs = getEntry
|
|
|
185
214
|
}
|
|
186
215
|
}
|
|
187
216
|
}
|
|
188
|
-
logger.warn(logger.i18n.entry_point_0_not_in_program(
|
|
189
|
-
if (expandSuggestion &&
|
|
217
|
+
logger.warn(logger.i18n.entry_point_0_not_in_program(nicePath(fileOrDir)));
|
|
218
|
+
if (expandSuggestion && isDir(fileOrDir)) {
|
|
190
219
|
expandSuggestion = false;
|
|
191
220
|
logger.info(logger.i18n.use_expand_or_glob_for_files_in_dir());
|
|
192
221
|
}
|
|
193
222
|
}
|
|
194
223
|
return entryPoints;
|
|
195
224
|
}
|
|
196
|
-
function getExpandedEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(inputFiles, logger, options)) {
|
|
225
|
+
export function getExpandedEntryPointsForPaths(logger, inputFiles, options, programs = getEntryPrograms(inputFiles, logger, options)) {
|
|
197
226
|
const compilerOptions = options.getCompilerOptions();
|
|
198
227
|
const supportedFileRegex = compilerOptions.allowJs || compilerOptions.checkJs
|
|
199
228
|
? /\.([cm][tj]s|[tj]sx?)$/
|
|
@@ -201,23 +230,23 @@ function getExpandedEntryPointsForPaths(logger, inputFiles, options, programs =
|
|
|
201
230
|
return getEntryPointsForPaths(logger, expandInputFiles(logger, inputFiles, options, supportedFileRegex), options, programs);
|
|
202
231
|
}
|
|
203
232
|
function expandGlobs(inputFiles, exclude, logger) {
|
|
204
|
-
const excludePatterns =
|
|
205
|
-
const base =
|
|
233
|
+
const excludePatterns = createMinimatch(exclude);
|
|
234
|
+
const base = deriveRootDir(inputFiles);
|
|
206
235
|
const result = inputFiles.flatMap((entry) => {
|
|
207
|
-
const result =
|
|
236
|
+
const result = glob(entry, base, {
|
|
208
237
|
includeDirectories: true,
|
|
209
238
|
followSymlinks: true,
|
|
210
239
|
});
|
|
211
|
-
const filtered = result.filter((file) => file === entry || !
|
|
240
|
+
const filtered = result.filter((file) => file === entry || !matchesAny(excludePatterns, file));
|
|
212
241
|
if (result.length === 0) {
|
|
213
|
-
logger.warn(logger.i18n.glob_0_did_not_match_any_files(
|
|
242
|
+
logger.warn(logger.i18n.glob_0_did_not_match_any_files(nicePath(entry)));
|
|
214
243
|
}
|
|
215
244
|
else if (filtered.length === 0) {
|
|
216
|
-
logger.warn(logger.i18n.entry_point_0_did_not_match_any_files_after_exclude(
|
|
245
|
+
logger.warn(logger.i18n.entry_point_0_did_not_match_any_files_after_exclude(nicePath(entry)));
|
|
217
246
|
}
|
|
218
|
-
else {
|
|
219
|
-
logger.verbose(`Expanded ${
|
|
220
|
-
.map(
|
|
247
|
+
else if (filtered.length !== 1) {
|
|
248
|
+
logger.verbose(`Expanded ${nicePath(entry)} to:\n\t${filtered
|
|
249
|
+
.map(nicePath)
|
|
221
250
|
.join("\n\t")}`);
|
|
222
251
|
}
|
|
223
252
|
return filtered;
|
|
@@ -228,11 +257,11 @@ function getEntryPrograms(inputFiles, logger, options) {
|
|
|
228
257
|
const noTsConfigFound = options.getFileNames().length === 0 &&
|
|
229
258
|
options.getProjectReferences().length === 0;
|
|
230
259
|
const rootProgram = noTsConfigFound
|
|
231
|
-
?
|
|
260
|
+
? ts.createProgram({
|
|
232
261
|
rootNames: inputFiles,
|
|
233
262
|
options: options.getCompilerOptions(),
|
|
234
263
|
})
|
|
235
|
-
:
|
|
264
|
+
: ts.createProgram({
|
|
236
265
|
rootNames: options.getFileNames(),
|
|
237
266
|
options: options.getCompilerOptions(),
|
|
238
267
|
projectReferences: options.getProjectReferences(),
|
|
@@ -246,7 +275,7 @@ function getEntryPrograms(inputFiles, logger, options) {
|
|
|
246
275
|
for (const ref of resolvedReferences ?? []) {
|
|
247
276
|
if (!ref)
|
|
248
277
|
continue; // This indicates bad configuration... will be reported later.
|
|
249
|
-
programs.push(
|
|
278
|
+
programs.push(ts.createProgram({
|
|
250
279
|
options: options.fixCompilerOptions(ref.commandLine.options),
|
|
251
280
|
rootNames: ref.commandLine.fileNames,
|
|
252
281
|
projectReferences: ref.commandLine.projectReferences,
|
|
@@ -267,7 +296,7 @@ function getEntryPrograms(inputFiles, logger, options) {
|
|
|
267
296
|
*/
|
|
268
297
|
function expandInputFiles(logger, entryPoints, options, supportedFile) {
|
|
269
298
|
const files = [];
|
|
270
|
-
const exclude =
|
|
299
|
+
const exclude = createMinimatch(options.getValue("exclude"));
|
|
271
300
|
function add(file, entryPoint) {
|
|
272
301
|
let stats;
|
|
273
302
|
try {
|
|
@@ -283,18 +312,18 @@ function expandInputFiles(logger, entryPoints, options, supportedFile) {
|
|
|
283
312
|
}
|
|
284
313
|
if (fileIsDir) {
|
|
285
314
|
FS.readdirSync(file).forEach((next) => {
|
|
286
|
-
add(
|
|
315
|
+
add(join(file, next), false);
|
|
287
316
|
});
|
|
288
317
|
}
|
|
289
318
|
else if (supportedFile.test(file)) {
|
|
290
|
-
if (!entryPoint &&
|
|
319
|
+
if (!entryPoint && matchesAny(exclude, file)) {
|
|
291
320
|
return;
|
|
292
321
|
}
|
|
293
|
-
files.push(
|
|
322
|
+
files.push(normalizePath(file));
|
|
294
323
|
}
|
|
295
324
|
}
|
|
296
325
|
entryPoints.forEach((file) => {
|
|
297
|
-
const resolved =
|
|
326
|
+
const resolved = resolve(file);
|
|
298
327
|
if (!FS.existsSync(resolved)) {
|
|
299
328
|
logger.warn(logger.i18n.entry_point_0_did_not_exist(file));
|
|
300
329
|
return;
|
package/dist/lib/utils/enum.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEnumFlags = getEnumFlags;
|
|
4
|
-
exports.removeFlag = removeFlag;
|
|
5
|
-
exports.hasAllFlags = hasAllFlags;
|
|
6
|
-
exports.hasAnyFlag = hasAnyFlag;
|
|
7
|
-
exports.debugFlags = debugFlags;
|
|
8
|
-
exports.getEnumKeys = getEnumKeys;
|
|
9
|
-
function getEnumFlags(flags) {
|
|
1
|
+
export function getEnumFlags(flags) {
|
|
10
2
|
const result = [];
|
|
11
3
|
for (let i = 1; i <= flags; i <<= 1) {
|
|
12
4
|
if (flags & i) {
|
|
@@ -16,20 +8,20 @@ function getEnumFlags(flags) {
|
|
|
16
8
|
return result;
|
|
17
9
|
}
|
|
18
10
|
// T & {} reduces inference priority
|
|
19
|
-
function removeFlag(flag, remove) {
|
|
11
|
+
export function removeFlag(flag, remove) {
|
|
20
12
|
return (flag & ~remove);
|
|
21
13
|
}
|
|
22
|
-
function hasAllFlags(flags, check) {
|
|
14
|
+
export function hasAllFlags(flags, check) {
|
|
23
15
|
return (flags & check) === check;
|
|
24
16
|
}
|
|
25
|
-
function hasAnyFlag(flags, check) {
|
|
17
|
+
export function hasAnyFlag(flags, check) {
|
|
26
18
|
return (flags & check) !== 0;
|
|
27
19
|
}
|
|
28
|
-
function debugFlags(Enum, flags) {
|
|
20
|
+
export function debugFlags(Enum, flags) {
|
|
29
21
|
return getEnumKeys(Enum).filter((key) => (Enum[key] & flags) === Enum[key]);
|
|
30
22
|
}
|
|
31
23
|
// Note: String enums are not handled.
|
|
32
|
-
function getEnumKeys(Enum) {
|
|
24
|
+
export function getEnumKeys(Enum) {
|
|
33
25
|
const E = Enum;
|
|
34
26
|
return Object.keys(E).filter((k) => E[E[k]] === k);
|
|
35
27
|
}
|
package/dist/lib/utils/events.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventDispatcher = void 0;
|
|
4
|
-
const array_1 = require("./array");
|
|
1
|
+
import { insertPrioritySorted } from "./array.js";
|
|
5
2
|
/**
|
|
6
3
|
* Intentionally very simple event emitter.
|
|
7
4
|
*
|
|
8
5
|
* @privateRemarks
|
|
9
6
|
* This is essentially a stripped down copy of EventHooks in hooks.ts.
|
|
10
7
|
*/
|
|
11
|
-
class EventDispatcher {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this._listeners = new Map();
|
|
16
|
-
}
|
|
8
|
+
export class EventDispatcher {
|
|
9
|
+
// Function is *usually* not a good type to use, but here it lets us specify stricter
|
|
10
|
+
// contracts in the methods while not casting everywhere this is used.
|
|
11
|
+
_listeners = new Map();
|
|
17
12
|
/**
|
|
18
13
|
* Starts listening to an event.
|
|
19
14
|
* @param event the event to listen to.
|
|
@@ -22,7 +17,7 @@ class EventDispatcher {
|
|
|
22
17
|
*/
|
|
23
18
|
on(event, listener, priority = 0) {
|
|
24
19
|
const list = (this._listeners.get(event) || []).slice();
|
|
25
|
-
|
|
20
|
+
insertPrioritySorted(list, { listener, priority });
|
|
26
21
|
this._listeners.set(event, list);
|
|
27
22
|
}
|
|
28
23
|
/**
|
|
@@ -51,4 +46,3 @@ class EventDispatcher {
|
|
|
51
46
|
}
|
|
52
47
|
}
|
|
53
48
|
}
|
|
54
|
-
exports.EventDispatcher = EventDispatcher;
|