@cparra/apexdocs 2.1.4 → 2.2.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 (47) hide show
  1. package/README.md +2 -1
  2. package/ROADMAP.md +7 -7
  3. package/docs/Misc/SampleClassWithoutModifier.md +11 -11
  4. package/docs/README.md +16 -16
  5. package/docs/Sample-Classes/SampleClass.md +174 -165
  6. package/docs/Sample-Interfaces/SampleInterface.md +27 -27
  7. package/examples/force-app/main/default/classes/SampleClass.cls +9 -0
  8. package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -0
  9. package/lib/application/Apexdocs.js +3 -0
  10. package/lib/application/Apexdocs.js.map +1 -1
  11. package/lib/cli/generate.js +6 -0
  12. package/lib/cli/generate.js.map +1 -1
  13. package/lib/model/apex-bundle.d.ts +5 -0
  14. package/lib/model/apex-bundle.js +10 -0
  15. package/lib/model/apex-bundle.js.map +1 -0
  16. package/lib/service/apex-file-reader.d.ts +2 -1
  17. package/lib/service/apex-file-reader.js +5 -2
  18. package/lib/service/apex-file-reader.js.map +1 -1
  19. package/lib/service/file-system.d.ts +2 -0
  20. package/lib/service/file-system.js +3 -0
  21. package/lib/service/file-system.js.map +1 -1
  22. package/lib/service/metadata-processor.d.ts +3 -0
  23. package/lib/service/metadata-processor.js +15 -0
  24. package/lib/service/metadata-processor.js.map +1 -0
  25. package/lib/service/parser.d.ts +3 -2
  26. package/lib/service/parser.js +20 -4
  27. package/lib/service/parser.js.map +1 -1
  28. package/lib/settings.d.ts +2 -0
  29. package/lib/settings.js +3 -0
  30. package/lib/settings.js.map +1 -1
  31. package/lib/transpiler/transpiler.js +4 -0
  32. package/lib/transpiler/transpiler.js.map +1 -1
  33. package/lib/util/error-logger.d.ts +8 -0
  34. package/lib/util/error-logger.js +89 -0
  35. package/lib/util/error-logger.js.map +1 -0
  36. package/package.json +5 -3
  37. package/src/application/Apexdocs.ts +5 -1
  38. package/src/cli/generate.ts +6 -0
  39. package/src/model/apex-bundle.ts +3 -0
  40. package/src/service/__tests__/apex-file-reader.spec.ts +11 -1
  41. package/src/service/apex-file-reader.ts +7 -4
  42. package/src/service/file-system.ts +5 -0
  43. package/src/service/metadata-processor.ts +13 -0
  44. package/src/service/parser.ts +20 -3
  45. package/src/settings.ts +5 -0
  46. package/src/transpiler/transpiler.ts +6 -0
  47. package/src/util/error-logger.ts +91 -0
package/README.md CHANGED
@@ -110,12 +110,13 @@ apexdocs-generate
110
110
  The CLI supports the following parameters:
111
111
 
112
112
  | Parameter | Alias | Description | Default | Required |
113
- | ----------------- | ----- |--------------------------------------------------------------------------------------------------------------------------| ----------------------------------- | -------- |
113
+ |-------------------|-------|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------|----------|
114
114
  | --sourceDir | -s | The directory location which contains your apex .cls classes. | N/A | Yes |
115
115
  | --targetDir | -t | The directory location where documentation will be generated to. | `docs` | No |
116
116
  | --recursive | -r | Whether .cls classes will be searched for recursively in the directory provided. | `true` | No |
117
117
  | --scope | -p | A list of scopes to document. Values should be separated by a space, e.g --scope public private | `global namespaceaccessible public` | No |
118
118
  | --targetGenerator | -g | Define the static file generator for which the documents will be created. Currently supports jekyll and docsify. | `jekyll` | No |
119
+ | --indexOnly | N/A | Defines whether only the index file should be generated. | `false` | No |
119
120
  | --configPath | -c | (Only versions 1.X) The path to the JSON configuration file that defines the structure of the documents to docGenerator. | N/A | No |
