From 8e8b277596a5439f5b43ffc7ea783a4a5f699d0a Mon Sep 17 00:00:00 2001 From: Emily Marigold Klassen Date: Mon, 26 Aug 2019 13:07:44 -0700 Subject: [PATCH 01/16] Add support for `` inside of Marked Link Brackets --- src/lib/output/plugins/MarkedLinksPlugin.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/output/plugins/MarkedLinksPlugin.ts b/src/lib/output/plugins/MarkedLinksPlugin.ts index d44fc6027..fb86924c5 100644 --- a/src/lib/output/plugins/MarkedLinksPlugin.ts +++ b/src/lib/output/plugins/MarkedLinksPlugin.ts @@ -54,8 +54,9 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent { */ private replaceBrackets(text: string): string { return text.replace(this.brackets, (match: string, content: string): string => { - const split = MarkedLinksPlugin.splitLinkText(content); - return this.buildLink(match, split.target, split.caption); + const monospace = content[0] === '`' && content[content.length - 1] === '`'; + const split = MarkedLinksPlugin.splitLinkText(monospace ? content.slice(1, -1) : content); + return this.buildLink(match, split.target, split.caption, monospace); }); } From 362138e01fb448699d66595c406adaef291086c1 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sat, 18 Jan 2020 15:54:25 -0700 Subject: [PATCH 02/16] feat!: Library mode BREAKING CHANGE: Renames external modules to modules, and modules to namespaces. Closes #109. --- scripts/rebuild_specs.js | 4 ++++ src/lib/converter/converter.ts | 19 ++++++++++++---- src/lib/converter/factories/declaration.ts | 8 +++---- src/lib/converter/nodes/block.ts | 22 ++++++++++++++++++- src/lib/converter/nodes/module.ts | 2 +- src/lib/converter/plugins/CommentPlugin.ts | 4 ++-- .../converter/plugins/DynamicModulePlugin.ts | 2 +- src/lib/converter/plugins/GroupPlugin.ts | 2 +- src/lib/models/reflections/abstract.ts | 6 ++--- src/lib/output/themes/DefaultTheme.ts | 4 ++-- src/lib/utils/options/declaration.ts | 4 ++-- src/lib/utils/options/sources/typedoc.ts | 5 +++-- src/test/converter.test.ts | 4 ++++ 13 files changed, 63 insertions(+), 23 deletions(-) diff --git a/scripts/rebuild_specs.js b/scripts/rebuild_specs.js index 4bb90ea64..2848d1cc7 100644 --- a/scripts/rebuild_specs.js +++ b/scripts/rebuild_specs.js @@ -42,6 +42,10 @@ const conversions = [ () => app.options.setValue('categorizeByGroup', false), () => app.options.setValue('categorizeByGroup', true) ], + ['specs.lib', + () => app.options.setValue('mode', 'library'), + () => app.options.setValue('mode', 'modules'), + ] ]; /** diff --git a/src/lib/converter/converter.ts b/src/lib/converter/converter.ts index e65ca05c2..a248e7fe7 100644 --- a/src/lib/converter/converter.ts +++ b/src/lib/converter/converter.ts @@ -7,7 +7,7 @@ import { Reflection, Type, ProjectReflection } from '../models/index'; import { Context } from './context'; import { ConverterComponent, ConverterNodeComponent, ConverterTypeComponent, TypeTypeConverter, TypeNodeConverter } from './components'; import { Component, ChildableComponent, ComponentClass } from '../utils/component'; -import { BindOption } from '../utils'; +import { BindOption, SourceFileMode } from '../utils'; import { normalizePath } from '../utils/fs'; import { createMinimatch } from '../utils/paths'; @@ -366,9 +366,20 @@ export class Converter extends ChildableComponent !isExcluded(file)); const isRelevantError = ({ file }: ts.Diagnostic) => !file || includedSourceFiles.includes(file); - includedSourceFiles.forEach((sourceFile) => { - this.convertNode(context, sourceFile); - }); + if (this.application.options.getValue('mode') === SourceFileMode.Library) { + for (const fileName of context.fileNames) { + const sourceFile = includedSourceFiles.find(file => fileName === file.fileName); + if (sourceFile) { + this.convertNode(context, sourceFile); + } else { + this.application.logger.warn(`Failed to find source file of entry point ${fileName}`); + } + } + } else { + includedSourceFiles.forEach((sourceFile) => { + this.convertNode(context, sourceFile); + }); + } if (this.application.ignoreCompilerErrors) { return []; diff --git a/src/lib/converter/factories/declaration.ts b/src/lib/converter/factories/declaration.ts index 5ec62f8e4..008a39537 100644 --- a/src/lib/converter/factories/declaration.ts +++ b/src/lib/converter/factories/declaration.ts @@ -11,7 +11,7 @@ import { createReferenceType } from './reference'; const nonStaticKinds = [ ReflectionKind.Class, ReflectionKind.Interface, - ReflectionKind.Module + ReflectionKind.Namespace ]; /** @@ -71,12 +71,12 @@ export function createDeclaration(context: Context, node: ts.Declaration, kind: // Test whether the node is exported let isExported: boolean; - if (kind === ReflectionKind.ExternalModule || kind === ReflectionKind.Global) { + if (kind === ReflectionKind.Module || kind === ReflectionKind.Global) { isExported = true; } else if (container.kind === ReflectionKind.Global) { // In file mode, everything is exported. isExported = true; - } else if (container.kindOf([ReflectionKind.Module, ReflectionKind.ExternalModule])) { + } else if (container.kindOf([ReflectionKind.Namespace, ReflectionKind.Module])) { const symbol = context.getSymbolAtLocation(node); if (!symbol) { isExported = false; @@ -213,7 +213,7 @@ function canMergeReflectionsByKind(kind1: ReflectionKind, kind2: ReflectionKind) */ function mergeDeclarations(context: Context, reflection: DeclarationReflection, node: ts.Node, kind: ReflectionKind) { if (reflection.kind !== kind) { - const weights = [ReflectionKind.Module, ReflectionKind.Enum, ReflectionKind.Class]; + const weights = [ReflectionKind.Namespace, ReflectionKind.Enum, ReflectionKind.Class]; const kindWeight = weights.indexOf(kind); const childKindWeight = weights.indexOf(reflection.kind); if (kindWeight > childKindWeight) { diff --git a/src/lib/converter/nodes/block.ts b/src/lib/converter/nodes/block.ts index bd3581b75..c744ce2e7 100644 --- a/src/lib/converter/nodes/block.ts +++ b/src/lib/converter/nodes/block.ts @@ -55,11 +55,17 @@ export class BlockConverter extends ConverterNodeComponent { if (this.mode === SourceFileMode.Modules) { - result = createDeclaration(context, node, ReflectionKind.ExternalModule, node.fileName); + result = createDeclaration(context, node, ReflectionKind.Module, node.fileName); context.withScope(result, () => { this.convertStatements(context, node); result!.setFlag(ReflectionFlag.Exported); }); + } else if (this.mode === SourceFileMode.Library) { + result = createDeclaration(context, node, ReflectionKind.Module, node.fileName); + context.withScope(result, () => { + this.convertVisibleDeclarations(context, node); + result!.setFlag(ReflectionFlag.Exported); + }); } else { this.convertStatements(context, node); } @@ -85,4 +91,18 @@ export class BlockConverter extends ConverterNodeComponent context.scope - : createDeclaration(context, node, ReflectionKind.Module); + : createDeclaration(context, node, ReflectionKind.Namespace); context.withScope(reflection, () => { if (node.body) { this.owner.convertNode(context, node.body); diff --git a/src/lib/converter/plugins/CommentPlugin.ts b/src/lib/converter/plugins/CommentPlugin.ts index 1e86d2435..c77af3eb9 100644 --- a/src/lib/converter/plugins/CommentPlugin.ts +++ b/src/lib/converter/plugins/CommentPlugin.ts @@ -111,7 +111,7 @@ export class CommentPlugin extends ConverterComponent { CommentPlugin.removeTags(comment, 'event'); } - if (reflection.kindOf(ReflectionKind.ExternalModule)) { + if (reflection.kindOf(ReflectionKind.Module)) { CommentPlugin.removeTags(comment, 'packagedocumentation'); } } @@ -172,7 +172,7 @@ export class CommentPlugin extends ConverterComponent { if (reflection.kindOf(ReflectionKind.FunctionOrMethod) || (reflection.kindOf(ReflectionKind.Event) && reflection['signatures'])) { const comment = parseComment(rawComment, reflection.comment); this.applyModifiers(reflection, comment); - } else if (reflection.kindOf(ReflectionKind.Module)) { + } else if (reflection.kindOf(ReflectionKind.Namespace)) { this.storeModuleComment(rawComment, reflection); } else { const comment = parseComment(rawComment, reflection.comment); diff --git a/src/lib/converter/plugins/DynamicModulePlugin.ts b/src/lib/converter/plugins/DynamicModulePlugin.ts index d89080aaa..07a3ca8b6 100644 --- a/src/lib/converter/plugins/DynamicModulePlugin.ts +++ b/src/lib/converter/plugins/DynamicModulePlugin.ts @@ -52,7 +52,7 @@ export class DynamicModulePlugin extends ConverterComponent { * @param node The node that is currently processed if available. */ private onDeclaration(context: Context, reflection: Reflection, node?: ts.Node) { - if (reflection.kindOf(ReflectionKind.ExternalModule)) { + if (reflection.kindOf(ReflectionKind.Module)) { let name = reflection.name; if (!name.includes('/')) { return; diff --git a/src/lib/converter/plugins/GroupPlugin.ts b/src/lib/converter/plugins/GroupPlugin.ts index 80e634d36..97e21e2e3 100644 --- a/src/lib/converter/plugins/GroupPlugin.ts +++ b/src/lib/converter/plugins/GroupPlugin.ts @@ -17,8 +17,8 @@ export class GroupPlugin extends ConverterComponent { */ static WEIGHTS = [ ReflectionKind.Global, - ReflectionKind.ExternalModule, ReflectionKind.Module, + ReflectionKind.Namespace, ReflectionKind.Enum, ReflectionKind.EnumMember, ReflectionKind.Class, diff --git a/src/lib/models/reflections/abstract.ts b/src/lib/models/reflections/abstract.ts index 162097aa9..0aff71480 100644 --- a/src/lib/models/reflections/abstract.ts +++ b/src/lib/models/reflections/abstract.ts @@ -36,8 +36,8 @@ export function resetReflectionID() { */ export enum ReflectionKind { Global = 0, - ExternalModule = 1 << 0, - Module = 1 << 1, + Module = 1 << 0, + Namespace = 1 << 1, Enum = 1 << 2, EnumMember = 1 << 4, Variable = 1 << 5, @@ -66,7 +66,7 @@ export enum ReflectionKind { FunctionOrMethod = ReflectionKind.Function | Method, ClassMember = Accessor | Constructor | Method | Property | Event, SomeSignature = CallSignature | IndexSignature | ConstructorSignature | GetSignature | SetSignature, - SomeModule = Module | ExternalModule, + SomeModule = Namespace | Module, SomeType = Interface | TypeLiteral | TypeParameter | TypeAlias, SomeValue = Variable | Function | ObjectLiteral } diff --git a/src/lib/output/themes/DefaultTheme.ts b/src/lib/output/themes/DefaultTheme.ts index e79ff3cf5..e9703ce2e 100644 --- a/src/lib/output/themes/DefaultTheme.ts +++ b/src/lib/output/themes/DefaultTheme.ts @@ -61,7 +61,7 @@ export class DefaultTheme extends Theme { directory: 'enums', template: 'reflection.hbs' }, { - kind: [ReflectionKind.Module, ReflectionKind.ExternalModule], + kind: [ReflectionKind.Namespace, ReflectionKind.Module], isLeaf: false, directory: 'modules', template: 'reflection.hbs' @@ -375,7 +375,7 @@ export class NavigationBuilder { let target = someModule.parent; let inScope = (someModule === this.entryPoint); while (target) { - if (target.kindOf(ReflectionKind.ExternalModule)) { + if (target.kindOf(ReflectionKind.Module)) { return; } if (this.entryPoint === target) { diff --git a/src/lib/utils/options/declaration.ts b/src/lib/utils/options/declaration.ts index 54bd493f4..0cad9dd1d 100644 --- a/src/lib/utils/options/declaration.ts +++ b/src/lib/utils/options/declaration.ts @@ -31,7 +31,7 @@ export type TypeDocAndTSOptions = TypeDocOptions & Pick, IgnoredTsOptionKeys>>; export enum SourceFileMode { - File, Modules + File, Modules, Library } /** @@ -43,7 +43,7 @@ export interface TypeDocOptionMap { tsconfig: string; inputFiles: string[]; - mode: { file: SourceFileMode.File, modules: SourceFileMode.Modules }; + mode: { file: SourceFileMode.File, modules: SourceFileMode.Modules, library: SourceFileMode.Library }; includeDeclarations: boolean; entryPoint: string; exclude: string[]; diff --git a/src/lib/utils/options/sources/typedoc.ts b/src/lib/utils/options/sources/typedoc.ts index 175b209be..1d74a86b3 100644 --- a/src/lib/utils/options/sources/typedoc.ts +++ b/src/lib/utils/options/sources/typedoc.ts @@ -26,8 +26,9 @@ export function addTypeDocOptions(options: Options) { help: "Specifies the output mode the project is used to be compiled with: 'file' or 'modules'", type: ParameterType.Map, map: { - 'file': SourceFileMode.File, - 'modules': SourceFileMode.Modules + file: SourceFileMode.File, + modules: SourceFileMode.Modules, + library: SourceFileMode.Library }, defaultValue: SourceFileMode.Modules }); diff --git a/src/test/converter.test.ts b/src/test/converter.test.ts index dac3ecd62..c368ed655 100644 --- a/src/test/converter.test.ts +++ b/src/test/converter.test.ts @@ -35,6 +35,10 @@ describe('Converter', function() { ['specs-with-lump-categories', () => app.options.setValue('categorizeByGroup', false), () => app.options.setValue('categorizeByGroup', true) + ], + ['specs.lib', + () => app.options.setValue('mode', 'library'), + () => app.options.setValue('mode', 'modules') ] ]; From 98207f1d5ded77bfa9f6b12d6ead425a846e1bc5 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sat, 18 Jan 2020 16:03:19 -0700 Subject: [PATCH 03/16] chore: Rebuild specs Required due to the renames in the previous commit. --- src/test/converter/alias/specs.json | 4 +- .../class/specs-with-lump-categories.json | 24 +- .../class/specs-without-exported.json | 24 +- src/test/converter/class/specs.json | 24 +- src/test/converter/comment/specs.json | 6 +- src/test/converter/declaration/specs.d.json | 6 +- src/test/converter/dots.in.path/specs.json | 6 +- src/test/converter/enum/specs.json | 4 +- .../exports/specs-without-exported.json | 12 +- src/test/converter/exports/specs.json | 12 +- src/test/converter/exports/specs.lib.json | 361 ++++++++++++++++++ src/test/converter/function/specs.json | 12 +- src/test/converter/interface/specs.json | 12 +- src/test/converter/mixin/specs.json | 4 +- src/test/converter/react/specs.json | 4 +- src/test/converter/types/specs.json | 6 +- src/test/converter/variables/specs.json | 10 +- .../specs/classes/_access_.privateclass.html | 38 +- .../specs/classes/_classes_.baseclass.html | 44 +-- .../specs/classes/_classes_.genericclass.html | 44 +-- .../classes/_classes_.internalclass.html | 44 +-- .../classes/_classes_.nongenericclass.html | 44 +-- .../specs/classes/_classes_.subclassa.html | 44 +-- .../specs/classes/_classes_.subclassb.html | 44 +-- ..._default_export_.defaultexportedclass.html | 32 +- ..._default_export_.notexportedclassname.html | 32 +- .../classes/_flattened_.flattenedclass.html | 34 +- .../renderer/specs/classes/_mixin_.base.html | 48 +-- .../classes/_mixin_.someclasswithmixin.html | 48 +-- .../_single_export_.notexportedclass.html | 30 +- .../_single_export_.singleexportedclass.html | 30 +- .../enums/_enumerations_.directions.html | 30 +- .../specs/enums/_enumerations_.size.html | 30 +- src/test/renderer/specs/globals.html | 54 +-- src/test/renderer/specs/index.html | 26 +- .../interfaces/_classes_.nameinterface.html | 44 +-- .../interfaces/_classes_.printinterface.html | 44 +-- .../_classes_.printnameinterface.html | 44 +-- .../specs/interfaces/_generics_.a.html | 44 +-- .../specs/interfaces/_generics_.ab.html | 44 +-- .../specs/interfaces/_generics_.abnumber.html | 44 +-- .../specs/interfaces/_generics_.abstring.html | 44 +-- .../specs/interfaces/_generics_.b.html | 44 +-- .../specs/interfaces/_mixin_.mixin1type.html | 48 +-- .../specs/interfaces/_mixin_.mixin2.html | 48 +-- src/test/renderer/specs/modules/_access_.html | 66 ++-- .../specs/modules/_access_.privatemodule.html | 38 +- .../renderer/specs/modules/_classes_.html | 64 ++-- .../specs/modules/_default_export_.html | 42 +- .../specs/modules/_enumerations_.html | 36 +- .../renderer/specs/modules/_flattened_.html | 56 +-- .../renderer/specs/modules/_functions_.html | 128 +++---- .../modules/_functions_.modulefunction.html | 54 +-- .../renderer/specs/modules/_generics_.html | 76 ++-- src/test/renderer/specs/modules/_mixin_.html | 92 ++--- src/test/renderer/specs/modules/_mod2_.html | 42 +- src/test/renderer/specs/modules/_mod_.html | 42 +- .../renderer/specs/modules/_modules_.html | 58 +-- .../specs/modules/_modules_.mymodule.html | 60 +-- .../_modules_.mymodule.mysubmodule.html | 44 +-- .../specs/modules/_single_export_.html | 36 +- .../renderer/specs/modules/_weird_names_.html | 34 +- 62 files changed, 1502 insertions(+), 1141 deletions(-) create mode 100644 src/test/converter/exports/specs.lib.json diff --git a/src/test/converter/alias/specs.json b/src/test/converter/alias/specs.json index cb302bdae..9b2ae3bf7 100644 --- a/src/test/converter/alias/specs.json +++ b/src/test/converter/alias/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"alias\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -629,7 +629,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1 diff --git a/src/test/converter/class/specs-with-lump-categories.json b/src/test/converter/class/specs-with-lump-categories.json index f63eac446..f485f048d 100644 --- a/src/test/converter/class/specs-with-lump-categories.json +++ b/src/test/converter/class/specs-with-lump-categories.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"access\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -336,7 +336,7 @@ "id": 15, "name": "\"class\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1741,7 +1741,7 @@ "id": 75, "name": "\"clodule-with-subclass\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1887,7 +1887,7 @@ "id": 80, "name": "\"constructor-properties\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -2358,7 +2358,7 @@ "id": 101, "name": "\"decorators\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -2725,7 +2725,7 @@ "id": 145, "name": "\"events\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -2802,7 +2802,7 @@ "id": 118, "name": "\"events-overloads\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -3227,7 +3227,7 @@ "id": 148, "name": "\"generic-class\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -3664,7 +3664,7 @@ "id": 166, "name": "\"getter-setter\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -3871,7 +3871,7 @@ "id": 178, "name": "\"this\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -3965,7 +3965,7 @@ "id": 182, "name": "\"type-operator\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -4147,7 +4147,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1, diff --git a/src/test/converter/class/specs-without-exported.json b/src/test/converter/class/specs-without-exported.json index 6f61d9b4e..75a0e7b26 100644 --- a/src/test/converter/class/specs-without-exported.json +++ b/src/test/converter/class/specs-without-exported.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"access\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -336,7 +336,7 @@ "id": 15, "name": "\"class\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1624,7 +1624,7 @@ "id": 69, "name": "\"clodule-with-subclass\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1770,7 +1770,7 @@ "id": 74, "name": "\"constructor-properties\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1787,7 +1787,7 @@ "id": 75, "name": "\"decorators\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1804,7 +1804,7 @@ "id": 77, "name": "\"events\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1821,7 +1821,7 @@ "id": 76, "name": "\"events-overloads\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1838,7 +1838,7 @@ "id": 78, "name": "\"generic-class\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1855,7 +1855,7 @@ "id": 79, "name": "\"getter-setter\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1872,7 +1872,7 @@ "id": 80, "name": "\"this\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1966,7 +1966,7 @@ "id": 84, "name": "\"type-operator\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -2148,7 +2148,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1, diff --git a/src/test/converter/class/specs.json b/src/test/converter/class/specs.json index 22900fd8c..b6e61523b 100644 --- a/src/test/converter/class/specs.json +++ b/src/test/converter/class/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"access\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -336,7 +336,7 @@ "id": 15, "name": "\"class\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1737,7 +1737,7 @@ "id": 75, "name": "\"clodule-with-subclass\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1883,7 +1883,7 @@ "id": 80, "name": "\"constructor-properties\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -2354,7 +2354,7 @@ "id": 101, "name": "\"decorators\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -2721,7 +2721,7 @@ "id": 145, "name": "\"events\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -2798,7 +2798,7 @@ "id": 118, "name": "\"events-overloads\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -3223,7 +3223,7 @@ "id": 148, "name": "\"generic-class\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -3660,7 +3660,7 @@ "id": 166, "name": "\"getter-setter\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -3867,7 +3867,7 @@ "id": 178, "name": "\"this\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -3961,7 +3961,7 @@ "id": 182, "name": "\"type-operator\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -4143,7 +4143,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1, diff --git a/src/test/converter/comment/specs.json b/src/test/converter/comment/specs.json index 04d70de99..9300c4626 100644 --- a/src/test/converter/comment/specs.json +++ b/src/test/converter/comment/specs.json @@ -8,7 +8,7 @@ "id": 6, "name": "\"comment\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -232,7 +232,7 @@ "id": 1, "name": "\"comment2\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -321,7 +321,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 6, diff --git a/src/test/converter/declaration/specs.d.json b/src/test/converter/declaration/specs.d.json index e42288d8c..43dc46084 100644 --- a/src/test/converter/declaration/specs.d.json +++ b/src/test/converter/declaration/specs.d.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"declaration.d\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -111,7 +111,7 @@ "id": 5, "name": "\"export-declaration.d\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -171,7 +171,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1, diff --git a/src/test/converter/dots.in.path/specs.json b/src/test/converter/dots.in.path/specs.json index 0673b9962..931a5bb1a 100644 --- a/src/test/converter/dots.in.path/specs.json +++ b/src/test/converter/dots.in.path/specs.json @@ -8,7 +8,7 @@ "id": 3, "name": "\"function\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -86,7 +86,7 @@ "id": 1, "name": "\"interface-empty\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -132,7 +132,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 3, diff --git a/src/test/converter/enum/specs.json b/src/test/converter/enum/specs.json index 558676852..d54a65615 100644 --- a/src/test/converter/enum/specs.json +++ b/src/test/converter/enum/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"enum\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -363,7 +363,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1 diff --git a/src/test/converter/exports/specs-without-exported.json b/src/test/converter/exports/specs-without-exported.json index 74f6ecb0b..459ffeb24 100644 --- a/src/test/converter/exports/specs-without-exported.json +++ b/src/test/converter/exports/specs-without-exported.json @@ -8,7 +8,7 @@ "id": 14, "name": "\"export\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -145,7 +145,7 @@ "id": 1, "name": "\"export-assignment\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -162,7 +162,7 @@ "id": 2, "name": "\"export-default\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -179,7 +179,7 @@ "id": 3, "name": "\"export-with-local\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -295,7 +295,7 @@ "id": 9, "name": "\"mod\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -375,7 +375,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 14, diff --git a/src/test/converter/exports/specs.json b/src/test/converter/exports/specs.json index 32586c974..3bfb0bc12 100644 --- a/src/test/converter/exports/specs.json +++ b/src/test/converter/exports/specs.json @@ -8,7 +8,7 @@ "id": 26, "name": "\"export\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -186,7 +186,7 @@ "id": 1, "name": "\"export-assignment\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -268,7 +268,7 @@ "id": 6, "name": "\"export-default\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -318,7 +318,7 @@ "id": 8, "name": "\"export-with-local\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -508,7 +508,7 @@ "id": 19, "name": "\"mod\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -625,7 +625,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 26, diff --git a/src/test/converter/exports/specs.lib.json b/src/test/converter/exports/specs.lib.json new file mode 100644 index 000000000..e258460e2 --- /dev/null +++ b/src/test/converter/exports/specs.lib.json @@ -0,0 +1,361 @@ +{ + "id": 0, + "name": "typedoc", + "kind": 0, + "flags": {}, + "children": [ + { + "id": 9, + "name": "\"export\"", + "kind": 1, + "kindString": "Module", + "flags": { + "isExported": true + }, + "originalName": "%BASE%/exports/export.ts", + "children": [ + { + "id": 13, + "name": "a", + "kind": 32, + "kindString": "Variable", + "flags": { + "isExported": true, + "isConst": true + }, + "comment": { + "shortText": "A simple named export that will be exported from export.ts" + }, + "sources": [ + { + "fileName": "mod.ts", + "line": 4, + "character": 14 + } + ], + "type": { + "type": "unknown", + "name": "1" + }, + "defaultValue": "1" + }, + { + "id": 10, + "name": "default", + "kind": 64, + "kindString": "Function", + "flags": {}, + "signatures": [ + { + "id": 11, + "name": "default", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 12, + "name": "a", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "type": { + "type": "intrinsic", + "name": "void" + } + } + ], + "sources": [ + { + "fileName": "export.ts", + "line": 9, + "character": 1 + } + ] + } + ], + "groups": [ + { + "title": "Variables", + "kind": 32, + "children": [ + 13 + ] + }, + { + "title": "Functions", + "kind": 64, + "children": [ + 10 + ] + } + ], + "sources": [ + { + "fileName": "export.ts", + "line": 1, + "character": 0 + } + ] + }, + { + "id": 1, + "name": "\"export-assignment\"", + "kind": 1, + "kindString": "Module", + "flags": { + "isExported": true + }, + "originalName": "%BASE%/exports/export-assignment.ts", + "sources": [ + { + "fileName": "export-assignment.ts", + "line": 1, + "character": 0 + } + ] + }, + { + "id": 2, + "name": "\"export-default\"", + "kind": 1, + "kindString": "Module", + "flags": { + "isExported": true + }, + "originalName": "%BASE%/exports/export-default.ts", + "sources": [ + { + "fileName": "export-default.ts", + "line": 1, + "character": 0 + } + ] + }, + { + "id": 3, + "name": "\"export-with-local\"", + "kind": 1, + "kindString": "Module", + "flags": { + "isExported": true + }, + "originalName": "%BASE%/exports/export-with-local.ts", + "children": [ + { + "id": 8, + "name": "x", + "kind": 32, + "kindString": "Variable", + "flags": { + "isExported": true, + "isConst": true + }, + "sources": [ + { + "fileName": "export-with-local.ts", + "line": 1, + "character": 14 + } + ], + "type": { + "type": "unknown", + "name": "5" + }, + "defaultValue": "5" + }, + { + "id": 4, + "name": "add", + "kind": 64, + "kindString": "Function", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 5, + "name": "add", + "kind": 4096, + "kindString": "Call signature", + "flags": { + "isExported": true + }, + "parameters": [ + { + "id": 6, + "name": "x", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isExported": true + }, + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "id": 7, + "name": "y", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isExported": true + }, + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "sources": [ + { + "fileName": "export-with-local.ts", + "line": 3, + "character": 19 + } + ] + } + ], + "groups": [ + { + "title": "Variables", + "kind": 32, + "children": [ + 8 + ] + }, + { + "title": "Functions", + "kind": 64, + "children": [ + 4 + ] + } + ], + "sources": [ + { + "fileName": "export-with-local.ts", + "line": 1, + "character": 0 + } + ] + }, + { + "id": 15, + "name": "\"mod\"", + "kind": 1, + "kindString": "Module", + "flags": { + "isExported": true + }, + "originalName": "%BASE%/exports/mod.ts", + "children": [ + { + "id": 18, + "name": "a", + "kind": 32, + "kindString": "Variable", + "flags": { + "isExported": true, + "isConst": true + }, + "comment": { + "shortText": "A simple named export that will be exported from export.ts" + }, + "sources": [ + { + "fileName": "mod.ts", + "line": 4, + "character": 14 + } + ], + "type": { + "type": "unknown", + "name": "1" + }, + "defaultValue": "1" + }, + { + "id": 16, + "name": "default", + "kind": 64, + "kindString": "Function", + "flags": {}, + "signatures": [ + { + "id": 17, + "name": "default", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Will not be re-exported from export.ts using export * from..." + }, + "type": { + "type": "intrinsic", + "name": "void" + } + } + ], + "sources": [ + { + "fileName": "mod.ts", + "line": 14, + "character": 31 + } + ] + } + ], + "groups": [ + { + "title": "Variables", + "kind": 32, + "children": [ + 18 + ] + }, + { + "title": "Functions", + "kind": 64, + "children": [ + 16 + ] + } + ], + "sources": [ + { + "fileName": "mod.ts", + "line": 1, + "character": 0 + } + ] + } + ], + "groups": [ + { + "title": "Modules", + "kind": 1, + "children": [ + 9, + 1, + 2, + 3, + 15 + ] + } + ] +} \ No newline at end of file diff --git a/src/test/converter/function/specs.json b/src/test/converter/function/specs.json index 352b4ac82..ddb1a8a0a 100644 --- a/src/test/converter/function/specs.json +++ b/src/test/converter/function/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"function\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -18,7 +18,7 @@ "id": 35, "name": "moduleFunction", "kind": 2, - "kindString": "Module", + "kindString": "Namespace", "flags": { "isExported": true }, @@ -1052,7 +1052,7 @@ ], "groups": [ { - "title": "Modules", + "title": "Namespaces", "kind": 2, "children": [ 35 @@ -1089,7 +1089,7 @@ "id": 57, "name": "\"generic-function\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1265,7 +1265,7 @@ "id": 67, "name": "\"implicit-types\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1676,7 +1676,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1, diff --git a/src/test/converter/interface/specs.json b/src/test/converter/interface/specs.json index 61fb7191f..a2b5d9147 100644 --- a/src/test/converter/interface/specs.json +++ b/src/test/converter/interface/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"constructor-type\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -210,7 +210,7 @@ "id": 14, "name": "\"interface-empty\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -360,7 +360,7 @@ "id": 20, "name": "\"interface-implementation\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -370,7 +370,7 @@ "id": 21, "name": "Forms", "kind": 2, - "kindString": "Module", + "kindString": "Namespace", "flags": {}, "children": [ { @@ -1607,7 +1607,7 @@ ], "groups": [ { - "title": "Modules", + "title": "Namespaces", "kind": 2, "children": [ 21 @@ -1625,7 +1625,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1, diff --git a/src/test/converter/mixin/specs.json b/src/test/converter/mixin/specs.json index 421e060f8..406504a54 100644 --- a/src/test/converter/mixin/specs.json +++ b/src/test/converter/mixin/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"mixin\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -1687,7 +1687,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1 diff --git a/src/test/converter/react/specs.json b/src/test/converter/react/specs.json index d20d42793..a5ba4a925 100644 --- a/src/test/converter/react/specs.json +++ b/src/test/converter/react/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"react\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -279,7 +279,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1 diff --git a/src/test/converter/types/specs.json b/src/test/converter/types/specs.json index c21f00d8e..ab4e5d3f4 100644 --- a/src/test/converter/types/specs.json +++ b/src/test/converter/types/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"query\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -89,7 +89,7 @@ "id": 4, "name": "\"union-or-intersection\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -373,7 +373,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1, diff --git a/src/test/converter/variables/specs.json b/src/test/converter/variables/specs.json index 2a03592cc..238676526 100644 --- a/src/test/converter/variables/specs.json +++ b/src/test/converter/variables/specs.json @@ -8,7 +8,7 @@ "id": 1, "name": "\"array\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -4570,7 +4570,7 @@ "id": 234, "name": "\"destructuring\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -4977,7 +4977,7 @@ "id": 253, "name": "\"literal\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -6034,7 +6034,7 @@ "id": 310, "name": "\"variable\"", "kind": 1, - "kindString": "External module", + "kindString": "Module", "flags": { "isExported": true }, @@ -6203,7 +6203,7 @@ ], "groups": [ { - "title": "External modules", + "title": "Modules", "kind": 1, "children": [ 1, diff --git a/src/test/renderer/specs/classes/_access_.privateclass.html b/src/test/renderer/specs/classes/_access_.privateclass.html index 02924520d..6c2a46487 100644 --- a/src/test/renderer/specs/classes/_access_.privateclass.html +++ b/src/test/renderer/specs/classes/_access_.privateclass.html @@ -192,48 +192,48 @@

Returns void Globals -
  • +
  • "access"
  • -
  • +
  • "classes"
  • -
  • +
  • "default-export"
  • -
  • +
  • "enumerations"
  • -
  • +
  • "flattened"
  • -
  • +
  • "functions"
  • -
  • +
  • "generics"
  • -
  • +
  • "mixin"
  • -
  • +
  • "mod"
  • -
  • +
  • "mod2"
  • -
  • +
  • "modules"
  • -
  • +
  • "single-export"
  • -
  • +
  • "weird-names"
  • @@ -242,7 +242,7 @@

    Returns void @@ -532,7 +532,7 @@

    Returns string