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

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 (215) hide show
  1. package/__mocks__/chalk.js +12 -0
  2. package/__mocks__/log-update.js +6 -0
  3. package/eslint.config.mjs +10 -0
  4. package/examples/plain-markdown/docs/Miscellaneous/ns.BaseClass.md +16 -0
  5. package/examples/plain-markdown/docs/Miscellaneous/ns.MultiInheritanceClass.md +73 -0
  6. package/examples/plain-markdown/docs/Miscellaneous/ns.ParentInterface.md +15 -0
  7. package/examples/plain-markdown/docs/Miscellaneous/ns.ReferencedEnum.md +8 -0
  8. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +7 -0
  9. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +115 -0
  10. package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +36 -0
  11. package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +173 -0
  12. package/examples/plain-markdown/docs/index.md +33 -0
  13. package/examples/plain-markdown/force-app/classes/MultiInheritanceClass.cls +1 -0
  14. package/examples/plain-markdown/force-app/classes/SampleClass.cls +37 -0
  15. package/examples/plain-markdown/package.json +2 -6
  16. package/jest.config.js +4 -0
  17. package/jest.d.ts +7 -0
  18. package/lib/__spec__/core/expect-extensions.d.ts +3 -0
  19. package/lib/__spec__/core/expect-extensions.js +54 -0
  20. package/lib/__spec__/core/expect-extensions.js.map +1 -0
  21. package/lib/__spec__/core/generating-class-docs.spec.d.ts +1 -0
  22. package/lib/__spec__/core/generating-class-docs.spec.js +427 -0
  23. package/lib/__spec__/core/generating-class-docs.spec.js.map +1 -0
  24. package/lib/__spec__/core/generating-enum-docs.spec.d.ts +1 -0
  25. package/lib/__spec__/core/generating-enum-docs.spec.js +303 -0
  26. package/lib/__spec__/core/generating-enum-docs.spec.js.map +1 -0
  27. package/lib/__spec__/core/generating-interface-docs.spec.d.ts +1 -0
  28. package/lib/__spec__/core/generating-interface-docs.spec.js +361 -0
  29. package/lib/__spec__/core/generating-interface-docs.spec.js.map +1 -0
  30. package/lib/__spec__/core/generating-reference-guide.spec.d.ts +1 -0
  31. package/lib/__spec__/core/generating-reference-guide.spec.js +161 -0
  32. package/lib/__spec__/core/generating-reference-guide.spec.js.map +1 -0
  33. package/lib/adapters/apex-types.d.ts +5 -5
  34. package/lib/adapters/apex-types.js +97 -22
  35. package/lib/adapters/apex-types.js.map +1 -1
  36. package/lib/adapters/documentables.d.ts +4 -3
  37. package/lib/adapters/documentables.js +23 -8
  38. package/lib/adapters/documentables.js.map +1 -1
  39. package/lib/adapters/fields-and-properties.d.ts +4 -3
  40. package/lib/adapters/fields-and-properties.js +26 -5
  41. package/lib/adapters/fields-and-properties.js.map +1 -1
  42. package/lib/adapters/methods-and-constructors.d.ts +4 -3
  43. package/lib/adapters/methods-and-constructors.js +54 -12
  44. package/lib/adapters/methods-and-constructors.js.map +1 -1
  45. package/lib/adapters/references.d.ts +1 -1
  46. package/lib/adapters/references.js +3 -3
  47. package/lib/adapters/references.js.map +1 -1
  48. package/lib/adapters/type-utils.d.ts +1 -1
  49. package/lib/adapters/type-utils.js +1 -2
  50. package/lib/adapters/type-utils.js.map +1 -1
  51. package/lib/application/Apexdocs.js +21 -15
  52. package/lib/application/Apexdocs.js.map +1 -1
  53. package/lib/application/flows/generate-markdown-files.d.ts +3 -0
  54. package/lib/application/flows/generate-markdown-files.js +57 -0
  55. package/lib/application/flows/generate-markdown-files.js.map +1 -0
  56. package/lib/cli/generate.js +7 -7
  57. package/lib/cli/generate.js.map +1 -1
  58. package/lib/core/__test__/inheritance-chain.test.d.ts +1 -0
  59. package/lib/core/__test__/inheritance-chain.test.js +42 -0
  60. package/lib/core/__test__/inheritance-chain.test.js.map +1 -0
  61. package/lib/core/generate-docs.d.ts +24 -0
  62. package/lib/core/generate-docs.js +267 -0
  63. package/lib/core/generate-docs.js.map +1 -0
  64. package/lib/core/inheritance-chain.d.ts +2 -0
  65. package/lib/core/inheritance-chain.js +35 -0
  66. package/lib/core/inheritance-chain.js.map +1 -0
  67. package/lib/core/template.d.ts +10 -0
  68. package/lib/core/template.js +92 -0
  69. package/lib/core/template.js.map +1 -0
  70. package/lib/core/templates/reference-guide.d.ts +1 -0
  71. package/lib/core/templates/reference-guide.js +18 -0
  72. package/lib/core/templates/reference-guide.js.map +1 -0
  73. package/lib/index.d.ts +2 -1
  74. package/lib/index.js +14 -3
  75. package/lib/index.js.map +1 -1
  76. package/lib/model/inheritance.d.ts +4 -1
  77. package/lib/model/manifest.js +8 -2
  78. package/lib/model/manifest.js.map +1 -1
  79. package/lib/model/markdown-file.d.ts +2 -2
  80. package/lib/model/markdown-file.js +5 -4
  81. package/lib/model/markdown-file.js.map +1 -1
  82. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +3 -4
  83. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
  84. package/lib/model/markdown-generation-util/field-declaration-util.js +1 -2
  85. package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
  86. package/lib/model/markdown-generation-util/method-declaration-util.js +2 -3
  87. package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
  88. package/lib/model/markdown-generation-util/type-declaration-util.js +1 -2
  89. package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
  90. package/lib/model/markdown-home-file.js.map +1 -1
  91. package/lib/model/markdown-type-file.js.map +1 -1
  92. package/lib/model/openapi/open-api.js.map +1 -1
  93. package/lib/model/outputFile.d.ts +1 -1
  94. package/lib/model/outputFile.js +2 -9
  95. package/lib/model/outputFile.js.map +1 -1
  96. package/lib/model/types-repository.js.map +1 -1
  97. package/lib/service/apex-file-reader.js.map +1 -1
  98. package/lib/service/file-writer.js.map +1 -1
  99. package/lib/service/manifest-factory.js +1 -2
  100. package/lib/service/manifest-factory.js.map +1 -1
  101. package/lib/service/metadata-processor.js.map +1 -1
  102. package/lib/service/parser.js +1 -1
  103. package/lib/service/parser.js.map +1 -1
  104. package/lib/service/state.js.map +1 -1
  105. package/lib/service/walkers/class-walker.js.map +1 -1
  106. package/lib/service/walkers/interface-walker.js.map +1 -1
  107. package/lib/service/walkers/walker-factory.js.map +1 -1
  108. package/lib/service/walkers/walker.js.map +1 -1
  109. package/lib/settings.d.ts +0 -6
  110. package/lib/settings.js +0 -11
  111. package/lib/settings.js.map +1 -1
  112. package/lib/test-helpers/ClassMirrorBuilder.d.ts +4 -0
  113. package/lib/test-helpers/ClassMirrorBuilder.js +11 -1
  114. package/lib/test-helpers/ClassMirrorBuilder.js.map +1 -1
  115. package/lib/transpiler/factory.js.map +1 -1
  116. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +1 -1
  117. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  118. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
  119. package/lib/transpiler/markdown/plain-markdown/class-template.js +53 -12
  120. package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -1
  121. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +13 -16
  122. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -1
  123. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +11 -8
  124. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -1
  125. package/lib/transpiler/markdown/plain-markdown/enum-template.js +7 -6
  126. package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -1
  127. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +9 -6
  128. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -1
  129. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +1 -0
  130. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +10 -0
  131. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +1 -0
  132. package/lib/transpiler/markdown/plain-markdown/interface-template.js +4 -4
  133. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +18 -20
  134. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -1
  135. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -4
  136. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +6 -86
  137. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
  138. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +1 -0
  139. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js +31 -0
  140. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js.map +1 -0
  141. package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
  142. package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
  143. package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
  144. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +3 -2
  145. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  146. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +1 -1
  147. package/lib/transpiler/transpiler.js.map +1 -1
  148. package/lib/util/error-logger.js.map +1 -1
  149. package/lib/util/logger.js +1 -1
  150. package/lib/util/logger.js.map +1 -1
  151. package/lib/util/string-utils.js +2 -2
  152. package/lib/util/string-utils.js.map +1 -1
  153. package/package.json +17 -17
  154. package/src/__spec__/core/expect-extensions.ts +32 -0
  155. package/src/__spec__/core/generating-class-docs.spec.ts +511 -0
  156. package/src/__spec__/core/generating-enum-docs.spec.ts +355 -0
  157. package/src/__spec__/core/generating-interface-docs.spec.ts +431 -0
  158. package/src/__spec__/core/generating-reference-guide.spec.ts +163 -0
  159. package/src/adapters/__tests__/interface-adapter.spec.ts +15 -11
  160. package/src/adapters/__tests__/references.spec.ts +1 -1
  161. package/src/adapters/apex-types.ts +205 -41
  162. package/src/adapters/documentables.ts +44 -9
  163. package/src/adapters/fields-and-properties.ts +31 -7
  164. package/src/adapters/methods-and-constructors.ts +65 -22
  165. package/src/adapters/references.ts +1 -1
  166. package/src/adapters/type-utils.ts +1 -1
  167. package/src/application/Apexdocs.ts +21 -15
  168. package/src/application/flows/generate-markdown-files.ts +47 -0
  169. package/src/cli/generate.ts +96 -96
  170. package/src/core/__test__/inheritance-chain.test.ts +54 -0
  171. package/src/core/generate-docs.ts +396 -0
  172. package/src/core/inheritance-chain.ts +23 -0
  173. package/src/core/renderable/types.d.ts +131 -0
  174. package/src/core/template.ts +108 -0
  175. package/src/core/templates/reference-guide.ts +14 -0
  176. package/src/index.ts +3 -1
  177. package/src/model/inheritance.ts +2 -1
  178. package/src/model/manifest.ts +12 -2
  179. package/src/model/markdown-file.ts +5 -4
  180. package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +1 -1
  181. package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
  182. package/src/model/outputFile.ts +2 -11
  183. package/src/service/parser.ts +1 -1
  184. package/src/settings.ts +0 -15
  185. package/src/test-helpers/ClassMirrorBuilder.ts +14 -1
  186. package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -1
  187. package/src/transpiler/markdown/plain-markdown/class-template.ts +53 -12
  188. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +13 -16
  189. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +11 -8
  190. package/src/transpiler/markdown/plain-markdown/enum-template.ts +7 -6
  191. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +9 -6
  192. package/src/transpiler/markdown/plain-markdown/grouped-members-partial-template.ts +6 -0
  193. package/src/transpiler/markdown/plain-markdown/interface-template.ts +4 -4
  194. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +18 -20
  195. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +8 -100
  196. package/src/transpiler/markdown/plain-markdown/type-doc-partial.ts +27 -0
  197. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +3 -2
  198. package/src/util/logger.ts +1 -1
  199. package/tsconfig.json +1 -1
  200. package/.eslintrc.js +0 -12
  201. package/examples/plain-markdown/README.md +0 -301
  202. package/lib/templating/compile.d.ts +0 -7
  203. package/lib/templating/compile.js +0 -98
  204. package/lib/templating/compile.js.map +0 -1
  205. package/lib/templating/helpers.d.ts +0 -2
  206. package/lib/templating/helpers.js +0 -18
  207. package/lib/templating/helpers.js.map +0 -1
  208. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +0 -1
  209. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +0 -31
  210. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +0 -1
  211. package/src/templating/__tests__/compile.spec.ts +0 -741
  212. package/src/templating/compile.ts +0 -187
  213. package/src/templating/helpers.ts +0 -14
  214. package/src/templating/types.d.ts +0 -104
  215. package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +0 -27
