@cparra/apexdocs 3.0.0-alpha.5 → 3.0.0-alpha.6

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.
@@ -1526,7 +1526,7 @@ var __spreadValues$7 = (a, b) => {
1526
1526
  return a;
1527
1527
  };
1528
1528
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1529
- var __async$2 = (__this, __arguments, generator) => {
1529
+ var __async$3 = (__this, __arguments, generator) => {
1530
1530
  return new Promise((resolve, reject) => {
1531
1531
  var fulfilled = (value) => {
1532
1532
  try {
@@ -1578,7 +1578,7 @@ function generateDocs(apexBundles, config) {
1578
1578
  }
1579
1579
  function transformReferenceHook(config) {
1580
1580
  function _execute(references, parsedFiles, transformReference) {
1581
- return __async$2(this, null, function* () {
1581
+ return __async$3(this, null, function* () {
1582
1582
  return {
1583
1583
  references: yield execTransformReferenceHook(Object.values(references), transformReference),
1584
1584
  parsedFiles
@@ -1599,8 +1599,8 @@ function transformDocumentationBundleHook(config) {
1599
1599
  function passThroughHook(value) {
1600
1600
  return value;
1601
1601
  }
1602
- const execTransformReferenceHook = (_0, ..._1) => __async$2(void 0, [_0, ..._1], function* (references, hook = passThroughHook) {
1603
- const hooked = references.map((reference) => __async$2(void 0, null, function* () {
1602
+ const execTransformReferenceHook = (_0, ..._1) => __async$3(void 0, [_0, ..._1], function* (references, hook = passThroughHook) {
1603
+ const hooked = references.map((reference) => __async$3(void 0, null, function* () {
1604
1604
  const hookedResult = yield hook(reference);
1605
1605
  return __spreadValues$7(__spreadValues$7({}, reference), hookedResult);
1606
1606
  }));
@@ -1610,24 +1610,24 @@ const execTransformReferenceHook = (_0, ..._1) => __async$2(void 0, [_0, ..._1],
1610
1610
  return acc;
1611
1611
  }, {});
1612
1612
  });
1613
- const documentationBundleHook = (bundle, config) => __async$2(void 0, null, function* () {
1613
+ const documentationBundleHook = (bundle, config) => __async$3(void 0, null, function* () {
1614
1614
  return {
1615
1615
  referenceGuide: yield transformReferenceGuide(bundle.referenceGuide, config.transformReferenceGuide),
1616
1616
  docs: yield transformDocs(bundle.docs, config.transformDocs, config.transformDocPage)
1617
1617
  };
1618
1618
  });
1619
- const transformReferenceGuide = (_0, ..._1) => __async$2(void 0, [_0, ..._1], function* (referenceGuide, hook = passThroughHook) {
1619
+ const transformReferenceGuide = (_0, ..._1) => __async$3(void 0, [_0, ..._1], function* (referenceGuide, hook = passThroughHook) {
1620
1620
  const result = yield hook(referenceGuide);
1621
1621
  if (isSkip(result)) {
1622
1622
  return result;
1623
1623
  }
1624
1624
  return __spreadValues$7(__spreadValues$7({}, referenceGuide), yield hook(referenceGuide));
1625
1625
  });
1626
- const transformDocs = (_0, ..._1) => __async$2(void 0, [_0, ..._1], function* (docs, transformDocsHook = passThroughHook, transformDocPageHook = passThroughHook) {
1626
+ const transformDocs = (_0, ..._1) => __async$3(void 0, [_0, ..._1], function* (docs, transformDocsHook = passThroughHook, transformDocPageHook = passThroughHook) {
1627
1627
  const transformed = yield transformDocsHook(docs);
1628
1628
  return Promise.all(transformed.map((doc) => transformDocPage(doc, transformDocPageHook)));
1629
1629
  });
1630
- const transformDocPage = (_0, ..._1) => __async$2(void 0, [_0, ..._1], function* (doc, hook = passThroughHook) {
1630
+ const transformDocPage = (_0, ..._1) => __async$3(void 0, [_0, ..._1], function* (doc, hook = passThroughHook) {
1631
1631
  return __spreadValues$7(__spreadValues$7({}, doc), yield hook(doc));
1632
1632
  });
1633
1633
  function postHookCompile(bundle) {
@@ -1734,6 +1734,7 @@ class Logger {
1734
1734
  static getChalkFn(color) {
1735
1735
  return color === "green" ? chalk.green : chalk.red;
1736
1736
  }
1737
+ // TODO: This isn't really working and I don't think its worth it. Let's just completely remove the ora dependency.
1737
1738
  static startSpinner(text) {
1738
1739
  this.spinner.text = text;
1739
1740
  this.spinner.start();
@@ -1779,23 +1780,45 @@ var __spreadValues$5 = (a, b) => {
1779
1780
  return a;
1780
1781
  };
1781
1782
  var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1782
- function generate(bundles, config) {
1783
- return _function.pipe(
1784
- generateDocumentationBundle(bundles, config),
1785
- TE__namespace.map((files) => writeFilesToSystem(files, config.targetDir)),
1786
- TE__namespace.mapLeft((error) => {
1787
- if (error._tag === "HookError") {
1788
- Logger.error("Error(s) occurred while processing hooks. Please review the following issues:");
1789
- Logger.error(error.error);
1790
- return;
1783
+ var __async$2 = (__this, __arguments, generator) => {
1784
+ return new Promise((resolve, reject) => {
1785
+ var fulfilled = (value) => {
1786
+ try {
1787
+ step(generator.next(value));
1788
+ } catch (e) {
1789
+ reject(e);
1791
1790
  }
1792
- const errorMessages = [
1793
- "Error(s) occurred while parsing files. Please review the following issues:",
1794
- ...error.errors.map(formatReflectionError)
1795
- ].join("\n");
1796
- Logger.error(errorMessages);
1797
- })
1798
- )();
1791
+ };
1792
+ var rejected = (value) => {
1793
+ try {
1794
+ step(generator.throw(value));
1795
+ } catch (e) {
1796
+ reject(e);
1797
+ }
1798
+ };
1799
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1800
+ step((generator = generator.apply(__this, __arguments)).next());
1801
+ });
1802
+ };
1803
+ function generate(bundles, config) {
1804
+ return __async$2(this, null, function* () {
1805
+ return _function.pipe(
1806
+ generateDocumentationBundle(bundles, config),
1807
+ TE__namespace.map((files) => writeFilesToSystem(files, config.targetDir)),
1808
+ TE__namespace.mapLeft((error) => {
1809
+ if (error._tag === "HookError") {
1810
+ Logger.error("Error(s) occurred while processing hooks. Please review the following issues:");
1811
+ Logger.error(error.error);
1812
+ return;
1813
+ }
1814
+ const errorMessages = [
1815
+ "Error(s) occurred while parsing files. Please review the following issues:",
1816
+ ...error.errors.map(formatReflectionError)
1817
+ ].join("\n");
1818
+ Logger.error(errorMessages);
1819
+ })
1820
+ )();
1821
+ });
1799
1822
  }
1800
1823
  function generateDocumentationBundle(bundles, config) {
1801
1824
  return generateDocs(bundles, __spreadProps$5(__spreadValues$5({}, config), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cparra/apexdocs",
3
- "version": "3.0.0-alpha.5",
3
+ "version": "3.0.0-alpha.6",
4
4
  "description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
5
5
  "keywords": [
6
6
  "apex",
@@ -13,7 +13,7 @@ import { referenceGuideTemplate } from '../../core/markdown/templates/reference-
13
13
  import * as TE from 'fp-ts/TaskEither';
14
14
  import { isSkip } from '../../core/shared/utils';
15
15
 
16
- export default function generate(bundles: UnparsedSourceFile[], config: UserDefinedMarkdownConfig) {
16
+ export default async function generate(bundles: UnparsedSourceFile[], config: UserDefinedMarkdownConfig) {
17
17
  return pipe(
18
18
  generateDocumentationBundle(bundles, config),
19
19
  TE.map((files) => writeFilesToSystem(files, config.targetDir)),
@@ -44,6 +44,8 @@ export class Logger {
44
44
  return color === 'green' ? chalk.green : chalk.red;
45
45
  }
46
46
 
47
+ // TODO: This isn't really working and I don't think its worth it. Let's just completely remove the ora dependency.
48
+
47
49
  public static startSpinner(text: string) {
48
50
  this.spinner.text = text;
49
51
  this.spinner.start();