@cparra/apexdocs 2.25.0-alpha.1 → 2.25.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/{lib → dist}/__spec__/core/expect-extensions.js +3 -2
- package/dist/__spec__/core/expect-extensions.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-class-docs.spec.js +54 -37
- package/dist/__spec__/core/generating-class-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-enum-docs.spec.js +25 -22
- package/dist/__spec__/core/generating-enum-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-interface-docs.spec.js +33 -30
- package/dist/__spec__/core/generating-interface-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-reference-guide.spec.js +8 -7
- package/dist/__spec__/core/generating-reference-guide.spec.js.map +1 -0
- package/dist/__spec__/core/test-helpers.d.ts +2 -0
- package/dist/__spec__/core/test-helpers.js +12 -0
- package/dist/__spec__/core/test-helpers.js.map +1 -0
- package/{lib → dist}/application/Apexdocs.d.ts +4 -2
- package/{lib → dist}/application/Apexdocs.js +49 -16
- package/dist/application/Apexdocs.js.map +1 -0
- package/dist/application/generators/generate-markdown-files.d.ts +3 -0
- package/dist/application/generators/generate-markdown-files.js +64 -0
- package/dist/application/generators/generate-markdown-files.js.map +1 -0
- package/dist/cli/args.d.ts +39 -0
- package/{lib/cli/generate.js → dist/cli/args.js} +37 -40
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/generate.js +291 -0
- package/dist/cli/generate.js.map +1 -0
- package/dist/core/__test__/inheritance-chain.test.d.ts +1 -0
- package/dist/core/__test__/inheritance-chain.test.js +42 -0
- package/dist/core/__test__/inheritance-chain.test.js.map +1 -0
- package/dist/core/adapters/apex-types.d.ts +6 -0
- package/{lib → dist/core}/adapters/apex-types.js +18 -21
- package/dist/core/adapters/apex-types.js.map +1 -0
- package/{lib → dist/core}/adapters/documentables.d.ts +1 -1
- package/dist/core/adapters/documentables.js +154 -0
- package/dist/core/adapters/documentables.js.map +1 -0
- package/{lib → dist/core}/adapters/fields-and-properties.d.ts +1 -2
- package/{lib → dist/core}/adapters/fields-and-properties.js +11 -6
- package/dist/core/adapters/fields-and-properties.js.map +1 -0
- package/{lib → dist/core}/adapters/methods-and-constructors.d.ts +1 -1
- package/{lib → dist/core}/adapters/methods-and-constructors.js +24 -16
- package/dist/core/adapters/methods-and-constructors.js.map +1 -0
- package/{lib → dist/core}/adapters/references.d.ts +2 -3
- package/{lib → dist/core}/adapters/references.js +5 -9
- package/dist/core/adapters/references.js.map +1 -0
- package/dist/core/adapters/type-utils.d.ts +3 -0
- package/dist/core/adapters/type-utils.js +12 -0
- package/dist/core/adapters/type-utils.js.map +1 -0
- package/dist/core/apex-bundle.js.map +1 -0
- package/{lib → dist}/core/generate-docs.d.ts +8 -3
- package/{lib → dist}/core/generate-docs.js +79 -24
- package/dist/core/generate-docs.js.map +1 -0
- package/dist/core/inheritance-chain.d.ts +2 -0
- package/{lib/index.js → dist/core/inheritance-chain.js} +11 -4
- package/dist/core/inheritance-chain.js.map +1 -0
- package/dist/core/manifest.js.map +1 -0
- package/{lib → dist}/core/template.js +12 -7
- package/{lib → dist}/core/template.js.map +1 -1
- package/{lib → dist}/core/templates/reference-guide.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/{lib → dist}/model/markdown-file.d.ts +1 -1
- package/{lib → dist}/model/markdown-file.js +1 -1
- package/dist/model/markdown-file.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/doc-comment-annotation-util.js +3 -2
- package/dist/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/field-declaration-util.d.ts +1 -1
- package/{lib → dist}/model/markdown-generation-util/field-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/field-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/method-declaration-util.d.ts +1 -1
- package/{lib → dist}/model/markdown-generation-util/method-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/method-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/type-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/type-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-type-file.d.ts +1 -1
- package/dist/model/markdown-type-file.js.map +1 -0
- package/{lib → dist}/service/apex-file-reader.d.ts +1 -1
- package/{lib → dist}/service/apex-file-reader.js +1 -1
- package/{lib → dist}/service/apex-file-reader.js.map +1 -1
- package/{lib → dist}/service/manifest-factory.d.ts +2 -2
- package/{lib → dist}/service/manifest-factory.js +3 -2
- package/dist/service/manifest-factory.js.map +1 -0
- package/{lib → dist}/service/parser.d.ts +1 -1
- package/{lib → dist}/settings.d.ts +3 -0
- package/{lib → dist}/settings.js +3 -0
- package/{lib → dist}/settings.js.map +1 -1
- package/{lib → dist}/test-helpers/ClassMirrorBuilder.d.ts +4 -0
- package/{lib → dist}/test-helpers/ClassMirrorBuilder.js +11 -1
- package/dist/test-helpers/ClassMirrorBuilder.js.map +1 -0
- package/{lib → dist}/test-helpers/SettingsBuilder.js +1 -0
- package/{lib → dist}/test-helpers/SettingsBuilder.js.map +1 -1
- package/{lib → dist}/transpiler/factory.js +2 -4
- package/dist/transpiler/factory.js.map +1 -0
- package/{lib → dist}/transpiler/markdown/class-file-generatorHelper.d.ts +0 -2
- package/{lib → dist}/transpiler/markdown/class-file-generatorHelper.js +1 -15
- package/dist/transpiler/markdown/class-file-generatorHelper.js.map +1 -0
- package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.js +3 -3
- package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.js +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.js +6 -4
- package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.js +2 -2
- package/{lib → dist}/util/logger.js +1 -1
- package/{lib → dist}/util/logger.js.map +1 -1
- package/{lib → dist}/util/string-utils.js +2 -2
- package/{lib → dist}/util/string-utils.js.map +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.MultiInheritanceClass.md +73 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +19 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +6 -2
- package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +3 -1
- package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +2 -2
- package/examples/plain-markdown/docs/index.md +12 -13
- package/examples/plain-markdown/force-app/classes/MultiInheritanceClass.cls +1 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +16 -0
- package/jest.config.js +1 -1
- package/package.json +13 -15
- package/src/__spec__/core/generating-class-docs.spec.ts +57 -37
- package/src/__spec__/core/generating-enum-docs.spec.ts +25 -22
- package/src/__spec__/core/generating-interface-docs.spec.ts +33 -30
- package/src/__spec__/core/generating-reference-guide.spec.ts +8 -7
- package/src/__spec__/core/test-helpers.ts +9 -0
- package/src/application/Apexdocs.ts +56 -19
- package/src/application/generators/generate-markdown-files.ts +53 -0
- package/src/cli/args.ts +136 -0
- package/src/cli/generate.ts +11 -135
- package/src/core/__test__/inheritance-chain.test.ts +54 -0
- package/src/{adapters → core/adapters}/__tests__/interface-adapter.spec.ts +13 -11
- package/src/{adapters → core/adapters}/__tests__/references.spec.ts +11 -1
- package/src/{adapters → core/adapters}/apex-types.ts +54 -44
- package/src/core/adapters/documentables.ts +195 -0
- package/src/{adapters → core/adapters}/fields-and-properties.ts +13 -11
- package/src/{adapters → core/adapters}/methods-and-constructors.ts +31 -20
- package/src/{adapters → core/adapters}/references.ts +3 -6
- package/src/core/adapters/type-utils.ts +9 -0
- package/src/core/{renderable → adapters}/types.d.ts +36 -5
- package/src/core/generate-docs.ts +106 -31
- package/src/core/inheritance-chain.ts +23 -0
- package/src/core/template.ts +12 -9
- package/src/core/templates/reference-guide.ts +1 -1
- package/src/model/__tests__/manifest.spec.ts +1 -1
- package/src/model/markdown-file.ts +1 -1
- package/src/model/markdown-generation-util/field-declaration-util.ts +1 -1
- package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
- package/src/model/markdown-type-file.ts +5 -1
- package/src/service/__tests__/apex-file-reader.spec.ts +1 -0
- package/src/service/apex-file-reader.ts +1 -1
- package/src/service/manifest-factory.ts +2 -2
- package/src/service/parser.ts +1 -1
- package/src/settings.ts +6 -0
- package/src/test-helpers/ClassMirrorBuilder.ts +14 -1
- package/src/test-helpers/SettingsBuilder.ts +1 -0
- package/src/transpiler/factory.ts +2 -4
- package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -18
- package/src/transpiler/markdown/plain-markdown/class-template.ts +3 -3
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +1 -1
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +6 -4
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +1 -1
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +2 -2
- package/src/util/logger.ts +1 -1
- package/tsconfig.json +1 -1
- package/docs/.nojekyll +0 -0
- package/docs/__old/README.md +0 -1
- package/docs/__old/index.html +0 -22
- package/docs/__old/restapi.json +0 -589
- package/docs/__old/types/Classes/nspc.AnotherInterface.md +0 -22
- package/docs/__old/types/Classes/nspc.ChildClass.md +0 -97
- package/docs/__old/types/Main/nspc.GroupedClass.md +0 -10
- package/docs/__old/types/Main/nspc.SampleClass.md +0 -189
- package/docs/__old/types/Misc-Group/nspc.EscapedAnnotations.md +0 -4
- package/docs/__old/types/Misc-Group/nspc.GrandparentClass.md +0 -13
- package/docs/__old/types/Misc-Group/nspc.InterfaceWithInheritance.md +0 -29
- package/docs/__old/types/Misc-Group/nspc.MemberGrouping.md +0 -13
- package/docs/__old/types/Misc-Group/nspc.ParentClass.md +0 -37
- package/docs/__old/types/Misc-Group/nspc.Reference1.md +0 -18
- package/docs/__old/types/Misc-Group/nspc.Reference2.md +0 -12
- package/docs/__old/types/Misc-Group/nspc.Reference3.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference4.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference5.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference6.md +0 -9
- package/docs/__old/types/Misc-Group/nspc.Reference7.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -11
- package/docs/__old/types/Misc-Group/nspc.SampleRestResource.md +0 -104
- package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -33
- package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -14
- package/docs/__old/types/README.md +0 -97
- package/docs/__old/types/Sample-Interfaces/nspc.SampleInterface.md +0 -23
- package/examples/includes/header.md +0 -3
- package/lib/__spec__/core/expect-extensions.js.map +0 -1
- package/lib/__spec__/core/generating-class-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-enum-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-interface-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-reference-guide.spec.js.map +0 -1
- package/lib/adapters/apex-types.d.ts +0 -7
- package/lib/adapters/apex-types.js.map +0 -1
- package/lib/adapters/documentables.js +0 -56
- package/lib/adapters/documentables.js.map +0 -1
- package/lib/adapters/fields-and-properties.js.map +0 -1
- package/lib/adapters/methods-and-constructors.js.map +0 -1
- package/lib/adapters/references.js.map +0 -1
- package/lib/adapters/type-utils.d.ts +0 -2
- package/lib/adapters/type-utils.js +0 -7
- package/lib/adapters/type-utils.js.map +0 -1
- package/lib/application/Apexdocs.js.map +0 -1
- package/lib/cli/generate.js.map +0 -1
- package/lib/core/generate-docs.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/model/apex-bundle.js.map +0 -1
- package/lib/model/inheritance.d.ts +0 -8
- package/lib/model/inheritance.js +0 -3
- package/lib/model/inheritance.js.map +0 -1
- package/lib/model/manifest.js.map +0 -1
- package/lib/model/markdown-file.js.map +0 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +0 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +0 -1
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +0 -1
- package/lib/model/markdown-type-file.js.map +0 -1
- package/lib/service/manifest-factory.js.map +0 -1
- package/lib/test-helpers/ClassMirrorBuilder.js.map +0 -1
- package/lib/transpiler/factory.js.map +0 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -9
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +0 -42
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +0 -1
- package/src/adapters/documentables.ts +0 -93
- package/src/adapters/type-utils.ts +0 -5
- package/src/adapters/types.d.ts +0 -8
- package/src/model/inheritance.ts +0 -7
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +0 -42
- /package/{lib → dist}/__spec__/core/expect-extensions.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-class-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-enum-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-interface-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-reference-guide.spec.d.ts +0 -0
- /package/{lib → dist}/cli/generate.d.ts +0 -0
- /package/{lib/model → dist/core}/apex-bundle.d.ts +0 -0
- /package/{lib/model → dist/core}/apex-bundle.js +0 -0
- /package/{lib/model → dist/core}/manifest.d.ts +0 -0
- /package/{lib/model → dist/core}/manifest.js +0 -0
- /package/{lib → dist}/core/template.d.ts +0 -0
- /package/{lib → dist}/core/templates/reference-guide.d.ts +0 -0
- /package/{lib → dist}/core/templates/reference-guide.js.map +0 -0
- /package/{lib → dist}/index.js.map +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -0
- /package/{lib → dist}/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.d.ts +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.js +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.js.map +0 -0
- /package/{lib → dist}/model/markdown-generation-util/type-declaration-util.d.ts +0 -0
- /package/{lib → dist}/model/markdown-home-file.d.ts +0 -0
- /package/{lib → dist}/model/markdown-home-file.js +0 -0
- /package/{lib → dist}/model/markdown-home-file.js.map +0 -0
- /package/{lib → dist}/model/markdown-type-file.js +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.d.ts +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.js +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.js.map +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.d.ts +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.js +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.js.map +0 -0
- /package/{lib → dist}/model/openapi/open-api.d.ts +0 -0
- /package/{lib → dist}/model/openapi/open-api.js +0 -0
- /package/{lib → dist}/model/openapi/open-api.js.map +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.d.ts +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.js +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.js.map +0 -0
- /package/{lib → dist}/model/outputFile.d.ts +0 -0
- /package/{lib → dist}/model/outputFile.js +0 -0
- /package/{lib → dist}/model/outputFile.js.map +0 -0
- /package/{lib → dist}/model/types-repository.d.ts +0 -0
- /package/{lib → dist}/model/types-repository.js +0 -0
- /package/{lib → dist}/model/types-repository.js.map +0 -0
- /package/{lib → dist}/service/file-system.d.ts +0 -0
- /package/{lib → dist}/service/file-system.js +0 -0
- /package/{lib → dist}/service/file-system.js.map +0 -0
- /package/{lib → dist}/service/file-writer.d.ts +0 -0
- /package/{lib → dist}/service/file-writer.js +0 -0
- /package/{lib → dist}/service/file-writer.js.map +0 -0
- /package/{lib → dist}/service/metadata-processor.d.ts +0 -0
- /package/{lib → dist}/service/metadata-processor.js +0 -0
- /package/{lib → dist}/service/metadata-processor.js.map +0 -0
- /package/{lib → dist}/service/parser.js +0 -0
- /package/{lib → dist}/service/parser.js.map +0 -0
- /package/{lib → dist}/service/state.d.ts +0 -0
- /package/{lib → dist}/service/state.js +0 -0
- /package/{lib → dist}/service/state.js.map +0 -0
- /package/{lib → dist}/service/walkers/class-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/class-walker.js +0 -0
- /package/{lib → dist}/service/walkers/class-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.js +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.js +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.d.ts +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.js +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.js.map +0 -0
- /package/{lib → dist}/service/walkers/walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/walker.js +0 -0
- /package/{lib → dist}/service/walkers/walker.js.map +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/SettingsBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/factory.d.ts +0 -0
- /package/{lib → dist}/transpiler/file-container.d.ts +0 -0
- /package/{lib → dist}/transpiler/file-container.js +0 -0
- /package/{lib → dist}/transpiler/file-container.js.map +0 -0
- /package/{lib → dist}/transpiler/generator-choices.d.ts +0 -0
- /package/{lib → dist}/transpiler/generator-choices.js +0 -0
- /package/{lib → dist}/transpiler/generator-choices.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.js +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.js +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.js +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.d.ts +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.js +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.js.map +0 -0
- /package/{lib → dist}/transpiler/transpiler.d.ts +0 -0
- /package/{lib → dist}/transpiler/transpiler.js +0 -0
- /package/{lib → dist}/transpiler/transpiler.js.map +0 -0
- /package/{lib → dist}/util/error-logger.d.ts +0 -0
- /package/{lib → dist}/util/error-logger.js +0 -0
- /package/{lib → dist}/util/error-logger.js.map +0 -0
- /package/{lib → dist}/util/logger.d.ts +0 -0
- /package/{lib → dist}/util/string-utils.d.ts +0 -0
- /package/src/{model → core}/apex-bundle.ts +0 -0
- /package/src/{model → core}/manifest.ts +0 -0
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { ClassMirror, InterfaceMirror, reflect as mirrorReflection, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { classMarkdownTemplate } from '../transpiler/markdown/plain-markdown/class-template';
|
|
5
|
-
import { enumMarkdownTemplate } from '../transpiler/markdown/plain-markdown/enum-template';
|
|
6
|
-
import { interfaceMarkdownTemplate } from '../transpiler/markdown/plain-markdown/interface-template';
|
|
2
|
+
import * as O from 'fp-ts/Option';
|
|
3
|
+
import { pipe } from 'fp-ts/function';
|
|
7
4
|
import * as E from 'fp-ts/Either';
|
|
8
|
-
|
|
5
|
+
|
|
6
|
+
import { typeToRenderable } from './adapters/apex-types';
|
|
7
|
+
import { Link, Renderable, RenderableContent, RenderableEnum, StringOrLink } from './adapters/types';
|
|
9
8
|
import { CompilationRequest, Template } from './template';
|
|
10
|
-
import Manifest from '../model/manifest';
|
|
11
9
|
import { referenceGuideTemplate } from './templates/reference-guide';
|
|
12
|
-
import { adaptDescribable } from '
|
|
10
|
+
import { adaptDescribable } from './adapters/documentables';
|
|
11
|
+
import { createInheritanceChain } from './inheritance-chain';
|
|
12
|
+
import ApexBundle from './apex-bundle';
|
|
13
|
+
import Manifest from './manifest';
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
// TODO: The core should never depend on things from the outside, so it should never reference "back" (../)
|
|
16
|
+
import { classMarkdownTemplate } from '../transpiler/markdown/plain-markdown/class-template';
|
|
17
|
+
import { interfaceMarkdownTemplate } from '../transpiler/markdown/plain-markdown/interface-template';
|
|
18
|
+
import { enumMarkdownTemplate } from '../transpiler/markdown/plain-markdown/enum-template';
|
|
19
|
+
import MetadataProcessor from '../service/metadata-processor';
|
|
15
20
|
|
|
16
21
|
export type DocumentationBundle = {
|
|
17
22
|
format: 'markdown';
|
|
@@ -29,6 +34,7 @@ type DocumentationConfig = {
|
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
type DocOutput = {
|
|
37
|
+
directory: string;
|
|
32
38
|
docContents: string;
|
|
33
39
|
typeName: string;
|
|
34
40
|
type: 'class' | 'interface' | 'enum';
|
|
@@ -42,27 +48,30 @@ const configDefaults: DocumentationConfig = {
|
|
|
42
48
|
};
|
|
43
49
|
|
|
44
50
|
export function generateDocs(
|
|
45
|
-
input:
|
|
51
|
+
input: ApexBundle[],
|
|
46
52
|
config?: Partial<DocumentationConfig>,
|
|
47
|
-
): E.Either<
|
|
53
|
+
): E.Either<ReflectionError[], DocumentationBundle> {
|
|
48
54
|
const configWithDefaults = { ...configDefaults, ...config };
|
|
49
55
|
return pipe(
|
|
50
56
|
input,
|
|
51
|
-
(input) => input.map(reflectSourceBody),
|
|
57
|
+
(input) => input.map((bundle) => reflectSourceBody(bundle)),
|
|
52
58
|
checkForReflectionErrors,
|
|
53
|
-
E.map((types) => types.map((type) => addInheritedMembers(type, types))),
|
|
54
59
|
E.map((types) => filterTypesOutOfScope(types, configWithDefaults.scope)),
|
|
60
|
+
E.map((types) => types.map((type) => addInheritedMembers(type, types))),
|
|
61
|
+
E.map((types) => types.map((type) => addInheritanceChain(type, types))),
|
|
55
62
|
E.map((types) => typesToRenderableBundle(types, configWithDefaults)),
|
|
56
63
|
E.map(({ references, renderables }) => ({
|
|
57
64
|
referenceGuide: pipe(referencesToReferenceGuide(references, configWithDefaults.referenceGuideTemplate)),
|
|
58
|
-
docs: renderables.map(renderableToOutputDoc),
|
|
65
|
+
docs: renderables.map((renderable) => renderableToOutputDoc(Object.values(references).flat(), renderable)),
|
|
59
66
|
})),
|
|
60
67
|
E.map(({ referenceGuide, docs }) => ({ format: 'markdown', referenceGuide: referenceGuide, docs })),
|
|
61
68
|
);
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
type ReferenceGuideReference = {
|
|
65
|
-
|
|
72
|
+
typeName: string;
|
|
73
|
+
directory: string;
|
|
74
|
+
title: Link;
|
|
66
75
|
description: RenderableContent[] | undefined;
|
|
67
76
|
};
|
|
68
77
|
|
|
@@ -77,7 +86,7 @@ type RenderableBundle = {
|
|
|
77
86
|
function typesToRenderableBundle(types: Type[], config: DocumentationConfig) {
|
|
78
87
|
return types.reduce<RenderableBundle>(
|
|
79
88
|
(acc, type) => {
|
|
80
|
-
const renderable =
|
|
89
|
+
const renderable = typeToRenderable(
|
|
81
90
|
type,
|
|
82
91
|
(referenceName) => {
|
|
83
92
|
return linkFromTypeNameGenerator(type, types, referenceName, config);
|
|
@@ -88,11 +97,12 @@ function typesToRenderableBundle(types: Type[], config: DocumentationConfig) {
|
|
|
88
97
|
|
|
89
98
|
const descriptionLines = type.docComment?.descriptionLines;
|
|
90
99
|
const reference = {
|
|
100
|
+
typeName: type.name,
|
|
101
|
+
directory: getDirectoryFromRoot(config, type),
|
|
91
102
|
title: getLinkFromRoot(config, type),
|
|
92
|
-
description: adaptDescribable(descriptionLines, (referenceName) =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}).description,
|
|
103
|
+
description: adaptDescribable(descriptionLines, (referenceName) =>
|
|
104
|
+
getPossibleLinkFromRoot(config, referenceName, findType(types, referenceName)),
|
|
105
|
+
).description,
|
|
96
106
|
};
|
|
97
107
|
|
|
98
108
|
const group = getTypeGroup(type, config);
|
|
@@ -110,9 +120,13 @@ function typesToRenderableBundle(types: Type[], config: DocumentationConfig) {
|
|
|
110
120
|
);
|
|
111
121
|
}
|
|
112
122
|
|
|
113
|
-
function renderableToOutputDoc(renderable: Renderable): DocOutput {
|
|
123
|
+
function renderableToOutputDoc(referenceGuideReference: ReferenceGuideReference[], renderable: Renderable): DocOutput {
|
|
114
124
|
function buildDocOutput(renderable: Renderable, docContents: string): DocOutput {
|
|
125
|
+
const reference = referenceGuideReference.find(
|
|
126
|
+
(ref) => ref.typeName.toLowerCase() === renderable.name.toLowerCase(),
|
|
127
|
+
);
|
|
115
128
|
return {
|
|
129
|
+
directory: reference!.directory,
|
|
116
130
|
docContents,
|
|
117
131
|
typeName: renderable.name,
|
|
118
132
|
type: renderable.type,
|
|
@@ -149,12 +163,12 @@ function filterTypesOutOfScope(types: Type[], scope: string[]): Type[] {
|
|
|
149
163
|
return new Manifest(types).filteredByAccessModifierAndAnnotations(scope);
|
|
150
164
|
}
|
|
151
165
|
|
|
152
|
-
function checkForReflectionErrors(reflectionResult: E.Either<
|
|
153
|
-
function reduceReflectionResultIntoSingleEither(results: E.Either<
|
|
154
|
-
errors:
|
|
166
|
+
function checkForReflectionErrors(reflectionResult: E.Either<ReflectionError, Type>[]) {
|
|
167
|
+
function reduceReflectionResultIntoSingleEither(results: E.Either<ReflectionError, Type>[]): {
|
|
168
|
+
errors: ReflectionError[];
|
|
155
169
|
types: Type[];
|
|
156
170
|
} {
|
|
157
|
-
return results.reduce<{ errors:
|
|
171
|
+
return results.reduce<{ errors: ReflectionError[]; types: Type[] }>(
|
|
158
172
|
(acc, result) => {
|
|
159
173
|
E.isLeft(result) ? acc.errors.push(result.left) : acc.types.push(result.right);
|
|
160
174
|
return acc;
|
|
@@ -171,10 +185,39 @@ function checkForReflectionErrors(reflectionResult: E.Either<string, Type>[]) {
|
|
|
171
185
|
);
|
|
172
186
|
}
|
|
173
187
|
|
|
174
|
-
function
|
|
188
|
+
function addFileMetadataToTypeAnnotation(type: Type, metadata: string | null): Type {
|
|
189
|
+
return pipe(
|
|
190
|
+
O.fromNullable(metadata),
|
|
191
|
+
O.map((metadata) => {
|
|
192
|
+
const metadataParams = MetadataProcessor.process(metadata);
|
|
193
|
+
metadataParams.forEach((value, key) => {
|
|
194
|
+
const declaration = `${key}: ${value}`;
|
|
195
|
+
type.annotations.push({
|
|
196
|
+
rawDeclaration: declaration,
|
|
197
|
+
name: declaration,
|
|
198
|
+
type: declaration,
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
return type;
|
|
202
|
+
}),
|
|
203
|
+
O.getOrElse(() => type),
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export class ReflectionError {
|
|
208
|
+
constructor(
|
|
209
|
+
public file: string,
|
|
210
|
+
public message: string,
|
|
211
|
+
) {}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function reflectSourceBody(apexBundle: ApexBundle): E.Either<ReflectionError, Type> {
|
|
215
|
+
const { filePath, rawTypeContent: input, rawMetadataContent: metadata } = apexBundle;
|
|
175
216
|
const result = mirrorReflection(input);
|
|
176
217
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
177
|
-
return result.error
|
|
218
|
+
return result.error
|
|
219
|
+
? E.left(new ReflectionError(filePath, result.error.message))
|
|
220
|
+
: E.right(addFileMetadataToTypeAnnotation(result.typeMirror!, metadata));
|
|
178
221
|
}
|
|
179
222
|
|
|
180
223
|
function resolveApexTypeTemplate(renderable: Renderable): CompilationRequest {
|
|
@@ -213,6 +256,18 @@ function addInheritedMembers<T extends Type>(current: T, repository: Type[]): T
|
|
|
213
256
|
}
|
|
214
257
|
}
|
|
215
258
|
|
|
259
|
+
function addInheritanceChain<T extends Type>(current: T, repository: Type[]): T {
|
|
260
|
+
if (current.type_name === 'enum' || current.type_name === 'interface') {
|
|
261
|
+
return current;
|
|
262
|
+
} else {
|
|
263
|
+
const inheritanceChain = createInheritanceChain(repository, current as ClassMirror);
|
|
264
|
+
return {
|
|
265
|
+
...current,
|
|
266
|
+
inheritanceChain,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
216
271
|
function getParents<T extends Type>(
|
|
217
272
|
extendedNamesExtractor: (current: T) => string[],
|
|
218
273
|
current: T,
|
|
@@ -308,6 +363,7 @@ function linkFromTypeNameGenerator(
|
|
|
308
363
|
|
|
309
364
|
const [fullClassName, fileLink] = getFileLinkTuple(typeBeingDocumented, type, config);
|
|
310
365
|
return {
|
|
366
|
+
__type: 'link',
|
|
311
367
|
title: fullClassName,
|
|
312
368
|
url: fileLink,
|
|
313
369
|
};
|
|
@@ -326,14 +382,33 @@ function getFileLinkTuple(
|
|
|
326
382
|
return [fullClassName, `${directoryRoot}${fullClassName}.md`];
|
|
327
383
|
}
|
|
328
384
|
|
|
329
|
-
function
|
|
385
|
+
function getDirectoryFromRoot(config: DocumentationConfig, type?: Type): string {
|
|
330
386
|
if (!type) {
|
|
331
387
|
return '';
|
|
332
388
|
}
|
|
333
|
-
|
|
389
|
+
return `./${getSanitizedGroup(type, config)}`;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function getPossibleLinkFromRoot(config: DocumentationConfig, fallback: string, type?: Type): StringOrLink {
|
|
393
|
+
if (!type) {
|
|
394
|
+
return fallback;
|
|
395
|
+
}
|
|
396
|
+
const namespacePrefix = config.namespace ? `${config.namespace}.` : '';
|
|
397
|
+
const title = `${namespacePrefix}${type.name}`;
|
|
398
|
+
return {
|
|
399
|
+
__type: 'link',
|
|
400
|
+
title: title,
|
|
401
|
+
url: `${getDirectoryFromRoot(config, type)}/${title}.md`,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function getLinkFromRoot(config: DocumentationConfig, type: Type): Link {
|
|
406
|
+
const namespacePrefix = config.namespace ? `${config.namespace}.` : '';
|
|
407
|
+
const title = `${namespacePrefix}${type.name}`;
|
|
334
408
|
return {
|
|
335
|
-
|
|
336
|
-
|
|
409
|
+
__type: 'link',
|
|
410
|
+
title: title,
|
|
411
|
+
url: `${getDirectoryFromRoot(config, type)}/${title}.md`,
|
|
337
412
|
};
|
|
338
413
|
}
|
|
339
414
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ClassMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
+
import { pipe } from 'fp-ts/function';
|
|
3
|
+
import * as O from 'fp-ts/Option';
|
|
4
|
+
|
|
5
|
+
export function createInheritanceChain(repository: Type[], classMirror: ClassMirror): string[] {
|
|
6
|
+
return pipe(
|
|
7
|
+
O.fromNullable(classMirror.extended_class),
|
|
8
|
+
O.match(
|
|
9
|
+
() => [],
|
|
10
|
+
(extendedClassName) => inheritanceChainFromParentClassName(repository, extendedClassName),
|
|
11
|
+
),
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function inheritanceChainFromParentClassName(repository: Type[], className: string): string[] {
|
|
16
|
+
return pipe(
|
|
17
|
+
O.fromNullable(repository.find((type) => type.name.toLowerCase() === className.toLowerCase())),
|
|
18
|
+
O.match(
|
|
19
|
+
() => [className],
|
|
20
|
+
(extendedClass: Type) => [className, ...createInheritanceChain(repository, extendedClass as ClassMirror)],
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
}
|
package/src/core/template.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { fieldsPartialTemplate } from '../transpiler/markdown/plain-markdown/fie
|
|
|
7
7
|
import { classMarkdownTemplate } from '../transpiler/markdown/plain-markdown/class-template';
|
|
8
8
|
import { enumMarkdownTemplate } from '../transpiler/markdown/plain-markdown/enum-template';
|
|
9
9
|
import { interfaceMarkdownTemplate } from '../transpiler/markdown/plain-markdown/interface-template';
|
|
10
|
-
import { RenderableContent, StringOrLink } from './
|
|
11
|
-
import { isEmptyLine } from '
|
|
10
|
+
import { CodeBlock, RenderableContent, StringOrLink } from './adapters/types';
|
|
11
|
+
import { isCodeBlock, isEmptyLine } from './adapters/type-utils';
|
|
12
12
|
import { groupedMembersPartialTemplate } from '../transpiler/markdown/plain-markdown/grouped-members-partial-template';
|
|
13
13
|
|
|
14
14
|
export type CompilationRequest = {
|
|
@@ -32,7 +32,7 @@ export class Template {
|
|
|
32
32
|
|
|
33
33
|
Handlebars.registerHelper('link', link);
|
|
34
34
|
Handlebars.registerHelper('code', convertCodeBlock);
|
|
35
|
-
Handlebars.registerHelper('
|
|
35
|
+
Handlebars.registerHelper('renderContent', resolveRenderableContent);
|
|
36
36
|
Handlebars.registerHelper('heading', heading);
|
|
37
37
|
Handlebars.registerHelper('inlineCode', inlineCode);
|
|
38
38
|
Handlebars.registerHelper('splitAndCapitalize', splitAndCapitalize);
|
|
@@ -73,17 +73,17 @@ const inlineCode = (text: string) => {
|
|
|
73
73
|
return new Handlebars.SafeString(`\`${text}\``);
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
const convertCodeBlock = (
|
|
76
|
+
const convertCodeBlock = (codeBlock: CodeBlock): Handlebars.SafeString => {
|
|
77
77
|
return new Handlebars.SafeString(
|
|
78
78
|
`
|
|
79
|
-
\`\`\`${language}
|
|
80
|
-
${
|
|
79
|
+
\`\`\`${codeBlock.language}
|
|
80
|
+
${codeBlock.content.join('\n')}
|
|
81
81
|
\`\`\`
|
|
82
82
|
`.trim(),
|
|
83
83
|
);
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
const
|
|
86
|
+
const resolveRenderableContent = (description?: RenderableContent[]): string => {
|
|
87
87
|
if (!description) {
|
|
88
88
|
return '';
|
|
89
89
|
}
|
|
@@ -92,8 +92,11 @@ const resolveLinksInContent = (description?: RenderableContent[]): string => {
|
|
|
92
92
|
if (isEmptyLine(curr)) {
|
|
93
93
|
return acc + '\n\n';
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
if (isCodeBlock(curr)) {
|
|
96
|
+
return acc + convertCodeBlock(curr) + '\n';
|
|
97
|
+
} else {
|
|
98
|
+
return acc + Handlebars.escapeExpression(link(curr)).trim() + ' ';
|
|
99
|
+
}
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
return description.reduce(reduceDescription, '').trim();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarkdownFile } from '../markdown-file';
|
|
2
|
-
import { FieldMirrorWithInheritance, FieldOrProperty, PropertyMirrorWithInheritance } from '
|
|
2
|
+
import { FieldMirrorWithInheritance, FieldOrProperty, PropertyMirrorWithInheritance } from '../../core/adapters/types';
|
|
3
3
|
|
|
4
4
|
export function declareField(
|
|
5
5
|
markdownFile: MarkdownFile,
|
|
@@ -2,7 +2,7 @@ import { ConstructorMirror, DocComment } from '@cparra/apex-reflection';
|
|
|
2
2
|
import { MarkdownFile } from '../markdown-file';
|
|
3
3
|
import { ParameterMirror } from '@cparra/apex-reflection';
|
|
4
4
|
import { addCustomDocCommentAnnotations, addMermaid } from './doc-comment-annotation-util';
|
|
5
|
-
import { MethodMirrorWithInheritance } from '
|
|
5
|
+
import { MethodMirrorWithInheritance } from '../../core/adapters/types';
|
|
6
6
|
|
|
7
7
|
export function declareMethod(
|
|
8
8
|
markdownFile: MarkdownFile,
|
|
@@ -11,8 +11,12 @@ import { WalkerListener } from '../service/walkers/walker';
|
|
|
11
11
|
import { MarkdownFile } from './markdown-file';
|
|
12
12
|
import { declareType, declareMethod, declareField } from './markdown-generation-util';
|
|
13
13
|
import ClassFileGeneratorHelper from '../transpiler/markdown/class-file-generatorHelper';
|
|
14
|
-
import { FieldMirrorWithInheritance, MethodMirrorWithInheritance, PropertyMirrorWithInheritance } from './inheritance';
|
|
15
14
|
import { Settings } from '../settings';
|
|
15
|
+
import {
|
|
16
|
+
FieldMirrorWithInheritance,
|
|
17
|
+
MethodMirrorWithInheritance,
|
|
18
|
+
PropertyMirrorWithInheritance
|
|
19
|
+
} from '../core/adapters/types';
|
|
16
20
|
|
|
17
21
|
interface GroupAware {
|
|
18
22
|
group?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Manifest from '../
|
|
1
|
+
import Manifest from '../core/manifest';
|
|
2
2
|
import { TypeParser } from './parser';
|
|
3
3
|
import { ReflectionResult } from '@cparra/apex-reflection';
|
|
4
|
-
import ApexBundle from '../
|
|
4
|
+
import ApexBundle from '../core/apex-bundle';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Builds a new Manifest object, sourcing its types from the received TypeParser.
|
package/src/service/parser.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClassMirror, InterfaceMirror, ReflectionResult, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import ApexBundle from '../
|
|
2
|
+
import ApexBundle from '../core/apex-bundle';
|
|
3
3
|
import MetadataProcessor from './metadata-processor';
|
|
4
4
|
import { Logger } from '../util/logger';
|
|
5
5
|
|
package/src/settings.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GeneratorChoices } from './transpiler/generator-choices';
|
|
2
|
+
import { LinkingStrategy } from './transpiler/processor-type-transpiler';
|
|
2
3
|
|
|
3
4
|
export type OnBeforeFileWrite = (file: TargetFile) => TargetFile;
|
|
4
5
|
|
|
@@ -40,6 +41,7 @@ export interface SettingsConfig {
|
|
|
40
41
|
onAfterProcess?: (files: TargetFile[]) => void;
|
|
41
42
|
onBeforeFileWrite?: (file: TargetFile) => TargetFile;
|
|
42
43
|
frontMatterHeader?: (file: TargetType) => string[];
|
|
44
|
+
linkingStrategy: LinkingStrategy;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
export class Settings {
|
|
@@ -144,4 +146,8 @@ export class Settings {
|
|
|
144
146
|
}
|
|
145
147
|
return [];
|
|
146
148
|
}
|
|
149
|
+
|
|
150
|
+
public getLinkingStrategy(): LinkingStrategy {
|
|
151
|
+
return this.config.linkingStrategy;
|
|
152
|
+
}
|
|
147
153
|
}
|
|
@@ -10,6 +10,8 @@ export class ClassMirrorBuilder {
|
|
|
10
10
|
private docComment?: DocComment;
|
|
11
11
|
private methods: MethodMirror[] = [];
|
|
12
12
|
private fields: FieldMirror[] = [];
|
|
13
|
+
private innerClasses: ClassMirror[] = [];
|
|
14
|
+
private extendedClass: string | undefined;
|
|
13
15
|
|
|
14
16
|
withName(name: string): ClassMirrorBuilder {
|
|
15
17
|
this.name = name;
|
|
@@ -36,6 +38,16 @@ export class ClassMirrorBuilder {
|
|
|
36
38
|
return this;
|
|
37
39
|
}
|
|
38
40
|
|
|
41
|
+
addInnerClass(innerClass: ClassMirror): ClassMirrorBuilder {
|
|
42
|
+
this.innerClasses.push(innerClass);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
withExtendedClass(extendedClass: string): ClassMirrorBuilder {
|
|
47
|
+
this.extendedClass = extendedClass;
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
|
|
39
51
|
build(): ClassMirror {
|
|
40
52
|
return {
|
|
41
53
|
annotations: this.annotations,
|
|
@@ -48,9 +60,10 @@ export class ClassMirrorBuilder {
|
|
|
48
60
|
constructors: [],
|
|
49
61
|
enums: [],
|
|
50
62
|
interfaces: [],
|
|
51
|
-
classes:
|
|
63
|
+
classes: this.innerClasses,
|
|
52
64
|
access_modifier: 'public',
|
|
53
65
|
docComment: this.docComment,
|
|
66
|
+
extended_class: this.extendedClass,
|
|
54
67
|
};
|
|
55
68
|
}
|
|
56
69
|
}
|
|
@@ -2,7 +2,6 @@ import ProcessorTypeTranspiler from './processor-type-transpiler';
|
|
|
2
2
|
import { GeneratorChoices } from './generator-choices';
|
|
3
3
|
import { JekyllDocsProcessor } from './markdown/jekyll/jekyll-docsProcessor';
|
|
4
4
|
import DocsifyDocsProcessor from './markdown/docsify/docsify-docs-processor';
|
|
5
|
-
import { PlainMarkdownDocsProcessor } from './markdown/plain-markdown/plain-docsProcessor';
|
|
6
5
|
import { OpenApiDocsProcessor } from './openapi/open-api-docs-processor';
|
|
7
6
|
|
|
8
7
|
export class TypeTranspilerFactory {
|
|
@@ -20,12 +19,11 @@ export class TypeTranspilerFactory {
|
|
|
20
19
|
case 'docsify':
|
|
21
20
|
this.typeTranspilerCache = new DocsifyDocsProcessor();
|
|
22
21
|
return this.typeTranspilerCache;
|
|
23
|
-
case 'plain-markdown':
|
|
24
|
-
this.typeTranspilerCache = new PlainMarkdownDocsProcessor();
|
|
25
|
-
return this.typeTranspilerCache;
|
|
26
22
|
case 'openapi':
|
|
27
23
|
this.typeTranspilerCache = new OpenApiDocsProcessor();
|
|
28
24
|
return this.typeTranspilerCache;
|
|
25
|
+
case 'plain-markdown':
|
|
26
|
+
throw Error('Plain Markdown processor is not supported through this factory anymore.');
|
|
29
27
|
default:
|
|
30
28
|
throw Error('Invalid target generator');
|
|
31
29
|
}
|
|
@@ -2,8 +2,6 @@ import { Type } from '@cparra/apex-reflection';
|
|
|
2
2
|
import { TypesRepository } from '../../model/types-repository';
|
|
3
3
|
import { Settings } from '../../settings';
|
|
4
4
|
import State from '../../service/state';
|
|
5
|
-
import { TypeTranspilerFactory } from '../factory';
|
|
6
|
-
import { StringOrLink } from '../../core/renderable/types';
|
|
7
5
|
|
|
8
6
|
export default class ClassFileGeneratorHelper {
|
|
9
7
|
public static getSanitizedGroup(classModel: Type) {
|
|
@@ -32,24 +30,9 @@ export default class ClassFileGeneratorHelper {
|
|
|
32
30
|
return this.getFileLink(type);
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
public static getRenderableLinkByTypeName(typeName: string): StringOrLink {
|
|
36
|
-
const type = TypesRepository.getInstance().getFromScopedByName(typeName);
|
|
37
|
-
if (!type) {
|
|
38
|
-
// If the type is not found, we return the type name as a string.
|
|
39
|
-
return typeName;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const [fullClassName, fileLink] = ClassFileGeneratorHelper.getFileLinkTuple(type);
|
|
43
|
-
return {
|
|
44
|
-
title: fullClassName,
|
|
45
|
-
url: fileLink,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
33
|
private static getDirectoryRoot(classModel: Type) {
|
|
50
34
|
// root-relative links start from the root by using a leading '/'
|
|
51
|
-
|
|
52
|
-
if (TypeTranspilerFactory.get(generator).getLinkingStrategy() === 'root-relative') {
|
|
35
|
+
if (Settings.getInstance().getLinkingStrategy() === 'root-relative') {
|
|
53
36
|
return `/${this.getSanitizedGroup(classModel)}/`;
|
|
54
37
|
}
|
|
55
38
|
|
|
@@ -6,9 +6,9 @@ export const classMarkdownTemplate = `
|
|
|
6
6
|
|
|
7
7
|
{{> typeDocumentation}}
|
|
8
8
|
|
|
9
|
-
{{#if extends}}
|
|
10
|
-
**
|
|
11
|
-
{{
|
|
9
|
+
{{#if extends.length}}
|
|
10
|
+
**Inheritance**
|
|
11
|
+
{{#each extends}}{{link this}}{{#unless @last}} < {{/unless}}{{/each}}
|
|
12
12
|
{{/if}}
|
|
13
13
|
|
|
14
14
|
{{#if implements}}
|
|
@@ -6,7 +6,7 @@ export const constructorsPartialTemplate = `
|
|
|
6
6
|
{{#> documentablePartialTemplate}}
|
|
7
7
|
|
|
8
8
|
{{ heading signature.headingLevel signature.heading }}
|
|
9
|
-
{{ code
|
|
9
|
+
{{ code signature.value }}
|
|
10
10
|
|
|
11
11
|
{{#if parameters.value}}
|
|
12
12
|
{{ heading parameters.headingLevel parameters.heading }}
|
|
@@ -3,10 +3,12 @@ export const documentablePartialTemplate = `
|
|
|
3
3
|
\`{{this}}\`
|
|
4
4
|
{{/each}}
|
|
5
5
|
|
|
6
|
-
{{
|
|
6
|
+
{{{renderContent doc.description}}}
|
|
7
7
|
|
|
8
8
|
{{#each doc.customTags}}
|
|
9
|
-
**{{splitAndCapitalize name}}**
|
|
9
|
+
**{{splitAndCapitalize name}}**
|
|
10
|
+
|
|
11
|
+
{{{renderContent description}}}
|
|
10
12
|
|
|
11
13
|
{{/each}}
|
|
12
14
|
|
|
@@ -14,11 +16,11 @@ export const documentablePartialTemplate = `
|
|
|
14
16
|
|
|
15
17
|
{{#if doc.mermaid.value}}
|
|
16
18
|
{{ heading doc.mermaid.headingLevel doc.mermaid.heading }}
|
|
17
|
-
{{code
|
|
19
|
+
{{code doc.mermaid.value}}
|
|
18
20
|
{{/if}}
|
|
19
21
|
|
|
20
22
|
{{#if doc.example.value}}
|
|
21
23
|
{{ heading doc.example.headingLevel doc.example.heading }}
|
|
22
|
-
{{code
|
|
24
|
+
{{code doc.example.value}}
|
|
23
25
|
{{/if}}
|
|
24
26
|
`.trim();
|
|
@@ -10,7 +10,7 @@ export const fieldsPartialTemplate = `
|
|
|
10
10
|
{{#> documentablePartialTemplate }}
|
|
11
11
|
|
|
12
12
|
{{ heading signature.headingLevel signature.heading }}
|
|
13
|
-
{{ code
|
|
13
|
+
{{ code signature.value }}
|
|
14
14
|
|
|
15
15
|
{{ heading type.headingLevel type.heading }}
|
|
16
16
|
{{link type.value}}
|
|
@@ -10,14 +10,14 @@ export const methodsPartialTemplate = `
|
|
|
10
10
|
{{#> documentablePartialTemplate}}
|
|
11
11
|
|
|
12
12
|
{{ heading signature.headingLevel signature.heading }}
|
|
13
|
-
{{ code
|
|
13
|
+
{{ code signature.value }}
|
|
14
14
|
|
|
15
15
|
{{#if parameters.value}}
|
|
16
16
|
{{ heading parameters.headingLevel parameters.heading }}
|
|
17
17
|
| Name | Type | Description |
|
|
18
18
|
|------|------|-------------|
|
|
19
19
|
{{#each parameters.value}}
|
|
20
|
-
| {{name}} | {{link type}} | {{
|
|
20
|
+
| {{name}} | {{link type}} | {{{renderContent description}}} |
|
|
21
21
|
{{/each}}
|
|
22
22
|
{{/if}}
|
|
23
23
|
|
package/src/util/logger.ts
CHANGED
package/tsconfig.json
CHANGED
package/docs/.nojekyll
DELETED
|
File without changes
|
package/docs/__old/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Go to [docs](/types/README.md) for more information.
|