120
121
  | --group | -o | (Only versions 1.X) Define whether the generated files should be grouped by the @group tag on the top level classes. | `true` | No |
121
122
 
package/ROADMAP.md CHANGED
@@ -1,16 +1,16 @@
1
- [] Respect access modifiers where the properties/methods are different from the class declaration. For example,
1
+ [ ] Respect access modifiers where the properties/methods are different from the class declaration. For example,
2
2
  AuraEnabled properties do not live in an AuraEnabled class, so there's no way to just generate docs to showcase the
3
3
  AuraEnabled properties of a class without some sort of combination of also exposing other public/globals
4
4
 
5
- [] Versioning capabilities. When creating the doc you specify a version number, and a new directory is created for the
5
+ [ ] Versioning capabilities. When creating the doc you specify a version number, and a new directory is created for the
6
6
  files, instead of just overriding
7
7
 
8
- [] New generatortype: To JsDocs from AuraEnabled
8
+ [ ] New generatortype: To JsDocs from AuraEnabled
9
9
 
10
- [] More unit tests
10
+ [ ] More unit tests
11
11
 
12
- [] config.js support to allow for injections, home header, etc.
12
+ [ ] config.js support to allow for injections, home header, etc.
13
13
 
14
- [] Add configuration setting that allows someone to set the "namespace"
14
+ [ ] Add configuration setting that allows someone to set the "namespace"
15
15
 
