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

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 (189) hide show
  1. package/dist/cli/generate.js +2745 -39
  2. package/dist/defaults-DUwru49Q.js +12 -0
  3. package/dist/defaults-SH0Rsi5E.js +11 -0
  4. package/dist/index.d.ts +62 -2
  5. package/dist/index.js +36 -1
  6. package/examples/plain-markdown/docs/Miscellaneous/ns.BaseClass.md +1 -1
  7. package/examples/plain-markdown/docs/Miscellaneous/ns.MultiInheritanceClass.md +1 -1
  8. package/examples/plain-markdown/docs/Miscellaneous/ns.ParentInterface.md +1 -1
  9. package/examples/plain-markdown/docs/Miscellaneous/ns.ReferencedEnum.md +1 -1
  10. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +1 -1
  11. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +1 -1
  12. package/examples/plain-markdown/docs/Miscellaneous/ns.Url.md +1 -1
  13. package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +1 -1
  14. package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +1 -1
  15. package/examples/plain-markdown/docs/index.md +1 -1
  16. package/examples/plain-markdown/package.json +3 -4
  17. package/examples/vitepress/.forceignore +12 -0
  18. package/examples/vitepress/apexdocs.config.ts +108 -0
  19. package/examples/vitepress/config/project-scratch-def.json +13 -0
  20. package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js +259 -0
  21. package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js.map +7 -0
  22. package/examples/vitepress/docs/.vitepress/cache/deps/_metadata.json +40 -0
  23. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js +11474 -0
  24. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js.map +7 -0
  25. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js +9172 -0
  26. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js.map +7 -0
  27. package/examples/vitepress/docs/.vitepress/cache/deps/package.json +3 -0
  28. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4339 -0
  29. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
  30. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +567 -0
  31. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
  32. package/examples/vitepress/docs/.vitepress/cache/deps/vue.js +323 -0
  33. package/examples/vitepress/docs/.vitepress/cache/deps/vue.js.map +7 -0
  34. package/examples/vitepress/docs/.vitepress/config.mts +21 -0
  35. package/examples/vitepress/docs/.vitepress/sidebar.json +119 -0
  36. package/examples/vitepress/docs/Miscellaneous/apexdocs.BaseClass.md +20 -0
  37. package/examples/vitepress/docs/Miscellaneous/apexdocs.MultiInheritanceClass.md +78 -0
  38. package/examples/vitepress/docs/Miscellaneous/apexdocs.ParentInterface.md +19 -0
  39. package/examples/vitepress/docs/Miscellaneous/apexdocs.ReferencedEnum.md +15 -0
  40. package/examples/vitepress/docs/Miscellaneous/apexdocs.SampleException.md +28 -0
  41. package/examples/vitepress/docs/Miscellaneous/apexdocs.SampleInterface.md +122 -0
  42. package/examples/vitepress/docs/Miscellaneous/apexdocs.Url.md +318 -0
  43. package/examples/vitepress/docs/Sample-Enums/apexdocs.SampleEnum.md +41 -0
  44. package/examples/vitepress/docs/SampleGroup/apexdocs.SampleClass.md +178 -0
  45. package/examples/vitepress/docs/api-examples.md +49 -0
  46. package/examples/vitepress/docs/index-frontmatter.md +16 -0
  47. package/examples/vitepress/docs/index.md +127 -0
  48. package/examples/vitepress/docs/markdown-examples.md +85 -0
  49. package/examples/vitepress/force-app/main/default/classes/BaseClass.cls +3 -0
  50. package/examples/vitepress/force-app/main/default/classes/MultiInheritanceClass.cls +1 -0
  51. package/examples/vitepress/force-app/main/default/classes/ParentInterface.cls +3 -0
  52. package/examples/vitepress/force-app/main/default/classes/ReferencedEnum.cls +5 -0
  53. package/examples/vitepress/force-app/main/default/classes/SampleClass.cls +72 -0
  54. package/examples/vitepress/force-app/main/default/classes/SampleEnum.cls +30 -0
  55. package/examples/vitepress/force-app/main/default/classes/SampleException.cls +17 -0
  56. package/examples/vitepress/force-app/main/default/classes/SampleInterface.cls +46 -0
  57. package/examples/vitepress/force-app/main/default/classes/Url.cls +195 -0
  58. package/examples/vitepress/package-lock.json +2574 -0
  59. package/examples/vitepress/package.json +18 -0
  60. package/examples/vitepress/sfdx-project.json +12 -0
  61. package/jest.config.js +1 -0
  62. package/package.json +10 -6
  63. package/src/application/Apexdocs.ts +16 -104
  64. package/src/application/__tests__/apex-file-reader.spec.ts +104 -0
  65. package/src/application/apex-file-reader.ts +42 -0
  66. package/src/application/file-writer.ts +25 -0
  67. package/src/application/generators/markdown.ts +53 -0
  68. package/src/application/generators/openapi.ts +56 -0
  69. package/src/cli/args.ts +17 -112
  70. package/src/cli/commands/markdown.ts +58 -0
  71. package/src/cli/generate.ts +7 -5
  72. package/src/{model/__tests__ → core/__test__}/manifest.spec.ts +1 -1
  73. package/src/core/manifest.ts +57 -51
  74. package/src/{__spec__/core → core/markdown/__test__}/expect-extensions.ts +5 -5
  75. package/src/core/markdown/__test__/generating-class-docs.spec.ts +727 -0
  76. package/src/{__spec__/core → core/markdown/__test__}/generating-enum-docs.spec.ts +82 -59
  77. package/src/{__spec__/core → core/markdown/__test__}/generating-interface-docs.spec.ts +94 -75
  78. package/src/core/markdown/__test__/generating-reference-guide.spec.ts +184 -0
  79. package/src/core/{__test__ → markdown/__test__}/inheritance-chain.test.ts +2 -2
  80. package/src/core/markdown/__test__/test-helpers.ts +22 -0
  81. package/src/core/{adapters → markdown/adapters}/__tests__/interface-adapter.spec.ts +38 -8
  82. package/src/core/{adapters → markdown/adapters}/apex-types.ts +7 -4
  83. package/src/core/{adapters → markdown/adapters}/inline.ts +1 -1
  84. package/src/core/markdown/adapters/renderable-bundle.ts +144 -0
  85. package/src/core/markdown/adapters/renderable-to-page-data.ts +92 -0
  86. package/src/core/{adapters → markdown/adapters}/types.d.ts +16 -2
  87. package/src/core/markdown/generate-docs.ts +158 -0
  88. package/src/core/markdown/reflection/error-handling.ts +37 -0
  89. package/src/core/markdown/reflection/filter-scope.ts +13 -0
  90. package/src/core/markdown/reflection/inheritance-chain-expanion.ts +22 -0
  91. package/src/core/markdown/reflection/inherited-member-expansion.ts +105 -0
  92. package/src/core/markdown/reflection/reflect-source.ts +41 -0
  93. package/src/core/markdown/reflection/sort-members.ts +59 -0
  94. package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/class-template.ts +2 -0
  95. package/src/core/markdown/templates/hookable.ts +7 -0
  96. package/src/core/{template.ts → markdown/templates/template.ts} +12 -12
  97. package/src/core/markdown/utils.ts +3 -0
  98. package/src/{transpiler → core}/openapi/__tests__/open-api-docs-processor.spec.ts +1 -1
  99. package/src/{model → core/openapi}/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +3 -3
  100. package/src/core/openapi/file-container.ts +13 -0
  101. package/src/{service → core/openapi}/manifest-factory.ts +3 -3
  102. package/src/{transpiler → core}/openapi/open-api-docs-processor.ts +9 -10
  103. package/src/core/openapi/openapi-type-file.ts +14 -0
  104. package/src/{service → core/openapi}/parser.ts +8 -8
  105. package/src/{transpiler → core}/openapi/parsers/Builder.ts +2 -2
  106. package/src/{transpiler → core}/openapi/parsers/MethodParser.ts +5 -5
  107. package/src/{transpiler → core}/openapi/parsers/ParameterObjectBuilder.ts +2 -2
  108. package/src/{transpiler → core}/openapi/parsers/ReferenceBuilder.ts +3 -3
  109. package/src/{transpiler → core}/openapi/parsers/RequestBodyBuilder.ts +2 -2
  110. package/src/{transpiler → core}/openapi/parsers/ResponsesBuilder.ts +2 -2
  111. package/src/{transpiler → core}/openapi/parsers/__tests__/MethodParser.spec.ts +1 -1
  112. package/src/{transpiler → core}/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +2 -2
  113. package/src/{transpiler → core}/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +2 -2
  114. package/src/{transpiler → core}/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +2 -2
  115. package/src/{transpiler → core}/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +1 -1
  116. package/src/{transpiler → core/openapi}/transpiler.ts +2 -6
  117. package/src/{model → core/openapi}/types-repository.ts +0 -9
  118. package/src/core/parse-apex-metadata.ts +14 -0
  119. package/src/core/settings.ts +56 -0
  120. package/src/core/shared/types.d.ts +92 -0
  121. package/src/core/shared/utils.ts +5 -0
  122. package/src/defaults.ts +8 -0
  123. package/src/index.ts +34 -2
  124. package/src/test-helpers/InterfaceMirrorBuilder.ts +0 -5
  125. package/src/test-helpers/SettingsBuilder.ts +1 -3
  126. package/src/util/logger.ts +2 -2
  127. package/src/util/string-utils.ts +0 -4
  128. package/tsconfig.json +5 -1
  129. package/apexdocs.config.ts +0 -13
  130. package/examples/plain-markdown/template.md +0 -3
  131. package/src/__spec__/core/generating-class-docs.spec.ts +0 -531
  132. package/src/__spec__/core/generating-reference-guide.spec.ts +0 -164
  133. package/src/__spec__/core/test-helpers.ts +0 -9
  134. package/src/application/generators/generate-markdown-files.ts +0 -53
  135. package/src/core/apex-bundle.ts +0 -3
  136. package/src/core/generate-docs.ts +0 -432
  137. package/src/model/markdown-file.ts +0 -122
  138. package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +0 -50
  139. package/src/model/markdown-generation-util/field-declaration-util.ts +0 -71
  140. package/src/model/markdown-generation-util/index.ts +0 -3
  141. package/src/model/markdown-generation-util/method-declaration-util.ts +0 -166
  142. package/src/model/markdown-generation-util/type-declaration-util.ts +0 -91
  143. package/src/model/markdown-home-file.ts +0 -58
  144. package/src/model/markdown-type-file.ts +0 -169
  145. package/src/model/openapi/openapi-type-file.ts +0 -14
  146. package/src/model/outputFile.ts +0 -20
  147. package/src/service/__tests__/apex-file-reader.spec.ts +0 -93
  148. package/src/service/apex-file-reader.ts +0 -47
  149. package/src/service/file-writer.ts +0 -34
  150. package/src/service/metadata-processor.ts +0 -16
  151. package/src/service/state.ts +0 -24
  152. package/src/service/walkers/class-walker.ts +0 -30
  153. package/src/service/walkers/enum-walker.ts +0 -7
  154. package/src/service/walkers/interface-walker.ts +0 -12
  155. package/src/service/walkers/walker-factory.ts +0 -19
  156. package/src/service/walkers/walker.ts +0 -42
  157. package/src/settings.ts +0 -143
  158. package/src/transpiler/factory.ts +0 -31
  159. package/src/transpiler/file-container.ts +0 -13
  160. package/src/transpiler/generator-choices.ts +0 -1
  161. package/src/transpiler/markdown/class-file-generatorHelper.ts +0 -61
  162. package/src/transpiler/markdown/docsify/docsify-docs-processor.ts +0 -12
  163. package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +0 -50
  164. package/src/transpiler/markdown/markdown-transpiler-base.ts +0 -28
  165. package/src/transpiler/processor-type-transpiler.ts +0 -18
  166. /package/src/{service → application}/file-system.ts +0 -0
  167. /package/src/core/{adapters → markdown/adapters}/__tests__/documentables.spec.ts +0 -0
  168. /package/src/core/{adapters → markdown/adapters}/__tests__/references.spec.ts +0 -0
  169. /package/src/core/{adapters → markdown/adapters}/documentables.ts +0 -0
  170. /package/src/core/{adapters → markdown/adapters}/fields-and-properties.ts +0 -0
  171. /package/src/core/{adapters → markdown/adapters}/methods-and-constructors.ts +0 -0
  172. /package/src/core/{adapters → markdown/adapters}/type-utils.ts +0 -0
  173. /package/src/core/{inheritance-chain.ts → markdown/reflection/inheritance-chain.ts} +0 -0
  174. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/constructors-partial-template.ts +0 -0
  175. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/documentable-partial-template.ts +0 -0
  176. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/enum-template.ts +0 -0
  177. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/fieldsPartialTemplate.ts +0 -0
  178. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/grouped-members-partial-template.ts +0 -0
  179. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/interface-template.ts +0 -0
  180. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/methods-partial-template.ts +0 -0
  181. /package/src/core/{templates → markdown/templates}/reference-guide.ts +0 -0
  182. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/type-doc-partial.ts +0 -0
  183. /package/src/{service → core/openapi}/__tests__/manifest-factory.spec.ts +0 -0
  184. /package/src/{model → core}/openapi/__tests__/open-api.spec.ts +0 -0
  185. /package/src/{model → core}/openapi/apex-doc-types.ts +0 -0
  186. /package/src/{model → core/openapi}/apex-type-wrappers/ClassMirrorWrapper.ts +0 -0
  187. /package/src/{model → core/openapi}/apex-type-wrappers/MethodMirrorWrapper.ts +0 -0
  188. /package/src/{model → core}/openapi/open-api-types.ts +0 -0
  189. /package/src/{model → core}/openapi/open-api.ts +0 -0
