@cparra/apexdocs 2.24.0 → 2.25.0-alpha.0

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.
Files changed (317) hide show
  1. package/.eslintrc.js +12 -12
  2. package/.github/workflows/ci.yaml +22 -0
  3. package/.github/workflows/close_stale.yml +22 -22
  4. package/.prettierrc.js +7 -7
  5. package/LICENSE +21 -21
  6. package/README.md +742 -718
  7. package/apexdocs.config.ts +13 -13
  8. package/docs/{README.md → __old/README.md} +1 -1
  9. package/docs/{restapi.json → __old/restapi.json} +589 -589
  10. package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
  11. package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
  12. package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
  13. package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
  14. package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
  15. package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
  16. package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
  17. package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
  18. package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
  19. package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
  20. package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
  21. package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
  22. package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
  23. package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
  24. package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
  25. package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
  26. package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
  27. package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
  28. package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
  29. package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
  30. package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
  31. package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
  32. package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
  33. package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
  34. package/examples/includes/header.md +3 -3
  35. package/examples/plain-markdown/.forceignore +12 -0
  36. package/examples/plain-markdown/README.md +301 -0
  37. package/examples/plain-markdown/config/project-scratch-def.json +5 -0
  38. package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
  39. package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
  40. package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
  41. package/examples/plain-markdown/force-app/classes/SampleClass.cls +35 -0
  42. package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
  43. package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
  44. package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
  45. package/examples/plain-markdown/package-lock.json +665 -0
  46. package/examples/plain-markdown/package.json +24 -0
  47. package/examples/plain-markdown/sfdx-project.json +12 -0
  48. package/examples/plain-markdown/template.md +3 -0
  49. package/jest.config.js +5 -5
  50. package/lib/adapters/apex-types.d.ts +5 -0
  51. package/lib/adapters/apex-types.js +34 -0
  52. package/lib/adapters/apex-types.js.map +1 -0
  53. package/lib/adapters/documentables.d.ts +6 -0
  54. package/lib/adapters/documentables.js +41 -0
  55. package/lib/adapters/documentables.js.map +1 -0
  56. package/lib/adapters/fields-and-properties.d.ts +3 -0
  57. package/lib/adapters/fields-and-properties.js +10 -0
  58. package/lib/adapters/fields-and-properties.js.map +1 -0
  59. package/lib/adapters/methods-and-constructors.d.ts +4 -0
  60. package/lib/adapters/methods-and-constructors.js +49 -0
  61. package/lib/adapters/methods-and-constructors.js.map +1 -0
  62. package/lib/adapters/references.d.ts +5 -0
  63. package/lib/adapters/references.js +82 -0
  64. package/lib/adapters/references.js.map +1 -0
  65. package/lib/adapters/type-utils.d.ts +2 -0
  66. package/lib/adapters/type-utils.js +8 -0
  67. package/lib/adapters/type-utils.js.map +1 -0
  68. package/lib/application/Apexdocs.d.ts +13 -13
  69. package/lib/application/Apexdocs.js +79 -76
  70. package/lib/application/Apexdocs.js.map +1 -1
  71. package/lib/cli/generate.d.ts +2 -2
  72. package/lib/cli/generate.js +156 -130
  73. package/lib/cli/generate.js.map +1 -1
  74. package/lib/index.d.ts +1 -1
  75. package/lib/index.js +17 -17
  76. package/lib/model/apex-bundle.d.ts +6 -6
  77. package/lib/model/apex-bundle.js +10 -10
  78. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
  79. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
  80. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
  81. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
  82. package/lib/model/inheritance.d.ts +8 -8
  83. package/lib/model/inheritance.js +2 -2
  84. package/lib/model/manifest.d.ts +22 -22
  85. package/lib/model/manifest.js +46 -46
  86. package/lib/model/manifest.js.map +1 -1
  87. package/lib/model/markdown-file.d.ts +16 -16
  88. package/lib/model/markdown-file.js +109 -106
  89. package/lib/model/markdown-file.js.map +1 -1
  90. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
  91. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +46 -43
  92. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
  93. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
  94. package/lib/model/markdown-generation-util/field-declaration-util.js +54 -54
  95. package/lib/model/markdown-generation-util/index.d.ts +3 -3
  96. package/lib/model/markdown-generation-util/index.js +19 -19
  97. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
  98. package/lib/model/markdown-generation-util/method-declaration-util.js +114 -114
  99. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
  100. package/lib/model/markdown-generation-util/type-declaration-util.js +81 -81
  101. package/lib/model/markdown-home-file.d.ts +11 -11
  102. package/lib/model/markdown-home-file.js +56 -53
  103. package/lib/model/markdown-home-file.js.map +1 -1
  104. package/lib/model/markdown-type-file.d.ts +26 -26
  105. package/lib/model/markdown-type-file.js +136 -133
  106. package/lib/model/markdown-type-file.js.map +1 -1
  107. package/lib/model/openapi/apex-doc-types.d.ts +19 -19
  108. package/lib/model/openapi/apex-doc-types.js +4 -4
  109. package/lib/model/openapi/open-api-types.d.ts +93 -93
  110. package/lib/model/openapi/open-api-types.js +2 -2
  111. package/lib/model/openapi/open-api.d.ts +16 -16
  112. package/lib/model/openapi/open-api.js +33 -33
  113. package/lib/model/openapi/openapi-type-file.d.ts +7 -7
  114. package/lib/model/openapi/openapi-type-file.js +16 -16
  115. package/lib/model/outputFile.d.ts +10 -10
  116. package/lib/model/outputFile.js +28 -28
  117. package/lib/model/types-repository.d.ts +16 -16
  118. package/lib/model/types-repository.js +53 -53
  119. package/lib/service/apex-file-reader.d.ts +14 -14
  120. package/lib/service/apex-file-reader.js +48 -45
  121. package/lib/service/apex-file-reader.js.map +1 -1
  122. package/lib/service/file-system.d.ts +14 -14
  123. package/lib/service/file-system.js +47 -24
  124. package/lib/service/file-system.js.map +1 -1
  125. package/lib/service/file-writer.d.ts +6 -6
  126. package/lib/service/file-writer.js +56 -33
  127. package/lib/service/file-writer.js.map +1 -1
  128. package/lib/service/manifest-factory.d.ts +10 -10
  129. package/lib/service/manifest-factory.js +16 -13
  130. package/lib/service/manifest-factory.js.map +1 -1
  131. package/lib/service/metadata-processor.d.ts +3 -3
  132. package/lib/service/metadata-processor.js +16 -16
  133. package/lib/service/parser.d.ts +21 -21
  134. package/lib/service/parser.js +137 -134
  135. package/lib/service/parser.js.map +1 -1
  136. package/lib/service/state.d.ts +9 -9
  137. package/lib/service/state.js +19 -19
  138. package/lib/service/walkers/class-walker.d.ts +4 -4
  139. package/lib/service/walkers/class-walker.js +32 -32
  140. package/lib/service/walkers/enum-walker.d.ts +4 -4
  141. package/lib/service/walkers/enum-walker.js +10 -10
  142. package/lib/service/walkers/interface-walker.d.ts +4 -4
  143. package/lib/service/walkers/interface-walker.js +14 -14
  144. package/lib/service/walkers/walker-factory.d.ts +5 -5
  145. package/lib/service/walkers/walker-factory.js +20 -20
  146. package/lib/service/walkers/walker.d.ts +19 -19
  147. package/lib/service/walkers/walker.js +16 -16
  148. package/lib/settings.d.ts +70 -64
  149. package/lib/settings.js +99 -88
  150. package/lib/settings.js.map +1 -1
  151. package/lib/templating/compile.d.ts +7 -0
  152. package/lib/templating/compile.js +98 -0
  153. package/lib/templating/compile.js.map +1 -0
  154. package/lib/templating/helpers.d.ts +2 -0
  155. package/lib/templating/helpers.js +18 -0
  156. package/lib/templating/helpers.js.map +1 -0
  157. package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
  158. package/lib/test-helpers/AnnotationBuilder.js +30 -30
  159. package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
  160. package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
  161. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
  162. package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
  163. package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
  164. package/lib/test-helpers/DocCommentBuilder.js +37 -37
  165. package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
  166. package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
  167. package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
  168. package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
  169. package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
  170. package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
  171. package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
  172. package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
  173. package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
  174. package/lib/test-helpers/SettingsBuilder.js +26 -26
  175. package/lib/transpiler/factory.d.ts +6 -6
  176. package/lib/transpiler/factory.js +34 -31
  177. package/lib/transpiler/factory.js.map +1 -1
  178. package/lib/transpiler/file-container.d.ts +6 -6
  179. package/lib/transpiler/file-container.js +15 -15
  180. package/lib/transpiler/generator-choices.d.ts +1 -1
  181. package/lib/transpiler/generator-choices.js +2 -2
  182. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
  183. package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
  184. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  185. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
  186. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
  187. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
  188. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
  189. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
  190. package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
  191. package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
  192. package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
  193. package/lib/transpiler/markdown/plain-markdown/class-template.js +36 -0
  194. package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
  195. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
  196. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +39 -0
  197. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
  198. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
  199. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +25 -0
  200. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
  201. package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
  202. package/lib/transpiler/markdown/plain-markdown/enum-template.js +15 -0
  203. package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
  204. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
  205. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +24 -0
  206. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
  207. package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +1 -0
  208. package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
  209. package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
  210. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
  211. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +49 -0
  212. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
  213. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +13 -6
  214. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +121 -13
  215. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
  216. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +1 -0
  217. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +31 -0
  218. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +1 -0
  219. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
  220. package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
  221. package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
  222. package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
  223. package/lib/transpiler/openapi/parsers/Builder.js +29 -29
  224. package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
  225. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
  226. package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
  227. package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
  228. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
  229. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
  230. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
  231. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +248 -225
  232. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  233. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
  234. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
  235. package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
  236. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
  237. package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
  238. package/lib/transpiler/processor-type-transpiler.js +8 -8
  239. package/lib/transpiler/transpiler.d.ts +5 -5
  240. package/lib/transpiler/transpiler.js +29 -26
  241. package/lib/transpiler/transpiler.js.map +1 -1
  242. package/lib/util/error-logger.d.ts +8 -8
  243. package/lib/util/error-logger.js +89 -89
  244. package/lib/util/error-logger.js.map +1 -1
  245. package/lib/util/logger.d.ts +21 -21
  246. package/lib/util/logger.js +60 -57
  247. package/lib/util/logger.js.map +1 -1
  248. package/lib/util/string-utils.d.ts +2 -2
  249. package/lib/util/string-utils.js +14 -14
  250. package/package.json +79 -78
  251. package/src/adapters/__tests__/interface-adapter.spec.ts +76 -0
  252. package/src/adapters/__tests__/references.spec.ts +115 -0
  253. package/src/adapters/apex-types.ts +67 -0
  254. package/src/adapters/documentables.ts +58 -0
  255. package/src/adapters/fields-and-properties.ts +14 -0
  256. package/src/adapters/methods-and-constructors.ts +78 -0
  257. package/src/adapters/references.ts +113 -0
  258. package/src/adapters/type-utils.ts +5 -0
  259. package/src/adapters/types.d.ts +8 -0
  260. package/src/cli/generate.ts +3 -0
  261. package/src/model/__tests__/manifest.spec.ts +1 -0
  262. package/src/model/manifest.ts +3 -3
  263. package/src/model/markdown-file.ts +1 -1
  264. package/src/model/openapi/open-api-types.ts +2 -2
  265. package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
  266. package/src/service/__tests__/manifest-factory.spec.ts +1 -2
  267. package/src/settings.ts +15 -0
  268. package/src/templating/__tests__/compile.spec.ts +741 -0
  269. package/src/templating/compile.ts +187 -0
  270. package/src/templating/helpers.ts +14 -0
  271. package/src/templating/types.d.ts +104 -0
  272. package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
  273. package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
  274. package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
  275. package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
  276. package/src/transpiler/markdown/plain-markdown/class-template.ts +32 -0
  277. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +35 -0
  278. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +21 -0
  279. package/src/transpiler/markdown/plain-markdown/enum-template.ts +11 -0
  280. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +20 -0
  281. package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
  282. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +45 -0
  283. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +122 -0
  284. package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +27 -0
  285. package/src/transpiler/openapi/parsers/Builder.ts +1 -1
  286. package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
  287. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +1 -1
  288. package/src/util/error-logger.ts +4 -4
  289. package/src/util/logger.ts +3 -3
  290. package/tsconfig.json +21 -20
  291. package/tslint.json +5 -5
  292. package/lib/model/manifest-diff.d.ts +0 -27
  293. package/lib/model/manifest-diff.js +0 -69
  294. package/lib/model/manifest-diff.js.map +0 -1
  295. package/src/model/__tests__/manifest-diff.spec.ts +0 -139
  296. package/src/model/manifest-diff.ts +0 -94
  297. /package/docs/{index.html → __old/index.html} +0 -0
  298. /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
  299. /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
  300. /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
  301. /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
  302. /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
  303. /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
  304. /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
  305. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
  306. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
  307. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
  308. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
  309. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
  310. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
  311. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
  312. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
  313. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
  314. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
  315. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
  316. /package/docs/{types → __old/types}/README.md +0 -0
  317. /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "plain-markdown",
