@cparra/apexdocs 2.24.0 → 2.25.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yaml +22 -0
- package/.github/workflows/close_stale.yml +22 -22
- package/.prettierrc.js +7 -7
- package/LICENSE +21 -21
- package/README.md +742 -718
- package/__mocks__/chalk.js +12 -0
- package/__mocks__/log-update.js +6 -0
- package/apexdocs.config.ts +13 -13
- package/docs/{README.md → __old/README.md} +1 -1
- package/docs/{restapi.json → __old/restapi.json} +589 -589
- package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
- package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
- package/eslint.config.mjs +10 -0
- package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
- package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
- package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
- package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
- package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
- package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
- package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
- package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
- package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
- package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
- package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
- package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
- package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
- package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
- package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
- package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
- package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
- package/examples/includes/header.md +3 -3
- package/examples/plain-markdown/.forceignore +12 -0
- package/examples/plain-markdown/config/project-scratch-def.json +5 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.BaseClass.md +16 -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 +36 -0
- package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
- package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
- package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
- package/examples/plain-markdown/force-app/classes/SampleClass.cls +72 -0
- package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
- package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
- package/examples/plain-markdown/package-lock.json +665 -0
- package/examples/plain-markdown/package.json +20 -0
- package/examples/plain-markdown/sfdx-project.json +12 -0
- package/examples/plain-markdown/template.md +3 -0
- package/jest.config.js +9 -5
- 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 +7 -0
- package/lib/adapters/apex-types.js +112 -0
- package/lib/adapters/apex-types.js.map +1 -0
- package/lib/adapters/documentables.d.ts +7 -0
- package/lib/adapters/documentables.js +56 -0
- package/lib/adapters/documentables.js.map +1 -0
- package/lib/adapters/fields-and-properties.d.ts +4 -0
- package/lib/adapters/fields-and-properties.js +32 -0
- package/lib/adapters/fields-and-properties.js.map +1 -0
- package/lib/adapters/methods-and-constructors.d.ts +5 -0
- package/lib/adapters/methods-and-constructors.js +92 -0
- package/lib/adapters/methods-and-constructors.js.map +1 -0
- package/lib/adapters/references.d.ts +5 -0
- package/lib/adapters/references.js +82 -0
- package/lib/adapters/references.js.map +1 -0
- package/lib/adapters/type-utils.d.ts +2 -0
- package/lib/adapters/type-utils.js +7 -0
- package/lib/adapters/type-utils.js.map +1 -0
- package/lib/application/Apexdocs.d.ts +13 -13
- package/lib/application/Apexdocs.js +79 -76
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.d.ts +2 -2
- package/lib/cli/generate.js +156 -130
- package/lib/cli/generate.js.map +1 -1
- package/lib/core/generate-docs.d.ts +23 -0
- package/lib/core/generate-docs.js +241 -0
- package/lib/core/generate-docs.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 +28 -17
- package/lib/index.js.map +1 -1
- package/lib/model/apex-bundle.d.ts +6 -6
- package/lib/model/apex-bundle.js +10 -10
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
- package/lib/model/inheritance.d.ts +8 -8
- package/lib/model/inheritance.js +2 -2
- package/lib/model/manifest.d.ts +22 -22
- package/lib/model/manifest.js +52 -46
- package/lib/model/manifest.js.map +1 -1
- package/lib/model/markdown-file.d.ts +16 -16
- package/lib/model/markdown-file.js +110 -106
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +45 -43
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/field-declaration-util.js +53 -54
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/index.d.ts +3 -3
- package/lib/model/markdown-generation-util/index.js +19 -19
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
- package/lib/model/markdown-generation-util/method-declaration-util.js +113 -114
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/type-declaration-util.js +80 -81
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
- package/lib/model/markdown-home-file.d.ts +11 -11
- package/lib/model/markdown-home-file.js +56 -53
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.d.ts +26 -26
- package/lib/model/markdown-type-file.js +136 -133
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/model/openapi/apex-doc-types.d.ts +19 -19
- package/lib/model/openapi/apex-doc-types.js +4 -4
- package/lib/model/openapi/open-api-types.d.ts +93 -93
- package/lib/model/openapi/open-api-types.js +2 -2
- package/lib/model/openapi/open-api.d.ts +16 -16
- package/lib/model/openapi/open-api.js +33 -33
- package/lib/model/openapi/open-api.js.map +1 -1
- package/lib/model/openapi/openapi-type-file.d.ts +7 -7
- package/lib/model/openapi/openapi-type-file.js +16 -16
- package/lib/model/outputFile.d.ts +10 -10
- package/lib/model/outputFile.js +21 -28
- package/lib/model/outputFile.js.map +1 -1
- package/lib/model/types-repository.d.ts +16 -16
- package/lib/model/types-repository.js +53 -53
- package/lib/model/types-repository.js.map +1 -1
- package/lib/service/apex-file-reader.d.ts +14 -14
- package/lib/service/apex-file-reader.js +48 -45
- package/lib/service/apex-file-reader.js.map +1 -1
- package/lib/service/file-system.d.ts +14 -14
- package/lib/service/file-system.js +47 -24
- package/lib/service/file-system.js.map +1 -1
- package/lib/service/file-writer.d.ts +6 -6
- package/lib/service/file-writer.js +56 -33
- package/lib/service/file-writer.js.map +1 -1
- package/lib/service/manifest-factory.d.ts +10 -10
- package/lib/service/manifest-factory.js +15 -13
- package/lib/service/manifest-factory.js.map +1 -1
- package/lib/service/metadata-processor.d.ts +3 -3
- package/lib/service/metadata-processor.js +16 -16
- package/lib/service/metadata-processor.js.map +1 -1
- package/lib/service/parser.d.ts +21 -21
- package/lib/service/parser.js +137 -134
- package/lib/service/parser.js.map +1 -1
- package/lib/service/state.d.ts +9 -9
- package/lib/service/state.js +19 -19
- package/lib/service/state.js.map +1 -1
- package/lib/service/walkers/class-walker.d.ts +4 -4
- package/lib/service/walkers/class-walker.js +32 -32
- package/lib/service/walkers/class-walker.js.map +1 -1
- package/lib/service/walkers/enum-walker.d.ts +4 -4
- package/lib/service/walkers/enum-walker.js +10 -10
- package/lib/service/walkers/interface-walker.d.ts +4 -4
- package/lib/service/walkers/interface-walker.js +14 -14
- package/lib/service/walkers/interface-walker.js.map +1 -1
- package/lib/service/walkers/walker-factory.d.ts +5 -5
- package/lib/service/walkers/walker-factory.js +20 -20
- package/lib/service/walkers/walker-factory.js.map +1 -1
- package/lib/service/walkers/walker.d.ts +19 -19
- package/lib/service/walkers/walker.js +16 -16
- package/lib/service/walkers/walker.js.map +1 -1
- package/lib/settings.d.ts +64 -64
- package/lib/settings.js +88 -88
- package/lib/settings.js.map +1 -1
- package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
- package/lib/test-helpers/AnnotationBuilder.js +30 -30
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
- package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
- package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
- package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
- package/lib/test-helpers/DocCommentBuilder.js +37 -37
- package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
- package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
- package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
- package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
- package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
- package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
- package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
- package/lib/test-helpers/SettingsBuilder.js +26 -26
- package/lib/transpiler/factory.d.ts +6 -6
- package/lib/transpiler/factory.js +34 -31
- package/lib/transpiler/factory.js.map +1 -1
- package/lib/transpiler/file-container.d.ts +6 -6
- package/lib/transpiler/file-container.js +15 -15
- package/lib/transpiler/generator-choices.d.ts +1 -1
- package/lib/transpiler/generator-choices.js +2 -2
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
- package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
- package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/class-template.js +77 -0
- package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +36 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +28 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.js +16 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +27 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
- 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.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +47 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +9 -6
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +41 -13
- 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.d.ts +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
- package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
- package/lib/transpiler/openapi/parsers/Builder.js +29 -29
- package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
- package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
- package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +249 -225
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +1 -1
- package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
- package/lib/transpiler/processor-type-transpiler.js +8 -8
- package/lib/transpiler/transpiler.d.ts +5 -5
- package/lib/transpiler/transpiler.js +29 -26
- package/lib/transpiler/transpiler.js.map +1 -1
- package/lib/util/error-logger.d.ts +8 -8
- package/lib/util/error-logger.js +89 -89
- package/lib/util/error-logger.js.map +1 -1
- package/lib/util/logger.d.ts +21 -21
- package/lib/util/logger.js +60 -57
- package/lib/util/logger.js.map +1 -1
- package/lib/util/string-utils.d.ts +2 -2
- package/lib/util/string-utils.js +14 -14
- package/lib/util/string-utils.js.map +1 -1
- package/package.json +79 -78
- 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 +80 -0
- package/src/adapters/__tests__/references.spec.ts +115 -0
- package/src/adapters/apex-types.ts +224 -0
- package/src/adapters/documentables.ts +93 -0
- package/src/adapters/fields-and-properties.ts +38 -0
- package/src/adapters/methods-and-constructors.ts +117 -0
- package/src/adapters/references.ts +113 -0
- package/src/adapters/type-utils.ts +5 -0
- package/src/adapters/types.d.ts +8 -0
- package/src/cli/generate.ts +96 -93
- package/src/core/generate-docs.ts +357 -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/__tests__/manifest.spec.ts +1 -0
- package/src/model/manifest.ts +15 -5
- package/src/model/markdown-file.ts +6 -5
- 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/openapi/open-api-types.ts +2 -2
- package/src/model/outputFile.ts +2 -11
- package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
- package/src/service/__tests__/manifest-factory.spec.ts +1 -2
- package/src/service/parser.ts +1 -1
- package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
- package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
- package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
- package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
- package/src/transpiler/markdown/plain-markdown/class-template.ts +73 -0
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +32 -0
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +24 -0
- package/src/transpiler/markdown/plain-markdown/enum-template.ts +12 -0
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +23 -0
- package/src/transpiler/markdown/plain-markdown/grouped-members-partial-template.ts +6 -0
- package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +43 -0
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +30 -0
- package/src/transpiler/markdown/plain-markdown/type-doc-partial.ts +27 -0
- package/src/transpiler/openapi/parsers/Builder.ts +1 -1
- package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
- package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +4 -3
- package/src/util/error-logger.ts +4 -4
- package/src/util/logger.ts +3 -3
- package/tsconfig.json +21 -20
- package/tslint.json +5 -5
- package/.eslintrc.js +0 -12
- package/lib/model/manifest-diff.d.ts +0 -27
- package/lib/model/manifest-diff.js +0 -69
- package/lib/model/manifest-diff.js.map +0 -1
- package/src/model/__tests__/manifest-diff.spec.ts +0 -139
- package/src/model/manifest-diff.ts +0 -94
- /package/docs/{index.html → __old/index.html} +0 -0
- /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
- /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
- /package/docs/{types → __old/types}/README.md +0 -0
- /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { assertEither, extendExpect } from './expect-extensions';
|
|
2
|
+
import { generateDocs } from '../../core/generate-docs';
|
|
3
|
+
|
|
4
|
+
describe('Generates interface documentation', () => {
|
|
5
|
+
beforeAll(() => {
|
|
6
|
+
extendExpect();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
describe('documentation output', () => {
|
|
10
|
+
it('always returns markdown as the format', () => {
|
|
11
|
+
const input = 'public class MyClass {}';
|
|
12
|
+
|
|
13
|
+
const result = generateDocs([input]);
|
|
14
|
+
assertEither(result, (data) => expect(data.format).toBe('markdown'));
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('returns the name of the class', () => {
|
|
18
|
+
const input = 'public class MyClass {}';
|
|
19
|
+
|
|
20
|
+
const result = generateDocs([input]);
|
|
21
|
+
expect(result).documentationBundleHasLength(1);
|
|
22
|
+
assertEither(result, (data) => expect(data.docs[0].typeName).toBe('MyClass'));
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('returns the type as class', () => {
|
|
26
|
+
const input = 'public class MyClass {}';
|
|
27
|
+
|
|
28
|
+
const result = generateDocs([input]);
|
|
29
|
+
expect(result).documentationBundleHasLength(1);
|
|
30
|
+
assertEither(result, (data) => expect(data.docs[0].type).toBe('class'));
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('does not return classes out of scope', () => {
|
|
34
|
+
const input1 = `
|
|
35
|
+
global class MyClass {}
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const input2 = `
|
|
39
|
+
public class AnotherClass {}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
const result = generateDocs([input1, input2], { scope: ['global'] });
|
|
43
|
+
expect(result).documentationBundleHasLength(1);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('does not return classes that have an @ignore in the docs', () => {
|
|
47
|
+
const input = `
|
|
48
|
+
/**
|
|
49
|
+
* @ignore
|
|
50
|
+
*/
|
|
51
|
+
public class MyClass {}`;
|
|
52
|
+
|
|
53
|
+
const result = generateDocs([input]);
|
|
54
|
+
expect(result).documentationBundleHasLength(0);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('does not return class methods that have @ignore in the docs', () => {
|
|
58
|
+
const input = `
|
|
59
|
+
public class MyClass {
|
|
60
|
+
/**
|
|
61
|
+
* @ignore
|
|
62
|
+
*/
|
|
63
|
+
public void myMethod() {}
|
|
64
|
+
}`;
|
|
65
|
+
|
|
66
|
+
const result = generateDocs([input]);
|
|
67
|
+
expect(result).documentationBundleHasLength(1);
|
|
68
|
+
assertEither(result, (data) => expect(data.docs[0].docContents).not.toContain('myMethod'));
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('does not return class properties that have @ignore in the docs', () => {
|
|
72
|
+
const input = `
|
|
73
|
+
public class MyClass {
|
|
74
|
+
/**
|
|
75
|
+
* @ignore
|
|
76
|
+
*/
|
|
77
|
+
public String myProperty { get; set; }
|
|
78
|
+
}`;
|
|
79
|
+
|
|
80
|
+
const result = generateDocs([input]);
|
|
81
|
+
expect(result).documentationBundleHasLength(1);
|
|
82
|
+
assertEither(result, (data) => expect(data.docs[0].docContents).not.toContain('myProperty'));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('does not return class fields that have @ignore in the docs', () => {
|
|
86
|
+
const input = `
|
|
87
|
+
public class MyClass {
|
|
88
|
+
/**
|
|
89
|
+
* @ignore
|
|
90
|
+
*/
|
|
91
|
+
public String myField;
|
|
92
|
+
}`;
|
|
93
|
+
|
|
94
|
+
const result = generateDocs([input]);
|
|
95
|
+
expect(result).documentationBundleHasLength(1);
|
|
96
|
+
assertEither(result, (data) => expect(data.docs[0].docContents).not.toContain('myField'));
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('does not return class inner classes that have @ignore in the docs', () => {
|
|
100
|
+
const input = `
|
|
101
|
+
public class MyClass {
|
|
102
|
+
/**
|
|
103
|
+
* @ignore
|
|
104
|
+
*/
|
|
105
|
+
public class InnerClass {}
|
|
106
|
+
}`;
|
|
107
|
+
|
|
108
|
+
const result = generateDocs([input]);
|
|
109
|
+
expect(result).documentationBundleHasLength(1);
|
|
110
|
+
assertEither(result, (data) => expect(data.docs[0].docContents).not.toContain('InnerClass'));
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('does not return class inner interfaces that have @ignore in the docs', () => {
|
|
114
|
+
const input = `
|
|
115
|
+
public class MyClass {
|
|
116
|
+
/**
|
|
117
|
+
* @ignore
|
|
118
|
+
*/
|
|
119
|
+
public interface InnerInterface {}
|
|
120
|
+
}`;
|
|
121
|
+
|
|
122
|
+
const result = generateDocs([input]);
|
|
123
|
+
expect(result).documentationBundleHasLength(1);
|
|
124
|
+
assertEither(result, (data) => expect(data.docs[0].docContents).not.toContain('InnerInterface'));
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('does not return class inner enums that have @ignore in the docs', () => {
|
|
128
|
+
const input = `
|
|
129
|
+
public class MyClass {
|
|
130
|
+
/**
|
|
131
|
+
* @ignore
|
|
132
|
+
*/
|
|
133
|
+
public enum InnerEnum {}
|
|
134
|
+
}`;
|
|
135
|
+
|
|
136
|
+
const result = generateDocs([input]);
|
|
137
|
+
expect(result).documentationBundleHasLength(1);
|
|
138
|
+
assertEither(result, (data) => expect(data.docs[0].docContents).not.toContain('InnerEnum'));
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
describe('documentation content', () => {
|
|
143
|
+
describe('type level information', () => {
|
|
144
|
+
it('generates a heading with the class name', () => {
|
|
145
|
+
const input = 'public class MyClass {}';
|
|
146
|
+
|
|
147
|
+
const output = `# MyClass Class`;
|
|
148
|
+
const result = generateDocs([input]);
|
|
149
|
+
expect(result).documentationBundleHasLength(1);
|
|
150
|
+
assertEither(result, (data) => expect(data).firstDocContains(output));
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('displays type level annotations', () => {
|
|
154
|
+
const input = `
|
|
155
|
+
@NamespaceAccessible
|
|
156
|
+
public class MyClass {
|
|
157
|
+
@Deprecated
|
|
158
|
+
public void myMethod() {}
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
|
|
162
|
+
const result = generateDocs([input]);
|
|
163
|
+
expect(result).documentationBundleHasLength(1);
|
|
164
|
+
assertEither(result, (data) => expect(data).firstDocContains('NAMESPACEACCESSIBLE'));
|
|
165
|
+
assertEither(result, (data) => expect(data).firstDocContains('DEPRECATED'));
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('displays the description', () => {
|
|
169
|
+
const input = `
|
|
170
|
+
/**
|
|
171
|
+
* This is a description
|
|
172
|
+
*/
|
|
173
|
+
public class MyClass {}
|
|
174
|
+
`;
|
|
175
|
+
|
|
176
|
+
const result = generateDocs([input]);
|
|
177
|
+
expect(result).documentationBundleHasLength(1);
|
|
178
|
+
assertEither(result, (data) => expect(data).firstDocContains('This is a description'));
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('display custom documentation tags', () => {
|
|
182
|
+
const input = `
|
|
183
|
+
/**
|
|
184
|
+
* @custom-tag My Value
|
|
185
|
+
*/
|
|
186
|
+
public class MyClass {}
|
|
187
|
+
`;
|
|
188
|
+
|
|
189
|
+
const result = generateDocs([input]);
|
|
190
|
+
expect(result).documentationBundleHasLength(1);
|
|
191
|
+
assertEither(result, (data) => expect(data).firstDocContains('Custom Tag'));
|
|
192
|
+
assertEither(result, (data) => expect(data).firstDocContains('My Value'));
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('displays the group', () => {
|
|
196
|
+
const input = `
|
|
197
|
+
/**
|
|
198
|
+
* @group MyGroup
|
|
199
|
+
*/
|
|
200
|
+
public class MyClass {}`;
|
|
201
|
+
|
|
202
|
+
const result = generateDocs([input]);
|
|
203
|
+
expect(result).documentationBundleHasLength(1);
|
|
204
|
+
assertEither(result, (data) => expect(data).firstDocContains('Group'));
|
|
205
|
+
assertEither(result, (data) => expect(data).firstDocContains('MyGroup'));
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('displays the author', () => {
|
|
209
|
+
const input = `
|
|
210
|
+
/**
|
|
211
|
+
* @author John Doe
|
|
212
|
+
*/
|
|
213
|
+
public class MyClass {}`;
|
|
214
|
+
|
|
215
|
+
const result = generateDocs([input]);
|
|
216
|
+
expect(result).documentationBundleHasLength(1);
|
|
217
|
+
assertEither(result, (data) => expect(data).firstDocContains('Author'));
|
|
218
|
+
assertEither(result, (data) => expect(data).firstDocContains('John Doe'));
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
it('displays the date', () => {
|
|
222
|
+
const input = `
|
|
223
|
+
/**
|
|
224
|
+
* @date 2021-01-01
|
|
225
|
+
*/
|
|
226
|
+
public class MyClass {}`;
|
|
227
|
+
|
|
228
|
+
const result = generateDocs([input]);
|
|
229
|
+
expect(result).documentationBundleHasLength(1);
|
|
230
|
+
assertEither(result, (data) => expect(data).firstDocContains('Date'));
|
|
231
|
+
assertEither(result, (data) => expect(data).firstDocContains('2021-01-01'));
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('displays descriptions', () => {
|
|
235
|
+
const input = `
|
|
236
|
+
/**
|
|
237
|
+
* @description This is a description
|
|
238
|
+
*/
|
|
239
|
+
public class MyClass {}`;
|
|
240
|
+
|
|
241
|
+
const result = generateDocs([input]);
|
|
242
|
+
expect(result).documentationBundleHasLength(1);
|
|
243
|
+
assertEither(result, (data) => expect(data).firstDocContains('This is a description'));
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it('displays descriptions with links', () => {
|
|
247
|
+
const input1 = `
|
|
248
|
+
/**
|
|
249
|
+
* @description This is a description with a {@link ClassRef} reference
|
|
250
|
+
*/
|
|
251
|
+
public enum MyClass {}
|
|
252
|
+
`;
|
|
253
|
+
|
|
254
|
+
const input2 = 'public class ClassRef {}';
|
|
255
|
+
|
|
256
|
+
const result = generateDocs([input1, input2]);
|
|
257
|
+
expect(result).documentationBundleHasLength(2);
|
|
258
|
+
assertEither(result, (data) =>
|
|
259
|
+
expect(data).firstDocContains('This is a description with a [ClassRef](./ClassRef.md) reference'),
|
|
260
|
+
);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it('displays descriptions with emails', () => {
|
|
264
|
+
const input = `
|
|
265
|
+
/**
|
|
266
|
+
* @description This is a description with an {@email test@testerson.com} email
|
|
267
|
+
*/
|
|
268
|
+
public class MyClass {}
|
|
269
|
+
`;
|
|
270
|
+
|
|
271
|
+
const result = generateDocs([input]);
|
|
272
|
+
expect(result).documentationBundleHasLength(1);
|
|
273
|
+
assertEither(result, (data) =>
|
|
274
|
+
expect(data).firstDocContains(
|
|
275
|
+
'This is a description with an [test@testerson.com](mailto:test@testerson.com) email',
|
|
276
|
+
),
|
|
277
|
+
);
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it('displays sees with accurately resolved links', () => {
|
|
281
|
+
const input1 = `
|
|
282
|
+
/**
|
|
283
|
+
* @see ClassRef
|
|
284
|
+
*/
|
|
285
|
+
public class MyClass {}
|
|
286
|
+
`;
|
|
287
|
+
|
|
288
|
+
const input2 = 'public class ClassRef {}';
|
|
289
|
+
|
|
290
|
+
const result = generateDocs([input1, input2]);
|
|
291
|
+
expect(result).documentationBundleHasLength(2);
|
|
292
|
+
assertEither(result, (data) => expect(data).firstDocContains('See'));
|
|
293
|
+
assertEither(result, (data) => expect(data).firstDocContains('[ClassRef](./ClassRef.md)'));
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it('displays sees without links when the reference is not found', () => {
|
|
297
|
+
const input = `
|
|
298
|
+
/**
|
|
299
|
+
* @see ClassRef
|
|
300
|
+
*/
|
|
301
|
+
public class MyClass {}
|
|
302
|
+
`;
|
|
303
|
+
|
|
304
|
+
const result = generateDocs([input]);
|
|
305
|
+
expect(result).documentationBundleHasLength(1);
|
|
306
|
+
assertEither(result, (data) => expect(data).firstDocContains('See'));
|
|
307
|
+
assertEither(result, (data) => expect(data).firstDocContains('ClassRef'));
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it('displays the namespace if present in the config', () => {
|
|
311
|
+
const input = 'public class MyClass {}';
|
|
312
|
+
|
|
313
|
+
const result = generateDocs([input], { namespace: 'MyNamespace' });
|
|
314
|
+
expect(result).documentationBundleHasLength(1);
|
|
315
|
+
assertEither(result, (data) => expect(data).firstDocContains('## Namespace'));
|
|
316
|
+
assertEither(result, (data) => expect(data).firstDocContains('MyNamespace'));
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
it('does not display the namespace if not present in the config', () => {
|
|
320
|
+
const input = 'public class MyClass {}';
|
|
321
|
+
|
|
322
|
+
const result = generateDocs([input]);
|
|
323
|
+
expect(result).documentationBundleHasLength(1);
|
|
324
|
+
assertEither(result, (data) => expect(data).firstDocContainsNot('## Namespace'));
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
it('displays a mermaid diagram', () => {
|
|
328
|
+
const input = `
|
|
329
|
+
/**
|
|
330
|
+
* @mermaid
|
|
331
|
+
* graph TD
|
|
332
|
+
* A[Square Rect] -- Link text --> B((Circle))
|
|
333
|
+
* A --> C(Round Rect)
|
|
334
|
+
* B --> D{Rhombus}
|
|
335
|
+
* C --> D
|
|
336
|
+
*/
|
|
337
|
+
public class MyClass {}
|
|
338
|
+
`;
|
|
339
|
+
|
|
340
|
+
const result = generateDocs([input]);
|
|
341
|
+
expect(result).documentationBundleHasLength(1);
|
|
342
|
+
assertEither(result, (data) => expect(data).firstDocContains('```mermaid'));
|
|
343
|
+
assertEither(result, (data) => expect(data).firstDocContains('graph TD'));
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
it('displays an example code block', () => {
|
|
347
|
+
const input = `
|
|
348
|
+
/**
|
|
349
|
+
* @example
|
|
350
|
+
* public class MyClass {
|
|
351
|
+
* public void myMethod() {
|
|
352
|
+
* System.debug('Hello, World!');
|
|
353
|
+
* }
|
|
354
|
+
* }
|
|
355
|
+
*/
|
|
356
|
+
public class MyClass {}`;
|
|
357
|
+
|
|
358
|
+
const result = generateDocs([input]);
|
|
359
|
+
expect(result).documentationBundleHasLength(1);
|
|
360
|
+
assertEither(result, (data) => expect(data).firstDocContains('```apex'));
|
|
361
|
+
assertEither(result, (data) => expect(data).firstDocContains('public class MyClass'));
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
describe('member information', () => {
|
|
367
|
+
it('displays the Method heading', () => {
|
|
368
|
+
const input = `
|
|
369
|
+
public class MyClass {
|
|
370
|
+
public void myMethod() {}
|
|
371
|
+
}
|
|
372
|
+
`;
|
|
373
|
+
|
|
374
|
+
const result = generateDocs([input]);
|
|
375
|
+
expect(result).documentationBundleHasLength(1);
|
|
376
|
+
assertEither(result, (data) => expect(data).firstDocContains('## Methods'));
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
it('displays the Property heading', () => {
|
|
380
|
+
const input = `
|
|
381
|
+
public class MyClass {
|
|
382
|
+
public String myProperty { get; set; }
|
|
383
|
+
}
|
|
384
|
+
`;
|
|
385
|
+
|
|
386
|
+
const result = generateDocs([input]);
|
|
387
|
+
expect(result).documentationBundleHasLength(1);
|
|
388
|
+
assertEither(result, (data) => expect(data).firstDocContains('## Properties'));
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
it('displays the Field heading', () => {
|
|
392
|
+
const input = `
|
|
393
|
+
public class MyClass {
|
|
394
|
+
public String myField;
|
|
395
|
+
}
|
|
396
|
+
`;
|
|
397
|
+
|
|
398
|
+
const result = generateDocs([input]);
|
|
399
|
+
expect(result).documentationBundleHasLength(1);
|
|
400
|
+
assertEither(result, (data) => expect(data).firstDocContains('## Fields'));
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
it('displays the Constructor heading', () => {
|
|
404
|
+
const input = `
|
|
405
|
+
public class MyClass {
|
|
406
|
+
public MyClass() {}
|
|
407
|
+
}
|
|
408
|
+
`;
|
|
409
|
+
|
|
410
|
+
const result = generateDocs([input]);
|
|
411
|
+
expect(result).documentationBundleHasLength(1);
|
|
412
|
+
assertEither(result, (data) => expect(data).firstDocContains('## Constructors'));
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
it('displays the Inner Class heading', () => {
|
|
416
|
+
const input = `
|
|
417
|
+
public class MyClass {
|
|
418
|
+
public class InnerClass {}
|
|
419
|
+
}
|
|
420
|
+
`;
|
|
421
|
+
|
|
422
|
+
const result = generateDocs([input]);
|
|
423
|
+
expect(result).documentationBundleHasLength(1);
|
|
424
|
+
assertEither(result, (data) => expect(data).firstDocContains('## Classes'));
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
it('displays the Inner Interface heading', () => {
|
|
428
|
+
const input = `
|
|
429
|
+
public class MyClass {
|
|
430
|
+
public interface InnerInterface {}
|
|
431
|
+
}
|
|
432
|
+
`;
|
|
433
|
+
|
|
434
|
+
const result = generateDocs([input]);
|
|
435
|
+
expect(result).documentationBundleHasLength(1);
|
|
436
|
+
assertEither(result, (data) => expect(data).firstDocContains('## Interfaces'));
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
it('displays the Inner Enum heading', () => {
|
|
440
|
+
const input = `
|
|
441
|
+
public class MyClass {
|
|
442
|
+
public enum InnerEnum {}
|
|
443
|
+
}
|
|
444
|
+
`;
|
|
445
|
+
|
|
446
|
+
const result = generateDocs([input]);
|
|
447
|
+
expect(result).documentationBundleHasLength(1);
|
|
448
|
+
assertEither(result, (data) => expect(data).firstDocContains('## Enums'));
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
it('supports having mermaid diagrams in descriptions', () => {
|
|
452
|
+
const input = `
|
|
453
|
+
public class MyClass {
|
|
454
|
+
/**
|
|
455
|
+
* @mermaid
|
|
456
|
+
* graph TD
|
|
457
|
+
* A[Square Rect] -- Link text --> B((Circle))
|
|
458
|
+
* A --> C(Round Rect)
|
|
459
|
+
* B --> D{Rhombus}
|
|
460
|
+
* C --> D
|
|
461
|
+
*/
|
|
462
|
+
public void myMethod() {}
|
|
463
|
+
}
|
|
464
|
+
`;
|
|
465
|
+
|
|
466
|
+
const result = generateDocs([input]);
|
|
467
|
+
expect(result).documentationBundleHasLength(1);
|
|
468
|
+
assertEither(result, (data) => expect(data).firstDocContains('```mermaid'));
|
|
469
|
+
assertEither(result, (data) => expect(data).firstDocContains('graph TD'));
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
it('supports having example code blocks in method descriptions', () => {
|
|
473
|
+
const input = `
|
|
474
|
+
public class MyClass {
|
|
475
|
+
/**
|
|
476
|
+
* @example
|
|
477
|
+
* public class MyClass {
|
|
478
|
+
* public void myMethod() {
|
|
479
|
+
* System.debug('Hello, World!');
|
|
480
|
+
* }
|
|
481
|
+
* }
|
|
482
|
+
*/
|
|
483
|
+
public void myMethod() {}
|
|
484
|
+
}
|
|
485
|
+
`;
|
|
486
|
+
|
|
487
|
+
const result = generateDocs([input]);
|
|
488
|
+
expect(result).documentationBundleHasLength(1);
|
|
489
|
+
assertEither(result, (data) => expect(data).firstDocContains('```apex'));
|
|
490
|
+
assertEither(result, (data) => expect(data).firstDocContains('public class MyClass'));
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
it('displays an "inherited" tag if the method was inherited from a different interface', () => {
|
|
494
|
+
const input1 = `
|
|
495
|
+
public virtual class MyClass {
|
|
496
|
+
public void myMethod() {}
|
|
497
|
+
}
|
|
498
|
+
`;
|
|
499
|
+
|
|
500
|
+
const input2 = `
|
|
501
|
+
public class AnotherClass extends MyClass {}
|
|
502
|
+
`;
|
|
503
|
+
|
|
504
|
+
const result = generateDocs([input1, input2]);
|
|
505
|
+
expect(result).documentationBundleHasLength(2);
|
|
506
|
+
assertEither(result, (data) =>
|
|
507
|
+
expect(data.docs.find((doc) => doc.typeName === 'AnotherClass')?.docContents).toContain('Inherited'),
|
|
508
|
+
);
|
|
509
|
+
});
|
|
510
|
+
});
|
|
511
|
+
});
|