@cparra/apexdocs 2.25.0-alpha.1 → 2.25.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/{lib → dist}/__spec__/core/expect-extensions.js +3 -2
- package/dist/__spec__/core/expect-extensions.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-class-docs.spec.js +54 -37
- package/dist/__spec__/core/generating-class-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-enum-docs.spec.js +25 -22
- package/dist/__spec__/core/generating-enum-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-interface-docs.spec.js +33 -30
- package/dist/__spec__/core/generating-interface-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-reference-guide.spec.js +8 -7
- package/dist/__spec__/core/generating-reference-guide.spec.js.map +1 -0
- package/dist/__spec__/core/test-helpers.d.ts +2 -0
- package/dist/__spec__/core/test-helpers.js +12 -0
- package/dist/__spec__/core/test-helpers.js.map +1 -0
- package/{lib → dist}/application/Apexdocs.d.ts +4 -2
- package/{lib → dist}/application/Apexdocs.js +49 -16
- package/dist/application/Apexdocs.js.map +1 -0
- package/dist/application/generators/generate-markdown-files.d.ts +3 -0
- package/dist/application/generators/generate-markdown-files.js +64 -0
- package/dist/application/generators/generate-markdown-files.js.map +1 -0
- package/dist/cli/args.d.ts +39 -0
- package/{lib/cli/generate.js → dist/cli/args.js} +37 -40
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/generate.js +291 -0
- package/dist/cli/generate.js.map +1 -0
- package/dist/core/__test__/inheritance-chain.test.d.ts +1 -0
- package/dist/core/__test__/inheritance-chain.test.js +42 -0
- package/dist/core/__test__/inheritance-chain.test.js.map +1 -0
- package/dist/core/adapters/apex-types.d.ts +6 -0
- package/{lib → dist/core}/adapters/apex-types.js +18 -21
- package/dist/core/adapters/apex-types.js.map +1 -0
- package/{lib → dist/core}/adapters/documentables.d.ts +1 -1
- package/dist/core/adapters/documentables.js +154 -0
- package/dist/core/adapters/documentables.js.map +1 -0
- package/{lib → dist/core}/adapters/fields-and-properties.d.ts +1 -2
- package/{lib → dist/core}/adapters/fields-and-properties.js +11 -6
- package/dist/core/adapters/fields-and-properties.js.map +1 -0
- package/{lib → dist/core}/adapters/methods-and-constructors.d.ts +1 -1
- package/{lib → dist/core}/adapters/methods-and-constructors.js +24 -16
- package/dist/core/adapters/methods-and-constructors.js.map +1 -0
- package/{lib → dist/core}/adapters/references.d.ts +2 -3
- package/{lib → dist/core}/adapters/references.js +5 -9
- package/dist/core/adapters/references.js.map +1 -0
- package/dist/core/adapters/type-utils.d.ts +3 -0
- package/dist/core/adapters/type-utils.js +12 -0
- package/dist/core/adapters/type-utils.js.map +1 -0
- package/dist/core/apex-bundle.js.map +1 -0
- package/{lib → dist}/core/generate-docs.d.ts +8 -3
- package/{lib → dist}/core/generate-docs.js +79 -24
- package/dist/core/generate-docs.js.map +1 -0
- package/dist/core/inheritance-chain.d.ts +2 -0
- package/{lib/index.js → dist/core/inheritance-chain.js} +11 -4
- package/dist/core/inheritance-chain.js.map +1 -0
- package/dist/core/manifest.js.map +1 -0
- package/{lib → dist}/core/template.js +12 -7
- package/{lib → dist}/core/template.js.map +1 -1
- package/{lib → dist}/core/templates/reference-guide.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/{lib → dist}/model/markdown-file.d.ts +1 -1
- package/{lib → dist}/model/markdown-file.js +1 -1
- package/dist/model/markdown-file.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/doc-comment-annotation-util.js +3 -2
- package/dist/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/field-declaration-util.d.ts +1 -1
- package/{lib → dist}/model/markdown-generation-util/field-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/field-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/method-declaration-util.d.ts +1 -1
- package/{lib → dist}/model/markdown-generation-util/method-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/method-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/type-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/type-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-type-file.d.ts +1 -1
- package/dist/model/markdown-type-file.js.map +1 -0
- package/{lib → dist}/service/apex-file-reader.d.ts +1 -1
- package/{lib → dist}/service/apex-file-reader.js +1 -1
- package/{lib → dist}/service/apex-file-reader.js.map +1 -1
- package/{lib → dist}/service/manifest-factory.d.ts +2 -2
- package/{lib → dist}/service/manifest-factory.js +3 -2
- package/dist/service/manifest-factory.js.map +1 -0
- package/{lib → dist}/service/parser.d.ts +1 -1
- package/{lib → dist}/settings.d.ts +3 -0
- package/{lib → dist}/settings.js +3 -0
- package/{lib → dist}/settings.js.map +1 -1
- package/{lib → dist}/test-helpers/ClassMirrorBuilder.d.ts +4 -0
- package/{lib → dist}/test-helpers/ClassMirrorBuilder.js +11 -1
- package/dist/test-helpers/ClassMirrorBuilder.js.map +1 -0
- package/{lib → dist}/test-helpers/SettingsBuilder.js +1 -0
- package/{lib → dist}/test-helpers/SettingsBuilder.js.map +1 -1
- package/{lib → dist}/transpiler/factory.js +2 -4
- package/dist/transpiler/factory.js.map +1 -0
- package/{lib → dist}/transpiler/markdown/class-file-generatorHelper.d.ts +0 -2
- package/{lib → dist}/transpiler/markdown/class-file-generatorHelper.js +1 -15
- package/dist/transpiler/markdown/class-file-generatorHelper.js.map +1 -0
- package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.js +3 -3
- package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.js +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.js +6 -4
- package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.js +2 -2
- package/{lib → dist}/util/logger.js +1 -1
- package/{lib → dist}/util/logger.js.map +1 -1
- package/{lib → dist}/util/string-utils.js +2 -2
- package/{lib → dist}/util/string-utils.js.map +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.MultiInheritanceClass.md +73 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +19 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +6 -2
- package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +3 -1
- package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +2 -2
- package/examples/plain-markdown/docs/index.md +12 -13
- package/examples/plain-markdown/force-app/classes/MultiInheritanceClass.cls +1 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +16 -0
- package/jest.config.js +1 -1
- package/package.json +13 -15
- package/src/__spec__/core/generating-class-docs.spec.ts +57 -37
- package/src/__spec__/core/generating-enum-docs.spec.ts +25 -22
- package/src/__spec__/core/generating-interface-docs.spec.ts +33 -30
- package/src/__spec__/core/generating-reference-guide.spec.ts +8 -7
- package/src/__spec__/core/test-helpers.ts +9 -0
- package/src/application/Apexdocs.ts +56 -19
- package/src/application/generators/generate-markdown-files.ts +53 -0
- package/src/cli/args.ts +136 -0
- package/src/cli/generate.ts +11 -135
- package/src/core/__test__/inheritance-chain.test.ts +54 -0
- package/src/{adapters → core/adapters}/__tests__/interface-adapter.spec.ts +13 -11
- package/src/{adapters → core/adapters}/__tests__/references.spec.ts +11 -1
- package/src/{adapters → core/adapters}/apex-types.ts +54 -44
- package/src/core/adapters/documentables.ts +195 -0
- package/src/{adapters → core/adapters}/fields-and-properties.ts +13 -11
- package/src/{adapters → core/adapters}/methods-and-constructors.ts +31 -20
- package/src/{adapters → core/adapters}/references.ts +3 -6
- package/src/core/adapters/type-utils.ts +9 -0
- package/src/core/{renderable → adapters}/types.d.ts +36 -5
- package/src/core/generate-docs.ts +106 -31
- package/src/core/inheritance-chain.ts +23 -0
- package/src/core/template.ts +12 -9
- package/src/core/templates/reference-guide.ts +1 -1
- package/src/model/__tests__/manifest.spec.ts +1 -1
- package/src/model/markdown-file.ts +1 -1
- package/src/model/markdown-generation-util/field-declaration-util.ts +1 -1
- package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
- package/src/model/markdown-type-file.ts +5 -1
- package/src/service/__tests__/apex-file-reader.spec.ts +1 -0
- package/src/service/apex-file-reader.ts +1 -1
- package/src/service/manifest-factory.ts +2 -2
- package/src/service/parser.ts +1 -1
- package/src/settings.ts +6 -0
- package/src/test-helpers/ClassMirrorBuilder.ts +14 -1
- package/src/test-helpers/SettingsBuilder.ts +1 -0
- package/src/transpiler/factory.ts +2 -4
- package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -18
- package/src/transpiler/markdown/plain-markdown/class-template.ts +3 -3
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +1 -1
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +6 -4
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +1 -1
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +2 -2
- package/src/util/logger.ts +1 -1
- package/tsconfig.json +1 -1
- package/docs/.nojekyll +0 -0
- package/docs/__old/README.md +0 -1
- package/docs/__old/index.html +0 -22
- package/docs/__old/restapi.json +0 -589
- package/docs/__old/types/Classes/nspc.AnotherInterface.md +0 -22
- package/docs/__old/types/Classes/nspc.ChildClass.md +0 -97
- package/docs/__old/types/Main/nspc.GroupedClass.md +0 -10
- package/docs/__old/types/Main/nspc.SampleClass.md +0 -189
- package/docs/__old/types/Misc-Group/nspc.EscapedAnnotations.md +0 -4
- package/docs/__old/types/Misc-Group/nspc.GrandparentClass.md +0 -13
- package/docs/__old/types/Misc-Group/nspc.InterfaceWithInheritance.md +0 -29
- package/docs/__old/types/Misc-Group/nspc.MemberGrouping.md +0 -13
- package/docs/__old/types/Misc-Group/nspc.ParentClass.md +0 -37
- package/docs/__old/types/Misc-Group/nspc.Reference1.md +0 -18
- package/docs/__old/types/Misc-Group/nspc.Reference2.md +0 -12
- package/docs/__old/types/Misc-Group/nspc.Reference3.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference4.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference5.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference6.md +0 -9
- package/docs/__old/types/Misc-Group/nspc.Reference7.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -11
- package/docs/__old/types/Misc-Group/nspc.SampleRestResource.md +0 -104
- package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -33
- package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -14
- package/docs/__old/types/README.md +0 -97
- package/docs/__old/types/Sample-Interfaces/nspc.SampleInterface.md +0 -23
- package/examples/includes/header.md +0 -3
- package/lib/__spec__/core/expect-extensions.js.map +0 -1
- package/lib/__spec__/core/generating-class-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-enum-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-interface-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-reference-guide.spec.js.map +0 -1
- package/lib/adapters/apex-types.d.ts +0 -7
- package/lib/adapters/apex-types.js.map +0 -1
- package/lib/adapters/documentables.js +0 -56
- package/lib/adapters/documentables.js.map +0 -1
- package/lib/adapters/fields-and-properties.js.map +0 -1
- package/lib/adapters/methods-and-constructors.js.map +0 -1
- package/lib/adapters/references.js.map +0 -1
- package/lib/adapters/type-utils.d.ts +0 -2
- package/lib/adapters/type-utils.js +0 -7
- package/lib/adapters/type-utils.js.map +0 -1
- package/lib/application/Apexdocs.js.map +0 -1
- package/lib/cli/generate.js.map +0 -1
- package/lib/core/generate-docs.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/model/apex-bundle.js.map +0 -1
- package/lib/model/inheritance.d.ts +0 -8
- package/lib/model/inheritance.js +0 -3
- package/lib/model/inheritance.js.map +0 -1
- package/lib/model/manifest.js.map +0 -1
- package/lib/model/markdown-file.js.map +0 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +0 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +0 -1
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +0 -1
- package/lib/model/markdown-type-file.js.map +0 -1
- package/lib/service/manifest-factory.js.map +0 -1
- package/lib/test-helpers/ClassMirrorBuilder.js.map +0 -1
- package/lib/transpiler/factory.js.map +0 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -9
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +0 -42
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +0 -1
- package/src/adapters/documentables.ts +0 -93
- package/src/adapters/type-utils.ts +0 -5
- package/src/adapters/types.d.ts +0 -8
- package/src/model/inheritance.ts +0 -7
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +0 -42
- /package/{lib → dist}/__spec__/core/expect-extensions.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-class-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-enum-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-interface-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-reference-guide.spec.d.ts +0 -0
- /package/{lib → dist}/cli/generate.d.ts +0 -0
- /package/{lib/model → dist/core}/apex-bundle.d.ts +0 -0
- /package/{lib/model → dist/core}/apex-bundle.js +0 -0
- /package/{lib/model → dist/core}/manifest.d.ts +0 -0
- /package/{lib/model → dist/core}/manifest.js +0 -0
- /package/{lib → dist}/core/template.d.ts +0 -0
- /package/{lib → dist}/core/templates/reference-guide.d.ts +0 -0
- /package/{lib → dist}/core/templates/reference-guide.js.map +0 -0
- /package/{lib → dist}/index.js.map +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -0
- /package/{lib → dist}/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.d.ts +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.js +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.js.map +0 -0
- /package/{lib → dist}/model/markdown-generation-util/type-declaration-util.d.ts +0 -0
- /package/{lib → dist}/model/markdown-home-file.d.ts +0 -0
- /package/{lib → dist}/model/markdown-home-file.js +0 -0
- /package/{lib → dist}/model/markdown-home-file.js.map +0 -0
- /package/{lib → dist}/model/markdown-type-file.js +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.d.ts +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.js +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.js.map +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.d.ts +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.js +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.js.map +0 -0
- /package/{lib → dist}/model/openapi/open-api.d.ts +0 -0
- /package/{lib → dist}/model/openapi/open-api.js +0 -0
- /package/{lib → dist}/model/openapi/open-api.js.map +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.d.ts +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.js +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.js.map +0 -0
- /package/{lib → dist}/model/outputFile.d.ts +0 -0
- /package/{lib → dist}/model/outputFile.js +0 -0
- /package/{lib → dist}/model/outputFile.js.map +0 -0
- /package/{lib → dist}/model/types-repository.d.ts +0 -0
- /package/{lib → dist}/model/types-repository.js +0 -0
- /package/{lib → dist}/model/types-repository.js.map +0 -0
- /package/{lib → dist}/service/file-system.d.ts +0 -0
- /package/{lib → dist}/service/file-system.js +0 -0
- /package/{lib → dist}/service/file-system.js.map +0 -0
- /package/{lib → dist}/service/file-writer.d.ts +0 -0
- /package/{lib → dist}/service/file-writer.js +0 -0
- /package/{lib → dist}/service/file-writer.js.map +0 -0
- /package/{lib → dist}/service/metadata-processor.d.ts +0 -0
- /package/{lib → dist}/service/metadata-processor.js +0 -0
- /package/{lib → dist}/service/metadata-processor.js.map +0 -0
- /package/{lib → dist}/service/parser.js +0 -0
- /package/{lib → dist}/service/parser.js.map +0 -0
- /package/{lib → dist}/service/state.d.ts +0 -0
- /package/{lib → dist}/service/state.js +0 -0
- /package/{lib → dist}/service/state.js.map +0 -0
- /package/{lib → dist}/service/walkers/class-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/class-walker.js +0 -0
- /package/{lib → dist}/service/walkers/class-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.js +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.js +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.d.ts +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.js +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.js.map +0 -0
- /package/{lib → dist}/service/walkers/walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/walker.js +0 -0
- /package/{lib → dist}/service/walkers/walker.js.map +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/SettingsBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/factory.d.ts +0 -0
- /package/{lib → dist}/transpiler/file-container.d.ts +0 -0
- /package/{lib → dist}/transpiler/file-container.js +0 -0
- /package/{lib → dist}/transpiler/file-container.js.map +0 -0
- /package/{lib → dist}/transpiler/generator-choices.d.ts +0 -0
- /package/{lib → dist}/transpiler/generator-choices.js +0 -0
- /package/{lib → dist}/transpiler/generator-choices.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.js +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.js +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.js +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.d.ts +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.js +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.js.map +0 -0
- /package/{lib → dist}/transpiler/transpiler.d.ts +0 -0
- /package/{lib → dist}/transpiler/transpiler.js +0 -0
- /package/{lib → dist}/transpiler/transpiler.js.map +0 -0
- /package/{lib → dist}/util/error-logger.d.ts +0 -0
- /package/{lib → dist}/util/error-logger.js +0 -0
- /package/{lib → dist}/util/error-logger.js.map +0 -0
- /package/{lib → dist}/util/logger.d.ts +0 -0
- /package/{lib → dist}/util/string-utils.d.ts +0 -0
- /package/src/{model → core}/apex-bundle.ts +0 -0
- /package/src/{model → core}/manifest.ts +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { CustomTag, RenderableDocumentation, RenderableContent, CodeBlock } from './types';
|
|
2
|
+
import { Describable, Documentable } from './types';
|
|
3
|
+
import { GetRenderableContentByTypeName, replaceInlineReferences } from './references';
|
|
4
|
+
import { isEmptyLine } from './type-utils';
|
|
5
|
+
|
|
6
|
+
export function adaptDescribable(
|
|
7
|
+
describable: Describable,
|
|
8
|
+
linkGenerator: GetRenderableContentByTypeName,
|
|
9
|
+
): {
|
|
10
|
+
description?: RenderableContent[];
|
|
11
|
+
} {
|
|
12
|
+
function describableToRenderableContent(describable: Describable): RenderableContent[] | undefined {
|
|
13
|
+
if (!describable) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let content: RenderableContent[] = [];
|
|
18
|
+
for (let i = 0; i < describable.length; i++) {
|
|
19
|
+
const line = describable[i];
|
|
20
|
+
// The language might or might not be present after ```
|
|
21
|
+
const codeBlockMatch = line.match(/^```([a-zA-Z]*)$/);
|
|
22
|
+
if (codeBlockMatch) {
|
|
23
|
+
// Check if the language is present, if not, fallback to "apex"
|
|
24
|
+
const language = codeBlockMatch[1] || 'apex';
|
|
25
|
+
const codeBlockLines: string[] = [];
|
|
26
|
+
i++;
|
|
27
|
+
while (i < describable.length) {
|
|
28
|
+
const currentLine = describable[i];
|
|
29
|
+
if (currentLine.trim() === '```') {
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
codeBlockLines.push(currentLine);
|
|
33
|
+
i++;
|
|
34
|
+
}
|
|
35
|
+
console.log('codeBlockLines', codeBlockLines);
|
|
36
|
+
content = [
|
|
37
|
+
...content,
|
|
38
|
+
{
|
|
39
|
+
__type: 'code-block',
|
|
40
|
+
language,
|
|
41
|
+
content: codeBlockLines,
|
|
42
|
+
},
|
|
43
|
+
{ __type: 'empty-line' },
|
|
44
|
+
];
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
content = [
|
|
49
|
+
...content,
|
|
50
|
+
...replaceInlineReferences(line, linkGenerator),
|
|
51
|
+
{
|
|
52
|
+
__type: 'empty-line',
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
return (
|
|
57
|
+
content
|
|
58
|
+
.flatMap((line) => line)
|
|
59
|
+
// If the last element is an empty line, remove it
|
|
60
|
+
.filter((line, index, lines) => !(isEmptyLine(line) && index === lines.length - 1))
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// TODO: Now we want to also extract code blocks if we encounter any line that starts with "```"
|
|
64
|
+
|
|
65
|
+
// return describable.reduce<RenderableContent[]>(
|
|
66
|
+
// (acc, line) => {
|
|
67
|
+
// if (line.trim() === '') {
|
|
68
|
+
// return [...acc, { __type: 'empty-line' }];
|
|
69
|
+
// }
|
|
70
|
+
//
|
|
71
|
+
// // The language might or might not be present after ```
|
|
72
|
+
// const codeBlockMatch = line.match(/^```([a-zA-Z]*)$/);
|
|
73
|
+
// if (codeBlockMatch) {
|
|
74
|
+
// console.log('codeBlockMatch', codeBlockMatch);
|
|
75
|
+
// // Check if the language is present, if not, fallback to "apex"
|
|
76
|
+
// const language = codeBlockMatch[1] || 'apex';
|
|
77
|
+
// const codeBlockLines: string[] = [];
|
|
78
|
+
// let index = acc.length + 1;
|
|
79
|
+
// while (index < describable.length) {
|
|
80
|
+
// const currentLine = describable[index];
|
|
81
|
+
// if (currentLine.trim() === '```') {
|
|
82
|
+
// break;
|
|
83
|
+
// }
|
|
84
|
+
// codeBlockLines.push(currentLine);
|
|
85
|
+
// index++;
|
|
86
|
+
// }
|
|
87
|
+
// return [
|
|
88
|
+
// ...acc,
|
|
89
|
+
// {
|
|
90
|
+
// __type: 'code-block',
|
|
91
|
+
// language,
|
|
92
|
+
// content: codeBlockLines,
|
|
93
|
+
// },
|
|
94
|
+
// ];
|
|
95
|
+
// }
|
|
96
|
+
//
|
|
97
|
+
// return [
|
|
98
|
+
// ...acc,
|
|
99
|
+
// ...replaceInlineReferences(line, linkGenerator),
|
|
100
|
+
// {
|
|
101
|
+
// __type: 'empty-line',
|
|
102
|
+
// },
|
|
103
|
+
// ];
|
|
104
|
+
// },
|
|
105
|
+
// <RenderableContent[]>[],
|
|
106
|
+
// );
|
|
107
|
+
|
|
108
|
+
// return (
|
|
109
|
+
// describable
|
|
110
|
+
// .map<RenderableContent[]>((line) => [
|
|
111
|
+
// ...replaceInlineReferences(line, linkGenerator),
|
|
112
|
+
// {
|
|
113
|
+
// __type: 'empty-line',
|
|
114
|
+
// },
|
|
115
|
+
// ])
|
|
116
|
+
// .flatMap((line) => line)
|
|
117
|
+
// // If the last element is an empty line, remove it
|
|
118
|
+
// .filter((line, index, lines) => !(isEmptyLine(line) && index === lines.length - 1))
|
|
119
|
+
// );
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
description: describableToRenderableContent(describable),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function adaptDocumentable(
|
|
128
|
+
documentable: Documentable,
|
|
129
|
+
linkGenerator: GetRenderableContentByTypeName,
|
|
130
|
+
subHeadingLevel: number,
|
|
131
|
+
): RenderableDocumentation {
|
|
132
|
+
function extractCustomTags(type: Documentable): CustomTag[] {
|
|
133
|
+
const baseTags = ['description', 'group', 'author', 'date', 'see', 'example', 'mermaid', 'throws', 'exception'];
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
type.docComment?.annotations
|
|
137
|
+
.filter((currentAnnotation) => !baseTags.includes(currentAnnotation.name.toLowerCase()))
|
|
138
|
+
.map<CustomTag>((currentAnnotation) => ({
|
|
139
|
+
...adaptDescribable(currentAnnotation.bodyLines, linkGenerator),
|
|
140
|
+
name: currentAnnotation.name,
|
|
141
|
+
})) ?? []
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function extractAnnotationBodyLines(type: Documentable, annotationName: string): string[] | undefined {
|
|
146
|
+
return type.docComment?.annotations.find(
|
|
147
|
+
(currentAnnotation) => currentAnnotation.name.toLowerCase() === annotationName,
|
|
148
|
+
)?.bodyLines;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function extractAnnotationBody(type: Documentable, annotationName: string): string | undefined {
|
|
152
|
+
return type.docComment?.annotations.find(
|
|
153
|
+
(currentAnnotation) => currentAnnotation.name.toLowerCase() === annotationName,
|
|
154
|
+
)?.body;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function extractSeeAnnotations(type: Documentable): string[] {
|
|
158
|
+
return (
|
|
159
|
+
type.docComment?.annotations
|
|
160
|
+
.filter((currentAnnotation) => currentAnnotation.name.toLowerCase() === 'see')
|
|
161
|
+
.map((currentAnnotation) => currentAnnotation.body) ?? []
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function bodyLinesToCodeBlock(language: string, bodyLines: string[] | undefined): CodeBlock | undefined {
|
|
166
|
+
if (!bodyLines) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
__type: 'code-block',
|
|
171
|
+
language,
|
|
172
|
+
content: bodyLines,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
...adaptDescribable(documentable.docComment?.descriptionLines, linkGenerator),
|
|
178
|
+
annotations: documentable.annotations.map((annotation) => annotation.type.toUpperCase()),
|
|
179
|
+
customTags: extractCustomTags(documentable),
|
|
180
|
+
mermaid: {
|
|
181
|
+
headingLevel: subHeadingLevel,
|
|
182
|
+
heading: 'Diagram',
|
|
183
|
+
value: bodyLinesToCodeBlock('mermaid', extractAnnotationBodyLines(documentable, 'mermaid')),
|
|
184
|
+
},
|
|
185
|
+
example: {
|
|
186
|
+
headingLevel: subHeadingLevel,
|
|
187
|
+
heading: 'Example',
|
|
188
|
+
value: bodyLinesToCodeBlock('apex', documentable.docComment?.exampleAnnotation?.bodyLines),
|
|
189
|
+
},
|
|
190
|
+
group: extractAnnotationBody(documentable, 'group'),
|
|
191
|
+
author: extractAnnotationBody(documentable, 'author'),
|
|
192
|
+
date: extractAnnotationBody(documentable, 'date'),
|
|
193
|
+
sees: extractSeeAnnotations(documentable).map(linkGenerator),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { FieldMirrorWithInheritance, PropertyMirrorWithInheritance } from '
|
|
2
|
-
import { RenderableField } from '../core/renderable/types';
|
|
1
|
+
import { CodeBlock, FieldMirrorWithInheritance, PropertyMirrorWithInheritance, RenderableField } from './types';
|
|
3
2
|
import { adaptDocumentable } from './documentables';
|
|
4
|
-
import { GetRenderableContentByTypeName
|
|
3
|
+
import { GetRenderableContentByTypeName } from './references';
|
|
5
4
|
|
|
6
5
|
export function adaptFieldOrProperty(
|
|
7
6
|
field: FieldMirrorWithInheritance | PropertyMirrorWithInheritance,
|
|
8
7
|
linkGenerator: GetRenderableContentByTypeName,
|
|
9
8
|
baseHeadingLevel: number,
|
|
10
9
|
): RenderableField {
|
|
11
|
-
function buildSignature() {
|
|
10
|
+
function buildSignature(): CodeBlock {
|
|
12
11
|
const { access_modifier, name } = field;
|
|
13
12
|
const memberModifiers = field.memberModifiers.join(' ');
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const codeContents = `${access_modifier} ${memberModifiers} ${name}`
|
|
14
|
+
// remove double spaces
|
|
15
|
+
.replace(/ {2}/g, ' ');
|
|
16
|
+
return {
|
|
17
|
+
__type: 'code-block',
|
|
18
|
+
language: 'apex',
|
|
19
|
+
content: [codeContents],
|
|
20
|
+
};
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
return {
|
|
@@ -25,14 +27,14 @@ export function adaptFieldOrProperty(
|
|
|
25
27
|
type: {
|
|
26
28
|
headingLevel: baseHeadingLevel + 1,
|
|
27
29
|
heading: 'Type',
|
|
28
|
-
value:
|
|
30
|
+
value: linkGenerator(field.typeReference.rawDeclaration),
|
|
29
31
|
},
|
|
30
32
|
inherited: field.inherited,
|
|
31
33
|
accessModifier: field.access_modifier,
|
|
32
34
|
signature: {
|
|
33
35
|
headingLevel: baseHeadingLevel + 1,
|
|
34
36
|
heading: 'Signature',
|
|
35
|
-
value:
|
|
37
|
+
value: buildSignature(),
|
|
36
38
|
},
|
|
37
39
|
};
|
|
38
40
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ConstructorMirror, MethodMirror, ParameterMirror, ThrowsAnnotation } from '@cparra/apex-reflection';
|
|
2
|
-
import { RenderableConstructor, RenderableMethod } from '
|
|
3
|
-
import { MethodMirrorWithInheritance } from '../model/inheritance';
|
|
2
|
+
import { RenderableConstructor, RenderableMethod, MethodMirrorWithInheritance, CodeBlock } from './types';
|
|
4
3
|
import { adaptDescribable, adaptDocumentable } from './documentables';
|
|
5
|
-
import { GetRenderableContentByTypeName
|
|
4
|
+
import { GetRenderableContentByTypeName } from './references';
|
|
6
5
|
import { Documentable } from './types';
|
|
7
6
|
|
|
8
7
|
export function adaptMethod(
|
|
@@ -16,13 +15,17 @@ export function adaptMethod(
|
|
|
16
15
|
return `${name}(${parametersString})`;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
function buildSignature(method: MethodMirrorWithInheritance):
|
|
18
|
+
function buildSignature(method: MethodMirrorWithInheritance): CodeBlock {
|
|
20
19
|
const { access_modifier, typeReference, name, memberModifiers } = method;
|
|
21
20
|
const parameters = method.parameters
|
|
22
21
|
.map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
|
|
23
22
|
.join(', ');
|
|
24
23
|
const members = memberModifiers.length > 0 ? `${memberModifiers.join(' ')} ` : '';
|
|
25
|
-
return
|
|
24
|
+
return {
|
|
25
|
+
__type: 'code-block',
|
|
26
|
+
language: 'apex',
|
|
27
|
+
content: [`${access_modifier} ${members}${typeReference.rawDeclaration} ${name}(${parameters})`],
|
|
28
|
+
};
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
return {
|
|
@@ -32,25 +35,25 @@ export function adaptMethod(
|
|
|
32
35
|
signature: {
|
|
33
36
|
headingLevel: baseHeadingLevel + 1,
|
|
34
37
|
heading: 'Signature',
|
|
35
|
-
value:
|
|
38
|
+
value: buildSignature(method as MethodMirrorWithInheritance),
|
|
36
39
|
},
|
|
37
40
|
returnType: {
|
|
38
41
|
headingLevel: baseHeadingLevel + 1,
|
|
39
42
|
heading: 'Return Type',
|
|
40
43
|
value: {
|
|
41
44
|
...adaptDescribable(method.docComment?.returnAnnotation?.bodyLines, linkGenerator),
|
|
42
|
-
type:
|
|
45
|
+
type: linkGenerator(method.typeReference.rawDeclaration),
|
|
43
46
|
},
|
|
44
47
|
},
|
|
45
48
|
throws: {
|
|
46
49
|
headingLevel: baseHeadingLevel + 1,
|
|
47
50
|
heading: 'Throws',
|
|
48
|
-
value: method.docComment?.throwsAnnotations.map((thrown) => mapThrows(thrown)),
|
|
51
|
+
value: method.docComment?.throwsAnnotations.map((thrown) => mapThrows(thrown, linkGenerator)),
|
|
49
52
|
},
|
|
50
53
|
parameters: {
|
|
51
54
|
headingLevel: baseHeadingLevel + 1,
|
|
52
55
|
heading: 'Parameters',
|
|
53
|
-
value: method.parameters.map((param) => mapParameters(method, param)),
|
|
56
|
+
value: method.parameters.map((param) => mapParameters(method, param, linkGenerator)),
|
|
54
57
|
},
|
|
55
58
|
inherited: (method as MethodMirrorWithInheritance).inherited,
|
|
56
59
|
};
|
|
@@ -68,12 +71,16 @@ export function adaptConstructor(
|
|
|
68
71
|
return `${name}(${parametersString})`;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
function buildSignature(name: string, constructor: ConstructorMirror):
|
|
74
|
+
function buildSignature(name: string, constructor: ConstructorMirror): CodeBlock {
|
|
72
75
|
const { access_modifier } = constructor;
|
|
73
76
|
const parameters = constructor.parameters
|
|
74
77
|
.map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
|
|
75
78
|
.join(', ');
|
|
76
|
-
return
|
|
79
|
+
return {
|
|
80
|
+
__type: 'code-block',
|
|
81
|
+
language: 'apex',
|
|
82
|
+
content: [`${access_modifier} ${name}(${parameters})`],
|
|
83
|
+
};
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
return {
|
|
@@ -83,35 +90,39 @@ export function adaptConstructor(
|
|
|
83
90
|
signature: {
|
|
84
91
|
headingLevel: baseHeadingLevel + 1,
|
|
85
92
|
heading: 'Signature',
|
|
86
|
-
value:
|
|
93
|
+
value: buildSignature(typeName, constructor),
|
|
87
94
|
},
|
|
88
95
|
parameters: {
|
|
89
96
|
headingLevel: baseHeadingLevel + 1,
|
|
90
97
|
heading: 'Parameters',
|
|
91
|
-
value: constructor.parameters.map((param) => mapParameters(constructor, param)),
|
|
98
|
+
value: constructor.parameters.map((param) => mapParameters(constructor, param, linkGenerator)),
|
|
92
99
|
},
|
|
93
100
|
throws: {
|
|
94
101
|
headingLevel: baseHeadingLevel + 1,
|
|
95
102
|
heading: 'Throws',
|
|
96
|
-
value: constructor.docComment?.throwsAnnotations.map((thrown) => mapThrows(thrown)),
|
|
103
|
+
value: constructor.docComment?.throwsAnnotations.map((thrown) => mapThrows(thrown, linkGenerator)),
|
|
97
104
|
},
|
|
98
105
|
};
|
|
99
106
|
}
|
|
100
107
|
|
|
101
|
-
function mapParameters(
|
|
108
|
+
function mapParameters(
|
|
109
|
+
documentable: Documentable,
|
|
110
|
+
param: ParameterMirror,
|
|
111
|
+
linkGenerator: GetRenderableContentByTypeName,
|
|
112
|
+
) {
|
|
102
113
|
const paramAnnotation = documentable.docComment?.paramAnnotations.find(
|
|
103
114
|
(pa) => pa.paramName.toLowerCase() === param.name.toLowerCase(),
|
|
104
115
|
);
|
|
105
116
|
return {
|
|
106
|
-
...adaptDescribable(paramAnnotation?.bodyLines,
|
|
117
|
+
...adaptDescribable(paramAnnotation?.bodyLines, linkGenerator),
|
|
107
118
|
name: param.name,
|
|
108
|
-
type:
|
|
119
|
+
type: linkGenerator(param.typeReference.rawDeclaration),
|
|
109
120
|
};
|
|
110
121
|
}
|
|
111
122
|
|
|
112
|
-
function mapThrows(thrown: ThrowsAnnotation) {
|
|
123
|
+
function mapThrows(thrown: ThrowsAnnotation, linkGenerator: GetRenderableContentByTypeName) {
|
|
113
124
|
return {
|
|
114
|
-
...adaptDescribable(thrown.bodyLines,
|
|
115
|
-
type:
|
|
125
|
+
...adaptDescribable(thrown.bodyLines, linkGenerator),
|
|
126
|
+
type: linkGenerator(thrown.exceptionName),
|
|
116
127
|
};
|
|
117
128
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Link, RenderableContent, StringOrLink } from '../core/renderable/types';
|
|
1
|
+
import { Link, RenderableContent, StringOrLink } from './types';
|
|
3
2
|
|
|
4
3
|
export type GetRenderableContentByTypeName = (typeName: string) => StringOrLink;
|
|
5
4
|
|
|
6
|
-
export const linkFromTypeNameGenerator: GetRenderableContentByTypeName =
|
|
7
|
-
ClassFileGeneratorHelper.getRenderableLinkByTypeName;
|
|
8
|
-
|
|
9
5
|
function defaultGetEmailByReference(email: string): Link {
|
|
10
6
|
return {
|
|
7
|
+
__type: 'link',
|
|
11
8
|
title: email,
|
|
12
9
|
url: `mailto:${email}`,
|
|
13
10
|
};
|
|
@@ -15,7 +12,7 @@ function defaultGetEmailByReference(email: string): Link {
|
|
|
15
12
|
|
|
16
13
|
export function replaceInlineReferences(
|
|
17
14
|
text: string,
|
|
18
|
-
linkReplacer: GetRenderableContentByTypeName
|
|
15
|
+
linkReplacer: GetRenderableContentByTypeName,
|
|
19
16
|
emailReplacer: GetRenderableContentByTypeName = defaultGetEmailByReference,
|
|
20
17
|
): RenderableContent[] {
|
|
21
18
|
return replaceInlineEmails(replaceInlineLinks([text], linkReplacer), emailReplacer);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CodeBlock, EmptyLine, RenderableContent } from './types';
|
|
2
|
+
|
|
3
|
+
export function isEmptyLine(content: RenderableContent): content is EmptyLine {
|
|
4
|
+
return Object.keys(content).includes('__type') && (content as { __type: string }).__type === 'empty-line';
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function isCodeBlock(content: RenderableContent): content is CodeBlock {
|
|
8
|
+
return Object.keys(content).includes('__type') && (content as { __type: string }).__type === 'code-block';
|
|
9
|
+
}
|
|
@@ -1,15 +1,42 @@
|
|
|
1
|
+
// Apex Reflection-based types
|
|
2
|
+
import {
|
|
3
|
+
Annotation as MirrorAnnotation,
|
|
4
|
+
ClassMirror,
|
|
5
|
+
DocComment,
|
|
6
|
+
FieldMirror,
|
|
7
|
+
MethodMirror,
|
|
8
|
+
PropertyMirror,
|
|
9
|
+
} from '@cparra/apex-reflection';
|
|
10
|
+
|
|
11
|
+
export type Describable = string[] | undefined;
|
|
12
|
+
|
|
13
|
+
export type Documentable = {
|
|
14
|
+
annotations: MirrorAnnotation[];
|
|
15
|
+
docComment?: DocComment;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type InheritanceSupport = { inherited: boolean };
|
|
19
|
+
export type ClassMirrorWithInheritanceChain = ClassMirror & { inheritanceChain: string[] };
|
|
20
|
+
export type FieldMirrorWithInheritance = FieldMirror & InheritanceSupport;
|
|
21
|
+
export type PropertyMirrorWithInheritance = PropertyMirror & InheritanceSupport;
|
|
22
|
+
export type MethodMirrorWithInheritance = MethodMirror & InheritanceSupport;
|
|
23
|
+
export type FieldOrProperty = FieldMirrorWithInheritance | PropertyMirrorWithInheritance;
|
|
24
|
+
|
|
25
|
+
// Renderable types
|
|
26
|
+
|
|
1
27
|
export type Link = {
|
|
28
|
+
readonly __type: 'link';
|
|
2
29
|
title: string;
|
|
3
30
|
url: string;
|
|
4
31
|
};
|
|
5
32
|
|
|
6
33
|
export type EmptyLine = {
|
|
7
|
-
|
|
34
|
+
__type: 'empty-line';
|
|
8
35
|
};
|
|
9
36
|
|
|
10
37
|
export type StringOrLink = string | Link;
|
|
11
38
|
|
|
12
|
-
export type RenderableContent = StringOrLink | EmptyLine;
|
|
39
|
+
export type RenderableContent = StringOrLink | EmptyLine | CodeBlock;
|
|
13
40
|
|
|
14
41
|
type EnumValue = {
|
|
15
42
|
value: string;
|
|
@@ -22,11 +49,15 @@ type CustomTag = {
|
|
|
22
49
|
};
|
|
23
50
|
|
|
24
51
|
/**
|
|
25
|
-
* Represents an annotation to a top-level type. For example @NamespaceAccessible.
|
|
52
|
+
* Represents an annotation to a top-level type. For example, @NamespaceAccessible.
|
|
26
53
|
*/
|
|
27
54
|
type Annotation = string;
|
|
28
55
|
|
|
29
|
-
type CodeBlock =
|
|
56
|
+
type CodeBlock = {
|
|
57
|
+
readonly __type: 'code-block';
|
|
58
|
+
language: string;
|
|
59
|
+
content: string[];
|
|
60
|
+
};
|
|
30
61
|
|
|
31
62
|
type RenderableDocumentation = {
|
|
32
63
|
annotations?: Annotation[];
|
|
@@ -102,7 +133,7 @@ export type GroupedMember<T> = RenderableSection<T[]> & { groupDescription: stri
|
|
|
102
133
|
|
|
103
134
|
export type RenderableClass = RenderableType & {
|
|
104
135
|
type: 'class';
|
|
105
|
-
extends?: StringOrLink;
|
|
136
|
+
extends?: StringOrLink[];
|
|
106
137
|
implements?: StringOrLink[];
|
|
107
138
|
classModifier?: string;
|
|
108
139
|
sharingModifier?: string;
|