3
+ "scripts": {
4
+ "docs:clean": "rimraf ./README.md",
5
+ "docs:build": "ts-node ../../src/cli/generate.ts",
6
+ "docs:gen": "npm run docs:clean && npm run docs:build"
7
+ },
8
+ "devDependencies": {
9
+ "ts-node": "^10.9.2"
10
+ },
11
+ "dependencies": {
12
+ "rimraf": "^5.0.7"
13
+ },
14
+ "apexdocs": {
15
+ "sourceDir": "force-app",
16
+ "targetGenerator": "plain-markdown",
17
+ "scope": ["global", "public", "protected", "private", "namespaceaccessible"],
18
+ "namespace": "ns",
19
+ "singleFile": true,
20
+ "templateFilePath": "template.md",
21
+ "fileName": "README",
22
+ "targetDir": "."
23
+ }
24
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "packageDirectories": [
3
+ {
4
+ "path": "force-app",
5
+ "default": true
6
+ }
7
+ ],
8
+ "name": "plain-markdown",
9
+ "namespace": "",
10
+ "sfdcLoginUrl": "https://login.salesforce.com",
11
+ "sourceApiVersion": "59.0"
12
+ }
@@ -0,0 +1,3 @@
1
+ # Template file
2
+
3
+ {{{api_docs}}}
package/jest.config.js CHANGED
@@ -1,5 +1,5 @@
1
- module.exports = {
2
- preset: 'ts-jest',
3
- testEnvironment: 'node',
4
- modulePathIgnorePatterns: ['<rootDir>/lib/'],
5
- };
1
+ module.exports = {
2
+ preset: 'ts-jest',
3
+ testEnvironment: 'node',
4
+ modulePathIgnorePatterns: ['<rootDir>/lib/'],
5
+ };
@@ -0,0 +1,5 @@
1
+ import { ClassMirror, EnumMirror, InterfaceMirror } from '@cparra/apex-reflection';
2
+ import { ClassSource, EnumSource, InterfaceSource } from '../templating/types';
3
+ export declare function enumTypeToEnumSource(enumType: EnumMirror): EnumSource;
4
+ export declare function interfaceTypeToInterfaceSource(interfaceType: InterfaceMirror): InterfaceSource;
5
+ export declare function classTypeToClassSource(classType: ClassMirror): ClassSource;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.classTypeToClassSource = exports.interfaceTypeToInterfaceSource = exports.enumTypeToEnumSource = void 0;
4
+ const documentables_1 = require("./documentables");
5
+ const references_1 = require("./references");
6
+ const methods_and_constructors_1 = require("./methods-and-constructors");
7
+ const fields_and_properties_1 = require("./fields-and-properties");
8
+ function baseTypeAdapter(type) {
9
+ function extractAnnotationBody(type, annotationName) {
10
+ var _a, _b;
11
+ return (_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((currentAnnotation) => currentAnnotation.name.toLowerCase() === annotationName)) === null || _b === void 0 ? void 0 : _b.body;
12
+ }
13
+ function extractSeeAnnotations(type) {
14
+ var _a, _b;
15
+ return ((_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((currentAnnotation) => currentAnnotation.name.toLowerCase() === 'see').map((currentAnnotation) => currentAnnotation.body)) !== null && _b !== void 0 ? _b : []);
16
+ }
17
+ return Object.assign(Object.assign({}, (0, documentables_1.adaptDocumentable)(type)), { accessModifier: type.access_modifier, name: type.name, group: extractAnnotationBody(type, 'group'), author: extractAnnotationBody(type, 'author'), date: extractAnnotationBody(type, 'date'), sees: extractSeeAnnotations(type).map(references_1.linkFromTypeNameGenerator) });
18
+ }
19
+ function enumTypeToEnumSource(enumType) {
20
+ return Object.assign(Object.assign({ __type: 'enum' }, baseTypeAdapter(enumType)), { values: enumType.values.map((value) => {
21
+ var _a;
22
+ return (Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)((_a = value.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines)), { value: value.name }));
23
+ }) });
24
+ }
25
+ exports.enumTypeToEnumSource = enumTypeToEnumSource;
26
+ function interfaceTypeToInterfaceSource(interfaceType) {
27
+ return Object.assign(Object.assign({ __type: 'interface' }, baseTypeAdapter(interfaceType)), { extends: interfaceType.extended_interfaces.map(references_1.linkFromTypeNameGenerator), methods: interfaceType.methods.map(methods_and_constructors_1.adaptMethod) });
28
+ }
29
+ exports.interfaceTypeToInterfaceSource = interfaceTypeToInterfaceSource;
30
+ function classTypeToClassSource(classType) {
31
+ return Object.assign(Object.assign({ __type: 'class' }, baseTypeAdapter(classType)), { classModifier: classType.classModifier, sharingModifier: classType.sharingModifier, implements: classType.implemented_interfaces.map(references_1.linkFromTypeNameGenerator), extends: classType.extended_class ? (0, references_1.linkFromTypeNameGenerator)(classType.extended_class) : undefined, methods: classType.methods.map(methods_and_constructors_1.adaptMethod), constructors: classType.constructors.map((constructor) => (0, methods_and_constructors_1.adaptConstructor)(classType.name, constructor)), fields: classType.fields.map((field) => (0, fields_and_properties_1.adaptField)(field)) });
32
+ }
33
+ exports.classTypeToClassSource = classTypeToClassSource;
34
+ //# sourceMappingURL=apex-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apex-types.js","sourceRoot":"","sources":["../../src/adapters/apex-types.ts"],"names":[],"mappings":";;;AAEA,mDAAsE;AACtE,6CAAyD;AAEzD,yEAA2E;AAC3E,mEAAqD;AAErD,SAAS,eAAe,CAAC,IAAgD;IACvE,SAAS,qBAAqB,CAAC,IAAU,EAAE,cAAsB;;QAC/D,OAAO,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CACtC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc,CAC/E,0CAAE,IAAI,CAAC;IACV,CAAC;IAED,SAAS,qBAAqB,CAAC,IAAU;;QACvC,OAAO,CACL,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,WAAW,CACzB,MAAM,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,EAC5E,GAAG,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,mCAAI,EAAE,CAC5D,CAAC;IACJ,CAAC;IAED,uCACK,IAAA,iCAAiB,EAAC,IAAI,CAAC,KAC1B,cAAc,EAAE,IAAI,CAAC,eAAe,EACpC,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,EAC3C,MAAM,EAAE,qBAAqB,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC7C,IAA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GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAA,2CAAgB,EAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,EACxG,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,kCAAU,EAAC,KAAmC,CAAC,CAAC,IACxF;AACJ,CAAC;AAZD,wDAYC"}
@@ -0,0 +1,6 @@
1
+ import { DocumentableSource, RenderableContent } from '../templating/types';
2
+ import { Describable, Documentable } from './types';
3
+ export declare function adaptDescribable(describable: Describable): {
4
+ description?: RenderableContent[];
5
+ };
6
+ export declare function adaptDocumentable(documentable: Documentable): DocumentableSource;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adaptDocumentable = exports.adaptDescribable = void 0;
4
+ const references_1 = require("./references");
5
+ const type_utils_1 = require("./type-utils");
6
+ function adaptDescribable(describable) {
7
+ function describableToRenderableContent(describable) {
8
+ if (!describable) {
9
+ return;
10
+ }
11
+ return (describable
12
+ .map((line) => [
13
+ ...(0, references_1.replaceInlineReferences)(line),
14
+ {
15
+ type: 'empty-line',
16
+ },
17
+ ])
18
+ .flatMap((line) => line)
19
+ // If the last element is an empty line, remove it
20
+ .filter((line, index, lines) => !((0, type_utils_1.isEmptyLine)(line) && index === lines.length - 1)));
21
+ }
22
+ return {
23
+ description: describableToRenderableContent(describable),
24
+ };
25
+ }
26
+ exports.adaptDescribable = adaptDescribable;
27
+ function adaptDocumentable(documentable) {
28
+ var _a, _b, _c;
29
+ function extractCustomTags(type) {
30
+ var _a, _b;
31
+ const baseTags = ['description', 'group', 'author', 'date', 'see', 'example', 'mermaid', 'throws', 'exception'];
32
+ return ((_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((currentAnnotation) => !baseTags.includes(currentAnnotation.name.toLowerCase())).map((currentAnnotation) => (Object.assign(Object.assign({}, adaptDescribable(currentAnnotation.bodyLines)), { name: currentAnnotation.name })))) !== null && _b !== void 0 ? _b : []);
33
+ }
34
+ function extractAnnotationBodyLines(type, annotationName) {
35
+ var _a, _b;
36
+ return (_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((currentAnnotation) => currentAnnotation.name.toLowerCase() === annotationName)) === null || _b === void 0 ? void 0 : _b.bodyLines;
37
+ }
38
+ return Object.assign(Object.assign({}, adaptDescribable((_a = documentable.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines)), { annotations: documentable.annotations.map((annotation) => annotation.type.toUpperCase()), customTags: extractCustomTags(documentable), mermaid: extractAnnotationBodyLines(documentable, 'mermaid'), example: (_c = (_b = documentable.docComment) === null || _b === void 0 ? void 0 : _b.exampleAnnotation) === null || _c === void 0 ? void 0 : _c.bodyLines });
39
+ }
40
+ exports.adaptDocumentable = adaptDocumentable;
41
+ //# sourceMappingURL=documentables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentables.js","sourceRoot":"","sources":["../../src/adapters/documentables.ts"],"names":[],"mappings":";;;AAEA,6CAAuD;AACvD,6CAA2C;AAE3C,SAAgB,gBAAgB,CAAC,WAAwB;IACvD,SAAS,8BAA8B,CAAC,WAAwB;QAC9D,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;SACR;QAED,OAAO,CACL,WAAW;aACR,GAAG,CAAsB,CAAC,IAAI,EAAE,EAAE,CAAC;YAClC,GAAG,IAAA,oCAAuB,EAAC,IAAI,CAAC;YAChC;gBACE,IAAI,EAAE,YAAY;aACnB;SACF,CAAC;aACD,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;YACxB,kDAAkD;aACjD,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,IAAA,wBAAW,EAAC,IAAI,CAAC,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CACtF,C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EAAE,SAAS,CAAC,EAC5D,OAAO,EAAE,MAAA,MAAA,YAAY,CAAC,UAAU,0CAAE,iBAAiB,0CAAE,SAAS,IAC9D;AACJ,CAAC;AA3BD,8CA2BC"}
@@ -0,0 +1,3 @@
1
+ import { FieldMirrorWithInheritance } from '../model/inheritance';
2
+ import { FieldSource } from '../templating/types';
3
+ export declare function adaptField(field: FieldMirrorWithInheritance): FieldSource;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adaptField = void 0;
4
+ const documentables_1 = require("./documentables");
5
+ const references_1 = require("./references");
6
+ function adaptField(field) {
7
+ return Object.assign(Object.assign({}, (0, documentables_1.adaptDocumentable)(field)), { name: field.name, type: (0, references_1.linkFromTypeNameGenerator)(field.typeReference.rawDeclaration), inherited: field.inherited, accessModifier: field.access_modifier });
8
+ }
9
+ exports.adaptField = adaptField;
10
+ //# sourceMappingURL=fields-and-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields-and-properties.js","sourceRoot":"","sources":["../../src/adapters/fields-and-properties.ts"],"names":[],"mappings":";;;AAEA,mDAAoD;AACpD,6CAAyD;AAEzD,SAAgB,UAAU,CAAC,KAAiC;IAC1D,uCACK,IAAA,iCAAiB,EAAC,KAAK,CAAC,KAC3B,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAE,IAAA,sCAAyB,EAAC,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,EACnE,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,cAAc,EAAE,KAAK,CAAC,eAAe,IACrC;AACJ,CAAC;AARD,gCAQC"}
@@ -0,0 +1,4 @@
1
+ import { ConstructorMirror, MethodMirror } from '@cparra/apex-reflection';
2
+ import { ConstructorSource, MethodSource } from '../templating/types';
3
+ export declare function adaptMethod(method: MethodMirror): MethodSource;
4
+ export declare function adaptConstructor(typeName: string, constructor: ConstructorMirror): ConstructorSource;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adaptConstructor = exports.adaptMethod = void 0;
4
+ const documentables_1 = require("./documentables");
5
+ const references_1 = require("./references");
6
+ function adaptMethod(method) {
7
+ var _a, _b, _c;
8
+ function buildTitle(method) {
9
+ const { name, parameters } = method;
10
+ const parametersString = parameters.map((param) => param.name).join(', ');
11
+ return `${name}(${parametersString})`;
12
+ }
13
+ function buildSignature(method) {
14
+ const { access_modifier, typeReference, name, memberModifiers } = method;
15
+ const parameters = method.parameters
16
+ .map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
17
+ .join(', ');
18
+ const members = memberModifiers.length > 0 ? `${memberModifiers.join(' ')} ` : '';
19
+ return `${access_modifier} ${members}${typeReference.rawDeclaration} ${name}(${parameters})`;
20
+ }
21
+ return Object.assign(Object.assign({}, (0, documentables_1.adaptDocumentable)(method)), { title: buildTitle(method), signature: buildSignature(method), returnType: Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)((_b = (_a = method.docComment) === null || _a === void 0 ? void 0 : _a.returnAnnotation) === null || _b === void 0 ? void 0 : _b.bodyLines)), { type: (0, references_1.linkFromTypeNameGenerator)(method.typeReference.rawDeclaration) }), throws: (_c = method.docComment) === null || _c === void 0 ? void 0 : _c.throwsAnnotations.map((thrown) => mapThrows(thrown)), parameters: method.parameters.map((param) => mapParameters(method, param)), inherited: method.inherited });
22
+ }
23
+ exports.adaptMethod = adaptMethod;
24
+ function adaptConstructor(typeName, constructor) {
25
+ var _a;
26
+ function buildTitle(name, constructor) {
27
+ const { parameters } = constructor;
28
+ const parametersString = parameters.map((param) => param.name).join(', ');
29
+ return `${name}(${parametersString})`;
30
+ }
31
+ function buildSignature(name, constructor) {
32
+ const { access_modifier } = constructor;
33
+ const parameters = constructor.parameters
34
+ .map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
35
+ .join(', ');
36
+ return `${access_modifier} ${name}(${parameters})`;
37
+ }
38
+ return Object.assign(Object.assign({}, (0, documentables_1.adaptDocumentable)(constructor)), { title: buildTitle(typeName, constructor), signature: buildSignature(typeName, constructor), parameters: constructor.parameters.map((param) => mapParameters(constructor, param)), throws: (_a = constructor.docComment) === null || _a === void 0 ? void 0 : _a.throwsAnnotations.map((thrown) => mapThrows(thrown)) });
39
+ }
40
+ exports.adaptConstructor = adaptConstructor;
41
+ function mapParameters(documentable, param) {
42
+ var _a;
43
+ const paramAnnotation = (_a = documentable.docComment) === null || _a === void 0 ? void 0 : _a.paramAnnotations.find((pa) => pa.paramName.toLowerCase() === param.name.toLowerCase());
44
+ return Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)(paramAnnotation === null || paramAnnotation === void 0 ? void 0 : paramAnnotation.bodyLines)), { name: param.name, type: (0, references_1.linkFromTypeNameGenerator)(param.typeReference.rawDeclaration) });
45
+ }
46
+ function mapThrows(thrown) {
47
+ return Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)(thrown.bodyLines)), { type: (0, references_1.linkFromTypeNameGenerator)(thrown.exceptionName) });
48
+ }
49
+ //# sourceMappingURL=methods-and-constructors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods-and-constructors.js","sourceRoot":"","sources":["../../src/adapters/methods-and-constructors.ts"],"names":[],"mappings":";;;AAGA,mDAAsE;AACtE,6CAAyD;AAGzD,SAAgB,WAAW,CAAC,MAAoB;;IAC9C,SAAS,UAAU,CAAC,MAAmC;QACrD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QACpC,MAAM,gBAAgB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1E,OAAO,GAAG,IAAI,IAAI,gBAAgB,GAAG,CAAC;IACxC,CAAC;IAED,SAAS,cAAc,CAAC,MAAmC;QACzD,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,IAAI,E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SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAChE,CAAC;IACF,uCACK,IAAA,gCAAgB,EAAC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,CAAC,KAC/C,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAE,IAAA,sCAAyB,EAAC,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,IACnE;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,MAAwB;IACzC,uCACK,IAAA,gCAAgB,EAAC,MAAM,CAAC,SAAS,CAAC,KACrC,IAAI,EAAE,IAAA,sCAAyB,EAAC,MAAM,CAAC,aAAa,CAAC,IACrD;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { RenderableContent, StringOrLink } from '../templating/types';
2
+ export type GetRenderableContentByTypeName = (typeName: string) => StringOrLink;
3
+ export declare const linkFromTypeNameGenerator: GetRenderableContentByTypeName;
4
+ export declare function replaceInlineReferences(text: string, linkReplacer?: GetRenderableContentByTypeName, emailReplacer?: GetRenderableContentByTypeName): RenderableContent[];
5
+ export declare function replaceInlineEmails(renderableContents: RenderableContent[], getLinkByTypeName: GetRenderableContentByTypeName): RenderableContent[];
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.replaceInlineEmails = exports.replaceInlineReferences = exports.linkFromTypeNameGenerator = void 0;
7
+ const class_file_generatorHelper_1 = __importDefault(require("../transpiler/markdown/class-file-generatorHelper"));
8
+ exports.linkFromTypeNameGenerator = class_file_generatorHelper_1.default.getRenderableLinkByTypeName;
9
+ function defaultGetEmailByReference(email) {
10
+ return {
11
+ title: email,
12
+ url: `mailto:${email}`,
13
+ };
14
+ }
15
+ function replaceInlineReferences(text, linkReplacer = exports.linkFromTypeNameGenerator, emailReplacer = defaultGetEmailByReference) {
16
+ return replaceInlineEmails(replaceInlineLinks([text], linkReplacer), emailReplacer);
17
+ }
18
+ exports.replaceInlineReferences = replaceInlineReferences;
19
+ function replaceInlineLinks(renderableContents, getLinkByTypeName) {
20
+ return renderableContents.flatMap((renderableContent) => inlineLinkContent(renderableContent, getLinkByTypeName));
21
+ }
22
+ function inlineLinkContent(renderableContent, getLinkByTypeName) {
23
+ if (typeof renderableContent !== 'string') {
24
+ return [renderableContent];
25
+ }
26
+ const text = renderableContent;
27
+ // Matches either `<<ClassName>>` or `{@link ClassName}`
28
+ const linkFormatRegEx = '{@link (.*?)}|<<([^>]+)>>';
29
+ const matches = match(linkFormatRegEx, text);
30
+ return createRenderableContents(matches, text, getLinkByTypeName);
31
+ }
32
+ function replaceInlineEmails(renderableContents, getLinkByTypeName) {
33
+ return renderableContents.flatMap((renderableContent) => inlineEmailContent(renderableContent, getLinkByTypeName));
34
+ }
35
+ exports.replaceInlineEmails = replaceInlineEmails;
36
+ function inlineEmailContent(renderableContent, getLinkByTypeName) {
37
+ if (typeof renderableContent !== 'string') {
38
+ return [renderableContent];
39
+ }
40
+ const text = renderableContent;
41
+ // Parsing references using the format '{@email email}'
42
+ const linkFormatRegEx = '{@email (.*?)}';
43
+ const matches = match(linkFormatRegEx, text);
44
+ return createRenderableContents(matches, text, getLinkByTypeName);
45
+ }
46
+ function match(regex, text) {
47
+ const expression = new RegExp(regex, 'gi');
48
+ let match;
49
+ const matches = [];
50
+ do {
51
+ match = expression.exec(text);
52
+ if (match) {
53
+ matches.push(match);
54
+ }
55
+ } while (match);
56
+ return matches;
57
+ }
58
+ function createRenderableContents(matches, text, linker) {
59
+ if (matches.length === 0) {
60
+ return [text];
61
+ }
62
+ const result = [];
63
+ let lastIndex = 0;
64
+ for (const match of matches) {
65
+ const index = match.index;
66
+ const length = match[0].length;
67
+ // loop through the matches (skip the first one, which is the full match)
68
+ // until we find the first capturing group that has a value
69
+ const capturedGroup = match.slice(1).find((group) => group);
70
+ if (!capturedGroup) {
71
+ continue;
72
+ }
73
+ result.push(text.slice(lastIndex, index));
74
+ result.push(linker(capturedGroup));
75
+ lastIndex = index + length;
76
+ }
77
+ if (lastIndex < text.length) {
78
+ result.push(text.slice(lastIndex));
79
+ }
80
+ return result;
81
+ }
82
+ //# sourceMappingURL=references.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"references.js","sourceRoot":"","sources":["../../src/adapters/references.ts"],"names":[],"mappings":";;;;;;AAAA,mHAAyF;AAK5E,QAAA,yBAAyB,GACpC,oCAAwB,CAAC,2BAA2B,CAAC;AAEvD,SAAS,0BAA0B,CAAC,KAAa;IAC/C,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,GAAG,EAAE,UAAU,KAAK,EAAE;KACvB,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CACrC,IAAY,EACZ,eAA+C,iCAAyB,EACxE,gBAAgD,0BAA0B;IAE1E,OAAO,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,EAAE,aAAa,CAAC,CAAC;AACtF,CAAC;AAND,0DAMC;AAED,SAAS,kBAAkB,CACzB,kBAAuC,EACvC,iBAAiD;IAEjD,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACpH,CAAC;AAED,SAAS,iBAAiB,CACxB,iBAAoC,EACpC,iBAAiD;IAEjD,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QACzC,OAAO,CAAC,iBAAiB,CAAC,CAAC;KAC5B;IAED,MAAM,IAAI,GAAG,iBAAiB,CAAC;IAE/B,wDAAwD;IACxD,MAAM,eAAe,GAAG,2BAA2B,CAAC;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IAC7C,OAAO,wBAAwB,CAAC,OAAO,EAAE,IAAI,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KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAE/B,yEAAyE;QACzE,2DAA2D;QAC3D,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa,EAAE;YAClB,SAAS;SACV;QACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAEnC,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;KAC5B;IAED,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE;QAC3B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;KACpC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { EmptyLine, RenderableContent } from '../templating/types';
2
+ export declare function isEmptyLine(content: RenderableContent): content is EmptyLine;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEmptyLine = void 0;
4
+ function isEmptyLine(content) {
5
+ return Object.keys(content).includes('type') && content.type === 'empty-line';
6
+ }
7
+ exports.isEmptyLine = isEmptyLine;
8
+ //# sourceMappingURL=type-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../../src/adapters/type-utils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,WAAW,CAAC,OAA0B;IACpD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAK,OAA4B,CAAC,IAAI,KAAK,YAAY,CAAC;AACtG,CAAC;AAFD,kCAEC"}
@@ -1,13 +1,13 @@
1
- import { ReflectionResult } from '@cparra/apex-reflection';
2
- import ApexBundle from '../model/apex-bundle';
3
- /**
4
- * Application entry-point to generate documentation out of Apex source files.
5
- */
6
- export declare class Apexdocs {
7
- /**
8
- * Generates documentation out of Apex source files.
9
- */
10
- static generate(): void;
11
- private static filterByScopes;
12
- static _reflectionWithLogger: (apexBundle: ApexBundle) => ReflectionResult;
13
- }
1
+ import { ReflectionResult } from '@cparra/apex-reflection';
2
+ import ApexBundle from '../model/apex-bundle';
3
+ /**
4
+ * Application entry-point to generate documentation out of Apex source files.
5
+ */
6
+ export declare class Apexdocs {
7
+ /**
8
+ * Generates documentation out of Apex source files.
9
+ */
10
+ static generate(): void;
11
+ private static filterByScopes;
12
+ static _reflectionWithLogger: (apexBundle: ApexBundle) => ReflectionResult;
13
+ }
@@ -1,77 +1,80 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Apexdocs = void 0;
4
- const apex_file_reader_1 = require("../service/apex-file-reader");
5
- const file_system_1 = require("../service/file-system");
6
- const apex_reflection_1 = require("@cparra/apex-reflection");
7
- const logger_1 = require("../util/logger");
8
- const manifest_factory_1 = require("../service/manifest-factory");
9
- const parser_1 = require("../service/parser");
10
- const settings_1 = require("../settings");
11
- const transpiler_1 = require("../transpiler/transpiler");
12
- const file_writer_1 = require("../service/file-writer");
13
- const error_logger_1 = require("../util/error-logger");
14
- const types_repository_1 = require("../model/types-repository");
15
- const factory_1 = require("../transpiler/factory");
16
- /**
17
- * Application entry-point to generate documentation out of Apex source files.
18
- */
19
- class Apexdocs {
20
- /**
21
- * Generates documentation out of Apex source files.
22
- */
23
- static generate() {
24
- logger_1.Logger.log('Initializing...');
25
- const fileBodies = apex_file_reader_1.ApexFileReader.processFiles(new file_system_1.DefaultFileSystem());
26
- const manifest = (0, manifest_factory_1.createManifest)(new parser_1.RawBodyParser(fileBodies), this._reflectionWithLogger);
27
- types_repository_1.TypesRepository.getInstance().populateAll(manifest.types);
28
- const filteredTypes = this.filterByScopes(manifest);
29
- types_repository_1.TypesRepository.getInstance().populateScoped(filteredTypes);
30
- const processor = factory_1.TypeTranspilerFactory.get(settings_1.Settings.getInstance().targetGenerator);
31
- transpiler_1.default.generate(filteredTypes, processor);
32
- const generatedFiles = processor.fileBuilder().files();
33
- const files = [];
34
- file_writer_1.FileWriter.write(generatedFiles, (file) => {
35
- logger_1.Logger.logSingle(`${file.name} processed.`, false, 'green', false);
36
- files.push(file);
37
- });
38
- settings_1.Settings.getInstance().onAfterProcess(files);
39
- // Error logging
40
- error_logger_1.default.logErrors(filteredTypes);
41
- }
42
- static filterByScopes(manifest) {
43
- let filteredTypes;
44
- let filteredLogMessage;
45
- if (settings_1.Settings.getInstance().config.targetGenerator !== 'openapi') {
46
- filteredTypes = manifest.filteredByAccessModifierAndAnnotations(settings_1.Settings.getInstance().scope);
47
- filteredLogMessage = `Filtered ${manifest.types.length - filteredTypes.length} file(s) based on scope: ${settings_1.Settings.getInstance().scope}`;
48
- }
49
- else {
50
- // If we are dealing with an OpenApi generator, we ignore the passed in access modifiers, and instead
51
- // we only keep classes annotated as @RestResource
52
- filteredTypes = manifest.filteredByAccessModifierAndAnnotations([
53
- 'restresource',
54
- 'httpdelete',
55
- 'httpget',
56
- 'httppatch',
57
- 'httppost',
58
- 'httpput',
59
- ]);
60
- filteredLogMessage = `Filtered ${manifest.types.length - filteredTypes.length} file(s), only keeping classes annotated as @RestResource.`;
61
- }
62
- logger_1.Logger.clear();
63
- logger_1.Logger.logSingle(filteredLogMessage, false, 'green', false);
64
- logger_1.Logger.logSingle(`Creating documentation for ${filteredTypes.length} file(s)`, false, 'green', false);
65
- return filteredTypes;
66
- }
67
- }
68
- exports.Apexdocs = Apexdocs;
69
- Apexdocs._reflectionWithLogger = (apexBundle) => {
70
- var _a;
71
- const result = (0, apex_reflection_1.reflect)(apexBundle.rawTypeContent);
72
- if (result.error) {
73
- logger_1.Logger.error(`${apexBundle.filePath} - Parsing error ${(_a = result.error) === null || _a === void 0 ? void 0 : _a.message}`);
74
- }
75
- return result;
76
- };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Apexdocs = void 0;
7
+ const apex_file_reader_1 = require("../service/apex-file-reader");
8
+ const file_system_1 = require("../service/file-system");
9
+ const apex_reflection_1 = require("@cparra/apex-reflection");
10
+ const logger_1 = require("../util/logger");
11
+ const manifest_factory_1 = require("../service/manifest-factory");
12
+ const parser_1 = require("../service/parser");
13
+ const settings_1 = require("../settings");
14
+ const transpiler_1 = __importDefault(require("../transpiler/transpiler"));
15
+ const file_writer_1 = require("../service/file-writer");
16
+ const error_logger_1 = __importDefault(require("../util/error-logger"));
17
+ const types_repository_1 = require("../model/types-repository");
18
+ const factory_1 = require("../transpiler/factory");
19
+ /**
20
+ * Application entry-point to generate documentation out of Apex source files.
21
+ */
22
+ class Apexdocs {
23
+ /**
24
+ * Generates documentation out of Apex source files.
25
+ */
26
+ static generate() {
27
+ logger_1.Logger.log('Initializing...');
28
+ const fileBodies = apex_file_reader_1.ApexFileReader.processFiles(new file_system_1.DefaultFileSystem());
29
+ const manifest = (0, manifest_factory_1.createManifest)(new parser_1.RawBodyParser(fileBodies), this._reflectionWithLogger);
30
+ types_repository_1.TypesRepository.getInstance().populateAll(manifest.types);
31
+ const filteredTypes = this.filterByScopes(manifest);
32
+ types_repository_1.TypesRepository.getInstance().populateScoped(filteredTypes);
33
+ const processor = factory_1.TypeTranspilerFactory.get(settings_1.Settings.getInstance().targetGenerator);
34
+ transpiler_1.default.generate(filteredTypes, processor);
35
+ const generatedFiles = processor.fileBuilder().files();
36
+ const files = [];
37
+ file_writer_1.FileWriter.write(generatedFiles, (file) => {
38
+ logger_1.Logger.logSingle(`${file.name} processed.`, false, 'green', false);
39
+ files.push(file);
40
+ });
41
+ settings_1.Settings.getInstance().onAfterProcess(files);
42
+ // Error logging
43
+ error_logger_1.default.logErrors(filteredTypes);
44
+ }
45
+ static filterByScopes(manifest) {
46
+ let filteredTypes;
47
+ let filteredLogMessage;
48
+ if (settings_1.Settings.getInstance().config.targetGenerator !== 'openapi') {
49
+ filteredTypes = manifest.filteredByAccessModifierAndAnnotations(settings_1.Settings.getInstance().scope);
50
+ filteredLogMessage = `Filtered ${manifest.types.length - filteredTypes.length} file(s) based on scope: ${settings_1.Settings.getInstance().scope}`;
51
+ }
52
+ else {
53
+ // If we are dealing with an OpenApi generator, we ignore the passed in access modifiers, and instead
54
+ // we only keep classes annotated as @RestResource
55
+ filteredTypes = manifest.filteredByAccessModifierAndAnnotations([
56
+ 'restresource',
57
+ 'httpdelete',
58
+ 'httpget',
59
+ 'httppatch',
60
+ 'httppost',
61
+ 'httpput',
62
+ ]);
63
+ filteredLogMessage = `Filtered ${manifest.types.length - filteredTypes.length} file(s), only keeping classes annotated as @RestResource.`;
64
+ }
65
+ logger_1.Logger.clear();
66
+ logger_1.Logger.logSingle(filteredLogMessage, false, 'green', false);
67
+ logger_1.Logger.logSingle(`Creating documentation for ${filteredTypes.length} file(s)`, false, 'green', false);
68
+ return filteredTypes;
69
+ }
70
+ }
71
+ exports.Apexdocs = Apexdocs;
72
+ Apexdocs._reflectionWithLogger = (apexBundle) => {
73
+ var _a;
74
+ const result = (0, apex_reflection_1.reflect)(apexBundle.rawTypeContent);
75
+ if (result.error) {
76
+ logger_1.Logger.error(`${apexBundle.filePath} - Parsing error ${(_a = result.error) === null || _a === void 0 ? void 0 : _a.message}`);
77
+ }
78
+ return result;
79
+ };
77
80
  //# sourceMappingURL=Apexdocs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAC7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