@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
@@ -1,16 +1,16 @@
1
1
  export const interfaceMarkdownTemplate = `
2
- # {{name}} Interface
2
+ {{ heading headingLevel heading }}
3
3
 
4
- {{> typeLevelApexDocPartialTemplate}}
4
+ {{> typeDocumentation }}
5
5
 
6
6
  {{#if extends}}
7
7
  **Extends**
8
8
  {{#each extends}}
9
- {{this}}{{#unless @last}}, {{/unless}}
9
+ {{link this}}{{#unless @last}}, {{/unless}}
10
10
  {{/each}}
11
11
  {{/if}}
12
12
 
13
13
  {{#if methods}}
14
- {{> methodsPartialTemplate}}
14
+ {{> methodsPartialTemplate methods}}
15
15
  {{/if}}
16
16
  `.trim();
@@ -1,39 +1,37 @@
1
1
  export const methodsPartialTemplate = `
2
- ## Methods
3
- {{#each methods}}
4
- ### \`{{title}}\`
2
+ {{ heading headingLevel heading }}
3
+ {{#each value}}
4
+ {{{ heading headingLevel (inlineCode heading) }}}
5
5
 
6
6
  {{#if inherited}}
7
7
  *Inherited*
8
8
  {{/if}}
9
9
 
10
- {{#> documentablePartialTemplate isInner=true}}
10
+ {{#> documentablePartialTemplate}}
11
11
 
12
- ### Signature
13
- \`\`\`apex
14
- {{signature}}
15
- \`\`\`
12
+ {{ heading signature.headingLevel signature.heading }}
13
+ {{ code "apex" signature.value }}
16
14
 
17
- {{#if parameters}}
18
- ### Parameters
15
+ {{#if parameters.value}}
16
+ {{ heading parameters.headingLevel parameters.heading }}
19
17
  | Name | Type | Description |
20
18
  |------|------|-------------|
21
- {{#each parameters}}
22
- | {{name}} | {{type}} | {{description}} |
19
+ {{#each parameters.value}}
20
+ | {{name}} | {{link type}} | {{withLinks description}} |
23
21
  {{/each}}
24
22
  {{/if}}
25
23
 
26
- {{#if returnType}}
27
- ### Returns
28
- **{{returnType.type}}**
24
+ {{ heading returnType.headingLevel returnType.heading }}
25
+ **{{link returnType.value.type}}**
29
26
 
30
- {{returnType.description}}
27
+ {{#if returnType.value.description}}
28
+ {{returnType.value.description}}
31
29
  {{/if}}
32
30
 
33
- {{#if throws}}
34
- ### Throws
35
- {{#each throws}}
36
- {{this.type}}: {{this.description}}
31
+ {{#if throws.value}}
32
+ {{ heading throws.headingLevel throws.heading }}
33
+ {{#each throws.value}}
34
+ {{link this.type}}: {{this.description}}
37
35
 
38
36
  {{/each}}
39
37
  {{/if}}
@@ -1,34 +1,16 @@
1
1
  import { MarkdownTranspilerBase } from '../markdown-transpiler-base';
2
2
  import { LinkingStrategy } from '../../processor-type-transpiler';
3
- import { ClassMirror, EnumMirror, InterfaceMirror, Type } from '@cparra/apex-reflection';
3
+ import { Type } from '@cparra/apex-reflection';
4
4
  import { OutputFile } from '../../../model/outputFile';
5
5
  import { Settings } from '../../../settings';
6
6
  import ClassFileGeneratorHelper from '../class-file-generatorHelper';
7
- import { enumMarkdownTemplate } from './enum-template';
8
- import { compile } from '../../../templating/compile';
9
- import { ClassSource, EnumSource, InterfaceSource, Link, RenderableContent } from '../../../templating/types';
10
- import { interfaceMarkdownTemplate } from './interface-template';
11
- import { classMarkdownTemplate } from './class-template';
12
- import { isEmptyLine } from '../../../adapters/type-utils';
13
- import {
14
- classTypeToClassSource,
15
- enumTypeToEnumSource,
16
- interfaceTypeToInterfaceSource,
17
- } from '../../../adapters/apex-types';
18
7
  import { MarkdownHomeFile } from '../../../model/markdown-home-file';
19
- import { MarkdownFile } from '../../../model/markdown-file';
20
- import Handlebars from 'handlebars';
21
- import fs from 'fs';
22
- import path from 'path';
8
+ import { documentType } from '../../../core/generate-docs';
9
+ import { linkFromTypeNameGenerator } from '../../../adapters/references';
23
10
 
24
11
  export class PlainMarkdownDocsProcessor extends MarkdownTranspilerBase {
25
- _fileContents: string[] = [];
26
12
  onBeforeProcess = (types: Type[]) => {
27
- if (Settings.getInstance().shouldOutputSingleFile()) {
28
- return;
29
- } else {
30
- this._fileContainer.pushFile(new MarkdownHomeFile(this.homeFileName(), types));
31
- }
13
+ this._fileContainer.pushFile(new MarkdownHomeFile(this.homeFileName(), types));
32
14
  };
33
15
 
34
16
  homeFileName(): string {
@@ -40,95 +22,21 @@ export class PlainMarkdownDocsProcessor extends MarkdownTranspilerBase {
40
22
  }
41
23
 
42
24
  onProcess(type: Type): void {
43
- if (Settings.getInstance().shouldOutputSingleFile()) {
44
- this._fileContents.push(this._generateOutputFile(type).body);
45
- } else {
46
- this._fileContainer.pushFile(this._generateOutputFile(type));
47
- }
48
- }
49
-
50
- onAfterProcess: (types: Type[]) => void = () => {
51
- if (Settings.getInstance().shouldOutputSingleFile()) {
52
- const file = new MarkdownFile(Settings.getInstance().getSingleFileName(), '');
53
-
54
- let contents;
55
- if (Settings.getInstance().getTemplateFilePath()) {
56
- const filePath = path.resolve(Settings.getInstance().getTemplateFilePath()!);
57
- const templateFileContents = fs.readFileSync(filePath, {
58
- encoding: 'utf-8',
59
- });
60
- const handlebars = Handlebars.compile(templateFileContents);
61
- contents = handlebars({ api_docs: this._fileContents.join('\n\n---\n\n') });
62
- } else {
63
- contents = this._fileContents.join('\n\n---\n\n');
64
- }
65
- file.addText(contents);
66
- this._fileContainer.pushFile(file);
67
- }
68
- };
69
-
70
- _generateOutputFile(type: Type): OutputFile {
71
- if (type.type_name === 'enum') {
72
- return new GenericFile<EnumMirror>(type as EnumMirror, enumTypeToEnumSource, enumMarkdownTemplate);
73
- } else if (type.type_name === 'interface') {
74
- return new GenericFile<InterfaceMirror>(
75
- type as InterfaceMirror,
76
- interfaceTypeToInterfaceSource,
77
- interfaceMarkdownTemplate,
78
- );
79
- } else {
80
- return new GenericFile<ClassMirror>(type as ClassMirror, classTypeToClassSource, classMarkdownTemplate);
81
- }
25
+ this._fileContainer.pushFile(new GenericFile(type));
82
26
  }
83
27
  }
84
28
 
85
- class GenericFile<T extends Type> extends OutputFile {
86
- constructor(private type: T, toSource: (type: T) => EnumSource | InterfaceSource | ClassSource, template: string) {
29
+ class GenericFile extends OutputFile {
30
+ constructor(private type: Type) {
87
31
  super(
88
32
  `${Settings.getInstance().getNamespacePrefix()}${type.name}`,
89
33
  ClassFileGeneratorHelper.getSanitizedGroup(type),
90
34
  );
91
35
 
92
- const source = toSource(type);
93
- this.addText(
94
- compile(template, source, {
95
- renderableContentConverter: prepareDescription,
96
- codeBlockConverter: convertCodeBlock,
97
- }),
98
- );
36
+ this.addText(documentType(type, linkFromTypeNameGenerator, Settings.getInstance().getNamespace()));
99
37
  }
100
38
 
101
39
  fileExtension(): string {
102
40
  return '.md';
103
41
  }
104
42
  }
105
-
106
- function prepareDescription(description?: RenderableContent[]) {
107
- if (!description) {
108
- return '';
109
- }
110
-
111
- function reduceDescription(acc: string, curr: RenderableContent) {
112
- if (typeof curr === 'string') {
113
- return acc + curr.trim() + ' ';
114
- } else if (isEmptyLine(curr)) {
115
- return acc + '\n\n';
116
- } else {
117
- return acc + linkToMarkdown(curr) + ' ';
118
- }
119
- }
120
-
121
- function linkToMarkdown(link: Link) {
122
- return `[${link.title}](${link.url})`;
123
- }
124
-
125
- return description.reduce(reduceDescription, '').trim();
126
- }
127
-
128
- function convertCodeBlock(language: string, lines: string[]): string {
129
- return `
130
- \`\`\`${language}
131
- ${lines.join('\n')}
132
- \`\`\`
133
- `.trim();
134
- }
@@ -0,0 +1,27 @@
1
+ export const typeDocPartial = `
2
+ {{#> documentablePartialTemplate}}
3
+
4
+ {{#if doc.group}}
5
+ **Group** {{doc.group}}
6
+ {{/if}}
7
+
8
+ {{#if doc.author}}
9
+ **Author** {{doc.author}}
10
+ {{/if}}
11
+
12
+ {{#if doc.date}}
13
+ **Date** {{doc.date}}
14
+ {{/if}}
15
+
16
+ {{#each doc.sees}}
17
+ **See** {{link this}}
18
+
19
+ {{/each}}
20
+
21
+ {{#if namespace}}
22
+ ## Namespace
23
+ {{namespace}}
24
+ {{/if}}
25
+
26
+ {{/documentablePartialTemplate}}
27
+ `.trim();
@@ -227,7 +227,7 @@ export class ReferenceBuilder {
227
227
  return { schema: { type: 'object' }, referenceComponents: [] };
228
228
  case 'object':
229
229
  return { schema: { type: 'object' }, referenceComponents: [] };
230
- default:
230
+ default: {
231
231
  // If we got here we are dealing with a non-primitive (most likely a custom class or an SObject).
232
232
  const referencedType = TypesRepository.getInstance().getFromAllByName(typeName);
233
233
  if (!referencedType) {
@@ -243,6 +243,7 @@ export class ReferenceBuilder {
243
243
  schema: reference.entrypointReferenceObject,
244
244
  referenceComponents: [...reference.referenceComponents],
245
245
  };
246
+ }
246
247
  }
247
248
  }
