@cparra/apexdocs 3.19.9-beta.6 → 3.19.9-beta.8
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 errorCollector = require('../error-collector-
|
|
4
|
+
var errorCollector = require('../error-collector-CgDY7vBU.js');
|
|
5
5
|
var cosmiconfig = require('cosmiconfig');
|
|
6
6
|
var yargs = require('yargs');
|
|
7
7
|
var E = require('fp-ts/Either');
|
|
@@ -589,27 +589,16 @@ function isDebugEnabledFromProcessArgs() {
|
|
|
589
589
|
const logger = new errorCollector.StdOutLogger();
|
|
590
590
|
logger.setDebug(isDebugEnabledFromProcessArgs());
|
|
591
591
|
function main() {
|
|
592
|
-
let commandsRun = 0;
|
|
593
592
|
function printFailuresAtEnd(collector, config) {
|
|
594
593
|
if (!collector.hasErrors()) {
|
|
595
594
|
return;
|
|
596
595
|
}
|
|
597
596
|
const count = collector.count();
|
|
598
|
-
logger.logSingle(
|
|
599
|
-
`\u26A0\uFE0F ${config.targetGenerator}: ${count} error item(s) occurred. Please review the following:`,
|
|
600
|
-
"red"
|
|
601
|
-
);
|
|
597
|
+
logger.logSingle(`\u26A0\uFE0F ${config.targetGenerator}: ${count} error(s) occurred. Please review the following:`, "red");
|
|
602
598
|
for (const item of collector.all()) {
|
|
603
599
|
logger.error(errorCollector.ErrorCollector.format(item));
|
|
604
600
|
}
|
|
605
601
|
}
|
|
606
|
-
function printDebugSummary(collector) {
|
|
607
|
-
if (!logger.isDebugEnabled()) {
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
|
-
logger.debug(`commandsRun=${commandsRun}`);
|
|
611
|
-
logger.debug(`aggregatedFailures=${collector.count()}`);
|
|
612
|
-
}
|
|
613
602
|
function catchUnexpectedError(error) {
|
|
614
603
|
logger.error(`\u274C An error occurred while processing the request: ${error}`);
|
|
615
604
|
process.exit(1);
|
|
@@ -622,7 +611,6 @@ function main() {
|
|
|
622
611
|
extractArgs().then((maybeConfigs) => __async(null, null, function* () {
|
|
623
612
|
E__namespace.match(catchUnexpectedError, (configs) => __async(null, null, function* () {
|
|
624
613
|
for (const config of configs) {
|
|
625
|
-
commandsRun++;
|
|
626
614
|
const errorCollector$1 = new errorCollector.ErrorCollector(config.targetGenerator);
|
|
627
615
|
const reflectionDebugLogger = errorCollector.createReflectionDebugLogger(logger, (filePath, errorMessage) => {
|
|
628
616
|
errorCollector$1.addFailure("other", filePath, errorMessage);
|
|
@@ -635,7 +623,6 @@ function main() {
|
|
|
635
623
|
reflectionDebugLogger,
|
|
636
624
|
errorCollector: errorCollector$1
|
|
637
625
|
});
|
|
638
|
-
printResultMessage(result);
|
|
639
626
|
if (logger.isDebugEnabled()) {
|
|
640
627
|
logger.logSingle(
|
|
641
628
|
`${config.targetGenerator}: ${E__namespace.isRight(result) ? "success" : "failure"}`,
|
|
@@ -643,10 +630,10 @@ function main() {
|
|
|
643
630
|
);
|
|
644
631
|
}
|
|
645
632
|
printFailuresAtEnd(errorCollector$1, config);
|
|
646
|
-
printDebugSummary(errorCollector$1);
|
|
647
633
|
if (errorCollector$1.hasErrors()) {
|
|
648
634
|
process.exitCode = 1;
|
|
649
635
|
}
|
|
636
|
+
printResultMessage(result);
|
|
650
637
|
}
|
|
651
638
|
}))(maybeConfigs);
|
|
652
639
|
})).catch(catchUnexpectedError);
|
|
@@ -5734,9 +5734,6 @@ function generateChangeLog(oldBundles, newBundles, config, debugLogger) {
|
|
|
5734
5734
|
})),
|
|
5735
5735
|
// Fail at the very end if we had any recoverable reflection errors,
|
|
5736
5736
|
// so the CLI can set an exit code after completing the work.
|
|
5737
|
-
//
|
|
5738
|
-
// We intentionally do NOT propagate individual error item details here.
|
|
5739
|
-
// Those are recorded via the per-generator ErrorCollector as they happen.
|
|
5740
5737
|
TE__namespace.flatMap(({ page, combinedReflectionErrors }) => {
|
|
5741
5738
|
if (combinedReflectionErrors.errors.length > 0) {
|
|
5742
5739
|
return TE__namespace.left(new ReflectionErrors([]));
|
|
@@ -6287,7 +6284,7 @@ function processMarkdown(config, logger, reflectionDebugLogger, errorCollector)
|
|
|
6287
6284
|
TE__namespace.map(() => "\u2714\uFE0F Documentation generated successfully!"),
|
|
6288
6285
|
TE__namespace.mapLeft((err) => {
|
|
6289
6286
|
if (logger.isDebugEnabled()) {
|
|
6290
|
-
logger.debug(`markdown generator finished with errors
|
|
6287
|
+
logger.debug(`markdown generator finished with errors`);
|
|
6291
6288
|
}
|
|
6292
6289
|
return toErrors(err);
|
|
6293
6290
|
})
|
|
@@ -6384,9 +6381,8 @@ function processChangeLog(config, logger, reflectionDebugLogger, errorCollector)
|
|
|
6384
6381
|
TE__namespace.fromEither,
|
|
6385
6382
|
TE__namespace.flatMap(([previous, current]) => generate(previous, current, config, reflectionDebugLogger)),
|
|
6386
6383
|
TE__namespace.mapLeft((err) => {
|
|
6387
|
-
errorCollector.addGlobalFailure("other", "Changelog generation completed with errors.", err);
|
|
6388
6384
|
if (logger.isDebugEnabled()) {
|
|
6389
|
-
logger.debug(`changelog generator finished with errors
|
|
6385
|
+
logger.debug(`changelog generator finished with errors`);
|
|
6390
6386
|
}
|
|
6391
6387
|
return toErrors(err);
|
|
6392
6388
|
})
|
|
@@ -6498,28 +6494,14 @@ var __spreadValues = (a, b) => {
|
|
|
6498
6494
|
class ErrorCollector {
|
|
6499
6495
|
constructor(generator) {
|
|
6500
6496
|
this.items = [];
|
|
6501
|
-
// Basic de-dupe to avoid double-recording the same failure if the same layer reports it twice.
|
|
6502
|
-
// Keyed by generator|stage|filePath|message.
|
|
6503
|
-
this.seen = /* @__PURE__ */ new Set();
|
|
6504
6497
|
this.generator = generator;
|
|
6505
6498
|
}
|
|
6506
6499
|
add(item) {
|
|
6507
|
-
var _a
|
|
6500
|
+
var _a;
|
|
6508
6501
|
const fullItem = __spreadValues({
|
|
6509
6502
|
generator: this.generator,
|
|
6510
6503
|
at: (_a = item.at) != null ? _a : (/* @__PURE__ */ new Date()).toISOString()
|
|
6511
6504
|
}, item);
|
|
6512
|
-
const key = [
|
|
6513
|
-
fullItem.generator,
|
|
6514
|
-
fullItem.stage,
|
|
6515
|
-
(_b = fullItem.filePath) != null ? _b : "",
|
|
6516
|
-
// Normalize whitespace a bit so trivial formatting differences don't explode the log.
|
|
6517
|
-
((_c = fullItem.message) != null ? _c : "").trim().replace(/\s+/g, " ")
|
|
6518
|
-
].join("|");
|
|
6519
|
-
if (this.seen.has(key)) {
|
|
6520
|
-
return;
|
|
6521
|
-
}
|
|
6522
|
-
this.seen.add(key);
|
|
6523
6505
|
this.items.push(fullItem);
|
|
6524
6506
|
}
|
|
6525
6507
|
addFailure(stage, filePath, message, raw) {
|
|
@@ -6540,7 +6522,6 @@ class ErrorCollector {
|
|
|
6540
6522
|
hasErrors() {
|
|
6541
6523
|
return this.items.length > 0;
|
|
6542
6524
|
}
|
|
6543
|
-
/** Count of collected error items (post de-duplication). */
|
|
6544
6525
|
count() {
|
|
6545
6526
|
return this.items.length;
|
|
6546
6527
|
}
|
|
@@ -6548,24 +6529,11 @@ class ErrorCollector {
|
|
|
6548
6529
|
return this.items;
|
|
6549
6530
|
}
|
|
6550
6531
|
/**
|
|
6551
|
-
*
|
|
6552
|
-
*/
|
|
6553
|
-
groupByFilePath() {
|
|
6554
|
-
return this.items.reduce((acc, item) => {
|
|
6555
|
-
var _a, _b;
|
|
6556
|
-
const key = (_a = item.filePath) != null ? _a : "__global__";
|
|
6557
|
-
acc[key] = (_b = acc[key]) != null ? _b : [];
|
|
6558
|
-
acc[key].push(item);
|
|
6559
|
-
return acc;
|
|
6560
|
-
}, {});
|
|
6561
|
-
}
|
|
6562
|
-
/**
|
|
6563
|
-
* A compact human-readable representation of the error item.
|
|
6564
|
-
* Useful for CLI output.
|
|
6532
|
+
* Human-readable representation of the error item.
|
|
6565
6533
|
*/
|
|
6566
6534
|
static format(item) {
|
|
6567
|
-
const location = item.filePath ? `${item.filePath}` : "
|
|
6568
|
-
return `[${item.generator}
|
|
6535
|
+
const location = item.filePath ? `${item.filePath}` : "";
|
|
6536
|
+
return `[${item.generator}] ${location}: ${item.message}`;
|
|
6569
6537
|
}
|
|
6570
6538
|
}
|
|
6571
6539
|
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cparra/apexdocs",
|
|
3
|
-
"version": "3.19.9-beta.
|
|
3
|
+
"version": "3.19.9-beta.8",
|
|
4
4
|
"description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
]
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@cparra/apex-reflection": "2.23.
|
|
99
|
+
"@cparra/apex-reflection": "2.23.10-dev.20260107145611",
|
|
100
100
|
"@salesforce/source-deploy-retrieve": "^12.20.1",
|
|
101
101
|
"@types/js-yaml": "^4.0.9",
|
|
102
102
|
"@types/yargs": "^17.0.32",
|