@@ -0,0 +1,12 @@
1
+ // __mocks__/chalk.js
2
+ module.exports = new Proxy(
3
+ {},
4
+ {
5
+ get: function (target, property) {
6
+ return property === 'default' ? this : (text) => text;
7
+ },
8
+ green: function (text) {
9
+ return text;
10
+ },
11
+ },
12
+ );
@@ -0,0 +1,6 @@
1
+ // This is a basic mock that can be expanded based on your needs.
2
+ // It mocks the main function of log-update to just log to console or do nothing.
3
+ module.exports = {
4
+ // Mock the main function to just log the text or do nothing
5
+ default: function () {},
6
+ };
@@ -0,0 +1,10 @@
1
+ // @ts-check
2
+
3
+ import eslint from '@eslint/js';
4
+ import tseslint from 'typescript-eslint';
5
+ import eslintConfigPrettier from "eslint-config-prettier";
6
+
7
+ export default tseslint.config(
8
+ eslint.configs.recommended,
9
+ ...tseslint.configs.recommended,
10
+ eslintConfigPrettier);
@@ -0,0 +1,16 @@
1
+ # BaseClass Class
2
+ `abstract`
3
+
4
+ ## Namespace
5
+ ns
6
+
7
+ ## Fields
8
+ ### `sampleEnumFromBase`
9
+
10
+ #### Signature
11
+ ```apex
12
+ public sampleEnumFromBase
13
+ ```
14
+
15
+ #### Type
16
+ [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
@@ -0,0 +1,73 @@
1
+ # MultiInheritanceClass Class
2
+
3
+ ## Namespace
4
+ ns
5
+
6
+ **Inheritance**
7
+ [ns.SampleClass](../SampleGroup/ns.SampleClass.md) < [ns.BaseClass](./ns.BaseClass.md)
8
+
9
+ ## Fields
10
+ ### `sampleEnumFromBase`
11
+
12
+ *Inherited*
13
+
14
+ #### Signature
15
+ ```apex
16
+ public sampleEnumFromBase
17
+ ```
18
+
19
+ #### Type
20
+ [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
21
+
22
+ ## Properties
23
+ ### Group Name
24
+ #### `someProperty`
25
+
26
+ *Inherited*
27
+
28
+ ##### Signature
29
+ ```apex
30
+ public someProperty
31
+ ```
32
+
33
+ ##### Type
34
+ String
35
+
36
+ ## Methods
37
+ ### Available Methods
38
+ #### `doSomething()`
39
+
40
+ *Inherited*
41
+
42
+ ##### Signature
43
+ ```apex
44
+ public void doSomething()
45
+ ```
46
+
47
+ ##### Return Type
48
+ **void**
49
+
50
+ ### Deprecated Methods
51
+ #### `sayHello()`
52
+
53
+ *Inherited*
54
+
55
+ `DEPRECATED`
56
+
57
+ This is a sample method.
58
+
59
+ ##### Signature
60
+ ```apex
61
+ public virtual String sayHello()
62
+ ```
63
+
64
+ ##### Return Type
65
+ **String**
66
+
67
+ A string value.
68
+
69
+ ##### Example
70
+ ```apex
71
+ SampleClass sample = new SampleClass();
72
+ sample.doSomething();
73
+ ```
@@ -0,0 +1,15 @@
1
+ # ParentInterface Interface
2
+
3
+ ## Namespace
4
+ ns
5
+
6
+ ## Methods
7
+ ### `sampleParentMethod()`
8
+
9
+ #### Signature
10
+ ```apex
11
+ public void sampleParentMethod()
12
+ ```
13
+
14
+ #### Return Type
15
+ **void**
@@ -0,0 +1,8 @@
1
+ # ReferencedEnum Enum
2
+
3
+ ## Namespace
4
+ ns
5
+
6
+ ## Values
7
+ | Value | Description |
8
+ |-------|-------------|
@@ -0,0 +1,7 @@
1
+ # SampleException Class
2
+
3
+ ## Namespace
4
+ ns
5
+
6
+ **Inheritance**
7
+ Exception
@@ -0,0 +1,115 @@
1
+ # SampleInterface Interface
2
+
3
+ `NAMESPACEACCESSIBLE`
4
+
5
+ This is a sample interface
6
+
7
+ **Author** John Doe
8
+
9
+ **Date** 2020-01-01
10
+
11
+ **See** [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
12
+
13
+ **See** [ns.ReferencedEnum](./ns.ReferencedEnum.md)
14
+
15
+ ## Namespace
16
+ ns
17
+
18
+ ## Diagram
19
+ ```mermaid
20
+ graph TD
21
+ A[SampleInterface] -->|extends| B[ParentInterface]
22
+ B -->|extends| C[GrandParentInterface]
23
+ C -->|extends| D[GreatGrandParentInterface]
24
+ ```
25
+
26
+ ## Example
27
+ ```apex
28
+ SampleInterface sampleInterface = new SampleInterface();
29
+ sampleInterface.sampleMethod();
30
+ ```
31
+
32
+ **Extends**
33
+ [ns.ParentInterface](./ns.ParentInterface.md)
34
+
35
+ ## Methods
36
+ ### `sampleMethod()`
37
+
38
+ `NAMESPACEACCESSIBLE`
39
+
40
+ This is a sample method
41
+
42
+ **Custom Tag** This is a custom tag
43
+
44
+ **Another Custom Tag** This is another custom tag
45
+
46
+ #### Signature
47
+ ```apex
48
+ public String sampleMethod()
49
+ ```
50
+
51
+ #### Return Type
52
+ **String**
53
+
54
+ Some return value
55
+
56
+ #### Throws
57
+ [ns.SampleException](./ns.SampleException.md): This is a sample exception
58
+
59
+ AnotherSampleException: This is another sample exception
60
+
61
+ #### Diagram
62
+ ```mermaid
63
+ graph TD
64
+ A[SampleInterface] -->|extends| B[ParentInterface]
65
+ B -->|extends| C[GrandParentInterface]
66
+ C -->|extends| D[GreatGrandParentInterface]
67
+ ```
68
+
69
+ #### Example
70
+ ```apex
71
+ SampleInterface sampleInterface = new SampleInterface();
72
+ sampleInterface.sampleMethod();
73
+ ```
74
+
75
+ ---
76
+
77
+ ### `sampleMethodWithParams(param1, param2, theEnum)`
78
+
79
+ `NAMESPACEACCESSIBLE`
80
+ `DEPRECATED`
81
+
82
+ This is a sample method with parameters
83
+
84
+ Sometimes it won&#x27;t be possible to find a NonExistent link.
85
+
86
+ #### Signature
87
+ ```apex
88
+ public SampleEnum sampleMethodWithParams(String param1, Integer param2, SampleEnum theEnum)
89
+ ```
90
+
91
+ #### Parameters
92
+ | Name | Type | Description |
93
+ |------|------|-------------|
94
+ | param1 | String | This is the first parameter |
95
+ | param2 | Integer | This is the second parameter |
96
+ | theEnum | [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md) | This is an enum parameter |
97
+
98
+ #### Return Type
99
+ **[ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)**
100
+
101
+ Some return value
102
+
103
+ ---
104
+
105
+ ### `sampleParentMethod()`
106
+
107
+ *Inherited*
108
+
109
+ #### Signature
110
+ ```apex
111
+ public void sampleParentMethod()
112
+ ```
113
+
114
+ #### Return Type
115
+ **void**
@@ -0,0 +1,36 @@
1
+ # SampleEnum Enum
2
+
3
+ `NAMESPACEACCESSIBLE`
4
+
5
+ This is a sample enum. This references [ns.ReferencedEnum](../Miscellaneous/ns.ReferencedEnum.md) .
6
+
7
+ This description has several lines
8
+
9
+ **Some Custom** Test. I can also have a [ns.ReferencedEnum](../Miscellaneous/ns.ReferencedEnum.md) here.
10
+
11
+ And it can be multiline.
12
+
13
+ **Group** Sample Enums
14
+
15
+ **Author** John Doe
16
+
17
+ **Date** 2022-01-01
18
+
19
+ **See** [ns.ReferencedEnum](../Miscellaneous/ns.ReferencedEnum.md)
20
+
21
+ ## Namespace
22
+ ns
23
+
24
+ ## Diagram
25
+ ```mermaid
26
+ graph TD
27
+ A[SampleEnum] -->|references| B[ReferencedEnum]
28
+ B -->|referenced by| A
29
+ ```
30
+
31
+ ## Values
32
+ | Value | Description |
33
+ |-------|-------------|
34
+ | VALUE1 | This is value 1 |
35
+ | VALUE2 | This is value 2 |
36
+ | VALUE3 | This is value 3 |
@@ -0,0 +1,173 @@
1
+ # SampleClass Class
2
+ `virtual`
3
+
4
+ aliquip ex sunt officia ullamco anim deserunt magna aliquip nisi eiusmod in sit officia veniam ex
5
+
6
+ deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.
7
+
8
+ **Group** SampleGroup
9
+
10
+ ## Namespace
11
+ ns
12
+
13
+ ## Example
14
+ ```apex
15
+ SampleClass sample = new SampleClass();
16
+ sample.doSomething();
17
+ ```
18
+
19
+ **Inheritance**
20
+ [ns.BaseClass](../Miscellaneous/ns.BaseClass.md)
21
+
22
+ **Implements**
23
+ [ns.SampleInterface](../Miscellaneous/ns.SampleInterface.md),
24
+ [ns.ParentInterface](../Miscellaneous/ns.ParentInterface.md)
25
+
26
+ ## Fields
27
+ ### Group Name
28
+ #### `name`
29
+
30
+ This is a sample field.
31
+
32
+ ##### Signature
33
+ ```apex
34
+ private name
35
+ ```
36
+
37
+ ##### Type
38
+ String
39
+
40
+ ### Other
41
+ #### `sampleEnumFromBase`
42
+
43
+ *Inherited*
44
+
45
+ ##### Signature
46
+ ```apex
47
+ public sampleEnumFromBase
48
+ ```
49
+
50
+ ##### Type
51
+ [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
52
+
53
+ ## Properties
54
+ ### Group Name
55
+ #### `someProperty`
56
+
57
+ ##### Signature
58
+ ```apex
59
+ public someProperty
60
+ ```
61
+
62
+ ##### Type
63
+ String
64
+
65
+ ## Constructors
66
+ ### Other
67
+ #### `SampleClass()`
68
+
69
+ This is a sample constructor.
70
+
71
+ ##### Signature
72
+ ```apex
73
+ public SampleClass()
74
+ ```
75
+
76
+ ### Other Constructors
77
+ #### `SampleClass(name)`
78
+
79
+ ##### Signature
80
+ ```apex
81
+ public SampleClass(String name)
82
+ ```
83
+
84
+ ##### Parameters
85
+ | Name | Type | Description |
86
+ |------|------|-------------|
87
+ | name | String | |
88
+
89
+ ## Methods
90
+ ### Available Methods
91
+ #### `doSomething()`
92
+
93
+ ##### Signature
94
+ ```apex
95
+ public void doSomething()
96
+ ```
97
+
98
+ ##### Return Type
99
+ **void**
100
+
101
+ ### Deprecated Methods
102
+ #### `sayHello()`
103
+
104
+ `DEPRECATED`
105
+
106
+ This is a sample method.
107
+
108
+ ##### Signature
109
+ ```apex
110
+ public virtual String sayHello()
111
+ ```
112
+
113
+ ##### Return Type
114
+ **String**
115
+
116
+ A string value.
117
+
118
+ ##### Example
119
+ ```apex
120
+ SampleClass sample = new SampleClass();
121
+ sample.doSomething();
122
+ ```
123
+
124
+ ## Classes
125
+ ### SomeInnerClass Class
126
+
127
+ #### Fields
128
+ ##### `someInnerField`
129
+
130
+ ###### Signature
131
+ ```apex
132
+ public someInnerField
133
+ ```
134
+
135
+ ###### Type
136
+ String
137
+
138
+ #### Methods
139
+ ##### `doSomething()`
140
+
141
+ ###### Signature
142
+ ```apex
143
+ public void doSomething()
144
+ ```
145
+
146
+ ###### Return Type
147
+ **void**
148
+
149
+ ## Enums
150
+ ### SomeEnum Enum
151
+
152
+ This enum is used for foo and bar.
153
+
154
+ #### Values
155
+ | Value | Description |
156
+ |-------|-------------|
157
+ | TEST_1 | This is a test. |
158
+ | TEST_2 | |
159
+ | TEST_3 | |
160
+
161
+ ## Interfaces
162
+ ### SomeInterface Interface
163
+
164
+ #### Methods
165
+ ##### `doSomething()`
166
+
167
+ ###### Signature
168
+ ```apex
169
+ public void doSomething()
170
+ ```
171
+
172
+ ###### Return Type
173
+ **void**
@@ -0,0 +1,33 @@
1
+ # Apex Reference Guide
2
+
3
+ ## Miscellaneous
4
+
5
+ ### [ns.BaseClass](./Miscellaneous/ns.BaseClass.md)
6
+
7
+ ### [ns.MultiInheritanceClass](./Miscellaneous/ns.MultiInheritanceClass.md)
8
+
9
+ ### [ns.ParentInterface](./Miscellaneous/ns.ParentInterface.md)
10
+
11
+ ### [ns.ReferencedEnum](./Miscellaneous/ns.ReferencedEnum.md)
12
+
13
+ ### [ns.SampleException](./Miscellaneous/ns.SampleException.md)
14
+
15
+ ### [ns.SampleInterface](./Miscellaneous/ns.SampleInterface.md)
16
+
17
+ This is a sample interface
18
+
19
+ ## Sample Enums
20
+
21
+ ### [ns.SampleEnum](./Sample-Enums/ns.SampleEnum.md)
22
+
23
+ This is a sample enum. This references [ns.ReferencedEnum](./Miscellaneous/ns.ReferencedEnum.md) .
24
+
25
+ This description has several lines
26
+
27
+ ## SampleGroup
28
+
29
+ ### [ns.SampleClass](./SampleGroup/ns.SampleClass.md)
30
+
31
+ aliquip ex sunt officia ullamco anim deserunt magna aliquip nisi eiusmod in sit officia veniam ex
32
+
33
+ deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.
@@ -0,0 +1 @@
1
+ public class MultiInheritanceClass extends SampleClass {}
@@ -7,19 +7,32 @@
7
7
  * sample.doSomething();
8
8
  */
9
9
  public with sharing virtual class SampleClass extends BaseClass implements SampleInterface, ParentInterface {
10
+ // @start-group Group Name
10
11
  /**
11
12
  * @description This is a sample field.
12
13
  */
13
14
  private final String name;
15
+ public String someProperty { get; private set; }
16
+ // @end-group
14
17
 
15
18
  /**
16
19
  * @description This is a sample constructor.
17
20
  */
18
21
  public SampleClass() {}
19
22
 
23
+ // @start-group Other Constructors
20
24
  public SampleClass(String name) {
21
25
  this.name = name;
22
26
  }
27
+ // @end-group
28
+
29
+ // @start-group Available Methods
30
+ public void doSomething() {
31
+ System.debug('Doing something');
32
+ }
33
+ // @end-group
34
+
35
+ // @start-group Deprecated Methods
23
36
 
24
37
  /**
25
38
  * @description This is a sample method.
@@ -32,4 +45,28 @@ public with sharing virtual class SampleClass extends BaseClass implements Sampl
32
45
  public virtual String sayHello() {
33
46
  return 'Hello';
34
47
  }
48
+
49
+ // @end-group
50
+
51
+ public class SomeInnerClass {
52
+ public String someInnerField;
53
+
54
+ public void doSomething() {
55
+ System.debug('Doing something');
56
+ }
57
+ }
58
+
59
+ /**
60
+ * @description This enum is used for foo and bar.
61
+ */
62
+ public enum SomeEnum {
63
+ /** @description This is a test. */
64
+ TEST_1,
65
+ TEST_2,
66
+ TEST_3
67
+ }
68
+
69
+ public interface SomeInterface {
70
+ void doSomething();
71
+ }
35
72
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "plain-markdown",
3
3
  "scripts": {
4
- "docs:clean": "rimraf ./README.md",
4
+ "docs:clean": "rimraf docs",
5
5
  "docs:build": "ts-node ../../src/cli/generate.ts",
6
6
  "docs:gen": "npm run docs:clean && npm run docs:build"
7
7
  },
@@ -15,10 +15,6 @@
15
15
  "sourceDir": "force-app",
16
16
  "targetGenerator": "plain-markdown",
17
17
  "scope": ["global", "public", "protected", "private", "namespaceaccessible"],
18
- "namespace": "ns",
19
- "singleFile": true,
20
- "templateFilePath": "template.md",
21
- "fileName": "README",
22
- "targetDir": "."
18
+ "namespace": "ns"
23
19
  }
24
20
  }
package/jest.config.js CHANGED
@@ -2,4 +2,8 @@ module.exports = {
2
2
  preset: 'ts-jest',
3
3
  testEnvironment: 'node',
4
4
  modulePathIgnorePatterns: ['<rootDir>/lib/'],
5
+ moduleNameMapper: {
6
+ '^chalk$': '<rootDir>/__mocks__/chalk.js',
7
+ '^log-update$': '<rootDir>/__mocks__/log-update.js',
8
+ },
5
9
  };
package/jest.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ declare namespace jest {
2
+ interface Matchers<R> {
3
+ documentationBundleHasLength(length: number): R;
4
+ firstDocContains(content: string): R;
5
+ firstDocContainsNot(content: string): R;
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ import * as E from 'fp-ts/Either';
2
+ export declare function extendExpect(): void;
3
+ export declare function assertEither<T, U>(result: E.Either<T, U>, assertion: (data: U) => void): void;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.extendExpect = extendExpect;
27
+ exports.assertEither = assertEither;
28
+ const E = __importStar(require("fp-ts/Either"));
29
+ function extendExpect() {
30
+ expect.extend({
31
+ documentationBundleHasLength(received, length) {
32
+ return {
33
+ pass: E.isRight(received) && received.right.docs.length === length,
34
+ message: () => `Expected documentation bundle to have length ${length}`,
35
+ };
36
+ },
37
+ firstDocContains(doc, content) {
38
+ return {
39
+ pass: doc.docs[0].docContents.includes(content),
40
+ message: () => `Expected documentation to contain ${content}. Got ${doc.docs[0].docContents}`,
41
+ };
42
+ },
43
+ firstDocContainsNot(doc, content) {
44
+ return {
45
+ pass: !doc.docs[0].docContents.includes(content),
46
+ message: () => `Expected documentation to not contain ${content}. Got ${doc.docs[0].docContents}`,
47
+ };
48
+ },
49
+ });
50
+ }
51
+ function assertEither(result, assertion) {
52
+ E.match((error) => fail(error), (data) => assertion(data))(result);
53
+ }
54
+ //# sourceMappingURL=expect-extensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expect-extensions.js","sourceRoot":"","sources":["../../../src/__spec__/core/expect-extensions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,oCAqBC;AAED,oCAKC;AA/BD,gDAAkC;AAGlC,SAAgB,YAAY;IAC1B,MAAM,CAAC,MAAM,CAAC;QACZ,4BAA4B,CAAC,QAAiD,EAAE,MAAc;YAC5F,OAAO;gBACL,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM;gBAClE,OAAO,EAAE,GAAG,EAAE,CAAC,gDAAgD,MAAM,EAAE;aACxE,CAAC;QACJ,CAAC;QACD,gBAAgB,CAAC,GAAwB,EAAE,OAAe;YACxD,OAAO;gBACL,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,qCAAqC,OAAO,SAAS,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;aAC9F,CAAC;QACJ,CAAC;QACD,mBAAmB,CAAC,GAAwB,EAAE,OAAe;YAC3D,OAAO;gBACL,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAChD,OAAO,EAAE,GAAG,EAAE,CAAC,yCAAyC,OAAO,SAAS,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;aAClG,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,YAAY,CAAO,MAAsB,EAAE,SAA4B;IACrF,CAAC,CAAC,KAAK,CACL,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EACtB,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAC1B,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC"}
@@ -0,0 +1 @@
1
+ export {};