@@ -0,0 +1,58 @@
1
+ import { Options } from 'yargs';
2
+ import { defaults } from '../../defaults';
3
+
4
+ export const markdownOptions: { [key: string]: Options } = {
5
+ sourceDir: {
6
+ type: 'string',
7
+ alias: 's',
8
+ demandOption: true,
9
+ describe: 'The directory location which contains your apex .cls classes.',
10
+ },
11
+ targetDir: {
12
+ type: 'string',
13
+ alias: 't',
14
+ default: defaults.targetDir,
15
+ describe: 'The directory location where documentation will be generated to.',
16
+ },
17
+ scope: {
18
+ type: 'string',
19
+ array: true,
20
+ alias: 'p',
21
+ default: defaults.scope,
22
+ describe:
23
+ 'A list of scopes to document. Values should be separated by a space, e.g --scope global public namespaceaccessible. ' +
24
+ 'Annotations are supported and should be passed lowercased and without the @ symbol, e.g. namespaceaccessible auraenabled. ' +
25
+ 'Note that this setting is ignored if generating an OpenApi REST specification since that looks for classes annotated with @RestResource.',
26
+ },
27
+ defaultGroupName: {
28
+ type: 'string',
29
+ default: defaults.defaultGroupName,
30
+ describe: 'Defines the @group name to be used when a file does not specify it.',
31
+ },
32
+ openApiTitle: {
33
+ type: 'string',
34
+ default: 'Apex REST Api',
35
+ describe: 'If using "openapi" as the target generator, this allows you to specify the OpenApi title value.',
36
+ },
37
+ namespace: {
38
+ type: 'string',
39
+ describe:
40
+ 'The package namespace, if any. If this value is provided the namespace will be added as a prefix to all of the parsed files. ' +
41
+ "If generating an OpenApi definition, it will be added to the file's Server Url.",
42
+ },
43
+ openApiFileName: {
44
+ type: 'string',
45
+ describe: 'If using "openapi" as the target generator, this allows you to specify the name of the output file.',
46
+ default: 'openapi',
47
+ },
48
+ sortMembersAlphabetically: {
49
+ type: 'boolean',
50
+ describe: 'Whether to sort members alphabetically.',
51
+ default: defaults.sortMembersAlphabetically,
52
+ },
53
+ includeMetadata: {
54
+ type: 'boolean',
55
+ describe: "Whether to include the file's meta.xml information: Whether it is active and and the API version",
56
+ default: defaults.includeMetadata,
57
+ },
58
+ };
@@ -3,12 +3,14 @@ import { Apexdocs } from '../application/Apexdocs';
3
3
  import { extractArgs } from './args';
