@cparra/apexdocs 2.25.0-alpha.2 → 2.25.0-alpha.4

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 (355) hide show
  1. package/README.md +37 -0
  2. package/dist/cli/generate.js +291 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +1 -0
  5. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +18 -0
  6. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +6 -2
  7. package/examples/plain-markdown/docs/Miscellaneous/ns.Url.md +320 -0
  8. package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +3 -1
  9. package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +1 -1
  10. package/examples/plain-markdown/docs/index.md +84 -0
  11. package/examples/plain-markdown/force-app/classes/SampleException.cls +16 -0
  12. package/examples/plain-markdown/force-app/classes/Url.cls +194 -0
  13. package/examples/plain-markdown/package.json +2 -1
  14. package/jest.config.js +1 -1
  15. package/package.json +11 -13
  16. package/src/__spec__/core/generating-class-docs.spec.ts +57 -37
  17. package/src/__spec__/core/generating-enum-docs.spec.ts +25 -22
  18. package/src/__spec__/core/generating-interface-docs.spec.ts +33 -30
  19. package/src/__spec__/core/generating-reference-guide.spec.ts +8 -7
  20. package/src/__spec__/core/test-helpers.ts +9 -0
  21. package/src/application/Apexdocs.ts +34 -5
  22. package/src/application/{flows → generators}/generate-markdown-files.ts +19 -13
  23. package/src/cli/args.ts +138 -0
  24. package/src/cli/generate.ts +12 -138
  25. package/src/core/adapters/__tests__/documentables.spec.ts +109 -0
  26. package/src/{adapters → core/adapters}/__tests__/interface-adapter.spec.ts +13 -11
  27. package/src/{adapters → core/adapters}/__tests__/references.spec.ts +23 -2
  28. package/src/{adapters → core/adapters}/apex-types.ts +18 -15
  29. package/src/{adapters → core/adapters}/documentables.ts +54 -12
  30. package/src/{adapters → core/adapters}/fields-and-properties.ts +17 -10
  31. package/src/{adapters/references.ts → core/adapters/inline.ts} +43 -13
  32. package/src/{adapters → core/adapters}/methods-and-constructors.ts +21 -9
  33. package/src/core/adapters/type-utils.ts +13 -0
  34. package/src/core/{renderable → adapters}/types.d.ts +42 -4
  35. package/src/core/generate-docs.ts +55 -19
  36. package/src/core/template.ts +15 -9
  37. package/src/core/templates/reference-guide.ts +1 -1
  38. package/src/model/__tests__/manifest.spec.ts +1 -1
  39. package/src/model/markdown-generation-util/field-declaration-util.ts +1 -1
  40. package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
  41. package/src/model/markdown-type-file.ts +5 -1
  42. package/src/service/__tests__/apex-file-reader.spec.ts +1 -0
  43. package/src/service/apex-file-reader.ts +2 -6
  44. package/src/service/manifest-factory.ts +2 -2
  45. package/src/service/parser.ts +1 -1
  46. package/src/settings.ts +6 -10
  47. package/src/test-helpers/SettingsBuilder.ts +1 -2
  48. package/src/transpiler/factory.ts +2 -4
  49. package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -18
  50. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +2 -2
  51. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +6 -4
  52. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +1 -1
  53. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +2 -2
  54. package/src/util/fp.ts +3 -0
  55. package/tsconfig.json +1 -1
  56. package/docs/.nojekyll +0 -0
  57. package/docs/__old/README.md +0 -1
  58. package/docs/__old/index.html +0 -22
  59. package/docs/__old/restapi.json +0 -589
  60. package/docs/__old/types/Classes/nspc.AnotherInterface.md +0 -22
  61. package/docs/__old/types/Classes/nspc.ChildClass.md +0 -97
  62. package/docs/__old/types/Main/nspc.GroupedClass.md +0 -10
  63. package/docs/__old/types/Main/nspc.SampleClass.md +0 -189
  64. package/docs/__old/types/Misc-Group/nspc.EscapedAnnotations.md +0 -4
  65. package/docs/__old/types/Misc-Group/nspc.GrandparentClass.md +0 -13
  66. package/docs/__old/types/Misc-Group/nspc.InterfaceWithInheritance.md +0 -29
  67. package/docs/__old/types/Misc-Group/nspc.MemberGrouping.md +0 -13
  68. package/docs/__old/types/Misc-Group/nspc.ParentClass.md +0 -37
  69. package/docs/__old/types/Misc-Group/nspc.Reference1.md +0 -18
  70. package/docs/__old/types/Misc-Group/nspc.Reference2.md +0 -12
  71. package/docs/__old/types/Misc-Group/nspc.Reference3.md +0 -7
  72. package/docs/__old/types/Misc-Group/nspc.Reference4.md +0 -7
  73. package/docs/__old/types/Misc-Group/nspc.Reference5.md +0 -7
  74. package/docs/__old/types/Misc-Group/nspc.Reference6.md +0 -9
  75. package/docs/__old/types/Misc-Group/nspc.Reference7.md +0 -7
  76. package/docs/__old/types/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -11
  77. package/docs/__old/types/Misc-Group/nspc.SampleRestResource.md +0 -104
  78. package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -33
  79. package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -14
  80. package/docs/__old/types/README.md +0 -97
  81. package/docs/__old/types/Sample-Interfaces/nspc.SampleInterface.md +0 -23
  82. package/examples/includes/header.md +0 -3
  83. package/lib/__spec__/core/expect-extensions.d.ts +0 -3
  84. package/lib/__spec__/core/expect-extensions.js +0 -54
  85. package/lib/__spec__/core/expect-extensions.js.map +0 -1
  86. package/lib/__spec__/core/generating-class-docs.spec.d.ts +0 -1
  87. package/lib/__spec__/core/generating-class-docs.spec.js +0 -427
  88. package/lib/__spec__/core/generating-class-docs.spec.js.map +0 -1
  89. package/lib/__spec__/core/generating-enum-docs.spec.d.ts +0 -1
  90. package/lib/__spec__/core/generating-enum-docs.spec.js +0 -303
  91. package/lib/__spec__/core/generating-enum-docs.spec.js.map +0 -1
  92. package/lib/__spec__/core/generating-interface-docs.spec.d.ts +0 -1
  93. package/lib/__spec__/core/generating-interface-docs.spec.js +0 -361
  94. package/lib/__spec__/core/generating-interface-docs.spec.js.map +0 -1
  95. package/lib/__spec__/core/generating-reference-guide.spec.d.ts +0 -1
  96. package/lib/__spec__/core/generating-reference-guide.spec.js +0 -161
  97. package/lib/__spec__/core/generating-reference-guide.spec.js.map +0 -1
  98. package/lib/adapters/apex-types.d.ts +0 -5
  99. package/lib/adapters/apex-types.js +0 -109
  100. package/lib/adapters/apex-types.js.map +0 -1
  101. package/lib/adapters/documentables.d.ts +0 -7
  102. package/lib/adapters/documentables.js +0 -56
  103. package/lib/adapters/documentables.js.map +0 -1
  104. package/lib/adapters/fields-and-properties.d.ts +0 -4
  105. package/lib/adapters/fields-and-properties.js +0 -31
  106. package/lib/adapters/fields-and-properties.js.map +0 -1
  107. package/lib/adapters/methods-and-constructors.d.ts +0 -5
  108. package/lib/adapters/methods-and-constructors.js +0 -91
  109. package/lib/adapters/methods-and-constructors.js.map +0 -1
  110. package/lib/adapters/references.d.ts +0 -5
  111. package/lib/adapters/references.js +0 -82
  112. package/lib/adapters/references.js.map +0 -1
  113. package/lib/adapters/type-utils.d.ts +0 -2
  114. package/lib/adapters/type-utils.js +0 -7
  115. package/lib/adapters/type-utils.js.map +0 -1
  116. package/lib/application/Apexdocs.d.ts +0 -13
  117. package/lib/application/Apexdocs.js +0 -86
  118. package/lib/application/Apexdocs.js.map +0 -1
  119. package/lib/application/flows/generate-markdown-files.d.ts +0 -3
  120. package/lib/application/flows/generate-markdown-files.js +0 -57
  121. package/lib/application/flows/generate-markdown-files.js.map +0 -1
  122. package/lib/cli/generate.d.ts +0 -2
  123. package/lib/cli/generate.js +0 -157
  124. package/lib/cli/generate.js.map +0 -1
  125. package/lib/core/__test__/inheritance-chain.test.d.ts +0 -1
  126. package/lib/core/__test__/inheritance-chain.test.js +0 -42
  127. package/lib/core/__test__/inheritance-chain.test.js.map +0 -1
  128. package/lib/core/generate-docs.d.ts +0 -24
  129. package/lib/core/generate-docs.js +0 -267
  130. package/lib/core/generate-docs.js.map +0 -1
  131. package/lib/core/inheritance-chain.d.ts +0 -2
  132. package/lib/core/inheritance-chain.js +0 -35
  133. package/lib/core/inheritance-chain.js.map +0 -1
  134. package/lib/core/template.d.ts +0 -10
  135. package/lib/core/template.js +0 -92
  136. package/lib/core/template.js.map +0 -1
  137. package/lib/core/templates/reference-guide.d.ts +0 -1
  138. package/lib/core/templates/reference-guide.js +0 -18
  139. package/lib/core/templates/reference-guide.js.map +0 -1
  140. package/lib/index.d.ts +0 -2
  141. package/lib/index.js +0 -29
  142. package/lib/index.js.map +0 -1
  143. package/lib/model/apex-bundle.d.ts +0 -6
  144. package/lib/model/apex-bundle.js +0 -11
  145. package/lib/model/apex-bundle.js.map +0 -1
  146. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -7
  147. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -14
  148. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -1
  149. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -7
  150. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -12
  151. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -1
  152. package/lib/model/inheritance.d.ts +0 -11
  153. package/lib/model/inheritance.js +0 -3
  154. package/lib/model/inheritance.js.map +0 -1
  155. package/lib/model/manifest.d.ts +0 -22
  156. package/lib/model/manifest.js +0 -53
  157. package/lib/model/manifest.js.map +0 -1
  158. package/lib/model/markdown-file.d.ts +0 -16
  159. package/lib/model/markdown-file.js +0 -111
  160. package/lib/model/markdown-file.js.map +0 -1
  161. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -8
  162. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +0 -46
  163. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
  164. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +0 -3
  165. package/lib/model/markdown-generation-util/field-declaration-util.js +0 -54
  166. package/lib/model/markdown-generation-util/field-declaration-util.js.map +0 -1
  167. package/lib/model/markdown-generation-util/index.d.ts +0 -3
  168. package/lib/model/markdown-generation-util/index.js +0 -20
  169. package/lib/model/markdown-generation-util/index.js.map +0 -1
  170. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +0 -4
  171. package/lib/model/markdown-generation-util/method-declaration-util.js +0 -114
  172. package/lib/model/markdown-generation-util/method-declaration-util.js.map +0 -1
  173. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +0 -3
  174. package/lib/model/markdown-generation-util/type-declaration-util.js +0 -81
  175. package/lib/model/markdown-generation-util/type-declaration-util.js.map +0 -1
  176. package/lib/model/markdown-home-file.d.ts +0 -11
  177. package/lib/model/markdown-home-file.js +0 -57
  178. package/lib/model/markdown-home-file.js.map +0 -1
  179. package/lib/model/markdown-type-file.d.ts +0 -26
  180. package/lib/model/markdown-type-file.js +0 -137
  181. package/lib/model/markdown-type-file.js.map +0 -1
  182. package/lib/model/openapi/apex-doc-types.d.ts +0 -19
  183. package/lib/model/openapi/apex-doc-types.js +0 -5
  184. package/lib/model/openapi/apex-doc-types.js.map +0 -1
  185. package/lib/model/openapi/open-api-types.d.ts +0 -93
  186. package/lib/model/openapi/open-api-types.js +0 -3
  187. package/lib/model/openapi/open-api-types.js.map +0 -1
  188. package/lib/model/openapi/open-api.d.ts +0 -16
  189. package/lib/model/openapi/open-api.js +0 -34
  190. package/lib/model/openapi/open-api.js.map +0 -1
  191. package/lib/model/openapi/openapi-type-file.d.ts +0 -7
  192. package/lib/model/openapi/openapi-type-file.js +0 -17
  193. package/lib/model/openapi/openapi-type-file.js.map +0 -1
  194. package/lib/model/outputFile.d.ts +0 -10
  195. package/lib/model/outputFile.js +0 -22
  196. package/lib/model/outputFile.js.map +0 -1
  197. package/lib/model/types-repository.d.ts +0 -16
  198. package/lib/model/types-repository.js +0 -54
  199. package/lib/model/types-repository.js.map +0 -1
  200. package/lib/service/apex-file-reader.d.ts +0 -14
  201. package/lib/service/apex-file-reader.js +0 -49
  202. package/lib/service/apex-file-reader.js.map +0 -1
  203. package/lib/service/file-system.d.ts +0 -14
  204. package/lib/service/file-system.js +0 -48
  205. package/lib/service/file-system.js.map +0 -1
  206. package/lib/service/file-writer.d.ts +0 -6
  207. package/lib/service/file-writer.js +0 -57
  208. package/lib/service/file-writer.js.map +0 -1
  209. package/lib/service/manifest-factory.d.ts +0 -10
  210. package/lib/service/manifest-factory.js +0 -16
  211. package/lib/service/manifest-factory.js.map +0 -1
  212. package/lib/service/metadata-processor.d.ts +0 -3
  213. package/lib/service/metadata-processor.js +0 -17
  214. package/lib/service/metadata-processor.js.map +0 -1
  215. package/lib/service/parser.d.ts +0 -21
  216. package/lib/service/parser.js +0 -138
  217. package/lib/service/parser.js.map +0 -1
  218. package/lib/service/state.d.ts +0 -9
  219. package/lib/service/state.js +0 -20
  220. package/lib/service/state.js.map +0 -1
  221. package/lib/service/walkers/class-walker.d.ts +0 -4
  222. package/lib/service/walkers/class-walker.js +0 -33
  223. package/lib/service/walkers/class-walker.js.map +0 -1
  224. package/lib/service/walkers/enum-walker.d.ts +0 -4
  225. package/lib/service/walkers/enum-walker.js +0 -11
  226. package/lib/service/walkers/enum-walker.js.map +0 -1
  227. package/lib/service/walkers/interface-walker.d.ts +0 -4
  228. package/lib/service/walkers/interface-walker.js +0 -15
  229. package/lib/service/walkers/interface-walker.js.map +0 -1
  230. package/lib/service/walkers/walker-factory.d.ts +0 -5
  231. package/lib/service/walkers/walker-factory.js +0 -21
  232. package/lib/service/walkers/walker-factory.js.map +0 -1
  233. package/lib/service/walkers/walker.d.ts +0 -19
  234. package/lib/service/walkers/walker.js +0 -17
  235. package/lib/service/walkers/walker.js.map +0 -1
  236. package/lib/settings.d.ts +0 -64
  237. package/lib/settings.js +0 -89
  238. package/lib/settings.js.map +0 -1
  239. package/lib/test-helpers/AnnotationBuilder.d.ts +0 -12
  240. package/lib/test-helpers/AnnotationBuilder.js +0 -31
  241. package/lib/test-helpers/AnnotationBuilder.js.map +0 -1
  242. package/lib/test-helpers/ClassMirrorBuilder.d.ts +0 -22
  243. package/lib/test-helpers/ClassMirrorBuilder.js +0 -64
  244. package/lib/test-helpers/ClassMirrorBuilder.js.map +0 -1
  245. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -8
  246. package/lib/test-helpers/DocCommentAnnotationBuilder.js +0 -26
  247. package/lib/test-helpers/DocCommentAnnotationBuilder.js.map +0 -1
  248. package/lib/test-helpers/DocCommentBuilder.d.ts +0 -12
  249. package/lib/test-helpers/DocCommentBuilder.js +0 -38
  250. package/lib/test-helpers/DocCommentBuilder.js.map +0 -1
  251. package/lib/test-helpers/FieldMirrorBuilder.d.ts +0 -18
  252. package/lib/test-helpers/FieldMirrorBuilder.js +0 -54
  253. package/lib/test-helpers/FieldMirrorBuilder.js.map +0 -1
  254. package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +0 -16
  255. package/lib/test-helpers/InterfaceMirrorBuilder.js +0 -43
  256. package/lib/test-helpers/InterfaceMirrorBuilder.js.map +0 -1
  257. package/lib/test-helpers/MethodMirrorBuilder.d.ts +0 -29
  258. package/lib/test-helpers/MethodMirrorBuilder.js +0 -72
  259. package/lib/test-helpers/MethodMirrorBuilder.js.map +0 -1
  260. package/lib/test-helpers/SettingsBuilder.d.ts +0 -8
  261. package/lib/test-helpers/SettingsBuilder.js +0 -27
  262. package/lib/test-helpers/SettingsBuilder.js.map +0 -1
  263. package/lib/transpiler/factory.d.ts +0 -6
  264. package/lib/transpiler/factory.js +0 -35
  265. package/lib/transpiler/factory.js.map +0 -1
  266. package/lib/transpiler/file-container.d.ts +0 -6
  267. package/lib/transpiler/file-container.js +0 -16
  268. package/lib/transpiler/file-container.js.map +0 -1
  269. package/lib/transpiler/generator-choices.d.ts +0 -1
  270. package/lib/transpiler/generator-choices.js +0 -3
  271. package/lib/transpiler/generator-choices.js.map +0 -1
  272. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +0 -11
  273. package/lib/transpiler/markdown/class-file-generatorHelper.js +0 -75
  274. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
  275. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -6
  276. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +0 -13
  277. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -1
  278. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -11
  279. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -51
  280. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -1
  281. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +0 -11
  282. package/lib/transpiler/markdown/markdown-transpiler-base.js +0 -27
  283. package/lib/transpiler/markdown/markdown-transpiler-base.js.map +0 -1
  284. package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +0 -1
  285. package/lib/transpiler/markdown/plain-markdown/class-template.js +0 -77
  286. package/lib/transpiler/markdown/plain-markdown/class-template.js.map +0 -1
  287. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -1
  288. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +0 -36
  289. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -1
  290. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -1
  291. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +0 -28
  292. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +0 -1
  293. package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -1
  294. package/lib/transpiler/markdown/plain-markdown/enum-template.js +0 -16
  295. package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +0 -1
  296. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -1
  297. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +0 -27
  298. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -1
  299. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -1
  300. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -10
  301. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -1
  302. package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -1
  303. package/lib/transpiler/markdown/plain-markdown/interface-template.js +0 -20
  304. package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +0 -1
  305. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -1
  306. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +0 -47
  307. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -1
  308. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -9
  309. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +0 -42
  310. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +0 -1
  311. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -1
  312. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -31
  313. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -1
  314. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +0 -13
  315. package/lib/transpiler/openapi/open-api-docs-processor.js +0 -78
  316. package/lib/transpiler/openapi/open-api-docs-processor.js.map +0 -1
  317. package/lib/transpiler/openapi/parsers/Builder.d.ts +0 -16
  318. package/lib/transpiler/openapi/parsers/Builder.js +0 -30
  319. package/lib/transpiler/openapi/parsers/Builder.js.map +0 -1
  320. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +0 -20
  321. package/lib/transpiler/openapi/parsers/MethodParser.js +0 -190
  322. package/lib/transpiler/openapi/parsers/MethodParser.js.map +0 -1
  323. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -7
  324. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -11
  325. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -1
  326. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -39
  327. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +0 -250
  328. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -1
  329. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -10
  330. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -20
  331. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -1
  332. package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -7
  333. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +0 -22
  334. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -1
  335. package/lib/transpiler/processor-type-transpiler.d.ts +0 -10
  336. package/lib/transpiler/processor-type-transpiler.js +0 -9
  337. package/lib/transpiler/processor-type-transpiler.js.map +0 -1
  338. package/lib/transpiler/transpiler.d.ts +0 -5
  339. package/lib/transpiler/transpiler.js +0 -30
  340. package/lib/transpiler/transpiler.js.map +0 -1
  341. package/lib/util/error-logger.d.ts +0 -8
  342. package/lib/util/error-logger.js +0 -90
  343. package/lib/util/error-logger.js.map +0 -1
  344. package/lib/util/logger.d.ts +0 -21
  345. package/lib/util/logger.js +0 -61
  346. package/lib/util/logger.js.map +0 -1
  347. package/lib/util/string-utils.d.ts +0 -2
  348. package/lib/util/string-utils.js +0 -15
  349. package/lib/util/string-utils.js.map +0 -1
  350. package/src/adapters/type-utils.ts +0 -5
  351. package/src/adapters/types.d.ts +0 -8
  352. package/src/model/inheritance.ts +0 -8
  353. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +0 -42
  354. /package/src/{model → core}/apex-bundle.ts +0 -0
  355. /package/src/{model → core}/manifest.ts +0 -0
