@cparra/apexdocs 2.25.0-alpha.9 → 2.25.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/.eslintrc.js +12 -0
- package/README.md +12 -73
- package/apexdocs.config.ts +13 -0
- package/docs/.nojekyll +0 -0
- package/docs/README.md +1 -0
- package/docs/index.html +22 -0
- package/docs/restapi.json +589 -0
- package/docs/types/Classes/nspc.AnotherInterface.md +22 -0
- package/docs/types/Classes/nspc.ChildClass.md +97 -0
- package/docs/types/Main/nspc.GroupedClass.md +10 -0
- package/docs/types/Main/nspc.SampleClass.md +190 -0
- package/docs/types/Misc-Group/nspc.EscapedAnnotations.md +4 -0
- package/docs/types/Misc-Group/nspc.GrandparentClass.md +13 -0
- package/docs/types/Misc-Group/nspc.InterfaceWithInheritance.md +29 -0
- package/docs/types/Misc-Group/nspc.MemberGrouping.md +13 -0
- package/docs/types/Misc-Group/nspc.ParentClass.md +37 -0
- package/docs/types/Misc-Group/nspc.Reference1.md +18 -0
- package/docs/types/Misc-Group/nspc.Reference2.md +12 -0
- package/docs/types/Misc-Group/nspc.Reference3.md +7 -0
- package/docs/types/Misc-Group/nspc.Reference4.md +7 -0
- package/docs/types/Misc-Group/nspc.Reference5.md +7 -0
- package/docs/types/Misc-Group/nspc.Reference6.md +9 -0
- package/docs/types/Misc-Group/nspc.Reference7.md +7 -0
- package/docs/types/Misc-Group/nspc.SampleClassWithoutModifier.md +11 -0
- package/docs/types/Misc-Group/nspc.SampleRestResource.md +211 -0
- package/docs/types/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +34 -0
- package/docs/types/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +14 -0
- package/docs/types/README.md +97 -0
- package/docs/types/Sample-Interfaces/nspc.SampleInterface.md +23 -0
- package/examples/includes/header.md +3 -0
- package/jest.config.js +1 -6
- package/lib/application/Apexdocs.d.ts +13 -0
- package/lib/application/Apexdocs.js +77 -0
- package/lib/application/Apexdocs.js.map +1 -0
- package/lib/cli/generate.d.ts +2 -0
- package/lib/cli/generate.js +131 -0
- package/lib/cli/generate.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/model/apex-bundle.d.ts +6 -0
- package/lib/model/apex-bundle.js +11 -0
- package/lib/model/apex-bundle.js.map +1 -0
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -0
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +14 -0
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js.map +1 -0
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -0
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +12 -0
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js.map +1 -0
- package/lib/model/inheritance.d.ts +8 -0
- package/lib/model/inheritance.js +3 -0
- package/lib/model/inheritance.js.map +1 -0
- package/lib/model/manifest-diff.d.ts +27 -0
- package/lib/model/manifest-diff.js +69 -0
- package/lib/model/manifest-diff.js.map +1 -0
- package/lib/model/manifest.d.ts +22 -0
- package/lib/model/manifest.js +47 -0
- package/lib/model/manifest.js.map +1 -0
- package/lib/model/markdown-file.d.ts +16 -0
- package/lib/model/markdown-file.js +107 -0
- package/lib/model/markdown-file.js.map +1 -0
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -0
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +44 -0
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -0
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -0
- package/lib/model/markdown-generation-util/field-declaration-util.js +55 -0
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -0
- package/lib/model/markdown-generation-util/index.d.ts +3 -0
- package/lib/model/markdown-generation-util/index.js +20 -0
- package/lib/model/markdown-generation-util/index.js.map +1 -0
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -0
- package/lib/model/markdown-generation-util/method-declaration-util.js +115 -0
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -0
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -0
- package/lib/model/markdown-generation-util/type-declaration-util.js +82 -0
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -0
- package/lib/model/markdown-home-file.d.ts +11 -0
- package/lib/model/markdown-home-file.js +54 -0
- package/lib/model/markdown-home-file.js.map +1 -0
- package/lib/model/markdown-type-file.d.ts +26 -0
- package/lib/model/markdown-type-file.js +134 -0
- package/lib/model/markdown-type-file.js.map +1 -0
- package/lib/model/openapi/apex-doc-types.d.ts +19 -0
- package/lib/model/openapi/apex-doc-types.js +5 -0
- package/lib/model/openapi/apex-doc-types.js.map +1 -0
- package/lib/model/openapi/open-api-types.d.ts +93 -0
- package/lib/model/openapi/open-api-types.js +3 -0
- package/lib/model/openapi/open-api-types.js.map +1 -0
- package/lib/model/openapi/open-api.d.ts +16 -0
- package/lib/model/openapi/open-api.js +34 -0
- package/lib/model/openapi/open-api.js.map +1 -0
- package/lib/model/openapi/openapi-type-file.d.ts +7 -0
- package/lib/model/openapi/openapi-type-file.js +17 -0
- package/lib/model/openapi/openapi-type-file.js.map +1 -0
- package/lib/model/outputFile.d.ts +10 -0
- package/lib/model/outputFile.js +29 -0
- package/lib/model/outputFile.js.map +1 -0
- package/lib/model/types-repository.d.ts +16 -0
- package/lib/model/types-repository.js +54 -0
- package/lib/model/types-repository.js.map +1 -0
- package/lib/service/apex-file-reader.d.ts +14 -0
- package/lib/service/apex-file-reader.js +46 -0
- package/lib/service/apex-file-reader.js.map +1 -0
- package/lib/service/file-system.d.ts +14 -0
- package/lib/service/file-system.js +25 -0
- package/lib/service/file-system.js.map +1 -0
- package/lib/service/file-writer.d.ts +6 -0
- package/lib/service/file-writer.js +34 -0
- package/lib/service/file-writer.js.map +1 -0
- package/lib/service/manifest-factory.d.ts +10 -0
- package/lib/service/manifest-factory.js +14 -0
- package/lib/service/manifest-factory.js.map +1 -0
- package/lib/service/metadata-processor.d.ts +3 -0
- package/lib/service/metadata-processor.js +17 -0
- package/lib/service/metadata-processor.js.map +1 -0
- package/lib/service/parser.d.ts +21 -0
- package/lib/service/parser.js +135 -0
- package/lib/service/parser.js.map +1 -0
- package/lib/service/state.d.ts +9 -0
- package/lib/service/state.js +20 -0
- package/lib/service/state.js.map +1 -0
- package/lib/service/walkers/class-walker.d.ts +4 -0
- package/lib/service/walkers/class-walker.js +33 -0
- package/lib/service/walkers/class-walker.js.map +1 -0
- package/lib/service/walkers/enum-walker.d.ts +4 -0
- package/lib/service/walkers/enum-walker.js +11 -0
- package/lib/service/walkers/enum-walker.js.map +1 -0
- package/lib/service/walkers/interface-walker.d.ts +4 -0
- package/lib/service/walkers/interface-walker.js +15 -0
- package/lib/service/walkers/interface-walker.js.map +1 -0
- package/lib/service/walkers/walker-factory.d.ts +5 -0
- package/lib/service/walkers/walker-factory.js +21 -0
- package/lib/service/walkers/walker-factory.js.map +1 -0
- package/lib/service/walkers/walker.d.ts +19 -0
- package/lib/service/walkers/walker.js +17 -0
- package/lib/service/walkers/walker.js.map +1 -0
- package/lib/settings.d.ts +64 -0
- package/lib/settings.js +89 -0
- package/lib/settings.js.map +1 -0
- package/lib/test-helpers/AnnotationBuilder.d.ts +12 -0
- package/lib/test-helpers/AnnotationBuilder.js +31 -0
- package/lib/test-helpers/AnnotationBuilder.js.map +1 -0
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -0
- package/lib/test-helpers/ClassMirrorBuilder.js +54 -0
- package/lib/test-helpers/ClassMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -0
- package/lib/test-helpers/DocCommentAnnotationBuilder.js +26 -0
- package/lib/test-helpers/DocCommentAnnotationBuilder.js.map +1 -0
- package/lib/test-helpers/DocCommentBuilder.d.ts +12 -0
- package/lib/test-helpers/DocCommentBuilder.js +38 -0
- package/lib/test-helpers/DocCommentBuilder.js.map +1 -0
- package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -0
- package/lib/test-helpers/FieldMirrorBuilder.js +54 -0
- package/lib/test-helpers/FieldMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +10 -0
- package/lib/test-helpers/MethodMirrorBuilder.js +37 -0
- package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/SettingsBuilder.d.ts +8 -0
- package/lib/test-helpers/SettingsBuilder.js +27 -0
- package/lib/test-helpers/SettingsBuilder.js.map +1 -0
- package/lib/transpiler/factory.d.ts +6 -0
- package/lib/transpiler/factory.js +32 -0
- package/lib/transpiler/factory.js.map +1 -0
- package/lib/transpiler/file-container.d.ts +6 -0
- package/lib/transpiler/file-container.js +16 -0
- package/lib/transpiler/file-container.js.map +1 -0
- package/lib/transpiler/generator-choices.d.ts +1 -0
- package/lib/transpiler/generator-choices.js +3 -0
- package/lib/transpiler/generator-choices.js.map +1 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +8 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js +56 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +13 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +1 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +51 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.js +24 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +6 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +14 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -0
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -0
- package/lib/transpiler/openapi/open-api-docs-processor.js +75 -0
- package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -0
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -0
- package/lib/transpiler/openapi/parsers/Builder.js +30 -0
- package/lib/transpiler/openapi/parsers/Builder.js.map +1 -0
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -0
- package/lib/transpiler/openapi/parsers/MethodParser.js +167 -0
- package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -0
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -0
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +11 -0
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +1 -0
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -0
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +226 -0
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -0
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -0
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +20 -0
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js.map +1 -0
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -0
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +22 -0
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +1 -0
- package/lib/transpiler/processor-type-transpiler.d.ts +10 -0
- package/lib/transpiler/processor-type-transpiler.js +9 -0
- package/lib/transpiler/processor-type-transpiler.js.map +1 -0
- package/lib/transpiler/transpiler.d.ts +5 -0
- package/lib/transpiler/transpiler.js +27 -0
- package/lib/transpiler/transpiler.js.map +1 -0
- package/lib/util/error-logger.d.ts +8 -0
- package/lib/util/error-logger.js +90 -0
- package/lib/util/error-logger.js.map +1 -0
- package/lib/util/logger.d.ts +21 -0
- package/lib/util/logger.js +58 -0
- package/lib/util/logger.js.map +1 -0
- package/lib/util/string-utils.d.ts +2 -0
- package/lib/util/string-utils.js +15 -0
- package/lib/util/string-utils.js.map +1 -0
- package/package.json +36 -35
- package/src/application/Apexdocs.ts +70 -17
- package/src/cli/generate.ts +131 -10
- package/src/index.ts +1 -36
- package/src/model/__tests__/manifest-diff.spec.ts +147 -0
- package/src/model/apex-bundle.ts +3 -0
- package/src/{core/openapi → model}/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +3 -3
- package/src/model/inheritance.ts +7 -0
- package/src/model/manifest-diff.ts +94 -0
- package/src/model/manifest.ts +74 -0
- package/src/model/markdown-file.ts +121 -0
- package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +50 -0
- package/src/model/markdown-generation-util/field-declaration-util.ts +71 -0
- package/src/model/markdown-generation-util/index.ts +3 -0
- package/src/model/markdown-generation-util/method-declaration-util.ts +166 -0
- package/src/model/markdown-generation-util/type-declaration-util.ts +91 -0
- package/src/model/markdown-home-file.ts +58 -0
- package/src/model/markdown-type-file.ts +165 -0
- package/src/{core → model}/openapi/open-api-types.ts +2 -2
- package/src/model/openapi/openapi-type-file.ts +14 -0
- package/src/model/outputFile.ts +29 -0
- package/src/{core/openapi → model}/types-repository.ts +9 -0
- package/src/service/__tests__/apex-file-reader.spec.ts +92 -0
- package/src/{core/openapi → service}/__tests__/manifest-factory.spec.ts +2 -1
- package/src/service/apex-file-reader.ts +51 -0
- package/src/service/file-writer.ts +34 -0
- package/src/{core/openapi → service}/manifest-factory.ts +3 -3
- package/src/service/metadata-processor.ts +16 -0
- package/src/{core/openapi → service}/parser.ts +9 -9
- package/src/service/state.ts +24 -0
- package/src/service/walkers/class-walker.ts +30 -0
- package/src/service/walkers/enum-walker.ts +7 -0
- package/src/service/walkers/interface-walker.ts +12 -0
- package/src/service/walkers/walker-factory.ts +19 -0
- package/src/service/walkers/walker.ts +42 -0
- package/src/settings.ts +147 -0
- package/src/test-helpers/ClassMirrorBuilder.ts +1 -14
- package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
- package/src/test-helpers/MethodMirrorBuilder.ts +6 -46
- package/src/test-helpers/SettingsBuilder.ts +4 -1
- package/src/transpiler/factory.ts +33 -0
- package/src/transpiler/file-container.ts +13 -0
- package/src/transpiler/generator-choices.ts +1 -0
- package/src/transpiler/markdown/class-file-generatorHelper.ts +58 -0
- package/src/transpiler/markdown/docsify/docsify-docs-processor.ts +12 -0
- package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +50 -0
- package/src/transpiler/markdown/markdown-transpiler-base.ts +28 -0
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +12 -0
- package/src/{core → transpiler}/openapi/__tests__/open-api-docs-processor.spec.ts +1 -1
- package/src/{core → transpiler}/openapi/open-api-docs-processor.ts +10 -9
- package/src/{core → transpiler}/openapi/parsers/Builder.ts +3 -3
- package/src/{core → transpiler}/openapi/parsers/MethodParser.ts +6 -6
- package/src/{core → transpiler}/openapi/parsers/ParameterObjectBuilder.ts +2 -2
- package/src/{core → transpiler}/openapi/parsers/ReferenceBuilder.ts +6 -7
- package/src/{core → transpiler}/openapi/parsers/RequestBodyBuilder.ts +2 -2
- package/src/{core → transpiler}/openapi/parsers/ResponsesBuilder.ts +2 -2
- package/src/{core → transpiler}/openapi/parsers/__tests__/MethodParser.spec.ts +1 -1
- package/src/{core → transpiler}/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +2 -2
- package/src/{core → transpiler}/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +2 -2
- package/src/{core → transpiler}/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +2 -2
- package/src/{core → transpiler}/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +1 -1
- package/src/transpiler/processor-type-transpiler.ts +18 -0
- package/src/{core/openapi → transpiler}/transpiler.ts +6 -2
- package/src/util/error-logger.ts +4 -4
- package/src/util/logger.ts +6 -6
- package/src/util/string-utils.ts +4 -0
- package/tsconfig.json +3 -8
- package/.github/workflows/ci.yaml +0 -22
- package/__mocks__/chalk.js +0 -12
- package/__mocks__/log-update.js +0 -6
- package/dist/cli/generate.js +0 -2964
- package/dist/defaults-DUwru49Q.js +0 -12
- package/dist/defaults-SH0Rsi5E.js +0 -11
- package/dist/index.d.ts +0 -100
- package/dist/index.js +0 -36
- package/eslint.config.mjs +0 -10
- package/examples/plain-markdown/.forceignore +0 -12
- package/examples/plain-markdown/config/project-scratch-def.json +0 -5
- package/examples/plain-markdown/docs/index.md +0 -109
- package/examples/plain-markdown/docs/miscellaneous/BaseClass.md +0 -16
- package/examples/plain-markdown/docs/miscellaneous/MultiInheritanceClass.md +0 -72
- package/examples/plain-markdown/docs/miscellaneous/ParentInterface.md +0 -15
- package/examples/plain-markdown/docs/miscellaneous/ReferencedEnum.md +0 -8
- package/examples/plain-markdown/docs/miscellaneous/SampleException.md +0 -24
- package/examples/plain-markdown/docs/miscellaneous/SampleInterface.md +0 -112
- package/examples/plain-markdown/docs/miscellaneous/Url.md +0 -309
- package/examples/plain-markdown/docs/sample-enums/SampleEnum.md +0 -36
- package/examples/plain-markdown/docs/samplegroup/SampleClass.md +0 -170
- package/examples/plain-markdown/force-app/classes/BaseClass.cls +0 -3
- package/examples/plain-markdown/force-app/classes/MultiInheritanceClass.cls +0 -1
- package/examples/plain-markdown/force-app/classes/ParentInterface.cls +0 -3
- package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +0 -3
- package/examples/plain-markdown/force-app/classes/SampleClass.cls +0 -72
- package/examples/plain-markdown/force-app/classes/SampleEnum.cls +0 -30
- package/examples/plain-markdown/force-app/classes/SampleException.cls +0 -17
- package/examples/plain-markdown/force-app/classes/SampleInterface.cls +0 -46
- package/examples/plain-markdown/force-app/classes/Url.cls +0 -194
- package/examples/plain-markdown/package-lock.json +0 -665
- package/examples/plain-markdown/package.json +0 -20
- package/examples/plain-markdown/sfdx-project.json +0 -12
- package/examples/vitepress/.forceignore +0 -12
- package/examples/vitepress/apexdocs.config.ts +0 -106
- 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/SampleClass.cls +0 -72
- package/examples/vitepress/force-app/main/default/classes/SampleEnum.cls +0 -30
- package/examples/vitepress/force-app/main/default/classes/SampleException.cls +0 -17
- package/examples/vitepress/force-app/main/default/classes/SampleInterface.cls +0 -46
- package/examples/vitepress/force-app/main/default/classes/Url.cls +0 -198
- 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.d.ts +0 -7
- package/src/application/__tests__/apex-file-reader.spec.ts +0 -104
- package/src/application/apex-file-reader.ts +0 -42
- package/src/application/file-writer.ts +0 -21
- package/src/application/generators/markdown.ts +0 -58
- package/src/application/generators/openapi.ts +0 -56
- package/src/cli/args.ts +0 -43
- package/src/cli/commands/markdown.ts +0 -58
- 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 -735
- package/src/core/markdown/__test__/generating-enum-docs.spec.ts +0 -385
- package/src/core/markdown/__test__/generating-interface-docs.spec.ts +0 -461
- package/src/core/markdown/__test__/generating-reference-guide.spec.ts +0 -180
- package/src/core/markdown/__test__/inheritance-chain.test.ts +0 -54
- package/src/core/markdown/__test__/test-helpers.ts +0 -22
- package/src/core/markdown/adapters/__tests__/documentables.spec.ts +0 -109
- package/src/core/markdown/adapters/__tests__/interface-adapter.spec.ts +0 -147
- 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 -116
- package/src/core/markdown/adapters/fields-and-properties.ts +0 -45
- 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 -35
- package/src/core/markdown/adapters/renderable-bundle.ts +0 -68
- package/src/core/markdown/adapters/renderable-to-page-data.ts +0 -89
- 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 -215
- package/src/core/markdown/reflection/error-handling.ts +0 -37
- 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 -45
- package/src/core/markdown/reflection/sort-members.ts +0 -59
- 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/openapi/file-container.ts +0 -13
- package/src/core/openapi/openapi-type-file.ts +0 -12
- package/src/core/parse-apex-metadata.ts +0 -14
- package/src/core/settings.ts +0 -56
- package/src/core/shared/types.d.ts +0 -130
- package/src/core/shared/utils.ts +0 -5
- package/src/defaults.ts +0 -8
- package/src/test-helpers/InterfaceMirrorBuilder.ts +0 -39
- package/src/util/fp.ts +0 -3
- /package/src/{core/__test__ → model/__tests__}/manifest.spec.ts +0 -0
- /package/src/{core/openapi → model}/apex-type-wrappers/ClassMirrorWrapper.ts +0 -0
- /package/src/{core/openapi → model}/apex-type-wrappers/MethodMirrorWrapper.ts +0 -0
- /package/src/{core → model}/openapi/__tests__/open-api.spec.ts +0 -0
- /package/src/{core → model}/openapi/apex-doc-types.ts +0 -0
- /package/src/{core → model}/openapi/open-api.ts +0 -0
- /package/src/{application → service}/file-system.ts +0 -0
|
@@ -1,735 +0,0 @@
|
|
|
1
|
-
import { assertEither, extendExpect } from './expect-extensions';
|
|
2
|
-
import { apexBundleFromRawString, generateDocs } from './test-helpers';
|
|
3
|
-
|
|
4
|
-
describe('Generates interface documentation', () => {
|
|
5
|
-
beforeAll(() => {
|
|
6
|
-
extendExpect();
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
describe('documentation output', () => {
|
|
10
|
-
it('returns the name of the class', async () => {
|
|
11
|
-
const input = 'public class MyClass {}';
|
|
12
|
-
|
|
13
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
14
|
-
expect(result).documentationBundleHasLength(1);
|
|
15
|
-
assertEither(result, (data) => expect(data.docs[0].filePath).toContain('MyClass'));
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('returns the type as class', async () => {
|
|
19
|
-
const input = 'public class MyClass {}';
|
|
20
|
-
|
|
21
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
22
|
-
expect(result).documentationBundleHasLength(1);
|
|
23
|
-
assertEither(result, (data) => expect(data.docs[0].source.type).toBe('class'));
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('does not return classes out of scope', async () => {
|
|
27
|
-
const input1 = `
|
|
28
|
-
global class MyClass {}
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
const input2 = `
|
|
32
|
-
public class AnotherClass {}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)], {
|
|
36
|
-
scope: ['global'],
|
|
37
|
-
})();
|
|
38
|
-
expect(result).documentationBundleHasLength(1);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('does not return classes that have an @ignore in the docs', async () => {
|
|
42
|
-
const input = `
|
|
43
|
-
/**
|
|
44
|
-
* @ignore
|
|
45
|
-
*/
|
|
46
|
-
public class MyClass {}`;
|
|
47
|
-
|
|
48
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
49
|
-
expect(result).documentationBundleHasLength(0);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('does not return class methods that have @ignore in the docs', async () => {
|
|
53
|
-
const input = `
|
|
54
|
-
public class MyClass {
|
|
55
|
-
/**
|
|
56
|
-
* @ignore
|
|
57
|
-
*/
|
|
58
|
-
public void myMethod() {}
|
|
59
|
-
}`;
|
|
60
|
-
|
|
61
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
62
|
-
expect(result).documentationBundleHasLength(1);
|
|
63
|
-
assertEither(result, (data) => expect(data.docs[0].content).not.toContain('myMethod'));
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('does not return class properties that have @ignore in the docs', async () => {
|
|
67
|
-
const input = `
|
|
68
|
-
public class MyClass {
|
|
69
|
-
/**
|
|
70
|
-
* @ignore
|
|
71
|
-
*/
|
|
72
|
-
public String myProperty { get; set; }
|
|
73
|
-
}`;
|
|
74
|
-
|
|
75
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
76
|
-
expect(result).documentationBundleHasLength(1);
|
|
77
|
-
assertEither(result, (data) => expect(data.docs[0].content).not.toContain('myProperty'));
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('does not return class fields that have @ignore in the docs', async () => {
|
|
81
|
-
const input = `
|
|
82
|
-
public class MyClass {
|
|
83
|
-
/**
|
|
84
|
-
* @ignore
|
|
85
|
-
*/
|
|
86
|
-
public String myField;
|
|
87
|
-
}`;
|
|
88
|
-
|
|
89
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
90
|
-
expect(result).documentationBundleHasLength(1);
|
|
91
|
-
assertEither(result, (data) => expect(data.docs[0].content).not.toContain('myField'));
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('does not return class inner classes that have @ignore in the docs', async () => {
|
|
95
|
-
const input = `
|
|
96
|
-
public class MyClass {
|
|
97
|
-
/**
|
|
98
|
-
* @ignore
|
|
99
|
-
*/
|
|
100
|
-
public class InnerClass {}
|
|
101
|
-
}`;
|
|
102
|
-
|
|
103
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
104
|
-
expect(result).documentationBundleHasLength(1);
|
|
105
|
-
assertEither(result, (data) => expect(data.docs[0].content).not.toContain('InnerClass'));
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('does not return class inner interfaces that have @ignore in the docs', async () => {
|
|
109
|
-
const input = `
|
|
110
|
-
public class MyClass {
|
|
111
|
-
/**
|
|
112
|
-
* @ignore
|
|
113
|
-
*/
|
|
114
|
-
public interface InnerInterface {}
|
|
115
|
-
}`;
|
|
116
|
-
|
|
117
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
118
|
-
expect(result).documentationBundleHasLength(1);
|
|
119
|
-
assertEither(result, (data) => expect(data.docs[0].content).not.toContain('InnerInterface'));
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it('does not return class inner enums that have @ignore in the docs', async () => {
|
|
123
|
-
const input = `
|
|
124
|
-
public class MyClass {
|
|
125
|
-
/**
|
|
126
|
-
* @ignore
|
|
127
|
-
*/
|
|
128
|
-
public enum InnerEnum {}
|
|
129
|
-
}`;
|
|
130
|
-
|
|
131
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
132
|
-
expect(result).documentationBundleHasLength(1);
|
|
133
|
-
assertEither(result, (data) => expect(data.docs[0].content).not.toContain('InnerEnum'));
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
describe('documentation content', () => {
|
|
138
|
-
describe('type level information', () => {
|
|
139
|
-
it('generates a heading with the class name', async () => {
|
|
140
|
-
const input = 'public class MyClass {}';
|
|
141
|
-
|
|
142
|
-
const output = `# MyClass Class`;
|
|
143
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
144
|
-
expect(result).documentationBundleHasLength(1);
|
|
145
|
-
assertEither(result, (data) => expect(data).firstDocContains(output));
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it('displays type level annotations', async () => {
|
|
149
|
-
const input = `
|
|
150
|
-
@NamespaceAccessible
|
|
151
|
-
public class MyClass {
|
|
152
|
-
@Deprecated
|
|
153
|
-
public void myMethod() {}
|
|
154
|
-
}
|
|
155
|
-
`;
|
|
156
|
-
|
|
157
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
158
|
-
expect(result).documentationBundleHasLength(1);
|
|
159
|
-
assertEither(result, (data) => expect(data).firstDocContains('NAMESPACEACCESSIBLE'));
|
|
160
|
-
assertEither(result, (data) => expect(data).firstDocContains('DEPRECATED'));
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it('displays metadata as annotations', async () => {
|
|
164
|
-
const input = 'public class MyClass {}';
|
|
165
|
-
const metadata = `
|
|
166
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
167
|
-
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
168
|
-
<apiVersion>59.0</apiVersion>
|
|
169
|
-
<status>Active</status>
|
|
170
|
-
</ApexClass>
|
|
171
|
-
`;
|
|
172
|
-
|
|
173
|
-
const result = await generateDocs([apexBundleFromRawString(input, metadata)])();
|
|
174
|
-
|
|
175
|
-
expect(result).documentationBundleHasLength(1);
|
|
176
|
-
assertEither(result, (data) => expect(data).firstDocContains('APIVERSION'));
|
|
177
|
-
assertEither(result, (data) => expect(data).firstDocContains('STATUS'));
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it('displays the description', async () => {
|
|
181
|
-
const input = `
|
|
182
|
-
/**
|
|
183
|
-
* This is a description
|
|
184
|
-
*/
|
|
185
|
-
public class MyClass {}
|
|
186
|
-
`;
|
|
187
|
-
|
|
188
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
189
|
-
expect(result).documentationBundleHasLength(1);
|
|
190
|
-
assertEither(result, (data) => expect(data).firstDocContains('This is a description'));
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
it('display custom documentation tags', async () => {
|
|
194
|
-
const input = `
|
|
195
|
-
/**
|
|
196
|
-
* @custom-tag My Value
|
|
197
|
-
*/
|
|
198
|
-
public class MyClass {}
|
|
199
|
-
`;
|
|
200
|
-
|
|
201
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
202
|
-
expect(result).documentationBundleHasLength(1);
|
|
203
|
-
assertEither(result, (data) => expect(data).firstDocContains('Custom Tag'));
|
|
204
|
-
assertEither(result, (data) => expect(data).firstDocContains('My Value'));
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
it('displays the group', async () => {
|
|
208
|
-
const input = `
|
|
209
|
-
/**
|
|
210
|
-
* @group MyGroup
|
|
211
|
-
*/
|
|
212
|
-
public class MyClass {}`;
|
|
213
|
-
|
|
214
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
215
|
-
expect(result).documentationBundleHasLength(1);
|
|
216
|
-
assertEither(result, (data) => expect(data).firstDocContains('Group'));
|
|
217
|
-
assertEither(result, (data) => expect(data).firstDocContains('MyGroup'));
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
it('displays the author', async () => {
|
|
221
|
-
const input = `
|
|
222
|
-
/**
|
|
223
|
-
* @author John Doe
|
|
224
|
-
*/
|
|
225
|
-
public class MyClass {}`;
|
|
226
|
-
|
|
227
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
228
|
-
expect(result).documentationBundleHasLength(1);
|
|
229
|
-
assertEither(result, (data) => expect(data).firstDocContains('Author'));
|
|
230
|
-
assertEither(result, (data) => expect(data).firstDocContains('John Doe'));
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
it('displays the date', async () => {
|
|
234
|
-
const input = `
|
|
235
|
-
/**
|
|
236
|
-
* @date 2021-01-01
|
|
237
|
-
*/
|
|
238
|
-
public class MyClass {}`;
|
|
239
|
-
|
|
240
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
241
|
-
expect(result).documentationBundleHasLength(1);
|
|
242
|
-
assertEither(result, (data) => expect(data).firstDocContains('Date'));
|
|
243
|
-
assertEither(result, (data) => expect(data).firstDocContains('2021-01-01'));
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
it('displays descriptions', async () => {
|
|
247
|
-
const input = `
|
|
248
|
-
/**
|
|
249
|
-
* @description This is a description
|
|
250
|
-
*/
|
|
251
|
-
public class MyClass {}`;
|
|
252
|
-
|
|
253
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
254
|
-
expect(result).documentationBundleHasLength(1);
|
|
255
|
-
assertEither(result, (data) => expect(data).firstDocContains('This is a description'));
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
it('displays descriptions with links', async () => {
|
|
259
|
-
const input1 = `
|
|
260
|
-
/**
|
|
261
|
-
* @description This is a description with a {@link ClassRef} reference
|
|
262
|
-
*/
|
|
263
|
-
public enum MyClass {}
|
|
264
|
-
`;
|
|
265
|
-
|
|
266
|
-
const input2 = 'public class ClassRef {}';
|
|
267
|
-
|
|
268
|
-
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
269
|
-
expect(result).documentationBundleHasLength(2);
|
|
270
|
-
assertEither(result, (data) =>
|
|
271
|
-
expect(data).firstDocContains(
|
|
272
|
-
'This is a description with a [ClassRef](/miscellaneous/ClassRef.md) reference',
|
|
273
|
-
),
|
|
274
|
-
);
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
it('displays descriptions with emails', async () => {
|
|
278
|
-
const input = `
|
|
279
|
-
/**
|
|
280
|
-
* @description This is a description with an {@email test@testerson.com} email
|
|
281
|
-
*/
|
|
282
|
-
public class MyClass {}
|
|
283
|
-
`;
|
|
284
|
-
|
|
285
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
286
|
-
expect(result).documentationBundleHasLength(1);
|
|
287
|
-
assertEither(result, (data) =>
|
|
288
|
-
expect(data).firstDocContains(
|
|
289
|
-
'This is a description with an [test@testerson.com](mailto:test@testerson.com) email',
|
|
290
|
-
),
|
|
291
|
-
);
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
it('displays sees with accurately resolved links', async () => {
|
|
295
|
-
const input1 = `
|
|
296
|
-
/**
|
|
297
|
-
* @see ClassRef
|
|
298
|
-
*/
|
|
299
|
-
public class MyClass {}
|
|
300
|
-
`;
|
|
301
|
-
|
|
302
|
-
const input2 = 'public class ClassRef {}';
|
|
303
|
-
|
|
304
|
-
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
305
|
-
expect(result).documentationBundleHasLength(2);
|
|
306
|
-
assertEither(result, (data) => expect(data).firstDocContains('See'));
|
|
307
|
-
assertEither(result, (data) => expect(data).firstDocContains('[ClassRef](/miscellaneous/ClassRef.md)'));
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
it('displays sees without links when the reference is not found', async () => {
|
|
311
|
-
const input = `
|
|
312
|
-
/**
|
|
313
|
-
* @see ClassRef
|
|
314
|
-
*/
|
|
315
|
-
public class MyClass {}
|
|
316
|
-
`;
|
|
317
|
-
|
|
318
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
319
|
-
expect(result).documentationBundleHasLength(1);
|
|
320
|
-
assertEither(result, (data) => expect(data).firstDocContains('See'));
|
|
321
|
-
assertEither(result, (data) => expect(data).firstDocContains('ClassRef'));
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
it('displays the namespace if present in the config', async () => {
|
|
325
|
-
const input = 'public class MyClass {}';
|
|
326
|
-
|
|
327
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { namespace: 'MyNamespace' })();
|
|
328
|
-
expect(result).documentationBundleHasLength(1);
|
|
329
|
-
assertEither(result, (data) => expect(data).firstDocContains('## Namespace'));
|
|
330
|
-
assertEither(result, (data) => expect(data).firstDocContains('MyNamespace'));
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
it('does not display the namespace if not present in the config', async () => {
|
|
334
|
-
const input = 'public class MyClass {}';
|
|
335
|
-
|
|
336
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
337
|
-
expect(result).documentationBundleHasLength(1);
|
|
338
|
-
assertEither(result, (data) => expect(data).firstDocContainsNot('## Namespace'));
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
it('displays a mermaid diagram', async () => {
|
|
342
|
-
const input = `
|
|
343
|
-
/**
|
|
344
|
-
* @mermaid
|
|
345
|
-
* \`\`\`mermaid
|
|
346
|
-
* graph TD
|
|
347
|
-
* A[Square Rect] -- Link text --> B((Circle))
|
|
348
|
-
* A --> C(Round Rect)
|
|
349
|
-
* B --> D{Rhombus}
|
|
350
|
-
* C --> D
|
|
351
|
-
* \`\`\`
|
|
352
|
-
*/
|
|
353
|
-
public class MyClass {}
|
|
354
|
-
`;
|
|
355
|
-
|
|
356
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
357
|
-
expect(result).documentationBundleHasLength(1);
|
|
358
|
-
assertEither(result, (data) => expect(data).firstDocContains('```mermaid'));
|
|
359
|
-
assertEither(result, (data) => expect(data).firstDocContains('graph TD'));
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
it('displays an example code block', async () => {
|
|
363
|
-
const input = `
|
|
364
|
-
/**
|
|
365
|
-
* @example
|
|
366
|
-
* \`\`\`apex
|
|
367
|
-
* public class MyClass {
|
|
368
|
-
* public void myMethod() {
|
|
369
|
-
* System.debug('Hello, World!');
|
|
370
|
-
* }
|
|
371
|
-
* }
|
|
372
|
-
* \`\`\`
|
|
373
|
-
*/
|
|
374
|
-
public class MyClass {}`;
|
|
375
|
-
|
|
376
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
377
|
-
expect(result).documentationBundleHasLength(1);
|
|
378
|
-
assertEither(result, (data) => expect(data).firstDocContains('```apex'));
|
|
379
|
-
assertEither(result, (data) => expect(data).firstDocContains('public class MyClass'));
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
describe('member information', () => {
|
|
385
|
-
it('displays the Method heading', async () => {
|
|
386
|
-
const input = `
|
|
387
|
-
public class MyClass {
|
|
388
|
-
public void myMethod() {}
|
|
389
|
-
}
|
|
390
|
-
`;
|
|
391
|
-
|
|
392
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
393
|
-
expect(result).documentationBundleHasLength(1);
|
|
394
|
-
assertEither(result, (data) => expect(data).firstDocContains('## Methods'));
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
it('sorts methods when sorting members alphabetically', async () => {
|
|
398
|
-
const input = `
|
|
399
|
-
public class MyClass {
|
|
400
|
-
public void zMethod() {}
|
|
401
|
-
public void aMethod() {}
|
|
402
|
-
}
|
|
403
|
-
`;
|
|
404
|
-
|
|
405
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: true })();
|
|
406
|
-
expect(result).documentationBundleHasLength(1);
|
|
407
|
-
assertEither(result, (data) => {
|
|
408
|
-
const aMethodIndex = data.docs[0].content.indexOf('aMethod');
|
|
409
|
-
const zMethodIndex = data.docs[0].content.indexOf('zMethod');
|
|
410
|
-
expect(aMethodIndex).toBeLessThan(zMethodIndex);
|
|
411
|
-
});
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
it('does not sort methods when not sorting members alphabetically', async () => {
|
|
415
|
-
const input = `
|
|
416
|
-
public class MyClass {
|
|
417
|
-
public void zMethod() {}
|
|
418
|
-
public void aMethod() {}
|
|
419
|
-
}
|
|
420
|
-
`;
|
|
421
|
-
|
|
422
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: false })();
|
|
423
|
-
expect(result).documentationBundleHasLength(1);
|
|
424
|
-
assertEither(result, (data) => {
|
|
425
|
-
const aMethodIndex = data.docs[0].content.indexOf('aMethod');
|
|
426
|
-
const zMethodIndex = data.docs[0].content.indexOf('zMethod');
|
|
427
|
-
expect(aMethodIndex).toBeGreaterThan(zMethodIndex);
|
|
428
|
-
});
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
it('displays the Property heading', async () => {
|
|
432
|
-
const input = `
|
|
433
|
-
public class MyClass {
|
|
434
|
-
public String myProperty { get; set; }
|
|
435
|
-
}
|
|
436
|
-
`;
|
|
437
|
-
|
|
438
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
439
|
-
expect(result).documentationBundleHasLength(1);
|
|
440
|
-
assertEither(result, (data) => expect(data).firstDocContains('## Properties'));
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
it('sorts properties when sorting members alphabetically', async () => {
|
|
444
|
-
const input = `
|
|
445
|
-
public class MyClass {
|
|
446
|
-
public String zProperty { get; set; }
|
|
447
|
-
public String aProperty { get; set; }
|
|
448
|
-
}
|
|
449
|
-
`;
|
|
450
|
-
|
|
451
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: true })();
|
|
452
|
-
expect(result).documentationBundleHasLength(1);
|
|
453
|
-
assertEither(result, (data) => {
|
|
454
|
-
const aPropertyIndex = data.docs[0].content.indexOf('aProperty');
|
|
455
|
-
const zPropertyIndex = data.docs[0].content.indexOf('zProperty');
|
|
456
|
-
expect(aPropertyIndex).toBeLessThan(zPropertyIndex);
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
it('does not sort properties when not sorting members alphabetically', async () => {
|
|
461
|
-
const input = `
|
|
462
|
-
public class MyClass {
|
|
463
|
-
public String zProperty { get; set; }
|
|
464
|
-
public String aProperty { get; set; }
|
|
465
|
-
}
|
|
466
|
-
`;
|
|
467
|
-
|
|
468
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: false })();
|
|
469
|
-
expect(result).documentationBundleHasLength(1);
|
|
470
|
-
assertEither(result, (data) => {
|
|
471
|
-
const aPropertyIndex = data.docs[0].content.indexOf('aProperty');
|
|
472
|
-
const zPropertyIndex = data.docs[0].content.indexOf('zProperty');
|
|
473
|
-
expect(aPropertyIndex).toBeGreaterThan(zPropertyIndex);
|
|
474
|
-
});
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
it('displays the Field heading', async () => {
|
|
478
|
-
const input = `
|
|
479
|
-
public class MyClass {
|
|
480
|
-
public String myField;
|
|
481
|
-
}
|
|
482
|
-
`;
|
|
483
|
-
|
|
484
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
485
|
-
expect(result).documentationBundleHasLength(1);
|
|
486
|
-
assertEither(result, (data) => expect(data).firstDocContains('## Fields'));
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
it('sort fields when sorting members alphabetically', async () => {
|
|
490
|
-
const input = `
|
|
491
|
-
public class MyClass {
|
|
492
|
-
public String zField;
|
|
493
|
-
public String aField;
|
|
494
|
-
}
|
|
495
|
-
`;
|
|
496
|
-
|
|
497
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: true })();
|
|
498
|
-
expect(result).documentationBundleHasLength(1);
|
|
499
|
-
assertEither(result, (data) => {
|
|
500
|
-
const aFieldIndex = data.docs[0].content.indexOf('aField');
|
|
501
|
-
const zFieldIndex = data.docs[0].content.indexOf('zField');
|
|
502
|
-
expect(aFieldIndex).toBeLessThan(zFieldIndex);
|
|
503
|
-
});
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
it('does not sort fields when not sorting members alphabetically', async () => {
|
|
507
|
-
const input = `
|
|
508
|
-
public class MyClass {
|
|
509
|
-
public String zField;
|
|
510
|
-
public String aField;
|
|
511
|
-
}
|
|
512
|
-
`;
|
|
513
|
-
|
|
514
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: false })();
|
|
515
|
-
expect(result).documentationBundleHasLength(1);
|
|
516
|
-
assertEither(result, (data) => {
|
|
517
|
-
const aFieldIndex = data.docs[0].content.indexOf('aField');
|
|
518
|
-
const zFieldIndex = data.docs[0].content.indexOf('zField');
|
|
519
|
-
expect(aFieldIndex).toBeGreaterThan(zFieldIndex);
|
|
520
|
-
});
|
|
521
|
-
});
|
|
522
|
-
|
|
523
|
-
it('displays the Constructor heading', async () => {
|
|
524
|
-
const input = `
|
|
525
|
-
public class MyClass {
|
|
526
|
-
public MyClass() {}
|
|
527
|
-
}
|
|
528
|
-
`;
|
|
529
|
-
|
|
530
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
531
|
-
expect(result).documentationBundleHasLength(1);
|
|
532
|
-
assertEither(result, (data) => expect(data).firstDocContains('## Constructors'));
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
it('displays the Inner Class heading', async () => {
|
|
536
|
-
const input = `
|
|
537
|
-
public class MyClass {
|
|
538
|
-
public class InnerClass {}
|
|
539
|
-
}
|
|
540
|
-
`;
|
|
541
|
-
|
|
542
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
543
|
-
expect(result).documentationBundleHasLength(1);
|
|
544
|
-
assertEither(result, (data) => expect(data).firstDocContains('## Classes'));
|
|
545
|
-
});
|
|
546
|
-
|
|
547
|
-
it('sorts inner classes when sorting members alphabetically', async () => {
|
|
548
|
-
const input = `
|
|
549
|
-
public class MyClass {
|
|
550
|
-
public class ZInnerClass {}
|
|
551
|
-
public class AInnerClass {}
|
|
552
|
-
}
|
|
553
|
-
`;
|
|
554
|
-
|
|
555
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: true })();
|
|
556
|
-
expect(result).documentationBundleHasLength(1);
|
|
557
|
-
assertEither(result, (data) => {
|
|
558
|
-
const aInnerClassIndex = data.docs[0].content.indexOf('AInnerClass');
|
|
559
|
-
const zInnerClassIndex = data.docs[0].content.indexOf('ZInnerClass');
|
|
560
|
-
expect(aInnerClassIndex).toBeLessThan(zInnerClassIndex);
|
|
561
|
-
});
|
|
562
|
-
});
|
|
563
|
-
|
|
564
|
-
it('does not sort inner classes when not sorting members alphabetically', async () => {
|
|
565
|
-
const input = `
|
|
566
|
-
public class MyClass {
|
|
567
|
-
public class ZInnerClass {}
|
|
568
|
-
public class AInnerClass {}
|
|
569
|
-
}
|
|
570
|
-
`;
|
|
571
|
-
|
|
572
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: false })();
|
|
573
|
-
expect(result).documentationBundleHasLength(1);
|
|
574
|
-
assertEither(result, (data) => {
|
|
575
|
-
const aInnerClassIndex = data.docs[0].content.indexOf('AInnerClass');
|
|
576
|
-
const zInnerClassIndex = data.docs[0].content.indexOf('ZInnerClass');
|
|
577
|
-
expect(aInnerClassIndex).toBeGreaterThan(zInnerClassIndex);
|
|
578
|
-
});
|
|
579
|
-
});
|
|
580
|
-
|
|
581
|
-
it('displays the Inner Interface heading', async () => {
|
|
582
|
-
const input = `
|
|
583
|
-
public class MyClass {
|
|
584
|
-
public interface InnerInterface {}
|
|
585
|
-
}
|
|
586
|
-
`;
|
|
587
|
-
|
|
588
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
589
|
-
expect(result).documentationBundleHasLength(1);
|
|
590
|
-
assertEither(result, (data) => expect(data).firstDocContains('## Interfaces'));
|
|
591
|
-
});
|
|
592
|
-
|
|
593
|
-
it('sorts inner interfaces when sorting members alphabetically', async () => {
|
|
594
|
-
const input = `
|
|
595
|
-
public class MyClass {
|
|
596
|
-
public interface ZInnerInterface {}
|
|
597
|
-
public interface AInnerInterface {}
|
|
598
|
-
}
|
|
599
|
-
`;
|
|
600
|
-
|
|
601
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: true })();
|
|
602
|
-
expect(result).documentationBundleHasLength(1);
|
|
603
|
-
assertEither(result, (data) => {
|
|
604
|
-
const aInnerInterfaceIndex = data.docs[0].content.indexOf('AInnerInterface');
|
|
605
|
-
const zInnerInterfaceIndex = data.docs[0].content.indexOf('ZInnerInterface');
|
|
606
|
-
expect(aInnerInterfaceIndex).toBeLessThan(zInnerInterfaceIndex);
|
|
607
|
-
});
|
|
608
|
-
});
|
|
609
|
-
|
|
610
|
-
it('does not sort inner interfaces when not sorting members alphabetically', async () => {
|
|
611
|
-
const input = `
|
|
612
|
-
public class MyClass {
|
|
613
|
-
public interface ZInnerInterface {}
|
|
614
|
-
public interface AInnerInterface {}
|
|
615
|
-
}
|
|
616
|
-
`;
|
|
617
|
-
|
|
618
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: false })();
|
|
619
|
-
expect(result).documentationBundleHasLength(1);
|
|
620
|
-
assertEither(result, (data) => {
|
|
621
|
-
const aInnerInterfaceIndex = data.docs[0].content.indexOf('AInnerInterface');
|
|
622
|
-
const zInnerInterfaceIndex = data.docs[0].content.indexOf('ZInnerInterface');
|
|
623
|
-
expect(aInnerInterfaceIndex).toBeGreaterThan(zInnerInterfaceIndex);
|
|
624
|
-
});
|
|
625
|
-
});
|
|
626
|
-
|
|
627
|
-
it('displays the Inner Enum heading', async () => {
|
|
628
|
-
const input = `
|
|
629
|
-
public class MyClass {
|
|
630
|
-
public enum InnerEnum {}
|
|
631
|
-
}
|
|
632
|
-
`;
|
|
633
|
-
|
|
634
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
635
|
-
expect(result).documentationBundleHasLength(1);
|
|
636
|
-
assertEither(result, (data) => expect(data).firstDocContains('## Enums'));
|
|
637
|
-
});
|
|
638
|
-
|
|
639
|
-
it('sort inner enums when sorting members alphabetically', async () => {
|
|
640
|
-
const input = `
|
|
641
|
-
public class MyClass {
|
|
642
|
-
public enum ZInnerEnum {}
|
|
643
|
-
public enum AInnerEnum {}
|
|
644
|
-
}
|
|
645
|
-
`;
|
|
646
|
-
|
|
647
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: true })();
|
|
648
|
-
expect(result).documentationBundleHasLength(1);
|
|
649
|
-
assertEither(result, (data) => {
|
|
650
|
-
const aInnerEnumIndex = data.docs[0].content.indexOf('AInnerEnum');
|
|
651
|
-
const zInnerEnumIndex = data.docs[0].content.indexOf('ZInnerEnum');
|
|
652
|
-
expect(aInnerEnumIndex).toBeLessThan(zInnerEnumIndex);
|
|
653
|
-
});
|
|
654
|
-
});
|
|
655
|
-
|
|
656
|
-
it('does not sort inner enums when not sorting members alphabetically', async () => {
|
|
657
|
-
const input = `
|
|
658
|
-
public class MyClass {
|
|
659
|
-
public enum ZInnerEnum {}
|
|
660
|
-
public enum AInnerEnum {}
|
|
661
|
-
}
|
|
662
|
-
`;
|
|
663
|
-
|
|
664
|
-
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: false })();
|
|
665
|
-
expect(result).documentationBundleHasLength(1);
|
|
666
|
-
assertEither(result, (data) => {
|
|
667
|
-
const aInnerEnumIndex = data.docs[0].content.indexOf('AInnerEnum');
|
|
668
|
-
const zInnerEnumIndex = data.docs[0].content.indexOf('ZInnerEnum');
|
|
669
|
-
expect(aInnerEnumIndex).toBeGreaterThan(zInnerEnumIndex);
|
|
670
|
-
});
|
|
671
|
-
});
|
|
672
|
-
|
|
673
|
-
it('supports having mermaid diagrams in descriptions', async () => {
|
|
674
|
-
const input = `
|
|
675
|
-
public class MyClass {
|
|
676
|
-
/**
|
|
677
|
-
* @mermaid
|
|
678
|
-
* \`\`\`mermaid
|
|
679
|
-
* graph TD
|
|
680
|
-
* A[Square Rect] -- Link text --> B((Circle))
|
|
681
|
-
* A --> C(Round Rect)
|
|
682
|
-
* B --> D{Rhombus}
|
|
683
|
-
* C --> D
|
|
684
|
-
* \`\`\`
|
|
685
|
-
*/
|
|
686
|
-
public void myMethod() {}
|
|
687
|
-
}
|
|
688
|
-
`;
|
|
689
|
-
|
|
690
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
691
|
-
expect(result).documentationBundleHasLength(1);
|
|
692
|
-
assertEither(result, (data) => expect(data).firstDocContains('```mermaid'));
|
|
693
|
-
assertEither(result, (data) => expect(data).firstDocContains('graph TD'));
|
|
694
|
-
});
|
|
695
|
-
|
|
696
|
-
it('supports having example code blocks in method descriptions', async () => {
|
|
697
|
-
const input = `
|
|
698
|
-
public class MyClass {
|
|
699
|
-
/**
|
|
700
|
-
* @example
|
|
701
|
-
* public class MyClass {
|
|
702
|
-
* public void myMethod() {
|
|
703
|
-
* System.debug('Hello, World!');
|
|
704
|
-
* }
|
|
705
|
-
* }
|
|
706
|
-
*/
|
|
707
|
-
public void myMethod() {}
|
|
708
|
-
}
|
|
709
|
-
`;
|
|
710
|
-
|
|
711
|
-
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
712
|
-
expect(result).documentationBundleHasLength(1);
|
|
713
|
-
assertEither(result, (data) => expect(data).firstDocContains('```apex'));
|
|
714
|
-
assertEither(result, (data) => expect(data).firstDocContains('public class MyClass'));
|
|
715
|
-
});
|
|
716
|
-
|
|
717
|
-
it('displays an "inherited" tag if the method was inherited from a different interface', async () => {
|
|
718
|
-
const input1 = `
|
|
719
|
-
public virtual class MyClass {
|
|
720
|
-
public void myMethod() {}
|
|
721
|
-
}
|
|
722
|
-
`;
|
|
723
|
-
|
|
724
|
-
const input2 = `
|
|
725
|
-
public class AnotherClass extends MyClass {}
|
|
726
|
-
`;
|
|
727
|
-
|
|
728
|
-
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
729
|
-
expect(result).documentationBundleHasLength(2);
|
|
730
|
-
assertEither(result, (data) =>
|
|
731
|
-
expect(data.docs.find((doc) => doc.source.name === 'AnotherClass')?.content).toContain('Inherited'),
|
|
732
|
-
);
|
|
733
|
-
});
|
|
734
|
-
});
|
|
735
|
-
});
|