@cparra/apexdocs 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/package.json +4 -1
- package/.github/workflows/ci.yaml +0 -22
- package/.github/workflows/close_stale.yml +0 -22
- package/.prettierrc.js +0 -7
- package/__mocks__/chalk.js +0 -12
- package/__mocks__/log-update.js +0 -6
- package/eslint.config.mjs +0 -10
- package/examples/README.md +0 -5
- package/examples/docsify/README.md +0 -17
- package/examples/docsify/apexdocs.config.ts +0 -13
- package/examples/docsify/classes/ASampleClass.cls +0 -57
- package/examples/docsify/classes/CodeControl.cls +0 -19
- package/examples/docsify/classes/SampleClass.cls +0 -95
- package/examples/docsify/classes/SampleInterface.cls +0 -17
- package/examples/docsify/classes/SomeDto.cls +0 -122
- package/examples/docsify/docs/.nojekyll +0 -0
- package/examples/docsify/docs/README.md +0 -25
- package/examples/docsify/docs/_config.yml +0 -1
- package/examples/docsify/docs/index.html +0 -22
- package/examples/docsify/docs/miscellaneous/ASampleClass.md +0 -88
- package/examples/docsify/docs/miscellaneous/CodeControl.md +0 -107
- package/examples/docsify/docs/miscellaneous/SomeDto.md +0 -244
- package/examples/docsify/docs/sample-classes/SampleClass.md +0 -171
- package/examples/docsify/docs/sample-interfaces/SampleInterface.md +0 -36
- package/examples/docsify/package-lock.json +0 -2459
- package/examples/docsify/package.json +0 -14
- package/examples/imported/.forceignore +0 -12
- package/examples/imported/README.md +0 -6
- package/examples/imported/config/project-scratch-def.json +0 -5
- package/examples/imported/docs/index.md +0 -109
- package/examples/imported/docs/miscellaneous/BaseClass.md +0 -13
- package/examples/imported/docs/miscellaneous/MultiInheritanceClass.md +0 -69
- package/examples/imported/docs/miscellaneous/ParentInterface.md +0 -12
- package/examples/imported/docs/miscellaneous/ReferencedEnum.md +0 -5
- package/examples/imported/docs/miscellaneous/SampleException.md +0 -21
- package/examples/imported/docs/miscellaneous/SampleInterface.md +0 -113
- package/examples/imported/docs/miscellaneous/Url.md +0 -308
- package/examples/imported/docs/sample-enums/SampleEnum.md +0 -33
- package/examples/imported/docs/samplegroup/SampleClass.md +0 -167
- package/examples/imported/force-app/classes/BaseClass.cls +0 -3
- package/examples/imported/force-app/classes/MultiInheritanceClass.cls +0 -1
- package/examples/imported/force-app/classes/ParentInterface.cls +0 -3
- package/examples/imported/force-app/classes/ReferencedEnum.cls +0 -3
- package/examples/imported/force-app/classes/SampleClass.cls +0 -72
- package/examples/imported/force-app/classes/SampleEnum.cls +0 -30
- package/examples/imported/force-app/classes/SampleException.cls +0 -17
- package/examples/imported/force-app/classes/SampleInterface.cls +0 -50
- package/examples/imported/force-app/classes/Url.cls +0 -196
- package/examples/imported/package-lock.json +0 -665
- package/examples/imported/package.json +0 -6
- package/examples/imported/scripts/process-docs.mjs +0 -16
- package/examples/imported/sfdx-project.json +0 -12
- package/examples/markdown/.forceignore +0 -12
- package/examples/markdown/README.md +0 -7
- package/examples/markdown/config/project-scratch-def.json +0 -5
- package/examples/markdown/docs/index.md +0 -109
- package/examples/markdown/docs/miscellaneous/BaseClass.md +0 -16
- package/examples/markdown/docs/miscellaneous/MultiInheritanceClass.md +0 -72
- package/examples/markdown/docs/miscellaneous/ParentInterface.md +0 -15
- package/examples/markdown/docs/miscellaneous/ReferencedEnum.md +0 -8
- package/examples/markdown/docs/miscellaneous/SampleException.md +0 -24
- package/examples/markdown/docs/miscellaneous/SampleInterface.md +0 -116
- package/examples/markdown/docs/miscellaneous/Url.md +0 -311
- package/examples/markdown/docs/sample-enums/SampleEnum.md +0 -36
- package/examples/markdown/docs/samplegroup/SampleClass.md +0 -170
- package/examples/markdown/force-app/classes/BaseClass.cls +0 -3
- package/examples/markdown/force-app/classes/MultiInheritanceClass.cls +0 -1
- package/examples/markdown/force-app/classes/ParentInterface.cls +0 -3
- package/examples/markdown/force-app/classes/ReferencedEnum.cls +0 -3
- package/examples/markdown/force-app/classes/SampleClass.cls +0 -72
- package/examples/markdown/force-app/classes/SampleEnum.cls +0 -30
- package/examples/markdown/force-app/classes/SampleException.cls +0 -17
- package/examples/markdown/force-app/classes/SampleInterface.cls +0 -50
- package/examples/markdown/force-app/classes/Url.cls +0 -196
- package/examples/markdown/package-lock.json +0 -665
- package/examples/markdown/package.json +0 -20
- package/examples/markdown/sfdx-project.json +0 -12
- package/examples/markdown-jsconfig/.forceignore +0 -12
- package/examples/markdown-jsconfig/README.md +0 -9
- package/examples/markdown-jsconfig/apexdocs.config.mjs +0 -22
- package/examples/markdown-jsconfig/config/project-scratch-def.json +0 -5
- package/examples/markdown-jsconfig/docs/index.md +0 -12
- package/examples/markdown-jsconfig/docs/miscellaneous/Url.md +0 -315
- package/examples/markdown-jsconfig/force-app/classes/Url.cls +0 -196
- package/examples/markdown-jsconfig/package-lock.json +0 -665
- package/examples/markdown-jsconfig/package.json +0 -15
- package/examples/markdown-jsconfig/sfdx-project.json +0 -12
- package/examples/open-api/README.md +0 -5
- package/examples/open-api/config/project-scratch-def.json +0 -13
- package/examples/open-api/docs/openapi.json +0 -14
- package/examples/open-api/force-app/main/default/classes/ChildClass.cls +0 -42
- package/examples/open-api/force-app/main/default/classes/SampleClass.cls +0 -167
- package/examples/open-api/force-app/main/default/restapi/SampleRestResource.cls +0 -195
- package/examples/open-api/force-app/main/default/restapi/SampleRestResourceToSkip.cls +0 -35
- package/examples/open-api/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +0 -24
- package/examples/open-api/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +0 -15
- package/examples/open-api/force-app/main/default/restapi/references/Reference1.cls +0 -9
- package/examples/open-api/force-app/main/default/restapi/references/Reference2.cls +0 -9
- package/examples/open-api/force-app/main/default/restapi/references/Reference3.cls +0 -3
- package/examples/open-api/force-app/main/default/restapi/references/Reference4.cls +0 -3
- package/examples/open-api/force-app/main/default/restapi/references/Reference5.cls +0 -3
- package/examples/open-api/force-app/main/default/restapi/references/Reference6.cls +0 -6
- package/examples/open-api/force-app/main/default/restapi/references/Reference7.cls +0 -3
- package/examples/open-api/package-lock.json +0 -724
- package/examples/open-api/package.json +0 -20
- package/examples/open-api/sfdx-project.json +0 -12
- package/examples/vitepress/.forceignore +0 -12
- package/examples/vitepress/README.md +0 -25
- package/examples/vitepress/apexdocs.config.ts +0 -113
- package/examples/vitepress/config/project-scratch-def.json +0 -13
- package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js +0 -259
- package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/_metadata.json +0 -40
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js +0 -11474
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js +0 -9172
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/package.json +0 -3
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +0 -4339
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +0 -567
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/cache/deps/vue.js +0 -323
- package/examples/vitepress/docs/.vitepress/cache/deps/vue.js.map +0 -7
- package/examples/vitepress/docs/.vitepress/config.mts +0 -21
- package/examples/vitepress/docs/.vitepress/sidebar.json +0 -119
- package/examples/vitepress/docs/api-examples.md +0 -49
- package/examples/vitepress/docs/index-frontmatter.md +0 -16
- package/examples/vitepress/docs/index.md +0 -56
- package/examples/vitepress/docs/markdown-examples.md +0 -85
- package/examples/vitepress/docs/miscellaneous/BaseClass.md +0 -20
- package/examples/vitepress/docs/miscellaneous/MultiInheritanceClass.md +0 -76
- package/examples/vitepress/docs/miscellaneous/ParentInterface.md +0 -19
- package/examples/vitepress/docs/miscellaneous/ReferencedEnum.md +0 -15
- package/examples/vitepress/docs/miscellaneous/SampleException.md +0 -28
- package/examples/vitepress/docs/miscellaneous/SampleInterface.md +0 -116
- package/examples/vitepress/docs/miscellaneous/Url.md +0 -317
- package/examples/vitepress/docs/sample-enums/SampleEnum.md +0 -40
- package/examples/vitepress/docs/samplegroup/SampleClass.md +0 -174
- package/examples/vitepress/force-app/main/default/classes/BaseClass.cls +0 -3
- package/examples/vitepress/force-app/main/default/classes/MultiInheritanceClass.cls +0 -1
- package/examples/vitepress/force-app/main/default/classes/ParentInterface.cls +0 -3
- package/examples/vitepress/force-app/main/default/classes/ReferencedEnum.cls +0 -5
- package/examples/vitepress/force-app/main/default/classes/Url.cls +0 -198
- package/examples/vitepress/force-app/main/default/classes/feature-a/SampleClass.cls +0 -73
- package/examples/vitepress/force-app/main/default/classes/feature-a/SampleEnum.cls +0 -30
- package/examples/vitepress/force-app/main/default/classes/feature-a/SampleException.cls +0 -17
- package/examples/vitepress/force-app/main/default/classes/feature-a/SampleInterface.cls +0 -46
- package/examples/vitepress/package-lock.json +0 -2574
- package/examples/vitepress/package.json +0 -18
- package/examples/vitepress/sfdx-project.json +0 -12
- package/jest.config.js +0 -10
- package/jest.d.ts +0 -7
- package/src/application/Apexdocs.ts +0 -69
- package/src/application/__tests__/apex-file-reader.spec.ts +0 -128
- package/src/application/apex-file-reader.ts +0 -56
- package/src/application/file-system.ts +0 -69
- package/src/application/file-writer.ts +0 -43
- package/src/application/generators/markdown.ts +0 -45
- package/src/application/generators/openapi.ts +0 -75
- package/src/cli/args.ts +0 -55
- package/src/cli/commands/markdown.ts +0 -56
- package/src/cli/commands/openapi.ts +0 -36
- package/src/cli/generate.ts +0 -32
- package/src/core/__test__/manifest.spec.ts +0 -16
- package/src/core/manifest.ts +0 -90
- package/src/core/markdown/__test__/expect-extensions.ts +0 -32
- package/src/core/markdown/__test__/generating-class-docs.spec.ts +0 -362
- package/src/core/markdown/__test__/generating-docs.spec.ts +0 -378
- package/src/core/markdown/__test__/generating-enum-docs.spec.ts +0 -61
- package/src/core/markdown/__test__/generating-interface-docs.spec.ts +0 -169
- package/src/core/markdown/__test__/generating-reference-guide.spec.ts +0 -196
- package/src/core/markdown/__test__/inheritance-chain.test.ts +0 -54
- package/src/core/markdown/__test__/test-helpers.ts +0 -25
- package/src/core/markdown/adapters/__tests__/documentables.spec.ts +0 -109
- package/src/core/markdown/adapters/__tests__/interface-adapter.spec.ts +0 -150
- package/src/core/markdown/adapters/__tests__/link-generator.spec.ts +0 -130
- package/src/core/markdown/adapters/__tests__/references.spec.ts +0 -136
- package/src/core/markdown/adapters/apex-types.ts +0 -238
- package/src/core/markdown/adapters/documentables.ts +0 -115
- package/src/core/markdown/adapters/fields-and-properties.ts +0 -45
- package/src/core/markdown/adapters/generate-link.ts +0 -82
- package/src/core/markdown/adapters/inline.ts +0 -143
- package/src/core/markdown/adapters/methods-and-constructors.ts +0 -133
- package/src/core/markdown/adapters/reference-guide.ts +0 -37
- package/src/core/markdown/adapters/renderable-bundle.ts +0 -61
- package/src/core/markdown/adapters/renderable-to-page-data.ts +0 -91
- package/src/core/markdown/adapters/type-utils.ts +0 -13
- package/src/core/markdown/adapters/types.d.ts +0 -180
- package/src/core/markdown/generate-docs.ts +0 -210
- package/src/core/markdown/reflection/__test__/filter-scope.spec.ts +0 -290
- package/src/core/markdown/reflection/__test__/helpers.ts +0 -18
- package/src/core/markdown/reflection/__test__/remove-excluded-tags.spec.ts +0 -200
- package/src/core/markdown/reflection/filter-scope.ts +0 -13
- package/src/core/markdown/reflection/inheritance-chain-expanion.ts +0 -22
- package/src/core/markdown/reflection/inheritance-chain.ts +0 -23
- package/src/core/markdown/reflection/inherited-member-expansion.ts +0 -105
- package/src/core/markdown/reflection/reflect-source.ts +0 -123
- package/src/core/markdown/reflection/remove-excluded-tags.ts +0 -168
- package/src/core/markdown/reflection/sort-types-and-members.ts +0 -61
- package/src/core/markdown/templates/class-template.ts +0 -75
- package/src/core/markdown/templates/constructors-partial-template.ts +0 -32
- package/src/core/markdown/templates/documentable-partial-template.ts +0 -26
- package/src/core/markdown/templates/enum-template.ts +0 -12
- package/src/core/markdown/templates/fieldsPartialTemplate.ts +0 -23
- package/src/core/markdown/templates/grouped-members-partial-template.ts +0 -6
- package/src/core/markdown/templates/hookable.ts +0 -7
- package/src/core/markdown/templates/interface-template.ts +0 -16
- package/src/core/markdown/templates/methods-partial-template.ts +0 -43
- package/src/core/markdown/templates/reference-guide.ts +0 -14
- package/src/core/markdown/templates/template.ts +0 -114
- package/src/core/markdown/templates/type-doc-partial.ts +0 -27
- package/src/core/markdown/utils.ts +0 -3
- package/src/core/openApiSettings.ts +0 -41
- package/src/core/openapi/__tests__/manifest-factory.spec.ts +0 -16
- package/src/core/openapi/__tests__/open-api-docs-processor.spec.ts +0 -59
- package/src/core/openapi/__tests__/open-api.spec.ts +0 -22
- package/src/core/openapi/apex-doc-types.ts +0 -26
- package/src/core/openapi/apex-type-wrappers/ClassMirrorWrapper.ts +0 -12
- package/src/core/openapi/apex-type-wrappers/MethodMirrorWrapper.ts +0 -11
- package/src/core/openapi/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +0 -15
- package/src/core/openapi/file-container.ts +0 -13
- package/src/core/openapi/manifest-factory.ts +0 -16
- package/src/core/openapi/open-api-docs-processor.ts +0 -93
- package/src/core/openapi/open-api-types.ts +0 -119
- package/src/core/openapi/open-api.ts +0 -45
- package/src/core/openapi/openapi-type-file.ts +0 -12
- package/src/core/openapi/parser.ts +0 -163
- package/src/core/openapi/parsers/Builder.ts +0 -40
- package/src/core/openapi/parsers/MethodParser.ts +0 -249
- package/src/core/openapi/parsers/ParameterObjectBuilder.ts +0 -13
- package/src/core/openapi/parsers/ReferenceBuilder.ts +0 -299
- package/src/core/openapi/parsers/RequestBodyBuilder.ts +0 -19
- package/src/core/openapi/parsers/ResponsesBuilder.ts +0 -21
- package/src/core/openapi/parsers/__tests__/MethodParser.spec.ts +0 -44
- package/src/core/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +0 -68
- package/src/core/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +0 -751
- package/src/core/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +0 -64
- package/src/core/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +0 -55
- package/src/core/openapi/transpiler.ts +0 -17
- package/src/core/openapi/types-repository.ts +0 -54
- package/src/core/parse-apex-metadata.ts +0 -30
- package/src/core/shared/types.d.ts +0 -150
- package/src/core/shared/utils.ts +0 -5
- package/src/defaults.ts +0 -21
- package/src/index.ts +0 -110
- package/src/test-helpers/AnnotationBuilder.ts +0 -29
- package/src/test-helpers/ClassMirrorBuilder.ts +0 -69
- package/src/test-helpers/DocCommentAnnotationBuilder.ts +0 -24
- package/src/test-helpers/DocCommentBuilder.ts +0 -36
- package/src/test-helpers/FieldMirrorBuilder.ts +0 -59
- package/src/test-helpers/InterfaceMirrorBuilder.ts +0 -39
- package/src/test-helpers/MethodMirrorBuilder.ts +0 -77
- package/src/test-helpers/SettingsBuilder.ts +0 -17
- package/src/util/error-logger.ts +0 -92
- package/src/util/fp.ts +0 -3
- package/src/util/logger.ts +0 -51
- package/src/util/string-utils.ts +0 -7
- package/tsconfig.json +0 -25
- package/tslint.json +0 -6
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ParsedFile } from '../../shared/types';
|
|
2
|
-
import Manifest from '../../manifest';
|
|
3
|
-
|
|
4
|
-
export function filterScope(scopes: string[], parsedFiles: ParsedFile[]): ParsedFile[] {
|
|
5
|
-
return parsedFiles
|
|
6
|
-
.filter(({ type }) => Manifest.shouldFilterType(type, scopes))
|
|
7
|
-
.map((parsedFile) => {
|
|
8
|
-
return {
|
|
9
|
-
...parsedFile,
|
|
10
|
-
type: Manifest.filterSingleType(parsedFile.type, scopes, false),
|
|
11
|
-
};
|
|
12
|
-
});
|
|
13
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ClassMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { createInheritanceChain } from './inheritance-chain';
|
|
3
|
-
import { ParsedFile } from '../../shared/types';
|
|
4
|
-
import { parsedFilesToTypes } from '../utils';
|
|
5
|
-
|
|
6
|
-
export const addInheritanceChainToTypes = (parsedFiles: ParsedFile[]): ParsedFile[] =>
|
|
7
|
-
parsedFiles.map((parsedFile) => ({
|
|
8
|
-
...parsedFile,
|
|
9
|
-
type: addInheritanceChain(parsedFile.type, parsedFilesToTypes(parsedFiles)),
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
function addInheritanceChain<T extends Type>(current: T, repository: Type[]): T {
|
|
13
|
-
if (current.type_name === 'enum' || current.type_name === 'interface') {
|
|
14
|
-
return current;
|
|
15
|
-
} else {
|
|
16
|
-
const inheritanceChain = createInheritanceChain(repository, current as ClassMirror);
|
|
17
|
-
return {
|
|
18
|
-
...current,
|
|
19
|
-
inheritanceChain,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ClassMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { pipe } from 'fp-ts/function';
|
|
3
|
-
import * as O from 'fp-ts/Option';
|
|
4
|
-
|
|
5
|
-
export function createInheritanceChain(repository: Type[], classMirror: ClassMirror): string[] {
|
|
6
|
-
return pipe(
|
|
7
|
-
O.fromNullable(classMirror.extended_class),
|
|
8
|
-
O.match(
|
|
9
|
-
() => [],
|
|
10
|
-
(extendedClassName) => inheritanceChainFromParentClassName(repository, extendedClassName),
|
|
11
|
-
),
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function inheritanceChainFromParentClassName(repository: Type[], className: string): string[] {
|
|
16
|
-
return pipe(
|
|
17
|
-
O.fromNullable(repository.find((type) => type.name.toLowerCase() === className.toLowerCase())),
|
|
18
|
-
O.match(
|
|
19
|
-
() => [className],
|
|
20
|
-
(extendedClass: Type) => [className, ...createInheritanceChain(repository, extendedClass as ClassMirror)],
|
|
21
|
-
),
|
|
22
|
-
);
|
|
23
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { ClassMirror, InterfaceMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { ParsedFile } from '../../shared/types';
|
|
3
|
-
import { pipe } from 'fp-ts/function';
|
|
4
|
-
import { parsedFilesToTypes } from '../utils';
|
|
5
|
-
|
|
6
|
-
export const addInheritedMembersToTypes = (parsedFiles: ParsedFile[]) =>
|
|
7
|
-
parsedFiles.map((parsedFile) => addInheritedMembers(parsedFilesToTypes(parsedFiles), parsedFile));
|
|
8
|
-
|
|
9
|
-
export function addInheritedMembers(repository: Type[], parsedFile: ParsedFile): ParsedFile {
|
|
10
|
-
function addInheritedMembersToType<T extends Type>(repository: Type[], current: T): T {
|
|
11
|
-
if (current.type_name === 'enum') {
|
|
12
|
-
return current;
|
|
13
|
-
} else if (current.type_name === 'interface') {
|
|
14
|
-
return addInheritedInterfaceMethods(current as InterfaceMirror, repository) as T;
|
|
15
|
-
} else {
|
|
16
|
-
return addInheritedClassMembers(current as ClassMirror, repository) as T;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
...parsedFile,
|
|
22
|
-
type: addInheritedMembersToType(repository, parsedFile.type),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function addInheritedInterfaceMethods(interfaceMirror: InterfaceMirror, repository: Type[]): InterfaceMirror {
|
|
27
|
-
function methodAlreadyExists(memberName: string, members: { name: string }[]) {
|
|
28
|
-
return members.some((member) => member.name.toLowerCase() === memberName.toLowerCase());
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function parentExtractor(interfaceMirror: InterfaceMirror): string[] {
|
|
32
|
-
return interfaceMirror.extended_interfaces;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const parents = getParents(parentExtractor, interfaceMirror, repository);
|
|
36
|
-
return {
|
|
37
|
-
...interfaceMirror,
|
|
38
|
-
methods: parents.reduce(
|
|
39
|
-
(acc, currentValue) => [
|
|
40
|
-
...acc,
|
|
41
|
-
...currentValue.methods
|
|
42
|
-
.filter((method) => !methodAlreadyExists(method.name, acc))
|
|
43
|
-
.map((method) => ({
|
|
44
|
-
...method,
|
|
45
|
-
inherited: true,
|
|
46
|
-
})),
|
|
47
|
-
],
|
|
48
|
-
interfaceMirror.methods,
|
|
49
|
-
),
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function addInheritedClassMembers(classMirror: ClassMirror, repository: Type[]): ClassMirror {
|
|
54
|
-
function memberAlreadyExists(memberName: string, members: { name: string }[]) {
|
|
55
|
-
return members.some((member) => member.name.toLowerCase() === memberName.toLowerCase());
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function parentExtractor(classMirror: ClassMirror): string[] {
|
|
59
|
-
return classMirror.extended_class ? [classMirror.extended_class] : [];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function filterMember<T extends { name: string; access_modifier: string }>(members: T[], existing: T[]): T[] {
|
|
63
|
-
return members
|
|
64
|
-
.filter((member) => member.access_modifier.toLowerCase() !== 'private')
|
|
65
|
-
.filter((member) => !memberAlreadyExists(member.name, existing))
|
|
66
|
-
.map((member) => ({
|
|
67
|
-
...member,
|
|
68
|
-
inherited: true,
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const parents = getParents(parentExtractor, classMirror, repository);
|
|
73
|
-
return {
|
|
74
|
-
...classMirror,
|
|
75
|
-
fields: parents.reduce(
|
|
76
|
-
(acc, currentValue) => [...acc, ...filterMember(currentValue.fields, acc)],
|
|
77
|
-
classMirror.fields,
|
|
78
|
-
),
|
|
79
|
-
properties: parents.reduce(
|
|
80
|
-
(acc, currentValue) => [...acc, ...filterMember(currentValue.properties, acc)],
|
|
81
|
-
classMirror.properties,
|
|
82
|
-
),
|
|
83
|
-
methods: parents.reduce(
|
|
84
|
-
(acc, currentValue) => [...acc, ...filterMember(currentValue.methods, acc)],
|
|
85
|
-
classMirror.methods,
|
|
86
|
-
),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function getParents<T extends Type>(
|
|
91
|
-
extendedNamesExtractor: (current: T) => string[],
|
|
92
|
-
current: T,
|
|
93
|
-
repository: Type[],
|
|
94
|
-
): T[] {
|
|
95
|
-
return pipe(
|
|
96
|
-
extendedNamesExtractor(current),
|
|
97
|
-
(interfaces: string[]) => interfaces.map((interfaceName) => repository.find((type) => type.name === interfaceName)),
|
|
98
|
-
(interfaces = []) => interfaces.filter((type) => type !== undefined) as T[],
|
|
99
|
-
(interfaces) =>
|
|
100
|
-
interfaces.reduce<T[]>(
|
|
101
|
-
(acc, current) => [...acc, ...getParents(extendedNamesExtractor, current, repository)],
|
|
102
|
-
interfaces,
|
|
103
|
-
),
|
|
104
|
-
);
|
|
105
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { ParsedFile, UnparsedSourceFile } from '../../shared/types';
|
|
2
|
-
import * as TE from 'fp-ts/TaskEither';
|
|
3
|
-
import * as E from 'fp-ts/Either';
|
|
4
|
-
import * as T from 'fp-ts/Task';
|
|
5
|
-
import * as A from 'fp-ts/lib/Array';
|
|
6
|
-
import { Annotation, reflect as mirrorReflection, Type } from '@cparra/apex-reflection';
|
|
7
|
-
import { pipe } from 'fp-ts/function';
|
|
8
|
-
import * as O from 'fp-ts/Option';
|
|
9
|
-
import { parseApexMetadata } from '../../parse-apex-metadata';
|
|
10
|
-
import { ParsingError } from '@cparra/apex-reflection';
|
|
11
|
-
import { apply } from '#utils/fp';
|
|
12
|
-
import { Semigroup } from 'fp-ts/Semigroup';
|
|
13
|
-
|
|
14
|
-
export class ReflectionErrors {
|
|
15
|
-
readonly _tag = 'ReflectionErrors';
|
|
16
|
-
|
|
17
|
-
constructor(public errors: ReflectionError[]) {}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class ReflectionError {
|
|
21
|
-
constructor(
|
|
22
|
-
public file: string,
|
|
23
|
-
public message: string,
|
|
24
|
-
) {}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async function reflectAsync(rawSource: string): Promise<Type> {
|
|
28
|
-
return new Promise((resolve, reject) => {
|
|
29
|
-
const result = mirrorReflection(rawSource);
|
|
30
|
-
if (result.typeMirror) {
|
|
31
|
-
return resolve(result.typeMirror);
|
|
32
|
-
} else if (result.error) {
|
|
33
|
-
return reject(result.error);
|
|
34
|
-
} else {
|
|
35
|
-
return reject(new Error('Unknown error'));
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function reflectBundles(apexBundles: UnparsedSourceFile[]) {
|
|
41
|
-
const semiGroupReflectionError: Semigroup<ReflectionErrors> = {
|
|
42
|
-
concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors]),
|
|
43
|
-
};
|
|
44
|
-
const Ap = TE.getApplicativeTaskValidation(T.ApplyPar, semiGroupReflectionError);
|
|
45
|
-
|
|
46
|
-
return pipe(apexBundles, A.traverse(Ap)(reflectBundle));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function reflectBundle(apexBundle: UnparsedSourceFile): TE.TaskEither<ReflectionErrors, ParsedFile> {
|
|
50
|
-
const convertToParsedFile: (typeMirror: Type) => ParsedFile = apply(toParsedFile, apexBundle.filePath);
|
|
51
|
-
const withMetadata = apply(addMetadata, apexBundle.metadataContent);
|
|
52
|
-
|
|
53
|
-
return pipe(apexBundle, reflectAsTask, TE.map(convertToParsedFile), TE.flatMap(withMetadata));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function reflectAsTask(apexBundle: UnparsedSourceFile): TE.TaskEither<ReflectionErrors, Type> {
|
|
57
|
-
return TE.tryCatch(
|
|
58
|
-
() => reflectAsync(apexBundle.content),
|
|
59
|
-
(error) =>
|
|
60
|
-
new ReflectionErrors([new ReflectionError(apexBundle.filePath, (error as ParsingError | Error).message)]),
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function toParsedFile(filePath: string, typeMirror: Type): ParsedFile {
|
|
65
|
-
return {
|
|
66
|
-
source: {
|
|
67
|
-
filePath: filePath,
|
|
68
|
-
name: typeMirror.name,
|
|
69
|
-
type: typeMirror.type_name,
|
|
70
|
-
},
|
|
71
|
-
type: typeMirror,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function addMetadata(
|
|
76
|
-
rawMetadataContent: string | null,
|
|
77
|
-
parsedFile: ParsedFile,
|
|
78
|
-
): TE.TaskEither<ReflectionErrors, ParsedFile> {
|
|
79
|
-
return TE.fromEither(
|
|
80
|
-
pipe(
|
|
81
|
-
parsedFile.type,
|
|
82
|
-
(type) => addFileMetadataToTypeAnnotation(type, rawMetadataContent),
|
|
83
|
-
E.map((type) => ({ ...parsedFile, type })),
|
|
84
|
-
E.mapLeft((error) => errorToReflectionErrors(error, parsedFile.source.filePath)),
|
|
85
|
-
),
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function errorToReflectionErrors(error: Error, filePath: string): ReflectionErrors {
|
|
90
|
-
return new ReflectionErrors([new ReflectionError(filePath, error.message)]);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function addFileMetadataToTypeAnnotation(type: Type, metadata: string | null): E.Either<Error, Type> {
|
|
94
|
-
const concatAnnotationToType = apply(concatAnnotations, type);
|
|
95
|
-
|
|
96
|
-
return pipe(
|
|
97
|
-
O.fromNullable(metadata),
|
|
98
|
-
O.map(concatAnnotationToType),
|
|
99
|
-
O.getOrElse(() => E.right(type)),
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function concatAnnotations(type: Type, metadataInput: string): E.Either<Error, Type> {
|
|
104
|
-
return pipe(
|
|
105
|
-
metadataInput,
|
|
106
|
-
parseApexMetadata,
|
|
107
|
-
E.map((metadataMap) => ({
|
|
108
|
-
...type,
|
|
109
|
-
annotations: [...type.annotations, ...mapToAnnotations(metadataMap)],
|
|
110
|
-
})),
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function mapToAnnotations(metadata: Map<string, string>): Annotation[] {
|
|
115
|
-
return Array.from(metadata.entries()).map(([key, value]) => {
|
|
116
|
-
const declaration = `${key}: ${value}`;
|
|
117
|
-
return {
|
|
118
|
-
name: declaration,
|
|
119
|
-
type: declaration,
|
|
120
|
-
rawDeclaration: declaration,
|
|
121
|
-
};
|
|
122
|
-
});
|
|
123
|
-
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import * as O from 'fp-ts/Option';
|
|
2
|
-
import { match } from 'fp-ts/boolean';
|
|
3
|
-
import { ParsedFile } from '../../shared/types';
|
|
4
|
-
import { ClassMirror, DocComment, InterfaceMirror, Type } from '@cparra/apex-reflection';
|
|
5
|
-
import { pipe } from 'fp-ts/function';
|
|
6
|
-
import { apply } from '#utils/fp';
|
|
7
|
-
|
|
8
|
-
type AppliedRemoveTagFn = (tagName: string, removeFn: RemoveTagFn) => DocComment;
|
|
9
|
-
type RemoveTagFn = (docComment: DocComment) => DocComment;
|
|
10
|
-
type Documentable = { docComment?: DocComment };
|
|
11
|
-
|
|
12
|
-
export const removeExcludedTags = (excludedTags: string[], parsedFiles: ParsedFile[]): ParsedFile[] => {
|
|
13
|
-
return parsedFiles.map((parsedFile) => {
|
|
14
|
-
return {
|
|
15
|
-
...parsedFile,
|
|
16
|
-
type: removeExcludedTagsFromType(excludedTags, parsedFile.type),
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const removeExcludedTagsFromType = <T extends Type>(excludedTags: string[], type: T): T => {
|
|
22
|
-
return {
|
|
23
|
-
...handleType(excludedTags, type),
|
|
24
|
-
docComment: removeExcludedTagsFromDocComment(excludedTags, type.docComment),
|
|
25
|
-
} as T;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const handleType = (excludedTags: string[], type: Type): Type => {
|
|
29
|
-
switch (type.type_name) {
|
|
30
|
-
case 'class':
|
|
31
|
-
return handleClass(excludedTags, type as ClassMirror);
|
|
32
|
-
case 'interface':
|
|
33
|
-
return handleInterface(excludedTags, type as InterfaceMirror);
|
|
34
|
-
case 'enum':
|
|
35
|
-
return type;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const handleClass = (excludedTags: string[], classMirror: ClassMirror): ClassMirror => {
|
|
40
|
-
return {
|
|
41
|
-
...classMirror,
|
|
42
|
-
methods: classMirror.methods.map((method) => removeExcludedTagsFromDocumentable(excludedTags, method)),
|
|
43
|
-
properties: classMirror.properties.map((property) => removeExcludedTagsFromDocumentable(excludedTags, property)),
|
|
44
|
-
fields: classMirror.fields.map((field) => removeExcludedTagsFromDocumentable(excludedTags, field)),
|
|
45
|
-
constructors: classMirror.constructors.map((constructor) =>
|
|
46
|
-
removeExcludedTagsFromDocumentable(excludedTags, constructor),
|
|
47
|
-
),
|
|
48
|
-
enums: classMirror.enums.map((enumType) => removeExcludedTagsFromType(excludedTags, enumType)),
|
|
49
|
-
interfaces: classMirror.interfaces.map((interfaceType) => removeExcludedTagsFromType(excludedTags, interfaceType)),
|
|
50
|
-
classes: classMirror.classes.map((innerClass) => removeExcludedTagsFromType(excludedTags, innerClass)),
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const handleInterface = (excludedTags: string[], interfaceMirror: InterfaceMirror): InterfaceMirror => {
|
|
55
|
-
return {
|
|
56
|
-
...interfaceMirror,
|
|
57
|
-
methods: interfaceMirror.methods.map((method) => removeExcludedTagsFromDocumentable(excludedTags, method)),
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const removeExcludedTagsFromDocumentable = <T extends Documentable>(excludedTags: string[], documentable: T): T => {
|
|
62
|
-
return {
|
|
63
|
-
...documentable,
|
|
64
|
-
docComment: removeExcludedTagsFromDocComment(excludedTags, documentable.docComment),
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const removeExcludedTagsFromDocComment = (
|
|
69
|
-
excludedTags: string[],
|
|
70
|
-
docComment: DocComment | undefined,
|
|
71
|
-
): DocComment | undefined => {
|
|
72
|
-
const removerFn = apply(remove, excludedTags);
|
|
73
|
-
|
|
74
|
-
return pipe(
|
|
75
|
-
O.fromNullable(docComment),
|
|
76
|
-
O.map((docComment) => removeExcludedTagsFromAnnotations(excludedTags, docComment)),
|
|
77
|
-
O.map((docComment) => removeExampleTag(apply(removerFn, docComment))),
|
|
78
|
-
O.map((docComment) => removeParamTags(apply(removerFn, docComment))),
|
|
79
|
-
O.map((docComment) => removeReturnTag(apply(removerFn, docComment))),
|
|
80
|
-
O.map((docComment) => removeThrowsTag(apply(removerFn, docComment))),
|
|
81
|
-
O.map((docComment) => removeExceptionTag(apply(removerFn, docComment))),
|
|
82
|
-
O.map((docComment) => removeDescription(apply(removerFn, docComment))),
|
|
83
|
-
O.fold(
|
|
84
|
-
() => undefined,
|
|
85
|
-
(updatedDocComment) => updatedDocComment,
|
|
86
|
-
),
|
|
87
|
-
);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const removeExcludedTagsFromAnnotations = (excludedTags: string[], docComment: DocComment): DocComment => {
|
|
91
|
-
return pipe(
|
|
92
|
-
O.some(docComment.annotations),
|
|
93
|
-
O.map((annotations) => annotations.filter((annotation) => !includesIgnoreCase(excludedTags, annotation.name))),
|
|
94
|
-
O.fold(
|
|
95
|
-
() => docComment,
|
|
96
|
-
(filteredAnnotations) => ({
|
|
97
|
-
...docComment,
|
|
98
|
-
annotations: filteredAnnotations,
|
|
99
|
-
}),
|
|
100
|
-
),
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const removeExampleTag = (remover: AppliedRemoveTagFn): DocComment => {
|
|
105
|
-
return remover('example', (docComment) => {
|
|
106
|
-
return {
|
|
107
|
-
...docComment,
|
|
108
|
-
exampleAnnotation: null,
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const removeParamTags = (remover: AppliedRemoveTagFn): DocComment => {
|
|
114
|
-
return remover('param', (docComment) => {
|
|
115
|
-
return {
|
|
116
|
-
...docComment,
|
|
117
|
-
paramAnnotations: [],
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const removeReturnTag = (remover: AppliedRemoveTagFn): DocComment => {
|
|
123
|
-
return remover('return', (docComment) => {
|
|
124
|
-
return {
|
|
125
|
-
...docComment,
|
|
126
|
-
returnAnnotation: null,
|
|
127
|
-
};
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const removeThrowsTag = (remover: AppliedRemoveTagFn): DocComment => {
|
|
132
|
-
return remover('throws', (docComment) => {
|
|
133
|
-
return {
|
|
134
|
-
...docComment,
|
|
135
|
-
throwsAnnotations: [],
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
const removeExceptionTag = (remover: AppliedRemoveTagFn): DocComment => {
|
|
141
|
-
return remover('exception', (docComment) => {
|
|
142
|
-
return {
|
|
143
|
-
...docComment,
|
|
144
|
-
throwsAnnotations: [],
|
|
145
|
-
};
|
|
146
|
-
});
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
const removeDescription = (remover: AppliedRemoveTagFn): DocComment => {
|
|
150
|
-
return remover('description', (docComment) => {
|
|
151
|
-
return {
|
|
152
|
-
...docComment,
|
|
153
|
-
description: '',
|
|
154
|
-
descriptionLines: [],
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const remove = (excludedTags: string[], docComment: DocComment, tagName: string, removeFn: RemoveTagFn): DocComment => {
|
|
160
|
-
return match(
|
|
161
|
-
() => docComment,
|
|
162
|
-
() => removeFn(docComment!),
|
|
163
|
-
)(includesIgnoreCase(excludedTags, tagName) && !!docComment);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const includesIgnoreCase = (excluded: string[], value: string): boolean => {
|
|
167
|
-
return excluded.some((element) => element.toLowerCase() === value.toLowerCase());
|
|
168
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { ClassMirror, EnumMirror, InterfaceMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { ParsedFile } from '../../shared/types';
|
|
3
|
-
|
|
4
|
-
type Named = { name: string };
|
|
5
|
-
|
|
6
|
-
export function sortTypesAndMembers(shouldSort: boolean, parsedFiles: ParsedFile[]): ParsedFile[] {
|
|
7
|
-
return parsedFiles
|
|
8
|
-
.map((parsedFile) => ({
|
|
9
|
-
...parsedFile,
|
|
10
|
-
type: sortTypeMember(parsedFile.type, shouldSort),
|
|
11
|
-
}))
|
|
12
|
-
.sort((a, b) => sortByNames(shouldSort, a.type, b.type));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function sortByNames<T extends Named>(shouldSort: boolean, a: T, b: T): number {
|
|
16
|
-
if (shouldSort) {
|
|
17
|
-
return a.name.localeCompare(b.name);
|
|
18
|
-
}
|
|
19
|
-
return 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function sortNamed<T extends Named>(shouldSort: boolean, items: T[]): T[] {
|
|
23
|
-
return items.sort((a, b) => sortByNames(shouldSort, a, b));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function sortTypeMember(type: Type, shouldSort: boolean): Type {
|
|
27
|
-
switch (type.type_name) {
|
|
28
|
-
case 'enum':
|
|
29
|
-
return sortEnumValues(shouldSort, type as EnumMirror);
|
|
30
|
-
case 'interface':
|
|
31
|
-
return sortInterfaceMethods(shouldSort, type as InterfaceMirror);
|
|
32
|
-
case 'class':
|
|
33
|
-
return sortClassMembers(shouldSort, type as ClassMirror);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function sortEnumValues(shouldSort: boolean, enumType: EnumMirror): EnumMirror {
|
|
38
|
-
return {
|
|
39
|
-
...enumType,
|
|
40
|
-
values: sortNamed(shouldSort, enumType.values),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function sortInterfaceMethods(shouldSort: boolean, interfaceType: InterfaceMirror): InterfaceMirror {
|
|
45
|
-
return {
|
|
46
|
-
...interfaceType,
|
|
47
|
-
methods: sortNamed(shouldSort, interfaceType.methods),
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function sortClassMembers(shouldSort: boolean, classType: ClassMirror): ClassMirror {
|
|
52
|
-
return {
|
|
53
|
-
...classType,
|
|
54
|
-
fields: sortNamed(shouldSort, classType.fields),
|
|
55
|
-
classes: sortNamed(shouldSort, classType.classes),
|
|
56
|
-
enums: sortNamed(shouldSort, classType.enums),
|
|
57
|
-
interfaces: sortNamed(shouldSort, classType.interfaces),
|
|
58
|
-
methods: sortNamed(shouldSort, classType.methods),
|
|
59
|
-
properties: sortNamed(shouldSort, classType.properties),
|
|
60
|
-
};
|
|
61
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export const classMarkdownTemplate = `
|
|
2
|
-
{{ heading headingLevel heading }}
|
|
3
|
-
{{#if classModifier}}
|
|
4
|
-
\`{{classModifier}}\`
|
|
5
|
-
{{/if}}
|
|
6
|
-
|
|
7
|
-
{{> typeDocumentation}}
|
|
8
|
-
|
|
9
|
-
{{#if extends.length}}
|
|
10
|
-
**Inheritance**
|
|
11
|
-
|
|
12
|
-
{{#each extends}}{{link this}}{{#unless @last}} < {{/unless}}{{/each}}
|
|
13
|
-
{{/if}}
|
|
14
|
-
|
|
15
|
-
{{#if implements}}
|
|
16
|
-
**Implements**
|
|
17
|
-
|
|
18
|
-
{{#each implements}}
|
|
19
|
-
{{link this}}{{#unless @last}}, {{/unless}}
|
|
20
|
-
{{/each}}
|
|
21
|
-
{{/if}}
|
|
22
|
-
|
|
23
|
-
{{#if fields.value}}
|
|
24
|
-
{{#if fields.isGrouped}}
|
|
25
|
-
{{> groupedMembersPartialTemplate fields subTemplate="fieldsPartialTemplate"}}
|
|
26
|
-
{{else}}
|
|
27
|
-
{{> fieldsPartialTemplate fields}}
|
|
28
|
-
{{/if}}
|
|
29
|
-
{{/if}}
|
|
30
|
-
|
|
31
|
-
{{#if properties.value}}
|
|
32
|
-
{{#if properties.isGrouped}}
|
|
33
|
-
{{> groupedMembersPartialTemplate properties subTemplate="fieldsPartialTemplate"}}
|
|
34
|
-
{{else}}
|
|
35
|
-
{{> fieldsPartialTemplate properties}}
|
|
36
|
-
{{/if}}
|
|
37
|
-
{{/if}}
|
|
38
|
-
|
|
39
|
-
{{#if constructors.value}}
|
|
40
|
-
{{#if constructors.isGrouped}}
|
|
41
|
-
{{> groupedMembersPartialTemplate constructors subTemplate="constructorsPartialTemplate"}}
|
|
42
|
-
{{else}}
|
|
43
|
-
{{> constructorsPartialTemplate constructors}}
|
|
44
|
-
{{/if}}
|
|
45
|
-
{{/if}}
|
|
46
|
-
|
|
47
|
-
{{#if methods.value}}
|
|
48
|
-
{{#if methods.isGrouped}}
|
|
49
|
-
{{> groupedMembersPartialTemplate methods subTemplate="methodsPartialTemplate"}}
|
|
50
|
-
{{else}}
|
|
51
|
-
{{> methodsPartialTemplate methods}}
|
|
52
|
-
{{/if}}
|
|
53
|
-
{{/if}}
|
|
54
|
-
|
|
55
|
-
{{#if innerClasses.value}}
|
|
56
|
-
{{ heading innerClasses.headingLevel innerClasses.heading }}
|
|
57
|
-
{{#each innerClasses.value}}
|
|
58
|
-
{{> classTemplate this}}
|
|
59
|
-
{{/each}}
|
|
60
|
-
{{/if}}
|
|
61
|
-
|
|
62
|
-
{{#if innerEnums.value}}
|
|
63
|
-
{{ heading innerEnums.headingLevel innerEnums.heading }}
|
|
64
|
-
{{#each innerEnums.value}}
|
|
65
|
-
{{> enumTemplate this}}
|
|
66
|
-
{{/each}}
|
|
67
|
-
{{/if}}
|
|
68
|
-
|
|
69
|
-
{{#if innerInterfaces.value}}
|
|
70
|
-
{{ heading innerInterfaces.headingLevel innerInterfaces.heading }}
|
|
71
|
-
{{#each innerInterfaces.value}}
|
|
72
|
-
{{> interfaceTemplate this}}
|
|
73
|
-
{{/each}}
|
|
74
|
-
{{/if}}
|
|
75
|
-
`.trim();
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export const constructorsPartialTemplate = `
|
|
2
|
-
{{ heading headingLevel heading }}
|
|
3
|
-
{{#each value}}
|
|
4
|
-
{{{ heading headingLevel (inlineCode heading) }}}
|
|
5
|
-
|
|
6
|
-
{{#> documentablePartialTemplate}}
|
|
7
|
-
|
|
8
|
-
{{ heading signature.headingLevel signature.heading }}
|
|
9
|
-
{{ code signature.value }}
|
|
10
|
-
|
|
11
|
-
{{#if parameters.value}}
|
|
12
|
-
{{ heading parameters.headingLevel parameters.heading }}
|
|
13
|
-
| Name | Type | Description |
|
|
14
|
-
|------|------|-------------|
|
|
15
|
-
{{#each parameters.value}}
|
|
16
|
-
| {{name}} | {{link type}} | {{description}} |
|
|
17
|
-
{{/each}}
|
|
18
|
-
{{/if}}
|
|
19
|
-
|
|
20
|
-
{{#if throws.value}}
|
|
21
|
-
{{ heading throws.headingLevel throws.heading }}
|
|
22
|
-
{{#each throws.value}}
|
|
23
|
-
{{link this.type}}: {{this.description}}
|
|
24
|
-
|
|
25
|
-
{{/each}}
|
|
26
|
-
{{/if}}
|
|
27
|
-
{{/documentablePartialTemplate}}
|
|
28
|
-
|
|
29
|
-
{{#unless @last}}---{{/unless}}
|
|
30
|
-
|
|
31
|
-
{{/each}}
|
|
32
|
-
`.trim();
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const documentablePartialTemplate = `
|
|
2
|
-
{{#each doc.annotations}}
|
|
3
|
-
\`{{this}}\`
|
|
4
|
-
{{/each}}
|
|
5
|
-
|
|
6
|
-
{{{renderContent doc.description}}}
|
|
7
|
-
|
|
8
|
-
{{#each doc.customTags}}
|
|
9
|
-
**{{splitAndCapitalize name}}**
|
|
10
|
-
|
|
11
|
-
{{{renderContent description}}}
|
|
12
|
-
|
|
13
|
-
{{/each}}
|
|
14
|
-
|
|
15
|
-
{{> @partial-block}}
|
|
16
|
-
|
|
17
|
-
{{#if doc.mermaid.value}}
|
|
18
|
-
{{ heading doc.mermaid.headingLevel doc.mermaid.heading }}
|
|
19
|
-
{{code doc.mermaid.value}}
|
|
20
|
-
{{/if}}
|
|
21
|
-
|
|
22
|
-
{{#if doc.example.value}}
|
|
23
|
-
{{ heading doc.example.headingLevel doc.example.heading }}
|
|
24
|
-
{{{renderContent doc.example.value}}}
|
|
25
|
-
{{/if}}
|
|
26
|
-
`.trim();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const enumMarkdownTemplate = `
|
|
2
|
-
{{ heading headingLevel heading }}
|
|
3
|
-
|
|
4
|
-
{{> typeDocumentation }}
|
|
5
|
-
|
|
6
|
-
{{ heading values.headingLevel values.heading }}
|
|
7
|
-
| Value | Description |
|
|
8
|
-
|-------|-------------|
|
|
9
|
-
{{#each values.value}}
|
|
10
|
-
| {{value}} | {{description}} |
|
|
11
|
-
{{/each}}
|
|
12
|
-
`.trim();
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const fieldsPartialTemplate = `
|
|
2
|
-
{{ heading headingLevel heading }}
|
|
3
|
-
{{#each value}}
|
|
4
|
-
{{{ heading headingLevel (inlineCode heading) }}}
|
|
5
|
-
|
|
6
|
-
{{#if inherited}}
|
|
7
|
-
*Inherited*
|
|
8
|
-
{{/if}}
|
|
9
|
-
|
|
10
|
-
{{#> documentablePartialTemplate }}
|
|
11
|
-
|
|
12
|
-
{{ heading signature.headingLevel signature.heading }}
|
|
13
|
-
{{ code signature.value }}
|
|
14
|
-
|
|
15
|
-
{{ heading type.headingLevel type.heading }}
|
|
16
|
-
{{link type.value}}
|
|
17
|
-
|
|
18
|
-
{{/documentablePartialTemplate}}
|
|
19
|
-
|
|
20
|
-
{{#unless @last}}---{{/unless}}
|
|
21
|
-
|
|
22
|
-
{{/each}}
|
|
23
|
-
`.trim();
|