4
4
 
5
5
  function main() {
6
+ function cathError(error: Error) {
7
+ console.error(error);
8
+ process.exit(1);
9
+ }
10
+
6
11
  extractArgs()
7
- .then((config) => Apexdocs.generate(config))
8
- .catch((error) => {
9
- console.error(error);
10
- process.exit(1);
11
- });
12
+ .then((config) => Apexdocs.generate(config).catch(cathError))
13
+ .catch(cathError);
12
14
  }
13
15
 
14
16
  main();
@@ -1,4 +1,4 @@
1
- import Manifest from '../../core/manifest';
1
+ import Manifest from '../manifest';
2
2
  import { EnumMirror } from '@cparra/apex-reflection';
3
3
 
4
4
  const sampleEnum: EnumMirror = {
@@ -1,11 +1,11 @@
1
1
  import {
2
+ Annotation,
2
3
  ClassMirror,
4
+ DocComment,
5
+ DocCommentAnnotation,
3
6
  EnumMirror,
4
7
  InterfaceMirror,
5
8
  Type,
6
- Annotation,
7
- DocComment,
8
- DocCommentAnnotation,
9
9
  } from '@cparra/apex-reflection';
10
10
 
11
11
  type AccessAndDocAware = { access_modifier: string; annotations: Annotation[]; docComment?: DocComment };
@@ -19,66 +19,72 @@ export default class Manifest {
19
19
  * @param types List of types to be wrapped by this object.
20
20
  * @param isForInnerTypes Whether this manifest represent an inner type or not.
21
21
  */
22
- constructor(public types: Type[], public isForInnerTypes: boolean = false) {}
22
+ constructor(
23
+ public types: Type[],
24
+ public isForInnerTypes: boolean = false,
25
+ ) {}
23
26
 
24
27
  filteredByAccessModifierAndAnnotations(modifiers: string[]): Type[] {
25
- const filteredTypes = this.filterAccessibleModifier(this.types, modifiers);
28
+ const filteredTypes = Manifest.filterAccessibleModifier(this.types, modifiers);
26
29
  const typesToReturn: Type[] = [];
27
30
  for (const filteredType of filteredTypes) {
28
- const currentType = filteredType as Type;
29
- if (currentType.type_name === 'enum') {
30
- // Ignoring enum values is not supported.
31
- typesToReturn.push(currentType);
32
- continue;
33
- }
31
+ typesToReturn.push(Manifest.filterSingleType(filteredType, modifiers, this.isForInnerTypes));
32
+ }
33
+
34
+ return typesToReturn;
35
+ }
34
36
 
35
- if (currentType.type_name === 'interface') {
36
- const currentInterface = currentType as InterfaceMirror;
37
- typesToReturn.push({
38
- ...currentType,
39
- methods: this.filterAccessibleModifier(currentInterface.methods, modifiers),
40
- } as InterfaceMirror);
41
- continue;
42
- }
37
+ static filterSingleType(currentType: Type, modifiers: string[], isForInnerTypes: boolean): Type {
38
+ if (currentType.type_name === 'enum') {
39
+ // Ignoring enum values is not supported.
40
+ return currentType;
41
+ }
43
42
 
44
- const currentClass = currentType as ClassMirror;
45
- let filteredClass = {
43
+ if (currentType.type_name === 'interface') {
44
+ const currentInterface = currentType as InterfaceMirror;
45
+ return {
46
46
  ...currentType,
47
- methods: this.filterAccessibleModifier(currentClass.methods, modifiers),
48
- properties: this.filterAccessibleModifier(currentClass.properties, modifiers),
49
- fields: this.filterAccessibleModifier(currentClass.fields, modifiers),
50
- constructors: this.filterAccessibleModifier(currentClass.constructors, modifiers),
51
- } as ClassMirror;
47
+ methods: this.filterAccessibleModifier(currentInterface.methods, modifiers),
48
+ } as InterfaceMirror;
49
+ }
52
50
 
53
- if (!this.isForInnerTypes) {
54
- filteredClass = {
55
- ...filteredClass,
56
- enums: this.filterAccessibleModifier(currentClass.enums, modifiers) as EnumMirror[],
57
- interfaces: this.filterAccessibleModifier(currentClass.interfaces, modifiers) as InterfaceMirror[],
58
- classes: new Manifest(currentClass.classes, true).filteredByAccessModifierAndAnnotations(
59
- modifiers,
60
- ) as ClassMirror[],
61
- };
62
- }
51
+ const currentClass = currentType as ClassMirror;
52
+ const filteredClass = {
53
+ ...currentType,
54
+ methods: this.filterAccessibleModifier(currentClass.methods, modifiers),
55
+ properties: this.filterAccessibleModifier(currentClass.properties, modifiers),
56
+ fields: this.filterAccessibleModifier(currentClass.fields, modifiers),
57
+ constructors: this.filterAccessibleModifier(currentClass.constructors, modifiers),
58
+ } as ClassMirror;
63
59
 
64
- typesToReturn.push(filteredClass);
60
+ if (!isForInnerTypes) {
61
+ return {
62
+ ...filteredClass,
63
+ enums: this.filterAccessibleModifier(currentClass.enums, modifiers) as EnumMirror[],
64
+ interfaces: this.filterAccessibleModifier(currentClass.interfaces, modifiers) as InterfaceMirror[],
65
+ classes: new Manifest(currentClass.classes, true).filteredByAccessModifierAndAnnotations(
66
+ modifiers,
67
+ ) as ClassMirror[],
68
+ };
65
69
  }
66
70
 
67
- return typesToReturn;
71
+ return filteredClass;
72
+ }
73
+
74
+ static filterAccessibleModifier<T extends AccessAndDocAware>(accessAndDocAware: T[], modifiers: string[]): T[] {
75
+ return accessAndDocAware.filter((type) => this.shouldFilterType(type, modifiers));
68
76
  }
69
77
 
70
- filterAccessibleModifier(accessAndDocAware: AccessAndDocAware[], modifiers: string[]) {
71
- return accessAndDocAware.filter((currentType) => {
72
- const hasIgnoreDocAnnotation = currentType.docComment?.annotations.some(
73
- (annotation: DocCommentAnnotation) => annotation.name.toLowerCase() === 'ignore',
74
- );
75
- if (hasIgnoreDocAnnotation) {
76
- return false;
77
- }
78
- return (
79
- modifiers.includes(currentType.access_modifier) ||
80
- currentType.annotations.some((annotation: Annotation) => modifiers.includes(annotation.type.toLowerCase()))
81
- );
82
- });
78
+ static shouldFilterType(accessAndDocAware: AccessAndDocAware, modifiers: string[]) {
79
+ const hasIgnoreDocAnnotation = accessAndDocAware.docComment?.annotations.some(
80
+ (annotation: DocCommentAnnotation) => annotation.name.toLowerCase() === 'ignore',
81
+ );
82
+ if (hasIgnoreDocAnnotation) {
83
+ return false;
84
+ }
85
+ return (
86
+ modifiers.includes(accessAndDocAware.access_modifier) ||
87
+ accessAndDocAware.annotations.some((annotation: Annotation) => modifiers.includes(annotation.type.toLowerCase()))
88
+ );
83
89
  }
84
90
  }
@@ -1,5 +1,5 @@
1
1
  import * as E from 'fp-ts/Either';
2
- import { DocumentationBundle } from '../../core/generate-docs';
2
+ import { DocumentationBundle } from '../../shared/types';
3
3
 
4
4
  export function extendExpect() {
5
5
  expect.extend({
@@ -11,14 +11,14 @@ export function extendExpect() {
11
11
  },
12
12
  firstDocContains(doc: DocumentationBundle, content: string) {
13
13
  return {
14
- pass: doc.docs[0].docContents.includes(content),
15
- message: () => `Expected documentation to contain ${content}. Got ${doc.docs[0].docContents}`,
14
+ pass: doc.docs[0].content.includes(content),
15
+ message: () => `Expected documentation to contain ${content}. Got ${doc.docs[0].content}`,
16
16
  };
17
17
  },
18
18
  firstDocContainsNot(doc: DocumentationBundle, content: string) {
19
19
  return {
20
- pass: !doc.docs[0].docContents.includes(content),
21
- message: () => `Expected documentation to not contain ${content}. Got ${doc.docs[0].docContents}`,
20
+ pass: !doc.docs[0].content.includes(content),
21
+ message: () => `Expected documentation to not contain ${content}. Got ${doc.docs[0].content}`,
22
22
  };
23
23
  },
24
24
  });