@cparra/apexdocs 2.25.0-alpha.2 → 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 +30 -3
- package/dist/application/Apexdocs.js.map +1 -0
- package/{lib/application/flows → dist/application/generators}/generate-markdown-files.d.ts +1 -1
- package/{lib/application/flows → dist/application/generators}/generate-markdown-files.js +9 -2
- 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/adapters/apex-types.d.ts +6 -0
- package/{lib → dist/core}/adapters/apex-types.js +3 -3
- 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 +10 -4
- 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 +15 -6
- 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 +7 -3
- package/{lib → dist}/core/generate-docs.js +43 -14
- package/dist/core/generate-docs.js.map +1 -0
- package/{lib → dist}/core/inheritance-chain.js +2 -1
- 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-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/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/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/string-utils.js +2 -2
- package/{lib → dist}/util/string-utils.js.map +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +18 -0
- 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 +1 -1
- package/examples/plain-markdown/docs/index.md +2 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +16 -0
- package/jest.config.js +1 -1
- package/package.json +11 -13
- 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 +36 -5
- package/src/application/{flows → generators}/generate-markdown-files.ts +19 -13
- package/src/cli/args.ts +136 -0
- package/src/cli/generate.ts +11 -135
- 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 +18 -15
- package/src/core/adapters/documentables.ts +195 -0
- package/src/{adapters → core/adapters}/fields-and-properties.ts +11 -9
- package/src/{adapters → core/adapters}/methods-and-constructors.ts +15 -8
- 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 +35 -4
- package/src/core/generate-docs.ts +55 -19
- 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-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/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/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/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 -5
- 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/application/flows/generate-markdown-files.js.map +0 -1
- package/lib/cli/generate.js.map +0 -1
- package/lib/core/generate-docs.js.map +0 -1
- package/lib/core/inheritance-chain.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -29
- package/lib/model/apex-bundle.js.map +0 -1
- package/lib/model/inheritance.d.ts +0 -11
- 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-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/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 -8
- 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 → dist}/core/__test__/inheritance-chain.test.d.ts +0 -0
- /package/{lib → dist}/core/__test__/inheritance-chain.test.js +0 -0
- /package/{lib → dist}/core/__test__/inheritance-chain.test.js.map +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 → dist}/core/inheritance-chain.d.ts +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-file.d.ts +0 -0
- /package/{lib → dist}/model/markdown-file.js +0 -0
- /package/{lib → dist}/model/markdown-file.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/ClassMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/ClassMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/ClassMirrorBuilder.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 +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/logger.js +0 -0
- /package/{lib → dist}/util/logger.js.map +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
package/src/cli/generate.ts
CHANGED
|
@@ -1,140 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import * as yargs from 'yargs';
|
|
3
|
-
|
|
4
|
-
import { Settings } from '../settings';
|
|
5
2
|
import { Apexdocs } from '../application/Apexdocs';
|
|
6
|
-
import {
|
|
7
|
-
import { cosmiconfig } from 'cosmiconfig';
|
|
3
|
+
import { extractArgs } from './args';
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.options({
|
|
14
|
-
sourceDir: {
|
|
15
|
-
type: 'string',
|
|
16
|
-
alias: 's',
|
|
17
|
-
demandOption: true,
|
|
18
|
-
describe: 'The directory location which contains your apex .cls classes.',
|
|
19
|
-
},
|
|
20
|
-
targetDir: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
alias: 't',
|
|
23
|
-
default: './docs/',
|
|
24
|
-
describe: 'The directory location where documentation will be generated to.',
|
|
25
|
-
},
|
|
26
|
-
recursive: {
|
|
27
|
-
type: 'boolean',
|
|
28
|
-
alias: 'r',
|
|
29
|
-
default: true,
|
|
30
|
-
describe: 'Whether .cls classes will be searched for recursively in the directory provided.',
|
|
31
|
-
},
|
|
32
|
-
scope: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
array: true,
|
|
35
|
-
alias: 'p',
|
|
36
|
-
default: ['global'],
|
|
37
|
-
describe:
|
|
38
|
-
'A list of scopes to document. Values should be separated by a space, e.g --scope global public namespaceaccessible. ' +
|
|
39
|
-
'Annotations are supported and should be passed lowercased and without the @ symbol, e.g. namespaceaccessible auraenabled. ' +
|
|
40
|
-
'Note that this setting is ignored if generating an OpenApi REST specification since that looks for classes annotated with @RestResource.',
|
|
41
|
-
},
|
|
42
|
-
targetGenerator: {
|
|
43
|
-
type: 'string',
|
|
44
|
-
alias: 'g',
|
|
45
|
-
default: 'jekyll',
|
|
46
|
-
choices: ['jekyll', 'docsify', 'plain-markdown', 'openapi'],
|
|
47
|
-
describe:
|
|
48
|
-
'Define the static file generator for which the documents will be created. ' +
|
|
49
|
-
'Currently supports jekyll, docsify, plain markdown, and OpenAPI v3.1.0.',
|
|
50
|
-
},
|
|
51
|
-
indexOnly: {
|
|
52
|
-
type: 'boolean',
|
|
53
|
-
default: false,
|
|
54
|
-
describe: 'Defines whether only the index file should be generated.',
|
|
55
|
-
},
|
|
56
|
-
defaultGroupName: {
|
|
57
|
-
type: 'string',
|
|
58
|
-
default: 'Miscellaneous',
|
|
59
|
-
describe: 'Defines the @group name to be used when a file does not specify it.',
|
|
60
|
-
},
|
|
61
|
-
sanitizeHtml: {
|
|
62
|
-
type: 'boolean',
|
|
63
|
-
default: true,
|
|
64
|
-
describe:
|
|
65
|
-
'When on, any special character within your ApexDocs is converted into its HTML code representation. ' +
|
|
66
|
-
'This is specially useful when generic objects are described within the docs, e.g. "List< Foo>", "Map<Foo, Bar>" ' +
|
|
67
|
-
'because otherwise the content within < and > would be treated as HTML tags and not shown in the output. ' +
|
|
68
|
-
'Content in @example blocks are never sanitized.',
|
|
69
|
-
},
|
|
70
|
-
openApiTitle: {
|
|
71
|
-
type: 'string',
|
|
72
|
-
default: 'Apex REST Api',
|
|
73
|
-
describe: 'If using "openapi" as the target generator, this allows you to specify the OpenApi title value.',
|
|
74
|
-
},
|
|
75
|
-
title: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
describe: "If this allows you to specify the title of the generated documentation's home file.",
|
|
78
|
-
default: 'Classes',
|
|
79
|
-
},
|
|
80
|
-
namespace: {
|
|
81
|
-
type: 'string',
|
|
82
|
-
describe:
|
|
83
|
-
'The package namespace, if any. If this value is provided the namespace will be added as a prefix to all of the parsed files. ' +
|
|
84
|
-
"If generating an OpenApi definition, it will be added to the file's Server Url.",
|
|
85
|
-
},
|
|
86
|
-
openApiFileName: {
|
|
87
|
-
type: 'string',
|
|
88
|
-
describe: 'If using "openapi" as the target generator, this allows you to specify the name of the output file.',
|
|
89
|
-
default: 'openapi',
|
|
90
|
-
},
|
|
91
|
-
sortMembersAlphabetically: {
|
|
92
|
-
type: 'boolean',
|
|
93
|
-
describe: 'Whether to sort members alphabetically.',
|
|
94
|
-
default: false,
|
|
95
|
-
},
|
|
96
|
-
includeMetadata: {
|
|
97
|
-
type: 'boolean',
|
|
98
|
-
describe: "Whether to include the file's meta.xml information: Whether it is active and and the API version",
|
|
99
|
-
default: false,
|
|
100
|
-
},
|
|
101
|
-
documentationRootDir: {
|
|
102
|
-
type: 'string',
|
|
103
|
-
describe:
|
|
104
|
-
'Allows you to specify the root documentation directory where the files are being generated. This can be helpful when embedding the generated docs into an existing site so that the links are generated correctly.',
|
|
105
|
-
},
|
|
5
|
+
function main() {
|
|
6
|
+
extractArgs()
|
|
7
|
+
.then((config) => {
|
|
8
|
+
Apexdocs.generate(config);
|
|
106
9
|
})
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
Settings.build({
|
|
114
|
-
sourceDirectory: argv.sourceDir,
|
|
115
|
-
recursive: argv.recursive,
|
|
116
|
-
scope: argv.scope,
|
|
117
|
-
outputDir: argv.targetDir,
|
|
118
|
-
targetGenerator: argv.targetGenerator as GeneratorChoices,
|
|
119
|
-
indexOnly: argv.indexOnly,
|
|
120
|
-
defaultGroupName: argv.defaultGroupName,
|
|
121
|
-
sanitizeHtml: argv.sanitizeHtml,
|
|
122
|
-
openApiTitle: argv.openApiTitle,
|
|
123
|
-
title: argv.title,
|
|
124
|
-
namespace: argv.namespace,
|
|
125
|
-
openApiFileName: argv.openApiFileName,
|
|
126
|
-
sortMembersAlphabetically: argv.sortMembersAlphabetically,
|
|
127
|
-
includeMetadata: argv.includeMetadata,
|
|
128
|
-
rootDir: argv.documentationRootDir,
|
|
129
|
-
onAfterProcess: config?.config?.onAfterProcess,
|
|
130
|
-
onBeforeFileWrite: config?.config?.onBeforeFileWrite,
|
|
131
|
-
frontMatterHeader: config?.config?.frontMatterHeader,
|
|
132
|
-
});
|
|
10
|
+
.catch((error) => {
|
|
11
|
+
console.error(error);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
133
15
|
|
|
134
|
-
|
|
135
|
-
Apexdocs.generate();
|
|
136
|
-
} catch (error) {
|
|
137
|
-
console.error(error);
|
|
138
|
-
process.exit(1);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
16
|
+
main();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { typeToRenderable } from '../apex-types';
|
|
2
|
+
import { InterfaceMirrorBuilder } from '../../../test-helpers/InterfaceMirrorBuilder';
|
|
3
|
+
import { AnnotationBuilder } from '../../../test-helpers/AnnotationBuilder';
|
|
4
|
+
import { MethodMirrorBuilder, ParameterBuilder } from '../../../test-helpers/MethodMirrorBuilder';
|
|
5
5
|
|
|
6
6
|
function linkGenerator(type: string): string {
|
|
7
7
|
return type;
|
|
@@ -10,14 +10,14 @@ function linkGenerator(type: string): string {
|
|
|
10
10
|
describe('Conversion from InterfaceMirror to InterfaceSource understandable by the templating engine', () => {
|
|
11
11
|
it('converts the name', () => {
|
|
12
12
|
const interfaceMirror = new InterfaceMirrorBuilder().withName('SampleInterface').build();
|
|
13
|
-
const interfaceSource =
|
|
13
|
+
const interfaceSource = typeToRenderable(interfaceMirror, linkGenerator);
|
|
14
14
|
|
|
15
15
|
expect(interfaceSource.name).toBe('SampleInterface');
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
it('converts the access modifier', () => {
|
|
19
19
|
const interfaceMirror = new InterfaceMirrorBuilder().build();
|
|
20
|
-
const interfaceSource =
|
|
20
|
+
const interfaceSource = typeToRenderable(interfaceMirror, linkGenerator);
|
|
21
21
|
|
|
22
22
|
expect(interfaceSource.meta.accessModifier).toBe('public');
|
|
23
23
|
});
|
|
@@ -26,7 +26,7 @@ describe('Conversion from InterfaceMirror to InterfaceSource understandable by t
|
|
|
26
26
|
const interfaceMirror = new InterfaceMirrorBuilder()
|
|
27
27
|
.addAnnotation(new AnnotationBuilder().withName('MyAnnotation').build())
|
|
28
28
|
.build();
|
|
29
|
-
const interfaceSource =
|
|
29
|
+
const interfaceSource = typeToRenderable(interfaceMirror, linkGenerator);
|
|
30
30
|
|
|
31
31
|
expect(interfaceSource.doc.annotations).toEqual(['MYANNOTATION']);
|
|
32
32
|
});
|
|
@@ -44,10 +44,10 @@ describe('Conversion from InterfaceMirror to InterfaceSource understandable by t
|
|
|
44
44
|
)
|
|
45
45
|
.build();
|
|
46
46
|
|
|
47
|
-
const interfaceSource =
|
|
47
|
+
const interfaceSource = typeToRenderable(interfaceMirror, linkGenerator);
|
|
48
48
|
|
|
49
49
|
expect(interfaceSource.methods.value).toHaveLength(1);
|
|
50
|
-
expect(interfaceSource.methods.value[0].signature.value[0]).toBe('public String sampleMethod()');
|
|
50
|
+
expect(interfaceSource.methods.value[0].signature.value.content[0]).toBe('public String sampleMethod()');
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
it('converts method declarations. Method with parameters', () => {
|
|
@@ -72,9 +72,11 @@ describe('Conversion from InterfaceMirror to InterfaceSource understandable by t
|
|
|
72
72
|
)
|
|
73
73
|
.build();
|
|
74
74
|
|
|
75
|
-
const interfaceSource =
|
|
75
|
+
const interfaceSource = typeToRenderable(interfaceMirror, linkGenerator);
|
|
76
76
|
|
|
77
77
|
expect(interfaceSource.methods.value).toHaveLength(1);
|
|
78
|
-
expect(interfaceSource.methods.value[0].signature.value[0]).toBe(
|
|
78
|
+
expect(interfaceSource.methods.value[0].signature.value.content[0]).toBe(
|
|
79
|
+
'public String sampleMethod(String param1)',
|
|
80
|
+
);
|
|
79
81
|
});
|
|
80
82
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { replaceInlineReferences } from '../references';
|
|
2
|
-
import { Link } from '
|
|
2
|
+
import { Link } from '../types';
|
|
3
3
|
|
|
4
4
|
function getFileLink(typeName: string): Link {
|
|
5
5
|
return {
|
|
6
|
+
__type: 'link' as const,
|
|
6
7
|
title: typeName,
|
|
7
8
|
url: `/api/${typeName}.html`,
|
|
8
9
|
};
|
|
@@ -10,6 +11,7 @@ function getFileLink(typeName: string): Link {
|
|
|
10
11
|
|
|
11
12
|
function getEmailLink(typeName: string) {
|
|
12
13
|
return {
|
|
14
|
+
__type: 'link' as const,
|
|
13
15
|
title: typeName,
|
|
14
16
|
url: `mailto:${typeName}`,
|
|
15
17
|
};
|
|
@@ -33,6 +35,7 @@ describe('reference utilities', () => {
|
|
|
33
35
|
const expected = [
|
|
34
36
|
'This is a test ',
|
|
35
37
|
{
|
|
38
|
+
__type: 'link',
|
|
36
39
|
title: 'ClassName',
|
|
37
40
|
url: '/api/ClassName.html',
|
|
38
41
|
},
|
|
@@ -44,6 +47,7 @@ describe('reference utilities', () => {
|
|
|
44
47
|
it('replaces links in the format of {@link ClassName}', () => {
|
|
45
48
|
function getFileLinkByTypeName(typeName: string): Link {
|
|
46
49
|
return {
|
|
50
|
+
__type: 'link' as const,
|
|
47
51
|
title: typeName,
|
|
48
52
|
url: `/api/${typeName}.html`,
|
|
49
53
|
};
|
|
@@ -55,6 +59,7 @@ describe('reference utilities', () => {
|
|
|
55
59
|
const expected = [
|
|
56
60
|
'This is a test ',
|
|
57
61
|
{
|
|
62
|
+
__type: 'link',
|
|
58
63
|
title: 'ClassName',
|
|
59
64
|
url: '/api/ClassName.html',
|
|
60
65
|
},
|
|
@@ -68,6 +73,7 @@ describe('reference utilities', () => {
|
|
|
68
73
|
it('replaces emails in the format of {@email email-address}', () => {
|
|
69
74
|
function getLinkByTypeName(typeName: string) {
|
|
70
75
|
return {
|
|
76
|
+
__type: 'link' as const,
|
|
71
77
|
title: typeName,
|
|
72
78
|
url: `mailto:${typeName}`,
|
|
73
79
|
};
|
|
@@ -79,6 +85,7 @@ describe('reference utilities', () => {
|
|
|
79
85
|
const expected = [
|
|
80
86
|
'This is an email ',
|
|
81
87
|
{
|
|
88
|
+
__type: 'link',
|
|
82
89
|
title: 'example@example.com',
|
|
83
90
|
url: 'mailto:example@example.com',
|
|
84
91
|
},
|
|
@@ -95,16 +102,19 @@ describe('reference utilities', () => {
|
|
|
95
102
|
const expected = [
|
|
96
103
|
'This is a test ',
|
|
97
104
|
{
|
|
105
|
+
__type: 'link',
|
|
98
106
|
title: 'ClassName',
|
|
99
107
|
url: '/api/ClassName.html',
|
|
100
108
|
},
|
|
101
109
|
', and ',
|
|
102
110
|
{
|
|
111
|
+
__type: 'link',
|
|
103
112
|
title: 'AnotherClass',
|
|
104
113
|
url: '/api/AnotherClass.html',
|
|
105
114
|
},
|
|
106
115
|
', and an email ',
|
|
107
116
|
{
|
|
117
|
+
__type: 'link',
|
|
108
118
|
title: 'testerson',
|
|
109
119
|
url: 'mailto:testerson',
|
|
110
120
|
},
|
|
@@ -4,38 +4,41 @@ import {
|
|
|
4
4
|
RenderableClass,
|
|
5
5
|
RenderableEnum,
|
|
6
6
|
RenderableInterface,
|
|
7
|
-
Renderable,
|
|
8
7
|
RenderableSection,
|
|
9
8
|
GroupedMember,
|
|
10
|
-
} from '../core/renderable/types';
|
|
11
|
-
import { adaptDescribable, adaptDocumentable } from './documentables';
|
|
12
|
-
import { GetRenderableContentByTypeName } from './references';
|
|
13
|
-
import {
|
|
14
9
|
ClassMirrorWithInheritanceChain,
|
|
15
10
|
FieldMirrorWithInheritance,
|
|
16
11
|
PropertyMirrorWithInheritance,
|
|
17
|
-
} from '
|
|
12
|
+
} from './types';
|
|
13
|
+
import { adaptDescribable, adaptDocumentable } from './documentables';
|
|
14
|
+
import { GetRenderableContentByTypeName } from './references';
|
|
18
15
|
import { adaptConstructor, adaptMethod } from './methods-and-constructors';
|
|
19
16
|
import { adaptFieldOrProperty } from './fields-and-properties';
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
type GetReturnRenderable<T extends Type> = T extends InterfaceMirror
|
|
19
|
+
? RenderableInterface
|
|
20
|
+
: T extends ClassMirror
|
|
21
|
+
? RenderableClass
|
|
22
|
+
: RenderableEnum;
|
|
23
|
+
|
|
24
|
+
export function typeToRenderable<T extends Type>(
|
|
25
|
+
type: T,
|
|
23
26
|
linkGenerator: GetRenderableContentByTypeName,
|
|
24
27
|
namespace?: string,
|
|
25
|
-
):
|
|
26
|
-
function getRenderable() {
|
|
28
|
+
): GetReturnRenderable<T> {
|
|
29
|
+
function getRenderable(): RenderableInterface | RenderableClass | RenderableEnum {
|
|
27
30
|
switch (type.type_name) {
|
|
28
31
|
case 'enum':
|
|
29
|
-
return enumTypeToEnumSource(type as EnumMirror, linkGenerator);
|
|
32
|
+
return enumTypeToEnumSource(type as EnumMirror, linkGenerator) as RenderableEnum;
|
|
30
33
|
case 'interface':
|
|
31
|
-
return interfaceTypeToInterfaceSource(type as InterfaceMirror, linkGenerator);
|
|
34
|
+
return interfaceTypeToInterfaceSource(type as InterfaceMirror, linkGenerator) as RenderableInterface;
|
|
32
35
|
case 'class':
|
|
33
|
-
return classTypeToClassSource(type as ClassMirrorWithInheritanceChain, linkGenerator);
|
|
36
|
+
return classTypeToClassSource(type as ClassMirrorWithInheritanceChain, linkGenerator) as RenderableClass;
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
return {
|
|
38
|
-
...getRenderable(),
|
|
41
|
+
...(getRenderable() as GetReturnRenderable<T>),
|
|
39
42
|
namespace,
|
|
40
43
|
};
|
|
41
44
|
}
|
|
@@ -85,7 +88,7 @@ function enumTypeToEnumSource(
|
|
|
85
88
|
};
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
|
|
91
|
+
function interfaceTypeToInterfaceSource(
|
|
89
92
|
interfaceType: InterfaceMirror,
|
|
90
93
|
linkGenerator: GetRenderableContentByTypeName,
|
|
91
94
|
baseHeadingLevel: number = 1,
|
|
@@ -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,5 +1,4 @@
|
|
|
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
3
|
import { GetRenderableContentByTypeName } from './references';
|
|
5
4
|
|
|
@@ -8,14 +7,17 @@ export function adaptFieldOrProperty(
|
|
|
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 {
|
|
@@ -32,7 +34,7 @@ export function adaptFieldOrProperty(
|
|
|
32
34
|
signature: {
|
|
33
35
|
headingLevel: baseHeadingLevel + 1,
|
|
34
36
|
heading: 'Signature',
|
|
35
|
-
value:
|
|
37
|
+
value: buildSignature(),
|
|
36
38
|
},
|
|
37
39
|
};
|
|
38
40
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
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
4
|
import { GetRenderableContentByTypeName } from './references';
|
|
6
5
|
import { Documentable } from './types';
|
|
@@ -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,7 +35,7 @@ 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,
|
|
@@ -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,7 +90,7 @@ 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,
|
|
@@ -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);
|