16
- [] Homepage support similar to what docsify does
16
+ [ ] Homepage support similar to what docsify does
@@ -1,11 +1,11 @@
1
- # SampleClassWithoutModifier
2
-
3
- `ISTEST`
4
- ## Methods
5
- ### `static thisIsAClassWithoutAModifier()`
6
-
7
- `ISTEST`
8
-
9
- This is a test method
10
-
11
- ---
1
+ # SampleClassWithoutModifier
2
+
3
+ `ISTEST`
4
+ ## Methods
5
+ ### `static thisIsAClassWithoutAModifier()`
6
+
7
+ `ISTEST`
8
+
9
+ This is a test method
10
+
11
+ ---
package/docs/README.md CHANGED
@@ -1,16 +1,16 @@
1
- # Classes
2
- ## Sample Classes
3
-
4
- ### [SampleClass](/Sample-Classes/SampleClass.md)
5
-
6
- This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this ClassThatDoesNotExist does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
7
- ## Miscellaneous
8
-
9
- ### [SampleClassWithoutModifier](/Misc/SampleClassWithoutModifier.md)
10
-
11
-
12
- ## Sample Interfaces
13
-
14
- ### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
15
-
16
- This is an interface description.
1
+ # Classes
2
+ ## Sample Classes
3
+
4
+ ### [SampleClass](/Sample-Classes/SampleClass.md)
5
+
6
+ This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this ClassThatDoesNotExist does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
7
+ ## Miscellaneous
8
+
9
+ ### [SampleClassWithoutModifier](/Misc/SampleClassWithoutModifier.md)
10
+
11
+
12
+ ## Sample Interfaces
13
+
14
+ ### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
15
+
16
+ This is an interface description.
@@ -1,165 +1,174 @@
1
- # SampleClass
2
-
3
- `NAMESPACEACCESSIBLE`
4
-
5
- This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this ClassThatDoesNotExist does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
6
-
7
-
8
- **Group** Sample Classes
9
-
10
-
11
- **CustomAnnotation** A Custom annotation
12
-
13
-
14
- **Author** Cesar Parra
15
-
16
-
17
- **See** [SampleInterface](/Sample-Interfaces/SampleInterface.md)
18
-
19
- ## Constructors
20
- ### My Super Group
21
- ##### `SampleClass()`
22
-
23
- `NAMESPACEACCESSIBLE`
24
-
25
- Constructs a SampleClass without any arguments. This relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md)
26
-
27
- ###### Throws
28
- |Exception|Description|
29
- |---|---|
30
- |`ExcName`|some exception|
31
-
32
-
33
- **CustomAnnotation** A Custom method annotation
34
-
35
-
36
- **See** [SampleInterface](/Sample-Interfaces/SampleInterface.md)
37
-
38
- ###### Example
39
- ```apex
40
- // Example
41
- SampleClass sampleInstance = new SampleClass();
42
- ```
43
-
44
- ---
45
- ### Other
46
- ##### `SampleClass(String argument1, String argument2)`
47
-
48
- Constructs a SampleClass with an argument.
49
-
50
- ###### Parameters
51
- |Param|Description|
52
- |---|---|
53
- |`argument1`|Argument1 definition|
54
- |`argument2`|Argument2 definition|
55
-
56
- ---
57
- ## Fields
58
- ### Common Constants
59
-
60
- * `ANOTHER_CONSTANT` → `String`
61
- * `A_CONSTANT` → `String` [`NAMESPACEACCESSIBLE` ] - This is a constant.
62
- ---
63
- ### Other variables
64
-
65
- * `someVariable` → `String`
66
- ---
67
- ## Properties
68
-
69
- ### `AnotherProp` → `Decimal`
70
-
71
- `AURAENABLED`
72
-
73
- This is a Decimal property.
74
-
75
- ### `MyProp` → `String`
76
-
77
- `AURAENABLED`
78
- `DEPRECATED`
79
-
80
- This is a String property.
81
-
82
- ---
83
- ## Methods
84
- ### `static sampleMethod(String argument1, String argument2)`
85
-
86
- `NAMESPACEACCESSIBLE`
87
-
88
- Executes commands based on the passed in argument.
89
-
90
- #### Parameters
91
- |Param|Description|
92
- |---|---|
93
- |`argument1`|Argument1 to debug|
94
- |`argument2`|Argument2 to debug|
95
-
96
- #### Return
97
-
98
- **Type**
99
-
100
- String
101
-
102
- **Description**
103
-
104
- Empty string
105
-
106
- #### Example
107
- ```apex
108
- String result = SampleClass.testMethod();
109
- System.debug(result);
110
- ```
111
-
112
- ### `static call()`
113
-
114
- Calls the method. This methods allows you to call it.
115
-
116
- ---
117
- ## Enums
118
- ### InnerEnum
119
-
120
- `NAMESPACEACCESSIBLE`
121
-
122
- This is a namespace accessible enum
123
-
124
-
125
- ---
126
- ## Classes
127
- ### AnotherInnerClass
128
-
129
- Inner class belonging to SampleClass.
130
-
131
- #### Properties
132
-
133
- ##### `InnerProp` → `String`
134
-
135
-
136
- Description of the inner property.
137
-
138
- ---
139
- #### Methods
140
- ##### `innerMethod()`
141
-
142
- Executes from the inner class.
143
-
144
- ---
145
-
146
- ### InnerClass
147
-
148
- Inner class belonging to SampleClass.
149
-
150
- #### Properties
151
-
152
- ##### `InnerProp` → `String`
153
-
154
-
155
- Description of the inner property.
156
-
157
- ---
158
- #### Methods
159
- ##### `innerMethod()`
160
-
161
- Executes from the inner class.
162
-
163
- ---
164
-
165
- ---
1
+ # SampleClass
2
+
3
+ `NAMESPACEACCESSIBLE`
4
+
5
+ `APIVERSION: 54`
6
+
7
+ `STATUS: ACTIVE`
8
+
9
+ This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this ClassThatDoesNotExist does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
10
+
11
+
12
+ **Group** Sample Classes
13
+
14
+
15
+ **CustomAnnotation** A Custom annotation
16
+
17
+
18
+ **Author** Cesar Parra
19
+
20
+
21
+ **See** [SampleInterface](/Sample-Interfaces/SampleInterface.md)
22
+
23
+ ## Constructors
24
+ ### My Super Group
25
+ ##### `SampleClass()`
26
+
27
+ `NAMESPACEACCESSIBLE`
28
+
29
+ Constructs a SampleClass without any arguments. This relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md)
30
+
31
+ ###### Throws
32
+ |Exception|Description|
33
+ |---|---|
34
+ |`ExcName`|some exception|
35
+
36
+
37
+ **CustomAnnotation** A Custom method annotation
38
+
39
+
40
+ **See** [SampleInterface](/Sample-Interfaces/SampleInterface.md)
41
+
42
+ ###### Example
43
+ ```apex
44
+ // Example
45
+ SampleClass sampleInstance = new SampleClass();
46
+ ```
47
+
48
+ ---
49
+ ### Other
50
+ ##### `SampleClass(String argument1, String argument2)`
51
+
52
+ Constructs a SampleClass with an argument.
53
+
54
+ ###### Parameters
55
+ |Param|Description|
56
+ |---|---|
57
+ |`argument1`|Argument1 definition|
58
+ |`argument2`|Argument2 definition|
59
+
60
+ ---
61
+ ## Fields
62
+ ### Common Constants
63
+
64
+ * `ANOTHER_CONSTANT` → `String`
65
+ * `A_CONSTANT` → `String` [`NAMESPACEACCESSIBLE` ] - This is a constant.
66
+ ---
67
+ ### Other variables
68
+
69
+ * `someVariable` → `String`
70
+ ---
71
+ ## Properties
72
+
73
+ ### `AnotherProp` `Decimal`
74
+
75
+ `AURAENABLED`
76
+
77
+ This is a Decimal property.
78
+
79
+ ### `MyProp` → `String`
80
+
81
+ `AURAENABLED`
82
+ `DEPRECATED`
83
+
84
+ This is a String property.
85
+
86
+ ---
87
+ ## Methods
88
+ ### `static sampleMethod(String argument1, String argument2)`
89
+
90
+ `NAMESPACEACCESSIBLE`
91
+
92
+ Executes commands based on the passed in argument.
93
+
94
+ #### Parameters
95
+ |Param|Description|
96
+ |---|---|
97
+ |`argument1`|Argument1 to debug|
98
+ |`argument2`|Argument2 to debug|
99
+
100
+ #### Return
101
+
102
+ **Type**
103
+
104
+ String
105
+
106
+ **Description**
107
+
108
+ Empty string
109
+
110
+ #### Example
111
+ ```apex
112
+ String result = SampleClass.testMethod();
113
+ System.debug(result);
114
+ ```
115
+
116
+ ### `static anotherSampleMethod(String arg1)`
117
+ #### Parameters
118
+ |Param|Description|
119
+ |---|---|
120
+
121
+ ### `static call()`
122
+
123
+ Calls the method. This methods allows you to call it.
124
+
125
+ ---
126
+ ## Enums
127
+ ### InnerEnum
128
+
129
+ `NAMESPACEACCESSIBLE`
130
+
131
+ This is a namespace accessible enum
132
+
133
+
134
+ ---
135
+ ## Classes
136
+ ### AnotherInnerClass
137
+
138
+ Inner class belonging to SampleClass.
139
+
140
+ #### Properties
141
+
142
+ ##### `InnerProp` `String`
143
+
144
+
145
+ Description of the inner property.
146
+
147
+ ---
148
+ #### Methods
149
+ ##### `innerMethod()`
150
+
151
+ Executes from the inner class.
152
+
153
+ ---
154
+
155
+ ### InnerClass
156
+
157
+ Inner class belonging to SampleClass.
158
+
159
+ #### Properties
160
+
161
+ ##### `InnerProp` `String`
162
+
163
+
164
+ Description of the inner property.
165
+
166
+ ---
167
+ #### Methods
168
+ ##### `innerMethod()`
169
+
170
+ Executes from the inner class.
171
+
172
+ ---
173
+
174
+ ---
@@ -1,27 +1,27 @@
1
- # SampleInterface
2
-
3
- This is an interface description.
4
-
5
-
6
- **Group** Sample Interfaces
7
-
8
- ## Methods
9
- ### `execute()`
10
-
11
- Executes the command.
12
-
13
- ### `getValue()`
14
-
15
- Returns a value based on the executed command.
16
-
17
- #### Return
18
-
19
- **Type**
20
-
21
- String
22
-
23
- **Description**
24
-
25
- The value
26
-
27
- ---
1
+ # SampleInterface
2
+
3
+ This is an interface description.
4
+
5
+
6
+ **Group** Sample Interfaces
7
+
8
+ ## Methods
9
+ ### `execute()`
10
+
11
+ Executes the command.
12
+
13
+ ### `getValue()`
14
+
15
+ Returns a value based on the executed command.
16
+
17
+ #### Return
18
+
19
+ **Type**
20
+
21
+ String
22
+
23
+ **Description**
24
+
25
+ The value
26
+
27
+ ---
@@ -72,6 +72,15 @@ public with sharing class SampleClass {
72
72
  return '';
73
73
  }
