@cparra/apexdocs 3.19.8 → 3.19.9-beta.10
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 +61 -70
- package/dist/{logger-BA26xTtD.js → error-collector-hp1dlub7.js} +299 -147
- package/dist/index.js +23 -12
- package/package.json +2 -2
package/dist/cli/generate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var errorCollector = require('../error-collector-hp1dlub7.js');
|
|
5
5
|
var cosmiconfig = require('cosmiconfig');
|
|
6
6
|
var yargs = require('yargs');
|
|
7
7
|
var E = require('fp-ts/Either');
|
|
@@ -79,42 +79,42 @@ const markdownOptions = {
|
|
|
79
79
|
targetDir: {
|
|
80
80
|
type: "string",
|
|
81
81
|
alias: "t",
|
|
82
|
-
default:
|
|
82
|
+
default: errorCollector.markdownDefaults.targetDir,
|
|
83
83
|
describe: "The directory location where documentation will be generated to."
|
|
84
84
|
},
|
|
85
85
|
scope: {
|
|
86
86
|
type: "string",
|
|
87
87
|
array: true,
|
|
88
88
|
alias: "p",
|
|
89
|
-
default:
|
|
89
|
+
default: errorCollector.markdownDefaults.scope,
|
|
90
90
|
describe: "A list of scopes to document. Values should be separated by a space, e.g --scope global public namespaceaccessible. Annotations are supported and should be passed lowercased and without the @ symbol, e.g. namespaceaccessible auraenabled."
|
|
91
91
|
},
|
|
92
92
|
customObjectVisibility: {
|
|
93
93
|
type: "string",
|
|
94
94
|
array: true,
|
|
95
95
|
alias: "v",
|
|
96
|
-
default:
|
|
96
|
+
default: errorCollector.markdownDefaults.customObjectVisibility,
|
|
97
97
|
choices: ["public", "protected", "packageprotected"],
|
|
98
98
|
describe: "Controls which custom objects are documented. Values should be separated by a space."
|
|
99
99
|
},
|
|
100
100
|
defaultGroupName: {
|
|
101
101
|
type: "string",
|
|
102
|
-
default:
|
|
102
|
+
default: errorCollector.markdownDefaults.defaultGroupName,
|
|
103
103
|
describe: "Defines the @group name to be used when a file does not specify it."
|
|
104
104
|
},
|
|
105
105
|
customObjectsGroupName: {
|
|
106
106
|
type: "string",
|
|
107
|
-
default:
|
|
107
|
+
default: errorCollector.markdownDefaults.customObjectsGroupName,
|
|
108
108
|
describe: "The name under which custom objects will be grouped in the Reference Guide"
|
|
109
109
|
},
|
|
110
110
|
triggersGroupName: {
|
|
111
111
|
type: "string",
|
|
112
|
-
default:
|
|
112
|
+
default: errorCollector.markdownDefaults.triggersGroupName,
|
|
113
113
|
describe: "The name under which triggers will be grouped in the Reference Guide"
|
|
114
114
|
},
|
|
115
115
|
lwcGroupName: {
|
|
116
116
|
type: "string",
|
|
117
|
-
default:
|
|
117
|
+
default: errorCollector.markdownDefaults.lwcGroupName,
|
|
118
118
|
describe: "The name under which Lightning Web Components will be grouped in the Reference Guide"
|
|
119
119
|
},
|
|
120
120
|
namespace: {
|
|
@@ -124,28 +124,28 @@ const markdownOptions = {
|
|
|
124
124
|
sortAlphabetically: {
|
|
125
125
|
type: "boolean",
|
|
126
126
|
describe: "Whether to sort files and members alphabetically.",
|
|
127
|
-
default:
|
|
127
|
+
default: errorCollector.markdownDefaults.sortAlphabetically
|
|
128
128
|
},
|
|
129
129
|
includeMetadata: {
|
|
130
130
|
type: "boolean",
|
|
131
131
|
describe: "Whether to include the file's meta.xml information: Whether it is active and and the API version",
|
|
132
|
-
default:
|
|
132
|
+
default: errorCollector.markdownDefaults.includeMetadata
|
|
133
133
|
},
|
|
134
134
|
linkingStrategy: {
|
|
135
135
|
type: "string",
|
|
136
136
|
describe: "The strategy to use when linking to other documentation pages.",
|
|
137
137
|
choices: ["relative", "no-link", "none"],
|
|
138
|
-
default:
|
|
138
|
+
default: errorCollector.markdownDefaults.linkingStrategy
|
|
139
139
|
},
|
|
140
140
|
referenceGuideTitle: {
|
|
141
141
|
type: "string",
|
|
142
142
|
describe: "The title of the reference guide.",
|
|
143
|
-
default:
|
|
143
|
+
default: errorCollector.markdownDefaults.referenceGuideTitle
|
|
144
144
|
},
|
|
145
145
|
includeFieldSecurityMetadata: {
|
|
146
146
|
type: "boolean",
|
|
147
147
|
describe: "Whether to include the compliance category and security classification for fields in the generated files.",
|
|
148
|
-
default:
|
|
148
|
+
default: errorCollector.markdownDefaults.includeFieldSecurityMetadata
|
|
149
149
|
},
|
|
150
150
|
includeInlineHelpTextMetadata: {
|
|
151
151
|
type: "boolean",
|
|
@@ -154,17 +154,17 @@ const markdownOptions = {
|
|
|
154
154
|
experimentalLwcSupport: {
|
|
155
155
|
type: "boolean",
|
|
156
156
|
describe: "Enable experimental support for documenting Lightning Web Components (LWC).",
|
|
157
|
-
default:
|
|
157
|
+
default: errorCollector.markdownDefaults.experimentalLwcSupport
|
|
158
158
|
},
|
|
159
159
|
parallelReflection: {
|
|
160
160
|
type: "boolean",
|
|
161
161
|
describe: "Parallelize CPU-heavy reflection via worker threads.",
|
|
162
|
-
default:
|
|
162
|
+
default: errorCollector.markdownDefaults.parallelReflection
|
|
163
163
|
},
|
|
164
164
|
parallelReflectionMaxWorkers: {
|
|
165
165
|
type: "number",
|
|
166
166
|
describe: "Maximum number of worker threads to use for parallel reflection. Defaults to a reasonable value based on CPU count.",
|
|
167
|
-
default:
|
|
167
|
+
default: errorCollector.markdownDefaults.parallelReflectionMaxWorkers
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
|
|
@@ -200,12 +200,12 @@ const openApiOptions = {
|
|
|
200
200
|
targetDir: {
|
|
201
201
|
type: "string",
|
|
202
202
|
alias: "t",
|
|
203
|
-
default:
|
|
203
|
+
default: errorCollector.openApiDefaults.targetDir,
|
|
204
204
|
describe: "The directory location where the OpenApi file will be generated."
|
|
205
205
|
},
|
|
206
206
|
fileName: {
|
|
207
207
|
type: "string",
|
|
208
|
-
default:
|
|
208
|
+
default: errorCollector.openApiDefaults.fileName,
|
|
209
209
|
describe: "The name of the OpenApi file to be generated."
|
|
210
210
|
},
|
|
211
211
|
namespace: {
|
|
@@ -214,23 +214,23 @@ const openApiOptions = {
|
|
|
214
214
|
},
|
|
215
215
|
title: {
|
|
216
216
|
type: "string",
|
|
217
|
-
default:
|
|
217
|
+
default: errorCollector.openApiDefaults.title,
|
|
218
218
|
describe: "The title of the OpenApi file."
|
|
219
219
|
},
|
|
220
220
|
apiVersion: {
|
|
221
221
|
type: "string",
|
|
222
|
-
default:
|
|
222
|
+
default: errorCollector.openApiDefaults.apiVersion,
|
|
223
223
|
describe: "The version of the OpenApi file."
|
|
224
224
|
},
|
|
225
225
|
parallelReflection: {
|
|
226
226
|
type: "boolean",
|
|
227
227
|
describe: "Parallelize CPU-heavy reflection via worker threads.",
|
|
228
|
-
default:
|
|
228
|
+
default: errorCollector.openApiDefaults.parallelReflection
|
|
229
229
|
},
|
|
230
230
|
parallelReflectionMaxWorkers: {
|
|
231
231
|
type: "number",
|
|
232
232
|
describe: "Maximum number of worker threads to use for parallel reflection. Defaults to a reasonable value based on CPU count.",
|
|
233
|
-
default:
|
|
233
|
+
default: errorCollector.openApiDefaults.parallelReflectionMaxWorkers
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
|
|
@@ -249,12 +249,12 @@ const changeLogOptions = {
|
|
|
249
249
|
parallelReflection: {
|
|
250
250
|
type: "boolean",
|
|
251
251
|
describe: "Parallelize CPU-heavy reflection via worker threads.",
|
|
252
|
-
default:
|
|
252
|
+
default: errorCollector.markdownDefaults.parallelReflection
|
|
253
253
|
},
|
|
254
254
|
parallelReflectionMaxWorkers: {
|
|
255
255
|
type: "number",
|
|
256
256
|
describe: "Maximum number of worker threads to use for parallel reflection. Defaults to a reasonable value based on CPU count.",
|
|
257
|
-
default:
|
|
257
|
+
default: errorCollector.markdownDefaults.parallelReflectionMaxWorkers
|
|
258
258
|
},
|
|
259
259
|
previousVersionDir: {
|
|
260
260
|
type: "string",
|
|
@@ -273,32 +273,32 @@ const changeLogOptions = {
|
|
|
273
273
|
targetDir: {
|
|
274
274
|
type: "string",
|
|
275
275
|
alias: "t",
|
|
276
|
-
default:
|
|
276
|
+
default: errorCollector.changeLogDefaults.targetDir,
|
|
277
277
|
describe: "The directory location where the changelog file will be generated."
|
|
278
278
|
},
|
|
279
279
|
fileName: {
|
|
280
280
|
type: "string",
|
|
281
|
-
default:
|
|
281
|
+
default: errorCollector.changeLogDefaults.fileName,
|
|
282
282
|
describe: "The name of the changelog file to be generated."
|
|
283
283
|
},
|
|
284
284
|
scope: {
|
|
285
285
|
type: "string",
|
|
286
286
|
array: true,
|
|
287
287
|
alias: "s",
|
|
288
|
-
default:
|
|
288
|
+
default: errorCollector.changeLogDefaults.scope,
|
|
289
289
|
describe: "The list of scope to respect when generating the changelog. Values should be separated by a space, e.g --scope global public namespaceaccessible. Annotations are supported and should be passed lowercased and without the @ symbol, e.g. namespaceaccessible auraenabled."
|
|
290
290
|
},
|
|
291
291
|
customObjectVisibility: {
|
|
292
292
|
type: "string",
|
|
293
293
|
array: true,
|
|
294
294
|
alias: "v",
|
|
295
|
-
default:
|
|
295
|
+
default: errorCollector.changeLogDefaults.customObjectVisibility,
|
|
296
296
|
choices: ["public", "protected", "packageprotected"],
|
|
297
297
|
describe: "Controls which custom objects are documented. Values should be separated by a space."
|
|
298
298
|
},
|
|
299
299
|
skipIfNoChanges: {
|
|
300
300
|
type: "boolean",
|
|
301
|
-
default:
|
|
301
|
+
default: errorCollector.changeLogDefaults.skipIfNoChanges,
|
|
302
302
|
describe: "Skip the changelog generation if there are no changes between the previous and current version."
|
|
303
303
|
}
|
|
304
304
|
};
|
|
@@ -406,13 +406,13 @@ function extractArgsForCommandProvidedThroughCli(extractFromProcessFn, config) {
|
|
|
406
406
|
switch (mergedConfig.targetGenerator) {
|
|
407
407
|
case "markdown":
|
|
408
408
|
return _function.pipe(
|
|
409
|
-
|
|
409
|
+
errorCollector.validateSourceDirectoryConfig(extractSourceDirectoryConfig(mergedConfig)),
|
|
410
410
|
E__namespace.mapLeft((error) => new Error(`Invalid markdown configuration: ${error.message}`)),
|
|
411
411
|
E__namespace.map(() => __spreadValues(__spreadValues({}, configOnlyMarkdownDefaults), mergedConfig))
|
|
412
412
|
);
|
|
413
413
|
case "openapi":
|
|
414
414
|
return _function.pipe(
|
|
415
|
-
|
|
415
|
+
errorCollector.validateSourceDirectoryConfig(extractSourceDirectoryConfig(mergedConfig)),
|
|
416
416
|
E__namespace.mapLeft((error) => new Error(`Invalid openapi configuration: ${error.message}`)),
|
|
417
417
|
E__namespace.map(() => __spreadValues(__spreadValues({}, configOnlyOpenApiDefaults), mergedConfig))
|
|
418
418
|
);
|
|
@@ -440,7 +440,7 @@ function extractArgsForCommandsProvidedInConfig(extractFromProcessFn, config) {
|
|
|
440
440
|
E__namespace.flatMap((cliArgs) => {
|
|
441
441
|
const mergedConfig = __spreadValues(__spreadValues(__spreadValues({}, configOnlyMarkdownDefaults), generatorConfig), cliArgs);
|
|
442
442
|
return _function.pipe(
|
|
443
|
-
|
|
443
|
+
errorCollector.validateSourceDirectoryConfig(extractSourceDirectoryConfig(mergedConfig)),
|
|
444
444
|
E__namespace.mapLeft((error) => new Error(`Invalid markdown configuration: ${error.message}`)),
|
|
445
445
|
E__namespace.map(() => mergedConfig)
|
|
446
446
|
);
|
|
@@ -452,7 +452,7 @@ function extractArgsForCommandsProvidedInConfig(extractFromProcessFn, config) {
|
|
|
452
452
|
E__namespace.flatMap((cliArgs) => {
|
|
453
453
|
const mergedConfig = __spreadValues(__spreadValues(__spreadValues({}, configOnlyOpenApiDefaults), generatorConfig), cliArgs);
|
|
454
454
|
return _function.pipe(
|
|
455
|
-
|
|
455
|
+
errorCollector.validateSourceDirectoryConfig(extractSourceDirectoryConfig(mergedConfig)),
|
|
456
456
|
E__namespace.mapLeft((error) => new Error(`Invalid openapi configuration: ${error.message}`)),
|
|
457
457
|
E__namespace.map(() => mergedConfig)
|
|
458
458
|
);
|
|
@@ -557,8 +557,8 @@ function validateChangelogConfig(config) {
|
|
|
557
557
|
};
|
|
558
558
|
return _function.pipe(
|
|
559
559
|
E__namespace.Do,
|
|
560
|
-
E__namespace.bind("previousValid", () =>
|
|
561
|
-
E__namespace.bind("currentValid", () =>
|
|
560
|
+
E__namespace.bind("previousValid", () => errorCollector.validateSourceDirectoryConfig(previousVersionConfig)),
|
|
561
|
+
E__namespace.bind("currentValid", () => errorCollector.validateSourceDirectoryConfig(currentVersionConfig)),
|
|
562
562
|
E__namespace.map(() => config)
|
|
563
563
|
);
|
|
564
564
|
}
|
|
@@ -586,63 +586,54 @@ var __async = (__this, __arguments, generator) => {
|
|
|
586
586
|
function isDebugEnabledFromProcessArgs() {
|
|
587
587
|
return process.argv.includes("--debug");
|
|
588
588
|
}
|
|
589
|
-
const logger = new
|
|
589
|
+
const logger = new errorCollector.StdOutLogger();
|
|
590
590
|
logger.setDebug(isDebugEnabledFromProcessArgs());
|
|
591
|
-
const reflectionDebugLogger = logger$1.createReflectionDebugLogger(logger);
|
|
592
591
|
function main() {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
function printDebugSummary() {
|
|
596
|
-
if (!logger.isDebugEnabled()) {
|
|
592
|
+
function printFailuresAtEnd(collector, config) {
|
|
593
|
+
if (!collector.hasErrors()) {
|
|
597
594
|
return;
|
|
598
595
|
}
|
|
599
|
-
|
|
600
|
-
logger.
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
if (aggregatedFailures.length === 0) {
|
|
604
|
-
return;
|
|
605
|
-
}
|
|
606
|
-
logger.logSingle("\u26A0\uFE0F Some operations completed with errors. Please review the following issues:", "red");
|
|
607
|
-
for (const failure of aggregatedFailures) {
|
|
608
|
-
logger.error(failure);
|
|
596
|
+
const count = collector.count();
|
|
597
|
+
logger.logSingle(`\u26A0\uFE0F ${config.targetGenerator}: ${count} error(s) occurred. Please review the following:`, "red");
|
|
598
|
+
for (const item of collector.all()) {
|
|
599
|
+
logger.error(errorCollector.ErrorCollector.format(item));
|
|
609
600
|
}
|
|
610
601
|
}
|
|
611
|
-
function parseResult(result, config) {
|
|
612
|
-
E__namespace.match(
|
|
613
|
-
(failure) => {
|
|
614
|
-
logger.logSingle(`${config.targetGenerator}: completed with errors`, "red");
|
|
615
|
-
aggregatedFailures.push(failure);
|
|
616
|
-
},
|
|
617
|
-
(successMessage) => {
|
|
618
|
-
logger.logSingle(successMessage);
|
|
619
|
-
}
|
|
620
|
-
)(result);
|
|
621
|
-
}
|
|
622
602
|
function catchUnexpectedError(error) {
|
|
623
603
|
logger.error(`\u274C An error occurred while processing the request: ${error}`);
|
|
624
604
|
process.exit(1);
|
|
625
605
|
}
|
|
606
|
+
function printResultMessage(result) {
|
|
607
|
+
if (E__namespace.isRight(result)) {
|
|
608
|
+
logger.logSingle("Documentation generated successfully");
|
|
609
|
+
}
|
|
610
|
+
}
|
|
626
611
|
extractArgs().then((maybeConfigs) => __async(null, null, function* () {
|
|
627
612
|
E__namespace.match(catchUnexpectedError, (configs) => __async(null, null, function* () {
|
|
628
613
|
for (const config of configs) {
|
|
629
|
-
|
|
614
|
+
const errorCollector$1 = new errorCollector.ErrorCollector(config.targetGenerator);
|
|
615
|
+
const reflectionDebugLogger = errorCollector.createReflectionDebugLogger(logger, (filePath, errorMessage) => {
|
|
616
|
+
errorCollector$1.addFailure("other", filePath, errorMessage);
|
|
617
|
+
});
|
|
630
618
|
if (logger.isDebugEnabled()) {
|
|
631
619
|
logger.debug(`Currently processing generator: ${config.targetGenerator}`);
|
|
632
620
|
}
|
|
633
|
-
const result = yield
|
|
621
|
+
const result = yield errorCollector.Apexdocs.generate(config, {
|
|
622
|
+
logger,
|
|
623
|
+
reflectionDebugLogger,
|
|
624
|
+
errorCollector: errorCollector$1
|
|
625
|
+
});
|
|
634
626
|
if (logger.isDebugEnabled()) {
|
|
635
627
|
logger.logSingle(
|
|
636
628
|
`${config.targetGenerator}: ${E__namespace.isRight(result) ? "success" : "failure"}`,
|
|
637
629
|
E__namespace.isRight(result) ? "green" : "red"
|
|
638
630
|
);
|
|
639
631
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
process.exitCode = 1;
|
|
632
|
+
printFailuresAtEnd(errorCollector$1, config);
|
|
633
|
+
if (errorCollector$1.hasErrors()) {
|
|
634
|
+
process.exitCode = 1;
|
|
635
|
+
}
|
|
636
|
+
printResultMessage(result);
|
|
646
637
|
}
|
|
647
638
|
}))(maybeConfigs);
|
|
648
639
|
})).catch(catchUnexpectedError);
|
|
@@ -2995,14 +2995,18 @@ var __spreadValues$f = (a, b) => {
|
|
|
2995
2995
|
return a;
|
|
2996
2996
|
};
|
|
2997
2997
|
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
2998
|
-
function reflectCustomObjectSources(objectBundles) {
|
|
2998
|
+
function reflectCustomObjectSources(objectBundles, debugLogger = noopReflectionDebugLogger) {
|
|
2999
2999
|
const semiGroupReflectionError = {
|
|
3000
3000
|
concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
|
|
3001
3001
|
};
|
|
3002
3002
|
const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
|
|
3003
|
-
return _function.pipe(
|
|
3003
|
+
return _function.pipe(
|
|
3004
|
+
objectBundles,
|
|
3005
|
+
A__namespace$1.traverse(Ap)((bundle) => reflectCustomObjectSource(bundle, debugLogger))
|
|
3006
|
+
);
|
|
3004
3007
|
}
|
|
3005
|
-
function reflectCustomObjectSource(objectSource) {
|
|
3008
|
+
function reflectCustomObjectSource(objectSource, debugLogger) {
|
|
3009
|
+
debugLogger.onStart(objectSource.filePath);
|
|
3006
3010
|
return _function.pipe(
|
|
3007
3011
|
E__namespace.tryCatch(() => new fastXmlParser.XMLParser().parse(objectSource.content), E__namespace.toError),
|
|
3008
3012
|
E__namespace.flatMap(validate$2),
|
|
@@ -3011,7 +3015,14 @@ function reflectCustomObjectSource(objectSource) {
|
|
|
3011
3015
|
E__namespace.map(parseInlineFields),
|
|
3012
3016
|
E__namespace.map(addTypeName),
|
|
3013
3017
|
E__namespace.map((metadata) => toParsedFile$4(objectSource.filePath, metadata)),
|
|
3014
|
-
E__namespace.mapLeft((error) =>
|
|
3018
|
+
E__namespace.mapLeft((error) => {
|
|
3019
|
+
debugLogger.onFailure(objectSource.filePath, error.message);
|
|
3020
|
+
return new ReflectionErrors([new ReflectionError(objectSource.filePath, error.message)]);
|
|
3021
|
+
}),
|
|
3022
|
+
E__namespace.map((parsedFile) => {
|
|
3023
|
+
debugLogger.onSuccess(objectSource.filePath);
|
|
3024
|
+
return parsedFile;
|
|
3025
|
+
}),
|
|
3015
3026
|
TE__namespace.fromEither
|
|
3016
3027
|
);
|
|
3017
3028
|
}
|
|
@@ -3107,14 +3118,18 @@ var __spreadValues$e = (a, b) => {
|
|
|
3107
3118
|
return a;
|
|
3108
3119
|
};
|
|
3109
3120
|
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
|
3110
|
-
function reflectCustomFieldSources(customFieldSources) {
|
|
3121
|
+
function reflectCustomFieldSources(customFieldSources, debugLogger = noopReflectionDebugLogger) {
|
|
3111
3122
|
const semiGroupReflectionError = {
|
|
3112
3123
|
concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
|
|
3113
3124
|
};
|
|
3114
3125
|
const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
|
|
3115
|
-
return _function.pipe(
|
|
3126
|
+
return _function.pipe(
|
|
3127
|
+
customFieldSources,
|
|
3128
|
+
A__namespace$1.traverse(Ap)((bundle) => reflectCustomFieldSource(bundle, debugLogger))
|
|
3129
|
+
);
|
|
3116
3130
|
}
|
|
3117
|
-
function reflectCustomFieldSource(customFieldSource) {
|
|
3131
|
+
function reflectCustomFieldSource(customFieldSource, debugLogger) {
|
|
3132
|
+
debugLogger.onStart(customFieldSource.filePath);
|
|
3118
3133
|
return _function.pipe(
|
|
3119
3134
|
E__namespace.tryCatch(() => new fastXmlParser.XMLParser().parse(customFieldSource.content), E__namespace.toError),
|
|
3120
3135
|
E__namespace.flatMap(validate$1),
|
|
@@ -3122,7 +3137,14 @@ function reflectCustomFieldSource(customFieldSource) {
|
|
|
3122
3137
|
E__namespace.map((metadata) => addName(metadata, customFieldSource.name)),
|
|
3123
3138
|
E__namespace.map((metadata) => addParentName$1(metadata, customFieldSource.parentName)),
|
|
3124
3139
|
E__namespace.map((metadata) => toParsedFile$3(customFieldSource.filePath, metadata)),
|
|
3125
|
-
E__namespace.
|
|
3140
|
+
E__namespace.map((parsed) => {
|
|
3141
|
+
debugLogger.onSuccess(customFieldSource.filePath);
|
|
3142
|
+
return parsed;
|
|
3143
|
+
}),
|
|
3144
|
+
E__namespace.mapLeft((error) => {
|
|
3145
|
+
debugLogger.onFailure(customFieldSource.filePath, error.message);
|
|
3146
|
+
return new ReflectionErrors([new ReflectionError(customFieldSource.filePath, error.message)]);
|
|
3147
|
+
}),
|
|
3126
3148
|
TE__namespace.fromEither
|
|
3127
3149
|
);
|
|
3128
3150
|
}
|
|
@@ -3186,10 +3208,14 @@ var __spreadValues$d = (a, b) => {
|
|
|
3186
3208
|
return a;
|
|
3187
3209
|
};
|
|
3188
3210
|
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
|
3189
|
-
function reflectCustomMetadataSources(customMetadataSources) {
|
|
3190
|
-
return _function.pipe(
|
|
3211
|
+
function reflectCustomMetadataSources(customMetadataSources, debugLogger = noopReflectionDebugLogger) {
|
|
3212
|
+
return _function.pipe(
|
|
3213
|
+
customMetadataSources,
|
|
3214
|
+
A__namespace$1.traverse(TE__namespace.ApplicativePar)((bundle) => reflectCustomMetadataSource(bundle, debugLogger))
|
|
3215
|
+
);
|
|
3191
3216
|
}
|
|
3192
|
-
function reflectCustomMetadataSource(customMetadataSource) {
|
|
3217
|
+
function reflectCustomMetadataSource(customMetadataSource, debugLogger) {
|
|
3218
|
+
debugLogger.onStart(customMetadataSource.filePath);
|
|
3193
3219
|
return _function.pipe(
|
|
3194
3220
|
E__namespace.tryCatch(() => new fastXmlParser.XMLParser().parse(customMetadataSource.content), E__namespace.toError),
|
|
3195
3221
|
E__namespace.flatMap(validate),
|
|
@@ -3197,7 +3223,14 @@ function reflectCustomMetadataSource(customMetadataSource) {
|
|
|
3197
3223
|
E__namespace.map((metadata) => addNames(metadata, customMetadataSource.name, customMetadataSource.apiName)),
|
|
3198
3224
|
E__namespace.map((metadata) => addParentName(metadata, customMetadataSource.parentName)),
|
|
3199
3225
|
E__namespace.map((metadata) => toParsedFile$2(customMetadataSource.filePath, metadata)),
|
|
3200
|
-
E__namespace.mapLeft((error) =>
|
|
3226
|
+
E__namespace.mapLeft((error) => {
|
|
3227
|
+
debugLogger.onFailure(customMetadataSource.filePath, error.message);
|
|
3228
|
+
return new ReflectionErrors([new ReflectionError(customMetadataSource.filePath, error.message)]);
|
|
3229
|
+
}),
|
|
3230
|
+
E__namespace.map((parsed) => {
|
|
3231
|
+
debugLogger.onSuccess(customMetadataSource.filePath);
|
|
3232
|
+
return parsed;
|
|
3233
|
+
}),
|
|
3201
3234
|
TE__namespace.fromEither
|
|
3202
3235
|
);
|
|
3203
3236
|
}
|
|
@@ -3256,7 +3289,7 @@ var __spreadValues$c = (a, b) => {
|
|
|
3256
3289
|
return a;
|
|
3257
3290
|
};
|
|
3258
3291
|
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
|
3259
|
-
function reflectCustomFieldsAndObjectsAndMetadataRecords(objectBundles, visibilitiesToDocument) {
|
|
3292
|
+
function reflectCustomFieldsAndObjectsAndMetadataRecords(objectBundles, visibilitiesToDocument, debugLogger = noopReflectionDebugLogger) {
|
|
3260
3293
|
function filterNonPublished(parsedFiles) {
|
|
3261
3294
|
return parsedFiles.filter((parsedFile) => parsedFile.type.deploymentStatus === "Deployed");
|
|
3262
3295
|
}
|
|
@@ -3278,14 +3311,14 @@ function reflectCustomFieldsAndObjectsAndMetadataRecords(objectBundles, visibili
|
|
|
3278
3311
|
(object) => object.type === "custommetadata"
|
|
3279
3312
|
);
|
|
3280
3313
|
function generateForFields(fields) {
|
|
3281
|
-
return _function.pipe(fields, reflectCustomFieldSources);
|
|
3314
|
+
return _function.pipe(fields, (bundles) => reflectCustomFieldSources(bundles, debugLogger));
|
|
3282
3315
|
}
|
|
3283
3316
|
function generateForMetadata(metadata) {
|
|
3284
|
-
return _function.pipe(metadata, reflectCustomMetadataSources);
|
|
3317
|
+
return _function.pipe(metadata, (bundles) => reflectCustomMetadataSources(bundles, debugLogger));
|
|
3285
3318
|
}
|
|
3286
3319
|
return _function.pipe(
|
|
3287
3320
|
customObjects,
|
|
3288
|
-
reflectCustomObjectSources,
|
|
3321
|
+
(bundles) => reflectCustomObjectSources(bundles, debugLogger),
|
|
3289
3322
|
TE__namespace.map(filterNonPublished),
|
|
3290
3323
|
TE__namespace.map(filter),
|
|
3291
3324
|
TE__namespace.bindTo("filterResult"),
|
|
@@ -3399,19 +3432,36 @@ var __async$4 = (__this, __arguments, generator) => {
|
|
|
3399
3432
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
3400
3433
|
});
|
|
3401
3434
|
};
|
|
3402
|
-
function reflectTriggerSource(triggerBundles) {
|
|
3435
|
+
function reflectTriggerSource(triggerBundles, debugLogger = noopReflectionDebugLogger) {
|
|
3403
3436
|
const semiGroupReflectionError = {
|
|
3404
3437
|
concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
|
|
3405
3438
|
};
|
|
3406
3439
|
const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
|
|
3407
|
-
return _function.pipe(
|
|
3440
|
+
return _function.pipe(
|
|
3441
|
+
triggerBundles,
|
|
3442
|
+
A__namespace.traverse(Ap)((bundle) => reflectBundle$1(bundle, debugLogger))
|
|
3443
|
+
);
|
|
3408
3444
|
}
|
|
3409
|
-
function reflectBundle$1(triggerBundle) {
|
|
3445
|
+
function reflectBundle$1(triggerBundle, debugLogger) {
|
|
3410
3446
|
const convertToParsedFile = apply(
|
|
3411
3447
|
toParsedFile$1,
|
|
3412
3448
|
triggerBundle.filePath
|
|
3413
3449
|
);
|
|
3414
|
-
|
|
3450
|
+
debugLogger.onStart(triggerBundle.filePath);
|
|
3451
|
+
return _function.pipe(
|
|
3452
|
+
triggerBundle,
|
|
3453
|
+
reflectAsTask,
|
|
3454
|
+
TE__namespace.map((triggerMirror) => {
|
|
3455
|
+
debugLogger.onSuccess(triggerBundle.filePath);
|
|
3456
|
+
return triggerMirror;
|
|
3457
|
+
}),
|
|
3458
|
+
TE__namespace.map(convertToParsedFile),
|
|
3459
|
+
TE__namespace.mapLeft((errs) => {
|
|
3460
|
+
const msg = errs.errors.map((e) => e.message).join(" | ");
|
|
3461
|
+
debugLogger.onFailure(triggerBundle.filePath, msg);
|
|
3462
|
+
return errs;
|
|
3463
|
+
})
|
|
3464
|
+
);
|
|
3415
3465
|
}
|
|
3416
3466
|
function toParsedFile$1(filePath, triggerMirror) {
|
|
3417
3467
|
return {
|
|
@@ -3457,14 +3507,18 @@ var __spreadValues$a = (a, b) => {
|
|
|
3457
3507
|
}
|
|
3458
3508
|
return a;
|
|
3459
3509
|
};
|
|
3460
|
-
function reflectLwcSource(triggerBundles) {
|
|
3510
|
+
function reflectLwcSource(triggerBundles, debugLogger = noopReflectionDebugLogger) {
|
|
3461
3511
|
const semiGroupReflectionError = {
|
|
3462
3512
|
concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
|
|
3463
3513
|
};
|
|
3464
3514
|
const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
|
|
3465
|
-
return _function.pipe(
|
|
3515
|
+
return _function.pipe(
|
|
3516
|
+
triggerBundles,
|
|
3517
|
+
A__namespace.traverse(Ap)((bundle) => reflectBundle(bundle, debugLogger))
|
|
3518
|
+
);
|
|
3466
3519
|
}
|
|
3467
|
-
function reflectBundle(lwcBundle) {
|
|
3520
|
+
function reflectBundle(lwcBundle, debugLogger) {
|
|
3521
|
+
debugLogger.onStart(lwcBundle.filePath);
|
|
3468
3522
|
return _function.pipe(
|
|
3469
3523
|
E__namespace.tryCatch(() => {
|
|
3470
3524
|
const alwaysArray = [
|
|
@@ -3482,8 +3536,15 @@ function reflectBundle(lwcBundle) {
|
|
|
3482
3536
|
const bundle = result["LightningComponentBundle"];
|
|
3483
3537
|
return transformBooleanProperties(bundle);
|
|
3484
3538
|
}, E__namespace.toError),
|
|
3539
|
+
E__namespace.map((parsed) => {
|
|
3540
|
+
debugLogger.onSuccess(lwcBundle.filePath);
|
|
3541
|
+
return parsed;
|
|
3542
|
+
}),
|
|
3485
3543
|
E__namespace.map((parsed) => toParsedFile(lwcBundle.filePath, lwcBundle.name, parsed)),
|
|
3486
|
-
E__namespace.mapLeft((error) =>
|
|
3544
|
+
E__namespace.mapLeft((error) => {
|
|
3545
|
+
debugLogger.onFailure(lwcBundle.filePath, error.message);
|
|
3546
|
+
return new ReflectionErrors([new ReflectionError(lwcBundle.filePath, error.message)]);
|
|
3547
|
+
}),
|
|
3487
3548
|
TE__namespace.fromEither
|
|
3488
3549
|
);
|
|
3489
3550
|
}
|
|
@@ -3580,33 +3641,40 @@ function generateDocs(unparsedBundles, config, debugLogger) {
|
|
|
3580
3641
|
}
|
|
3581
3642
|
return _function.pipe(
|
|
3582
3643
|
TE__namespace.right(replaceMacros(unparsedBundles, config.macros)),
|
|
3583
|
-
TE__namespace.
|
|
3584
|
-
TE__namespace.
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
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 }) => {
|
|
3600
3662
|
if (!config.experimentalLwcSupport) {
|
|
3601
|
-
return TE__namespace.right(
|
|
3663
|
+
return TE__namespace.right([]);
|
|
3602
3664
|
}
|
|
3603
3665
|
return _function.pipe(
|
|
3604
|
-
reflectLwcSource(filterLwcFiles(
|
|
3605
|
-
TE__namespace.map((
|
|
3606
|
-
TE__namespace.map((parsedLwcFiles) => [...parsedFiles, ...parsedLwcFiles])
|
|
3666
|
+
reflectLwcSource(filterLwcFiles(unparsedBundles2), debugLogger),
|
|
3667
|
+
TE__namespace.map((files) => files.filter((file) => file.type.isExposed))
|
|
3607
3668
|
);
|
|
3608
3669
|
}),
|
|
3609
|
-
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(new ReflectionErrors([]));
|
|
3675
|
+
}
|
|
3676
|
+
return TE__namespace.right(sorted);
|
|
3677
|
+
}),
|
|
3610
3678
|
TE__namespace.bindTo("parsedFiles"),
|
|
3611
3679
|
TE__namespace.bind(
|
|
3612
3680
|
"references",
|
|
@@ -3666,12 +3734,10 @@ function generateForApex(apexBundles, config, debugLogger) {
|
|
|
3666
3734
|
);
|
|
3667
3735
|
return _function.pipe(
|
|
3668
3736
|
filtered,
|
|
3669
|
-
TE__namespace.
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
return TE__namespace.right(parsed);
|
|
3674
|
-
})
|
|
3737
|
+
TE__namespace.map((parsed) => ({
|
|
3738
|
+
parsed,
|
|
3739
|
+
reflectionErrors: errors
|
|
3740
|
+
}))
|
|
3675
3741
|
);
|
|
3676
3742
|
})
|
|
3677
3743
|
);
|
|
@@ -4752,7 +4818,6 @@ class OpenApiDocsProcessor {
|
|
|
4752
4818
|
}
|
|
4753
4819
|
onProcess(type) {
|
|
4754
4820
|
var _a, _b;
|
|
4755
|
-
this.logger.logSingle(`Processing ${type.name}`, "green");
|
|
4756
4821
|
const endpointPath = this.getEndpointPath(type);
|
|
4757
4822
|
if (!endpointPath) {
|
|
4758
4823
|
return;
|
|
@@ -4788,40 +4853,31 @@ class OpenApiDocsProcessor {
|
|
|
4788
4853
|
}
|
|
4789
4854
|
}
|
|
4790
4855
|
|
|
4791
|
-
function createReflectionDebugLogger(logger) {
|
|
4792
|
-
if (!logger.isDebugEnabled()) {
|
|
4856
|
+
function createReflectionDebugLogger(logger, recordFailure) {
|
|
4857
|
+
if (!logger.isDebugEnabled() && !recordFailure) {
|
|
4793
4858
|
return noopReflectionDebugLogger;
|
|
4794
4859
|
}
|
|
4795
4860
|
return {
|
|
4796
4861
|
onStart: (filePath) => {
|
|
4797
|
-
logger.
|
|
4862
|
+
if (logger.isDebugEnabled()) {
|
|
4863
|
+
logger.debug(`Parsing: ${filePath}...`);
|
|
4864
|
+
}
|
|
4798
4865
|
},
|
|
4799
4866
|
onSuccess: (filePath) => {
|
|
4800
|
-
logger.
|
|
4867
|
+
if (logger.isDebugEnabled()) {
|
|
4868
|
+
logger.debug(`Parsing: ${filePath} OK`);
|
|
4869
|
+
}
|
|
4801
4870
|
},
|
|
4802
4871
|
onFailure: (filePath, errorMessage) => {
|
|
4803
|
-
logger.
|
|
4804
|
-
|
|
4872
|
+
if (logger.isDebugEnabled()) {
|
|
4873
|
+
logger.debug(`Parsing: ${filePath} FAILED`);
|
|
4874
|
+
logger.debug(`Parsing error: ${filePath} - ${errorMessage}`);
|
|
4875
|
+
}
|
|
4876
|
+
recordFailure == null ? void 0 : recordFailure(filePath, errorMessage);
|
|
4805
4877
|
}
|
|
4806
4878
|
};
|
|
4807
4879
|
}
|
|
4808
4880
|
|
|
4809
|
-
var __defProp$2 = Object.defineProperty;
|
|
4810
|
-
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
4811
|
-
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
4812
|
-
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
4813
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4814
|
-
var __spreadValues$2 = (a, b) => {
|
|
4815
|
-
for (var prop in b || (b = {}))
|
|
4816
|
-
if (__hasOwnProp$2.call(b, prop))
|
|
4817
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
4818
|
-
if (__getOwnPropSymbols$2)
|
|
4819
|
-
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
4820
|
-
if (__propIsEnum$2.call(b, prop))
|
|
4821
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
4822
|
-
}
|
|
4823
|
-
return a;
|
|
4824
|
-
};
|
|
4825
4881
|
var __async$2 = (__this, __arguments, generator) => {
|
|
4826
4882
|
return new Promise((resolve, reject) => {
|
|
4827
4883
|
var fulfilled = (value) => {
|
|
@@ -4842,7 +4898,7 @@ var __async$2 = (__this, __arguments, generator) => {
|
|
|
4842
4898
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
4843
4899
|
});
|
|
4844
4900
|
};
|
|
4845
|
-
function openApi(logger, fileBodies, config) {
|
|
4901
|
+
function openApi(logger, fileBodies, config, errorCollector) {
|
|
4846
4902
|
return __async$2(this, null, function* () {
|
|
4847
4903
|
const sourceDirectory = (Array.isArray(config.sourceDir) ? config.sourceDir[0] : config.sourceDir) || (fileBodies.length > 0 ? fileBodies[0].filePath.split("/").slice(0, -1).join("/") : process.cwd());
|
|
4848
4904
|
OpenApiSettings.build({
|
|
@@ -4853,7 +4909,9 @@ function openApi(logger, fileBodies, config) {
|
|
|
4853
4909
|
namespace: config.namespace,
|
|
4854
4910
|
version: config.apiVersion
|
|
4855
4911
|
});
|
|
4856
|
-
const debugLogger = createReflectionDebugLogger(logger)
|
|
4912
|
+
const debugLogger = createReflectionDebugLogger(logger, (filePath, errorMessage) => {
|
|
4913
|
+
errorCollector.addFailure("apex", filePath, errorMessage);
|
|
4914
|
+
});
|
|
4857
4915
|
const reflectedEither = yield reflectApexSourceBestEffort(
|
|
4858
4916
|
fileBodies,
|
|
4859
4917
|
{
|
|
@@ -4871,11 +4929,6 @@ function openApi(logger, fileBodies, config) {
|
|
|
4871
4929
|
`\u26A0\uFE0F ${recoverableErrors.errors.length} file(s) failed to parse/reflect. Continuing with successfully reflected files.`,
|
|
4872
4930
|
"red"
|
|
4873
4931
|
);
|
|
4874
|
-
logger.error(
|
|
4875
|
-
new ReflectionErrors(
|
|
4876
|
-
recoverableErrors.errors.map((e) => __spreadValues$2({}, e))
|
|
4877
|
-
)
|
|
4878
|
-
);
|
|
4879
4932
|
}
|
|
4880
4933
|
const reflectionByPath = /* @__PURE__ */ new Map();
|
|
4881
4934
|
for (const parsed of parsedFiles) {
|
|
@@ -4909,11 +4962,12 @@ function openApi(logger, fileBodies, config) {
|
|
|
4909
4962
|
}
|
|
4910
4963
|
ErrorLogger.logErrors(logger, filteredTypes);
|
|
4911
4964
|
if (recoverableErrors.errors.length > 0) {
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4965
|
+
errorCollector.addGlobalFailure(
|
|
4966
|
+
"other",
|
|
4967
|
+
`OpenAPI generation completed with ${recoverableErrors.errors.length} reflection error item(s).`,
|
|
4968
|
+
recoverableErrors
|
|
4916
4969
|
);
|
|
4970
|
+
return E__namespace.left(new ReflectionErrors([]));
|
|
4917
4971
|
}
|
|
4918
4972
|
return E__namespace.right(void 0);
|
|
4919
4973
|
});
|
|
@@ -5532,21 +5586,21 @@ function changelogToSourceChangelog(changelog) {
|
|
|
5532
5586
|
};
|
|
5533
5587
|
}
|
|
5534
5588
|
|
|
5535
|
-
var __defProp$
|
|
5589
|
+
var __defProp$2 = Object.defineProperty;
|
|
5536
5590
|
var __defProps$1 = Object.defineProperties;
|
|
5537
5591
|
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
5538
|
-
var __getOwnPropSymbols$
|
|
5539
|
-
var __hasOwnProp$
|
|
5540
|
-
var __propIsEnum$
|
|
5541
|
-
var __defNormalProp$
|
|
5542
|
-
var __spreadValues$
|
|
5592
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
5593
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
5594
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
5595
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5596
|
+
var __spreadValues$2 = (a, b) => {
|
|
5543
5597
|
for (var prop in b || (b = {}))
|
|
5544
|
-
if (__hasOwnProp$
|
|
5545
|
-
__defNormalProp$
|
|
5546
|
-
if (__getOwnPropSymbols$
|
|
5547
|
-
for (var prop of __getOwnPropSymbols$
|
|
5548
|
-
if (__propIsEnum$
|
|
5549
|
-
__defNormalProp$
|
|
5598
|
+
if (__hasOwnProp$2.call(b, prop))
|
|
5599
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
5600
|
+
if (__getOwnPropSymbols$2)
|
|
5601
|
+
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
5602
|
+
if (__propIsEnum$2.call(b, prop))
|
|
5603
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
5550
5604
|
}
|
|
5551
5605
|
return a;
|
|
5552
5606
|
};
|
|
@@ -5616,7 +5670,8 @@ function generateChangeLog(oldBundles, newBundles, config, debugLogger) {
|
|
|
5616
5670
|
({ bundles: bundles2, apex }) => _function.pipe(
|
|
5617
5671
|
reflectCustomFieldsAndObjectsAndMetadataRecords(
|
|
5618
5672
|
filterCustomObjectsFieldsAndMetadataRecords(bundles2),
|
|
5619
|
-
config.customObjectVisibility
|
|
5673
|
+
config.customObjectVisibility,
|
|
5674
|
+
debugLogger
|
|
5620
5675
|
),
|
|
5621
5676
|
TE__namespace.map((parsedObjectFiles) => ({
|
|
5622
5677
|
parsedFiles: [...apex.parsedFiles, ...parsedObjectFiles],
|
|
@@ -5630,7 +5685,7 @@ function generateChangeLog(oldBundles, newBundles, config, debugLogger) {
|
|
|
5630
5685
|
TE__namespace.bind(
|
|
5631
5686
|
"all",
|
|
5632
5687
|
({ objects, bundles: bundles2 }) => _function.pipe(
|
|
5633
|
-
reflectTriggerSource(filterTriggerFiles(bundles2)),
|
|
5688
|
+
reflectTriggerSource(filterTriggerFiles(bundles2), debugLogger),
|
|
5634
5689
|
TE__namespace.map((parsedTriggerFiles) => ({
|
|
5635
5690
|
parsedFiles: [...objects.parsedFiles, ...parsedTriggerFiles],
|
|
5636
5691
|
errors: objects.errors
|
|
@@ -5676,11 +5731,11 @@ function generateChangeLog(oldBundles, newBundles, config, debugLogger) {
|
|
|
5676
5731
|
page: postHookCompile(page),
|
|
5677
5732
|
combinedReflectionErrors
|
|
5678
5733
|
})),
|
|
5679
|
-
// Fail at the very end if we had any recoverable
|
|
5680
|
-
// so the CLI can
|
|
5734
|
+
// Fail at the very end if we had any recoverable reflection errors,
|
|
5735
|
+
// so the CLI can set an exit code after completing the work.
|
|
5681
5736
|
TE__namespace.flatMap(({ page, combinedReflectionErrors }) => {
|
|
5682
5737
|
if (combinedReflectionErrors.errors.length > 0) {
|
|
5683
|
-
return TE__namespace.left(
|
|
5738
|
+
return TE__namespace.left(new ReflectionErrors([]));
|
|
5684
5739
|
}
|
|
5685
5740
|
return TE__namespace.right(page);
|
|
5686
5741
|
})
|
|
@@ -5706,7 +5761,7 @@ function compile(translations) {
|
|
|
5706
5761
|
return (renderable) => {
|
|
5707
5762
|
const compilationRequest = {
|
|
5708
5763
|
template: changelogTemplate,
|
|
5709
|
-
source: __spreadProps$1(__spreadValues$
|
|
5764
|
+
source: __spreadProps$1(__spreadValues$2({}, renderable), {
|
|
5710
5765
|
title: translations.changelog.title
|
|
5711
5766
|
})
|
|
5712
5767
|
};
|
|
@@ -5732,14 +5787,14 @@ function transformChangelogPage(_0) {
|
|
|
5732
5787
|
if (isSkip(page)) {
|
|
5733
5788
|
return page;
|
|
5734
5789
|
}
|
|
5735
|
-
return __spreadValues$
|
|
5790
|
+
return __spreadValues$2(__spreadValues$2({}, page), yield hook(page));
|
|
5736
5791
|
});
|
|
5737
5792
|
}
|
|
5738
5793
|
function postHookCompile(page) {
|
|
5739
5794
|
if (isSkip(page)) {
|
|
5740
5795
|
return page;
|
|
5741
5796
|
}
|
|
5742
|
-
return __spreadProps$1(__spreadValues$
|
|
5797
|
+
return __spreadProps$1(__spreadValues$2({}, page), {
|
|
5743
5798
|
content: Template.getInstance().compile({
|
|
5744
5799
|
source: {
|
|
5745
5800
|
frontmatter: toFrontmatterString(page.frontmatter),
|
|
@@ -5770,21 +5825,21 @@ function writeFilesToSystem(pageData, outputDir) {
|
|
|
5770
5825
|
);
|
|
5771
5826
|
}
|
|
5772
5827
|
|
|
5773
|
-
var __defProp = Object.defineProperty;
|
|
5828
|
+
var __defProp$1 = Object.defineProperty;
|
|
5774
5829
|
var __defProps = Object.defineProperties;
|
|
5775
5830
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5776
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5777
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5778
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5779
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5780
|
-
var __spreadValues = (a, b) => {
|
|
5831
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
5832
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
5833
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
5834
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5835
|
+
var __spreadValues$1 = (a, b) => {
|
|
5781
5836
|
for (var prop in b || (b = {}))
|
|
5782
|
-
if (__hasOwnProp.call(b, prop))
|
|
5783
|
-
__defNormalProp(a, prop, b[prop]);
|
|
5784
|
-
if (__getOwnPropSymbols)
|
|
5785
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
5786
|
-
if (__propIsEnum.call(b, prop))
|
|
5787
|
-
__defNormalProp(a, prop, b[prop]);
|
|
5837
|
+
if (__hasOwnProp$1.call(b, prop))
|
|
5838
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
5839
|
+
if (__getOwnPropSymbols$1)
|
|
5840
|
+
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
5841
|
+
if (__propIsEnum$1.call(b, prop))
|
|
5842
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
5788
5843
|
}
|
|
5789
5844
|
return a;
|
|
5790
5845
|
};
|
|
@@ -5978,7 +6033,7 @@ function processFiles(fileSystem, config) {
|
|
|
5978
6033
|
(components) => {
|
|
5979
6034
|
return components.map((component) => {
|
|
5980
6035
|
const pathLocation = component.type.name === "ApexClass" ? component.content : component.xml;
|
|
5981
|
-
return __spreadProps(__spreadValues({}, component), {
|
|
6036
|
+
return __spreadProps(__spreadValues$1({}, component), {
|
|
5982
6037
|
filePath: pathLocation
|
|
5983
6038
|
});
|
|
5984
6039
|
});
|
|
@@ -6176,15 +6231,15 @@ class Apexdocs {
|
|
|
6176
6231
|
*/
|
|
6177
6232
|
static generate(config, deps) {
|
|
6178
6233
|
return __async(this, null, function* () {
|
|
6179
|
-
const { logger, reflectionDebugLogger } = deps;
|
|
6234
|
+
const { logger, reflectionDebugLogger, errorCollector } = deps;
|
|
6180
6235
|
logger.logSingle(`Generating ${config.targetGenerator} documentation...`);
|
|
6181
6236
|
try {
|
|
6182
6237
|
switch (config.targetGenerator) {
|
|
6183
6238
|
case "markdown": {
|
|
6184
|
-
return (yield processMarkdown(config, logger, reflectionDebugLogger))();
|
|
6239
|
+
return (yield processMarkdown(config, logger, reflectionDebugLogger, errorCollector))();
|
|
6185
6240
|
}
|
|
6186
6241
|
case "openapi": {
|
|
6187
|
-
const task = yield processOpenApi(config, logger);
|
|
6242
|
+
const task = yield processOpenApi(config, logger, errorCollector);
|
|
6188
6243
|
const openApiResult = yield task();
|
|
6189
6244
|
if (E__namespace.isLeft(openApiResult)) {
|
|
6190
6245
|
return E__namespace.left([openApiResult.left]);
|
|
@@ -6192,48 +6247,57 @@ class Apexdocs {
|
|
|
6192
6247
|
return E__namespace.right("\u2714\uFE0F Documentation generated successfully!");
|
|
6193
6248
|
}
|
|
6194
6249
|
case "changelog": {
|
|
6195
|
-
return (yield processChangeLog(config, logger, reflectionDebugLogger))();
|
|
6250
|
+
return (yield processChangeLog(config, logger, reflectionDebugLogger, errorCollector))();
|
|
6196
6251
|
}
|
|
6197
6252
|
}
|
|
6198
6253
|
} catch (error) {
|
|
6254
|
+
errorCollector.addGlobalFailure("other", String(error), error);
|
|
6199
6255
|
return E__namespace.left([error]);
|
|
6200
6256
|
}
|
|
6201
6257
|
});
|
|
6202
6258
|
}
|
|
6203
6259
|
}
|
|
6204
6260
|
const readFiles = apply(processFiles, new DefaultFileSystem());
|
|
6205
|
-
function processMarkdown(config, logger, reflectionDebugLogger) {
|
|
6261
|
+
function processMarkdown(config, logger, reflectionDebugLogger, errorCollector) {
|
|
6206
6262
|
return __async(this, null, function* () {
|
|
6207
6263
|
const debugLogger = reflectionDebugLogger;
|
|
6208
6264
|
return _function.pipe(
|
|
6209
6265
|
resolveAndValidateSourceDirectories(config),
|
|
6210
|
-
E__namespace.mapLeft((error) =>
|
|
6266
|
+
E__namespace.mapLeft((error) => {
|
|
6267
|
+
errorCollector.addGlobalFailure("read", `Failed to resolve source directories: ${error.message}`, error);
|
|
6268
|
+
return new FileReadingError(`Failed to resolve source directories: ${error.message}`, error);
|
|
6269
|
+
}),
|
|
6211
6270
|
E__namespace.flatMap(
|
|
6212
6271
|
(sourceDirs) => E__namespace.tryCatch(
|
|
6213
6272
|
() => readFiles({ experimentalLwcSupport: config.experimentalLwcSupport })(allComponentTypes, {
|
|
6214
6273
|
includeMetadata: config.includeMetadata
|
|
6215
6274
|
})(sourceDirs, config.exclude),
|
|
6216
|
-
(e) =>
|
|
6275
|
+
(e) => {
|
|
6276
|
+
errorCollector.addGlobalFailure("read", "An error occurred while reading files.", e);
|
|
6277
|
+
return new FileReadingError("An error occurred while reading files.", e);
|
|
6278
|
+
}
|
|
6217
6279
|
)
|
|
6218
6280
|
),
|
|
6219
6281
|
TE__namespace.fromEither,
|
|
6220
6282
|
TE__namespace.flatMap((fileBodies) => generate$1(fileBodies, config, debugLogger)),
|
|
6221
6283
|
TE__namespace.map(() => "\u2714\uFE0F Documentation generated successfully!"),
|
|
6222
6284
|
TE__namespace.mapLeft((err) => {
|
|
6223
|
-
const errors = toErrors(err);
|
|
6224
6285
|
if (logger.isDebugEnabled()) {
|
|
6225
|
-
logger.debug(`markdown generator finished with
|
|
6286
|
+
logger.debug(`markdown generator finished with errors`);
|
|
6226
6287
|
}
|
|
6227
|
-
return
|
|
6288
|
+
return toErrors(err);
|
|
6228
6289
|
})
|
|
6229
6290
|
);
|
|
6230
6291
|
});
|
|
6231
6292
|
}
|
|
6232
|
-
function processOpenApi(config, logger) {
|
|
6293
|
+
function processOpenApi(config, logger, errorCollector) {
|
|
6233
6294
|
return __async(this, null, function* () {
|
|
6234
6295
|
return _function.pipe(
|
|
6235
6296
|
resolveAndValidateSourceDirectories(config),
|
|
6236
|
-
E__namespace.mapLeft((error) =>
|
|
6297
|
+
E__namespace.mapLeft((error) => {
|
|
6298
|
+
errorCollector.addGlobalFailure("read", `Failed to resolve source directories: ${error.message}`, error);
|
|
6299
|
+
return new FileReadingError(`Failed to resolve source directories: ${error.message}`, error);
|
|
6300
|
+
}),
|
|
6237
6301
|
TE__namespace.fromEither,
|
|
6238
6302
|
TE__namespace.flatMap(
|
|
6239
6303
|
(sourceDirs) => TE__namespace.tryCatch(
|
|
@@ -6242,15 +6306,18 @@ function processOpenApi(config, logger) {
|
|
|
6242
6306
|
sourceDirs,
|
|
6243
6307
|
config.exclude
|
|
6244
6308
|
);
|
|
6245
|
-
return openApi(logger, fileBodies, config);
|
|
6309
|
+
return openApi(logger, fileBodies, config, errorCollector);
|
|
6246
6310
|
},
|
|
6247
|
-
(e) =>
|
|
6311
|
+
(e) => {
|
|
6312
|
+
errorCollector.addGlobalFailure("other", "An error occurred while generating OpenAPI documentation.", e);
|
|
6313
|
+
return new FileReadingError("An error occurred while generating OpenAPI documentation.", e);
|
|
6314
|
+
}
|
|
6248
6315
|
)
|
|
6249
6316
|
)
|
|
6250
6317
|
);
|
|
6251
6318
|
});
|
|
6252
6319
|
}
|
|
6253
|
-
function processChangeLog(config, logger, reflectionDebugLogger) {
|
|
6320
|
+
function processChangeLog(config, logger, reflectionDebugLogger, errorCollector) {
|
|
6254
6321
|
return __async(this, null, function* () {
|
|
6255
6322
|
function loadFiles() {
|
|
6256
6323
|
const previousVersionConfig = {
|
|
@@ -6265,24 +6332,47 @@ function processChangeLog(config, logger, reflectionDebugLogger) {
|
|
|
6265
6332
|
"previousVersionDirs",
|
|
6266
6333
|
() => _function.pipe(
|
|
6267
6334
|
resolveAndValidateSourceDirectories(previousVersionConfig),
|
|
6268
|
-
E__namespace.mapLeft(
|
|
6269
|
-
(
|
|
6270
|
-
|
|
6335
|
+
E__namespace.mapLeft((error) => {
|
|
6336
|
+
errorCollector.addGlobalFailure(
|
|
6337
|
+
"read",
|
|
6338
|
+
`Failed to resolve previous version source directories: ${error.message}`,
|
|
6339
|
+
error
|
|
6340
|
+
);
|
|
6341
|
+
return new FileReadingError(
|
|
6342
|
+
`Failed to resolve previous version source directories: ${error.message}`,
|
|
6343
|
+
error
|
|
6344
|
+
);
|
|
6345
|
+
})
|
|
6271
6346
|
)
|
|
6272
6347
|
),
|
|
6273
6348
|
E__namespace.bind(
|
|
6274
6349
|
"currentVersionDirs",
|
|
6275
6350
|
() => _function.pipe(
|
|
6276
6351
|
resolveAndValidateSourceDirectories(currentVersionConfig),
|
|
6277
|
-
E__namespace.mapLeft(
|
|
6278
|
-
(
|
|
6279
|
-
|
|
6352
|
+
E__namespace.mapLeft((error) => {
|
|
6353
|
+
errorCollector.addGlobalFailure(
|
|
6354
|
+
"read",
|
|
6355
|
+
`Failed to resolve current version source directories: ${error.message}`,
|
|
6356
|
+
error
|
|
6357
|
+
);
|
|
6358
|
+
return new FileReadingError(
|
|
6359
|
+
`Failed to resolve current version source directories: ${error.message}`,
|
|
6360
|
+
error
|
|
6361
|
+
);
|
|
6362
|
+
})
|
|
6280
6363
|
)
|
|
6281
6364
|
),
|
|
6282
|
-
E__namespace.map(({ previousVersionDirs, currentVersionDirs }) =>
|
|
6283
|
-
readFiles({ experimentalLwcSupport: false })(allComponentTypes)(
|
|
6284
|
-
|
|
6285
|
-
|
|
6365
|
+
E__namespace.map(({ previousVersionDirs, currentVersionDirs }) => {
|
|
6366
|
+
const previous = readFiles({ experimentalLwcSupport: false })(allComponentTypes)(
|
|
6367
|
+
previousVersionDirs,
|
|
6368
|
+
config.exclude
|
|
6369
|
+
);
|
|
6370
|
+
const current = readFiles({ experimentalLwcSupport: false })(allComponentTypes)(
|
|
6371
|
+
currentVersionDirs,
|
|
6372
|
+
config.exclude
|
|
6373
|
+
);
|
|
6374
|
+
return [previous, current];
|
|
6375
|
+
})
|
|
6286
6376
|
);
|
|
6287
6377
|
}
|
|
6288
6378
|
return _function.pipe(
|
|
@@ -6290,11 +6380,10 @@ function processChangeLog(config, logger, reflectionDebugLogger) {
|
|
|
6290
6380
|
TE__namespace.fromEither,
|
|
6291
6381
|
TE__namespace.flatMap(([previous, current]) => generate(previous, current, config, reflectionDebugLogger)),
|
|
6292
6382
|
TE__namespace.mapLeft((err) => {
|
|
6293
|
-
const errors = toErrors(err);
|
|
6294
6383
|
if (logger.isDebugEnabled()) {
|
|
6295
|
-
logger.debug(`changelog generator finished with
|
|
6384
|
+
logger.debug(`changelog generator finished with errors`);
|
|
6296
6385
|
}
|
|
6297
|
-
return
|
|
6386
|
+
return toErrors(err);
|
|
6298
6387
|
})
|
|
6299
6388
|
);
|
|
6300
6389
|
});
|
|
@@ -6385,7 +6474,70 @@ class NoLogger {
|
|
|
6385
6474
|
}
|
|
6386
6475
|
}
|
|
6387
6476
|
|
|
6477
|
+
var __defProp = Object.defineProperty;
|
|
6478
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6479
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6480
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6481
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6482
|
+
var __spreadValues = (a, b) => {
|
|
6483
|
+
for (var prop in b || (b = {}))
|
|
6484
|
+
if (__hasOwnProp.call(b, prop))
|
|
6485
|
+
__defNormalProp(a, prop, b[prop]);
|
|
6486
|
+
if (__getOwnPropSymbols)
|
|
6487
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
6488
|
+
if (__propIsEnum.call(b, prop))
|
|
6489
|
+
__defNormalProp(a, prop, b[prop]);
|
|
6490
|
+
}
|
|
6491
|
+
return a;
|
|
6492
|
+
};
|
|
6493
|
+
class ErrorCollector {
|
|
6494
|
+
constructor(generator) {
|
|
6495
|
+
this.items = [];
|
|
6496
|
+
this.generator = generator;
|
|
6497
|
+
}
|
|
6498
|
+
add(item) {
|
|
6499
|
+
var _a;
|
|
6500
|
+
const fullItem = __spreadValues({
|
|
6501
|
+
generator: this.generator,
|
|
6502
|
+
at: (_a = item.at) != null ? _a : (/* @__PURE__ */ new Date()).toISOString()
|
|
6503
|
+
}, item);
|
|
6504
|
+
this.items.push(fullItem);
|
|
6505
|
+
}
|
|
6506
|
+
addFailure(stage, filePath, message, raw) {
|
|
6507
|
+
this.add({
|
|
6508
|
+
stage,
|
|
6509
|
+
filePath,
|
|
6510
|
+
message,
|
|
6511
|
+
raw
|
|
6512
|
+
});
|
|
6513
|
+
}
|
|
6514
|
+
addGlobalFailure(stage, message, raw) {
|
|
6515
|
+
this.add({
|
|
6516
|
+
stage,
|
|
6517
|
+
message,
|
|
6518
|
+
raw
|
|
6519
|
+
});
|
|
6520
|
+
}
|
|
6521
|
+
hasErrors() {
|
|
6522
|
+
return this.items.length > 0;
|
|
6523
|
+
}
|
|
6524
|
+
count() {
|
|
6525
|
+
return this.items.length;
|
|
6526
|
+
}
|
|
6527
|
+
all() {
|
|
6528
|
+
return this.items;
|
|
6529
|
+
}
|
|
6530
|
+
/**
|
|
6531
|
+
* Human-readable representation of the error item.
|
|
6532
|
+
*/
|
|
6533
|
+
static format(item) {
|
|
6534
|
+
const location = item.filePath ? `${item.filePath}` : "";
|
|
6535
|
+
return `[${item.generator}] ${location}: ${item.message} - ${item.raw}`;
|
|
6536
|
+
}
|
|
6537
|
+
}
|
|
6538
|
+
|
|
6388
6539
|
exports.Apexdocs = Apexdocs;
|
|
6540
|
+
exports.ErrorCollector = ErrorCollector;
|
|
6389
6541
|
exports.NoLogger = NoLogger;
|
|
6390
6542
|
exports.StdOutLogger = StdOutLogger;
|
|
6391
6543
|
exports.changeLogDefaults = changeLogDefaults;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var errorCollector = require('./error-collector-hp1dlub7.js');
|
|
5
5
|
var E = require('fp-ts/Either');
|
|
6
6
|
require('fp-ts/function');
|
|
7
7
|
require('fp-ts/TaskEither');
|
|
@@ -82,15 +82,26 @@ var __async = (__this, __arguments, generator) => {
|
|
|
82
82
|
};
|
|
83
83
|
function process(config) {
|
|
84
84
|
return __async(this, null, function* () {
|
|
85
|
-
const logger
|
|
86
|
-
const reflectionDebugLogger = logger.createReflectionDebugLogger(logger$1);
|
|
85
|
+
const logger = new errorCollector.NoLogger();
|
|
87
86
|
const configWithDefaults = __spreadValues$1(__spreadValues$1({}, getDefault(config)), config);
|
|
88
87
|
if (!configWithDefaults.sourceDir) {
|
|
89
88
|
throw new Error("sourceDir is required");
|
|
90
89
|
}
|
|
91
|
-
const
|
|
90
|
+
const errorCollector$1 = new errorCollector.ErrorCollector(configWithDefaults.targetGenerator);
|
|
91
|
+
const reflectionDebugLogger = errorCollector.createReflectionDebugLogger(logger, (filePath, errorMessage) => {
|
|
92
|
+
errorCollector$1.addFailure("other", filePath, errorMessage);
|
|
93
|
+
});
|
|
94
|
+
const result = yield errorCollector.Apexdocs.generate(configWithDefaults, {
|
|
95
|
+
logger,
|
|
96
|
+
reflectionDebugLogger,
|
|
97
|
+
errorCollector: errorCollector$1
|
|
98
|
+
});
|
|
92
99
|
E__namespace.match(
|
|
93
100
|
(errors) => {
|
|
101
|
+
if (errorCollector$1.hasErrors()) {
|
|
102
|
+
const details = errorCollector$1.all().map(errorCollector.ErrorCollector.format).join("\n");
|
|
103
|
+
throw new Error(details);
|
|
104
|
+
}
|
|
94
105
|
throw errors;
|
|
95
106
|
},
|
|
96
107
|
() => {
|
|
@@ -101,11 +112,11 @@ function process(config) {
|
|
|
101
112
|
function getDefault(config) {
|
|
102
113
|
switch (config.targetGenerator) {
|
|
103
114
|
case "markdown":
|
|
104
|
-
return
|
|
115
|
+
return errorCollector.markdownDefaults;
|
|
105
116
|
case "openapi":
|
|
106
|
-
return
|
|
117
|
+
return errorCollector.openApiDefaults;
|
|
107
118
|
case "changelog":
|
|
108
|
-
return
|
|
119
|
+
return errorCollector.changeLogDefaults;
|
|
109
120
|
default:
|
|
110
121
|
throw new Error("Unknown target generator");
|
|
111
122
|
}
|
|
@@ -131,23 +142,23 @@ var __spreadValues = (a, b) => {
|
|
|
131
142
|
};
|
|
132
143
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
133
144
|
function defineMarkdownConfig(config) {
|
|
134
|
-
return __spreadProps(__spreadValues(__spreadValues({},
|
|
145
|
+
return __spreadProps(__spreadValues(__spreadValues({}, errorCollector.markdownDefaults), config), {
|
|
135
146
|
targetGenerator: "markdown"
|
|
136
147
|
});
|
|
137
148
|
}
|
|
138
149
|
function defineOpenApiConfig(config) {
|
|
139
|
-
return __spreadProps(__spreadValues(__spreadValues({},
|
|
150
|
+
return __spreadProps(__spreadValues(__spreadValues({}, errorCollector.openApiDefaults), config), {
|
|
140
151
|
targetGenerator: "openapi"
|
|
141
152
|
});
|
|
142
153
|
}
|
|
143
154
|
function defineChangelogConfig(config) {
|
|
144
|
-
return __spreadProps(__spreadValues(__spreadValues({},
|
|
155
|
+
return __spreadProps(__spreadValues(__spreadValues({}, errorCollector.changeLogDefaults), config), {
|
|
145
156
|
targetGenerator: "changelog"
|
|
146
157
|
});
|
|
147
158
|
}
|
|
148
159
|
|
|
149
|
-
exports.skip =
|
|
150
|
-
exports.templateHelpers =
|
|
160
|
+
exports.skip = errorCollector.skip;
|
|
161
|
+
exports.templateHelpers = errorCollector.templateHelpers;
|
|
151
162
|
exports.defineChangelogConfig = defineChangelogConfig;
|
|
152
163
|
exports.defineMarkdownConfig = defineMarkdownConfig;
|
|
153
164
|
exports.defineOpenApiConfig = defineOpenApiConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cparra/apexdocs",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.9-beta.10",
|
|
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.10",
|
|
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",
|