@cparra/apexdocs 2.25.0-alpha.0 → 2.25.0-alpha.2
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/__mocks__/chalk.js +12 -0
- package/__mocks__/log-update.js +6 -0
- package/eslint.config.mjs +10 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.BaseClass.md +16 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.MultiInheritanceClass.md +73 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.ParentInterface.md +15 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.ReferencedEnum.md +8 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +7 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +115 -0
- package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +36 -0
- package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +173 -0
- package/examples/plain-markdown/docs/index.md +33 -0
- package/examples/plain-markdown/force-app/classes/MultiInheritanceClass.cls +1 -0
- package/examples/plain-markdown/force-app/classes/SampleClass.cls +37 -0
- package/examples/plain-markdown/package.json +2 -6
- package/jest.config.js +4 -0
- package/jest.d.ts +7 -0
- package/lib/__spec__/core/expect-extensions.d.ts +3 -0
- package/lib/__spec__/core/expect-extensions.js +54 -0
- package/lib/__spec__/core/expect-extensions.js.map +1 -0
- package/lib/__spec__/core/generating-class-docs.spec.d.ts +1 -0
- package/lib/__spec__/core/generating-class-docs.spec.js +427 -0
- package/lib/__spec__/core/generating-class-docs.spec.js.map +1 -0
- package/lib/__spec__/core/generating-enum-docs.spec.d.ts +1 -0
- package/lib/__spec__/core/generating-enum-docs.spec.js +303 -0
- package/lib/__spec__/core/generating-enum-docs.spec.js.map +1 -0
- package/lib/__spec__/core/generating-interface-docs.spec.d.ts +1 -0
- package/lib/__spec__/core/generating-interface-docs.spec.js +361 -0
- package/lib/__spec__/core/generating-interface-docs.spec.js.map +1 -0
- package/lib/__spec__/core/generating-reference-guide.spec.d.ts +1 -0
- package/lib/__spec__/core/generating-reference-guide.spec.js +161 -0
- package/lib/__spec__/core/generating-reference-guide.spec.js.map +1 -0
- package/lib/adapters/apex-types.d.ts +5 -5
- package/lib/adapters/apex-types.js +97 -22
- package/lib/adapters/apex-types.js.map +1 -1
- package/lib/adapters/documentables.d.ts +4 -3
- package/lib/adapters/documentables.js +23 -8
- package/lib/adapters/documentables.js.map +1 -1
- package/lib/adapters/fields-and-properties.d.ts +4 -3
- package/lib/adapters/fields-and-properties.js +26 -5
- package/lib/adapters/fields-and-properties.js.map +1 -1
- package/lib/adapters/methods-and-constructors.d.ts +4 -3
- package/lib/adapters/methods-and-constructors.js +54 -12
- package/lib/adapters/methods-and-constructors.js.map +1 -1
- package/lib/adapters/references.d.ts +1 -1
- package/lib/adapters/references.js +3 -3
- package/lib/adapters/references.js.map +1 -1
- package/lib/adapters/type-utils.d.ts +1 -1
- package/lib/adapters/type-utils.js +1 -2
- package/lib/adapters/type-utils.js.map +1 -1
- package/lib/application/Apexdocs.js +21 -15
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/application/flows/generate-markdown-files.d.ts +3 -0
- package/lib/application/flows/generate-markdown-files.js +57 -0
- package/lib/application/flows/generate-markdown-files.js.map +1 -0
- package/lib/cli/generate.js +7 -7
- package/lib/cli/generate.js.map +1 -1
- package/lib/core/__test__/inheritance-chain.test.d.ts +1 -0
- package/lib/core/__test__/inheritance-chain.test.js +42 -0
- package/lib/core/__test__/inheritance-chain.test.js.map +1 -0
- package/lib/core/generate-docs.d.ts +24 -0
- package/lib/core/generate-docs.js +267 -0
- package/lib/core/generate-docs.js.map +1 -0
- package/lib/core/inheritance-chain.d.ts +2 -0
- package/lib/core/inheritance-chain.js +35 -0
- package/lib/core/inheritance-chain.js.map +1 -0
- package/lib/core/template.d.ts +10 -0
- package/lib/core/template.js +92 -0
- package/lib/core/template.js.map +1 -0
- package/lib/core/templates/reference-guide.d.ts +1 -0
- package/lib/core/templates/reference-guide.js +18 -0
- package/lib/core/templates/reference-guide.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +14 -3
- package/lib/index.js.map +1 -1
- package/lib/model/inheritance.d.ts +4 -1
- package/lib/model/manifest.js +8 -2
- package/lib/model/manifest.js.map +1 -1
- package/lib/model/markdown-file.d.ts +2 -2
- package/lib/model/markdown-file.js +5 -4
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +3 -4
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.js +1 -2
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js +2 -3
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/type-declaration-util.js +1 -2
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/model/openapi/open-api.js.map +1 -1
- package/lib/model/outputFile.d.ts +1 -1
- package/lib/model/outputFile.js +2 -9
- package/lib/model/outputFile.js.map +1 -1
- package/lib/model/types-repository.js.map +1 -1
- package/lib/service/apex-file-reader.js.map +1 -1
- package/lib/service/file-writer.js.map +1 -1
- package/lib/service/manifest-factory.js +1 -2
- package/lib/service/manifest-factory.js.map +1 -1
- package/lib/service/metadata-processor.js.map +1 -1
- package/lib/service/parser.js +1 -1
- package/lib/service/parser.js.map +1 -1
- package/lib/service/state.js.map +1 -1
- package/lib/service/walkers/class-walker.js.map +1 -1
- package/lib/service/walkers/interface-walker.js.map +1 -1
- package/lib/service/walkers/walker-factory.js.map +1 -1
- package/lib/service/walkers/walker.js.map +1 -1
- package/lib/settings.d.ts +0 -6
- package/lib/settings.js +0 -11
- package/lib/settings.js.map +1 -1
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +4 -0
- package/lib/test-helpers/ClassMirrorBuilder.js +11 -1
- package/lib/test-helpers/ClassMirrorBuilder.js.map +1 -1
- package/lib/transpiler/factory.js.map +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/class-template.js +53 -12
- package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +13 -16
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +11 -8
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/enum-template.js +7 -6
- package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +9 -6
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +10 -0
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js +4 -4
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +18 -20
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -4
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +6 -86
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js +31 -0
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js.map +1 -0
- package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
- package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +3 -2
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +1 -1
- package/lib/transpiler/transpiler.js.map +1 -1
- package/lib/util/error-logger.js.map +1 -1
- package/lib/util/logger.js +1 -1
- package/lib/util/logger.js.map +1 -1
- package/lib/util/string-utils.js +2 -2
- package/lib/util/string-utils.js.map +1 -1
- package/package.json +17 -17
- package/src/__spec__/core/expect-extensions.ts +32 -0
- package/src/__spec__/core/generating-class-docs.spec.ts +511 -0
- package/src/__spec__/core/generating-enum-docs.spec.ts +355 -0
- package/src/__spec__/core/generating-interface-docs.spec.ts +431 -0
- package/src/__spec__/core/generating-reference-guide.spec.ts +163 -0
- package/src/adapters/__tests__/interface-adapter.spec.ts +15 -11
- package/src/adapters/__tests__/references.spec.ts +1 -1
- package/src/adapters/apex-types.ts +205 -41
- package/src/adapters/documentables.ts +44 -9
- package/src/adapters/fields-and-properties.ts +31 -7
- package/src/adapters/methods-and-constructors.ts +65 -22
- package/src/adapters/references.ts +1 -1
- package/src/adapters/type-utils.ts +1 -1
- package/src/application/Apexdocs.ts +21 -15
- package/src/application/flows/generate-markdown-files.ts +47 -0
- package/src/cli/generate.ts +96 -96
- package/src/core/__test__/inheritance-chain.test.ts +54 -0
- package/src/core/generate-docs.ts +396 -0
- package/src/core/inheritance-chain.ts +23 -0
- package/src/core/renderable/types.d.ts +131 -0
- package/src/core/template.ts +108 -0
- package/src/core/templates/reference-guide.ts +14 -0
- package/src/index.ts +3 -1
- package/src/model/inheritance.ts +2 -1
- package/src/model/manifest.ts +12 -2
- package/src/model/markdown-file.ts +5 -4
- package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +1 -1
- package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
- package/src/model/outputFile.ts +2 -11
- package/src/service/parser.ts +1 -1
- package/src/settings.ts +0 -15
- package/src/test-helpers/ClassMirrorBuilder.ts +14 -1
- package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -1
- package/src/transpiler/markdown/plain-markdown/class-template.ts +53 -12
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +13 -16
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +11 -8
- package/src/transpiler/markdown/plain-markdown/enum-template.ts +7 -6
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +9 -6
- package/src/transpiler/markdown/plain-markdown/grouped-members-partial-template.ts +6 -0
- package/src/transpiler/markdown/plain-markdown/interface-template.ts +4 -4
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +18 -20
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +8 -100
- package/src/transpiler/markdown/plain-markdown/type-doc-partial.ts +27 -0
- package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +3 -2
- package/src/util/logger.ts +1 -1
- package/tsconfig.json +1 -1
- package/.eslintrc.js +0 -12
- package/examples/plain-markdown/README.md +0 -301
- package/lib/templating/compile.d.ts +0 -7
- package/lib/templating/compile.js +0 -98
- package/lib/templating/compile.js.map +0 -1
- package/lib/templating/helpers.d.ts +0 -2
- package/lib/templating/helpers.js +0 -18
- package/lib/templating/helpers.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +0 -31
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +0 -1
- package/src/templating/__tests__/compile.spec.ts +0 -741
- package/src/templating/compile.ts +0 -187
- package/src/templating/helpers.ts +0 -14
- package/src/templating/types.d.ts +0 -104
- package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +0 -27
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import Handlebars from 'handlebars';
|
|
2
|
-
import {
|
|
3
|
-
EnumSource,
|
|
4
|
-
ConvertRenderableContentsToString,
|
|
5
|
-
InterfaceSource,
|
|
6
|
-
ClassSource,
|
|
7
|
-
MethodSource,
|
|
8
|
-
RenderableContent,
|
|
9
|
-
DocumentableSource,
|
|
10
|
-
} from './types';
|
|
11
|
-
import { namespace, splitAndCapitalize } from './helpers';
|
|
12
|
-
import { typeLevelApexDocPartialTemplate } from '../transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template';
|
|
13
|
-
import { methodsPartialTemplate } from '../transpiler/markdown/plain-markdown/methods-partial-template';
|
|
14
|
-
import { constructorsPartialTemplate } from '../transpiler/markdown/plain-markdown/constructors-partial-template';
|
|
15
|
-
import { fieldsPartialTemplate } from '../transpiler/markdown/plain-markdown/fieldsPartialTemplate';
|
|
16
|
-
import { documentablePartialTemplate } from '../transpiler/markdown/plain-markdown/documentable-partial-template';
|
|
17
|
-
|
|
18
|
-
type CompileOptions = {
|
|
19
|
-
renderableContentConverter: ConvertRenderableContentsToString;
|
|
20
|
-
codeBlockConverter: (language: string, lines: string[]) => string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function compile(template: string, source: EnumSource | InterfaceSource | ClassSource, options: CompileOptions) {
|
|
24
|
-
Handlebars.registerPartial('typeLevelApexDocPartialTemplate', typeLevelApexDocPartialTemplate);
|
|
25
|
-
Handlebars.registerPartial('documentablePartialTemplate', documentablePartialTemplate);
|
|
26
|
-
Handlebars.registerPartial('methodsPartialTemplate', methodsPartialTemplate);
|
|
27
|
-
Handlebars.registerPartial('constructorsPartialTemplate', constructorsPartialTemplate);
|
|
28
|
-
Handlebars.registerPartial('fieldsPartialTemplate', fieldsPartialTemplate);
|
|
29
|
-
|
|
30
|
-
Handlebars.registerHelper('splitAndCapitalize', splitAndCapitalize);
|
|
31
|
-
|
|
32
|
-
const prepared = { ...prepare(source, options), namespace: namespace() };
|
|
33
|
-
const compiled = Handlebars.compile(template);
|
|
34
|
-
return (
|
|
35
|
-
compiled(prepared)
|
|
36
|
-
.trim()
|
|
37
|
-
// clean up extra newlines
|
|
38
|
-
.replace(/\n{3,}/g, '\n\n')
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function prepare(
|
|
43
|
-
source: EnumSource | InterfaceSource | ClassSource,
|
|
44
|
-
{ renderableContentConverter, codeBlockConverter }: CompileOptions,
|
|
45
|
-
) {
|
|
46
|
-
const base = {
|
|
47
|
-
...source,
|
|
48
|
-
...prepareDocumentable(source, renderableContentConverter, codeBlockConverter),
|
|
49
|
-
...prepareBaseType(source, renderableContentConverter),
|
|
50
|
-
};
|
|
51
|
-
if (isEnumSource(source)) {
|
|
52
|
-
return {
|
|
53
|
-
...base,
|
|
54
|
-
...prepareEnum(source, renderableContentConverter),
|
|
55
|
-
};
|
|
56
|
-
} else if (isInterfaceSource(source)) {
|
|
57
|
-
return {
|
|
58
|
-
...base,
|
|
59
|
-
...prepareInterface(source, renderableContentConverter, codeBlockConverter),
|
|
60
|
-
};
|
|
61
|
-
} else {
|
|
62
|
-
return {
|
|
63
|
-
...base,
|
|
64
|
-
...prepareClass(source, renderableContentConverter, codeBlockConverter),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function prepareDocumentable(
|
|
70
|
-
source: DocumentableSource,
|
|
71
|
-
renderableContentConverter: ConvertRenderableContentsToString,
|
|
72
|
-
codeBlockConverter: (language: string, lines: string[]) => string,
|
|
73
|
-
) {
|
|
74
|
-
return {
|
|
75
|
-
description: renderableContentConverter(source.description),
|
|
76
|
-
mermaid: source.mermaid ? codeBlockConverter('mermaid', source.mermaid) : undefined,
|
|
77
|
-
example: source.example ? codeBlockConverter('apex', source.example) : undefined,
|
|
78
|
-
customTags: source.customTags?.map((tag) => ({
|
|
79
|
-
name: tag.name,
|
|
80
|
-
value: renderableContentConverter(tag.description),
|
|
81
|
-
})),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function prepareBaseType(
|
|
86
|
-
source: EnumSource | InterfaceSource | ClassSource,
|
|
87
|
-
renderableContentConverter: ConvertRenderableContentsToString,
|
|
88
|
-
) {
|
|
89
|
-
return {
|
|
90
|
-
sees: source.sees?.map((see) => renderableContentConverter([see])),
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function prepareEnum(source: EnumSource, renderableContentConverter: ConvertRenderableContentsToString) {
|
|
95
|
-
return {
|
|
96
|
-
values: source.values.map((value) => ({
|
|
97
|
-
value: value.value,
|
|
98
|
-
description: renderableContentConverter(value.description),
|
|
99
|
-
})),
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function prepareInterface(
|
|
104
|
-
source: InterfaceSource,
|
|
105
|
-
renderableContentConverter: ConvertRenderableContentsToString,
|
|
106
|
-
codeBlockConverter: (language: string, lines: string[]) => string,
|
|
107
|
-
) {
|
|
108
|
-
return {
|
|
109
|
-
extends: source.extends?.map((ext) => renderableContentConverter([ext])),
|
|
110
|
-
methods: source.methods?.map((method) => mapMethod(method, renderableContentConverter, codeBlockConverter)),
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function prepareClass(
|
|
115
|
-
source: ClassSource,
|
|
116
|
-
renderableContentConverter: ConvertRenderableContentsToString,
|
|
117
|
-
codeBlockConverter: (language: string, lines: string[]) => string,
|
|
118
|
-
) {
|
|
119
|
-
return {
|
|
120
|
-
implements: source.implements?.map((impl) => renderableContentConverter([impl])),
|
|
121
|
-
extends: source.extends ? renderableContentConverter([source.extends]) : undefined,
|
|
122
|
-
constructors: source.constructors?.map((constructor) =>
|
|
123
|
-
mapConstructor(constructor, renderableContentConverter, codeBlockConverter),
|
|
124
|
-
),
|
|
125
|
-
methods: source.methods?.map((method) => mapMethod(method, renderableContentConverter, codeBlockConverter)),
|
|
126
|
-
fields: source.fields?.map((field) => ({
|
|
127
|
-
...field,
|
|
128
|
-
...prepareDocumentable(field, renderableContentConverter, codeBlockConverter),
|
|
129
|
-
type: renderableContentConverter([field.type]),
|
|
130
|
-
})),
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function mapMethod(
|
|
135
|
-
method: MethodSource,
|
|
136
|
-
renderableContentConverter: (content?: RenderableContent[]) => string,
|
|
137
|
-
codeBlockConverter: (language: string, lines: string[]) => string,
|
|
138
|
-
) {
|
|
139
|
-
return {
|
|
140
|
-
...method,
|
|
141
|
-
...prepareDocumentable(method, renderableContentConverter, codeBlockConverter),
|
|
142
|
-
returnType: {
|
|
143
|
-
...method,
|
|
144
|
-
type: method.returnType?.type ? renderableContentConverter([method.returnType.type]) : undefined,
|
|
145
|
-
description: renderableContentConverter(method.returnType?.description),
|
|
146
|
-
},
|
|
147
|
-
throws: method.throws?.map((thrown) => ({
|
|
148
|
-
...thrown,
|
|
149
|
-
type: renderableContentConverter([thrown.type]),
|
|
150
|
-
description: renderableContentConverter(thrown.description),
|
|
151
|
-
})),
|
|
152
|
-
parameters: method.parameters?.map((param) => ({
|
|
153
|
-
...param,
|
|
154
|
-
type: renderableContentConverter([param.type]),
|
|
155
|
-
description: renderableContentConverter(param.description),
|
|
156
|
-
})),
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function mapConstructor(
|
|
161
|
-
constructor: MethodSource,
|
|
162
|
-
renderableContentConverter: (content?: RenderableContent[]) => string,
|
|
163
|
-
codeBlockConverter: (language: string, lines: string[]) => string,
|
|
164
|
-
) {
|
|
165
|
-
return {
|
|
166
|
-
...constructor,
|
|
167
|
-
...prepareDocumentable(constructor, renderableContentConverter, codeBlockConverter),
|
|
168
|
-
parameters: constructor.parameters?.map((param) => ({
|
|
169
|
-
...param,
|
|
170
|
-
type: renderableContentConverter([param.type]),
|
|
171
|
-
description: renderableContentConverter(param.description),
|
|
172
|
-
})),
|
|
173
|
-
throws: constructor.throws?.map((thrown) => ({
|
|
174
|
-
...thrown,
|
|
175
|
-
type: renderableContentConverter([thrown.type]),
|
|
176
|
-
description: renderableContentConverter(thrown.description),
|
|
177
|
-
})),
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function isEnumSource(source: { __type: string }): source is EnumSource {
|
|
182
|
-
return source.__type === 'enum';
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function isInterfaceSource(source: { __type: string }): source is InterfaceSource {
|
|
186
|
-
return source.__type === 'interface';
|
|
187
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Settings } from '../settings';
|
|
2
|
-
|
|
3
|
-
export const splitAndCapitalize = (text: string) => {
|
|
4
|
-
const words = text.split(/[-_]+/);
|
|
5
|
-
const capitalizedWords = [];
|
|
6
|
-
for (const word of words) {
|
|
7
|
-
capitalizedWords.push(word.charAt(0).toUpperCase() + word.slice(1));
|
|
8
|
-
}
|
|
9
|
-
return capitalizedWords.join(' ');
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const namespace = () => {
|
|
13
|
-
return Settings.getInstance().getNamespace();
|
|
14
|
-
};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export type Link = {
|
|
2
|
-
title: string;
|
|
3
|
-
url: string;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export type EmptyLine = {
|
|
7
|
-
type: 'empty-line';
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type StringOrLink = string | Link;
|
|
11
|
-
|
|
12
|
-
export type RenderableContent = StringOrLink | EmptyLine;
|
|
13
|
-
|
|
14
|
-
export type ConvertRenderableContentsToString = (content?: RenderableContent[]) => string;
|
|
15
|
-
|
|
16
|
-
type EnumValue = {
|
|
17
|
-
value: string;
|
|
18
|
-
description?: RenderableContent[];
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type CustomTag = {
|
|
22
|
-
name: string;
|
|
23
|
-
description?: RenderableContent[];
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Represents an annotation to a top-level type. For example @NamespaceAccessible.
|
|
28
|
-
*/
|
|
29
|
-
type Annotation = string;
|
|
30
|
-
|
|
31
|
-
type CodeBlock = string[];
|
|
32
|
-
|
|
33
|
-
type DocumentableSource = {
|
|
34
|
-
annotations?: Annotation[];
|
|
35
|
-
description?: RenderableContent[];
|
|
36
|
-
customTags?: CustomTag[];
|
|
37
|
-
mermaid?: CodeBlock;
|
|
38
|
-
example?: CodeBlock;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
type BaseTypeSource = DocumentableSource & {
|
|
42
|
-
name: string;
|
|
43
|
-
accessModifier: string;
|
|
44
|
-
group?: string;
|
|
45
|
-
author?: string;
|
|
46
|
-
date?: string;
|
|
47
|
-
sees?: StringOrLink[];
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
type MethodParameterSource = {
|
|
51
|
-
name: string;
|
|
52
|
-
type: StringOrLink;
|
|
53
|
-
description?: RenderableContent[];
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
type TypeSource = {
|
|
57
|
-
type: StringOrLink;
|
|
58
|
-
description?: RenderableContent[];
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
type ConstructorSource = DocumentableSource & {
|
|
62
|
-
title: string;
|
|
63
|
-
signature: string;
|
|
64
|
-
parameters?: MethodParameterSource[];
|
|
65
|
-
throws?: TypeSource[];
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
type MethodSource = DocumentableSource & {
|
|
69
|
-
title: string;
|
|
70
|
-
signature: string;
|
|
71
|
-
parameters?: MethodParameterSource[];
|
|
72
|
-
returnType?: TypeSource;
|
|
73
|
-
throws?: TypeSource[];
|
|
74
|
-
inherited?: boolean;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
type FieldSource = DocumentableSource & {
|
|
78
|
-
name: string;
|
|
79
|
-
type: StringOrLink;
|
|
80
|
-
accessModifier: string;
|
|
81
|
-
inherited?: boolean;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export type ClassSource = BaseTypeSource & {
|
|
85
|
-
__type: 'class';
|
|
86
|
-
extends?: StringOrLink;
|
|
87
|
-
implements?: StringOrLink[];
|
|
88
|
-
constructors?: ConstructorSource[];
|
|
89
|
-
methods?: MethodSource[];
|
|
90
|
-
classModifier?: string;
|
|
91
|
-
sharingModifier?: string;
|
|
92
|
-
fields?: FieldSource[];
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
export type InterfaceSource = BaseTypeSource & {
|
|
96
|
-
__type: 'interface';
|
|
97
|
-
extends?: StringOrLink[];
|
|
98
|
-
methods?: MethodSource[];
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export type EnumSource = BaseTypeSource & {
|
|
102
|
-
__type: 'enum';
|
|
103
|
-
values: EnumValue[];
|
|
104
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const typeLevelApexDocPartialTemplate = `
|
|
2
|
-
{{#> documentablePartialTemplate}}
|
|
3
|
-
|
|
4
|
-
{{#if group}}
|
|
5
|
-
**Group** {{group}}
|
|
6
|
-
{{/if}}
|
|
7
|
-
|
|
8
|
-
{{#if author}}
|
|
9
|
-
**Author** {{author}}
|
|
10
|
-
{{/if}}
|
|
11
|
-
|
|
12
|
-
{{#if date}}
|
|
13
|
-
**Date** {{date}}
|
|
14
|
-
{{/if}}
|
|
15
|
-
|
|
16
|
-
{{#each sees}}
|
|
17
|
-
**See** {{this}}
|
|
18
|
-
|
|
19
|
-
{{/each}}
|
|
20
|
-
|
|
21
|
-
{{#if namespace}}
|
|
22
|
-
## Namespace
|
|
23
|
-
{{namespace}}
|
|
24
|
-
{{/if}}
|
|
25
|
-
|
|
26
|
-
{{/documentablePartialTemplate}}
|
|
27
|
-
`.trim();
|