@cparra/apexdocs 2.24.0 → 2.25.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yaml +22 -0
- package/.github/workflows/close_stale.yml +22 -22
- package/.prettierrc.js +7 -7
- package/LICENSE +21 -21
- package/README.md +742 -718
- package/__mocks__/chalk.js +12 -0
- package/__mocks__/log-update.js +6 -0
- package/apexdocs.config.ts +13 -13
- package/docs/{README.md → __old/README.md} +1 -1
- package/docs/{restapi.json → __old/restapi.json} +589 -589
- package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
- package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
- package/eslint.config.mjs +10 -0
- package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
- package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
- package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
- package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
- package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
- package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
- package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
- package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
- package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
- package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
- package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
- package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
- package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
- package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
- package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
- package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
- package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
- package/examples/includes/header.md +3 -3
- package/examples/plain-markdown/.forceignore +12 -0
- package/examples/plain-markdown/config/project-scratch-def.json +5 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.BaseClass.md +16 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.ParentInterface.md +15 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.ReferencedEnum.md +8 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +7 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +115 -0
- package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +36 -0
- package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +173 -0
- package/examples/plain-markdown/docs/index.md +36 -0
- package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
- package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
- package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
- package/examples/plain-markdown/force-app/classes/SampleClass.cls +72 -0
- package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
- package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
- package/examples/plain-markdown/package-lock.json +665 -0
- package/examples/plain-markdown/package.json +20 -0
- package/examples/plain-markdown/sfdx-project.json +12 -0
- package/examples/plain-markdown/template.md +3 -0
- package/jest.config.js +9 -5
- package/jest.d.ts +7 -0
- package/lib/__spec__/core/expect-extensions.d.ts +3 -0
- package/lib/__spec__/core/expect-extensions.js +54 -0
- package/lib/__spec__/core/expect-extensions.js.map +1 -0
- package/lib/__spec__/core/generating-class-docs.spec.d.ts +1 -0
- package/lib/__spec__/core/generating-class-docs.spec.js +427 -0
- package/lib/__spec__/core/generating-class-docs.spec.js.map +1 -0
- package/lib/__spec__/core/generating-enum-docs.spec.d.ts +1 -0
- package/lib/__spec__/core/generating-enum-docs.spec.js +303 -0
- package/lib/__spec__/core/generating-enum-docs.spec.js.map +1 -0
- package/lib/__spec__/core/generating-interface-docs.spec.d.ts +1 -0
- package/lib/__spec__/core/generating-interface-docs.spec.js +361 -0
- package/lib/__spec__/core/generating-interface-docs.spec.js.map +1 -0
- package/lib/__spec__/core/generating-reference-guide.spec.d.ts +1 -0
- package/lib/__spec__/core/generating-reference-guide.spec.js +161 -0
- package/lib/__spec__/core/generating-reference-guide.spec.js.map +1 -0
- package/lib/adapters/apex-types.d.ts +7 -0
- package/lib/adapters/apex-types.js +112 -0
- package/lib/adapters/apex-types.js.map +1 -0
- package/lib/adapters/documentables.d.ts +7 -0
- package/lib/adapters/documentables.js +56 -0
- package/lib/adapters/documentables.js.map +1 -0
- package/lib/adapters/fields-and-properties.d.ts +4 -0
- package/lib/adapters/fields-and-properties.js +32 -0
- package/lib/adapters/fields-and-properties.js.map +1 -0
- package/lib/adapters/methods-and-constructors.d.ts +5 -0
- package/lib/adapters/methods-and-constructors.js +92 -0
- package/lib/adapters/methods-and-constructors.js.map +1 -0
- package/lib/adapters/references.d.ts +5 -0
- package/lib/adapters/references.js +82 -0
- package/lib/adapters/references.js.map +1 -0
- package/lib/adapters/type-utils.d.ts +2 -0
- package/lib/adapters/type-utils.js +7 -0
- package/lib/adapters/type-utils.js.map +1 -0
- package/lib/application/Apexdocs.d.ts +13 -13
- package/lib/application/Apexdocs.js +79 -76
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.d.ts +2 -2
- package/lib/cli/generate.js +156 -130
- package/lib/cli/generate.js.map +1 -1
- package/lib/core/generate-docs.d.ts +23 -0
- package/lib/core/generate-docs.js +241 -0
- package/lib/core/generate-docs.js.map +1 -0
- package/lib/core/template.d.ts +10 -0
- package/lib/core/template.js +92 -0
- package/lib/core/template.js.map +1 -0
- package/lib/core/templates/reference-guide.d.ts +1 -0
- package/lib/core/templates/reference-guide.js +18 -0
- package/lib/core/templates/reference-guide.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +28 -17
- package/lib/index.js.map +1 -1
- package/lib/model/apex-bundle.d.ts +6 -6
- package/lib/model/apex-bundle.js +10 -10
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
- package/lib/model/inheritance.d.ts +8 -8
- package/lib/model/inheritance.js +2 -2
- package/lib/model/manifest.d.ts +22 -22
- package/lib/model/manifest.js +52 -46
- package/lib/model/manifest.js.map +1 -1
- package/lib/model/markdown-file.d.ts +16 -16
- package/lib/model/markdown-file.js +110 -106
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +45 -43
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/field-declaration-util.js +53 -54
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/index.d.ts +3 -3
- package/lib/model/markdown-generation-util/index.js +19 -19
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
- package/lib/model/markdown-generation-util/method-declaration-util.js +113 -114
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/type-declaration-util.js +80 -81
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
- package/lib/model/markdown-home-file.d.ts +11 -11
- package/lib/model/markdown-home-file.js +56 -53
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.d.ts +26 -26
- package/lib/model/markdown-type-file.js +136 -133
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/model/openapi/apex-doc-types.d.ts +19 -19
- package/lib/model/openapi/apex-doc-types.js +4 -4
- package/lib/model/openapi/open-api-types.d.ts +93 -93
- package/lib/model/openapi/open-api-types.js +2 -2
- package/lib/model/openapi/open-api.d.ts +16 -16
- package/lib/model/openapi/open-api.js +33 -33
- package/lib/model/openapi/open-api.js.map +1 -1
- package/lib/model/openapi/openapi-type-file.d.ts +7 -7
- package/lib/model/openapi/openapi-type-file.js +16 -16
- package/lib/model/outputFile.d.ts +10 -10
- package/lib/model/outputFile.js +21 -28
- package/lib/model/outputFile.js.map +1 -1
- package/lib/model/types-repository.d.ts +16 -16
- package/lib/model/types-repository.js +53 -53
- package/lib/model/types-repository.js.map +1 -1
- package/lib/service/apex-file-reader.d.ts +14 -14
- package/lib/service/apex-file-reader.js +48 -45
- package/lib/service/apex-file-reader.js.map +1 -1
- package/lib/service/file-system.d.ts +14 -14
- package/lib/service/file-system.js +47 -24
- package/lib/service/file-system.js.map +1 -1
- package/lib/service/file-writer.d.ts +6 -6
- package/lib/service/file-writer.js +56 -33
- package/lib/service/file-writer.js.map +1 -1
- package/lib/service/manifest-factory.d.ts +10 -10
- package/lib/service/manifest-factory.js +15 -13
- package/lib/service/manifest-factory.js.map +1 -1
- package/lib/service/metadata-processor.d.ts +3 -3
- package/lib/service/metadata-processor.js +16 -16
- package/lib/service/metadata-processor.js.map +1 -1
- package/lib/service/parser.d.ts +21 -21
- package/lib/service/parser.js +137 -134
- package/lib/service/parser.js.map +1 -1
- package/lib/service/state.d.ts +9 -9
- package/lib/service/state.js +19 -19
- package/lib/service/state.js.map +1 -1
- package/lib/service/walkers/class-walker.d.ts +4 -4
- package/lib/service/walkers/class-walker.js +32 -32
- package/lib/service/walkers/class-walker.js.map +1 -1
- package/lib/service/walkers/enum-walker.d.ts +4 -4
- package/lib/service/walkers/enum-walker.js +10 -10
- package/lib/service/walkers/interface-walker.d.ts +4 -4
- package/lib/service/walkers/interface-walker.js +14 -14
- package/lib/service/walkers/interface-walker.js.map +1 -1
- package/lib/service/walkers/walker-factory.d.ts +5 -5
- package/lib/service/walkers/walker-factory.js +20 -20
- package/lib/service/walkers/walker-factory.js.map +1 -1
- package/lib/service/walkers/walker.d.ts +19 -19
- package/lib/service/walkers/walker.js +16 -16
- package/lib/service/walkers/walker.js.map +1 -1
- package/lib/settings.d.ts +64 -64
- package/lib/settings.js +88 -88
- package/lib/settings.js.map +1 -1
- package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
- package/lib/test-helpers/AnnotationBuilder.js +30 -30
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
- package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
- package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
- package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
- package/lib/test-helpers/DocCommentBuilder.js +37 -37
- package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
- package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
- package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
- package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
- package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
- package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
- package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
- package/lib/test-helpers/SettingsBuilder.js +26 -26
- package/lib/transpiler/factory.d.ts +6 -6
- package/lib/transpiler/factory.js +34 -31
- package/lib/transpiler/factory.js.map +1 -1
- package/lib/transpiler/file-container.d.ts +6 -6
- package/lib/transpiler/file-container.js +15 -15
- package/lib/transpiler/generator-choices.d.ts +1 -1
- package/lib/transpiler/generator-choices.js +2 -2
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
- package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
- package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/class-template.js +77 -0
- package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +36 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +28 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.js +16 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +27 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +10 -0
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +47 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +9 -6
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +41 -13
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js +31 -0
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js.map +1 -0
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
- package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
- package/lib/transpiler/openapi/parsers/Builder.js +29 -29
- package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
- package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
- package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +249 -225
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +1 -1
- package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
- package/lib/transpiler/processor-type-transpiler.js +8 -8
- package/lib/transpiler/transpiler.d.ts +5 -5
- package/lib/transpiler/transpiler.js +29 -26
- package/lib/transpiler/transpiler.js.map +1 -1
- package/lib/util/error-logger.d.ts +8 -8
- package/lib/util/error-logger.js +89 -89
- package/lib/util/error-logger.js.map +1 -1
- package/lib/util/logger.d.ts +21 -21
- package/lib/util/logger.js +60 -57
- package/lib/util/logger.js.map +1 -1
- package/lib/util/string-utils.d.ts +2 -2
- package/lib/util/string-utils.js +14 -14
- package/lib/util/string-utils.js.map +1 -1
- package/package.json +79 -78
- package/src/__spec__/core/expect-extensions.ts +32 -0
- package/src/__spec__/core/generating-class-docs.spec.ts +511 -0
- package/src/__spec__/core/generating-enum-docs.spec.ts +355 -0
- package/src/__spec__/core/generating-interface-docs.spec.ts +431 -0
- package/src/__spec__/core/generating-reference-guide.spec.ts +163 -0
- package/src/adapters/__tests__/interface-adapter.spec.ts +80 -0
- package/src/adapters/__tests__/references.spec.ts +115 -0
- package/src/adapters/apex-types.ts +224 -0
- package/src/adapters/documentables.ts +93 -0
- package/src/adapters/fields-and-properties.ts +38 -0
- package/src/adapters/methods-and-constructors.ts +117 -0
- package/src/adapters/references.ts +113 -0
- package/src/adapters/type-utils.ts +5 -0
- package/src/adapters/types.d.ts +8 -0
- package/src/cli/generate.ts +96 -93
- package/src/core/generate-docs.ts +357 -0
- package/src/core/renderable/types.d.ts +131 -0
- package/src/core/template.ts +108 -0
- package/src/core/templates/reference-guide.ts +14 -0
- package/src/index.ts +3 -1
- package/src/model/__tests__/manifest.spec.ts +1 -0
- package/src/model/manifest.ts +15 -5
- package/src/model/markdown-file.ts +6 -5
- package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +1 -1
- package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
- package/src/model/openapi/open-api-types.ts +2 -2
- package/src/model/outputFile.ts +2 -11
- package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
- package/src/service/__tests__/manifest-factory.spec.ts +1 -2
- package/src/service/parser.ts +1 -1
- package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
- package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
- package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
- package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
- package/src/transpiler/markdown/plain-markdown/class-template.ts +73 -0
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +32 -0
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +24 -0
- package/src/transpiler/markdown/plain-markdown/enum-template.ts +12 -0
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +23 -0
- package/src/transpiler/markdown/plain-markdown/grouped-members-partial-template.ts +6 -0
- package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +43 -0
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +30 -0
- package/src/transpiler/markdown/plain-markdown/type-doc-partial.ts +27 -0
- package/src/transpiler/openapi/parsers/Builder.ts +1 -1
- package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
- package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +4 -3
- package/src/util/error-logger.ts +4 -4
- package/src/util/logger.ts +3 -3
- package/tsconfig.json +21 -20
- package/tslint.json +5 -5
- package/.eslintrc.js +0 -12
- package/lib/model/manifest-diff.d.ts +0 -27
- package/lib/model/manifest-diff.js +0 -69
- package/lib/model/manifest-diff.js.map +0 -1
- package/src/model/__tests__/manifest-diff.spec.ts +0 -139
- package/src/model/manifest-diff.ts +0 -94
- /package/docs/{index.html → __old/index.html} +0 -0
- /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
- /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
- /package/docs/{types → __old/types}/README.md +0 -0
- /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.typeToRenderableType = typeToRenderableType;
|
|
4
|
+
exports.enumTypeToEnumSource = enumTypeToEnumSource;
|
|
5
|
+
exports.interfaceTypeToInterfaceSource = interfaceTypeToInterfaceSource;
|
|
6
|
+
exports.classTypeToClassSource = classTypeToClassSource;
|
|
7
|
+
const documentables_1 = require("./documentables");
|
|
8
|
+
const references_1 = require("./references");
|
|
9
|
+
const methods_and_constructors_1 = require("./methods-and-constructors");
|
|
10
|
+
const fields_and_properties_1 = require("./fields-and-properties");
|
|
11
|
+
function baseTypeAdapter(type, linkGenerator, baseHeadingLevel) {
|
|
12
|
+
function getHeading(type) {
|
|
13
|
+
const suffixMap = {
|
|
14
|
+
class: 'Class',
|
|
15
|
+
interface: 'Interface',
|
|
16
|
+
enum: 'Enum',
|
|
17
|
+
};
|
|
18
|
+
return `${type.name} ${suffixMap[type.type_name]}`;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
headingLevel: baseHeadingLevel,
|
|
22
|
+
heading: getHeading(type),
|
|
23
|
+
doc: (0, documentables_1.adaptDocumentable)(type, linkGenerator, baseHeadingLevel + 1),
|
|
24
|
+
name: type.name,
|
|
25
|
+
meta: {
|
|
26
|
+
accessModifier: type.access_modifier,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function typeToRenderableType(type, linkGenerator, namespace) {
|
|
31
|
+
function getRenderable() {
|
|
32
|
+
switch (type.type_name) {
|
|
33
|
+
case 'enum':
|
|
34
|
+
return enumTypeToEnumSource(type, linkGenerator);
|
|
35
|
+
case 'interface':
|
|
36
|
+
return interfaceTypeToInterfaceSource(type, linkGenerator);
|
|
37
|
+
case 'class':
|
|
38
|
+
return classTypeToClassSource(type, linkGenerator);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return Object.assign(Object.assign({}, getRenderable()), { namespace });
|
|
42
|
+
}
|
|
43
|
+
function enumTypeToEnumSource(enumType, linkGenerator, baseHeadingLevel = 1) {
|
|
44
|
+
return Object.assign(Object.assign({ type: 'enum' }, baseTypeAdapter(enumType, linkGenerator, baseHeadingLevel)), { values: {
|
|
45
|
+
headingLevel: baseHeadingLevel + 1,
|
|
46
|
+
heading: 'Values',
|
|
47
|
+
value: enumType.values.map((value) => {
|
|
48
|
+
var _a;
|
|
49
|
+
return (Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)((_a = value.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines, linkGenerator)), { value: value.name }));
|
|
50
|
+
}),
|
|
51
|
+
} });
|
|
52
|
+
}
|
|
53
|
+
function interfaceTypeToInterfaceSource(interfaceType, linkGenerator, baseHeadingLevel = 1) {
|
|
54
|
+
return Object.assign(Object.assign({ type: 'interface' }, baseTypeAdapter(interfaceType, linkGenerator, baseHeadingLevel)), { extends: interfaceType.extended_interfaces.map(references_1.linkFromTypeNameGenerator), methods: {
|
|
55
|
+
headingLevel: baseHeadingLevel + 1,
|
|
56
|
+
heading: 'Methods',
|
|
57
|
+
value: interfaceType.methods.map((method) => (0, methods_and_constructors_1.adaptMethod)(method, linkGenerator, baseHeadingLevel + 2)),
|
|
58
|
+
} });
|
|
59
|
+
}
|
|
60
|
+
function classTypeToClassSource(classType, linkGenerator, baseHeadingLevel = 1) {
|
|
61
|
+
return Object.assign(Object.assign({ type: 'class' }, baseTypeAdapter(classType, linkGenerator, baseHeadingLevel)), { classModifier: classType.classModifier, sharingModifier: classType.sharingModifier, implements: classType.implemented_interfaces.map(references_1.linkFromTypeNameGenerator), extends: classType.extended_class ? (0, references_1.linkFromTypeNameGenerator)(classType.extended_class) : undefined, methods: adaptMembers('Methods', classType.methods, methods_and_constructors_1.adaptMethod, references_1.linkFromTypeNameGenerator, baseHeadingLevel + 1), constructors: adaptMembers('Constructors', classType.constructors, (constructor, linkGenerator, baseHeadingLevel) => (0, methods_and_constructors_1.adaptConstructor)(classType.name, constructor, linkGenerator, baseHeadingLevel), references_1.linkFromTypeNameGenerator, baseHeadingLevel + 1), fields: adaptMembers('Fields', classType.fields, fields_and_properties_1.adaptFieldOrProperty, references_1.linkFromTypeNameGenerator, baseHeadingLevel + 1), properties: adaptMembers('Properties', classType.properties, fields_and_properties_1.adaptFieldOrProperty, references_1.linkFromTypeNameGenerator, baseHeadingLevel + 1), innerClasses: {
|
|
62
|
+
headingLevel: baseHeadingLevel + 1,
|
|
63
|
+
heading: 'Classes',
|
|
64
|
+
value: classType.classes.map((innerClass) => classTypeToClassSource(innerClass, linkGenerator, baseHeadingLevel + 2)),
|
|
65
|
+
}, innerEnums: {
|
|
66
|
+
headingLevel: baseHeadingLevel + 1,
|
|
67
|
+
heading: 'Enums',
|
|
68
|
+
value: classType.enums.map((innerEnum) => enumTypeToEnumSource(innerEnum, linkGenerator, baseHeadingLevel + 2)),
|
|
69
|
+
}, innerInterfaces: {
|
|
70
|
+
headingLevel: baseHeadingLevel + 1,
|
|
71
|
+
heading: 'Interfaces',
|
|
72
|
+
value: classType.interfaces.map((innerInterface) => interfaceTypeToInterfaceSource(innerInterface, linkGenerator, baseHeadingLevel + 2)),
|
|
73
|
+
} });
|
|
74
|
+
}
|
|
75
|
+
function adaptMembers(heading, members, adapter, linkFromTypeNameGenerator, headingLevel) {
|
|
76
|
+
return {
|
|
77
|
+
headingLevel,
|
|
78
|
+
heading,
|
|
79
|
+
isGrouped: hasGroup(members),
|
|
80
|
+
value: hasGroup(members)
|
|
81
|
+
? toGroupedMembers(members, adapter, linkFromTypeNameGenerator, headingLevel + 1)
|
|
82
|
+
: toFlat(members, adapter, linkFromTypeNameGenerator, headingLevel + 1),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function hasGroup(members) {
|
|
86
|
+
return members.some((member) => member.group);
|
|
87
|
+
}
|
|
88
|
+
function toFlat(members, adapter, linkGenerator, baseHeadingLevel) {
|
|
89
|
+
return members.map((member) => adapter(member, linkGenerator, baseHeadingLevel));
|
|
90
|
+
}
|
|
91
|
+
function toGroupedMembers(members, adapter, linkGenerator, baseHeadingLevel) {
|
|
92
|
+
const groupedMembers = groupByGroupName(members);
|
|
93
|
+
return Object.entries(groupedMembers).map(([groupName, members]) => singleGroup(baseHeadingLevel, groupName, adapter, members, linkGenerator));
|
|
94
|
+
}
|
|
95
|
+
function groupByGroupName(members) {
|
|
96
|
+
return members.reduce((acc, member) => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
const groupName = (_a = member.group) !== null && _a !== void 0 ? _a : 'Other';
|
|
99
|
+
acc[groupName] = (_b = acc[groupName]) !== null && _b !== void 0 ? _b : [];
|
|
100
|
+
acc[groupName].push(member);
|
|
101
|
+
return acc;
|
|
102
|
+
}, {});
|
|
103
|
+
}
|
|
104
|
+
function singleGroup(headingLevel, groupName, adapter, members, linkGenerator) {
|
|
105
|
+
return {
|
|
106
|
+
headingLevel: headingLevel,
|
|
107
|
+
heading: groupName,
|
|
108
|
+
groupDescription: members[0].groupDescription, // All fields in the group have the same description
|
|
109
|
+
value: toFlat(members, adapter, linkGenerator, headingLevel + 1),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=apex-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apex-types.js","sourceRoot":"","sources":["../../src/adapters/apex-types.ts"],"names":[],"mappings":";;AA0CA,oDAoBC;AAED,oDAiBC;AAED,wEAeC;AAED,wDAuDC;AAjJD,mDAAsE;AACtE,6CAAyF;AAEzF,yEAA2E;AAC3E,mEAA+D;AAE/D,SAAS,eAAe,CACtB,IAAgD,EAChD,aAA6C,EAC7C,gBAAwB;IAExB,SAAS,UAAU,CAAC,IAAU;QAC5B,MAAM,SAAS,GAAG;YAChB,KAAK,EAAE,OAAO;YACd,SAAS,EAAE,WAAW;YACtB,IAAI,EAAE,MAAM;SACb,CAAC;QAEF,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;IACrD,CAAC;IAED,OAAO;QACL,YAAY,EAAE,gBAAgB;QAC9B,OAAO,EAAE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ChC,CAAC;AAED,SAAS,WAAW,CAClB,YAAoB,EACpB,SAAiB,EACjB,OAAkG,EAClG,OAAY,EACZ,aAA6C;IAE7C,OAAO;QACL,YAAY,EAAE,YAAY;QAC1B,OAAO,EAAE,SAAS;QAClB,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,oDAAoD;QACnG,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,GAAG,CAAC,CAAC;KACjE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RenderableDocumentation, RenderableContent } from '../core/renderable/types';
|
|
2
|
+
import { Describable, Documentable } from './types';
|
|
3
|
+
import { GetRenderableContentByTypeName } from './references';
|
|
4
|
+
export declare function adaptDescribable(describable: Describable, linkGenerator: GetRenderableContentByTypeName): {
|
|
5
|
+
description?: RenderableContent[];
|
|
6
|
+
};
|
|
7
|
+
export declare function adaptDocumentable(documentable: Documentable, linkGenerator: GetRenderableContentByTypeName, subHeadingLevel: number): RenderableDocumentation;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adaptDescribable = adaptDescribable;
|
|
4
|
+
exports.adaptDocumentable = adaptDocumentable;
|
|
5
|
+
const references_1 = require("./references");
|
|
6
|
+
const type_utils_1 = require("./type-utils");
|
|
7
|
+
function adaptDescribable(describable, linkGenerator) {
|
|
8
|
+
function describableToRenderableContent(describable) {
|
|
9
|
+
if (!describable) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
return (describable
|
|
13
|
+
.map((line) => [
|
|
14
|
+
...(0, references_1.replaceInlineReferences)(line, linkGenerator),
|
|
15
|
+
{
|
|
16
|
+
type: 'empty-line',
|
|
17
|
+
},
|
|
18
|
+
])
|
|
19
|
+
.flatMap((line) => line)
|
|
20
|
+
// If the last element is an empty line, remove it
|
|
21
|
+
.filter((line, index, lines) => !((0, type_utils_1.isEmptyLine)(line) && index === lines.length - 1)));
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
description: describableToRenderableContent(describable),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function adaptDocumentable(documentable, linkGenerator, subHeadingLevel) {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
function extractCustomTags(type) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const baseTags = ['description', 'group', 'author', 'date', 'see', 'example', 'mermaid', 'throws', 'exception'];
|
|
32
|
+
return ((_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((currentAnnotation) => !baseTags.includes(currentAnnotation.name.toLowerCase())).map((currentAnnotation) => (Object.assign(Object.assign({}, adaptDescribable(currentAnnotation.bodyLines, linkGenerator)), { name: currentAnnotation.name })))) !== null && _b !== void 0 ? _b : []);
|
|
33
|
+
}
|
|
34
|
+
function extractAnnotationBodyLines(type, annotationName) {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
return (_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((currentAnnotation) => currentAnnotation.name.toLowerCase() === annotationName)) === null || _b === void 0 ? void 0 : _b.bodyLines;
|
|
37
|
+
}
|
|
38
|
+
function extractAnnotationBody(type, annotationName) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
return (_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((currentAnnotation) => currentAnnotation.name.toLowerCase() === annotationName)) === null || _b === void 0 ? void 0 : _b.body;
|
|
41
|
+
}
|
|
42
|
+
function extractSeeAnnotations(type) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return ((_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((currentAnnotation) => currentAnnotation.name.toLowerCase() === 'see').map((currentAnnotation) => currentAnnotation.body)) !== null && _b !== void 0 ? _b : []);
|
|
45
|
+
}
|
|
46
|
+
return Object.assign(Object.assign({}, adaptDescribable((_a = documentable.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines, linkGenerator)), { annotations: documentable.annotations.map((annotation) => annotation.type.toUpperCase()), customTags: extractCustomTags(documentable), mermaid: {
|
|
47
|
+
headingLevel: subHeadingLevel,
|
|
48
|
+
heading: 'Diagram',
|
|
49
|
+
value: extractAnnotationBodyLines(documentable, 'mermaid'),
|
|
50
|
+
}, example: {
|
|
51
|
+
headingLevel: subHeadingLevel,
|
|
52
|
+
heading: 'Example',
|
|
53
|
+
value: (_c = (_b = documentable.docComment) === null || _b === void 0 ? void 0 : _b.exampleAnnotation) === null || _c === void 0 ? void 0 : _c.bodyLines,
|
|
54
|
+
}, group: extractAnnotationBody(documentable, 'group'), author: extractAnnotationBody(documentable, 'author'), date: extractAnnotationBody(documentable, 'date'), sees: extractSeeAnnotations(documentable).map(linkGenerator) });
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=documentables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentables.js","sourceRoot":"","sources":["../../src/adapters/documentables.ts"],"names":[],"mappings":";;AAKA,4CA4BC;AAED,8CAyDC;AA1FD,6CAAuF;AACvF,6CAA2C;AAE3C,SAAgB,gBAAgB,CAC9B,WAAwB,EACxB,aAA6C;IAI7C,SAAS,8BAA8B,CAAC,WAAwB;QAC9D,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,OAAO,CACL,WAAW;aACR,GAAG,CAAsB,CAAC,IAAI,EAAE,EAAE,CAAC;YAClC,GAAG,IAAA,oCAAuB,EAAC,IAAI,EAAE,aAAa,CAAC;YAC/C;gBACE,IAAI,EAAE,YAAY;aACnB;SACF,CAAC;aACD,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;YACxB,kDAAkD;aACjD,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC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|
|
1
|
+
import { FieldMirrorWithInheritance, PropertyMirrorWithInheritance } from '../model/inheritance';
|
|
2
|
+
import { RenderableField } from '../core/renderable/types';
|
|
3
|
+
import { GetRenderableContentByTypeName } from './references';
|
|
4
|
+
export declare function adaptFieldOrProperty(field: FieldMirrorWithInheritance | PropertyMirrorWithInheritance, linkGenerator: GetRenderableContentByTypeName, baseHeadingLevel: number): RenderableField;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adaptFieldOrProperty = adaptFieldOrProperty;
|
|
4
|
+
const documentables_1 = require("./documentables");
|
|
5
|
+
const references_1 = require("./references");
|
|
6
|
+
function adaptFieldOrProperty(field, linkGenerator, baseHeadingLevel) {
|
|
7
|
+
function buildSignature() {
|
|
8
|
+
const { access_modifier, name } = field;
|
|
9
|
+
const memberModifiers = field.memberModifiers.join(' ');
|
|
10
|
+
return (`${access_modifier} ${memberModifiers} ${name}`
|
|
11
|
+
// remove double spaces
|
|
12
|
+
.replace(/ {2}/g, ' '));
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
headingLevel: baseHeadingLevel,
|
|
16
|
+
doc: (0, documentables_1.adaptDocumentable)(field, linkGenerator, baseHeadingLevel + 1),
|
|
17
|
+
heading: field.name,
|
|
18
|
+
type: {
|
|
19
|
+
headingLevel: baseHeadingLevel + 1,
|
|
20
|
+
heading: 'Type',
|
|
21
|
+
value: (0, references_1.linkFromTypeNameGenerator)(field.typeReference.rawDeclaration),
|
|
22
|
+
},
|
|
23
|
+
inherited: field.inherited,
|
|
24
|
+
accessModifier: field.access_modifier,
|
|
25
|
+
signature: {
|
|
26
|
+
headingLevel: baseHeadingLevel + 1,
|
|
27
|
+
heading: 'Signature',
|
|
28
|
+
value: [buildSignature()],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=fields-and-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields-and-properties.js","sourceRoot":"","sources":["../../src/adapters/fields-and-properties.ts"],"names":[],"mappings":";;AAKA,oDAgCC;AAnCD,mDAAoD;AACpD,6CAAyF;AAEzF,SAAgB,oBAAoB,CAClC,KAAiE,EACjE,aAA6C,EAC7C,gBAAwB;IAExB,SAAS,cAAc;QACrB,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QACxC,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,OAAO,CACL,GAAG,eAAe,IAAI,eAAe,IAAI,IAAI,EAAE;YAC7C,uBAAuB;aACtB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CACzB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,YAAY,EAAE,gBAAgB;QAC9B,GAAG,EAAE,IAAA,iCAAiB,EAAC,KAAK,EAAE,aAAa,EAAE,gBAAgB,GAAG,CAAC,CAAC;QAClE,OAAO,EAAE,KAAK,CAAC,IAAI;QACnB,IAAI,EAAE;YACJ,YAAY,EAAE,gBAAgB,GAAG,CAAC;YAClC,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,IAAA,sCAAyB,EAAC,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC;SACrE;QACD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,cAAc,EAAE,KAAK,CAAC,eAAe;QACrC,SAAS,EAAE;YACT,YAAY,EAAE,gBAAgB,GAAG,CAAC;YAClC,OAAO,EAAE,WAAW;YACpB,KAAK,EAAE,CAAC,cAAc,EAAE,CAAC;SAC1B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConstructorMirror, MethodMirror } from '@cparra/apex-reflection';
|
|
2
|
+
import { RenderableConstructor, RenderableMethod } from '../core/renderable/types';
|
|
3
|
+
import { GetRenderableContentByTypeName } from './references';
|
|
4
|
+
export declare function adaptMethod(method: MethodMirror, linkGenerator: GetRenderableContentByTypeName, baseHeadingLevel: number): RenderableMethod;
|
|
5
|
+
export declare function adaptConstructor(typeName: string, constructor: ConstructorMirror, linkGenerator: GetRenderableContentByTypeName, baseHeadingLevel: number): RenderableConstructor;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adaptMethod = adaptMethod;
|
|
4
|
+
exports.adaptConstructor = adaptConstructor;
|
|
5
|
+
const documentables_1 = require("./documentables");
|
|
6
|
+
const references_1 = require("./references");
|
|
7
|
+
function adaptMethod(method, linkGenerator, baseHeadingLevel) {
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
function buildTitle(method) {
|
|
10
|
+
const { name, parameters } = method;
|
|
11
|
+
const parametersString = parameters.map((param) => param.name).join(', ');
|
|
12
|
+
return `${name}(${parametersString})`;
|
|
13
|
+
}
|
|
14
|
+
function buildSignature(method) {
|
|
15
|
+
const { access_modifier, typeReference, name, memberModifiers } = method;
|
|
16
|
+
const parameters = method.parameters
|
|
17
|
+
.map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
|
|
18
|
+
.join(', ');
|
|
19
|
+
const members = memberModifiers.length > 0 ? `${memberModifiers.join(' ')} ` : '';
|
|
20
|
+
return `${access_modifier} ${members}${typeReference.rawDeclaration} ${name}(${parameters})`;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
headingLevel: baseHeadingLevel,
|
|
24
|
+
doc: (0, documentables_1.adaptDocumentable)(method, linkGenerator, baseHeadingLevel + 1),
|
|
25
|
+
heading: buildTitle(method),
|
|
26
|
+
signature: {
|
|
27
|
+
headingLevel: baseHeadingLevel + 1,
|
|
28
|
+
heading: 'Signature',
|
|
29
|
+
value: [buildSignature(method)],
|
|
30
|
+
},
|
|
31
|
+
returnType: {
|
|
32
|
+
headingLevel: baseHeadingLevel + 1,
|
|
33
|
+
heading: 'Return Type',
|
|
34
|
+
value: Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)((_b = (_a = method.docComment) === null || _a === void 0 ? void 0 : _a.returnAnnotation) === null || _b === void 0 ? void 0 : _b.bodyLines, linkGenerator)), { type: (0, references_1.linkFromTypeNameGenerator)(method.typeReference.rawDeclaration) }),
|
|
35
|
+
},
|
|
36
|
+
throws: {
|
|
37
|
+
headingLevel: baseHeadingLevel + 1,
|
|
38
|
+
heading: 'Throws',
|
|
39
|
+
value: (_c = method.docComment) === null || _c === void 0 ? void 0 : _c.throwsAnnotations.map((thrown) => mapThrows(thrown)),
|
|
40
|
+
},
|
|
41
|
+
parameters: {
|
|
42
|
+
headingLevel: baseHeadingLevel + 1,
|
|
43
|
+
heading: 'Parameters',
|
|
44
|
+
value: method.parameters.map((param) => mapParameters(method, param)),
|
|
45
|
+
},
|
|
46
|
+
inherited: method.inherited,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function adaptConstructor(typeName, constructor, linkGenerator, baseHeadingLevel) {
|
|
50
|
+
var _a;
|
|
51
|
+
function buildTitle(name, constructor) {
|
|
52
|
+
const { parameters } = constructor;
|
|
53
|
+
const parametersString = parameters.map((param) => param.name).join(', ');
|
|
54
|
+
return `${name}(${parametersString})`;
|
|
55
|
+
}
|
|
56
|
+
function buildSignature(name, constructor) {
|
|
57
|
+
const { access_modifier } = constructor;
|
|
58
|
+
const parameters = constructor.parameters
|
|
59
|
+
.map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
|
|
60
|
+
.join(', ');
|
|
61
|
+
return `${access_modifier} ${name}(${parameters})`;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
doc: (0, documentables_1.adaptDocumentable)(constructor, linkGenerator, baseHeadingLevel + 1),
|
|
65
|
+
headingLevel: baseHeadingLevel,
|
|
66
|
+
heading: buildTitle(typeName, constructor),
|
|
67
|
+
signature: {
|
|
68
|
+
headingLevel: baseHeadingLevel + 1,
|
|
69
|
+
heading: 'Signature',
|
|
70
|
+
value: [buildSignature(typeName, constructor)],
|
|
71
|
+
},
|
|
72
|
+
parameters: {
|
|
73
|
+
headingLevel: baseHeadingLevel + 1,
|
|
74
|
+
heading: 'Parameters',
|
|
75
|
+
value: constructor.parameters.map((param) => mapParameters(constructor, param)),
|
|
76
|
+
},
|
|
77
|
+
throws: {
|
|
78
|
+
headingLevel: baseHeadingLevel + 1,
|
|
79
|
+
heading: 'Throws',
|
|
80
|
+
value: (_a = constructor.docComment) === null || _a === void 0 ? void 0 : _a.throwsAnnotations.map((thrown) => mapThrows(thrown)),
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function mapParameters(documentable, param) {
|
|
85
|
+
var _a;
|
|
86
|
+
const paramAnnotation = (_a = documentable.docComment) === null || _a === void 0 ? void 0 : _a.paramAnnotations.find((pa) => pa.paramName.toLowerCase() === param.name.toLowerCase());
|
|
87
|
+
return Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)(paramAnnotation === null || paramAnnotation === void 0 ? void 0 : paramAnnotation.bodyLines, references_1.linkFromTypeNameGenerator)), { name: param.name, type: (0, references_1.linkFromTypeNameGenerator)(param.typeReference.rawDeclaration) });
|
|
88
|
+
}
|
|
89
|
+
function mapThrows(thrown) {
|
|
90
|
+
return Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)(thrown.bodyLines, references_1.linkFromTypeNameGenerator)), { type: (0, references_1.linkFromTypeNameGenerator)(thrown.exceptionName) });
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=methods-and-constructors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods-and-constructors.js","sourceRoot":"","sources":["../../src/adapters/methods-and-constructors.ts"],"names":[],"mappings":";;AAOA,kCAiDC;AAED,4CAwCC;AA/FD,mDAAsE;AACtE,6CAAyF;AAGzF,SAAgB,WAAW,CACzB,MAAoB,EACpB,aAA6C,EAC7C,gBAAwB;;IAExB,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C,WAAW,EAAE,CAChE,CAAC;IACF,uCACK,IAAA,gCAAgB,EAAC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,EAAE,sCAAyB,CAAC,KAC1E,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAE,IAAA,sCAAyB,EAAC,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,IACnE;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,MAAwB;IACzC,uCACK,IAAA,gCAAgB,EAAC,MAAM,CAAC,SAAS,EAAE,sCAAyB,CAAC,KAChE,IAAI,EAAE,IAAA,sCAAyB,EAAC,MAAM,CAAC,aAAa,CAAC,IACrD;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RenderableContent, StringOrLink } from '../core/renderable/types';
|
|
2
|
+
export type GetRenderableContentByTypeName = (typeName: string) => StringOrLink;
|
|
3
|
+
export declare const linkFromTypeNameGenerator: GetRenderableContentByTypeName;
|
|
4
|
+
export declare function replaceInlineReferences(text: string, linkReplacer?: GetRenderableContentByTypeName, emailReplacer?: GetRenderableContentByTypeName): RenderableContent[];
|
|
5
|
+
export declare function replaceInlineEmails(renderableContents: RenderableContent[], getLinkByTypeName: GetRenderableContentByTypeName): RenderableContent[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.linkFromTypeNameGenerator = void 0;
|
|
7
|
+
exports.replaceInlineReferences = replaceInlineReferences;
|
|
8
|
+
exports.replaceInlineEmails = replaceInlineEmails;
|
|
9
|
+
const class_file_generatorHelper_1 = __importDefault(require("../transpiler/markdown/class-file-generatorHelper"));
|
|
10
|
+
exports.linkFromTypeNameGenerator = class_file_generatorHelper_1.default.getRenderableLinkByTypeName;
|
|
11
|
+
function defaultGetEmailByReference(email) {
|
|
12
|
+
return {
|
|
13
|
+
title: email,
|
|
14
|
+
url: `mailto:${email}`,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function replaceInlineReferences(text, linkReplacer = exports.linkFromTypeNameGenerator, emailReplacer = defaultGetEmailByReference) {
|
|
18
|
+
return replaceInlineEmails(replaceInlineLinks([text], linkReplacer), emailReplacer);
|
|
19
|
+
}
|
|
20
|
+
function replaceInlineLinks(renderableContents, getLinkByTypeName) {
|
|
21
|
+
return renderableContents.flatMap((renderableContent) => inlineLinkContent(renderableContent, getLinkByTypeName));
|
|
22
|
+
}
|
|
23
|
+
function inlineLinkContent(renderableContent, getLinkByTypeName) {
|
|
24
|
+
if (typeof renderableContent !== 'string') {
|
|
25
|
+
return [renderableContent];
|
|
26
|
+
}
|
|
27
|
+
const text = renderableContent;
|
|
28
|
+
// Matches either `<<ClassName>>` or `{@link ClassName}`
|
|
29
|
+
const linkFormatRegEx = '{@link (.*?)}|<<([^>]+)>>';
|
|
30
|
+
const matches = match(linkFormatRegEx, text);
|
|
31
|
+
return createRenderableContents(matches, text, getLinkByTypeName);
|
|
32
|
+
}
|
|
33
|
+
function replaceInlineEmails(renderableContents, getLinkByTypeName) {
|
|
34
|
+
return renderableContents.flatMap((renderableContent) => inlineEmailContent(renderableContent, getLinkByTypeName));
|
|
35
|
+
}
|
|
36
|
+
function inlineEmailContent(renderableContent, getLinkByTypeName) {
|
|
37
|
+
if (typeof renderableContent !== 'string') {
|
|
38
|
+
return [renderableContent];
|
|
39
|
+
}
|
|
40
|
+
const text = renderableContent;
|
|
41
|
+
// Parsing references using the format '{@email email}'
|
|
42
|
+
const linkFormatRegEx = '{@email (.*?)}';
|
|
43
|
+
const matches = match(linkFormatRegEx, text);
|
|
44
|
+
return createRenderableContents(matches, text, getLinkByTypeName);
|
|
45
|
+
}
|
|
46
|
+
function match(regex, text) {
|
|
47
|
+
const expression = new RegExp(regex, 'gi');
|
|
48
|
+
let match;
|
|
49
|
+
const matches = [];
|
|
50
|
+
do {
|
|
51
|
+
match = expression.exec(text);
|
|
52
|
+
if (match) {
|
|
53
|
+
matches.push(match);
|
|
54
|
+
}
|
|
55
|
+
} while (match);
|
|
56
|
+
return matches;
|
|
57
|
+
}
|
|
58
|
+
function createRenderableContents(matches, text, linker) {
|
|
59
|
+
if (matches.length === 0) {
|
|
60
|
+
return [text];
|
|
61
|
+
}
|
|
62
|
+
const result = [];
|
|
63
|
+
let lastIndex = 0;
|
|
64
|
+
for (const match of matches) {
|
|
65
|
+
const index = match.index;
|
|
66
|
+
const length = match[0].length;
|
|
67
|
+
// loop through the matches (skip the first one, which is the full match)
|
|
68
|
+
// until we find the first capturing group that has a value
|
|
69
|
+
const capturedGroup = match.slice(1).find((group) => group);
|
|
70
|
+
if (!capturedGroup) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
result.push(text.slice(lastIndex, index));
|
|
74
|
+
result.push(linker(capturedGroup));
|
|
75
|
+
lastIndex = index + length;
|
|
76
|
+
}
|
|
77
|
+
if (lastIndex < text.length) {
|
|
78
|
+
result.push(text.slice(lastIndex));
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../../src/adapters/references.ts"],"names":[],"mappings":";;;;;;AAeA,0DAMC;AAyBD,kDAKC;AAnDD,mHAAyF;AAK5E,QAAA,yBAAyB,GACpC,oCAAwB,CAAC,2BAA2B,CAAC;AAEvD,SAAS,0BAA0B,CAAC,KAAa;IAC/C,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,GAAG,EAAE,UAAU,KAAK,EAAE;KACvB,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CACrC,IAAY,EACZ,eAA+C,iCAAyB,EACxE,gBAAgD,0BAA0B;IAE1E,OAAO,mBAAmB,C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,GAAG,MAAM,CAAC;IAC7B,CAAC;IAED,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEmptyLine = isEmptyLine;
|
|
4
|
+
function isEmptyLine(content) {
|
|
5
|
+
return Object.keys(content).includes('type') && content.type === 'empty-line';
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=type-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../../src/adapters/type-utils.ts"],"names":[],"mappings":";;AAEA,kCAEC;AAFD,SAAgB,WAAW,CAAC,OAA0B;IACpD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAK,OAA4B,CAAC,IAAI,KAAK,YAAY,CAAC;AACtG,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ReflectionResult } from '@cparra/apex-reflection';
|
|
2
|
-
import ApexBundle from '../model/apex-bundle';
|
|
3
|
-
/**
|
|
4
|
-
* Application entry-point to generate documentation out of Apex source files.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Apexdocs {
|
|
7
|
-
/**
|
|
8
|
-
* Generates documentation out of Apex source files.
|
|
9
|
-
*/
|
|
10
|
-
static generate(): void;
|
|
11
|
-
private static filterByScopes;
|
|
12
|
-
static _reflectionWithLogger: (apexBundle: ApexBundle) => ReflectionResult;
|
|
13
|
-
}
|
|
1
|
+
import { ReflectionResult } from '@cparra/apex-reflection';
|
|
2
|
+
import ApexBundle from '../model/apex-bundle';
|
|
3
|
+
/**
|
|
4
|
+
* Application entry-point to generate documentation out of Apex source files.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Apexdocs {
|
|
7
|
+
/**
|
|
8
|
+
* Generates documentation out of Apex source files.
|
|
9
|
+
*/
|
|
10
|
+
static generate(): void;
|
|
11
|
+
private static filterByScopes;
|
|
12
|
+
static _reflectionWithLogger: (apexBundle: ApexBundle) => ReflectionResult;
|
|
13
|
+
}
|