@cparra/apexdocs 2.2.4 → 2.4.0

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 (63) hide show
  1. package/.github/workflows/close_stale.yml +3 -3
  2. package/README.md +74 -114
  3. package/docs/{Misc → API}/SampleClassWithoutModifier.md +0 -0
  4. package/docs/README.md +2 -2
  5. package/docs/Sample-Classes/SampleClass.md +7 -1
  6. package/docs/Sample-Interfaces/SampleInterface.md +0 -3
  7. package/docs/Utils/GroupedClass.md +10 -10
  8. package/examples/force-app/main/default/classes/SampleClass.cls +1 -1
  9. package/lib/application/Apexdocs.d.ts +2 -1
  10. package/lib/application/Apexdocs.js +7 -5
  11. package/lib/application/Apexdocs.js.map +1 -1
  12. package/lib/cli/generate.js +6 -0
  13. package/lib/cli/generate.js.map +1 -1
  14. package/lib/model/apex-bundle.d.ts +2 -1
  15. package/lib/model/apex-bundle.js +2 -1
  16. package/lib/model/apex-bundle.js.map +1 -1
  17. package/lib/model/file.js +5 -2
  18. package/lib/model/file.js.map +1 -1
  19. package/lib/model/markdown-file.d.ts +2 -0
  20. package/lib/model/markdown-file.js +22 -0
  21. package/lib/model/markdown-file.js.map +1 -1
  22. package/lib/model/markdown-home-file.d.ts +0 -1
  23. package/lib/model/markdown-home-file.js +0 -4
  24. package/lib/model/markdown-home-file.js.map +1 -1
  25. package/lib/model/markdown-type-file.d.ts +0 -1
  26. package/lib/model/markdown-type-file.js +0 -4
  27. package/lib/model/markdown-type-file.js.map +1 -1
  28. package/lib/service/apex-file-reader.js +4 -4
  29. package/lib/service/apex-file-reader.js.map +1 -1
  30. package/lib/service/manifest-factory.d.ts +2 -1
  31. package/lib/service/manifest-factory.js.map +1 -1
  32. package/lib/service/parser.d.ts +2 -2
  33. package/lib/service/parser.js +3 -1
  34. package/lib/service/parser.js.map +1 -1
  35. package/lib/settings.d.ts +2 -0
  36. package/lib/settings.js +3 -0
  37. package/lib/settings.js.map +1 -1
  38. package/lib/transpiler/markdown/class-file-generatorHelper.js +4 -3
  39. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  40. package/lib/util/error-logger.js +25 -24
  41. package/lib/util/error-logger.js.map +1 -1
  42. package/lib/util/logger.d.ts +4 -1
  43. package/lib/util/logger.js +28 -3
  44. package/lib/util/logger.js.map +1 -1
  45. package/package.json +6 -5
  46. package/src/application/Apexdocs.ts +8 -5
  47. package/src/cli/generate.ts +6 -0
  48. package/src/model/apex-bundle.ts +1 -1
  49. package/src/model/file.ts +6 -2
  50. package/src/model/markdown-file.ts +26 -0
  51. package/src/model/markdown-home-file.ts +0 -5
  52. package/src/model/markdown-type-file.ts +0 -5
  53. package/src/service/apex-file-reader.ts +4 -4
  54. package/src/service/manifest-factory.ts +5 -1
  55. package/src/service/parser.ts +5 -3
  56. package/src/settings.ts +5 -0
  57. package/src/transpiler/markdown/class-file-generatorHelper.ts +4 -3
  58. package/src/util/error-logger.ts +25 -24
  59. package/src/util/logger.ts +29 -3
  60. package/docs/.nojekyll +0 -0
  61. package/docs/Some-group/GroupedClass.md +0 -7
  62. package/docs/index.html +0 -21
  63. package/docs/index.md +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-type-file.js","sourceRoot":"","sources":["../../src/model/markdown-type-file.ts"],"names":[],"mappings":";;;AAUA,sEAAkE;AAElE,mDAA+C;AAC/C,yEAAsF;AACtF,kGAAyF;AAUzF,MAAa,gBAAiB,SAAQ,4BAAY;IAChD,YAAmB,IAAU,EAAS,eAAuB,CAAC,EAAE,aAAsB;QACpF,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,oCAAwB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;QADvD,SAAI,GAAJ,IAAI,CAAM;QAAS,iBAAY,GAAZ,YAAY,CAAY;QAE5D,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SAC7B;QACD,MAAM,MAAM,GAA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,IAAI,CAAC,KAAK,mCAAI,OAAO,CAAC;YAChD,MAAM,KAAK,GAAiB,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;CACF;AApHD,4CAoHC"}