@@ -1,13 +1,14 @@
1
- import ClassFileGeneratorHelper from '../transpiler/markdown/class-file-generatorHelper';
2
- import { Link, RenderableContent, StringOrLink } from '../core/renderable/types';
1
+ import { InlineCode, Link, RenderableContent } from './types';
2
+ import { pipe } from 'fp-ts/function';
3
+ import { apply } from '../../util/fp';
3
4
 
4
- export type GetRenderableContentByTypeName = (typeName: string) => StringOrLink;
5
+ type InlineRenderableContent = InlineCode | Link | string;
5
6
 
6
- export const linkFromTypeNameGenerator: GetRenderableContentByTypeName =
7
- ClassFileGeneratorHelper.getRenderableLinkByTypeName;
7
+ type ToInlineRenderableContent = (typeName: string) => InlineRenderableContent;
8
8
 
9
9
  function defaultGetEmailByReference(email: string): Link {
10
10
  return {
11
+ __type: 'link',
11
12
  title: email,
12
13
  url: `mailto:${email}`,
13
14
  };
@@ -15,22 +16,51 @@ function defaultGetEmailByReference(email: string): Link {
15
16
 
16
17
  export function replaceInlineReferences(
17
18
  text: string,
18
- linkReplacer: GetRenderableContentByTypeName = linkFromTypeNameGenerator,
19
- emailReplacer: GetRenderableContentByTypeName = defaultGetEmailByReference,
19
+ linkReplacer: ToInlineRenderableContent,
20
+ emailReplacer: ToInlineRenderableContent = defaultGetEmailByReference,
20
21
  ): RenderableContent[] {
21
- return replaceInlineEmails(replaceInlineLinks([text], linkReplacer), emailReplacer);
22
+ const inlineLinks = apply(replaceInlineLinks, linkReplacer);
23
+ const inlineEmails = apply(replaceInlineEmails, emailReplacer);
24
+
25
+ return pipe(inlineCode([text]), inlineLinks, inlineEmails);
26
+ }
27
+
28
+ function inlineCode(renderableContents: RenderableContent[]): RenderableContent[] {
29
+ return renderableContents.flatMap((renderableContent) => inlineCodeContent(renderableContent));
30
+ }
31
+
32
+ // Replace string that is inline code with InlineCode
33
+ // Inline code is any text that backticks surround
34
+ function inlineCodeContent(renderableContent: RenderableContent): RenderableContent[] {
35
+ if (typeof renderableContent !== 'string') {
36
+ return [renderableContent];
37
+ }
38
+
39
+ function inlineCodeLink(text: string): InlineCode {
40
+ return {
41
+ __type: 'inline-code',
42
+ content: text,
43
+ };
44
+ }
45
+
46
+ const text = renderableContent;
47
+
48
+ // Matches any text surrounded by backticks
49
+ const codeFormatRegEx = '`([^`]*)`';
50
+ const matches = match(codeFormatRegEx, text);
51
+ return createRenderableContents(matches, text, inlineCodeLink);
22
52
  }
23
53
 
24
54
  function replaceInlineLinks(
55
+ getLinkByTypeName: ToInlineRenderableContent,
25
56
  renderableContents: RenderableContent[],
26
- getLinkByTypeName: GetRenderableContentByTypeName,
27
57
  ): RenderableContent[] {
28
58
  return renderableContents.flatMap((renderableContent) => inlineLinkContent(renderableContent, getLinkByTypeName));
29
59
  }
30
60
 
31
61
  function inlineLinkContent(
32
62
  renderableContent: RenderableContent,
33
- getLinkByTypeName: GetRenderableContentByTypeName,
63
+ getLinkByTypeName: ToInlineRenderableContent,
34
64
  ): RenderableContent[] {
35
65
  if (typeof renderableContent !== 'string') {
36
66
  return [renderableContent];
@@ -45,15 +75,15 @@ function inlineLinkContent(
45
75
  }
46
76
 
47
77
  export function replaceInlineEmails(
78
+ getLinkByTypeName: ToInlineRenderableContent,
48
79
  renderableContents: RenderableContent[],
49
- getLinkByTypeName: GetRenderableContentByTypeName,
50
80
  ): RenderableContent[] {
51
81
  return renderableContents.flatMap((renderableContent) => inlineEmailContent(renderableContent, getLinkByTypeName));
52
82
  }
53
83
 
54
84
  function inlineEmailContent(
55
85
  renderableContent: RenderableContent,
56
- getLinkByTypeName: GetRenderableContentByTypeName,
86
+ getLinkByTypeName: ToInlineRenderableContent,
57
87
  ): RenderableContent[] {
58
88
  if (typeof renderableContent !== 'string') {
59
89
  return [renderableContent];
@@ -82,7 +112,7 @@ function match(regex: string, text: string) {
82
112
  return matches;
83
113
  }
84
114
 
85
- function createRenderableContents(matches: RegExpExecArray[], text: string, linker: GetRenderableContentByTypeName) {
115
+ function createRenderableContents(matches: RegExpExecArray[], text: string, linker: ToInlineRenderableContent) {
86
116
  if (matches.length === 0) {
87
117
  return [text];
88
118
  }
@@ -1,8 +1,12 @@
1
1
  import { ConstructorMirror, MethodMirror, ParameterMirror, ThrowsAnnotation } from '@cparra/apex-reflection';
2
- import { RenderableConstructor, RenderableMethod } from '../core/renderable/types';
3
- import { MethodMirrorWithInheritance } from '../model/inheritance';
2
+ import {
3
+ RenderableConstructor,
4
+ RenderableMethod,
5
+ MethodMirrorWithInheritance,
6
+ CodeBlock,
7
+ GetRenderableContentByTypeName,
8
+ } from './types';
4
9
  import { adaptDescribable, adaptDocumentable } from './documentables';
5
- import { GetRenderableContentByTypeName } from './references';
6
10
  import { Documentable } from './types';
7
11
 
8
12
  export function adaptMethod(
@@ -16,13 +20,17 @@ export function adaptMethod(
16
20
  return `${name}(${parametersString})`;
17
21
  }
18
22
 
19
- function buildSignature(method: MethodMirrorWithInheritance): string {
23
+ function buildSignature(method: MethodMirrorWithInheritance): CodeBlock {
20
24
  const { access_modifier, typeReference, name, memberModifiers } = method;
21
25
  const parameters = method.parameters
22
26
  .map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
23
27
  .join(', ');
24
28
  const members = memberModifiers.length > 0 ? `${memberModifiers.join(' ')} ` : '';
25
- return `${access_modifier} ${members}${typeReference.rawDeclaration} ${name}(${parameters})`;
29
+ return {
30
+ __type: 'code-block',
31
+ language: 'apex',
32
+ content: [`${access_modifier} ${members}${typeReference.rawDeclaration} ${name}(${parameters})`],
33
+ };
26
34
  }
27
35
 
28
36
  return {
@@ -32,7 +40,7 @@ export function adaptMethod(
32
40
  signature: {
33
41
  headingLevel: baseHeadingLevel + 1,
34
42
  heading: 'Signature',
35
- value: [buildSignature(method as MethodMirrorWithInheritance)],
43
+ value: buildSignature(method as MethodMirrorWithInheritance),
36
44
  },
37
45
  returnType: {
38
46
  headingLevel: baseHeadingLevel + 1,
@@ -68,12 +76,16 @@ export function adaptConstructor(
68
76
  return `${name}(${parametersString})`;
69
77
  }
70
78
 
71
- function buildSignature(name: string, constructor: ConstructorMirror): string {
79
+ function buildSignature(name: string, constructor: ConstructorMirror): CodeBlock {
72
80
  const { access_modifier } = constructor;
73
81
  const parameters = constructor.parameters
74
82
  .map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
75
83
  .join(', ');
76
- return `${access_modifier} ${name}(${parameters})`;
84
+ return {
85
+ __type: 'code-block',
86
+ language: 'apex',
87
+ content: [`${access_modifier} ${name}(${parameters})`],
88
+ };
77
89
  }
78
90
 
79
91
  return {
@@ -83,7 +95,7 @@ export function adaptConstructor(
83
95
  signature: {
84
96
  headingLevel: baseHeadingLevel + 1,
85
97
  heading: 'Signature',
86
- value: [buildSignature(typeName, constructor)],
98
+ value: buildSignature(typeName, constructor),
87
99
  },
88
100
  parameters: {
89
101
  headingLevel: baseHeadingLevel + 1,
@@ -0,0 +1,13 @@
1
+ import { CodeBlock, EmptyLine, InlineCode, 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
+ }
10
+
11
+ export function isInlineCode(content: RenderableContent): content is InlineCode {
12
+ return Object.keys(content).includes('__type') && (content as { __type: string }).__type === 'inline-code';
13
+ }
@@ -1,15 +1,44 @@
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
- type: 'empty-line';
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 GetRenderableContentByTypeName = (typeName: string) => StringOrLink;
40
+
41
+ export type RenderableContent = StringOrLink | EmptyLine | CodeBlock | InlineCode;
13
42
 
14
43
  type EnumValue = {
15
44
  value: string;
@@ -22,11 +51,20 @@ type CustomTag = {
22
51
  };
23
52
 
24
53
  /**
25
- * Represents an annotation to a top-level type. For example @NamespaceAccessible.
54
+ * Represents an annotation to a top-level type. For example, @NamespaceAccessible.
26
55
  */
27
56
  type Annotation = string;
28
57
 
29
- type CodeBlock = string[];
58
+ type CodeBlock = {
59
+ readonly __type: 'code-block';
60
+ language: string;
61
+ content: string[];
62
+ };
63
+
64
+ type InlineCode = {
65
+ readonly __type: 'inline-code';
66
+ content: string;
67
+ };
30
68
 
31
69
  type RenderableDocumentation = {
32
70
  annotations?: Annotation[];
@@ -1,18 +1,22 @@
1
1
  import { ClassMirror, InterfaceMirror, reflect as mirrorReflection, Type } from '@cparra/apex-reflection';
2
- import { typeToRenderableType } from '../adapters/apex-types';
3
- import { Link, Renderable, RenderableContent, RenderableEnum, StringOrLink } from './renderable/types';
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
- import { flow, pipe } from 'fp-ts/function';
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 '../adapters/documentables';
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
- export const documentType = flow(typeToRenderableType, resolveApexTypeTemplate, compile);
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: string[],
51
+ input: ApexBundle[],
48
52
  config?: Partial<DocumentationConfig>,
49
- ): E.Either<string[], DocumentationBundle> {
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 = typeToRenderableType(
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<string, Type>[]) {
163
- function reduceReflectionResultIntoSingleEither(results: E.Either<string, Type>[]): {
164
- errors: string[];
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: string[]; types: Type[] }>(
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 reflectSourceBody(input: string): E.Either<string, Type> {
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 ? E.left(result.error.message) : E.right(result.typeMirror!);
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
  };
@@ -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 './renderable/types';
11
- import { isEmptyLine } from '../adapters/type-utils';
10
+ import { CodeBlock, RenderableContent, StringOrLink } from './adapters/types';
11
+ import { isCodeBlock, isEmptyLine, isInlineCode } 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('withLinks', resolveLinksInContent);
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 = (language: string, lines: string[]): Handlebars.SafeString => {
76
+ const convertCodeBlock = (codeBlock: CodeBlock): Handlebars.SafeString => {
77
77
  return new Handlebars.SafeString(
78
78
  `
79
- \`\`\`${language}
80
- ${lines.join('\n')}
79
+ \`\`\`${codeBlock.language}
80
+ ${codeBlock.content.join('\n')}
81
81
  \`\`\`
82
82
  `.trim(),
83
83
  );
84
84
  };
85
85
 
86
- const resolveLinksInContent = (description?: RenderableContent[]): string => {
86
+ const resolveRenderableContent = (description?: RenderableContent[]): string => {
87
87
  if (!description) {
88
88
  return '';
89
89
  }
@@ -92,8 +92,14 @@ const resolveLinksInContent = (description?: RenderableContent[]): string => {
92
92
  if (isEmptyLine(curr)) {
93
93
  return acc + '\n\n';
94
94
  }
95
-
96
- return acc + link(curr).trim() + ' ';
95
+ if (isCodeBlock(curr)) {
96
+ return acc + convertCodeBlock(curr) + '\n';
97
+ }
98
+ if (isInlineCode(curr)) {
99
+ return acc + inlineCode(curr.content).toString() + ' ';
100
+ } else {
101
+ return acc + Handlebars.escapeExpression(link(curr)).trim() + ' ';
102
+ }
97
103
  }
98
104
 
99
105
  return description.reduce(reduceDescription, '').trim();
@@ -7,7 +7,7 @@ export const referenceGuideTemplate = `
7
7
  {{#each this}}
8
8
  ### {{link title}}
9
9
 
10
- {{withLinks description}}
10
+ {{{renderContent description}}}
11
11
 
12
12
  {{/each}}
13
13
  {{/each}}
@@ -1,4 +1,4 @@
1
- import Manifest from '../manifest';
1
+ import Manifest from '../../core/manifest';
2
2
  import { EnumMirror } from '@cparra/apex-reflection';
3
3
 
4
4
  const sampleEnum: EnumMirror = {
@@ -1,5 +1,5 @@
1
1
  import { MarkdownFile } from '../markdown-file';
2
- import { FieldMirrorWithInheritance, FieldOrProperty, PropertyMirrorWithInheritance } from '../inheritance';
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 '../inheritance';
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;
@@ -15,6 +15,7 @@ describe('File Reader', () => {
15
15
  openApiFileName: 'openapi',
16
16
  title: 'Classes',
17
17
  includeMetadata: false,
18
+ linkingStrategy: 'root-relative',
18
19
  } as SettingsConfig);
19
20
  });
20
21
 
@@ -1,6 +1,6 @@
1
1
  import { Settings } from '../settings';
2
2
  import { FileSystem } from './file-system';
3
- import ApexBundle from '../model/apex-bundle';
3
+ import ApexBundle from '../core/apex-bundle';
4
4
 
5
5
  const APEX_FILE_EXTENSION = '.cls';
6
6
 
@@ -17,7 +17,7 @@ export class ApexFileReader {
17
17
  const directoryContents = fileSystem.readDirectory(rootPath);
18
18
  directoryContents.forEach((currentFilePath) => {
19
19
  const currentPath = fileSystem.joinPath(rootPath, currentFilePath);
20
- if (this.readRecursively && fileSystem.isDirectory(currentPath)) {
20
+ if (fileSystem.isDirectory(currentPath)) {
21
21
  bundles = bundles.concat(this.processFiles(fileSystem, currentPath));
22
22
  }
23
23
 
@@ -44,8 +44,4 @@ export class ApexFileReader {
44
44
  private static get sourceDirectory() {
45
45
  return Settings.getInstance().sourceDirectory;
46
46
  }
47
-
48
- private static get readRecursively() {
49
- return Settings.getInstance().recursive;
50
- }
51
47
  }
@@ -1,7 +1,7 @@
1
- import Manifest from '../model/manifest';
1
+ import Manifest from '../core/manifest';
2
2
  import { TypeParser } from './parser';
3
3
  import { ReflectionResult } from '@cparra/apex-reflection';
4
- import ApexBundle from '../model/apex-bundle';
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.
@@ -1,5 +1,5 @@
1
1
  import { ClassMirror, InterfaceMirror, ReflectionResult, Type } from '@cparra/apex-reflection';
2
- import ApexBundle from '../model/apex-bundle';
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
 
@@ -23,13 +24,11 @@ export type TargetType = {
23
24
 
24
25
  export interface SettingsConfig {
25
26
  sourceDirectory: string;
26
- recursive: boolean;
27
27
  scope: string[];
28
28
  outputDir: string;
29
29
  targetGenerator: GeneratorChoices;
30
30
  indexOnly: boolean;
31
31
  defaultGroupName: string;
32
- sanitizeHtml: boolean;
33
32
  openApiTitle?: string;
34
33
  title: string;
35
34
  namespace?: string;
@@ -40,6 +39,7 @@ export interface SettingsConfig {
40
39
  onAfterProcess?: (files: TargetFile[]) => void;
41
40
  onBeforeFileWrite?: (file: TargetFile) => TargetFile;
42
41
  frontMatterHeader?: (file: TargetType) => string[];
42
+ linkingStrategy: LinkingStrategy;
43
43
  }
44
44
 
45
45
  export class Settings {
@@ -62,10 +62,6 @@ export class Settings {
62
62
  return this.config.sourceDirectory;
63
63
  }
64
64
 
65
- get recursive(): boolean {
66
- return this.config.recursive;
67
- }
68
-
69
65
  get scope(): string[] {
70
66
  return this.config.scope;
71
67
  }
@@ -82,10 +78,6 @@ export class Settings {
82
78
  return this.config.indexOnly;
83
79
  }
84
80
 
85
- get sanitizeHtml(): boolean {
86
- return this.config.sanitizeHtml;
87
- }
88
-
89
81
  public getDefaultGroupName(): string {
90
82
  return this.config.defaultGroupName;
91
83
  }
@@ -144,4 +136,8 @@ export class Settings {
144
136
  }
145
137
  return [];
146
138
  }
139
+
140
+ public getLinkingStrategy(): LinkingStrategy {
141
+ return this.config.linkingStrategy;
142
+ }
147
143
  }
@@ -8,17 +8,16 @@ export class SettingsBuilder {
8
8
  build(): SettingsConfig {
9
9
  return {
10
10
  sourceDirectory: './',
11
- recursive: true,
12
11
  scope: [],
13
12
  outputDir: './',
14
13
  targetGenerator: 'openapi',
15
14
  indexOnly: false,
16
15
  defaultGroupName: 'Misc',
17
- sanitizeHtml: true,
18
16
  openApiTitle: 'Apex API',
19
17
  openApiFileName: 'openapi',
20
18
  title: 'Classes',
21
19
  includeMetadata: false,
20
+ linkingStrategy: 'root-relative',
22
21
  };
23
22
  }
24
23
  }
@@ -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
  }