@cparra/apexdocs 2.2.2 → 2.2.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.
@@ -0,0 +1,22 @@
1
+ name: Close inactive issues
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+
6
+ jobs:
7
+ close-issues:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ issues: write
11
+ pull-requests: write
12
+ steps:
13
+ - uses: actions/stale@v4
14
+ with:
15
+ days-before-issue-stale: -1
16
+ days-before-issue-close: 30
17
+ stale-issue-label: "stale"
18
+ stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
19
+ close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
20
+ days-before-pr-stale: -1
21
+ days-before-pr-close: -1
22
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
package/README.md CHANGED
@@ -207,23 +207,8 @@ the `Properties` title will be `<h2>`, each property name will be an `<h3>`, etc
207
207
 
208
208
  ### Importing to your project
209
209
 
210
- If you are just interested in the documentation parsing capabilities, you can import ApexDocs into your own project.
211
-
212
- Use the `docGenerator` function to create a list of `ClassModel` that includes all the parsed information from your .cls
213
- files.
214
-
215
- `docGenerator(sourceDirectory[,recursive][,scope][,outputDir])`
216
-
217
- - `sourceDirectory` \<string>
218
- - `recursive` \<boolean>
219
- - `scope` \<string[]>
220
- - `outpurDir` \<string>
221
-
222
- ```javascript
223
- var { docGenerator } = require('@cparra/apexdocs');
224
-
225
- let documentedClasses = docGenerator('src', true, ['global'], 'docs');
226
- ```
210
+ If you are just interested in the Apex parsing capabilities, you can use the standalone [Apex Reflection Library](https://www.npmjs.com/package/@cparra/apex-reflection)
211
+ which is what gets used by this library behind the scenes to generate the documentation files.
227
212
 
228
213
  ## Documentation Format
229
214
 
@@ -235,7 +220,7 @@ multiple lines, ending with `*/`.
235
220
  The following tags are supported on the class level:
236
221
 
237
222
  | Tag | Description |
238
- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
223
+ |----------------|--------------------------------------------------------------------------------------------------------------------------------------------|
239
224
  | `@description` | One or more lines describing the class. |
240
225
  | `@see` | The name of a related class. |
241
226
  | `@group` | The group to which the class belongs to. |
@@ -257,7 +242,7 @@ public with sharing class TestClass {
257
242
  The following tags are supported on the enum level:
258
243
 
259
244
  | Tag | Description |
260
- | -------------- | -------------------------------------- |
245
+ |----------------|----------------------------------------|
261
246
  | `@description` | One or more lines describing the enum. |
262
247
 
263
248
  **Example**
@@ -276,7 +261,7 @@ public Enum ExampleEnum {
276
261
  The following tags are supported on the property level:
277
262
 
278
263
  | Tag | Description |
279
- | -------------- | ------------------------------------------ |
264
+ |----------------|--------------------------------------------|
280
265
  | `@description` | One or more lines describing the property. |
281
266
 
282
267
  **Example**
@@ -295,7 +280,7 @@ Methods and constructors support the same tags.
295
280
  The following tags are supported on the method level:
296
281
 
297
282
  | Tag | Description |
298
- | ------------------------- | ------------------------------------------------- |
283
+ |---------------------------|---------------------------------------------------|
299
284
  | `@description` | One or more lines describing the method. |
300
285
  | `@param` _paramName_ | Description of a single parameter. |
301
286
  | `@return` | Description of the return value of the method. |
package/docs/README.md CHANGED
@@ -1,4 +1,9 @@
1
1
  # Classes
2
+ ## Utils
3
+
4
+ ### [GroupedClass](/Utils/GroupedClass.md)
5
+
6
+ Uses a block style apex doc
2
7
  ## Sample Classes
3
8
 
4
9
  ### [SampleClass](/Sample-Classes/SampleClass.md)
@@ -14,3 +19,8 @@ This is a class description. This class relates to [SampleInterface](/Sample-Int
14
19
  ### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
15
20
 
16
21
  This is an interface description.
22
+ ## Stripe Integration
23
+
24
+ ### [SampleTestClass](/Stripe-Integration/SampleTestClass.md)
25
+
26
+
@@ -114,10 +114,16 @@ System.debug(result);
114
114
  ```
115
115
 
116
116
  ### `static anotherSampleMethod(String arg1)`
117
+
118
+ Something here
119
+
117
120
  #### Parameters
118
121
  |Param|Description|
119
122
  |---|---|
120
123
 
124
+
125
+ **Arg1** The arg1 description
126
+
121
127
  ### `static call()`
122
128
 
123
129
  Calls the method. This methods allows you to call it.
@@ -0,0 +1,7 @@
1
+ # GroupedClass
2
+
3
+ Some desc
4
+
5
+
6
+ **Group** Some group
7
+
@@ -0,0 +1,10 @@
1
+ # GroupedClass
2
+
3
+ Uses a block style apex doc
4
+
5
+
6
+ **Group** Utils
7
+
8
+
9
+ **Test Class** [SampleClass](/Sample-Classes/SampleClass.md)
10
+
@@ -0,0 +1,8 @@
1
+ /**********************************************************
2
+ Uses a block style apex doc
3
+ @group Utils
4
+ @test-class {@link SampleClass}
5
+ ***********************************************************/
6
+ public class GroupedClass {
7
+
8
+ }
@@ -74,7 +74,7 @@ public with sharing class SampleClass {
74
74
 
75
75
  /**
76
76
  * @description Something here
77
- * @arg1
77
+ * @arg1 The arg1 description
78
78
  */
79
79
  public static String anotherSampleMethod(String arg1) {
80
80
  System.debug('something');
@@ -0,0 +1,11 @@
1
+ @IsTest
2
+ /**
3
+ * @Name StripeRESTService
4
+ * @Date 3/2/2022
5
+ * @group Stripe Integration
6
+ * @See StripeRESTServiceTest
7
+ * @Description Apex class that creates and exposes a REST endpoint by the name of 'Stripe'. [ORG_URL]/services/apexrest/Stripe (case sensitive!)
8
+ */
9
+ private class SampleTestClass {
10
+
11
+ }
@@ -9,15 +9,20 @@ function addCustomDocCommentAnnotations(markdownFile, docCommentAware) {
9
9
  markdownFile.addText(buildDocAnnotationText(currentAnnotation));
10
10
  markdownFile.addBlankLine();
11
11
  });
12
- function capitalizeFirstLetter(text) {
13
- return text.charAt(0).toUpperCase() + text.slice(1);
12
+ function splitAndCapitalize(text) {
13
+ const words = text.split(/[-_]+/);
14
+ const capitalizedWords = [];
15
+ for (const word of words) {
16
+ capitalizedWords.push(word.charAt(0).toUpperCase() + word.slice(1));
17
+ }
18
+ return capitalizedWords.join(' ');
14
19
  }
15
20
  function buildDocAnnotationText(annotation) {
16
21
  let annotationBodyText = annotation.body;
17
22
  if (annotation.name.toLowerCase() === 'see') {
18
23
  annotationBodyText = class_file_generatorHelper_1.default.getFileLinkByTypeName(annotation.body);
19
24
  }
20
- return `**${capitalizeFirstLetter(annotation.name)}** ${annotationBodyText}`;
25
+ return `**${splitAndCapitalize(annotation.name)}** ${annotationBodyText}`;
21
26
  }
22
27
  }
23
28
  exports.addCustomDocCommentAnnotations = addCustomDocCommentAnnotations;
@@ -1 +1 @@
1
- {"version":3,"file":"doc-comment-annotation-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/doc-comment-annotation-util.ts"],"names":[],"mappings":";;;AACA,qGAA4F;AAO5F,SAAgB,8BAA8B,CAAC,YAA0B,EAAE,eAAgC;;IACzG,MAAA,eAAe,CAAC,UAAU,0CAAE,WAAW,CACpC,MAAM,CAAC,CAAC,iBAAuC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,KAAK,aAAa,EAC5F,OAAO,CAAC,CAAC,iBAAuC,EAAE,EAAE;QACnD,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAChE,YAAY,CAAC,YAAY,EAAE,CAAC;IAC9B,CAAC,EAAE;IAEL,SAAS,qBAAqB,CAAC,IAAY;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,SAAS,sBAAsB,CAAC,UAAgC;QAC9D,IAAI,kBAAkB,GAAG,UAAU,CAAC,IAAI,CAAC;QACzC,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YAC3C,kBAAkB,GAAG,oCAAwB,CAAC,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SACtF;QACD,OAAO,KAAK,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,kBAAkB,EAAE,CAAC;IAC/E,CAAC;AACH,CAAC;AApBD,wEAoBC"}
1
+ {"version":3,"file":"doc-comment-annotation-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/doc-comment-annotation-util.ts"],"names":[],"mappings":";;;AACA,qGAA4F;AAO5F,SAAgB,8BAA8B,CAAC,YAA0B,EAAE,eAAgC;;IACzG,MAAA,eAAe,CAAC,UAAU,0CAAE,WAAW,CACpC,MAAM,CAAC,CAAC,iBAAuC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,KAAK,aAAa,EAC5F,OAAO,CAAC,CAAC,iBAAuC,EAAE,EAAE;QACnD,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAChE,YAAY,CAAC,YAAY,EAAE,CAAC;IAC9B,CAAC,EAAE;IAEL,SAAS,kBAAkB,CAAC,IAAY;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,gBAAgB,GAAG,EAAE,CAAC;QAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACrE;QACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,SAAS,sBAAsB,CAAC,UAAgC;QAC9D,IAAI,kBAAkB,GAAG,UAAU,CAAC,IAAI,CAAC;QACzC,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YAC3C,kBAAkB,GAAG,oCAAwB,CAAC,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SACtF;QACD,OAAO,KAAK,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,kBAAkB,EAAE,CAAC;IAC5E,CAAC;AACH,CAAC;AAzBD,wEAyBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cparra/apexdocs",
3
- "version": "2.2.2",
3
+ "version": "2.2.5",
4
4
  "description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
5
5
  "keywords": [
6
6
  "apex",
@@ -64,7 +64,7 @@
64
64
  ]
65
65
  },
66
66
  "dependencies": {
67
- "@cparra/apex-reflection": "^1.4.0",
67
+ "@cparra/apex-reflection": "^1.5.1",
68
68
  "fast-xml-parser": "^4.0.1",
69
69
  "chalk": "^4.1.2",
70
70
  "html-entities": "^2.3.2",
@@ -15,8 +15,13 @@ export function addCustomDocCommentAnnotations(markdownFile: MarkdownFile, docCo
15
15
  markdownFile.addBlankLine();
16
16
  });
17
17
 
18
- function capitalizeFirstLetter(text: string) {
19
- return text.charAt(0).toUpperCase() + text.slice(1);
18
+ function splitAndCapitalize(text: string) {
19
+ const words = text.split(/[-_]+/);
20
+ const capitalizedWords = [];
21
+ for (const word of words) {
22
+ capitalizedWords.push(word.charAt(0).toUpperCase() + word.slice(1));
23
+ }
24
+ return capitalizedWords.join(' ');
20
25
  }
21
26
 
22
27
  function buildDocAnnotationText(annotation: DocCommentAnnotation) {
@@ -24,6 +29,6 @@ export function addCustomDocCommentAnnotations(markdownFile: MarkdownFile, docCo
24
29
  if (annotation.name.toLowerCase() === 'see') {
25
30
  annotationBodyText = ClassFileGeneratorHelper.getFileLinkByTypeName(annotation.body);
26
31
  }
27
- return `**${capitalizeFirstLetter(annotation.name)}** ${annotationBodyText}`;
32
+ return `**${splitAndCapitalize(annotation.name)}** ${annotationBodyText}`;
28
33
  }
29
34
  }