@cparra/apexdocs 3.17.1-beta.1 → 3.17.1-beta.3
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 +39 -41
- package/dist/index.js +13 -12
- package/dist/{Apexdocs-DPBWi8Yn.js → logger-Vr_GM9Dn.js} +131 -164
- package/package.json +1 -1
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 logger$1 = require('../logger-Vr_GM9Dn.js');
|
|
5
5
|
var cosmiconfig = require('cosmiconfig');
|
|
6
6
|
var yargs = require('yargs');
|
|
7
7
|
var E = require('fp-ts/Either');
|
|
@@ -24,9 +24,9 @@ require('fp-ts/boolean');
|
|
|
24
24
|
require('fp-ts/Array');
|
|
25
25
|
require('fs');
|
|
26
26
|
require('fp-ts/lib/TaskEither');
|
|
27
|
-
require('chalk');
|
|
28
27
|
require('minimatch');
|
|
29
28
|
require('@salesforce/source-deploy-retrieve');
|
|
29
|
+
require('chalk');
|
|
30
30
|
|
|
31
31
|
function _interopNamespaceDefault(e) {
|
|
32
32
|
var n = Object.create(null);
|
|
@@ -79,42 +79,42 @@ const markdownOptions = {
|
|
|
79
79
|
targetDir: {
|
|
80
80
|
type: "string",
|
|
81
81
|
alias: "t",
|
|
82
|
-
default:
|
|
82
|
+
default: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.markdownDefaults.linkingStrategy
|
|
139
139
|
},
|
|
140
140
|
referenceGuideTitle: {
|
|
141
141
|
type: "string",
|
|
142
142
|
describe: "The title of the reference guide.",
|
|
143
|
-
default:
|
|
143
|
+
default: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.openApiDefaults.title,
|
|
218
218
|
describe: "The title of the OpenApi file."
|
|
219
219
|
},
|
|
220
220
|
apiVersion: {
|
|
221
221
|
type: "string",
|
|
222
|
-
default:
|
|
222
|
+
default: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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: logger$1.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
|
+
logger$1.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
|
+
logger$1.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
|
+
logger$1.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
|
+
logger$1.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", () => logger$1.validateSourceDirectoryConfig(previousVersionConfig)),
|
|
561
|
+
E__namespace.bind("currentValid", () => logger$1.validateSourceDirectoryConfig(currentVersionConfig)),
|
|
562
562
|
E__namespace.map(() => config)
|
|
563
563
|
);
|
|
564
564
|
}
|
|
@@ -586,11 +586,9 @@ 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 logger$1.StdOutLogger();
|
|
590
590
|
logger.setDebug(isDebugEnabledFromProcessArgs());
|
|
591
|
-
|
|
592
|
-
process.env.APEXDOCS_DEBUG = "true";
|
|
593
|
-
}
|
|
591
|
+
const reflectionDebugLogger = logger$1.createReflectionDebugLogger(logger);
|
|
594
592
|
function main() {
|
|
595
593
|
const aggregatedFailures = [];
|
|
596
594
|
let commandsRun = 0;
|
|
@@ -632,7 +630,7 @@ function main() {
|
|
|
632
630
|
if (logger.isDebugEnabled()) {
|
|
633
631
|
logger.debug(`Currently processing generator: ${config.targetGenerator}`);
|
|
634
632
|
}
|
|
635
|
-
const result = yield
|
|
633
|
+
const result = yield logger$1.Apexdocs.generate(config, { logger, reflectionDebugLogger });
|
|
636
634
|
if (logger.isDebugEnabled()) {
|
|
637
635
|
logger.logSingle(
|
|
638
636
|
`${config.targetGenerator}: ${E__namespace.isRight(result) ? "success" : "failure"}`,
|
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 logger = require('./logger-Vr_GM9Dn.js');
|
|
5
5
|
var E = require('fp-ts/Either');
|
|
6
6
|
require('fp-ts/function');
|
|
7
7
|
require('fp-ts/TaskEither');
|
|
@@ -21,9 +21,9 @@ require('fp-ts/boolean');
|
|
|
21
21
|
require('fp-ts/Array');
|
|
22
22
|
require('fs');
|
|
23
23
|
require('fp-ts/lib/TaskEither');
|
|
24
|
-
require('chalk');
|
|
25
24
|
require('minimatch');
|
|
26
25
|
require('@salesforce/source-deploy-retrieve');
|
|
26
|
+
require('chalk');
|
|
27
27
|
|
|
28
28
|
function _interopNamespaceDefault(e) {
|
|
29
29
|
var n = Object.create(null);
|
|
@@ -82,12 +82,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
82
82
|
};
|
|
83
83
|
function process(config) {
|
|
84
84
|
return __async(this, null, function* () {
|
|
85
|
-
const logger = new
|
|
85
|
+
const logger$1 = new logger.NoLogger();
|
|
86
|
+
const reflectionDebugLogger = logger.createReflectionDebugLogger(logger$1);
|
|
86
87
|
const configWithDefaults = __spreadValues$1(__spreadValues$1({}, getDefault(config)), config);
|
|
87
88
|
if (!configWithDefaults.sourceDir) {
|
|
88
89
|
throw new Error("sourceDir is required");
|
|
89
90
|
}
|
|
90
|
-
const result = yield
|
|
91
|
+
const result = yield logger.Apexdocs.generate(configWithDefaults, { logger: logger$1, reflectionDebugLogger });
|
|
91
92
|
E__namespace.match(
|
|
92
93
|
(errors) => {
|
|
93
94
|
throw errors;
|
|
@@ -100,11 +101,11 @@ function process(config) {
|
|
|
100
101
|
function getDefault(config) {
|
|
101
102
|
switch (config.targetGenerator) {
|
|
102
103
|
case "markdown":
|
|
103
|
-
return
|
|
104
|
+
return logger.markdownDefaults;
|
|
104
105
|
case "openapi":
|
|
105
|
-
return
|
|
106
|
+
return logger.openApiDefaults;
|
|
106
107
|
case "changelog":
|
|
107
|
-
return
|
|
108
|
+
return logger.changeLogDefaults;
|
|
108
109
|
default:
|
|
109
110
|
throw new Error("Unknown target generator");
|
|
110
111
|
}
|
|
@@ -130,23 +131,23 @@ var __spreadValues = (a, b) => {
|
|
|
130
131
|
};
|
|
131
132
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
132
133
|
function defineMarkdownConfig(config) {
|
|
133
|
-
return __spreadProps(__spreadValues(__spreadValues({},
|
|
134
|
+
return __spreadProps(__spreadValues(__spreadValues({}, logger.markdownDefaults), config), {
|
|
134
135
|
targetGenerator: "markdown"
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
138
|
function defineOpenApiConfig(config) {
|
|
138
|
-
return __spreadProps(__spreadValues(__spreadValues({},
|
|
139
|
+
return __spreadProps(__spreadValues(__spreadValues({}, logger.openApiDefaults), config), {
|
|
139
140
|
targetGenerator: "openapi"
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
143
|
function defineChangelogConfig(config) {
|
|
143
|
-
return __spreadProps(__spreadValues(__spreadValues({},
|
|
144
|
+
return __spreadProps(__spreadValues(__spreadValues({}, logger.changeLogDefaults), config), {
|
|
144
145
|
targetGenerator: "changelog"
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
148
|
|
|
148
|
-
exports.skip =
|
|
149
|
-
exports.templateHelpers =
|
|
149
|
+
exports.skip = logger.skip;
|
|
150
|
+
exports.templateHelpers = logger.templateHelpers;
|
|
150
151
|
exports.defineChangelogConfig = defineChangelogConfig;
|
|
151
152
|
exports.defineMarkdownConfig = defineMarkdownConfig;
|
|
152
153
|
exports.defineOpenApiConfig = defineOpenApiConfig;
|
|
@@ -19,9 +19,9 @@ var boolean = require('fp-ts/boolean');
|
|
|
19
19
|
var A$1 = require('fp-ts/Array');
|
|
20
20
|
var fs$1 = require('fs');
|
|
21
21
|
var TE$1 = require('fp-ts/lib/TaskEither');
|
|
22
|
-
var chalk = require('chalk');
|
|
23
22
|
var minimatch = require('minimatch');
|
|
24
23
|
var sourceDeployRetrieve = require('@salesforce/source-deploy-retrieve');
|
|
24
|
+
var chalk = require('chalk');
|
|
25
25
|
|
|
26
26
|
function _interopNamespaceDefault(e) {
|
|
27
27
|
var n = Object.create(null);
|
|
@@ -1420,14 +1420,13 @@ var __async$5 = (__this, __arguments, generator) => {
|
|
|
1420
1420
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
1421
1421
|
});
|
|
1422
1422
|
};
|
|
1423
|
-
const
|
|
1424
|
-
onStart: () => {
|
|
1425
|
-
},
|
|
1423
|
+
const noopReflectionDebugLogger = {
|
|
1426
1424
|
onSuccess: () => {
|
|
1427
1425
|
},
|
|
1428
1426
|
onFailure: () => {
|
|
1429
1427
|
}
|
|
1430
1428
|
};
|
|
1429
|
+
const noopDebugLogger = noopReflectionDebugLogger;
|
|
1431
1430
|
function reflectAsync$1(rawSource) {
|
|
1432
1431
|
return __async$5(this, null, function* () {
|
|
1433
1432
|
return new Promise((resolve, reject) => {
|
|
@@ -1484,7 +1483,6 @@ function reflectApexSourceBestEffort(apexBundles, config, debugLogger = noopDebu
|
|
|
1484
1483
|
return _function.pipe(
|
|
1485
1484
|
apexBundles,
|
|
1486
1485
|
A__namespace.traverse(Ap)((bundle) => {
|
|
1487
|
-
debugLogger.onStart(bundle.filePath);
|
|
1488
1486
|
return _function.pipe(
|
|
1489
1487
|
reflectBundle$2(bundle),
|
|
1490
1488
|
TE__namespace.map((parsed) => {
|
|
@@ -1514,9 +1512,7 @@ function reflectApexSourceBestEffort(apexBundles, config, debugLogger = noopDebu
|
|
|
1514
1512
|
try {
|
|
1515
1513
|
const results = yield Promise.allSettled(
|
|
1516
1514
|
apexBundles.map((bundle) => __async$5(null, null, function* () {
|
|
1517
|
-
|
|
1518
|
-
const typeMirror = yield pool.run({ content: bundle.content });
|
|
1519
|
-
return typeMirror;
|
|
1515
|
+
return yield pool.run({ content: bundle.content });
|
|
1520
1516
|
}))
|
|
1521
1517
|
);
|
|
1522
1518
|
const errors = [];
|
|
@@ -3656,13 +3652,24 @@ function generateForApex(apexBundles, config, debugLogger) {
|
|
|
3656
3652
|
},
|
|
3657
3653
|
debugLogger
|
|
3658
3654
|
),
|
|
3659
|
-
TE__namespace.
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3655
|
+
TE__namespace.flatMap(({ successes, errors }) => {
|
|
3656
|
+
const filtered = _function.pipe(
|
|
3657
|
+
TE__namespace.right(successes),
|
|
3658
|
+
TE__namespace.map(filterOutOfScope),
|
|
3659
|
+
TE__namespace.map(addInheritedMembersToTypes),
|
|
3660
|
+
TE__namespace.map(addInheritanceChainToTypes),
|
|
3661
|
+
TE__namespace.map(removeExcluded)
|
|
3662
|
+
);
|
|
3663
|
+
return _function.pipe(
|
|
3664
|
+
filtered,
|
|
3665
|
+
TE__namespace.flatMap((parsed) => {
|
|
3666
|
+
if (errors.errors.length > 0) {
|
|
3667
|
+
return TE__namespace.left(errors);
|
|
3668
|
+
}
|
|
3669
|
+
return TE__namespace.right(parsed);
|
|
3670
|
+
})
|
|
3671
|
+
);
|
|
3672
|
+
})
|
|
3666
3673
|
);
|
|
3667
3674
|
}
|
|
3668
3675
|
function transformReferenceHook(config) {
|
|
@@ -4777,6 +4784,21 @@ class OpenApiDocsProcessor {
|
|
|
4777
4784
|
}
|
|
4778
4785
|
}
|
|
4779
4786
|
|
|
4787
|
+
function createReflectionDebugLogger(logger) {
|
|
4788
|
+
if (!logger.isDebugEnabled()) {
|
|
4789
|
+
return noopReflectionDebugLogger;
|
|
4790
|
+
}
|
|
4791
|
+
return {
|
|
4792
|
+
onSuccess: (filePath) => {
|
|
4793
|
+
logger.debug(`Parsing: ${filePath} OK`);
|
|
4794
|
+
},
|
|
4795
|
+
onFailure: (filePath, errorMessage) => {
|
|
4796
|
+
logger.debug(`Parsing: ${filePath} FAILED`);
|
|
4797
|
+
logger.debug(`Parsing error: ${filePath} - ${errorMessage}`);
|
|
4798
|
+
}
|
|
4799
|
+
};
|
|
4800
|
+
}
|
|
4801
|
+
|
|
4780
4802
|
var __defProp$2 = Object.defineProperty;
|
|
4781
4803
|
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
4782
4804
|
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
@@ -4824,18 +4846,7 @@ function openApi(logger, fileBodies, config) {
|
|
|
4824
4846
|
namespace: config.namespace,
|
|
4825
4847
|
version: config.apiVersion
|
|
4826
4848
|
});
|
|
4827
|
-
const debugLogger =
|
|
4828
|
-
onStart: (filePath) => {
|
|
4829
|
-
logger.debug(`Parsing: ${filePath}`);
|
|
4830
|
-
},
|
|
4831
|
-
onSuccess: (filePath) => {
|
|
4832
|
-
logger.logSingle(`Parsing: ${filePath} OK`, "green");
|
|
4833
|
-
},
|
|
4834
|
-
onFailure: (filePath, errorMessage) => {
|
|
4835
|
-
logger.logSingle(`Parsing: ${filePath} FAILED`, "red");
|
|
4836
|
-
logger.debug(`Parsing error: ${filePath} - ${errorMessage}`);
|
|
4837
|
-
}
|
|
4838
|
-
};
|
|
4849
|
+
const debugLogger = createReflectionDebugLogger(logger);
|
|
4839
4850
|
const reflectedEither = yield reflectApexSourceBestEffort(
|
|
4840
4851
|
fileBodies,
|
|
4841
4852
|
{
|
|
@@ -4845,9 +4856,7 @@ function openApi(logger, fileBodies, config) {
|
|
|
4845
4856
|
debugLogger
|
|
4846
4857
|
)();
|
|
4847
4858
|
if (E__namespace.isLeft(reflectedEither)) {
|
|
4848
|
-
|
|
4849
|
-
logger.error(errors);
|
|
4850
|
-
return;
|
|
4859
|
+
return E__namespace.left(reflectedEither.left);
|
|
4851
4860
|
}
|
|
4852
4861
|
const { successes: parsedFiles, errors: recoverableErrors } = reflectedEither.right;
|
|
4853
4862
|
if (recoverableErrors.errors.length > 0) {
|
|
@@ -4882,13 +4891,24 @@ function openApi(logger, fileBodies, config) {
|
|
|
4882
4891
|
const processor = new OpenApiDocsProcessor(logger);
|
|
4883
4892
|
Transpiler.generate(filteredTypes, processor);
|
|
4884
4893
|
const generatedFiles = processor.fileBuilder().files();
|
|
4885
|
-
yield _function.pipe(
|
|
4894
|
+
const writeResult = yield _function.pipe(
|
|
4886
4895
|
writeFiles(generatedFiles, config.targetDir, (file) => {
|
|
4887
4896
|
logger.logSingle(`${file.outputDocPath} processed.`, "green");
|
|
4888
4897
|
}),
|
|
4889
|
-
TE__namespace.
|
|
4898
|
+
TE__namespace.mapLeft((error) => new FileWritingError("An error occurred while writing files to the system.", error))
|
|
4890
4899
|
)();
|
|
4900
|
+
if (E__namespace.isLeft(writeResult)) {
|
|
4901
|
+
return E__namespace.left(writeResult.left);
|
|
4902
|
+
}
|
|
4891
4903
|
ErrorLogger.logErrors(logger, filteredTypes);
|
|
4904
|
+
if (recoverableErrors.errors.length > 0) {
|
|
4905
|
+
return E__namespace.left(
|
|
4906
|
+
new ReflectionErrors(
|
|
4907
|
+
recoverableErrors.errors.map((e) => __spreadValues$2({}, e))
|
|
4908
|
+
)
|
|
4909
|
+
);
|
|
4910
|
+
}
|
|
4911
|
+
return E__namespace.right(void 0);
|
|
4892
4912
|
});
|
|
4893
4913
|
}
|
|
4894
4914
|
function filterByScopes(logger, manifest) {
|
|
@@ -5505,71 +5525,6 @@ function changelogToSourceChangelog(changelog) {
|
|
|
5505
5525
|
};
|
|
5506
5526
|
}
|
|
5507
5527
|
|
|
5508
|
-
class StdOutLogger {
|
|
5509
|
-
constructor(options) {
|
|
5510
|
-
this.debugEnabled = false;
|
|
5511
|
-
var _a;
|
|
5512
|
-
this.debugEnabled = (_a = options == null ? void 0 : options.debug) != null ? _a : false;
|
|
5513
|
-
}
|
|
5514
|
-
setDebug(enabled) {
|
|
5515
|
-
this.debugEnabled = enabled;
|
|
5516
|
-
}
|
|
5517
|
-
isDebugEnabled() {
|
|
5518
|
-
return this.debugEnabled;
|
|
5519
|
-
}
|
|
5520
|
-
debug(message) {
|
|
5521
|
-
if (!this.debugEnabled) {
|
|
5522
|
-
return;
|
|
5523
|
-
}
|
|
5524
|
-
this.logSingle(`[debug] ${String(message)}`);
|
|
5525
|
-
}
|
|
5526
|
-
/**
|
|
5527
|
-
* Logs a message with optional arguments.
|
|
5528
|
-
* @param message The message to log.
|
|
5529
|
-
* @param args Optional arguments.
|
|
5530
|
-
*/
|
|
5531
|
-
log(message, ...args) {
|
|
5532
|
-
this.logSingle(message);
|
|
5533
|
-
args.forEach((arg) => {
|
|
5534
|
-
this.logSingle(arg);
|
|
5535
|
-
});
|
|
5536
|
-
}
|
|
5537
|
-
/**
|
|
5538
|
-
* Logs an error message with optional arguments.
|
|
5539
|
-
* @param message The error message to log.
|
|
5540
|
-
* @param args Optional arguments.
|
|
5541
|
-
*/
|
|
5542
|
-
error(message, ...args) {
|
|
5543
|
-
this.logSingle(message, "red");
|
|
5544
|
-
args.forEach(() => {
|
|
5545
|
-
this.logSingle(message, "red");
|
|
5546
|
-
});
|
|
5547
|
-
}
|
|
5548
|
-
logSingle(text, color = "green") {
|
|
5549
|
-
const logMessage = `${this.getChalkFn(color)((/* @__PURE__ */ new Date()).toLocaleString() + ": ")}${text}
|
|
5550
|
-
`;
|
|
5551
|
-
process.stdout.write(logMessage);
|
|
5552
|
-
}
|
|
5553
|
-
getChalkFn(color) {
|
|
5554
|
-
return color === "green" ? chalk.green : chalk.red;
|
|
5555
|
-
}
|
|
5556
|
-
}
|
|
5557
|
-
class NoLogger {
|
|
5558
|
-
setDebug(enabled) {
|
|
5559
|
-
}
|
|
5560
|
-
isDebugEnabled() {
|
|
5561
|
-
return false;
|
|
5562
|
-
}
|
|
5563
|
-
debug(message) {
|
|
5564
|
-
}
|
|
5565
|
-
log(message, ...args) {
|
|
5566
|
-
}
|
|
5567
|
-
error(message, ...args) {
|
|
5568
|
-
}
|
|
5569
|
-
logSingle(text, color) {
|
|
5570
|
-
}
|
|
5571
|
-
}
|
|
5572
|
-
|
|
5573
5528
|
var __defProp$1 = Object.defineProperty;
|
|
5574
5529
|
var __defProps$1 = Object.defineProperties;
|
|
5575
5530
|
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
@@ -5615,34 +5570,7 @@ function changelogReflectionConfig(config) {
|
|
|
5615
5570
|
parallelReflectionMaxWorkers: config.parallelReflectionMaxWorkers
|
|
5616
5571
|
};
|
|
5617
5572
|
}
|
|
5618
|
-
function
|
|
5619
|
-
var _a, _b;
|
|
5620
|
-
const enabled = ((_a = process.env.APEXDOCS_DEBUG) != null ? _a : "").toLowerCase() === "true" || ((_b = process.env.APEXDOCS_DEBUG) != null ? _b : "").toLowerCase() === "1";
|
|
5621
|
-
const logger = new StdOutLogger({ debug: enabled });
|
|
5622
|
-
if (!enabled) {
|
|
5623
|
-
return {
|
|
5624
|
-
onStart: () => {
|
|
5625
|
-
},
|
|
5626
|
-
onSuccess: () => {
|
|
5627
|
-
},
|
|
5628
|
-
onFailure: () => {
|
|
5629
|
-
}
|
|
5630
|
-
};
|
|
5631
|
-
}
|
|
5632
|
-
return {
|
|
5633
|
-
onStart: (filePath) => {
|
|
5634
|
-
logger.debug(`Parsing: ${filePath}`);
|
|
5635
|
-
},
|
|
5636
|
-
onSuccess: (filePath) => {
|
|
5637
|
-
logger.logSingle(`Parsing: ${filePath} OK`, "green");
|
|
5638
|
-
},
|
|
5639
|
-
onFailure: (filePath, errorMessage) => {
|
|
5640
|
-
logger.logSingle(`Parsing: ${filePath} FAILED`, "red");
|
|
5641
|
-
logger.debug(`Parsing error: ${filePath} - ${errorMessage}`);
|
|
5642
|
-
}
|
|
5643
|
-
};
|
|
5644
|
-
}
|
|
5645
|
-
function generateChangeLog(oldBundles, newBundles, config) {
|
|
5573
|
+
function generateChangeLog(oldBundles, newBundles, config, debugLogger) {
|
|
5646
5574
|
const convertToPageData = apply(toPageData, config.fileName);
|
|
5647
5575
|
function handleConversion({ changelog, newManifest }) {
|
|
5648
5576
|
if (config.skipIfNoChanges && !hasChanges(changelog)) {
|
|
@@ -5657,12 +5585,10 @@ function generateChangeLog(oldBundles, newBundles, config) {
|
|
|
5657
5585
|
}
|
|
5658
5586
|
const reflectVersionBestEffort = (bundles) => {
|
|
5659
5587
|
const filterOutOfScopeApex = apply(filterScope, config.scope);
|
|
5660
|
-
const debugLogger = getDebugLogger();
|
|
5661
5588
|
const apexConfig = changelogReflectionConfig(config);
|
|
5662
5589
|
return _function.pipe(
|
|
5663
5590
|
TE__namespace.right(bundles),
|
|
5664
5591
|
TE__namespace.bindTo("bundles"),
|
|
5665
|
-
// 1) Apex
|
|
5666
5592
|
TE__namespace.bind(
|
|
5667
5593
|
"apex",
|
|
5668
5594
|
({ bundles: bundles2 }) => _function.pipe(
|
|
@@ -5675,11 +5601,9 @@ function generateChangeLog(oldBundles, newBundles, config) {
|
|
|
5675
5601
|
parsedFiles: filterOutOfScopeApex(successes),
|
|
5676
5602
|
errors
|
|
5677
5603
|
})),
|
|
5678
|
-
// Best-effort: if the reflection system itself fails unexpectedly, treat that as a single error and continue.
|
|
5679
5604
|
TE__namespace.orElseW((errs) => TE__namespace.right({ parsedFiles: [], errors: errs }))
|
|
5680
5605
|
)
|
|
5681
5606
|
),
|
|
5682
|
-
// 2) Custom objects / fields / metadata records
|
|
5683
5607
|
TE__namespace.bind(
|
|
5684
5608
|
"objects",
|
|
5685
5609
|
({ bundles: bundles2, apex }) => _function.pipe(
|
|
@@ -5691,13 +5615,12 @@ function generateChangeLog(oldBundles, newBundles, config) {
|
|
|
5691
5615
|
parsedFiles: [...apex.parsedFiles, ...parsedObjectFiles],
|
|
5692
5616
|
errors: apex.errors
|
|
5693
5617
|
})),
|
|
5694
|
-
//
|
|
5618
|
+
// We swallow failures here and keep going, because
|
|
5695
5619
|
// this helper's left type is `never`. Any such failures are treated as if
|
|
5696
5620
|
// this step produced no additional parsed files.
|
|
5697
5621
|
TE__namespace.orElseW(() => TE__namespace.right({ parsedFiles: apex.parsedFiles, errors: apex.errors }))
|
|
5698
5622
|
)
|
|
5699
5623
|
),
|
|
5700
|
-
// 3) Triggers
|
|
5701
5624
|
TE__namespace.bind(
|
|
5702
5625
|
"all",
|
|
5703
5626
|
({ objects, bundles: bundles2 }) => _function.pipe(
|
|
@@ -5706,7 +5629,7 @@ function generateChangeLog(oldBundles, newBundles, config) {
|
|
|
5706
5629
|
parsedFiles: [...objects.parsedFiles, ...parsedTriggerFiles],
|
|
5707
5630
|
errors: objects.errors
|
|
5708
5631
|
})),
|
|
5709
|
-
//
|
|
5632
|
+
// We swallow failures here and keep going, because
|
|
5710
5633
|
// this helper's left type is `never`. Any such failures are treated as if
|
|
5711
5634
|
// no triggers were parsed.
|
|
5712
5635
|
TE__namespace.orElseW(() => TE__namespace.right({ parsedFiles: objects.parsedFiles, errors: objects.errors }))
|
|
@@ -5822,14 +5745,14 @@ function postHookCompile(page) {
|
|
|
5822
5745
|
});
|
|
5823
5746
|
}
|
|
5824
5747
|
|
|
5825
|
-
function generate(oldBundles, newBundles, config) {
|
|
5748
|
+
function generate(oldBundles, newBundles, config, debugLogger) {
|
|
5826
5749
|
function handleFile(file) {
|
|
5827
5750
|
if (isSkip(file)) {
|
|
5828
5751
|
return TE__namespace.right("\u2714\uFE0F Done! Skipped writing files to the system.");
|
|
5829
5752
|
}
|
|
5830
5753
|
return writeFilesToSystem(file, config.targetDir);
|
|
5831
5754
|
}
|
|
5832
|
-
return _function.pipe(generateChangeLog(oldBundles, newBundles, config), TE__namespace.flatMap(handleFile));
|
|
5755
|
+
return _function.pipe(generateChangeLog(oldBundles, newBundles, config, debugLogger), TE__namespace.flatMap(handleFile));
|
|
5833
5756
|
}
|
|
5834
5757
|
function writeFilesToSystem(pageData, outputDir) {
|
|
5835
5758
|
return _function.pipe(
|
|
@@ -6245,19 +6168,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
6245
6168
|
class Apexdocs {
|
|
6246
6169
|
/**
|
|
6247
6170
|
* Generates documentation out of Apex source files.
|
|
6248
|
-
*
|
|
6249
|
-
* NOTE:
|
|
6250
|
-
* - Markdown + Changelog generators are now expected to be "best-effort" and may return both successes and
|
|
6251
|
-
* recoverable parse/reflection failures (to be presented at the end of the run).
|
|
6252
|
-
* - OpenAPI is handled separately and already has its own logging/reporting behavior.
|
|
6253
6171
|
*/
|
|
6254
|
-
static generate(config,
|
|
6172
|
+
static generate(config, deps) {
|
|
6255
6173
|
return __async(this, null, function* () {
|
|
6174
|
+
const { logger, reflectionDebugLogger } = deps;
|
|
6256
6175
|
logger.logSingle(`Generating ${config.targetGenerator} documentation...`);
|
|
6257
6176
|
try {
|
|
6258
6177
|
switch (config.targetGenerator) {
|
|
6259
6178
|
case "markdown": {
|
|
6260
|
-
return (yield processMarkdown(config, logger))();
|
|
6179
|
+
return (yield processMarkdown(config, logger, reflectionDebugLogger))();
|
|
6261
6180
|
}
|
|
6262
6181
|
case "openapi": {
|
|
6263
6182
|
const task = yield processOpenApi(config, logger);
|
|
@@ -6268,7 +6187,7 @@ class Apexdocs {
|
|
|
6268
6187
|
return E__namespace.right("\u2714\uFE0F Documentation generated successfully!");
|
|
6269
6188
|
}
|
|
6270
6189
|
case "changelog": {
|
|
6271
|
-
return (yield processChangeLog(config, logger))();
|
|
6190
|
+
return (yield processChangeLog(config, logger, reflectionDebugLogger))();
|
|
6272
6191
|
}
|
|
6273
6192
|
}
|
|
6274
6193
|
} catch (error) {
|
|
@@ -6278,23 +6197,9 @@ class Apexdocs {
|
|
|
6278
6197
|
}
|
|
6279
6198
|
}
|
|
6280
6199
|
const readFiles = apply(processFiles, new DefaultFileSystem());
|
|
6281
|
-
function processMarkdown(config, logger) {
|
|
6200
|
+
function processMarkdown(config, logger, reflectionDebugLogger) {
|
|
6282
6201
|
return __async(this, null, function* () {
|
|
6283
|
-
const debugLogger =
|
|
6284
|
-
onStart: (filePath) => {
|
|
6285
|
-
if (!logger.isDebugEnabled()) return;
|
|
6286
|
-
logger.debug(`Parsing: ${filePath}`);
|
|
6287
|
-
},
|
|
6288
|
-
onSuccess: (filePath) => {
|
|
6289
|
-
if (!logger.isDebugEnabled()) return;
|
|
6290
|
-
logger.logSingle(`Parsing: ${filePath} OK`, "green");
|
|
6291
|
-
},
|
|
6292
|
-
onFailure: (filePath, errorMessage) => {
|
|
6293
|
-
if (!logger.isDebugEnabled()) return;
|
|
6294
|
-
logger.logSingle(`Parsing: ${filePath} FAILED`, "red");
|
|
6295
|
-
logger.debug(`Parsing error: ${filePath} - ${errorMessage}`);
|
|
6296
|
-
}
|
|
6297
|
-
};
|
|
6202
|
+
const debugLogger = reflectionDebugLogger;
|
|
6298
6203
|
return _function.pipe(
|
|
6299
6204
|
resolveAndValidateSourceDirectories(config),
|
|
6300
6205
|
E__namespace.mapLeft((error) => new FileReadingError(`Failed to resolve source directories: ${error.message}`, error)),
|
|
@@ -6309,8 +6214,6 @@ function processMarkdown(config, logger) {
|
|
|
6309
6214
|
TE__namespace.fromEither,
|
|
6310
6215
|
TE__namespace.flatMap((fileBodies) => generate$1(fileBodies, config, debugLogger)),
|
|
6311
6216
|
TE__namespace.map(() => "\u2714\uFE0F Documentation generated successfully!"),
|
|
6312
|
-
// Best-effort behavior: if there were recoverable parse/reflection failures, they should be returned here
|
|
6313
|
-
// (for presentation to the user at the end of the run), not thrown earlier.
|
|
6314
6217
|
TE__namespace.mapLeft((err) => {
|
|
6315
6218
|
const errors = toErrors(err);
|
|
6316
6219
|
if (logger.isDebugEnabled()) {
|
|
@@ -6342,7 +6245,7 @@ function processOpenApi(config, logger) {
|
|
|
6342
6245
|
);
|
|
6343
6246
|
});
|
|
6344
6247
|
}
|
|
6345
|
-
function processChangeLog(config, logger) {
|
|
6248
|
+
function processChangeLog(config, logger, reflectionDebugLogger) {
|
|
6346
6249
|
return __async(this, null, function* () {
|
|
6347
6250
|
function loadFiles() {
|
|
6348
6251
|
const previousVersionConfig = {
|
|
@@ -6380,9 +6283,7 @@ function processChangeLog(config, logger) {
|
|
|
6380
6283
|
return _function.pipe(
|
|
6381
6284
|
loadFiles(),
|
|
6382
6285
|
TE__namespace.fromEither,
|
|
6383
|
-
TE__namespace.flatMap(([previous, current]) => generate(previous, current, config)),
|
|
6384
|
-
// Best-effort behavior: if there were recoverable parse/reflection failures, they should be returned here
|
|
6385
|
-
// (for presentation to the user at the end of the run), not thrown earlier.
|
|
6286
|
+
TE__namespace.flatMap(([previous, current]) => generate(previous, current, config, reflectionDebugLogger)),
|
|
6386
6287
|
TE__namespace.mapLeft((err) => {
|
|
6387
6288
|
const errors = toErrors(err);
|
|
6388
6289
|
if (logger.isDebugEnabled()) {
|
|
@@ -6414,10 +6315,76 @@ ${error.message}
|
|
|
6414
6315
|
`;
|
|
6415
6316
|
}
|
|
6416
6317
|
|
|
6318
|
+
class StdOutLogger {
|
|
6319
|
+
constructor(options) {
|
|
6320
|
+
this.debugEnabled = false;
|
|
6321
|
+
var _a;
|
|
6322
|
+
this.debugEnabled = (_a = options == null ? void 0 : options.debug) != null ? _a : false;
|
|
6323
|
+
}
|
|
6324
|
+
setDebug(enabled) {
|
|
6325
|
+
this.debugEnabled = enabled;
|
|
6326
|
+
}
|
|
6327
|
+
isDebugEnabled() {
|
|
6328
|
+
return this.debugEnabled;
|
|
6329
|
+
}
|
|
6330
|
+
debug(message) {
|
|
6331
|
+
if (!this.debugEnabled) {
|
|
6332
|
+
return;
|
|
6333
|
+
}
|
|
6334
|
+
this.logSingle(`[debug] ${String(message)}`);
|
|
6335
|
+
}
|
|
6336
|
+
/**
|
|
6337
|
+
* Logs a message with optional arguments.
|
|
6338
|
+
* @param message The message to log.
|
|
6339
|
+
* @param args Optional arguments.
|
|
6340
|
+
*/
|
|
6341
|
+
log(message, ...args) {
|
|
6342
|
+
this.logSingle(message);
|
|
6343
|
+
args.forEach((arg) => {
|
|
6344
|
+
this.logSingle(arg);
|
|
6345
|
+
});
|
|
6346
|
+
}
|
|
6347
|
+
/**
|
|
6348
|
+
* Logs an error message with optional arguments.
|
|
6349
|
+
* @param message The error message to log.
|
|
6350
|
+
* @param args Optional arguments.
|
|
6351
|
+
*/
|
|
6352
|
+
error(message, ...args) {
|
|
6353
|
+
this.logSingle(message, "red");
|
|
6354
|
+
args.forEach(() => {
|
|
6355
|
+
this.logSingle(message, "red");
|
|
6356
|
+
});
|
|
6357
|
+
}
|
|
6358
|
+
logSingle(text, color = "green") {
|
|
6359
|
+
const logMessage = `${this.getChalkFn(color)((/* @__PURE__ */ new Date()).toLocaleString() + ": ")}${text}
|
|
6360
|
+
`;
|
|
6361
|
+
process.stdout.write(logMessage);
|
|
6362
|
+
}
|
|
6363
|
+
getChalkFn(color) {
|
|
6364
|
+
return color === "green" ? chalk.green : chalk.red;
|
|
6365
|
+
}
|
|
6366
|
+
}
|
|
6367
|
+
class NoLogger {
|
|
6368
|
+
setDebug(enabled) {
|
|
6369
|
+
}
|
|
6370
|
+
isDebugEnabled() {
|
|
6371
|
+
return false;
|
|
6372
|
+
}
|
|
6373
|
+
debug(message) {
|
|
6374
|
+
}
|
|
6375
|
+
log(message, ...args) {
|
|
6376
|
+
}
|
|
6377
|
+
error(message, ...args) {
|
|
6378
|
+
}
|
|
6379
|
+
logSingle(text, color) {
|
|
6380
|
+
}
|
|
6381
|
+
}
|
|
6382
|
+
|
|
6417
6383
|
exports.Apexdocs = Apexdocs;
|
|
6418
6384
|
exports.NoLogger = NoLogger;
|
|
6419
6385
|
exports.StdOutLogger = StdOutLogger;
|
|
6420
6386
|
exports.changeLogDefaults = changeLogDefaults;
|
|
6387
|
+
exports.createReflectionDebugLogger = createReflectionDebugLogger;
|
|
6421
6388
|
exports.markdownDefaults = markdownDefaults;
|
|
6422
6389
|
exports.openApiDefaults = openApiDefaults;
|
|
6423
6390
|
exports.skip = skip;
|