@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
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
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.Apexdocs = void 0;
|
|
7
|
+
const apex_file_reader_1 = require("../service/apex-file-reader");
|
|
8
|
+
const file_system_1 = require("../service/file-system");
|
|
9
|
+
const apex_reflection_1 = require("@cparra/apex-reflection");
|
|
10
|
+
const logger_1 = require("../util/logger");
|
|
11
|
+
const manifest_factory_1 = require("../service/manifest-factory");
|
|
12
|
+
const parser_1 = require("../service/parser");
|
|
13
|
+
const settings_1 = require("../settings");
|
|
14
|
+
const transpiler_1 = __importDefault(require("../transpiler/transpiler"));
|
|
15
|
+
const file_writer_1 = require("../service/file-writer");
|
|
16
|
+
const error_logger_1 = __importDefault(require("../util/error-logger"));
|
|
17
|
+
const types_repository_1 = require("../model/types-repository");
|
|
18
|
+
const factory_1 = require("../transpiler/factory");
|
|
19
|
+
/**
|
|
20
|
+
* Application entry-point to generate documentation out of Apex source files.
|
|
21
|
+
*/
|
|
22
|
+
class Apexdocs {
|
|
23
|
+
/**
|
|
24
|
+
* Generates documentation out of Apex source files.
|
|
25
|
+
*/
|
|
26
|
+
static generate() {
|
|
27
|
+
logger_1.Logger.log('Initializing...');
|
|
28
|
+
const fileBodies = apex_file_reader_1.ApexFileReader.processFiles(new file_system_1.DefaultFileSystem());
|
|
29
|
+
const manifest = (0, manifest_factory_1.createManifest)(new parser_1.RawBodyParser(fileBodies), this._reflectionWithLogger);
|
|
30
|
+
types_repository_1.TypesRepository.getInstance().populateAll(manifest.types);
|
|
31
|
+
const filteredTypes = this.filterByScopes(manifest);
|
|
32
|
+
types_repository_1.TypesRepository.getInstance().populateScoped(filteredTypes);
|
|
33
|
+
const processor = factory_1.TypeTranspilerFactory.get(settings_1.Settings.getInstance().targetGenerator);
|
|
34
|
+
transpiler_1.default.generate(filteredTypes, processor);
|
|
35
|
+
const generatedFiles = processor.fileBuilder().files();
|
|
36
|
+
const files = [];
|
|
37
|
+
file_writer_1.FileWriter.write(generatedFiles, (file) => {
|
|
38
|
+
logger_1.Logger.logSingle(`${file.name} processed.`, false, 'green', false);
|
|
39
|
+
files.push(file);
|
|
40
|
+
});
|
|
41
|
+
settings_1.Settings.getInstance().onAfterProcess(files);
|
|
42
|
+
// Error logging
|
|
43
|
+
error_logger_1.default.logErrors(filteredTypes);
|
|
44
|
+
}
|
|
45
|
+
static filterByScopes(manifest) {
|
|
46
|
+
let filteredTypes;
|
|
47
|
+
let filteredLogMessage;
|
|
48
|
+
if (settings_1.Settings.getInstance().config.targetGenerator !== 'openapi') {
|
|
49
|
+
filteredTypes = manifest.filteredByAccessModifierAndAnnotations(settings_1.Settings.getInstance().scope);
|
|
50
|
+
filteredLogMessage = `Filtered ${manifest.types.length - filteredTypes.length} file(s) based on scope: ${settings_1.Settings.getInstance().scope}`;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// If we are dealing with an OpenApi generator, we ignore the passed in access modifiers, and instead
|
|
54
|
+
// we only keep classes annotated as @RestResource
|
|
55
|
+
filteredTypes = manifest.filteredByAccessModifierAndAnnotations([
|
|
56
|
+
'restresource',
|
|
57
|
+
'httpdelete',
|
|
58
|
+
'httpget',
|
|
59
|
+
'httppatch',
|
|
60
|
+
'httppost',
|
|
61
|
+
'httpput',
|
|
62
|
+
]);
|
|
63
|
+
filteredLogMessage = `Filtered ${manifest.types.length - filteredTypes.length} file(s), only keeping classes annotated as @RestResource.`;
|
|
64
|
+
}
|
|
65
|
+
logger_1.Logger.clear();
|
|
66
|
+
logger_1.Logger.logSingle(filteredLogMessage, false, 'green', false);
|
|
67
|
+
logger_1.Logger.logSingle(`Creating documentation for ${filteredTypes.length} file(s)`, false, 'green', false);
|
|
68
|
+
return filteredTypes;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.Apexdocs = Apexdocs;
|
|
72
|
+
Apexdocs._reflectionWithLogger = (apexBundle) => {
|
|
73
|
+
var _a;
|
|
74
|
+
const result = (0, apex_reflection_1.reflect)(apexBundle.rawTypeContent);
|
|
75
|
+
if (result.error) {
|
|
76
|
+
logger_1.Logger.error(`${apexBundle.filePath} - Parsing error ${(_a = result.error) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
};
|
|
77
80
|
//# sourceMappingURL=Apexdocs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAA0E;AAC1E,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAmD;AACnD,0EAAkD;AAClD,wDAAoD;AACpD,wEAA+C;AAG/C,gEAA4D;AAC5D,mDAA8D;AAE9D;;GAEG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,QAAQ;QACb,eAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC9B,MAAM,UAAU,GAAG,iCAAc,CAAC,YAAY,CAAC,IAAI,+BAAiB,EAAE,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,IAAA,iCAAc,EAAC,IAAI,sBAAa,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC3F,kCAAe,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC1D,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACpD,kCAAe,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAC5D,MAAM,SAAS,GAAG,+BAAqB,CAAC,GAAG,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,CAAC;QACpF,oBAAU,CAAC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QAEvD,MAAM,KAAK,GAAiB,EAAE,CAAC;QAC/B,wBAAU,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,IAAgB,EAAE,EAAE;YACpD,eAAM,CAAC,SAAS,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AAK,CAAC,CAAC;QACtG,OAAO,aAAa,CAAC;IACvB,CAAC;;AAvDH,4BAgEC;AAPQ,8BAAqB,GAAG,CAAC,UAAsB,EAAoB,EAAE;;IAC1E,MAAM,MAAM,GAAG,IAAA,yBAAO,EAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAClD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,eAAM,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,QAAQ,oBAAoB,MAAA,MAAM,CAAC,KAAK,0CAAE,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/cli/generate.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export {};
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|
package/lib/cli/generate.js
CHANGED
|
@@ -1,131 +1,157 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
default:
|
|
60
|
-
describe: '
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
default: '
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
type: '
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
type: 'string',
|
|
97
|
-
describe:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
const yargs = __importStar(require("yargs"));
|
|
28
|
+
const settings_1 = require("../settings");
|
|
29
|
+
const Apexdocs_1 = require("../application/Apexdocs");
|
|
30
|
+
const cosmiconfig_1 = require("cosmiconfig");
|
|
31
|
+
const result = (0, cosmiconfig_1.cosmiconfig)('apexdocs').search();
|
|
32
|
+
result.then((config) => {
|
|
33
|
+
var _a, _b, _c;
|
|
34
|
+
yargs.config(config === null || config === void 0 ? void 0 : config.config);
|
|
35
|
+
let argv = yargs
|
|
36
|
+
.options({
|
|
37
|
+
sourceDir: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
alias: 's',
|
|
40
|
+
demandOption: true,
|
|
41
|
+
describe: 'The directory location which contains your apex .cls classes.',
|
|
42
|
+
},
|
|
43
|
+
targetDir: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
alias: 't',
|
|
46
|
+
default: './docs/',
|
|
47
|
+
describe: 'The directory location where documentation will be generated to.',
|
|
48
|
+
},
|
|
49
|
+
recursive: {
|
|
50
|
+
type: 'boolean',
|
|
51
|
+
alias: 'r',
|
|
52
|
+
default: true,
|
|
53
|
+
describe: 'Whether .cls classes will be searched for recursively in the directory provided.',
|
|
54
|
+
},
|
|
55
|
+
scope: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
array: true,
|
|
58
|
+
alias: 'p',
|
|
59
|
+
default: ['global'],
|
|
60
|
+
describe: 'A list of scopes to document. Values should be separated by a space, e.g --scope global public namespaceaccessible. ' +
|
|
61
|
+
'Annotations are supported and should be passed lowercased and without the @ symbol, e.g. namespaceaccessible auraenabled. ' +
|
|
62
|
+
'Note that this setting is ignored if generating an OpenApi REST specification since that looks for classes annotated with @RestResource.',
|
|
63
|
+
},
|
|
64
|
+
targetGenerator: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
alias: 'g',
|
|
67
|
+
default: 'jekyll',
|
|
68
|
+
choices: ['jekyll', 'docsify', 'plain-markdown', 'openapi'],
|
|
69
|
+
describe: 'Define the static file generator for which the documents will be created. ' +
|
|
70
|
+
'Currently supports jekyll, docsify, plain markdown, and OpenAPI v3.1.0.',
|
|
71
|
+
},
|
|
72
|
+
indexOnly: {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
default: false,
|
|
75
|
+
describe: 'Defines whether only the index file should be generated.',
|
|
76
|
+
},
|
|
77
|
+
defaultGroupName: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
default: 'Miscellaneous',
|
|
80
|
+
describe: 'Defines the @group name to be used when a file does not specify it.',
|
|
81
|
+
},
|
|
82
|
+
sanitizeHtml: {
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
default: true,
|
|
85
|
+
describe: 'When on, any special character within your ApexDocs is converted into its HTML code representation. ' +
|
|
86
|
+
'This is specially useful when generic objects are described within the docs, e.g. "List< Foo>", "Map<Foo, Bar>" ' +
|
|
87
|
+
'because otherwise the content within < and > would be treated as HTML tags and not shown in the output. ' +
|
|
88
|
+
'Content in @example blocks are never sanitized.',
|
|
89
|
+
},
|
|
90
|
+
openApiTitle: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
default: 'Apex REST Api',
|
|
93
|
+
describe: 'If using "openapi" as the target generator, this allows you to specify the OpenApi title value.',
|
|
94
|
+
},
|
|
95
|
+
title: {
|
|
96
|
+
type: 'string',
|
|
97
|
+
describe: "If this allows you to specify the title of the generated documentation's home file.",
|
|
98
|
+
default: 'Classes',
|
|
99
|
+
},
|
|
100
|
+
namespace: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
describe: 'The package namespace, if any. If this value is provided the namespace will be added as a prefix to all of the parsed files. ' +
|
|
103
|
+
"If generating an OpenApi definition, it will be added to the file's Server Url.",
|
|
104
|
+
},
|
|
105
|
+
openApiFileName: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
describe: 'If using "openapi" as the target generator, this allows you to specify the name of the output file.',
|
|
108
|
+
default: 'openapi',
|
|
109
|
+
},
|
|
110
|
+
sortMembersAlphabetically: {
|
|
111
|
+
type: 'boolean',
|
|
112
|
+
describe: 'Whether to sort members alphabetically.',
|
|
113
|
+
default: false,
|
|
114
|
+
},
|
|
115
|
+
includeMetadata: {
|
|
116
|
+
type: 'boolean',
|
|
117
|
+
describe: "Whether to include the file's meta.xml information: Whether it is active and and the API version",
|
|
118
|
+
default: false,
|
|
119
|
+
},
|
|
120
|
+
documentationRootDir: {
|
|
121
|
+
type: 'string',
|
|
122
|
+
describe: '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.',
|
|
123
|
+
},
|
|
124
|
+
})
|
|
125
|
+
.parseSync();
|
|
126
|
+
if (config) {
|
|
127
|
+
argv = Object.assign(Object.assign({}, config.config), argv);
|
|
128
|
+
}
|
|
129
|
+
settings_1.Settings.build({
|
|
130
|
+
sourceDirectory: argv.sourceDir,
|
|
131
|
+
recursive: argv.recursive,
|
|
132
|
+
scope: argv.scope,
|
|
133
|
+
outputDir: argv.targetDir,
|
|
134
|
+
targetGenerator: argv.targetGenerator,
|
|
135
|
+
indexOnly: argv.indexOnly,
|
|
136
|
+
defaultGroupName: argv.defaultGroupName,
|
|
137
|
+
sanitizeHtml: argv.sanitizeHtml,
|
|
138
|
+
openApiTitle: argv.openApiTitle,
|
|
139
|
+
title: argv.title,
|
|
140
|
+
namespace: argv.namespace,
|
|
141
|
+
openApiFileName: argv.openApiFileName,
|
|
142
|
+
sortMembersAlphabetically: argv.sortMembersAlphabetically,
|
|
143
|
+
includeMetadata: argv.includeMetadata,
|
|
144
|
+
rootDir: argv.documentationRootDir,
|
|
145
|
+
onAfterProcess: (_a = config === null || config === void 0 ? void 0 : config.config) === null || _a === void 0 ? void 0 : _a.onAfterProcess,
|
|
146
|
+
onBeforeFileWrite: (_b = config === null || config === void 0 ? void 0 : config.config) === null || _b === void 0 ? void 0 : _b.onBeforeFileWrite,
|
|
147
|
+
frontMatterHeader: (_c = config === null || config === void 0 ? void 0 : config.config) === null || _c === void 0 ? void 0 : _c.frontMatterHeader,
|
|
148
|
+
});
|
|
149
|
+
try {
|
|
150
|
+
Apexdocs_1.Apexdocs.generate();
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
console.error(error);
|
|
154
|
+
process.exit(1);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
131
157
|
//# sourceMappingURL=generate.js.map
|
package/lib/cli/generate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA+B;AAE/B,0CAAuC;AACvC,sDAAmD;AAEnD,6CAA0C;AAE1C,MAAM,MAAM,GAAG,IAAA,yBAAW,EAAC,UAAU,CAAC,CAAC,MAAM,EAAE,CAAC;AAChD,MAA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AI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,yBAAyB,EAAE,IAAI,CAAC,yBAAyB;QACzD,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,OAAO,EAAE,IAAI,CAAC,oBAAoB;QAClC,cAAc,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,cAAc;QAC9C,iBAAiB,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,iBAAiB;QACpD,iBAAiB,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,iBAAiB;KACrD,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,mBAAQ,CAAC,QAAQ,EAAE,CAAC;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
import * as E from 'fp-ts/Either';
|
|
3
|
+
export declare const documentType: (type: Type, linkGenerator: import("../adapters/references").GetRenderableContentByTypeName, namespace?: string | undefined) => string;
|
|
4
|
+
export type DocumentationBundle = {
|
|
5
|
+
format: 'markdown';
|
|
6
|
+
referenceGuide: string;
|
|
7
|
+
docs: DocOutput[];
|
|
8
|
+
};
|
|
9
|
+
type DocumentationConfig = {
|
|
10
|
+
scope: string[];
|
|
11
|
+
outputDir: string;
|
|
12
|
+
namespace?: string;
|
|
13
|
+
sortMembersAlphabetically?: boolean;
|
|
14
|
+
defaultGroupName: string;
|
|
15
|
+
referenceGuideTemplate: string;
|
|
16
|
+
};
|
|
17
|
+
type DocOutput = {
|
|
18
|
+
docContents: string;
|
|
19
|
+
typeName: string;
|
|
20
|
+
type: 'class' | 'interface' | 'enum';
|
|
21
|
+
};
|
|
22
|
+
export declare function generateDocs(input: string[], config?: Partial<DocumentationConfig>): E.Either<string[], DocumentationBundle>;
|
|
23
|
+
export {};
|