@cparra/apexdocs 2.25.0-alpha.3 → 2.25.0-alpha.5
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/dist/cli/generate.js +2746 -40
- package/dist/defaults-DUwru49Q.js +12 -0
- package/dist/defaults-SH0Rsi5E.js +11 -0
- package/dist/index.d.ts +62 -2
- package/dist/index.js +36 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.BaseClass.md +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.MultiInheritanceClass.md +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.ParentInterface.md +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.ReferencedEnum.md +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.Url.md +320 -0
- package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +1 -1
- package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +1 -1
- package/examples/plain-markdown/docs/index.md +83 -1
- package/examples/plain-markdown/force-app/classes/Url.cls +194 -0
- package/examples/plain-markdown/package.json +2 -2
- package/examples/vitepress/.forceignore +12 -0
- package/examples/vitepress/apexdocs.config.ts +108 -0
- package/examples/vitepress/config/project-scratch-def.json +13 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js +259 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/_metadata.json +40 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js +11474 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js +9172 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/package.json +3 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4339 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +567 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vue.js +323 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vue.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/config.mts +21 -0
- package/examples/vitepress/docs/.vitepress/sidebar.json +119 -0
- package/examples/vitepress/docs/Miscellaneous/apexdocs.BaseClass.md +20 -0
- package/examples/vitepress/docs/Miscellaneous/apexdocs.MultiInheritanceClass.md +78 -0
- package/examples/vitepress/docs/Miscellaneous/apexdocs.ParentInterface.md +19 -0
- package/examples/vitepress/docs/Miscellaneous/apexdocs.ReferencedEnum.md +15 -0
- package/examples/vitepress/docs/Miscellaneous/apexdocs.SampleException.md +28 -0
- package/examples/vitepress/docs/Miscellaneous/apexdocs.SampleInterface.md +122 -0
- package/examples/vitepress/docs/Miscellaneous/apexdocs.Url.md +318 -0
- package/examples/vitepress/docs/Sample-Enums/apexdocs.SampleEnum.md +41 -0
- package/examples/vitepress/docs/SampleGroup/apexdocs.SampleClass.md +178 -0
- package/examples/vitepress/docs/api-examples.md +49 -0
- package/examples/vitepress/docs/index-frontmatter.md +16 -0
- package/examples/vitepress/docs/index.md +127 -0
- package/examples/vitepress/docs/markdown-examples.md +85 -0
- package/examples/vitepress/force-app/main/default/classes/BaseClass.cls +3 -0
- package/examples/vitepress/force-app/main/default/classes/MultiInheritanceClass.cls +1 -0
- package/examples/vitepress/force-app/main/default/classes/ParentInterface.cls +3 -0
- package/examples/vitepress/force-app/main/default/classes/ReferencedEnum.cls +5 -0
- package/examples/vitepress/force-app/main/default/classes/SampleClass.cls +72 -0
- package/examples/vitepress/force-app/main/default/classes/SampleEnum.cls +30 -0
- package/examples/vitepress/force-app/main/default/classes/SampleException.cls +17 -0
- package/examples/vitepress/force-app/main/default/classes/SampleInterface.cls +46 -0
- package/examples/vitepress/force-app/main/default/classes/Url.cls +195 -0
- package/examples/vitepress/package-lock.json +2574 -0
- package/examples/vitepress/package.json +18 -0
- package/examples/vitepress/sfdx-project.json +12 -0
- package/jest.config.js +1 -0
- package/package.json +10 -6
- package/src/application/Apexdocs.ts +16 -106
- package/src/application/__tests__/apex-file-reader.spec.ts +104 -0
- package/src/application/apex-file-reader.ts +42 -0
- package/src/application/file-writer.ts +25 -0
- package/src/application/generators/markdown.ts +53 -0
- package/src/application/generators/openapi.ts +56 -0
- package/src/cli/args.ts +17 -110
- package/src/cli/commands/markdown.ts +58 -0
- package/src/cli/generate.ts +7 -7
- package/src/{model/__tests__ → core/__test__}/manifest.spec.ts +1 -1
- package/src/core/manifest.ts +57 -51
- package/src/{__spec__/core → core/markdown/__test__}/expect-extensions.ts +5 -5
- package/src/core/markdown/__test__/generating-class-docs.spec.ts +727 -0
- package/src/{__spec__/core → core/markdown/__test__}/generating-enum-docs.spec.ts +82 -59
- package/src/{__spec__/core → core/markdown/__test__}/generating-interface-docs.spec.ts +94 -75
- package/src/core/markdown/__test__/generating-reference-guide.spec.ts +184 -0
- package/src/core/{__test__ → markdown/__test__}/inheritance-chain.test.ts +2 -2
- package/src/core/markdown/__test__/test-helpers.ts +22 -0
- package/src/core/markdown/adapters/__tests__/documentables.spec.ts +109 -0
- package/src/core/{adapters → markdown/adapters}/__tests__/interface-adapter.spec.ts +38 -8
- package/src/core/{adapters → markdown/adapters}/__tests__/references.spec.ts +12 -1
- package/src/core/{adapters → markdown/adapters}/apex-types.ts +8 -5
- package/src/core/{adapters → markdown/adapters}/documentables.ts +2 -62
- package/src/core/{adapters → markdown/adapters}/fields-and-properties.ts +7 -2
- package/src/core/{adapters/references.ts → markdown/adapters/inline.ts} +43 -10
- package/src/core/{adapters → markdown/adapters}/methods-and-constructors.ts +7 -2
- package/src/core/markdown/adapters/renderable-bundle.ts +144 -0
- package/src/core/markdown/adapters/renderable-to-page-data.ts +92 -0
- package/src/core/{adapters → markdown/adapters}/type-utils.ts +5 -1
- package/src/core/{adapters → markdown/adapters}/types.d.ts +24 -3
- package/src/core/markdown/generate-docs.ts +158 -0
- package/src/core/markdown/reflection/error-handling.ts +37 -0
- package/src/core/markdown/reflection/filter-scope.ts +13 -0
- package/src/core/markdown/reflection/inheritance-chain-expanion.ts +22 -0
- package/src/core/markdown/reflection/inherited-member-expansion.ts +105 -0
- package/src/core/markdown/reflection/reflect-source.ts +41 -0
- package/src/core/markdown/reflection/sort-members.ts +59 -0
- package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/class-template.ts +2 -0
- package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/constructors-partial-template.ts +1 -1
- package/src/core/markdown/templates/hookable.ts +7 -0
- package/src/core/{template.ts → markdown/templates/template.ts} +15 -12
- package/src/core/markdown/utils.ts +3 -0
- package/src/{transpiler → core}/openapi/__tests__/open-api-docs-processor.spec.ts +1 -1
- package/src/{model → core/openapi}/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +3 -3
- package/src/core/openapi/file-container.ts +13 -0
- package/src/{service → core/openapi}/manifest-factory.ts +3 -3
- package/src/{transpiler → core}/openapi/open-api-docs-processor.ts +9 -10
- package/src/core/openapi/openapi-type-file.ts +14 -0
- package/src/{service → core/openapi}/parser.ts +8 -8
- package/src/{transpiler → core}/openapi/parsers/Builder.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/MethodParser.ts +5 -5
- package/src/{transpiler → core}/openapi/parsers/ParameterObjectBuilder.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/ReferenceBuilder.ts +3 -3
- package/src/{transpiler → core}/openapi/parsers/RequestBodyBuilder.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/ResponsesBuilder.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/__tests__/MethodParser.spec.ts +1 -1
- package/src/{transpiler → core}/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +1 -1
- package/src/{transpiler → core/openapi}/transpiler.ts +2 -6
- package/src/{model → core/openapi}/types-repository.ts +0 -9
- package/src/core/parse-apex-metadata.ts +14 -0
- package/src/core/settings.ts +56 -0
- package/src/core/shared/types.d.ts +92 -0
- package/src/core/shared/utils.ts +5 -0
- package/src/defaults.ts +8 -0
- package/src/index.ts +34 -2
- package/src/test-helpers/InterfaceMirrorBuilder.ts +0 -5
- package/src/test-helpers/SettingsBuilder.ts +1 -5
- package/src/util/fp.ts +3 -0
- package/src/util/logger.ts +2 -2
- package/src/util/string-utils.ts +0 -4
- package/tsconfig.json +5 -1
- package/apexdocs.config.ts +0 -13
- package/dist/__spec__/core/expect-extensions.d.ts +0 -3
- package/dist/__spec__/core/expect-extensions.js +0 -55
- package/dist/__spec__/core/expect-extensions.js.map +0 -1
- package/dist/__spec__/core/generating-class-docs.spec.d.ts +0 -1
- package/dist/__spec__/core/generating-class-docs.spec.js +0 -444
- package/dist/__spec__/core/generating-class-docs.spec.js.map +0 -1
- package/dist/__spec__/core/generating-enum-docs.spec.d.ts +0 -1
- package/dist/__spec__/core/generating-enum-docs.spec.js +0 -306
- package/dist/__spec__/core/generating-enum-docs.spec.js.map +0 -1
- package/dist/__spec__/core/generating-interface-docs.spec.d.ts +0 -1
- package/dist/__spec__/core/generating-interface-docs.spec.js +0 -364
- package/dist/__spec__/core/generating-interface-docs.spec.js.map +0 -1
- package/dist/__spec__/core/generating-reference-guide.spec.d.ts +0 -1
- package/dist/__spec__/core/generating-reference-guide.spec.js +0 -162
- package/dist/__spec__/core/generating-reference-guide.spec.js.map +0 -1
- package/dist/__spec__/core/test-helpers.d.ts +0 -2
- package/dist/__spec__/core/test-helpers.js +0 -12
- package/dist/__spec__/core/test-helpers.js.map +0 -1
- package/dist/application/Apexdocs.d.ts +0 -15
- package/dist/application/Apexdocs.js +0 -113
- package/dist/application/Apexdocs.js.map +0 -1
- package/dist/application/generators/generate-markdown-files.d.ts +0 -3
- package/dist/application/generators/generate-markdown-files.js +0 -64
- package/dist/application/generators/generate-markdown-files.js.map +0 -1
- package/dist/cli/args.d.ts +0 -39
- package/dist/cli/args.js +0 -154
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/generate.d.ts +0 -2
- package/dist/cli/generate.js.map +0 -1
- package/dist/core/__test__/inheritance-chain.test.d.ts +0 -1
- package/dist/core/__test__/inheritance-chain.test.js +0 -42
- package/dist/core/__test__/inheritance-chain.test.js.map +0 -1
- package/dist/core/adapters/apex-types.d.ts +0 -6
- package/dist/core/adapters/apex-types.js +0 -109
- package/dist/core/adapters/apex-types.js.map +0 -1
- package/dist/core/adapters/documentables.d.ts +0 -7
- package/dist/core/adapters/documentables.js +0 -154
- package/dist/core/adapters/documentables.js.map +0 -1
- package/dist/core/adapters/fields-and-properties.d.ts +0 -3
- package/dist/core/adapters/fields-and-properties.js +0 -37
- package/dist/core/adapters/fields-and-properties.js.map +0 -1
- package/dist/core/adapters/methods-and-constructors.d.ts +0 -5
- package/dist/core/adapters/methods-and-constructors.js +0 -100
- package/dist/core/adapters/methods-and-constructors.js.map +0 -1
- package/dist/core/adapters/references.d.ts +0 -4
- package/dist/core/adapters/references.js +0 -78
- package/dist/core/adapters/references.js.map +0 -1
- package/dist/core/adapters/type-utils.d.ts +0 -3
- package/dist/core/adapters/type-utils.js +0 -12
- package/dist/core/adapters/type-utils.js.map +0 -1
- package/dist/core/apex-bundle.d.ts +0 -6
- package/dist/core/apex-bundle.js +0 -11
- package/dist/core/apex-bundle.js.map +0 -1
- package/dist/core/generate-docs.d.ts +0 -28
- package/dist/core/generate-docs.js +0 -296
- package/dist/core/generate-docs.js.map +0 -1
- package/dist/core/inheritance-chain.d.ts +0 -2
- package/dist/core/inheritance-chain.js +0 -36
- package/dist/core/inheritance-chain.js.map +0 -1
- package/dist/core/manifest.d.ts +0 -22
- package/dist/core/manifest.js +0 -53
- package/dist/core/manifest.js.map +0 -1
- package/dist/core/template.d.ts +0 -10
- package/dist/core/template.js +0 -97
- package/dist/core/template.js.map +0 -1
- package/dist/core/templates/reference-guide.d.ts +0 -1
- package/dist/core/templates/reference-guide.js +0 -18
- package/dist/core/templates/reference-guide.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -7
- package/dist/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -14
- package/dist/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -1
- package/dist/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -7
- package/dist/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -12
- package/dist/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -1
- package/dist/model/markdown-file.d.ts +0 -16
- package/dist/model/markdown-file.js +0 -111
- package/dist/model/markdown-file.js.map +0 -1
- package/dist/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -8
- package/dist/model/markdown-generation-util/doc-comment-annotation-util.js +0 -47
- package/dist/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
- package/dist/model/markdown-generation-util/field-declaration-util.d.ts +0 -3
- package/dist/model/markdown-generation-util/field-declaration-util.js +0 -55
- package/dist/model/markdown-generation-util/field-declaration-util.js.map +0 -1
- package/dist/model/markdown-generation-util/index.d.ts +0 -3
- package/dist/model/markdown-generation-util/index.js +0 -20
- package/dist/model/markdown-generation-util/index.js.map +0 -1
- package/dist/model/markdown-generation-util/method-declaration-util.d.ts +0 -4
- package/dist/model/markdown-generation-util/method-declaration-util.js +0 -115
- package/dist/model/markdown-generation-util/method-declaration-util.js.map +0 -1
- package/dist/model/markdown-generation-util/type-declaration-util.d.ts +0 -3
- package/dist/model/markdown-generation-util/type-declaration-util.js +0 -82
- package/dist/model/markdown-generation-util/type-declaration-util.js.map +0 -1
- package/dist/model/markdown-home-file.d.ts +0 -11
- package/dist/model/markdown-home-file.js +0 -57
- package/dist/model/markdown-home-file.js.map +0 -1
- package/dist/model/markdown-type-file.d.ts +0 -26
- package/dist/model/markdown-type-file.js +0 -137
- package/dist/model/markdown-type-file.js.map +0 -1
- package/dist/model/openapi/apex-doc-types.d.ts +0 -19
- package/dist/model/openapi/apex-doc-types.js +0 -5
- package/dist/model/openapi/apex-doc-types.js.map +0 -1
- package/dist/model/openapi/open-api-types.d.ts +0 -93
- package/dist/model/openapi/open-api-types.js +0 -3
- package/dist/model/openapi/open-api-types.js.map +0 -1
- package/dist/model/openapi/open-api.d.ts +0 -16
- package/dist/model/openapi/open-api.js +0 -34
- package/dist/model/openapi/open-api.js.map +0 -1
- package/dist/model/openapi/openapi-type-file.d.ts +0 -7
- package/dist/model/openapi/openapi-type-file.js +0 -17
- package/dist/model/openapi/openapi-type-file.js.map +0 -1
- package/dist/model/outputFile.d.ts +0 -10
- package/dist/model/outputFile.js +0 -22
- package/dist/model/outputFile.js.map +0 -1
- package/dist/model/types-repository.d.ts +0 -16
- package/dist/model/types-repository.js +0 -54
- package/dist/model/types-repository.js.map +0 -1
- package/dist/service/apex-file-reader.d.ts +0 -14
- package/dist/service/apex-file-reader.js +0 -49
- package/dist/service/apex-file-reader.js.map +0 -1
- package/dist/service/file-system.d.ts +0 -14
- package/dist/service/file-system.js +0 -48
- package/dist/service/file-system.js.map +0 -1
- package/dist/service/file-writer.d.ts +0 -6
- package/dist/service/file-writer.js +0 -57
- package/dist/service/file-writer.js.map +0 -1
- package/dist/service/manifest-factory.d.ts +0 -10
- package/dist/service/manifest-factory.js +0 -17
- package/dist/service/manifest-factory.js.map +0 -1
- package/dist/service/metadata-processor.d.ts +0 -3
- package/dist/service/metadata-processor.js +0 -17
- package/dist/service/metadata-processor.js.map +0 -1
- package/dist/service/parser.d.ts +0 -21
- package/dist/service/parser.js +0 -138
- package/dist/service/parser.js.map +0 -1
- package/dist/service/state.d.ts +0 -9
- package/dist/service/state.js +0 -20
- package/dist/service/state.js.map +0 -1
- package/dist/service/walkers/class-walker.d.ts +0 -4
- package/dist/service/walkers/class-walker.js +0 -33
- package/dist/service/walkers/class-walker.js.map +0 -1
- package/dist/service/walkers/enum-walker.d.ts +0 -4
- package/dist/service/walkers/enum-walker.js +0 -11
- package/dist/service/walkers/enum-walker.js.map +0 -1
- package/dist/service/walkers/interface-walker.d.ts +0 -4
- package/dist/service/walkers/interface-walker.js +0 -15
- package/dist/service/walkers/interface-walker.js.map +0 -1
- package/dist/service/walkers/walker-factory.d.ts +0 -5
- package/dist/service/walkers/walker-factory.js +0 -21
- package/dist/service/walkers/walker-factory.js.map +0 -1
- package/dist/service/walkers/walker.d.ts +0 -19
- package/dist/service/walkers/walker.js +0 -17
- package/dist/service/walkers/walker.js.map +0 -1
- package/dist/settings.d.ts +0 -67
- package/dist/settings.js +0 -92
- package/dist/settings.js.map +0 -1
- package/dist/test-helpers/AnnotationBuilder.d.ts +0 -12
- package/dist/test-helpers/AnnotationBuilder.js +0 -31
- package/dist/test-helpers/AnnotationBuilder.js.map +0 -1
- package/dist/test-helpers/ClassMirrorBuilder.d.ts +0 -22
- package/dist/test-helpers/ClassMirrorBuilder.js +0 -64
- package/dist/test-helpers/ClassMirrorBuilder.js.map +0 -1
- package/dist/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -8
- package/dist/test-helpers/DocCommentAnnotationBuilder.js +0 -26
- package/dist/test-helpers/DocCommentAnnotationBuilder.js.map +0 -1
- package/dist/test-helpers/DocCommentBuilder.d.ts +0 -12
- package/dist/test-helpers/DocCommentBuilder.js +0 -38
- package/dist/test-helpers/DocCommentBuilder.js.map +0 -1
- package/dist/test-helpers/FieldMirrorBuilder.d.ts +0 -18
- package/dist/test-helpers/FieldMirrorBuilder.js +0 -54
- package/dist/test-helpers/FieldMirrorBuilder.js.map +0 -1
- package/dist/test-helpers/InterfaceMirrorBuilder.d.ts +0 -16
- package/dist/test-helpers/InterfaceMirrorBuilder.js +0 -43
- package/dist/test-helpers/InterfaceMirrorBuilder.js.map +0 -1
- package/dist/test-helpers/MethodMirrorBuilder.d.ts +0 -29
- package/dist/test-helpers/MethodMirrorBuilder.js +0 -72
- package/dist/test-helpers/MethodMirrorBuilder.js.map +0 -1
- package/dist/test-helpers/SettingsBuilder.d.ts +0 -8
- package/dist/test-helpers/SettingsBuilder.js +0 -28
- package/dist/test-helpers/SettingsBuilder.js.map +0 -1
- package/dist/transpiler/factory.d.ts +0 -6
- package/dist/transpiler/factory.js +0 -33
- package/dist/transpiler/factory.js.map +0 -1
- package/dist/transpiler/file-container.d.ts +0 -6
- package/dist/transpiler/file-container.js +0 -16
- package/dist/transpiler/file-container.js.map +0 -1
- package/dist/transpiler/generator-choices.d.ts +0 -1
- package/dist/transpiler/generator-choices.js +0 -3
- package/dist/transpiler/generator-choices.js.map +0 -1
- package/dist/transpiler/markdown/class-file-generatorHelper.d.ts +0 -9
- package/dist/transpiler/markdown/class-file-generatorHelper.js +0 -61
- package/dist/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
- package/dist/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -6
- package/dist/transpiler/markdown/docsify/docsify-docs-processor.js +0 -13
- package/dist/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -1
- package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -11
- package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -51
- package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -1
- package/dist/transpiler/markdown/markdown-transpiler-base.d.ts +0 -11
- package/dist/transpiler/markdown/markdown-transpiler-base.js +0 -27
- package/dist/transpiler/markdown/markdown-transpiler-base.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/class-template.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/class-template.js +0 -77
- package/dist/transpiler/markdown/plain-markdown/class-template.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.js +0 -36
- package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.js +0 -30
- package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/enum-template.js +0 -16
- package/dist/transpiler/markdown/plain-markdown/enum-template.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +0 -27
- package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -10
- package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/interface-template.js +0 -20
- package/dist/transpiler/markdown/plain-markdown/interface-template.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/methods-partial-template.js +0 -47
- package/dist/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -1
- package/dist/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -1
- package/dist/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -31
- package/dist/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -1
- package/dist/transpiler/openapi/open-api-docs-processor.d.ts +0 -13
- package/dist/transpiler/openapi/open-api-docs-processor.js +0 -78
- package/dist/transpiler/openapi/open-api-docs-processor.js.map +0 -1
- package/dist/transpiler/openapi/parsers/Builder.d.ts +0 -16
- package/dist/transpiler/openapi/parsers/Builder.js +0 -30
- package/dist/transpiler/openapi/parsers/Builder.js.map +0 -1
- package/dist/transpiler/openapi/parsers/MethodParser.d.ts +0 -20
- package/dist/transpiler/openapi/parsers/MethodParser.js +0 -190
- package/dist/transpiler/openapi/parsers/MethodParser.js.map +0 -1
- package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -7
- package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -11
- package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -1
- package/dist/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -39
- package/dist/transpiler/openapi/parsers/ReferenceBuilder.js +0 -250
- package/dist/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -1
- package/dist/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -10
- package/dist/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -20
- package/dist/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -1
- package/dist/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -7
- package/dist/transpiler/openapi/parsers/ResponsesBuilder.js +0 -22
- package/dist/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -1
- package/dist/transpiler/processor-type-transpiler.d.ts +0 -10
- package/dist/transpiler/processor-type-transpiler.js +0 -9
- package/dist/transpiler/processor-type-transpiler.js.map +0 -1
- package/dist/transpiler/transpiler.d.ts +0 -5
- package/dist/transpiler/transpiler.js +0 -30
- package/dist/transpiler/transpiler.js.map +0 -1
- package/dist/util/error-logger.d.ts +0 -8
- package/dist/util/error-logger.js +0 -90
- package/dist/util/error-logger.js.map +0 -1
- package/dist/util/logger.d.ts +0 -21
- package/dist/util/logger.js +0 -61
- package/dist/util/logger.js.map +0 -1
- package/dist/util/string-utils.d.ts +0 -2
- package/dist/util/string-utils.js +0 -15
- package/dist/util/string-utils.js.map +0 -1
- package/examples/plain-markdown/template.md +0 -3
- package/src/__spec__/core/generating-class-docs.spec.ts +0 -531
- package/src/__spec__/core/generating-reference-guide.spec.ts +0 -164
- package/src/__spec__/core/test-helpers.ts +0 -9
- package/src/application/generators/generate-markdown-files.ts +0 -53
- package/src/core/apex-bundle.ts +0 -3
- package/src/core/generate-docs.ts +0 -432
- package/src/model/markdown-file.ts +0 -122
- package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +0 -50
- package/src/model/markdown-generation-util/field-declaration-util.ts +0 -71
- package/src/model/markdown-generation-util/index.ts +0 -3
- package/src/model/markdown-generation-util/method-declaration-util.ts +0 -166
- package/src/model/markdown-generation-util/type-declaration-util.ts +0 -91
- package/src/model/markdown-home-file.ts +0 -58
- package/src/model/markdown-type-file.ts +0 -169
- package/src/model/openapi/openapi-type-file.ts +0 -14
- package/src/model/outputFile.ts +0 -20
- package/src/service/__tests__/apex-file-reader.spec.ts +0 -93
- package/src/service/apex-file-reader.ts +0 -51
- package/src/service/file-writer.ts +0 -34
- package/src/service/metadata-processor.ts +0 -16
- package/src/service/state.ts +0 -24
- package/src/service/walkers/class-walker.ts +0 -30
- package/src/service/walkers/enum-walker.ts +0 -7
- package/src/service/walkers/interface-walker.ts +0 -12
- package/src/service/walkers/walker-factory.ts +0 -19
- package/src/service/walkers/walker.ts +0 -42
- package/src/settings.ts +0 -153
- package/src/transpiler/factory.ts +0 -31
- package/src/transpiler/file-container.ts +0 -13
- package/src/transpiler/generator-choices.ts +0 -1
- package/src/transpiler/markdown/class-file-generatorHelper.ts +0 -61
- package/src/transpiler/markdown/docsify/docsify-docs-processor.ts +0 -12
- package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +0 -50
- package/src/transpiler/markdown/markdown-transpiler-base.ts +0 -28
- package/src/transpiler/processor-type-transpiler.ts +0 -18
- /package/src/{service → application}/file-system.ts +0 -0
- /package/src/core/{inheritance-chain.ts → markdown/reflection/inheritance-chain.ts} +0 -0
- /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/documentable-partial-template.ts +0 -0
- /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/enum-template.ts +0 -0
- /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/fieldsPartialTemplate.ts +0 -0
- /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/grouped-members-partial-template.ts +0 -0
- /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/interface-template.ts +0 -0
- /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/methods-partial-template.ts +0 -0
- /package/src/core/{templates → markdown/templates}/reference-guide.ts +0 -0
- /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/type-doc-partial.ts +0 -0
- /package/src/{service → core/openapi}/__tests__/manifest-factory.spec.ts +0 -0
- /package/src/{model → core}/openapi/__tests__/open-api.spec.ts +0 -0
- /package/src/{model → core}/openapi/apex-doc-types.ts +0 -0
- /package/src/{model → core/openapi}/apex-type-wrappers/ClassMirrorWrapper.ts +0 -0
- /package/src/{model → core/openapi}/apex-type-wrappers/MethodMirrorWrapper.ts +0 -0
- /package/src/{model → core}/openapi/open-api-types.ts +0 -0
- /package/src/{model → core}/openapi/open-api.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { assertEither, extendExpect } from './expect-extensions';
|
|
2
|
-
import { generateDocs } from '
|
|
3
|
-
import { apexBundleFromRawString } from './test-helpers';
|
|
2
|
+
import { apexBundleFromRawString, generateDocs } from './test-helpers';
|
|
4
3
|
|
|
5
4
|
describe('Generates interface documentation', () => {
|
|
6
5
|
beforeAll(() => {
|
|
@@ -8,39 +7,29 @@ describe('Generates interface documentation', () => {
|
|
|
8
7
|
});
|
|
9
8
|
|
|
10
9
|
describe('documentation output', () => {
|
|
11
|
-
it('
|
|
12
|
-
const input = `
|
|
13
|
-
public interface MyInterface {
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
18
|
-
assertEither(result, (data) => expect(data.format).toBe('markdown'));
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('returns the name of the interface', () => {
|
|
10
|
+
it('returns the name of the interface', async () => {
|
|
22
11
|
const input = `
|
|
23
12
|
public interface MyInterface {
|
|
24
13
|
}
|
|
25
14
|
`;
|
|
26
15
|
|
|
27
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
16
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
28
17
|
expect(result).documentationBundleHasLength(1);
|
|
29
|
-
assertEither(result, (data) => expect(data.docs[0].
|
|
18
|
+
assertEither(result, (data) => expect(data.docs[0].source.name).toBe('MyInterface'));
|
|
30
19
|
});
|
|
31
20
|
|
|
32
|
-
it('returns the type as interface', () => {
|
|
21
|
+
it('returns the type as interface', async () => {
|
|
33
22
|
const input = `
|
|
34
23
|
public interface MyInterface {
|
|
35
24
|
}
|
|
36
25
|
`;
|
|
37
26
|
|
|
38
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
27
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
39
28
|
expect(result).documentationBundleHasLength(1);
|
|
40
|
-
assertEither(result, (data) => expect(data.docs[0].type).toBe('interface'));
|
|
29
|
+
assertEither(result, (data) => expect(data.docs[0].source.type).toBe('interface'));
|
|
41
30
|
});
|
|
42
31
|
|
|
43
|
-
it('does not return interfaces out of scope', () => {
|
|
32
|
+
it('does not return interfaces out of scope', async () => {
|
|
44
33
|
const input1 = `
|
|
45
34
|
global interface MyInterface {}
|
|
46
35
|
`;
|
|
@@ -49,24 +38,24 @@ describe('Generates interface documentation', () => {
|
|
|
49
38
|
public interface AnotherInterface {}
|
|
50
39
|
`;
|
|
51
40
|
|
|
52
|
-
const result = generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)], {
|
|
41
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)], {
|
|
53
42
|
scope: ['global'],
|
|
54
|
-
});
|
|
43
|
+
})();
|
|
55
44
|
expect(result).documentationBundleHasLength(1);
|
|
56
45
|
});
|
|
57
46
|
|
|
58
|
-
it('does not return interfaces that have an @ignore in the docs', () => {
|
|
47
|
+
it('does not return interfaces that have an @ignore in the docs', async () => {
|
|
59
48
|
const input = `
|
|
60
49
|
/**
|
|
61
50
|
* @ignore
|
|
62
51
|
*/
|
|
63
52
|
public interface MyInterface {}`;
|
|
64
53
|
|
|
65
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
54
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
66
55
|
expect(result).documentationBundleHasLength(0);
|
|
67
56
|
});
|
|
68
57
|
|
|
69
|
-
it('does not return interface methods that have @ignore in the docs', () => {
|
|
58
|
+
it('does not return interface methods that have @ignore in the docs', async () => {
|
|
70
59
|
const input = `
|
|
71
60
|
public interface MyInterface {
|
|
72
61
|
/**
|
|
@@ -75,26 +64,26 @@ describe('Generates interface documentation', () => {
|
|
|
75
64
|
void myMethod();
|
|
76
65
|
}`;
|
|
77
66
|
|
|
78
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
67
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
79
68
|
expect(result).documentationBundleHasLength(1);
|
|
80
|
-
assertEither(result, (data) => expect(data.docs[0].
|
|
69
|
+
assertEither(result, (data) => expect(data.docs[0].content).not.toContain('myMethod'));
|
|
81
70
|
});
|
|
82
71
|
});
|
|
83
72
|
|
|
84
73
|
describe('documentation content', () => {
|
|
85
74
|
describe('type level information', () => {
|
|
86
|
-
it('generates a heading with the interface name', () => {
|
|
75
|
+
it('generates a heading with the interface name', async () => {
|
|
87
76
|
const input = `
|
|
88
77
|
public interface MyInterface {}
|
|
89
78
|
`;
|
|
90
79
|
|
|
91
80
|
const output = `# MyInterface Interface`;
|
|
92
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
81
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
93
82
|
expect(result).documentationBundleHasLength(1);
|
|
94
83
|
assertEither(result, (data) => expect(data).firstDocContains(output));
|
|
95
84
|
});
|
|
96
85
|
|
|
97
|
-
it('displays type level annotations', () => {
|
|
86
|
+
it('displays type level annotations', async () => {
|
|
98
87
|
const input = `
|
|
99
88
|
@NamespaceAccessible
|
|
100
89
|
public interface MyInterface {
|
|
@@ -103,13 +92,13 @@ describe('Generates interface documentation', () => {
|
|
|
103
92
|
}
|
|
104
93
|
`;
|
|
105
94
|
|
|
106
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
95
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
107
96
|
expect(result).documentationBundleHasLength(1);
|
|
108
97
|
assertEither(result, (data) => expect(data).firstDocContains('NAMESPACEACCESSIBLE'));
|
|
109
98
|
assertEither(result, (data) => expect(data).firstDocContains('DEPRECATED'));
|
|
110
99
|
});
|
|
111
100
|
|
|
112
|
-
it('displays the description', () => {
|
|
101
|
+
it('displays the description', async () => {
|
|
113
102
|
const input = `
|
|
114
103
|
/**
|
|
115
104
|
* This is a description
|
|
@@ -117,12 +106,12 @@ describe('Generates interface documentation', () => {
|
|
|
117
106
|
public interface MyInterface {}
|
|
118
107
|
`;
|
|
119
108
|
|
|
120
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
109
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
121
110
|
expect(result).documentationBundleHasLength(1);
|
|
122
111
|
assertEither(result, (data) => expect(data).firstDocContains('This is a description'));
|
|
123
112
|
});
|
|
124
113
|
|
|
125
|
-
it('display custom documentation tags', () => {
|
|
114
|
+
it('display custom documentation tags', async () => {
|
|
126
115
|
const input = `
|
|
127
116
|
/**
|
|
128
117
|
* @custom-tag My Value
|
|
@@ -130,64 +119,64 @@ describe('Generates interface documentation', () => {
|
|
|
130
119
|
public interface MyInterface {}
|
|
131
120
|
`;
|
|
132
121
|
|
|
133
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
122
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
134
123
|
expect(result).documentationBundleHasLength(1);
|
|
135
124
|
assertEither(result, (data) => expect(data).firstDocContains('Custom Tag'));
|
|
136
125
|
assertEither(result, (data) => expect(data).firstDocContains('My Value'));
|
|
137
126
|
});
|
|
138
127
|
|
|
139
|
-
it('displays the group', () => {
|
|
128
|
+
it('displays the group', async () => {
|
|
140
129
|
const input = `
|
|
141
130
|
/**
|
|
142
131
|
* @group MyGroup
|
|
143
132
|
*/
|
|
144
133
|
public interface MyInterface {}`;
|
|
145
134
|
|
|
146
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
135
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
147
136
|
expect(result).documentationBundleHasLength(1);
|
|
148
137
|
assertEither(result, (data) => expect(data).firstDocContains('Group'));
|
|
149
138
|
assertEither(result, (data) => expect(data).firstDocContains('MyGroup'));
|
|
150
139
|
});
|
|
151
140
|
|
|
152
|
-
it('displays the author', () => {
|
|
141
|
+
it('displays the author', async () => {
|
|
153
142
|
const input = `
|
|
154
143
|
/**
|
|
155
144
|
* @author John Doe
|
|
156
145
|
*/
|
|
157
146
|
public interface MyInterface {}`;
|
|
158
147
|
|
|
159
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
148
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
160
149
|
expect(result).documentationBundleHasLength(1);
|
|
161
150
|
assertEither(result, (data) => expect(data).firstDocContains('Author'));
|
|
162
151
|
assertEither(result, (data) => expect(data).firstDocContains('John Doe'));
|
|
163
152
|
});
|
|
164
153
|
|
|
165
|
-
it('displays the date', () => {
|
|
154
|
+
it('displays the date', async () => {
|
|
166
155
|
const input = `
|
|
167
156
|
/**
|
|
168
157
|
* @date 2021-01-01
|
|
169
158
|
*/
|
|
170
159
|
public interface MyInterface {}`;
|
|
171
160
|
|
|
172
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
161
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
173
162
|
expect(result).documentationBundleHasLength(1);
|
|
174
163
|
assertEither(result, (data) => expect(data).firstDocContains('Date'));
|
|
175
164
|
assertEither(result, (data) => expect(data).firstDocContains('2021-01-01'));
|
|
176
165
|
});
|
|
177
166
|
|
|
178
|
-
it('displays descriptions', () => {
|
|
167
|
+
it('displays descriptions', async () => {
|
|
179
168
|
const input = `
|
|
180
169
|
/**
|
|
181
170
|
* @description This is a description
|
|
182
171
|
*/
|
|
183
172
|
public interface MyInterface {}`;
|
|
184
173
|
|
|
185
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
174
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
186
175
|
expect(result).documentationBundleHasLength(1);
|
|
187
176
|
assertEither(result, (data) => expect(data).firstDocContains('This is a description'));
|
|
188
177
|
});
|
|
189
178
|
|
|
190
|
-
it('displays descriptions with links', () => {
|
|
179
|
+
it('displays descriptions with links', async () => {
|
|
191
180
|
const input1 = `
|
|
192
181
|
/**
|
|
193
182
|
* @description This is a description with a {@link InterfaceRef} reference
|
|
@@ -197,14 +186,14 @@ describe('Generates interface documentation', () => {
|
|
|
197
186
|
|
|
198
187
|
const input2 = 'public interface InterfaceRef {}';
|
|
199
188
|
|
|
200
|
-
const result = generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)]);
|
|
189
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
201
190
|
expect(result).documentationBundleHasLength(2);
|
|
202
191
|
assertEither(result, (data) =>
|
|
203
192
|
expect(data).firstDocContains('This is a description with a [InterfaceRef](./InterfaceRef.md) reference'),
|
|
204
193
|
);
|
|
205
194
|
});
|
|
206
195
|
|
|
207
|
-
it('displays descriptions with emails', () => {
|
|
196
|
+
it('displays descriptions with emails', async () => {
|
|
208
197
|
const input = `
|
|
209
198
|
/**
|
|
210
199
|
* @description This is a description with an {@email test@testerson.com} email
|
|
@@ -212,7 +201,7 @@ describe('Generates interface documentation', () => {
|
|
|
212
201
|
public interface MyInterface {}
|
|
213
202
|
`;
|
|
214
203
|
|
|
215
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
204
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
216
205
|
expect(result).documentationBundleHasLength(1);
|
|
217
206
|
assertEither(result, (data) =>
|
|
218
207
|
expect(data).firstDocContains(
|
|
@@ -221,7 +210,7 @@ describe('Generates interface documentation', () => {
|
|
|
221
210
|
);
|
|
222
211
|
});
|
|
223
212
|
|
|
224
|
-
it('displays sees with accurately resolved links', () => {
|
|
213
|
+
it('displays sees with accurately resolved links', async () => {
|
|
225
214
|
const input1 = `
|
|
226
215
|
/**
|
|
227
216
|
* @see InterfaceRef
|
|
@@ -231,13 +220,13 @@ describe('Generates interface documentation', () => {
|
|
|
231
220
|
|
|
232
221
|
const input2 = 'public interface InterfaceRef {}';
|
|
233
222
|
|
|
234
|
-
const result = generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)]);
|
|
223
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
235
224
|
expect(result).documentationBundleHasLength(2);
|
|
236
225
|
assertEither(result, (data) => expect(data).firstDocContains('See'));
|
|
237
226
|
assertEither(result, (data) => expect(data).firstDocContains('[InterfaceRef](./InterfaceRef.md)'));
|
|
238
227
|
});
|
|
239
228
|
|
|
240
|
-
it('displays sees without links when the reference is not found', () => {
|
|
229
|
+
it('displays sees without links when the reference is not found', async () => {
|
|
241
230
|
const input = `
|
|
242
231
|
/**
|
|
243
232
|
* @see InterfaceRef
|
|
@@ -245,30 +234,30 @@ describe('Generates interface documentation', () => {
|
|
|
245
234
|
public interface MyInterface {}
|
|
246
235
|
`;
|
|
247
236
|
|
|
248
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
237
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
249
238
|
expect(result).documentationBundleHasLength(1);
|
|
250
239
|
assertEither(result, (data) => expect(data).firstDocContains('See'));
|
|
251
240
|
assertEither(result, (data) => expect(data).firstDocContains('InterfaceRef'));
|
|
252
241
|
});
|
|
253
242
|
|
|
254
|
-
it('displays the namespace if present in the config', () => {
|
|
243
|
+
it('displays the namespace if present in the config', async () => {
|
|
255
244
|
const input = 'public interface MyInterface {}';
|
|
256
245
|
|
|
257
|
-
const result = generateDocs([apexBundleFromRawString(input)], { namespace: 'MyNamespace' });
|
|
246
|
+
const result = await generateDocs([apexBundleFromRawString(input)], { namespace: 'MyNamespace' })();
|
|
258
247
|
expect(result).documentationBundleHasLength(1);
|
|
259
248
|
assertEither(result, (data) => expect(data).firstDocContains('## Namespace'));
|
|
260
249
|
assertEither(result, (data) => expect(data).firstDocContains('MyNamespace'));
|
|
261
250
|
});
|
|
262
251
|
|
|
263
|
-
it('does not display the namespace if not present in the config', () => {
|
|
252
|
+
it('does not display the namespace if not present in the config', async () => {
|
|
264
253
|
const input = 'public interface MyInterface {}';
|
|
265
254
|
|
|
266
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
255
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
267
256
|
expect(result).documentationBundleHasLength(1);
|
|
268
257
|
assertEither(result, (data) => expect(data).firstDocContainsNot('## Namespace'));
|
|
269
258
|
});
|
|
270
259
|
|
|
271
|
-
it('displays a mermaid diagram', () => {
|
|
260
|
+
it('displays a mermaid diagram', async () => {
|
|
272
261
|
const input = `
|
|
273
262
|
/**
|
|
274
263
|
* @mermaid
|
|
@@ -281,13 +270,13 @@ describe('Generates interface documentation', () => {
|
|
|
281
270
|
public interface MyInterface {}
|
|
282
271
|
`;
|
|
283
272
|
|
|
284
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
273
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
285
274
|
expect(result).documentationBundleHasLength(1);
|
|
286
275
|
assertEither(result, (data) => expect(data).firstDocContains('```mermaid'));
|
|
287
276
|
assertEither(result, (data) => expect(data).firstDocContains('graph TD'));
|
|
288
277
|
});
|
|
289
278
|
|
|
290
|
-
it('displays an example code block', () => {
|
|
279
|
+
it('displays an example code block', async () => {
|
|
291
280
|
const input = `
|
|
292
281
|
/**
|
|
293
282
|
* @example
|
|
@@ -299,7 +288,7 @@ describe('Generates interface documentation', () => {
|
|
|
299
288
|
*/
|
|
300
289
|
public interface MyInterface {}`;
|
|
301
290
|
|
|
302
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
291
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
303
292
|
expect(result).documentationBundleHasLength(1);
|
|
304
293
|
assertEither(result, (data) => expect(data).firstDocContains('```apex'));
|
|
305
294
|
assertEither(result, (data) => expect(data).firstDocContains('public class MyClass'));
|
|
@@ -307,19 +296,49 @@ describe('Generates interface documentation', () => {
|
|
|
307
296
|
});
|
|
308
297
|
|
|
309
298
|
describe('method information', () => {
|
|
310
|
-
it('displays the Method heading', () => {
|
|
299
|
+
it('displays the Method heading', async () => {
|
|
311
300
|
const input = `
|
|
312
301
|
public interface MyInterface {
|
|
313
302
|
void myMethod();
|
|
314
303
|
}
|
|
315
304
|
`;
|
|
316
305
|
|
|
317
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
306
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
318
307
|
expect(result).documentationBundleHasLength(1);
|
|
319
308
|
assertEither(result, (data) => expect(data).firstDocContains('## Methods'));
|
|
320
309
|
});
|
|
321
310
|
|
|
322
|
-
it('
|
|
311
|
+
it('displays methods sorted if sortMembersAlphabetically is true', async () => {
|
|
312
|
+
const input = `
|
|
313
|
+
public interface MyInterface {
|
|
314
|
+
void myMethod();
|
|
315
|
+
void anotherMethod();
|
|
316
|
+
}
|
|
317
|
+
`;
|
|
318
|
+
|
|
319
|
+
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: true })();
|
|
320
|
+
expect(result).documentationBundleHasLength(1);
|
|
321
|
+
assertEither(result, (data) => {
|
|
322
|
+
expect(data.docs[0].content.indexOf('anotherMethod')).toBeLessThan(data.docs[0].content.indexOf('myMethod'));
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it('does not display methods sorted if sortMembersAlphabetically is false', async () => {
|
|
327
|
+
const input = `
|
|
328
|
+
public interface MyInterface {
|
|
329
|
+
void myMethod();
|
|
330
|
+
void anotherMethod();
|
|
331
|
+
}
|
|
332
|
+
`;
|
|
333
|
+
|
|
334
|
+
const result = await generateDocs([apexBundleFromRawString(input)], { sortMembersAlphabetically: false })();
|
|
335
|
+
expect(result).documentationBundleHasLength(1);
|
|
336
|
+
assertEither(result, (data) => {
|
|
337
|
+
expect(data.docs[0].content.indexOf('myMethod')).toBeLessThan(data.docs[0].content.indexOf('anotherMethod'));
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it('supports having mermaid diagrams in method descriptions', async () => {
|
|
323
342
|
const input = `
|
|
324
343
|
public interface MyInterface {
|
|
325
344
|
/**
|
|
@@ -334,13 +353,13 @@ describe('Generates interface documentation', () => {
|
|
|
334
353
|
}
|
|
335
354
|
`;
|
|
336
355
|
|
|
337
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
356
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
338
357
|
expect(result).documentationBundleHasLength(1);
|
|
339
358
|
assertEither(result, (data) => expect(data).firstDocContains('```mermaid'));
|
|
340
359
|
assertEither(result, (data) => expect(data).firstDocContains('graph TD'));
|
|
341
360
|
});
|
|
342
361
|
|
|
343
|
-
it('supports having example code blocks in method descriptions', () => {
|
|
362
|
+
it('supports having example code blocks in method descriptions', async () => {
|
|
344
363
|
const input = `
|
|
345
364
|
public interface MyInterface {
|
|
346
365
|
/**
|
|
@@ -355,49 +374,49 @@ describe('Generates interface documentation', () => {
|
|
|
355
374
|
}
|
|
356
375
|
`;
|
|
357
376
|
|
|
358
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
377
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
359
378
|
expect(result).documentationBundleHasLength(1);
|
|
360
379
|
assertEither(result, (data) => expect(data).firstDocContains('```apex'));
|
|
361
380
|
assertEither(result, (data) => expect(data).firstDocContains('public class MyClass'));
|
|
362
381
|
});
|
|
363
382
|
|
|
364
|
-
it('has a signature section', () => {
|
|
383
|
+
it('has a signature section', async () => {
|
|
365
384
|
const input = `
|
|
366
385
|
public interface MyInterface {
|
|
367
386
|
void myMethod();
|
|
368
387
|
}
|
|
369
388
|
`;
|
|
370
389
|
|
|
371
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
390
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
372
391
|
expect(result).documentationBundleHasLength(1);
|
|
373
392
|
assertEither(result, (data) => expect(data).firstDocContains('### Signature'));
|
|
374
393
|
});
|
|
375
394
|
|
|
376
|
-
it('has a parameters section', () => {
|
|
395
|
+
it('has a parameters section', async () => {
|
|
377
396
|
const input = `
|
|
378
397
|
public interface MyInterface {
|
|
379
398
|
void myMethod(String param1, Integer param2);
|
|
380
399
|
}
|
|
381
400
|
`;
|
|
382
401
|
|
|
383
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
402
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
384
403
|
expect(result).documentationBundleHasLength(1);
|
|
385
404
|
assertEither(result, (data) => expect(data).firstDocContains('### Parameters'));
|
|
386
405
|
});
|
|
387
406
|
|
|
388
|
-
it('has a return type section', () => {
|
|
407
|
+
it('has a return type section', async () => {
|
|
389
408
|
const input = `
|
|
390
409
|
public interface MyInterface {
|
|
391
410
|
String myMethod();
|
|
392
411
|
}
|
|
393
412
|
`;
|
|
394
413
|
|
|
395
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
414
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
396
415
|
expect(result).documentationBundleHasLength(1);
|
|
397
416
|
assertEither(result, (data) => expect(data).firstDocContains('### Return Type'));
|
|
398
417
|
});
|
|
399
418
|
|
|
400
|
-
it('has a throws section', () => {
|
|
419
|
+
it('has a throws section', async () => {
|
|
401
420
|
const input = `
|
|
402
421
|
public interface MyInterface {
|
|
403
422
|
/**
|
|
@@ -407,12 +426,12 @@ describe('Generates interface documentation', () => {
|
|
|
407
426
|
}
|
|
408
427
|
`;
|
|
409
428
|
|
|
410
|
-
const result = generateDocs([apexBundleFromRawString(input)]);
|
|
429
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
411
430
|
expect(result).documentationBundleHasLength(1);
|
|
412
431
|
assertEither(result, (data) => expect(data).firstDocContains('### Throws'));
|
|
413
432
|
});
|
|
414
433
|
|
|
415
|
-
it('displays an "inherited" tag if the method was inherited from a different interface', () => {
|
|
434
|
+
it('displays an "inherited" tag if the method was inherited from a different interface', async () => {
|
|
416
435
|
const input1 = `
|
|
417
436
|
public interface MyInterface {
|
|
418
437
|
void myMethod();
|
|
@@ -423,10 +442,10 @@ describe('Generates interface documentation', () => {
|
|
|
423
442
|
public interface AnotherInterface extends MyInterface {}
|
|
424
443
|
`;
|
|
425
444
|
|
|
426
|
-
const result = generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)]);
|
|
445
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
427
446
|
expect(result).documentationBundleHasLength(2);
|
|
428
447
|
assertEither(result, (data) =>
|
|
429
|
-
expect(data.docs.find((doc) => doc.
|
|
448
|
+
expect(data.docs.find((doc) => doc.fileName === 'AnotherInterface')?.content).toContain('Inherited'),
|
|
430
449
|
);
|
|
431
450
|
});
|
|
432
451
|
});
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { assertEither, extendExpect } from './expect-extensions';
|
|
2
|
+
import { pipe } from 'fp-ts/function';
|
|
3
|
+
import * as E from 'fp-ts/Either';
|
|
4
|
+
import { apexBundleFromRawString, generateDocs } from './test-helpers';
|
|
5
|
+
import { ReferenceGuidePageData } from '../../shared/types';
|
|
6
|
+
|
|
7
|
+
describe('Generates a Reference Guide', () => {
|
|
8
|
+
beforeAll(() => {
|
|
9
|
+
extendExpect();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('returns a reference guide with links to all other files', async () => {
|
|
13
|
+
const input1 = `
|
|
14
|
+
public enum MyEnum {
|
|
15
|
+
VALUE1,
|
|
16
|
+
VALUE2
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
const input2 = `
|
|
21
|
+
public class MyClass {}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
25
|
+
expect(result).documentationBundleHasLength(2);
|
|
26
|
+
|
|
27
|
+
assertEither(result, (data) =>
|
|
28
|
+
expect((data.referenceGuide as ReferenceGuidePageData).content).toContain('[MyEnum](./Miscellaneous/MyEnum.md)'),
|
|
29
|
+
);
|
|
30
|
+
assertEither(result, (data) =>
|
|
31
|
+
expect((data.referenceGuide as ReferenceGuidePageData).content).toContain(
|
|
32
|
+
'[MyClass](./Miscellaneous/MyClass.md)',
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('groups things under Miscellaneous if no group is provided', async () => {
|
|
38
|
+
const input = `
|
|
39
|
+
public enum MyEnum {
|
|
40
|
+
VALUE1,
|
|
41
|
+
VALUE2
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
46
|
+
expect(result).documentationBundleHasLength(1);
|
|
47
|
+
assertEither(result, (data) =>
|
|
48
|
+
expect((data.referenceGuide as ReferenceGuidePageData).content).toContain('## Miscellaneous'),
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('group things under the provided group', async () => {
|
|
53
|
+
const input = `
|
|
54
|
+
/**
|
|
55
|
+
* @group MyGroup
|
|
56
|
+
*/
|
|
57
|
+
public enum MyEnum {
|
|
58
|
+
VALUE1,
|
|
59
|
+
VALUE2
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
const result = await generateDocs([apexBundleFromRawString(input)])();
|
|
64
|
+
expect(result).documentationBundleHasLength(1);
|
|
65
|
+
assertEither(result, (data) =>
|
|
66
|
+
expect((data.referenceGuide as ReferenceGuidePageData).content).toContain('## MyGroup'),
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('displays groups in alphabetical order', async () => {
|
|
71
|
+
const input1 = `
|
|
72
|
+
/**
|
|
73
|
+
* @group ZGroup
|
|
74
|
+
*/
|
|
75
|
+
public enum MyEnum {
|
|
76
|
+
VALUE1,
|
|
77
|
+
VALUE2
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
const input2 = `
|
|
82
|
+
/**
|
|
83
|
+
* @group AGroup
|
|
84
|
+
*/
|
|
85
|
+
public class MyClass {}
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
89
|
+
expect(result).documentationBundleHasLength(2);
|
|
90
|
+
pipe(
|
|
91
|
+
result,
|
|
92
|
+
E.map((data) => ({
|
|
93
|
+
aGroupIndex: (data.referenceGuide as ReferenceGuidePageData).content.indexOf('## AGroup'),
|
|
94
|
+
zGroupIndex: (data.referenceGuide as ReferenceGuidePageData).content.indexOf('## ZGroup'),
|
|
95
|
+
})),
|
|
96
|
+
E.match(
|
|
97
|
+
() => fail('Expected data'),
|
|
98
|
+
(data) => expect(data.aGroupIndex).toBeLessThan(data.zGroupIndex),
|
|
99
|
+
),
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('displays references within groups in alphabetical order', async () => {
|
|
104
|
+
const input1 = `
|
|
105
|
+
/**
|
|
106
|
+
* @group Group1
|
|
107
|
+
*/
|
|
108
|
+
public enum MyEnum {
|
|
109
|
+
VALUE1,
|
|
110
|
+
VALUE2
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
const input2 = `
|
|
115
|
+
/**
|
|
116
|
+
* @group Group1
|
|
117
|
+
*/
|
|
118
|
+
public class MyClass {}
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
122
|
+
expect(result).documentationBundleHasLength(2);
|
|
123
|
+
assertEither(result, (data) =>
|
|
124
|
+
expect((data.referenceGuide as ReferenceGuidePageData).content).toContain('## Group1'),
|
|
125
|
+
);
|
|
126
|
+
assertEither(result, (data) =>
|
|
127
|
+
expect((data.referenceGuide as ReferenceGuidePageData).content).toContain('MyClass'),
|
|
128
|
+
);
|
|
129
|
+
assertEither(result, (data) => expect((data.referenceGuide as ReferenceGuidePageData).content).toContain('MyEnum'));
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('returns a reference guide with descriptions', async () => {
|
|
133
|
+
const input1 = `
|
|
134
|
+
/**
|
|
135
|
+
* @description This is a description
|
|
136
|
+
*/
|
|
137
|
+
public enum MyEnum {
|
|
138
|
+
VALUE1,
|
|
139
|
+
VALUE2
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
142
|
+
|
|
143
|
+
const input2 = `
|
|
144
|
+
/**
|
|
145
|
+
* @description This is a description
|
|
146
|
+
*/
|
|
147
|
+
public class MyClass {}
|
|
148
|
+
`;
|
|
149
|
+
|
|
150
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
151
|
+
expect(result).documentationBundleHasLength(2);
|
|
152
|
+
assertEither(result, (data) =>
|
|
153
|
+
expect((data.referenceGuide as ReferenceGuidePageData).content).toContain('This is a description'),
|
|
154
|
+
);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('returns a reference guide with descriptions with links to all other files', async () => {
|
|
158
|
+
const input1 = `
|
|
159
|
+
/**
|
|
160
|
+
* @description This is a description with a {@link MyClass}
|
|
161
|
+
* @group Group1
|
|
162
|
+
*/
|
|
163
|
+
public enum MyEnum {
|
|
164
|
+
VALUE1,
|
|
165
|
+
VALUE2
|
|
166
|
+
}
|
|
167
|
+
`;
|
|
168
|
+
|
|
169
|
+
const input2 = `
|
|
170
|
+
/**
|
|
171
|
+
* @group Group2
|
|
172
|
+
*/
|
|
173
|
+
public class MyClass {}
|
|
174
|
+
`;
|
|
175
|
+
|
|
176
|
+
const result = await generateDocs([apexBundleFromRawString(input1), apexBundleFromRawString(input2)])();
|
|
177
|
+
expect(result).documentationBundleHasLength(2);
|
|
178
|
+
assertEither(result, (data) =>
|
|
179
|
+
expect((data.referenceGuide as ReferenceGuidePageData).content).toContain(
|
|
180
|
+
'with a [MyClass](./Group2/MyClass.md)',
|
|
181
|
+
),
|
|
182
|
+
);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClassMirrorBuilder } from '
|
|
2
|
-
import { createInheritanceChain } from '../inheritance-chain';
|
|
1
|
+
import { ClassMirrorBuilder } from '../../../test-helpers/ClassMirrorBuilder';
|
|
2
|
+
import { createInheritanceChain } from '../reflection/inheritance-chain';
|
|
3
3
|
|
|
4
4
|
describe('inheritance chain for classes', () => {
|
|
5
5
|
test('returns an empty list of the class does not extend any other class', () => {
|