@cparra/apexdocs 3.19.9-beta.2 → 3.19.9-beta.4
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.
package/dist/cli/generate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var logger$1 = require('../logger-
|
|
4
|
+
var logger$1 = require('../logger-Bm8lUpMI.js');
|
|
5
5
|
var cosmiconfig = require('cosmiconfig');
|
|
6
6
|
var yargs = require('yargs');
|
|
7
7
|
var E = require('fp-ts/Either');
|
|
@@ -591,21 +591,34 @@ logger.setDebug(isDebugEnabledFromProcessArgs());
|
|
|
591
591
|
const reflectionDebugLogger = logger$1.createReflectionDebugLogger(logger);
|
|
592
592
|
function main() {
|
|
593
593
|
const aggregatedFailures = [];
|
|
594
|
+
let aggregatedFailureCount = 0;
|
|
594
595
|
let commandsRun = 0;
|
|
595
596
|
function printDebugSummary() {
|
|
596
597
|
if (!logger.isDebugEnabled()) {
|
|
597
598
|
return;
|
|
598
599
|
}
|
|
599
600
|
logger.debug(`commandsRun=${commandsRun}`);
|
|
600
|
-
logger.debug(`aggregatedFailures=${
|
|
601
|
+
logger.debug(`aggregatedFailures=${aggregatedFailureCount}`);
|
|
602
|
+
}
|
|
603
|
+
function failureToErrorItems(failure) {
|
|
604
|
+
const maybeFailureWithErrors = failure;
|
|
605
|
+
if (maybeFailureWithErrors && Array.isArray(maybeFailureWithErrors.errors)) {
|
|
606
|
+
return maybeFailureWithErrors.errors;
|
|
607
|
+
}
|
|
608
|
+
if (Array.isArray(failure)) {
|
|
609
|
+
return failure;
|
|
610
|
+
}
|
|
611
|
+
return [failure];
|
|
601
612
|
}
|
|
602
613
|
function printFailuresAtEnd() {
|
|
603
614
|
if (aggregatedFailures.length === 0) {
|
|
604
615
|
return;
|
|
605
616
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
617
|
+
const flattened = aggregatedFailures.flatMap(failureToErrorItems);
|
|
618
|
+
const count = flattened.length;
|
|
619
|
+
logger.logSingle(`\u26A0\uFE0F ${count} error item(s) occurred. Please review the following issues:`, "red");
|
|
620
|
+
for (const item of flattened) {
|
|
621
|
+
logger.error(item);
|
|
609
622
|
}
|
|
610
623
|
}
|
|
611
624
|
function parseResult(result, config) {
|
|
@@ -613,6 +626,7 @@ function main() {
|
|
|
613
626
|
(failure) => {
|
|
614
627
|
logger.logSingle(`${config.targetGenerator}: completed with errors`, "red");
|
|
615
628
|
aggregatedFailures.push(failure);
|
|
629
|
+
aggregatedFailureCount += failureToErrorItems(failure).length;
|
|
616
630
|
},
|
|
617
631
|
(successMessage) => {
|
|
618
632
|
logger.logSingle(successMessage);
|
package/dist/index.js
CHANGED
|
@@ -3641,34 +3641,40 @@ function generateDocs(unparsedBundles, config, debugLogger) {
|
|
|
3641
3641
|
}
|
|
3642
3642
|
return _function.pipe(
|
|
3643
3643
|
TE__namespace.right(replaceMacros(unparsedBundles, config.macros)),
|
|
3644
|
-
TE__namespace.
|
|
3645
|
-
TE__namespace.
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
)
|
|
3660
|
-
|
|
3661
|
-
TE__namespace.
|
|
3644
|
+
TE__namespace.bindW("unparsedBundles", (unparsedBundles2) => TE__namespace.right(unparsedBundles2)),
|
|
3645
|
+
TE__namespace.bindW(
|
|
3646
|
+
"apex",
|
|
3647
|
+
({ unparsedBundles: unparsedBundles2 }) => generateForApex(filterApexSourceFiles(unparsedBundles2), config, debugLogger)
|
|
3648
|
+
),
|
|
3649
|
+
TE__namespace.bindW(
|
|
3650
|
+
"objects",
|
|
3651
|
+
({ unparsedBundles: unparsedBundles2 }) => reflectCustomFieldsAndObjectsAndMetadataRecords(
|
|
3652
|
+
filterCustomObjectsFieldsAndMetadataRecords(unparsedBundles2),
|
|
3653
|
+
config.customObjectVisibility,
|
|
3654
|
+
debugLogger
|
|
3655
|
+
)
|
|
3656
|
+
),
|
|
3657
|
+
TE__namespace.bindW(
|
|
3658
|
+
"triggers",
|
|
3659
|
+
({ unparsedBundles: unparsedBundles2 }) => reflectTriggerSource(filterTriggerFiles(unparsedBundles2), debugLogger)
|
|
3660
|
+
),
|
|
3661
|
+
TE__namespace.bindW("lwcs", ({ unparsedBundles: unparsedBundles2 }) => {
|
|
3662
3662
|
if (!config.experimentalLwcSupport) {
|
|
3663
|
-
return TE__namespace.right(
|
|
3663
|
+
return TE__namespace.right([]);
|
|
3664
3664
|
}
|
|
3665
3665
|
return _function.pipe(
|
|
3666
|
-
reflectLwcSource(filterLwcFiles(
|
|
3667
|
-
TE__namespace.map((
|
|
3668
|
-
TE__namespace.map((parsedLwcFiles) => [...parsedFiles, ...parsedLwcFiles])
|
|
3666
|
+
reflectLwcSource(filterLwcFiles(unparsedBundles2), debugLogger),
|
|
3667
|
+
TE__namespace.map((files) => files.filter((file) => file.type.isExposed))
|
|
3669
3668
|
);
|
|
3670
3669
|
}),
|
|
3671
|
-
TE__namespace.
|
|
3670
|
+
TE__namespace.flatMap(({ apex, objects, triggers, lwcs }) => {
|
|
3671
|
+
const allParsed = [...apex.parsed, ...objects, ...triggers, ...lwcs];
|
|
3672
|
+
const sorted = sort(filterOutCustomFieldsAndMetadata(allParsed));
|
|
3673
|
+
if (apex.reflectionErrors.errors.length > 0) {
|
|
3674
|
+
return TE__namespace.left(apex.reflectionErrors);
|
|
3675
|
+
}
|
|
3676
|
+
return TE__namespace.right(sorted);
|
|
3677
|
+
}),
|
|
3672
3678
|
TE__namespace.bindTo("parsedFiles"),
|
|
3673
3679
|
TE__namespace.bind(
|
|
3674
3680
|
"references",
|
|
@@ -3728,12 +3734,10 @@ function generateForApex(apexBundles, config, debugLogger) {
|
|
|
3728
3734
|
);
|
|
3729
3735
|
return _function.pipe(
|
|
3730
3736
|
filtered,
|
|
3731
|
-
TE__namespace.
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
return TE__namespace.right(parsed);
|
|
3736
|
-
})
|
|
3737
|
+
TE__namespace.map((parsed) => ({
|
|
3738
|
+
parsed,
|
|
3739
|
+
reflectionErrors: errors
|
|
3740
|
+
}))
|
|
3737
3741
|
);
|
|
3738
3742
|
})
|
|
3739
3743
|
);
|