@cparra/apexdocs 2.25.0-alpha.2 → 2.25.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/{lib → dist}/__spec__/core/expect-extensions.js +3 -2
- package/dist/__spec__/core/expect-extensions.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-class-docs.spec.js +54 -37
- package/dist/__spec__/core/generating-class-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-enum-docs.spec.js +25 -22
- package/dist/__spec__/core/generating-enum-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-interface-docs.spec.js +33 -30
- package/dist/__spec__/core/generating-interface-docs.spec.js.map +1 -0
- package/{lib → dist}/__spec__/core/generating-reference-guide.spec.js +8 -7
- package/dist/__spec__/core/generating-reference-guide.spec.js.map +1 -0
- package/dist/__spec__/core/test-helpers.d.ts +2 -0
- package/dist/__spec__/core/test-helpers.js +12 -0
- package/dist/__spec__/core/test-helpers.js.map +1 -0
- package/{lib → dist}/application/Apexdocs.d.ts +4 -2
- package/{lib → dist}/application/Apexdocs.js +30 -3
- package/dist/application/Apexdocs.js.map +1 -0
- package/{lib/application/flows → dist/application/generators}/generate-markdown-files.d.ts +1 -1
- package/{lib/application/flows → dist/application/generators}/generate-markdown-files.js +9 -2
- package/dist/application/generators/generate-markdown-files.js.map +1 -0
- package/dist/cli/args.d.ts +39 -0
- package/{lib/cli/generate.js → dist/cli/args.js} +37 -40
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/generate.js +291 -0
- package/dist/cli/generate.js.map +1 -0
- package/dist/core/adapters/apex-types.d.ts +6 -0
- package/{lib → dist/core}/adapters/apex-types.js +3 -3
- package/dist/core/adapters/apex-types.js.map +1 -0
- package/{lib → dist/core}/adapters/documentables.d.ts +1 -1
- package/dist/core/adapters/documentables.js +154 -0
- package/dist/core/adapters/documentables.js.map +1 -0
- package/{lib → dist/core}/adapters/fields-and-properties.d.ts +1 -2
- package/{lib → dist/core}/adapters/fields-and-properties.js +10 -4
- package/dist/core/adapters/fields-and-properties.js.map +1 -0
- package/{lib → dist/core}/adapters/methods-and-constructors.d.ts +1 -1
- package/{lib → dist/core}/adapters/methods-and-constructors.js +15 -6
- package/dist/core/adapters/methods-and-constructors.js.map +1 -0
- package/{lib → dist/core}/adapters/references.d.ts +2 -3
- package/{lib → dist/core}/adapters/references.js +5 -9
- package/dist/core/adapters/references.js.map +1 -0
- package/dist/core/adapters/type-utils.d.ts +3 -0
- package/dist/core/adapters/type-utils.js +12 -0
- package/dist/core/adapters/type-utils.js.map +1 -0
- package/dist/core/apex-bundle.js.map +1 -0
- package/{lib → dist}/core/generate-docs.d.ts +7 -3
- package/{lib → dist}/core/generate-docs.js +43 -14
- package/dist/core/generate-docs.js.map +1 -0
- package/{lib → dist}/core/inheritance-chain.js +2 -1
- package/dist/core/inheritance-chain.js.map +1 -0
- package/dist/core/manifest.js.map +1 -0
- package/{lib → dist}/core/template.js +12 -7
- package/{lib → dist}/core/template.js.map +1 -1
- package/{lib → dist}/core/templates/reference-guide.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/{lib → dist}/model/markdown-generation-util/doc-comment-annotation-util.js +3 -2
- package/dist/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/field-declaration-util.d.ts +1 -1
- package/{lib → dist}/model/markdown-generation-util/field-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/field-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/method-declaration-util.d.ts +1 -1
- package/{lib → dist}/model/markdown-generation-util/method-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/method-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-generation-util/type-declaration-util.js +2 -1
- package/dist/model/markdown-generation-util/type-declaration-util.js.map +1 -0
- package/{lib → dist}/model/markdown-type-file.d.ts +1 -1
- package/dist/model/markdown-type-file.js.map +1 -0
- package/{lib → dist}/service/apex-file-reader.d.ts +1 -1
- package/{lib → dist}/service/apex-file-reader.js +1 -1
- package/{lib → dist}/service/apex-file-reader.js.map +1 -1
- package/{lib → dist}/service/manifest-factory.d.ts +2 -2
- package/{lib → dist}/service/manifest-factory.js +3 -2
- package/dist/service/manifest-factory.js.map +1 -0
- package/{lib → dist}/service/parser.d.ts +1 -1
- package/{lib → dist}/settings.d.ts +3 -0
- package/{lib → dist}/settings.js +3 -0
- package/{lib → dist}/settings.js.map +1 -1
- package/{lib → dist}/test-helpers/SettingsBuilder.js +1 -0
- package/{lib → dist}/test-helpers/SettingsBuilder.js.map +1 -1
- package/{lib → dist}/transpiler/factory.js +2 -4
- package/dist/transpiler/factory.js.map +1 -0
- package/{lib → dist}/transpiler/markdown/class-file-generatorHelper.d.ts +0 -2
- package/{lib → dist}/transpiler/markdown/class-file-generatorHelper.js +1 -15
- package/dist/transpiler/markdown/class-file-generatorHelper.js.map +1 -0
- package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.js +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.js +6 -4
- package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +1 -1
- package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.js +2 -2
- package/{lib → dist}/util/string-utils.js +2 -2
- package/{lib → dist}/util/string-utils.js.map +1 -1
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +18 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +6 -2
- package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +3 -1
- package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +1 -1
- package/examples/plain-markdown/docs/index.md +2 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +16 -0
- package/jest.config.js +1 -1
- package/package.json +11 -13
- package/src/__spec__/core/generating-class-docs.spec.ts +57 -37
- package/src/__spec__/core/generating-enum-docs.spec.ts +25 -22
- package/src/__spec__/core/generating-interface-docs.spec.ts +33 -30
- package/src/__spec__/core/generating-reference-guide.spec.ts +8 -7
- package/src/__spec__/core/test-helpers.ts +9 -0
- package/src/application/Apexdocs.ts +36 -5
- package/src/application/{flows → generators}/generate-markdown-files.ts +19 -13
- package/src/cli/args.ts +136 -0
- package/src/cli/generate.ts +11 -135
- package/src/{adapters → core/adapters}/__tests__/interface-adapter.spec.ts +13 -11
- package/src/{adapters → core/adapters}/__tests__/references.spec.ts +11 -1
- package/src/{adapters → core/adapters}/apex-types.ts +18 -15
- package/src/core/adapters/documentables.ts +195 -0
- package/src/{adapters → core/adapters}/fields-and-properties.ts +11 -9
- package/src/{adapters → core/adapters}/methods-and-constructors.ts +15 -8
- package/src/{adapters → core/adapters}/references.ts +3 -6
- package/src/core/adapters/type-utils.ts +9 -0
- package/src/core/{renderable → adapters}/types.d.ts +35 -4
- package/src/core/generate-docs.ts +55 -19
- package/src/core/template.ts +12 -9
- package/src/core/templates/reference-guide.ts +1 -1
- package/src/model/__tests__/manifest.spec.ts +1 -1
- package/src/model/markdown-generation-util/field-declaration-util.ts +1 -1
- package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
- package/src/model/markdown-type-file.ts +5 -1
- package/src/service/__tests__/apex-file-reader.spec.ts +1 -0
- package/src/service/apex-file-reader.ts +1 -1
- package/src/service/manifest-factory.ts +2 -2
- package/src/service/parser.ts +1 -1
- package/src/settings.ts +6 -0
- package/src/test-helpers/SettingsBuilder.ts +1 -0
- package/src/transpiler/factory.ts +2 -4
- package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -18
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +1 -1
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +6 -4
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +1 -1
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +2 -2
- package/tsconfig.json +1 -1
- package/docs/.nojekyll +0 -0
- package/docs/__old/README.md +0 -1
- package/docs/__old/index.html +0 -22
- package/docs/__old/restapi.json +0 -589
- package/docs/__old/types/Classes/nspc.AnotherInterface.md +0 -22
- package/docs/__old/types/Classes/nspc.ChildClass.md +0 -97
- package/docs/__old/types/Main/nspc.GroupedClass.md +0 -10
- package/docs/__old/types/Main/nspc.SampleClass.md +0 -189
- package/docs/__old/types/Misc-Group/nspc.EscapedAnnotations.md +0 -4
- package/docs/__old/types/Misc-Group/nspc.GrandparentClass.md +0 -13
- package/docs/__old/types/Misc-Group/nspc.InterfaceWithInheritance.md +0 -29
- package/docs/__old/types/Misc-Group/nspc.MemberGrouping.md +0 -13
- package/docs/__old/types/Misc-Group/nspc.ParentClass.md +0 -37
- package/docs/__old/types/Misc-Group/nspc.Reference1.md +0 -18
- package/docs/__old/types/Misc-Group/nspc.Reference2.md +0 -12
- package/docs/__old/types/Misc-Group/nspc.Reference3.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference4.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference5.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference6.md +0 -9
- package/docs/__old/types/Misc-Group/nspc.Reference7.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -11
- package/docs/__old/types/Misc-Group/nspc.SampleRestResource.md +0 -104
- package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -33
- package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -14
- package/docs/__old/types/README.md +0 -97
- package/docs/__old/types/Sample-Interfaces/nspc.SampleInterface.md +0 -23
- package/examples/includes/header.md +0 -3
- package/lib/__spec__/core/expect-extensions.js.map +0 -1
- package/lib/__spec__/core/generating-class-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-enum-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-interface-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-reference-guide.spec.js.map +0 -1
- package/lib/adapters/apex-types.d.ts +0 -5
- package/lib/adapters/apex-types.js.map +0 -1
- package/lib/adapters/documentables.js +0 -56
- package/lib/adapters/documentables.js.map +0 -1
- package/lib/adapters/fields-and-properties.js.map +0 -1
- package/lib/adapters/methods-and-constructors.js.map +0 -1
- package/lib/adapters/references.js.map +0 -1
- package/lib/adapters/type-utils.d.ts +0 -2
- package/lib/adapters/type-utils.js +0 -7
- package/lib/adapters/type-utils.js.map +0 -1
- package/lib/application/Apexdocs.js.map +0 -1
- package/lib/application/flows/generate-markdown-files.js.map +0 -1
- package/lib/cli/generate.js.map +0 -1
- package/lib/core/generate-docs.js.map +0 -1
- package/lib/core/inheritance-chain.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -29
- package/lib/model/apex-bundle.js.map +0 -1
- package/lib/model/inheritance.d.ts +0 -11
- package/lib/model/inheritance.js +0 -3
- package/lib/model/inheritance.js.map +0 -1
- package/lib/model/manifest.js.map +0 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +0 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +0 -1
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +0 -1
- package/lib/model/markdown-type-file.js.map +0 -1
- package/lib/service/manifest-factory.js.map +0 -1
- package/lib/transpiler/factory.js.map +0 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -9
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +0 -42
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +0 -1
- package/src/adapters/documentables.ts +0 -93
- package/src/adapters/type-utils.ts +0 -5
- package/src/adapters/types.d.ts +0 -8
- package/src/model/inheritance.ts +0 -8
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +0 -42
- /package/{lib → dist}/__spec__/core/expect-extensions.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-class-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-enum-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-interface-docs.spec.d.ts +0 -0
- /package/{lib → dist}/__spec__/core/generating-reference-guide.spec.d.ts +0 -0
- /package/{lib → dist}/cli/generate.d.ts +0 -0
- /package/{lib → dist}/core/__test__/inheritance-chain.test.d.ts +0 -0
- /package/{lib → dist}/core/__test__/inheritance-chain.test.js +0 -0
- /package/{lib → dist}/core/__test__/inheritance-chain.test.js.map +0 -0
- /package/{lib/model → dist/core}/apex-bundle.d.ts +0 -0
- /package/{lib/model → dist/core}/apex-bundle.js +0 -0
- /package/{lib → dist}/core/inheritance-chain.d.ts +0 -0
- /package/{lib/model → dist/core}/manifest.d.ts +0 -0
- /package/{lib/model → dist/core}/manifest.js +0 -0
- /package/{lib → dist}/core/template.d.ts +0 -0
- /package/{lib → dist}/core/templates/reference-guide.d.ts +0 -0
- /package/{lib → dist}/core/templates/reference-guide.js.map +0 -0
- /package/{lib → dist}/index.js.map +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -0
- /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -0
- /package/{lib → dist}/model/markdown-file.d.ts +0 -0
- /package/{lib → dist}/model/markdown-file.js +0 -0
- /package/{lib → dist}/model/markdown-file.js.map +0 -0
- /package/{lib → dist}/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.d.ts +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.js +0 -0
- /package/{lib → dist}/model/markdown-generation-util/index.js.map +0 -0
- /package/{lib → dist}/model/markdown-generation-util/type-declaration-util.d.ts +0 -0
- /package/{lib → dist}/model/markdown-home-file.d.ts +0 -0
- /package/{lib → dist}/model/markdown-home-file.js +0 -0
- /package/{lib → dist}/model/markdown-home-file.js.map +0 -0
- /package/{lib → dist}/model/markdown-type-file.js +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.d.ts +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.js +0 -0
- /package/{lib → dist}/model/openapi/apex-doc-types.js.map +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.d.ts +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.js +0 -0
- /package/{lib → dist}/model/openapi/open-api-types.js.map +0 -0
- /package/{lib → dist}/model/openapi/open-api.d.ts +0 -0
- /package/{lib → dist}/model/openapi/open-api.js +0 -0
- /package/{lib → dist}/model/openapi/open-api.js.map +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.d.ts +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.js +0 -0
- /package/{lib → dist}/model/openapi/openapi-type-file.js.map +0 -0
- /package/{lib → dist}/model/outputFile.d.ts +0 -0
- /package/{lib → dist}/model/outputFile.js +0 -0
- /package/{lib → dist}/model/outputFile.js.map +0 -0
- /package/{lib → dist}/model/types-repository.d.ts +0 -0
- /package/{lib → dist}/model/types-repository.js +0 -0
- /package/{lib → dist}/model/types-repository.js.map +0 -0
- /package/{lib → dist}/service/file-system.d.ts +0 -0
- /package/{lib → dist}/service/file-system.js +0 -0
- /package/{lib → dist}/service/file-system.js.map +0 -0
- /package/{lib → dist}/service/file-writer.d.ts +0 -0
- /package/{lib → dist}/service/file-writer.js +0 -0
- /package/{lib → dist}/service/file-writer.js.map +0 -0
- /package/{lib → dist}/service/metadata-processor.d.ts +0 -0
- /package/{lib → dist}/service/metadata-processor.js +0 -0
- /package/{lib → dist}/service/metadata-processor.js.map +0 -0
- /package/{lib → dist}/service/parser.js +0 -0
- /package/{lib → dist}/service/parser.js.map +0 -0
- /package/{lib → dist}/service/state.d.ts +0 -0
- /package/{lib → dist}/service/state.js +0 -0
- /package/{lib → dist}/service/state.js.map +0 -0
- /package/{lib → dist}/service/walkers/class-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/class-walker.js +0 -0
- /package/{lib → dist}/service/walkers/class-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.js +0 -0
- /package/{lib → dist}/service/walkers/enum-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.js +0 -0
- /package/{lib → dist}/service/walkers/interface-walker.js.map +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.d.ts +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.js +0 -0
- /package/{lib → dist}/service/walkers/walker-factory.js.map +0 -0
- /package/{lib → dist}/service/walkers/walker.d.ts +0 -0
- /package/{lib → dist}/service/walkers/walker.js +0 -0
- /package/{lib → dist}/service/walkers/walker.js.map +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/AnnotationBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/ClassMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/ClassMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/ClassMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/DocCommentBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/FieldMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.d.ts +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.js +0 -0
- /package/{lib → dist}/test-helpers/MethodMirrorBuilder.js.map +0 -0
- /package/{lib → dist}/test-helpers/SettingsBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/factory.d.ts +0 -0
- /package/{lib → dist}/transpiler/file-container.d.ts +0 -0
- /package/{lib → dist}/transpiler/file-container.js +0 -0
- /package/{lib → dist}/transpiler/file-container.js.map +0 -0
- /package/{lib → dist}/transpiler/generator-choices.d.ts +0 -0
- /package/{lib → dist}/transpiler/generator-choices.js +0 -0
- /package/{lib → dist}/transpiler/generator-choices.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.js +0 -0
- /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -0
- /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.js +0 -0
- /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -0
- /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.js +0 -0
- /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/Builder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.js +0 -0
- /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.d.ts +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.js +0 -0
- /package/{lib → dist}/transpiler/processor-type-transpiler.js.map +0 -0
- /package/{lib → dist}/transpiler/transpiler.d.ts +0 -0
- /package/{lib → dist}/transpiler/transpiler.js +0 -0
- /package/{lib → dist}/transpiler/transpiler.js.map +0 -0
- /package/{lib → dist}/util/error-logger.d.ts +0 -0
- /package/{lib → dist}/util/error-logger.js +0 -0
- /package/{lib → dist}/util/error-logger.js.map +0 -0
- /package/{lib → dist}/util/logger.d.ts +0 -0
- /package/{lib → dist}/util/logger.js +0 -0
- /package/{lib → dist}/util/logger.js.map +0 -0
- /package/{lib → dist}/util/string-utils.d.ts +0 -0
- /package/src/{model → core}/apex-bundle.ts +0 -0
- /package/src/{model → core}/manifest.ts +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CodeBlock, EmptyLine, RenderableContent } from './types';
|
|
2
|
+
|
|
3
|
+
export function isEmptyLine(content: RenderableContent): content is EmptyLine {
|
|
4
|
+
return Object.keys(content).includes('__type') && (content as { __type: string }).__type === 'empty-line';
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function isCodeBlock(content: RenderableContent): content is CodeBlock {
|
|
8
|
+
return Object.keys(content).includes('__type') && (content as { __type: string }).__type === 'code-block';
|
|
9
|
+
}
|
|
@@ -1,15 +1,42 @@
|
|
|
1
|
+
// Apex Reflection-based types
|
|
2
|
+
import {
|
|
3
|
+
Annotation as MirrorAnnotation,
|
|
4
|
+
ClassMirror,
|
|
5
|
+
DocComment,
|
|
6
|
+
FieldMirror,
|
|
7
|
+
MethodMirror,
|
|
8
|
+
PropertyMirror,
|
|
9
|
+
} from '@cparra/apex-reflection';
|
|
10
|
+
|
|
11
|
+
export type Describable = string[] | undefined;
|
|
12
|
+
|
|
13
|
+
export type Documentable = {
|
|
14
|
+
annotations: MirrorAnnotation[];
|
|
15
|
+
docComment?: DocComment;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type InheritanceSupport = { inherited: boolean };
|
|
19
|
+
export type ClassMirrorWithInheritanceChain = ClassMirror & { inheritanceChain: string[] };
|
|
20
|
+
export type FieldMirrorWithInheritance = FieldMirror & InheritanceSupport;
|
|
21
|
+
export type PropertyMirrorWithInheritance = PropertyMirror & InheritanceSupport;
|
|
22
|
+
export type MethodMirrorWithInheritance = MethodMirror & InheritanceSupport;
|
|
23
|
+
export type FieldOrProperty = FieldMirrorWithInheritance | PropertyMirrorWithInheritance;
|
|
24
|
+
|
|
25
|
+
// Renderable types
|
|
26
|
+
|
|
1
27
|
export type Link = {
|
|
28
|
+
readonly __type: 'link';
|
|
2
29
|
title: string;
|
|
3
30
|
url: string;
|
|
4
31
|
};
|
|
5
32
|
|
|
6
33
|
export type EmptyLine = {
|
|
7
|
-
|
|
34
|
+
__type: 'empty-line';
|
|
8
35
|
};
|
|
9
36
|
|
|
10
37
|
export type StringOrLink = string | Link;
|
|
11
38
|
|
|
12
|
-
export type RenderableContent = StringOrLink | EmptyLine;
|
|
39
|
+
export type RenderableContent = StringOrLink | EmptyLine | CodeBlock;
|
|
13
40
|
|
|
14
41
|
type EnumValue = {
|
|
15
42
|
value: string;
|
|
@@ -22,11 +49,15 @@ type CustomTag = {
|
|
|
22
49
|
};
|
|
23
50
|
|
|
24
51
|
/**
|
|
25
|
-
* Represents an annotation to a top-level type. For example @NamespaceAccessible.
|
|
52
|
+
* Represents an annotation to a top-level type. For example, @NamespaceAccessible.
|
|
26
53
|
*/
|
|
27
54
|
type Annotation = string;
|
|
28
55
|
|
|
29
|
-
type CodeBlock =
|
|
56
|
+
type CodeBlock = {
|
|
57
|
+
readonly __type: 'code-block';
|
|
58
|
+
language: string;
|
|
59
|
+
content: string[];
|
|
60
|
+
};
|
|
30
61
|
|
|
31
62
|
type RenderableDocumentation = {
|
|
32
63
|
annotations?: Annotation[];
|
|
@@ -1,18 +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';
|
|
13
11
|
import { createInheritanceChain } from './inheritance-chain';
|
|
12
|
+
import ApexBundle from './apex-bundle';
|
|
13
|
+
import Manifest from './manifest';
|
|
14
14
|
|
|
15
|
-
|
|
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';
|
|
16
20
|
|
|
17
21
|
export type DocumentationBundle = {
|
|
18
22
|
format: 'markdown';
|
|
@@ -44,13 +48,13 @@ const configDefaults: DocumentationConfig = {
|
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
export function generateDocs(
|
|
47
|
-
input:
|
|
51
|
+
input: ApexBundle[],
|
|
48
52
|
config?: Partial<DocumentationConfig>,
|
|
49
|
-
): E.Either<
|
|
53
|
+
): E.Either<ReflectionError[], DocumentationBundle> {
|
|
50
54
|
const configWithDefaults = { ...configDefaults, ...config };
|
|
51
55
|
return pipe(
|
|
52
56
|
input,
|
|
53
|
-
(input) => input.map(reflectSourceBody),
|
|
57
|
+
(input) => input.map((bundle) => reflectSourceBody(bundle)),
|
|
54
58
|
checkForReflectionErrors,
|
|
55
59
|
E.map((types) => filterTypesOutOfScope(types, configWithDefaults.scope)),
|
|
56
60
|
E.map((types) => types.map((type) => addInheritedMembers(type, types))),
|
|
@@ -82,7 +86,7 @@ type RenderableBundle = {
|
|
|
82
86
|
function typesToRenderableBundle(types: Type[], config: DocumentationConfig) {
|
|
83
87
|
return types.reduce<RenderableBundle>(
|
|
84
88
|
(acc, type) => {
|
|
85
|
-
const renderable =
|
|
89
|
+
const renderable = typeToRenderable(
|
|
86
90
|
type,
|
|
87
91
|
(referenceName) => {
|
|
88
92
|
return linkFromTypeNameGenerator(type, types, referenceName, config);
|
|
@@ -159,12 +163,12 @@ function filterTypesOutOfScope(types: Type[], scope: string[]): Type[] {
|
|
|
159
163
|
return new Manifest(types).filteredByAccessModifierAndAnnotations(scope);
|
|
160
164
|
}
|
|
161
165
|
|
|
162
|
-
function checkForReflectionErrors(reflectionResult: E.Either<
|
|
163
|
-
function reduceReflectionResultIntoSingleEither(results: E.Either<
|
|
164
|
-
errors:
|
|
166
|
+
function checkForReflectionErrors(reflectionResult: E.Either<ReflectionError, Type>[]) {
|
|
167
|
+
function reduceReflectionResultIntoSingleEither(results: E.Either<ReflectionError, Type>[]): {
|
|
168
|
+
errors: ReflectionError[];
|
|
165
169
|
types: Type[];
|
|
166
170
|
} {
|
|
167
|
-
return results.reduce<{ errors:
|
|
171
|
+
return results.reduce<{ errors: ReflectionError[]; types: Type[] }>(
|
|
168
172
|
(acc, result) => {
|
|
169
173
|
E.isLeft(result) ? acc.errors.push(result.left) : acc.types.push(result.right);
|
|
170
174
|
return acc;
|
|
@@ -181,10 +185,39 @@ function checkForReflectionErrors(reflectionResult: E.Either<string, Type>[]) {
|
|
|
181
185
|
);
|
|
182
186
|
}
|
|
183
187
|
|
|
184
|
-
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;
|
|
185
216
|
const result = mirrorReflection(input);
|
|
186
217
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
187
|
-
return result.error
|
|
218
|
+
return result.error
|
|
219
|
+
? E.left(new ReflectionError(filePath, result.error.message))
|
|
220
|
+
: E.right(addFileMetadataToTypeAnnotation(result.typeMirror!, metadata));
|
|
188
221
|
}
|
|
189
222
|
|
|
190
223
|
function resolveApexTypeTemplate(renderable: Renderable): CompilationRequest {
|
|
@@ -330,6 +363,7 @@ function linkFromTypeNameGenerator(
|
|
|
330
363
|
|
|
331
364
|
const [fullClassName, fileLink] = getFileLinkTuple(typeBeingDocumented, type, config);
|
|
332
365
|
return {
|
|
366
|
+
__type: 'link',
|
|
333
367
|
title: fullClassName,
|
|
334
368
|
url: fileLink,
|
|
335
369
|
};
|
|
@@ -362,6 +396,7 @@ function getPossibleLinkFromRoot(config: DocumentationConfig, fallback: string,
|
|
|
362
396
|
const namespacePrefix = config.namespace ? `${config.namespace}.` : '';
|
|
363
397
|
const title = `${namespacePrefix}${type.name}`;
|
|
364
398
|
return {
|
|
399
|
+
__type: 'link',
|
|
365
400
|
title: title,
|
|
366
401
|
url: `${getDirectoryFromRoot(config, type)}/${title}.md`,
|
|
367
402
|
};
|
|
@@ -371,6 +406,7 @@ function getLinkFromRoot(config: DocumentationConfig, type: Type): Link {
|
|
|
371
406
|
const namespacePrefix = config.namespace ? `${config.namespace}.` : '';
|
|
372
407
|
const title = `${namespacePrefix}${type.name}`;
|
|
373
408
|
return {
|
|
409
|
+
__type: 'link',
|
|
374
410
|
title: title,
|
|
375
411
|
url: `${getDirectoryFromRoot(config, type)}/${title}.md`,
|
|
376
412
|
};
|
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
|
}
|
|
@@ -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,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/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.
|
package/docs/__old/index.html
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>Document</title>
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
7
|
-
<meta name="description" content="Description">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
|
9
|
-
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="app"></div>
|
|
13
|
-
<script>
|
|
14
|
-
window.$docsify = {
|
|
15
|
-
name: '',
|
|
16
|
-
repo: ''
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
<!-- Docsify v4 -->
|
|
20
|
-
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
|
|
21
|
-
</body>
|
|
22
|
-
</html>
|