@cparra/apexdocs 3.19.9-beta.1 → 3.19.9-beta.2

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var logger$1 = require('../logger-BA26xTtD.js');
4
+ var logger$1 = require('../logger-BsMnN0q7.js');
5
5
  var cosmiconfig = require('cosmiconfig');
6
6
  var yargs = require('yargs');
7
7
  var E = require('fp-ts/Either');
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var logger = require('./logger-BA26xTtD.js');
4
+ var logger = require('./logger-BsMnN0q7.js');
5
5
  var E = require('fp-ts/Either');
6
6
  require('fp-ts/function');
7
7
  require('fp-ts/TaskEither');
@@ -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(objectBundles, A__namespace$1.traverse(Ap)(reflectCustomObjectSource));
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) => new ReflectionErrors([new ReflectionError(objectSource.filePath, error.message)])),
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(customFieldSources, A__namespace$1.traverse(Ap)(reflectCustomFieldSource));
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.mapLeft((error) => new ReflectionErrors([new ReflectionError(customFieldSource.filePath, error.message)])),
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(customMetadataSources, A__namespace$1.traverse(TE__namespace.ApplicativePar)(reflectCustomMetadataSource));
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) => new ReflectionErrors([new ReflectionError(customMetadataSource.filePath, error.message)])),
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(triggerBundles, A__namespace.traverse(Ap)(reflectBundle$1));
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
- return _function.pipe(triggerBundle, reflectAsTask, TE__namespace.map(convertToParsedFile));
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(triggerBundles, A__namespace.traverse(Ap)(reflectBundle));
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) => new ReflectionErrors([new ReflectionError(lwcBundle.filePath, error.message)])),
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
  }
@@ -3585,14 +3646,15 @@ function generateDocs(unparsedBundles, config, debugLogger) {
3585
3646
  return _function.pipe(
3586
3647
  reflectCustomFieldsAndObjectsAndMetadataRecords(
3587
3648
  filterCustomObjectsFieldsAndMetadataRecords(unparsedBundles),
3588
- config.customObjectVisibility
3649
+ config.customObjectVisibility,
3650
+ debugLogger
3589
3651
  ),
3590
3652
  TE__namespace.map((parsedObjectFiles) => [...parsedApexFiles, ...parsedObjectFiles])
3591
3653
  );
3592
3654
  }),
3593
3655
  TE__namespace.chain((parsedFiles) => {
3594
3656
  return _function.pipe(
3595
- reflectTriggerSource(filterTriggerFiles(unparsedBundles)),
3657
+ reflectTriggerSource(filterTriggerFiles(unparsedBundles), debugLogger),
3596
3658
  TE__namespace.map((parsedTriggerFiles) => [...parsedFiles, ...parsedTriggerFiles])
3597
3659
  );
3598
3660
  }),
@@ -3601,7 +3663,7 @@ function generateDocs(unparsedBundles, config, debugLogger) {
3601
3663
  return TE__namespace.right(parsedFiles);
3602
3664
  }
3603
3665
  return _function.pipe(
3604
- reflectLwcSource(filterLwcFiles(unparsedBundles)),
3666
+ reflectLwcSource(filterLwcFiles(unparsedBundles), debugLogger),
3605
3667
  TE__namespace.map((parsedFiles2) => parsedFiles2.filter((file) => file.type.isExposed)),
3606
3668
  TE__namespace.map((parsedLwcFiles) => [...parsedFiles, ...parsedLwcFiles])
3607
3669
  );
@@ -5616,7 +5678,8 @@ function generateChangeLog(oldBundles, newBundles, config, debugLogger) {
5616
5678
  ({ bundles: bundles2, apex }) => _function.pipe(
5617
5679
  reflectCustomFieldsAndObjectsAndMetadataRecords(
5618
5680
  filterCustomObjectsFieldsAndMetadataRecords(bundles2),
5619
- config.customObjectVisibility
5681
+ config.customObjectVisibility,
5682
+ debugLogger
5620
5683
  ),
5621
5684
  TE__namespace.map((parsedObjectFiles) => ({
5622
5685
  parsedFiles: [...apex.parsedFiles, ...parsedObjectFiles],
@@ -5630,7 +5693,7 @@ function generateChangeLog(oldBundles, newBundles, config, debugLogger) {
5630
5693
  TE__namespace.bind(
5631
5694
  "all",
5632
5695
  ({ objects, bundles: bundles2 }) => _function.pipe(
5633
- reflectTriggerSource(filterTriggerFiles(bundles2)),
5696
+ reflectTriggerSource(filterTriggerFiles(bundles2), debugLogger),
5634
5697
  TE__namespace.map((parsedTriggerFiles) => ({
5635
5698
  parsedFiles: [...objects.parsedFiles, ...parsedTriggerFiles],
5636
5699
  errors: objects.errors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cparra/apexdocs",
3
- "version": "3.19.9-beta.1",
3
+ "version": "3.19.9-beta.2",
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-dev.20260107145611",
99
+ "@cparra/apex-reflection": "2.23.7",
100
100
  "@salesforce/source-deploy-retrieve": "^12.20.1",
101
101
  "@types/js-yaml": "^4.0.9",
102
102
  "@types/yargs": "^17.0.32",