248
249
 
@@ -266,7 +267,7 @@ type SchemaObjectReferencePair = {
266
267
 
267
268
  class ReferenceOverrides {
268
269
  static build(referenceAsString: string): ReferenceOverride[] {
269
- const cleanedUpReference = referenceAsString.replace(/[\[\]]/g, '');
270
+ const cleanedUpReference = referenceAsString.replace(/[[\]]/g, '');
270
271
  const referenceStrings = cleanedUpReference.split(',').map((item) => item.replace(/\s/g, ''));
271
272
  return referenceStrings.map((item) => {
272
273
  const [propertyName, referenceName] = item.split(':');
@@ -5,7 +5,7 @@ import logUpdate from 'log-update';
5
5
  * Logs messages to the console.
6
6
  */
7
7
  export class Logger {
8
- static currentFrame = -1;
8
+ static currentFrame = 0;
9
9
 
10
10
  static frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
11
11
 
package/tsconfig.json CHANGED
@@ -12,7 +12,7 @@
12
12
  ]
13
13
  },
14
14
  "include": [
15
- "src"
15
+ "src", "jest.d.ts"
16
16
  ],
17
17
  "exclude": [
18
18
  "node_modules",
package/.eslintrc.js DELETED
@@ -1,12 +0,0 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- parserOptions: {
4
- ecmaVersion: 2020,
5
- sourceType: 'module',
6
- },
7
- extends: [
8
- 'plugin:@typescript-eslint/recommended',
9
- 'plugin:prettier/recommended',
10
- ],
11
- rules: {},
12
- };
@@ -1,301 +0,0 @@
1
- # Template file
2
-
3
- # BaseClass Class
4
- `abstract`
5
-
6
- ## Namespace
7
- ns
8
-
9
- ## Fields
10
- ### `sampleEnumFromBase`
11
-
12
- #### Type
13
- [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
14
-
15
-
16
- ---
17
-
18
- # ParentInterface Interface
19
-
20
- ## Namespace
21
- ns
22
-
23
- ## Methods
24
- ### `sampleParentMethod()`
25
-
26
- ### Signature
27
- ```apex
28
- public void sampleParentMethod()
29
- ```
30
-
31
- ### Returns
32
- **void**
33
-
34
-
35
- ---
36
-
37
- # ReferencedEnum Enum
38
-
39
- ## Namespace
40
- ns
41
-
42
- ## Enum Values
43
-
44
-
45
- ---
46
-
47
- # SampleClass Class
48
- `virtual`
49
-
50
- aliquip ex sunt officia ullamco anim deserunt magna aliquip nisi eiusmod in sit officia veniam ex
51
-
52
- deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.
53
-
54
- **Group** SampleGroup
55
-
56
- ## Namespace
57
- ns
58
-
59
- ## Example
60
- ```apex
61
- SampleClass sample = new SampleClass();
62
- sample.doSomething();
63
- ```
64
-
65
- **Extends**
66
- [ns.BaseClass](../Miscellaneous/ns.BaseClass.md)
67
-
68
- **Implements**
69
- [ns.SampleInterface](../Miscellaneous/ns.SampleInterface.md),
70
- [ns.ParentInterface](../Miscellaneous/ns.ParentInterface.md)
71
-
72
- ## Fields
73
- ### `name`
74
-
75
- This is a sample field.
76
-
77
- #### Type
78
- String
79
-
80
- ---
81
-
82
- ### `sampleEnumFromBase`
83
-
84
- *Inherited*
85
-
86
- #### Type
87
- [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
88
-
89
- ## Constructors
90
- ### `SampleClass()`
91
-
92
- This is a sample constructor.
93
-
94
- ### Signature
95
- ```apex
96
- public SampleClass()
97
- ```
98
-
99
- ---
100
- ### `SampleClass(name)`
101
-
102
- ### Signature
103
- ```apex
104
- public SampleClass(String name)
105
- ```
106
-
107
- ### Parameters
108
- | Name | Type | Description |
109
- |------|------|-------------|
110
- | name | String | |
111
-
112
- ## Methods
113
- ### `sayHello()`
114
-
115
- `DEPRECATED`
116
-
117
- This is a sample method.
118
-
119
- ### Signature
120
- ```apex
121
- public virtual String sayHello()
122
- ```
123
-
124
- ### Returns
125
- **String**
126
-
127
- A string value.
128
-
129
- ### Example
130
- ```apex
131
- SampleClass sample = new SampleClass();
132
- sample.doSomething();
133
- ```
134
-
135
-
136
- ---
137
-
138
- # SampleEnum Enum
139
-
140
- `NAMESPACEACCESSIBLE`
141
-
142
- This is a sample enum. This references [ns.ReferencedEnum](../Miscellaneous/ns.ReferencedEnum.md) .
143
-
144
- This description has several lines
145
-
146
- **Some Custom**
147
-
148
- **Group** Sample Enums
149
-
150
- **Author** John Doe
151
-
152
- **Date** 2022-01-01
153
-
154
- **See** [ns.ReferencedEnum](../Miscellaneous/ns.ReferencedEnum.md)
155
-
156
- ## Namespace
157
- ns
158
-
159
- ```mermaid
160
- graph TD
161
- A[SampleEnum] --&gt;|references| B[ReferencedEnum]
162
- B --&gt;|referenced by| A
163
- ```
164
-
165
- ## Enum Values
166
- ### VALUE1
167
- This is value 1
168
- ### VALUE2
169
- This is value 2
170
- ### VALUE3
171
- This is value 3
172
-
173
-
174
- ---
175
-
176
- # SampleException Class
177
-
178
- ## Namespace
179
- ns
180
-
181
- **Extends**
182
- Exception
183
-
184
-
185
- ---
186
-
187
- # SampleInterface Interface
188
-
189
- `NAMESPACEACCESSIBLE`
190
-
191
- This is a sample interface
192
-
193
- **Author** John Doe
194
-
195
- **Date** 2020-01-01
196
-
197
- **See** [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
198
-
199
- **See** [ns.ReferencedEnum](./ns.ReferencedEnum.md)
200
-
201
- ## Namespace
202
- ns
203
-
204
- ```mermaid
205
- graph TD
206
- A[SampleInterface] --&gt;|extends| B[ParentInterface]
207
- B --&gt;|extends| C[GrandParentInterface]
208
- C --&gt;|extends| D[GreatGrandParentInterface]
209
- ```
210
-
211
- ## Example
212
- ```apex
213
- SampleInterface sampleInterface = new SampleInterface();
214
- sampleInterface.sampleMethod();
215
- ```
216
-
217
- **Extends**
218
- [ns.ParentInterface](./ns.ParentInterface.md)
219
-
220
- ## Methods
221
- ### `sampleMethod()`
222
-
223
- `NAMESPACEACCESSIBLE`
224
-
225
- This is a sample method
226
-
227
- **Custom Tag**
228
-
229
- **Another Custom Tag**
230
-
231
- ### Signature
232
- ```apex
233
- public String sampleMethod()
234
- ```
235
-
236
- ### Returns
237
- **String**
238
-
239
- Some return value
240
-
241
- ### Throws
242
- [ns.SampleException](./ns.SampleException.md): This is a sample exception
243
-
244
- AnotherSampleException: This is another sample exception
245
-
246
- ```mermaid
247
- graph TD
248
- A[SampleInterface] --&gt;|extends| B[ParentInterface]
249
- B --&gt;|extends| C[GrandParentInterface]
250
- C --&gt;|extends| D[GreatGrandParentInterface]
251
- ```
252
-
253
- ### Example
254
- ```apex
255
- SampleInterface sampleInterface = new SampleInterface();
256
- sampleInterface.sampleMethod();
257
- ```
258
-
259
- ---
260
-
261
- ### `sampleMethodWithParams(param1, param2, theEnum)`
262
-
263
- `NAMESPACEACCESSIBLE`
264
- `DEPRECATED`
265
-
266
- This is a sample method with parameters
267
-
268
- Sometimes it won&#x27;t be possible to find a NonExistent link.
269
-
270
- ### Signature
271
- ```apex
272
- public SampleEnum sampleMethodWithParams(String param1, Integer param2, SampleEnum theEnum)
273
- ```
274
-
275
- ### Parameters
276
- | Name | Type | Description |
277
- |------|------|-------------|
278
- | param1 | String | This is the first parameter |
279
- | param2 | Integer | This is the second parameter |
280
- | theEnum | [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md) | This is an enum parameter |
281
-
282
- ### Returns
283
- **[ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)**
284
-
285
- Some return value
286
-
287
- ---
288
-
289
- ### `sampleParentMethod()`
290
-
291
- *Inherited*
292
-
293
- ### Signature
294
- ```apex
295
- public void sampleParentMethod()
296
- ```
297
-
298
- ### Returns
299
- **void**
300
-
301
-
@@ -1,7 +0,0 @@
1
- import { EnumSource, ConvertRenderableContentsToString, InterfaceSource, ClassSource } from './types';
2
- type CompileOptions = {
3
- renderableContentConverter: ConvertRenderableContentsToString;
4
- codeBlockConverter: (language: string, lines: string[]) => string;
5
- };
6
- export declare function compile(template: string, source: EnumSource | InterfaceSource | ClassSource, options: CompileOptions): string;
7
- export {};