74
74
 
75
+ /**
76
+ * @description Something here
77
+ * @arg1
78
+ */
79
+ public static String anotherSampleMethod(String arg1) {
80
+ System.debug('something');
81
+ return '';
82
+ }
83
+
75
84
 
76
85
  /**
77
86
  * @description Calls the method.
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <apiVersion>54.0</apiVersion>
4
+ <status>Active</status>
5
+ </ApexClass>
@@ -11,6 +11,7 @@ const settings_1 = require("../settings");
11
11
  const transpiler_1 = require("../transpiler/transpiler");
12
12
  const file_writer_1 = require("../service/file-writer");
13
13
  const types_repository_1 = require("../model/types-repository");
14
+ const error_logger_1 = require("../util/error-logger");
14
15
  /**
15
16
  * Application entry-point to generate documentation out of Apex source files.
16
17
  */
@@ -30,6 +31,8 @@ class Apexdocs {
30
31
  file_writer_1.FileWriter.write(generatedFiles, (fileName) => {
31
32
  logger_1.Logger.log(`${fileName} processed.`);
32
33
  });
34
+ // Error logging
35
+ error_logger_1.default.logErrors(filteredTypes);
33
36
  }
34
37
  }
35
38
  exports.Apexdocs = Apexdocs;
@@ -1 +1 @@
1
- {"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAA0E;AAC1E,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAuC;AACvC,yDAAkD;AAClD,wDAAoD;AACpD,gEAA4D;AAE5D;;GAEG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,QAAQ;QACb,MAAM,UAAU,GAAG,iCAAc,CAAC,YAAY,CAAC,IAAI,+BAAiB,EAAE,CAAC,CAAC;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ACtD;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -37,6 +37,11 @@ const argv = yargs.options({
37
37
  choices: ['jekyll', 'docsify'],
38
38
  describe: 'Define the static file generator for which the documents will be created. Currently supports jekyll, and docsify.',
39
39
  },
