typedoc 0.26.11 → 0.27.0-beta.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/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 +212 -239
- package/dist/lib/converter/factories/index-signature.d.ts +3 -3
- package/dist/lib/converter/factories/index-signature.js +43 -26
- 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 +372 -2
- package/dist/lib/internationalization/locales/en.d.cts +343 -2
- package/dist/lib/internationalization/locales/jp.cjs +13 -14
- package/dist/lib/internationalization/locales/jp.d.cts +307 -1
- package/dist/lib/internationalization/locales/ko.cjs +12 -11
- package/dist/lib/internationalization/locales/ko.d.cts +221 -1
- package/dist/lib/internationalization/locales/zh.cjs +43 -19
- package/dist/lib/internationalization/locales/zh.d.cts +409 -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 +29 -16
- 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 +624 -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 +14 -0
- package/dist/lib/output/output.js +91 -0
- package/dist/lib/output/plugins/AssetsPlugin.d.ts +9 -8
- package/dist/lib/output/plugins/AssetsPlugin.js +64 -80
- package/dist/lib/output/plugins/HierarchyPlugin.d.ts +7 -0
- package/dist/lib/output/plugins/HierarchyPlugin.js +67 -0
- 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 +7 -6
- package/dist/lib/output/plugins/index.js +7 -15
- package/dist/lib/output/renderer.d.ts +14 -13
- package/dist/lib/output/renderer.js +130 -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 +48 -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 +4 -4
- package/dist/lib/output/themes/default/partials/hierarchy.js +12 -15
- 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 +222 -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 +24 -22
- 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 +32 -34
- package/dist/lib/output/themes/lib.d.ts +17 -3
- package/dist/lib/output/themes/lib.js +118 -50
- 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 -6
- package/dist/lib/utils/jsx.elements.d.ts +1 -1
- package/dist/lib/utils/jsx.elements.js +3 -4
- package/dist/lib/utils/jsx.js +82 -52
- 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 +35 -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 +232 -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 +17 -14
- package/static/main.js +4 -4
- package/static/style.css +109 -17
- 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,20 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
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
1
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
19
2
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
20
3
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -49,50 +32,21 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
49
32
|
}
|
|
50
33
|
return useValue ? value : void 0;
|
|
51
34
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
62
|
-
};
|
|
63
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
64
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
65
|
-
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");
|
|
66
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
67
|
-
};
|
|
68
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
69
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
70
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
71
|
-
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");
|
|
72
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
73
|
-
};
|
|
74
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
-
exports.PackagePlugin = void 0;
|
|
76
|
-
const Path = __importStar(require("path"));
|
|
77
|
-
const components_1 = require("../components");
|
|
78
|
-
const converter_1 = require("../converter");
|
|
79
|
-
const utils_1 = require("../../utils");
|
|
80
|
-
const fs_1 = require("../../utils/fs");
|
|
81
|
-
const paths_1 = require("../../utils/paths");
|
|
82
|
-
const minimalSourceFile_1 = require("../../utils/minimalSourceFile");
|
|
83
|
-
const application_events_1 = require("../../application-events");
|
|
84
|
-
const path_1 = require("path");
|
|
35
|
+
import * as Path from "path";
|
|
36
|
+
import { ConverterComponent } from "../components.js";
|
|
37
|
+
import { Option, EntryPointStrategy, readFile } from "../../utils/index.js";
|
|
38
|
+
import { deriveRootDir, discoverInParentDir, discoverPackageJson, } from "../../utils/fs.js";
|
|
39
|
+
import { nicePath } from "../../utils/paths.js";
|
|
40
|
+
import { MinimalSourceFile } from "../../utils/minimalSourceFile.js";
|
|
41
|
+
import { ApplicationEvents } from "../../application-events.js";
|
|
42
|
+
import { join } from "path";
|
|
43
|
+
import { ConverterEvents } from "../converter-events.js";
|
|
85
44
|
/**
|
|
86
45
|
* A handler that tries to find the package.json and readme.md files of the
|
|
87
46
|
* current project.
|
|
88
47
|
*/
|
|
89
48
|
let PackagePlugin = (() => {
|
|
90
|
-
|
|
91
|
-
let _classDecorators = [(0, components_1.Component)({ name: "package" })];
|
|
92
|
-
let _classDescriptor;
|
|
93
|
-
let _classExtraInitializers = [];
|
|
94
|
-
let _classThis;
|
|
95
|
-
let _classSuper = components_1.ConverterComponent;
|
|
49
|
+
let _classSuper = ConverterComponent;
|
|
96
50
|
let _readme_decorators;
|
|
97
51
|
let _readme_initializers = [];
|
|
98
52
|
let _readme_extraInitializers = [];
|
|
@@ -105,35 +59,53 @@ let PackagePlugin = (() => {
|
|
|
105
59
|
let _includeVersion_decorators;
|
|
106
60
|
let _includeVersion_initializers = [];
|
|
107
61
|
let _includeVersion_extraInitializers = [];
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
this.
|
|
62
|
+
return class PackagePlugin extends _classSuper {
|
|
63
|
+
static {
|
|
64
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
65
|
+
_readme_decorators = [Option("readme")];
|
|
66
|
+
_entryPointStrategy_decorators = [Option("entryPointStrategy")];
|
|
67
|
+
_entryPoints_decorators = [Option("entryPoints")];
|
|
68
|
+
_includeVersion_decorators = [Option("includeVersion")];
|
|
69
|
+
__esDecorate(this, null, _readme_decorators, { kind: "accessor", name: "readme", static: false, private: false, access: { has: obj => "readme" in obj, get: obj => obj.readme, set: (obj, value) => { obj.readme = value; } }, metadata: _metadata }, _readme_initializers, _readme_extraInitializers);
|
|
70
|
+
__esDecorate(this, null, _entryPointStrategy_decorators, { kind: "accessor", name: "entryPointStrategy", static: false, private: false, access: { has: obj => "entryPointStrategy" in obj, get: obj => obj.entryPointStrategy, set: (obj, value) => { obj.entryPointStrategy = value; } }, metadata: _metadata }, _entryPointStrategy_initializers, _entryPointStrategy_extraInitializers);
|
|
71
|
+
__esDecorate(this, null, _entryPoints_decorators, { kind: "accessor", name: "entryPoints", static: false, private: false, access: { has: obj => "entryPoints" in obj, get: obj => obj.entryPoints, set: (obj, value) => { obj.entryPoints = value; } }, metadata: _metadata }, _entryPoints_initializers, _entryPoints_extraInitializers);
|
|
72
|
+
__esDecorate(this, null, _includeVersion_decorators, { kind: "accessor", name: "includeVersion", static: false, private: false, access: { has: obj => "includeVersion" in obj, get: obj => obj.includeVersion, set: (obj, value) => { obj.includeVersion = value; } }, metadata: _metadata }, _includeVersion_initializers, _includeVersion_extraInitializers);
|
|
73
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
119
74
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
get
|
|
125
|
-
set
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
75
|
+
#readme_accessor_storage = __runInitializers(this, _readme_initializers, void 0);
|
|
76
|
+
get readme() { return this.#readme_accessor_storage; }
|
|
77
|
+
set readme(value) { this.#readme_accessor_storage = value; }
|
|
78
|
+
#entryPointStrategy_accessor_storage = (__runInitializers(this, _readme_extraInitializers), __runInitializers(this, _entryPointStrategy_initializers, void 0));
|
|
79
|
+
get entryPointStrategy() { return this.#entryPointStrategy_accessor_storage; }
|
|
80
|
+
set entryPointStrategy(value) { this.#entryPointStrategy_accessor_storage = value; }
|
|
81
|
+
#entryPoints_accessor_storage = (__runInitializers(this, _entryPointStrategy_extraInitializers), __runInitializers(this, _entryPoints_initializers, void 0));
|
|
82
|
+
get entryPoints() { return this.#entryPoints_accessor_storage; }
|
|
83
|
+
set entryPoints(value) { this.#entryPoints_accessor_storage = value; }
|
|
84
|
+
#includeVersion_accessor_storage = (__runInitializers(this, _entryPoints_extraInitializers), __runInitializers(this, _includeVersion_initializers, void 0));
|
|
85
|
+
get includeVersion() { return this.#includeVersion_accessor_storage; }
|
|
86
|
+
set includeVersion(value) { this.#includeVersion_accessor_storage = value; }
|
|
87
|
+
/**
|
|
88
|
+
* The file name of the found readme.md file.
|
|
89
|
+
*/
|
|
90
|
+
readmeFile = __runInitializers(this, _includeVersion_extraInitializers);
|
|
91
|
+
/**
|
|
92
|
+
* Contents of the readme.md file discovered, if any
|
|
93
|
+
*/
|
|
94
|
+
readmeContents;
|
|
95
|
+
/**
|
|
96
|
+
* Contents of package.json for the active project
|
|
97
|
+
*/
|
|
98
|
+
packageJson;
|
|
99
|
+
constructor(owner) {
|
|
100
|
+
super(owner);
|
|
101
|
+
this.owner.on(ConverterEvents.BEGIN, this.onBegin.bind(this));
|
|
102
|
+
this.owner.on(ConverterEvents.RESOLVE_BEGIN, this.onBeginResolve.bind(this));
|
|
103
|
+
this.owner.on(ConverterEvents.END, () => {
|
|
132
104
|
delete this.readmeFile;
|
|
133
105
|
delete this.readmeContents;
|
|
134
106
|
delete this.packageJson;
|
|
135
107
|
});
|
|
136
|
-
this.application.on(
|
|
108
|
+
this.application.on(ApplicationEvents.REVIVE, this.onRevive.bind(this));
|
|
137
109
|
}
|
|
138
110
|
onRevive(project) {
|
|
139
111
|
this.onBegin();
|
|
@@ -146,13 +118,13 @@ let PackagePlugin = (() => {
|
|
|
146
118
|
this.readmeFile = undefined;
|
|
147
119
|
this.readmeContents = undefined;
|
|
148
120
|
this.packageJson = undefined;
|
|
149
|
-
const entryFiles = this.entryPointStrategy ===
|
|
150
|
-
? this.entryPoints.map((d) =>
|
|
121
|
+
const entryFiles = this.entryPointStrategy === EntryPointStrategy.Packages
|
|
122
|
+
? this.entryPoints.map((d) => join(d, "package.json"))
|
|
151
123
|
: this.entryPoints;
|
|
152
124
|
const dirName = this.application.options.packageDir ??
|
|
153
|
-
Path.resolve(
|
|
154
|
-
this.application.logger.verbose(`Begin readme.md/package.json search at ${
|
|
155
|
-
this.packageJson =
|
|
125
|
+
Path.resolve(deriveRootDir(entryFiles));
|
|
126
|
+
this.application.logger.verbose(`Begin readme.md/package.json search at ${nicePath(dirName)}`);
|
|
127
|
+
this.packageJson = discoverPackageJson(dirName)?.content;
|
|
156
128
|
// Path will be resolved already. This is kind of ugly, but...
|
|
157
129
|
if (this.readme.endsWith("none")) {
|
|
158
130
|
return; // No readme, we're done
|
|
@@ -160,16 +132,16 @@ let PackagePlugin = (() => {
|
|
|
160
132
|
if (this.readme) {
|
|
161
133
|
// Readme path provided, read only that file.
|
|
162
134
|
try {
|
|
163
|
-
this.readmeContents =
|
|
135
|
+
this.readmeContents = readFile(this.readme);
|
|
164
136
|
this.readmeFile = this.readme;
|
|
165
137
|
}
|
|
166
138
|
catch {
|
|
167
|
-
this.application.logger.error(this.application.i18n.provided_readme_at_0_could_not_be_read(
|
|
139
|
+
this.application.logger.error(this.application.i18n.provided_readme_at_0_could_not_be_read(nicePath(this.readme)));
|
|
168
140
|
}
|
|
169
141
|
}
|
|
170
142
|
else {
|
|
171
143
|
// No readme provided, automatically find the readme
|
|
172
|
-
const result =
|
|
144
|
+
const result = discoverInParentDir("readme.md", dirName, (content) => content);
|
|
173
145
|
if (result) {
|
|
174
146
|
this.readmeFile = result.file;
|
|
175
147
|
this.readmeContents = result.content;
|
|
@@ -181,7 +153,7 @@ let PackagePlugin = (() => {
|
|
|
181
153
|
}
|
|
182
154
|
addEntries(project) {
|
|
183
155
|
if (this.readmeFile && this.readmeContents) {
|
|
184
|
-
const { content } = this.application.converter.parseRawComment(new
|
|
156
|
+
const { content } = this.application.converter.parseRawComment(new MinimalSourceFile(this.readmeContents, this.readmeFile), project.files);
|
|
185
157
|
project.readme = content;
|
|
186
158
|
}
|
|
187
159
|
if (this.packageJson) {
|
|
@@ -199,26 +171,5 @@ let PackagePlugin = (() => {
|
|
|
199
171
|
}
|
|
200
172
|
}
|
|
201
173
|
};
|
|
202
|
-
_PackagePlugin_readme_accessor_storage = new WeakMap();
|
|
203
|
-
_PackagePlugin_entryPointStrategy_accessor_storage = new WeakMap();
|
|
204
|
-
_PackagePlugin_entryPoints_accessor_storage = new WeakMap();
|
|
205
|
-
_PackagePlugin_includeVersion_accessor_storage = new WeakMap();
|
|
206
|
-
__setFunctionName(_classThis, "PackagePlugin");
|
|
207
|
-
(() => {
|
|
208
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
209
|
-
_readme_decorators = [(0, utils_1.Option)("readme")];
|
|
210
|
-
_entryPointStrategy_decorators = [(0, utils_1.Option)("entryPointStrategy")];
|
|
211
|
-
_entryPoints_decorators = [(0, utils_1.Option)("entryPoints")];
|
|
212
|
-
_includeVersion_decorators = [(0, utils_1.Option)("includeVersion")];
|
|
213
|
-
__esDecorate(_classThis, null, _readme_decorators, { kind: "accessor", name: "readme", static: false, private: false, access: { has: obj => "readme" in obj, get: obj => obj.readme, set: (obj, value) => { obj.readme = value; } }, metadata: _metadata }, _readme_initializers, _readme_extraInitializers);
|
|
214
|
-
__esDecorate(_classThis, null, _entryPointStrategy_decorators, { kind: "accessor", name: "entryPointStrategy", static: false, private: false, access: { has: obj => "entryPointStrategy" in obj, get: obj => obj.entryPointStrategy, set: (obj, value) => { obj.entryPointStrategy = value; } }, metadata: _metadata }, _entryPointStrategy_initializers, _entryPointStrategy_extraInitializers);
|
|
215
|
-
__esDecorate(_classThis, null, _entryPoints_decorators, { kind: "accessor", name: "entryPoints", static: false, private: false, access: { has: obj => "entryPoints" in obj, get: obj => obj.entryPoints, set: (obj, value) => { obj.entryPoints = value; } }, metadata: _metadata }, _entryPoints_initializers, _entryPoints_extraInitializers);
|
|
216
|
-
__esDecorate(_classThis, null, _includeVersion_decorators, { kind: "accessor", name: "includeVersion", static: false, private: false, access: { has: obj => "includeVersion" in obj, get: obj => obj.includeVersion, set: (obj, value) => { obj.includeVersion = value; } }, metadata: _metadata }, _includeVersion_initializers, _includeVersion_extraInitializers);
|
|
217
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
218
|
-
PackagePlugin = _classThis = _classDescriptor.value;
|
|
219
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
220
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
221
|
-
})();
|
|
222
|
-
return PackagePlugin = _classThis;
|
|
223
174
|
})();
|
|
224
|
-
|
|
175
|
+
export { PackagePlugin };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ConverterComponent } from "../components";
|
|
1
|
+
import { ConverterComponent } from "../components.js";
|
|
2
|
+
import type { Converter } from "../converter.js";
|
|
2
3
|
/**
|
|
3
4
|
* A handler that attaches source file information to reflections.
|
|
4
5
|
*/
|
|
@@ -14,10 +15,7 @@ export declare class SourcePlugin extends ConverterComponent {
|
|
|
14
15
|
*/
|
|
15
16
|
private fileNames;
|
|
16
17
|
private repositories?;
|
|
17
|
-
|
|
18
|
-
* Create a new SourceHandler instance.
|
|
19
|
-
*/
|
|
20
|
-
initialize(): void;
|
|
18
|
+
constructor(owner: Converter);
|
|
21
19
|
private onEnd;
|
|
22
20
|
/**
|
|
23
21
|
* Triggered when the converter has created a declaration reflection.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
2
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
3
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -33,45 +32,20 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
32
|
}
|
|
34
33
|
return useValue ? value : void 0;
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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;
|
|
50
|
-
};
|
|
51
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
-
};
|
|
54
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.SourcePlugin = void 0;
|
|
56
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
57
|
-
const index_1 = require("../../models/reflections/index");
|
|
58
|
-
const components_1 = require("../components");
|
|
59
|
-
const converter_1 = require("../converter");
|
|
60
|
-
const utils_1 = require("../../utils");
|
|
61
|
-
const nodes_1 = require("../utils/nodes");
|
|
62
|
-
const path_1 = require("path");
|
|
63
|
-
const models_1 = require("../../models");
|
|
64
|
-
const repository_1 = require("../utils/repository");
|
|
35
|
+
import ts from "typescript";
|
|
36
|
+
import { DeclarationReflection, SignatureReflection, } from "../../models/reflections/index.js";
|
|
37
|
+
import { ConverterComponent } from "../components.js";
|
|
38
|
+
import { Option, normalizePath, getCommonDirectory, } from "../../utils/index.js";
|
|
39
|
+
import { isNamedNode } from "../utils/nodes.js";
|
|
40
|
+
import { relative } from "path";
|
|
41
|
+
import { SourceReference } from "../../models/index.js";
|
|
42
|
+
import { gitIsInstalled, RepositoryManager } from "../utils/repository.js";
|
|
43
|
+
import { ConverterEvents } from "../converter-events.js";
|
|
65
44
|
/**
|
|
66
45
|
* A handler that attaches source file information to reflections.
|
|
67
46
|
*/
|
|
68
47
|
let SourcePlugin = (() => {
|
|
69
|
-
|
|
70
|
-
let _classDecorators = [(0, components_1.Component)({ name: "source" })];
|
|
71
|
-
let _classDescriptor;
|
|
72
|
-
let _classExtraInitializers = [];
|
|
73
|
-
let _classThis;
|
|
74
|
-
let _classSuper = components_1.ConverterComponent;
|
|
48
|
+
let _classSuper = ConverterComponent;
|
|
75
49
|
let _disableSources_decorators;
|
|
76
50
|
let _disableSources_initializers = [];
|
|
77
51
|
let _disableSources_extraInitializers = [];
|
|
@@ -90,40 +64,52 @@ let SourcePlugin = (() => {
|
|
|
90
64
|
let _basePath_decorators;
|
|
91
65
|
let _basePath_initializers = [];
|
|
92
66
|
let _basePath_extraInitializers = [];
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
this.
|
|
67
|
+
return class SourcePlugin extends _classSuper {
|
|
68
|
+
static {
|
|
69
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
70
|
+
_disableSources_decorators = [Option("disableSources")];
|
|
71
|
+
_gitRevision_decorators = [Option("gitRevision")];
|
|
72
|
+
_gitRemote_decorators = [Option("gitRemote")];
|
|
73
|
+
_disableGit_decorators = [Option("disableGit")];
|
|
74
|
+
_sourceLinkTemplate_decorators = [Option("sourceLinkTemplate")];
|
|
75
|
+
_basePath_decorators = [Option("basePath")];
|
|
76
|
+
__esDecorate(this, null, _disableSources_decorators, { kind: "accessor", name: "disableSources", static: false, private: false, access: { has: obj => "disableSources" in obj, get: obj => obj.disableSources, set: (obj, value) => { obj.disableSources = value; } }, metadata: _metadata }, _disableSources_initializers, _disableSources_extraInitializers);
|
|
77
|
+
__esDecorate(this, null, _gitRevision_decorators, { kind: "accessor", name: "gitRevision", static: false, private: false, access: { has: obj => "gitRevision" in obj, get: obj => obj.gitRevision, set: (obj, value) => { obj.gitRevision = value; } }, metadata: _metadata }, _gitRevision_initializers, _gitRevision_extraInitializers);
|
|
78
|
+
__esDecorate(this, null, _gitRemote_decorators, { kind: "accessor", name: "gitRemote", static: false, private: false, access: { has: obj => "gitRemote" in obj, get: obj => obj.gitRemote, set: (obj, value) => { obj.gitRemote = value; } }, metadata: _metadata }, _gitRemote_initializers, _gitRemote_extraInitializers);
|
|
79
|
+
__esDecorate(this, null, _disableGit_decorators, { kind: "accessor", name: "disableGit", static: false, private: false, access: { has: obj => "disableGit" in obj, get: obj => obj.disableGit, set: (obj, value) => { obj.disableGit = value; } }, metadata: _metadata }, _disableGit_initializers, _disableGit_extraInitializers);
|
|
80
|
+
__esDecorate(this, null, _sourceLinkTemplate_decorators, { kind: "accessor", name: "sourceLinkTemplate", static: false, private: false, access: { has: obj => "sourceLinkTemplate" in obj, get: obj => obj.sourceLinkTemplate, set: (obj, value) => { obj.sourceLinkTemplate = value; } }, metadata: _metadata }, _sourceLinkTemplate_initializers, _sourceLinkTemplate_extraInitializers);
|
|
81
|
+
__esDecorate(this, null, _basePath_decorators, { kind: "accessor", name: "basePath", static: false, private: false, access: { has: obj => "basePath" in obj, get: obj => obj.basePath, set: (obj, value) => { obj.basePath = value; } }, metadata: _metadata }, _basePath_initializers, _basePath_extraInitializers);
|
|
82
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
106
83
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
get
|
|
112
|
-
set
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
get
|
|
118
|
-
set
|
|
84
|
+
#disableSources_accessor_storage = __runInitializers(this, _disableSources_initializers, void 0);
|
|
85
|
+
get disableSources() { return this.#disableSources_accessor_storage; }
|
|
86
|
+
set disableSources(value) { this.#disableSources_accessor_storage = value; }
|
|
87
|
+
#gitRevision_accessor_storage = (__runInitializers(this, _disableSources_extraInitializers), __runInitializers(this, _gitRevision_initializers, void 0));
|
|
88
|
+
get gitRevision() { return this.#gitRevision_accessor_storage; }
|
|
89
|
+
set gitRevision(value) { this.#gitRevision_accessor_storage = value; }
|
|
90
|
+
#gitRemote_accessor_storage = (__runInitializers(this, _gitRevision_extraInitializers), __runInitializers(this, _gitRemote_initializers, void 0));
|
|
91
|
+
get gitRemote() { return this.#gitRemote_accessor_storage; }
|
|
92
|
+
set gitRemote(value) { this.#gitRemote_accessor_storage = value; }
|
|
93
|
+
#disableGit_accessor_storage = (__runInitializers(this, _gitRemote_extraInitializers), __runInitializers(this, _disableGit_initializers, void 0));
|
|
94
|
+
get disableGit() { return this.#disableGit_accessor_storage; }
|
|
95
|
+
set disableGit(value) { this.#disableGit_accessor_storage = value; }
|
|
96
|
+
#sourceLinkTemplate_accessor_storage = (__runInitializers(this, _disableGit_extraInitializers), __runInitializers(this, _sourceLinkTemplate_initializers, void 0));
|
|
97
|
+
get sourceLinkTemplate() { return this.#sourceLinkTemplate_accessor_storage; }
|
|
98
|
+
set sourceLinkTemplate(value) { this.#sourceLinkTemplate_accessor_storage = value; }
|
|
99
|
+
#basePath_accessor_storage = (__runInitializers(this, _sourceLinkTemplate_extraInitializers), __runInitializers(this, _basePath_initializers, void 0));
|
|
100
|
+
get basePath() { return this.#basePath_accessor_storage; }
|
|
101
|
+
set basePath(value) { this.#basePath_accessor_storage = value; }
|
|
119
102
|
/**
|
|
120
|
-
*
|
|
103
|
+
* All file names to find the base path from.
|
|
121
104
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.owner.on(
|
|
105
|
+
fileNames = (__runInitializers(this, _basePath_extraInitializers), new Set());
|
|
106
|
+
repositories;
|
|
107
|
+
constructor(owner) {
|
|
108
|
+
super(owner);
|
|
109
|
+
this.owner.on(ConverterEvents.END, this.onEnd.bind(this));
|
|
110
|
+
this.owner.on(ConverterEvents.CREATE_DECLARATION, this.onDeclaration.bind(this));
|
|
111
|
+
this.owner.on(ConverterEvents.CREATE_SIGNATURE, this.onSignature.bind(this));
|
|
112
|
+
this.owner.on(ConverterEvents.RESOLVE_BEGIN, this.onBeginResolve.bind(this));
|
|
127
113
|
}
|
|
128
114
|
onEnd() {
|
|
129
115
|
// Should probably clear repositories/ignoredPaths here, but these aren't likely to change between runs...
|
|
@@ -143,28 +129,28 @@ let SourcePlugin = (() => {
|
|
|
143
129
|
const symbol = reflection.project.getSymbolFromReflection(reflection);
|
|
144
130
|
for (const node of symbol?.declarations || []) {
|
|
145
131
|
const sourceFile = node.getSourceFile();
|
|
146
|
-
const fileName =
|
|
132
|
+
const fileName = normalizePath(sourceFile.fileName);
|
|
147
133
|
this.fileNames.add(fileName);
|
|
148
134
|
let position;
|
|
149
|
-
if (
|
|
135
|
+
if (ts.isSourceFile(node)) {
|
|
150
136
|
position = { character: 0, line: 0 };
|
|
151
137
|
}
|
|
152
138
|
else {
|
|
153
|
-
position =
|
|
139
|
+
position = ts.getLineAndCharacterOfPosition(sourceFile, getLocationNode(node).getStart());
|
|
154
140
|
}
|
|
155
141
|
reflection.sources ||= [];
|
|
156
|
-
reflection.sources.push(new
|
|
142
|
+
reflection.sources.push(new SourceReference(fileName, position.line + 1, position.character));
|
|
157
143
|
}
|
|
158
144
|
}
|
|
159
145
|
onSignature(_context, reflection, sig) {
|
|
160
146
|
if (this.disableSources || !sig)
|
|
161
147
|
return;
|
|
162
148
|
const sourceFile = sig.getSourceFile();
|
|
163
|
-
const fileName =
|
|
149
|
+
const fileName = normalizePath(sourceFile.fileName);
|
|
164
150
|
this.fileNames.add(fileName);
|
|
165
|
-
const position =
|
|
151
|
+
const position = ts.getLineAndCharacterOfPosition(sourceFile, getLocationNode(sig).getStart());
|
|
166
152
|
reflection.sources ||= [];
|
|
167
|
-
reflection.sources.push(new
|
|
153
|
+
reflection.sources.push(new SourceReference(fileName, position.line + 1, position.character));
|
|
168
154
|
}
|
|
169
155
|
/**
|
|
170
156
|
* Triggered when the converter begins resolving a project.
|
|
@@ -183,63 +169,36 @@ let SourcePlugin = (() => {
|
|
|
183
169
|
!this.gitRevision) {
|
|
184
170
|
this.application.logger.warn(context.i18n.disable_git_set_and_git_revision_used());
|
|
185
171
|
}
|
|
186
|
-
const basePath = this.basePath ||
|
|
187
|
-
this.repositories ||= new
|
|
172
|
+
const basePath = this.basePath || getCommonDirectory([...this.fileNames]);
|
|
173
|
+
this.repositories ||= new RepositoryManager(basePath, this.gitRevision, this.gitRemote, this.sourceLinkTemplate, this.disableGit, this.application.logger);
|
|
188
174
|
for (const id in context.project.reflections) {
|
|
189
175
|
const refl = context.project.reflections[id];
|
|
190
|
-
if (!(refl instanceof
|
|
191
|
-
refl instanceof
|
|
176
|
+
if (!(refl instanceof DeclarationReflection ||
|
|
177
|
+
refl instanceof SignatureReflection)) {
|
|
192
178
|
continue;
|
|
193
179
|
}
|
|
194
180
|
if (replaceSourcesWithParentSources(refl)) {
|
|
195
181
|
refl.sources = refl.parent.sources;
|
|
196
182
|
}
|
|
197
183
|
for (const source of refl.sources || []) {
|
|
198
|
-
if (this.disableGit ||
|
|
184
|
+
if (this.disableGit || gitIsInstalled()) {
|
|
199
185
|
const repo = this.repositories.getRepository(source.fullFileName);
|
|
200
186
|
source.url = repo?.getURL(source.fullFileName, source.line);
|
|
201
187
|
}
|
|
202
|
-
source.fileName =
|
|
188
|
+
source.fileName = normalizePath(relative(basePath, source.fullFileName));
|
|
203
189
|
}
|
|
204
190
|
}
|
|
205
191
|
}
|
|
206
192
|
};
|
|
207
|
-
_SourcePlugin_disableSources_accessor_storage = new WeakMap();
|
|
208
|
-
_SourcePlugin_gitRevision_accessor_storage = new WeakMap();
|
|
209
|
-
_SourcePlugin_gitRemote_accessor_storage = new WeakMap();
|
|
210
|
-
_SourcePlugin_disableGit_accessor_storage = new WeakMap();
|
|
211
|
-
_SourcePlugin_sourceLinkTemplate_accessor_storage = new WeakMap();
|
|
212
|
-
_SourcePlugin_basePath_accessor_storage = new WeakMap();
|
|
213
|
-
__setFunctionName(_classThis, "SourcePlugin");
|
|
214
|
-
(() => {
|
|
215
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
216
|
-
_disableSources_decorators = [(0, utils_1.Option)("disableSources")];
|
|
217
|
-
_gitRevision_decorators = [(0, utils_1.Option)("gitRevision")];
|
|
218
|
-
_gitRemote_decorators = [(0, utils_1.Option)("gitRemote")];
|
|
219
|
-
_disableGit_decorators = [(0, utils_1.Option)("disableGit")];
|
|
220
|
-
_sourceLinkTemplate_decorators = [(0, utils_1.Option)("sourceLinkTemplate")];
|
|
221
|
-
_basePath_decorators = [(0, utils_1.Option)("basePath")];
|
|
222
|
-
__esDecorate(_classThis, null, _disableSources_decorators, { kind: "accessor", name: "disableSources", static: false, private: false, access: { has: obj => "disableSources" in obj, get: obj => obj.disableSources, set: (obj, value) => { obj.disableSources = value; } }, metadata: _metadata }, _disableSources_initializers, _disableSources_extraInitializers);
|
|
223
|
-
__esDecorate(_classThis, null, _gitRevision_decorators, { kind: "accessor", name: "gitRevision", static: false, private: false, access: { has: obj => "gitRevision" in obj, get: obj => obj.gitRevision, set: (obj, value) => { obj.gitRevision = value; } }, metadata: _metadata }, _gitRevision_initializers, _gitRevision_extraInitializers);
|
|
224
|
-
__esDecorate(_classThis, null, _gitRemote_decorators, { kind: "accessor", name: "gitRemote", static: false, private: false, access: { has: obj => "gitRemote" in obj, get: obj => obj.gitRemote, set: (obj, value) => { obj.gitRemote = value; } }, metadata: _metadata }, _gitRemote_initializers, _gitRemote_extraInitializers);
|
|
225
|
-
__esDecorate(_classThis, null, _disableGit_decorators, { kind: "accessor", name: "disableGit", static: false, private: false, access: { has: obj => "disableGit" in obj, get: obj => obj.disableGit, set: (obj, value) => { obj.disableGit = value; } }, metadata: _metadata }, _disableGit_initializers, _disableGit_extraInitializers);
|
|
226
|
-
__esDecorate(_classThis, null, _sourceLinkTemplate_decorators, { kind: "accessor", name: "sourceLinkTemplate", static: false, private: false, access: { has: obj => "sourceLinkTemplate" in obj, get: obj => obj.sourceLinkTemplate, set: (obj, value) => { obj.sourceLinkTemplate = value; } }, metadata: _metadata }, _sourceLinkTemplate_initializers, _sourceLinkTemplate_extraInitializers);
|
|
227
|
-
__esDecorate(_classThis, null, _basePath_decorators, { kind: "accessor", name: "basePath", static: false, private: false, access: { has: obj => "basePath" in obj, get: obj => obj.basePath, set: (obj, value) => { obj.basePath = value; } }, metadata: _metadata }, _basePath_initializers, _basePath_extraInitializers);
|
|
228
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
229
|
-
SourcePlugin = _classThis = _classDescriptor.value;
|
|
230
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
231
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
232
|
-
})();
|
|
233
|
-
return SourcePlugin = _classThis;
|
|
234
193
|
})();
|
|
235
|
-
|
|
194
|
+
export { SourcePlugin };
|
|
236
195
|
function getLocationNode(node) {
|
|
237
|
-
if (
|
|
196
|
+
if (isNamedNode(node))
|
|
238
197
|
return node.name;
|
|
239
198
|
return node;
|
|
240
199
|
}
|
|
241
200
|
function replaceSourcesWithParentSources(refl) {
|
|
242
|
-
if (refl instanceof
|
|
201
|
+
if (refl instanceof DeclarationReflection || !refl.sources) {
|
|
243
202
|
return false;
|
|
244
203
|
}
|
|
245
204
|
const symbol = refl.project.getSymbolFromReflection(refl.parent);
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { DeclarationReflection } from "../../models/reflections/index";
|
|
2
|
-
import { ConverterComponent } from "../components";
|
|
1
|
+
import { DeclarationReflection } from "../../models/reflections/index.js";
|
|
2
|
+
import { ConverterComponent } from "../components.js";
|
|
3
|
+
import type { Converter } from "../converter.js";
|
|
3
4
|
/**
|
|
4
5
|
* Responsible for adding `implementedBy` / `implementedFrom`
|
|
5
6
|
*/
|
|
6
7
|
export declare class TypePlugin extends ConverterComponent {
|
|
7
8
|
reflections: Set<DeclarationReflection>;
|
|
8
|
-
|
|
9
|
-
* Create a new TypeHandler instance.
|
|
10
|
-
*/
|
|
11
|
-
initialize(): void;
|
|
9
|
+
constructor(owner: Converter);
|
|
12
10
|
private onRevive;
|
|
13
11
|
private onResolve;
|
|
14
12
|
private resolve;
|