@@ -12,12 +12,12 @@ class ApexFileReader {
12
12
  * Reads from .cls files and returns their raw body.
13
13
  */
14
14
  static processFiles(fileSystem, rootPath = this.sourceDirectory) {
15
- let bodies = [];
15
+ let bundles = [];
16
16
  const directoryContents = fileSystem.readDirectory(rootPath);
17
17
  directoryContents.forEach((currentFilePath) => {
18
18
  const currentPath = fileSystem.joinPath(rootPath, currentFilePath);
19
19
  if (this.readRecursively && fileSystem.isDirectory(currentPath)) {
20
- bodies = bodies.concat(this.processFiles(fileSystem, currentPath));
20
+ bundles = bundles.concat(this.processFiles(fileSystem, currentPath));
21
21
  }
22
22
  if (!this.isApexFile(currentFilePath)) {
23
23
  return;
@@ -25,9 +25,9 @@ class ApexFileReader {
25
25
  const rawApexFile = fileSystem.readFile(currentPath);
26
26
  const metadataPath = fileSystem.joinPath(rootPath, `${currentFilePath}-meta.xml`);
27
27
  const rawMetadataFile = fileSystem.exists(metadataPath) ? fileSystem.readFile(metadataPath) : null;
28
- bodies.push(new apex_bundle_1.default(rawApexFile, rawMetadataFile));
28
+ bundles.push(new apex_bundle_1.default(currentFilePath, rawApexFile, rawMetadataFile));
29
29
  });
30
- return bodies;
30
+ return bundles;
31
31
  }
32
32
  static isApexFile(currentFile) {
33
33
  return currentFile.endsWith(APEX_FILE_EXTENSION);
@@ -1 +1 @@
1
- {"version":3,"file":"apex-file-reader.js","sourceRoot":"","sources":["../../src/service/apex-file-reader.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAEvC,sDAA8C;AAE9C,M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AAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACnG,OAAO,CAAC,IAAI,CAAC,IAAI,qBAAU,CAAC,eAAe,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;QAC9E,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,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"}
@@ -1,9 +1,10 @@
1
1
  import Manifest from '../model/manifest';
2
2
  import { TypeParser } from './parser';
3
3
  import { ReflectionResult } from '@cparra/apex-reflection';
4
+ import ApexBundle from '../model/apex-bundle';
4
5
  /**
5
6
  * Builds a new Manifest object, sourcing its types from the received TypeParser.
6
7
  * @param typeParser In charge of returning the list of reflected types.
7
8
  * @param reflect Reflection function.
8
9
  */
9
- export declare function createManifest(typeParser: TypeParser, reflect: (typeBody: string) => ReflectionResult): Manifest;
10
+ export declare function createManifest(typeParser: TypeParser, reflect: (apexBundle: ApexBundle) => ReflectionResult): Manifest;
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-factory.js","sourceRoot":"","sources":["../../src/service/manifest-factory.ts"],"names":[],"mappings":";;;AAAA,gDAAyC;AAIzC;;;;GAIG;AACH,SAAgB,cAAc,CAAC,UAAsB,EAAE,OAA+C;IACpG,OAAO,IAAI,kBAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,wCAEC"}
1
+ {"version":3,"file":"manifest-factory.js","sourceRoot":"","sources":["../../src/service/manifest-factory.ts"],"names":[],"mappings":";;;AAAA,gDAAyC;AAKzC;;;;GAIG;AACH,SAAgB,cAAc,CAC5B,UAAsB,EACtB,OAAqD;IAErD,OAAO,IAAI,kBAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC;AALD,wCAKC"}
@@ -1,10 +1,10 @@
1
1
  import { Type, ReflectionResult } from '@cparra/apex-reflection';
2
2
  import ApexBundle from '../model/apex-bundle';
3
3
  export interface TypeParser {
4
- parse(reflect: (typeBody: string) => ReflectionResult): Type[];
4
+ parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
5
5
  }
6
6
  export declare class RawBodyParser implements TypeParser {
7
7
  typeBundles: ApexBundle[];
8
8
  constructor(typeBundles: ApexBundle[]);
9
- parse(reflect: (typeBody: string) => ReflectionResult): Type[];
9
+ parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
10
10
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RawBodyParser = void 0;
4
4
  const metadata_processor_1 = require("./metadata-processor");
5
+ const logger_1 = require("../util/logger");
5
6
  class RawBodyParser {
6
7
  constructor(typeBundles) {
7
8
  this.typeBundles = typeBundles;
@@ -9,7 +10,8 @@ class RawBodyParser {
9
10
  parse(reflect) {
10
11
  return this.typeBundles
11
12
  .map((currentBundle) => {
12
- const result = reflect(currentBundle.rawTypeContent);
13
+ logger_1.Logger.log(`Parsing file: ${currentBundle.filePath}`);
14
+ const result = reflect(currentBundle);
13
15
  if (!!result.typeMirror && !!currentBundle.rawMetadataContent) {
14
16
  // If successful and there is a metadata file
15
17
  const metadataParams = metadata_processor_1.default.process(currentBundle.rawMetadataContent);
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/service/parser.ts"],"names":[],"mappings":";;;AAEA,6DAAqD;AAMrD,MAAa,aAAa;IACxB,YAAmB,WAAyB;QAAzB,gBAAW,GAAX,WAAW,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AM,CAAC,GAAG,CAAC,iBAAiB,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;YACtD,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;YACtC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,aAAa,CAAC,kBAAkB,EAAE;gBAC7D,6CAA6C;gBAC7C,MAAM,cAAc,GAAG,4BAAiB,CAAC,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;gBACnF,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;oBACpC,MAAM,WAAW,GAAG,GAAG,GAAG,KAAK,KAAK,EAAE,CAAC;oBACvC,MAAM,CAAC,UAAW,CAAC,WAAW,CAAC,IAAI,CAAC;wBAClC,cAAc,EAAE,WAAW;wBAC3B,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,WAAW;qBAClB,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;aACJ;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,gBAAgB,EAAE,EAAE;YAC3B,OAAO,gBAAgB,CAAC,UAAU,CAAC;QACrC,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,UAAW,CAAC,CAAC;IAC7D,CAAC;CACF;AA3BD,sCA2BC"}
package/lib/settings.d.ts CHANGED
@@ -7,6 +7,7 @@ export interface SettingsConfig {
7
7
  outputDir: string;
8
8
  targetGenerator: GeneratorChoices;
9
9
  indexOnly: boolean;
10
+ defaultGroupName: string;
10
11
  }
11
12
  export declare class Settings {
12
13
  config: SettingsConfig;
@@ -20,4 +21,5 @@ export declare class Settings {
20
21
  get outputDir(): string;
21
22
  get typeTranspiler(): ProcessorTypeTranspiler;
22
23
  get indexOnly(): boolean;
24
+ getDefaultGroupName(): string;
23
25
  }
package/lib/settings.js CHANGED
@@ -41,6 +41,9 @@ class Settings {
41
41
  get indexOnly() {
42
42
  return this.config.indexOnly;
43
43
  }
44
+ getDefaultGroupName() {
45
+ return this.config.defaultGroupName;
46
+ }
44
47
  }
45
48
  exports.Settings = Settings;
46
49
  //# sourceMappingURL=settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AACA,4FAAwF;AACxF,iGAAwF;AAaxF,MAAa,QAAQ;IAGnB,YAA2B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE9C,MAAM,CAAC,KAAK,CAAC,MAAsB;QACxC,QAAQ,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QACD,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACrC,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,cAAc;QAChB,QAAQ,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YACnC,KAAK,QAAQ;gBACX,OAAO,IAAI,0CAAmB,EAAE,CAAC;YACnC,KAAK,SAAS;gBACZ,OAAO,IAAI,gCAAoB,EAAE,CAAC;YACpC;gBACE,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC;IAED,IAAI,SAAS;QACX,OA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,CAAC,gBAAgB,CAAC;IACtC,CAAC;CACF;AAlDD,4BAkDC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const types_repository_1 = require("../../model/types-repository");
4
+ const settings_1 = require("../../settings");
4
5
  class ClassFileGeneratorHelper {
5
6
  static getSanitizedGroup(classModel) {
6
7
  return this.getClassGroup(classModel).replace(/ /g, '-').replace('.', '');
@@ -11,15 +12,15 @@ class ClassFileGeneratorHelper {
11
12
  static getFileLinkByTypeName(typeName) {
12
13
  const type = types_repository_1.TypesRepository.getInstance().getByName(typeName);
13
14
  if (!type) {
14
- // If the type is not found we simply return the file name we received
15
- return typeName;
15
+ // If the type is not found we return a Markdown hyperlink with whatever we received.
16
+ return `[${typeName}](${typeName})`;
16
17
  }
17
18
  return this.getFileLink(type);
18
19
  }
19
20
  static getClassGroup(classModel) {
20
21
  var _a, _b;
21
22
  const groupAnnotation = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name === 'group');
22
- return (_b = groupAnnotation === null || groupAnnotation === void 0 ? void 0 : groupAnnotation.body) !== null && _b !== void 0 ? _b : 'Misc';
23
+ return (_b = groupAnnotation === null || groupAnnotation === void 0 ? void 0 : groupAnnotation.body) !== null && _b !== void 0 ? _b : settings_1.Settings.getInstance().getDefaultGroupName();
23
24
  }
24
25
  }
25
26
  exports.default = ClassFileGeneratorHelper;
@@ -1 +1 @@
1
- {"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;AAE/D,MAAqB,wBAAwB;IACpC,MAAM,CAAC,iBAAiB,CAAC,UAAgB;QAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAgB;QACxC,OAAO,IAAI,UAAU,CAAC,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,MAAM,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,MAAM,IAAI,GAAG,kCAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,EAAE;YACT,sEAAsE;YACtE,OAAO,QAAQ,CAAC;SACjB;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,UAAgB;;QAC3C,MAAM,eAAe,SAAG,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;QAC7G,aAAO,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,mCAAI,MAAM,CAAC;IACzC,CAAC;CACF;AAvBD,2CAuBC"}
1
+ {"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;AAC/D,6CAA0C;AAE1C,MAAqB,wBAAwB;IACpC,MAAM,CAAC,iBAAiB,CAAC,UAAgB;QAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAgB;QACxC,OAAO,IAAI,UAAU,CAAC,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,MAAM,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,MAAM,IAAI,GAAG,kCAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,EAAE;YACT,qFAAqF;YACrF,OAAO,IAAI,QAAQ,KAAK,QAAQ,GAAG,CAAC;SACrC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,UAAgB;;QAC3C,MAAM,eAAe,SAAG,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;QAC7G,aAAO,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,mCAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,CAAC;IAC/E,CAAC;CACF;AAvBD,2CAuBC"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const logger_1 = require("./logger");
3
4
  class ErrorLogger {
4
5
  static logErrors(types) {
5
6
  types.forEach((currentType) => {
@@ -19,10 +20,10 @@ class ErrorLogger {
19
20
  var _a;
20
21
  if ((_a = currentType.docComment) === null || _a === void 0 ? void 0 : _a.error) {
21
22
  const typeName = parentType ? `${parentType.name}.${currentType.name}` : currentType.name;
22
- console.log(`${typeName} - Doc comment parsing error. Level: Type`);
23
- console.log(`Comment:\n ${currentType.docComment.rawDeclaration}`);
24
- console.log(currentType.docComment.error);
25
- console.log('=================================');
23
+ logger_1.Logger.error(`${typeName} - Doc comment parsing error. Level: Type`);
24
+ logger_1.Logger.error(`Comment:\n ${currentType.docComment.rawDeclaration}`);
25
+ logger_1.Logger.error(currentType.docComment.error);
26
+ logger_1.Logger.error('=================================');
26
27
  }
27
28
  }
28
29
  static logErrorsForClass(classMirror, parentType) {
@@ -30,37 +31,37 @@ class ErrorLogger {
30
31
  classMirror.constructors.forEach((currentConstructor) => {
31
32
  var _a;
32
33
  if ((_a = currentConstructor.docComment) === null || _a === void 0 ? void 0 : _a.error) {
33
- console.log(`${typeName} - Doc comment parsing error. Level: Constructor`);
34
- console.log(`Comment:\n ${currentConstructor.docComment.rawDeclaration}`);
35
- console.log(currentConstructor.docComment.error);
36
- console.log('=================================');
34
+ logger_1.Logger.error(`${typeName} - Doc comment parsing error. Level: Constructor`);
35
+ logger_1.Logger.error(`Comment:\n ${currentConstructor.docComment.rawDeclaration}`);
36
+ logger_1.Logger.error(currentConstructor.docComment.error);
37
+ logger_1.Logger.error('=================================');
37
38
  }
38
39
  });
39
40
  classMirror.fields.forEach((currentField) => {
40
41
  var _a;
41
42
  if ((_a = currentField.docComment) === null || _a === void 0 ? void 0 : _a.error) {
42
- console.log(`${typeName} - Doc comment parsing error. Level: Field`);
43
- console.log(`Comment:\n ${currentField.docComment.rawDeclaration}`);
44
- console.log(currentField.docComment.error);
45
- console.log('=================================');
43
+ logger_1.Logger.error(`${typeName} - Doc comment parsing error. Level: Field`);
44
+ logger_1.Logger.error(`Comment:\n ${currentField.docComment.rawDeclaration}`);
45
+ logger_1.Logger.error(currentField.docComment.error);
46
+ logger_1.Logger.error('=================================');
46
47
  }
47
48
  });
48
49
  classMirror.properties.forEach((currentProperty) => {
49
50
  var _a;
50
51
  if ((_a = currentProperty.docComment) === null || _a === void 0 ? void 0 : _a.error) {
51
- console.log(`${typeName} - Doc comment parsing error. Level: Property`);
52
- console.log(`Comment:\n ${currentProperty.docComment.rawDeclaration}`);
53
- console.log(currentProperty.docComment.error);
54
- console.log('=================================');
52
+ logger_1.Logger.error(`${typeName} - Doc comment parsing error. Level: Property`);
53
+ logger_1.Logger.error(`Comment:\n ${currentProperty.docComment.rawDeclaration}`);
54
+ logger_1.Logger.error(currentProperty.docComment.error);
55
+ logger_1.Logger.error('=================================');
55
56
  }
56
57
  });
57
58
  classMirror.methods.forEach((currentMethod) => {
58
59
  var _a;
59
60
  if ((_a = currentMethod.docComment) === null || _a === void 0 ? void 0 : _a.error) {
60
- console.log(`${typeName} - Doc comment parsing error. Level: Method`);
61
- console.log(`Comment:\n ${currentMethod.docComment.rawDeclaration}`);
62
- console.log(currentMethod.docComment.error);
63
- console.log('=================================');
61
+ logger_1.Logger.error(`${typeName} - Doc comment parsing error. Level: Method`);
62
+ logger_1.Logger.error(`Comment:\n ${currentMethod.docComment.rawDeclaration}`);
63
+ logger_1.Logger.error(currentMethod.docComment.error);
64
+ logger_1.Logger.error('=================================');
64
65
  }
65
66
  });
66
67
  classMirror.enums.forEach((currentEnum) => {
@@ -77,10 +78,10 @@ class ErrorLogger {
77
78
  interfaceMirror.methods.forEach((currentMethod) => {
78
79
  var _a;
79
80
  if ((_a = currentMethod.docComment) === null || _a === void 0 ? void 0 : _a.error) {
80
- console.log(`${interfaceMirror.name} - Doc comment parsing error. Level: Method`);
81
- console.log(`Comment: ${currentMethod.docComment.rawDeclaration}`);
82
- console.log(currentMethod.docComment.error);
83
- console.log('=================================');
81
+ logger_1.Logger.error(`${interfaceMirror.name} - Doc comment parsing error. Level: Method`);
82
+ logger_1.Logger.error(`Comment: ${currentMethod.docComment.rawDeclaration}`);
83
+ logger_1.Logger.error(currentMethod.docComment.error);
84
+ logger_1.Logger.error('=================================');
84
85
  }
85
86
  });
86
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error-logger.js","sourceRoot":"","sources":["../../src/util/error-logger.ts"],"names":[],"mappings":";;AAEA,MAAqB,WAAW;IACvB,MAAM,CAAC,SAAS,CAAC,KAAa;QACnC,KAAK,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YAC5B,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,sBAAsB,CAAC,WAAiB,EAAE,UAAiB;QACxE,IAAI,CA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CAAC,GAAG,eAAe,CAAC,IAAI,6CAA6C,CAAC,CAAC;gBACnF,eAAM,CAAC,KAAK,CAAC,YAAY,aAAa,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;gBACpE,eAAM,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBAC7C,eAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;aACnD;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxFD,8BAwFC"}
@@ -2,6 +2,8 @@
2
2
  * Logs messages to the console.
3
3
  */
4
4
  export declare class Logger {
5
+ static currentFrame: number;
6
+ static frames: string[];
5
7
  /**
6
8
  * Logs a message with optional arguments.
7
9
  * @param message The message to log.
@@ -14,5 +16,6 @@ export declare class Logger {
14
16
  * @param args Optional arguments.
15
17
  */
16
18
  static error(message: string, ...args: string[]): void;
17
- private static logSingle;
19
+ static logSingle(text: string, showSpinner?: boolean, color?: 'green' | 'red', overrideConsole?: boolean): void;
20
+ static clear(): void;
18
21
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Logger = void 0;
4
4
  const chalk = require("chalk");
5
+ const logUpdate = require("log-update");
5
6
  /**
6
7
  * Logs messages to the console.
7
8
  */
@@ -23,11 +24,35 @@ class Logger {
23
24
  * @param args Optional arguments.
24
25
  */
25
26
  static error(message, ...args) {
26
- this.log(`${chalk.red(message)}`, ...args);
27
+ this.logSingle(message, false, 'red', false);
28
+ args.forEach((arg) => {
29
+ this.logSingle(message, false, 'red', false);
30
+ });
31
+ }
32
+ static logSingle(text, showSpinner = true, color = 'green', overrideConsole = true) {
33
+ if (this.currentFrame > 9) {
34
+ this.currentFrame = 0;
35
+ }
36
+ const spinner = showSpinner ? `${this.frames[this.currentFrame++]}` : '';
37
+ let logMessage;
38
+ if (color === 'green') {
39
+ logMessage = `${chalk.green(new Date().toLocaleString() + ': ')}${text}\n`;
40
+ }
41
+ else {
42
+ logMessage = `${chalk.red(new Date().toLocaleString() + ': ')}${text}\n`;
43
+ }
44
+ if (overrideConsole) {
45
+ logUpdate(`${spinner} ${logMessage}`);
46
+ }
47
+ else {
48
+ process.stdout.write(`${spinner} ${logMessage}`);
49
+ }
27
50
  }
28
- static logSingle(message) {
29
- process.stdout.write(`${chalk.green(new Date().toLocaleString() + ': ')}${message}\n`);
51
+ static clear() {
52
+ logUpdate.clear();
30
53
  }
31
54
  }
32
55
  exports.Logger = Logger;
56
+ Logger.currentFrame = -1;
57
+ Logger.frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
33
58
  //# sourceMappingURL=logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/util/logger.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B;;GAEG;AACH,MAAa,MAAM;IACjB;;;;OAIG;IACI,MAAM,CAAC,GAAG,CAAC,OAAe,EAAE,GAAG,IAAc;QAClD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,KAAK,CAAC,OAAe,EAAE,GAAG,IAAc;QACpD,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7C,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,OAAe;QACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;IACzF,CAAC;CACF;AAzBD,wBAyB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,IAAI,CAAC;SAC5E;aAAM;YACL,UAAU,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC;SAC1E;QACD,IAAI,eAAe,EAAE;YACnB,SAAS,CAAC,GAAG,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC;SACvC;aAAM;YACL,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC;SAClD;IACH,CAAC;IAEM,MAAM,CAAC,KAAK;QACjB,SAAS,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;;AAjDH,wBAkDC;AAjDQ,mBAAY,GAAG,CAAC,CAAC,CAAC;AAElB,aAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cparra/apexdocs",
3
- "version": "2.2.4",
3
+ "version": "2.4.0",
4
4
  "description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
5
5
  "keywords": [
6
6
  "apex",
@@ -24,7 +24,7 @@
24
24
  "postversion": "git push && git push --tags",
25
25
  "docs:init": "docsify init docs",
26
26
  "docs:serve": "docsify serve docs",
27
- "execute:example": "node lib/cli/generate.js -s examples/force-app -t docs --scope global public private -g docsify",
27
+ "execute:example": "node lib/cli/generate.js -s examples/force-app -t docs --scope global public private -g docsify --defaultGroupName API",
28
28
  "execute:example:index:only": "node lib/cli/generate.js -s examples/force-app -t docs --scope global public private -g docsify --indexOnly"
29
29
  },
30
30
  "author": "Cesar Parra",
@@ -64,10 +64,11 @@
64
64
  ]
65
65
  },
66
66
  "dependencies": {
67
- "@cparra/apex-reflection": "^1.5.0",
68
- "fast-xml-parser": "^4.0.1",
67
+ "@cparra/apex-reflection": "^1.6.0",
69
68
  "chalk": "^4.1.2",
70
- "html-entities": "^2.3.2",
69
+ "fast-xml-parser": "^4.0.1",
70
+ "log-update": "4.0.0",
71
+ "xss": "^1.0.11",
71
72
  "yargs": "^16.0.3"
72
73
  }
73
74
  }
@@ -9,6 +9,7 @@ import Transpiler from '../transpiler/transpiler';
9
9
  import { FileWriter } from '../service/file-writer';
10
10
  import { TypesRepository } from '../model/types-repository';
11
11
  import ErrorLogger from '../util/error-logger';
12
+ import ApexBundle from '../model/apex-bundle';
12
13
 
13
14
  /**
14
15
  * Application entry-point to generate documentation out of Apex source files.
@@ -18,28 +19,30 @@ export class Apexdocs {
18
19
  * Generates documentation out of Apex source files.
19
20
  */
20
21
  static generate(): void {
22
+ Logger.log('Initializing...');
21
23
  const fileBodies = ApexFileReader.processFiles(new DefaultFileSystem());
22
24
  const manifest = createManifest(new RawBodyParser(fileBodies), this._reflectionWithLogger);
23
25
 
24
26
  const filteredTypes: Type[] = manifest.filteredByAccessModifierAndAnnotations(Settings.getInstance().scope);
25
27
  TypesRepository.getInstance().populate(filteredTypes);
28
+ Logger.clear();
26
29
 
27
- Logger.log(`Parsed ${filteredTypes.length} files`);
30
+ Logger.logSingle(`Parsed ${filteredTypes.length} files`, false, 'green', false);
28
31
  const processor = Settings.getInstance().typeTranspiler;
29
32
  Transpiler.generate(filteredTypes, processor);
30
33
  const generatedFiles = processor.fileBuilder().files();
31
34
  FileWriter.write(generatedFiles, (fileName: string) => {
32
- Logger.log(`${fileName} processed.`);
35
+ Logger.logSingle(`${fileName} processed.`, false, 'green', false);
33
36
  });
34
37
 
35
38
  // Error logging
36
39
  ErrorLogger.logErrors(filteredTypes);
37
40
  }
38
41
 
39
- static _reflectionWithLogger = (declarationBody: string): ReflectionResult => {
40
- const result = reflect(declarationBody);
42
+ static _reflectionWithLogger = (apexBundle: ApexBundle): ReflectionResult => {
43
+ const result = reflect(apexBundle.rawTypeContent);
41
44
  if (result.error) {
42
- Logger.log(`Parsing error ${result.error?.message}`);
45
+ Logger.error(`${apexBundle.filePath} - Parsing error ${result.error?.message}`);
43
46
  }
44
47
  return result;
45
48
  };
@@ -44,6 +44,11 @@ const argv = yargs.options({
44
44
  default: false,
45
45
  describe: 'Defines whether only the index file should be generated.',
46
46
  },
47
+ defaultGroupName: {
48
+ type: 'string',
49
+ default: 'Miscellaneous',
50
+ describe: 'Defines the @group name to be used when a file does not specify it.',
51
+ },
47
52
  }).argv;
48
53
 
49
54
  Settings.build({
@@ -53,6 +58,7 @@ Settings.build({
53
58
  outputDir: argv.targetDir,
54
59
  targetGenerator: argv.targetGenerator as GeneratorChoices,
55
60
  indexOnly: argv.indexOnly,
61
+ defaultGroupName: argv.defaultGroupName,
56
62
  });
57
63
 
58
64
  Apexdocs.generate();
@@ -1,3 +1,3 @@
1
1
  export default class ApexBundle {
2
- constructor(public rawTypeContent: string, public rawMetadataContent: string | null) {}
2
+ constructor(public filePath: string, public rawTypeContent: string, public rawMetadataContent: string | null) {}
3
3
  }
package/src/model/file.ts CHANGED
@@ -1,4 +1,8 @@
1
- import { encode } from 'html-entities';
1
+ import xss = require('xss');
2
+
3
+ const xssFilter = new xss.FilterXSS({
4
+ whiteList: { br: [], p: [], ul: [], li: [] },
5
+ });
2
6
 
3
7
  export abstract class File {
4
8
  _contents = '';
@@ -12,7 +16,7 @@ export abstract class File {
12
16
  }
13
17
 
14
18
  addText(text: string, encodeHtml = true) {
15
- const textToAdd = encodeHtml ? encode(text) : text;
19
+ const textToAdd = encodeHtml ? xssFilter.process(text) : text;
16
20
  this._contents += textToAdd;
17
21
  this.addBlankLine();
18
22
  }
@@ -18,6 +18,12 @@ export class MarkdownFile extends File {
18
18
  this.addBlankLine();
19
19
  }
20
20
 
21
+ public addText(text: string, encodeHtml = true) {
22
+ text = MarkdownFile.replaceInlineLinks(text);
23
+ text = MarkdownFile.replaceInlineEmails(text);
24
+ super.addText(text, encodeHtml);
25
+ }
26
+
21
27
  startCodeBlock() {
22
28
  this._contents += '```';
23
29
  const sourceLanguage = 'apex';
@@ -86,4 +92,24 @@ export class MarkdownFile extends File {
86
92
  }
87
93
  return text;
88
94
  }
95
+
96
+ protected static replaceInlineEmails(text: string) {
97
+ // Parsing links using {@link ClassName} format
98
+ const linkFormatRegEx = '{@email (.*?)}';
99
+ const expression = new RegExp(linkFormatRegEx, 'gi');
100
+ let match;
101
+ const matches = [];
102
+
103
+ do {
104
+ match = expression.exec(text);
105
+ if (match) {
106
+ matches.push(match);
107
+ }
108
+ } while (match);
109
+
110
+ for (const currentMatch of matches) {
111
+ text = text.replace(currentMatch[0], `[${currentMatch[1]}](mailto:${currentMatch[1]})`);
112
+ }
113
+ return text;
114
+ }
89
115
  }
@@ -12,11 +12,6 @@ export class MarkdownHomeFile extends MarkdownFile {
12
12
  this.addTypeEntries(types);
13
13
  }
14
14
 
15
- public addText(text: string, encodeHtml = true) {
16
- text = MarkdownFile.replaceInlineLinks(text);
17
- super.addText(text, encodeHtml);
18
- }
19
-
20
15
  private addTypeEntries(types: Type[]) {
21
16
  const groupedClasses: Map<string, Type[]> = this.group(types);
22
17
  groupedClasses.forEach((value: Type[], key: string) => {
@@ -32,11 +32,6 @@ export class MarkdownTypeFile extends MarkdownFile implements WalkerListener {
32
32
  walker.walk(this);
33
33
  }
34
34
 
35
- public addText(text: string, encodeHtml = true) {
36
- text = MarkdownFile.replaceInlineLinks(text);
37
- super.addText(text, encodeHtml);
38
- }
39
-
40
35
  public onTypeDeclaration(typeMirror: Type): void {
41
36
  this.addTitle(typeMirror.name, this.headingLevel);
42
37
  declareType(this, typeMirror);
@@ -12,13 +12,13 @@ export class ApexFileReader {
12
12
  * Reads from .cls files and returns their raw body.
13
13
  */
14
14
  static processFiles(fileSystem: FileSystem, rootPath: string = this.sourceDirectory): ApexBundle[] {
15
- let bodies: ApexBundle[] = [];
15
+ let bundles: ApexBundle[] = [];
16
16
 
17
17
  const directoryContents = fileSystem.readDirectory(rootPath);
18
18
  directoryContents.forEach((currentFilePath) => {
19
19
  const currentPath = fileSystem.joinPath(rootPath, currentFilePath);
20
20
  if (this.readRecursively && fileSystem.isDirectory(currentPath)) {
21
- bodies = bodies.concat(this.processFiles(fileSystem, currentPath));
21
+ bundles = bundles.concat(this.processFiles(fileSystem, currentPath));
22
22
  }
23
23
 
24
24
  if (!this.isApexFile(currentFilePath)) {
@@ -28,9 +28,9 @@ export class ApexFileReader {
28
28
  const rawApexFile = fileSystem.readFile(currentPath);
29
29
  const metadataPath = fileSystem.joinPath(rootPath, `${currentFilePath}-meta.xml`);
30
30
  const rawMetadataFile = fileSystem.exists(metadataPath) ? fileSystem.readFile(metadataPath) : null;
31
- bodies.push(new ApexBundle(rawApexFile, rawMetadataFile));
31
+ bundles.push(new ApexBundle(currentFilePath, rawApexFile, rawMetadataFile));
32
32
  });
33
- return bodies;
33
+ return bundles;
34
34
  }
35
35
 
36
36
  private static isApexFile(currentFile: string): boolean {
@@ -1,12 +1,16 @@
1
1
  import Manifest from '../model/manifest';
2
2
  import { TypeParser } from './parser';
3
3
  import { ReflectionResult } from '@cparra/apex-reflection';
4
+ import ApexBundle from '../model/apex-bundle';
4
5
 
5
6
  /**
6
7
  * Builds a new Manifest object, sourcing its types from the received TypeParser.
7
8
  * @param typeParser In charge of returning the list of reflected types.
8
9
  * @param reflect Reflection function.
9
10
  */
10
- export function createManifest(typeParser: TypeParser, reflect: (typeBody: string) => ReflectionResult): Manifest {
11
+ export function createManifest(
12
+ typeParser: TypeParser,
13
+ reflect: (apexBundle: ApexBundle) => ReflectionResult,
14
+ ): Manifest {
11
15
  return new Manifest(typeParser.parse(reflect));
12
16
  }