40
+ indexOnly: {
41
+ type: 'boolean',
42
+ default: false,
43
+ describe: 'Defines whether only the index file should be generated.',
44
+ },
40
45
  }).argv;
41
46
  settings_1.Settings.build({
42
47
  sourceDirectory: argv.sourceDir,
@@ -44,6 +49,7 @@ settings_1.Settings.build({
44
49
  scope: argv.scope,
45
50
  outputDir: argv.targetDir,
46
51
  targetGenerator: argv.targetGenerator,
52
+ indexOnly: argv.indexOnly,
47
53
  });
48
54
  Apexdocs_1.Apexdocs.generate();
49
55
  //# sourceMappingURL=generate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAyD;AACzD,sDAAmD;AAEnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,+DAA+D;KAC1E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kEAAkE;KAC7E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,kFAAkF;KAC7F;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,QAAQ,EACN,sHAAsH;YACtH,0HAA0H;KAC7H;IACD,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd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S,CAAC;QAC9B,QAAQ,EACN,mHAAmH;KACtH;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,2DAA2D;KACtE;CACF,CAAC,CAAC,IAAI,CAAC;AAER,mBAAQ,CAAC,KAAK,CAAC;IACb,eAAe,EAAE,IAAI,CAAC,SAAS;IAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,eAAe,EAAE,IAAI,CAAC,eAAmC;IACzD,SAAS,EAAE,IAAI,CAAC,SAAS;CAC1B,CAAC,CAAC;AAEH,mBAAQ,CAAC,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export default class ApexBundle {
2
+ rawTypeContent: string;
3
+ rawMetadataContent: string | null;
4
+ constructor(rawTypeContent: string, rawMetadataContent: string | null);
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class ApexBundle {
4
+ constructor(rawTypeContent, rawMetadataContent) {
5
+ this.rawTypeContent = rawTypeContent;
6
+ this.rawMetadataContent = rawMetadataContent;
7
+ }
8
+ }
9
+ exports.default = ApexBundle;
10
+ //# sourceMappingURL=apex-bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apex-bundle.js","sourceRoot":"","sources":["../../src/model/apex-bundle.ts"],"names":[],"mappings":";;AAAA,MAAqB,UAAU;IAC7B,YAAmB,cAAsB,EAAS,kBAAiC;QAAhE,mBAAc,GAAd,cAAc,CAAQ;QAAS,uBAAkB,GAAlB,kBAAkB,CAAe;IAAG,CAAC;CACxF;AAFD,6BAEC"}
@@ -1,4 +1,5 @@
1
1
  import { FileSystem } from './file-system';
2
+ import ApexBundle from '../model/apex-bundle';
2
3
  /**
3
4
  * Reads from .cls files and returns their raw body.
4
5
  */
@@ -6,7 +7,7 @@ export declare class ApexFileReader {
6
7
  /**
7
8
  * Reads from .cls files and returns their raw body.
8
9
  */
9
- static processFiles(fileSystem: FileSystem, rootPath?: string): string[];
10
+ static processFiles(fileSystem: FileSystem, rootPath?: string): ApexBundle[];
10
11
  private static isApexFile;
11
12
  private static get sourceDirectory();
12
13
  private static get readRecursively();
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApexFileReader = void 0;
4
4
  const settings_1 = require("../settings");
5
+ const apex_bundle_1 = require("../model/apex-bundle");
5
6
  const APEX_FILE_EXTENSION = '.cls';
6
7
  /**
7
8
  * Reads from .cls files and returns their raw body.
@@ -21,8 +22,10 @@ class ApexFileReader {
21
22
  if (!this.isApexFile(currentFilePath)) {
22
23
  return;
23
24
  }
24
- const rawFile = fileSystem.readFile(currentPath);
25
- bodies.push(rawFile);
25
+ const rawApexFile = fileSystem.readFile(currentPath);
26
+ const metadataPath = fileSystem.joinPath(rootPath, `${currentFilePath}-meta.xml`);
27
+ const rawMetadataFile = fileSystem.exists(metadataPath) ? fileSystem.readFile(metadataPath) : null;
28
+ bodies.push(new apex_bundle_1.default(rawApexFile, rawMetadataFile));
26
29
  });
27
30
  return bodies;
28
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"apex-file-reader.js","sourceRoot":"","sources":["../../src/service/apex-file-reader.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAGvC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC;;GAEG;AACH,MAAa,cAAc;IACzB;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,UAAsB,EAAE,WAAmB,IAAI,CAAC,eAAe;QACjF,IAAI,MAAM,GAAa,EAAE,CAAC;QAE1B,MAAM,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC7D,iBAAiB,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;YAC5C,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CA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M,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;YACnE,IAAI,IAAI,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE;gBAC/D,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;aACpE;YAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE;gBACrC,OAAO;aACR;YAED,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YACrD,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,eAAe,WAAW,CAAC,CAAC;YAClF,MAAM,eAAe,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACnG,MAAM,CAAC,IAAI,CAAC,IAAI,qBAAU,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,MAAM,CAAC,UAAU,CAAC,WAAmB;QAC3C,OAAO,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAEO,MAAM,KAAK,eAAe;QAChC,OAAO,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC;IAChD,CAAC;IAEO,MAAM,KAAK,eAAe;QAChC,OAAO,mBAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC;IAC1C,CAAC;CACF;AArCD,wCAqCC"}
@@ -3,10 +3,12 @@ export interface FileSystem {
3
3
  isDirectory: (path: string) => boolean;
4
4
  readFile: (path: string) => string;
5
5
  joinPath: (...paths: string[]) => string;
6
+ exists: (path: string) => boolean;
6
7
  }
7
8
  export declare class DefaultFileSystem implements FileSystem {
8
9
  isDirectory(pathToRead: string): boolean;
9
10
  readDirectory(sourceDirectory: string): string[];
10
11
  readFile(pathToRead: string): string;
11
12
  joinPath(...paths: string[]): string;
13
+ exists(path: string): boolean;
12
14
  }