@codometer/output 0.0.9 → 0.0.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/src/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import { z as e } from "zod";
2
2
  import { ConsoleLogger as t, Global as n, Injectable as r, Module as i, Scope as a } from "@nestjs/common";
3
- import { existsSync as o, globSync as s, mkdirSync as c, readFileSync as l, writeFileSync as ee } from "node:fs";
4
- import u from "node:path";
5
- import d from "pino";
6
- import { CONFIGURATION_FILE_NAMES as te, ConfigurationModule as ne, ConfigurationService as f, DEFAULT_EXCLUDE_GLOBS as re, DEFAULT_JSON_INDENTATION as p, DEFAULT_MARKDOWN_END_MARKER as ie, DEFAULT_MARKDOWN_START_MARKER as m, REPOSITORY_ROOT_MARKERS as ae } from "@codometer/configuration";
7
- import { DiscoveryModule as oe, DiscoveryService as se } from "@codometer/measurement";
8
- import { readFile as ce, writeFile as le } from "node:fs/promises";
9
- //#region packages/ic-suite/codometer/codometer-output/src/modules/changes/changes.constants.ts
10
- var h = [
3
+ import { existsSync as o, globSync as s, mkdirSync as c, readFileSync as l, writeFileSync as u } from "node:fs";
4
+ import d from "node:path";
5
+ import f from "pino";
6
+ import { CONFIGURATION_FILE_NAMES as ee, ConfigurationModule as te, ConfigurationService as p, DEFAULT_EXCLUDE_GLOBS as ne, DEFAULT_JSON_INDENTATION as m, DEFAULT_MARKDOWN_END_MARKER as h, DEFAULT_MARKDOWN_START_MARKER as g, REPOSITORY_ROOT_MARKERS as re } from "@codometer/configuration";
7
+ import { DiscoveryModule as ie, DiscoveryService as _ } from "@codometer/measurement";
8
+ import { readFile as ae, writeFile as v } from "node:fs/promises";
9
+ //#region \0rolldown/runtime.js
10
+ var y = [
11
11
  "codometer-report.json",
12
12
  "applications/*/codometer-report.json",
13
13
  "packages/*/codometer-report.json",
14
14
  "packages/*/*/*/codometer-report.json",
15
15
  "tools/*/codometer-report.json"
16
- ], g = e.object({
16
+ ], b = e.object({
17
17
  failures: e.array(e.object({
18
18
  kind: e.enum(["limit", "target"]),
19
19
  reason: e.string(),
@@ -34,7 +34,7 @@ var h = [
34
34
  })),
35
35
  name: e.string()
36
36
  }))
37
- }), ue = /^(\p{Extended_Pictographic}️?(?:‍\p{Extended_Pictographic}️?)*)\s+/u, de = /^([A-Za-z]+)/, fe = /* @__PURE__ */ new Set([
37
+ }), oe = /^(\p{Extended_Pictographic}️?(?:‍\p{Extended_Pictographic}️?)*)\s+/u, x = /^([A-Za-z]+)/, se = /* @__PURE__ */ new Set([
38
38
  "built",
39
39
  "cut",
40
40
  "found",
@@ -52,7 +52,7 @@ var h = [
52
52
  "split",
53
53
  "took",
54
54
  "wrote"
55
- ]), pe = /* @__PURE__ */ new Set([
55
+ ]), ce = /* @__PURE__ */ new Set([
56
56
  "CommandFactory",
57
57
  "ExceptionHandler",
58
58
  "GraphQLModule",
@@ -65,12 +65,12 @@ var h = [
65
65
  ]);
66
66
  //#endregion
67
67
  //#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
68
- function _(e, t) {
68
+ function __decorateMetadata(e, t) {
69
69
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
70
70
  }
71
71
  //#endregion
72
72
  //#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
73
- function v(e, t, n, r) {
73
+ function __decorate(e, t, n, r) {
74
74
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
75
75
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
76
76
  else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
@@ -78,9 +78,9 @@ function v(e, t, n, r) {
78
78
  }
79
79
  //#endregion
80
80
  //#region packages/logging/src/modules/logger/logger.service.ts
81
- var y, b = class extends t {
81
+ var S, C = class LoggerService extends t {
82
82
  static {
83
- y = this;
83
+ S = this;
84
84
  }
85
85
  constructor() {
86
86
  super();
@@ -88,15 +88,15 @@ var y, b = class extends t {
88
88
  static isProduction = process.env.NODE_ENV === "production";
89
89
  static rootLogger;
90
90
  static writesToStandardError = !1;
91
- child = y.root;
91
+ child = S.root;
92
92
  static createRootLogger() {
93
93
  let e = process.env.LOG_LEVEL ?? "info";
94
- return y.isProduction ? y.writesToStandardError ? d({ level: e }, d.destination(2)) : d({ level: e }) : d({
94
+ return S.isProduction ? S.writesToStandardError ? f({ level: e }, f.destination(2)) : f({ level: e }) : f({
95
95
  level: e,
96
96
  transport: {
97
97
  options: {
98
98
  colorize: !0,
99
- destination: y.writesToStandardError ? 2 : 1,
99
+ destination: S.writesToStandardError ? 2 : 1,
100
100
  ignore: "pid,hostname,emoji",
101
101
  messageFormat: "{emoji} {msg}",
102
102
  singleLine: !0
@@ -106,14 +106,14 @@ var y, b = class extends t {
106
106
  });
107
107
  }
108
108
  static logToStandardError() {
109
- if (y.rootLogger !== void 0) {
109
+ if (S.rootLogger !== void 0) {
110
110
  process.emitWarning("LoggerService.logToStandardError() was called after the first log line, so log lines still go to standard output and anything piping that stream will read them as data. Call it as the first statement of the application's bootstrap.");
111
111
  return;
112
112
  }
113
- y.writesToStandardError = !0;
113
+ S.writesToStandardError = !0;
114
114
  }
115
115
  assertConventionalMessage(e) {
116
- if (y.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
116
+ if (S.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
117
117
  let t = this.getConventionalMessageViolation(e.parsed);
118
118
  if (t !== void 0) throw Error(t);
119
119
  }
@@ -124,21 +124,21 @@ var y, b = class extends t {
124
124
  }), {
125
125
  ...e.data,
126
126
  context: e.context,
127
- ...y.isProduction ? {} : { emoji: e.parsed.emoji }
127
+ ...S.isProduction ? {} : { emoji: e.parsed.emoji }
128
128
  };
129
129
  }
130
130
  getConventionalMessageViolation(e) {
131
131
  let t = e.emoji, n = e.text;
132
132
  if (t === void 0) return `Log message must start with an emoji naming its subject, then a verb: "${n}"`;
133
- let r = de.exec(n)?.[1];
133
+ let r = x.exec(n)?.[1];
134
134
  if (r === void 0 || !this.isConventionalVerb(r)) return `Log message must begin with a verb in present progressive or past tense, got "${r ?? ""}": "${t} ${n}"`;
135
135
  }
136
136
  isConventionalVerb(e) {
137
137
  let t = e.toLowerCase();
138
- return t.endsWith("ing") || t.endsWith("ed") || fe.has(t);
138
+ return t.endsWith("ing") || t.endsWith("ed") || se.has(t);
139
139
  }
140
140
  parseMessage(e) {
141
- let t = String(e), n = ue.exec(t), r = n?.[1];
141
+ let t = String(e), n = oe.exec(t), r = n?.[1];
142
142
  return r === void 0 ? {
143
143
  emoji: void 0,
144
144
  text: t
@@ -148,10 +148,10 @@ var y, b = class extends t {
148
148
  };
149
149
  }
150
150
  shouldSkipConventionalMessageValidation(e) {
151
- return e !== void 0 && pe.has(e);
151
+ return e !== void 0 && ce.has(e);
152
152
  }
153
153
  static get root() {
154
- return y.rootLogger ??= y.createRootLogger(), y.rootLogger;
154
+ return S.rootLogger ??= S.createRootLogger(), S.rootLogger;
155
155
  }
156
156
  buildErrorLogEntry(e, t) {
157
157
  let n = t instanceof Error ? t.stack || t.message : String(t);
@@ -161,8 +161,8 @@ var y, b = class extends t {
161
161
  };
162
162
  }
163
163
  createTimestampedOutputLogFilePath(e) {
164
- let t = u.join(process.cwd(), "output");
165
- return o(t) || c(t, { recursive: !0 }), u.join(t, `${e}-${(/* @__PURE__ */ new Date()).toISOString().replaceAll(/[:.]/g, "-")}.log`);
164
+ let t = d.join(process.cwd(), "output");
165
+ return o(t) || c(t, { recursive: !0 }), d.join(t, `${e}-${(/* @__PURE__ */ new Date()).toISOString().replaceAll(/[:.]/g, "-")}.log`);
166
166
  }
167
167
  debug(e, t, n) {
168
168
  let r = this.parseMessage(e);
@@ -195,7 +195,7 @@ var y, b = class extends t {
195
195
  this.info(e, t, n);
196
196
  }
197
197
  setContext(e) {
198
- super.setContext(e), this.child = y.root.child({ context: e });
198
+ super.setContext(e), this.child = S.root.child({ context: e });
199
199
  }
200
200
  verbose(e, t, n) {
201
201
  let r = this.parseMessage(e);
@@ -214,22 +214,22 @@ var y, b = class extends t {
214
214
  }), r.text);
215
215
  }
216
216
  };
217
- b = y = v([r({ scope: a.TRANSIENT }), _("design:paramtypes", [])], b);
217
+ C = S = __decorate([r({ scope: a.TRANSIENT }), __decorateMetadata("design:paramtypes", [])], C);
218
218
  //#endregion
219
219
  //#region packages/logging/src/modules/logger/logger.module.ts
220
- var x = class {};
221
- x = v([n(), i({
220
+ var w = class LoggerModule {};
221
+ w = __decorate([n(), i({
222
222
  controllers: [],
223
- exports: [b],
223
+ exports: [C],
224
224
  imports: [],
225
- providers: [b]
226
- })], x);
225
+ providers: [C]
226
+ })], w);
227
227
  //#endregion
228
228
  //#region packages/ic-suite/codometer/codometer-output/src/modules/changes/changes.service.ts
229
- var S, C = S = class {
229
+ var T, E = T = class ChangesService {
230
230
  logger;
231
231
  constructor(e) {
232
- this.logger = e, this.logger.setContext(S.name);
232
+ this.logger = e, this.logger.setContext(T.name);
233
233
  }
234
234
  buildBaselineRow(e, t, n) {
235
235
  return {
@@ -265,7 +265,7 @@ var S, C = S = class {
265
265
  }
266
266
  parseReport(e, t) {
267
267
  try {
268
- let n = g.safeParse(JSON.parse(l(u.join(e, t), "utf8")));
268
+ let n = b.safeParse(JSON.parse(l(d.join(e, t), "utf8")));
269
269
  return n.success ? n.data : void 0;
270
270
  } catch {
271
271
  return;
@@ -273,7 +273,7 @@ var S, C = S = class {
273
273
  }
274
274
  readBaseline(e) {
275
275
  if (e.baselineDirectory === void 0) return /* @__PURE__ */ new Map();
276
- let { metrics: t } = this.readReport(e.workingDirectory, u.join(e.baselineDirectory, e.reportPath));
276
+ let { metrics: t } = this.readReport(e.workingDirectory, d.join(e.baselineDirectory, e.reportPath));
277
277
  return new Map(t.map((e) => [e.name, e]));
278
278
  }
279
279
  readBreach(e) {
@@ -299,8 +299,8 @@ var S, C = S = class {
299
299
  }));
300
300
  }
301
301
  readProjectName(e) {
302
- let t = u.dirname(e);
303
- return t === "." || t === "" ? "codebase" : u.basename(t);
302
+ let t = d.dirname(e);
303
+ return t === "." || t === "" ? "codebase" : d.basename(t);
304
304
  }
305
305
  readReport(e, t) {
306
306
  let n = this.parseReport(e, t);
@@ -316,7 +316,7 @@ var S, C = S = class {
316
316
  };
317
317
  }
318
318
  readReportPaths(e) {
319
- let { baselineDirectory: t, workingDirectory: n } = e, r = h.flatMap((e) => s(e, { cwd: n })), i = t === void 0 ? [] : h.flatMap((e) => s(u.join(t, e), { cwd: n })).map((e) => u.relative(t, e));
319
+ let { baselineDirectory: t, workingDirectory: n } = e, r = y.flatMap((e) => s(e, { cwd: n })), i = t === void 0 ? [] : y.flatMap((e) => s(d.join(t, e), { cwd: n })).map((e) => d.relative(t, e));
320
320
  return this.logger.debug("📂 Found the codometer reports", void 0, {
321
321
  baseline: i.length,
322
322
  current: r.length
@@ -333,59 +333,59 @@ var S, C = S = class {
333
333
  };
334
334
  }
335
335
  };
336
- C = S = v([r(), _("design:paramtypes", [b === void 0 ? Object : b])], C);
336
+ E = T = __decorate([r(), __decorateMetadata("design:paramtypes", [C === void 0 ? Object : C])], E);
337
337
  //#endregion
338
338
  //#region packages/ic-suite/codometer/codometer-output/src/modules/changes/changes.module.ts
339
- var w = class {};
340
- w = v([i({
339
+ var D = class ChangesModule {};
340
+ D = __decorate([i({
341
341
  controllers: [],
342
- exports: [C],
343
- imports: [x],
344
- providers: [C]
345
- })], w);
342
+ exports: [E],
343
+ imports: [w],
344
+ providers: [E]
345
+ })], D);
346
346
  //#endregion
347
347
  //#region packages/ic-suite/codometer/codometer-output/src/modules/configuration-listing/configuration-listing.constants.ts
348
- var me = "—", T = "# 🔧 Codometer Configuration", E = [
348
+ var le = "—", O = "# 🔧 Codometer Configuration", k = [
349
349
  "Directory",
350
350
  "Metric",
351
351
  "Label",
352
352
  "Severity",
353
353
  "Value",
354
354
  "Declared in"
355
- ], he = ".size";
355
+ ], ue = ".size";
356
356
  //#endregion
357
357
  //#region packages/ic-suite/codometer/codometer-output/src/modules/render/render.utilities.ts
358
- function D(e) {
358
+ function formatBytes(e) {
359
359
  return Math.abs(e) >= 1e6 ? `${(e / 1e6).toFixed(2)} MB` : `${(e / 1e3).toFixed(2)} kB`;
360
360
  }
361
- function O(e) {
361
+ function formatCount(e) {
362
362
  return e.toLocaleString();
363
363
  }
364
- function ge(e, t) {
364
+ function formatDelta(e, t) {
365
365
  if (e === void 0) return "—";
366
- let n = k(e, t);
366
+ let n = formatValue(e, t);
367
367
  return e >= 0 ? `+${n}` : n;
368
368
  }
369
- function k(e, t) {
370
- return t === "bytes" ? D(e) : O(e);
369
+ function formatValue(e, t) {
370
+ return t === "bytes" ? formatBytes(e) : formatCount(e);
371
371
  }
372
- function _e(e) {
372
+ function hasChanged(e) {
373
373
  return e.breach === void 0 ? e.baseValue === void 0 ? e.value !== 0 || e.empty : e.value !== e.baseValue : !0;
374
374
  }
375
375
  //#endregion
376
376
  //#region packages/ic-suite/codometer/codometer-output/src/modules/configuration-listing/configuration-listing.service.ts
377
- var A = class {
377
+ var A = class ConfigurationListingService {
378
378
  configurationService;
379
379
  discoveryService;
380
380
  constructor(e, t) {
381
381
  this.configurationService = e, this.discoveryService = t;
382
382
  }
383
- configurationFileNames = new Set(te);
383
+ configurationFileNames = new Set(ee);
384
384
  async describeConfiguration(e) {
385
385
  try {
386
386
  let { configuration: t } = await this.configurationService.loadConfigurationFile({
387
- configurationPath: u.resolve(e.workingDirectory, e.file),
388
- searchDirectory: u.resolve(e.workingDirectory, e.directory)
387
+ configurationPath: d.resolve(e.workingDirectory, e.file),
388
+ searchDirectory: d.resolve(e.workingDirectory, e.directory)
389
389
  });
390
390
  return {
391
391
  configuration: t,
@@ -403,7 +403,7 @@ var A = class {
403
403
  }
404
404
  }
405
405
  formatLimitValue(e, t) {
406
- return e.endsWith(".size") ? D(t) : O(t);
406
+ return e.endsWith(".size") ? formatBytes(t) : formatCount(t);
407
407
  }
408
408
  async resolveWalkExclusions(e) {
409
409
  try {
@@ -419,7 +419,7 @@ var A = class {
419
419
  } catch (e) {
420
420
  return {
421
421
  error: e instanceof Error ? e.message : String(e),
422
- exclude: [...re],
422
+ exclude: [...ne],
423
423
  excludeFrom: []
424
424
  };
425
425
  }
@@ -427,7 +427,7 @@ var A = class {
427
427
  async describeConfigurations(e) {
428
428
  let { files: t, rootError: n } = await this.findConfigurationFiles(e), r = [];
429
429
  for (let n of t) r.push(await this.describeConfiguration({
430
- directory: u.dirname(n),
430
+ directory: d.dirname(n),
431
431
  file: n,
432
432
  workingDirectory: e.workingDirectory
433
433
  }));
@@ -443,7 +443,7 @@ var A = class {
443
443
  workingDirectory: e.workingDirectory
444
444
  });
445
445
  return {
446
- files: n.filter((e) => this.configurationFileNames.has(u.basename(e))).toSorted((e, t) => e.localeCompare(t)),
446
+ files: n.filter((e) => this.configurationFileNames.has(d.basename(e))).toSorted((e, t) => e.localeCompare(t)),
447
447
  rootError: t.error
448
448
  };
449
449
  }
@@ -458,10 +458,10 @@ var A = class {
458
458
  })));
459
459
  }
460
460
  };
461
- A = v([r(), _("design:paramtypes", [f === void 0 ? Object : f, se === void 0 ? Object : se])], A);
461
+ A = __decorate([r(), __decorateMetadata("design:paramtypes", [p === void 0 ? Object : p, _ === void 0 ? Object : _])], A);
462
462
  //#endregion
463
463
  //#region packages/ic-suite/codometer/codometer-output/src/modules/configuration-listing/render-configuration.service.ts
464
- var j = class {
464
+ var j = class RenderConfigurationService {
465
465
  constructor() {}
466
466
  renderDirectory(e) {
467
467
  let { configuration: t } = e;
@@ -486,8 +486,8 @@ var j = class {
486
486
  }
487
487
  renderLimitsTable(e) {
488
488
  return e.length === 0 ? "No limits are configured." : [
489
- this.renderRow(E),
490
- this.renderRow(E.map(() => "---")),
489
+ this.renderRow(k),
490
+ this.renderRow(k.map(() => "---")),
491
491
  ...e.map((e) => this.renderRow([
492
492
  e.directory,
493
493
  `\`${e.metric}\``,
@@ -515,42 +515,42 @@ var j = class {
515
515
  configurations: e.described,
516
516
  rootError: e.rootError ?? null
517
517
  }, void 0, 2) : e.limitsOnly ? [
518
- `${T}: Limits`,
518
+ `${O}: Limits`,
519
519
  "",
520
520
  ...this.renderRootError(e.rootError),
521
521
  this.renderLimitsTable(e.limitRows)
522
522
  ].join("\n") : [
523
- T,
523
+ O,
524
524
  "",
525
525
  ...this.renderRootError(e.rootError),
526
526
  ...e.described.map((e) => this.renderDirectory(e)),
527
527
  "",
528
- `${T}: Limits`.replace("# 🔧", "## 🔧"),
528
+ `${O}: Limits`.replace("# 🔧", "## 🔧"),
529
529
  "",
530
530
  this.renderLimitsTable(e.limitRows)
531
531
  ].join("\n");
532
532
  }
533
533
  };
534
- j = v([r(), _("design:paramtypes", [])], j);
534
+ j = __decorate([r(), __decorateMetadata("design:paramtypes", [])], j);
535
535
  //#endregion
536
536
  //#region packages/ic-suite/codometer/codometer-output/src/modules/configuration-listing/configuration-listing.module.ts
537
- var M = class {};
538
- M = v([i({
537
+ var M = class ConfigurationListingModule {};
538
+ M = __decorate([i({
539
539
  controllers: [],
540
540
  exports: [A, j],
541
- imports: [ne, oe],
541
+ imports: [te, ie],
542
542
  providers: [A, j]
543
543
  })], M);
544
544
  //#endregion
545
545
  //#region packages/ic-suite/codometer/codometer-output/src/modules/json/json.service.ts
546
- var N, P = N = class {
546
+ var N, P = N = class JsonService {
547
547
  logger;
548
548
  constructor(e) {
549
549
  this.logger = e, this.logger.setContext(N.name);
550
550
  }
551
551
  readExisting(e) {
552
552
  try {
553
- return l(u.resolve(e), "utf8");
553
+ return l(d.resolve(e), "utf8");
554
554
  } catch {
555
555
  return "";
556
556
  }
@@ -559,286 +559,286 @@ var N, P = N = class {
559
559
  return `${JSON.stringify(e.report, null, e.indentation)}\n`;
560
560
  }
561
561
  sync(e) {
562
- let t = u.resolve(e.path), n = this.render(e);
563
- return e.check ? this.readExisting(t) === n : (c(u.dirname(t), { recursive: !0 }), ee(t, n, "utf8"), this.logger.info("📝 Wrote the JSON report", void 0, { path: t }), !0);
562
+ let t = d.resolve(e.path), n = this.render(e);
563
+ return e.check ? this.readExisting(t) === n : (c(d.dirname(t), { recursive: !0 }), u(t, n, "utf8"), this.logger.info("📝 Wrote the JSON report", void 0, { path: t }), !0);
564
564
  }
565
565
  };
566
- P = N = v([r(), _("design:paramtypes", [b === void 0 ? Object : b])], P);
566
+ P = N = __decorate([r(), __decorateMetadata("design:paramtypes", [C === void 0 ? Object : C])], P);
567
567
  //#endregion
568
568
  //#region packages/ic-suite/codometer/codometer-output/src/modules/json/json.module.ts
569
- var F = class {};
570
- F = v([i({
569
+ var F = class JsonModule {};
570
+ F = __decorate([i({
571
571
  controllers: [],
572
572
  exports: [P],
573
- imports: [x],
573
+ imports: [w],
574
574
  providers: [P]
575
575
  })], F);
576
576
  //#endregion
577
577
  //#region packages/ic-suite/codometer/codometer-output/src/modules/markdown/markdown.constants.ts
578
- var ve = "## ⏲️ Codometer", ye = /[.*+?^${}()|[\]\\]/g, be = /\n+$/, I = class extends Error {
578
+ var I = "## ⏲️ Codometer", de = /[.*+?^${}()|[\]\\]/g, fe = /\n+$/, MissingMarkdownPathError = class extends Error {
579
579
  constructor() {
580
580
  super("No markdown path to write to. Set output.markdown.path, pass --markdown, or give syncAnchoredBlock a path of its own."), this.name = "MissingMarkdownPathError";
581
581
  }
582
582
  };
583
583
  //#endregion
584
584
  //#region packages/ic-suite/codometer/codometer-output/src/modules/markdown/markdown.utilities.ts
585
- function L(e, t, n) {
586
- return `![${e}](https://img.shields.io/badge/${Le(e)}-${Le(t)}-${n}?style=flat-square)`;
585
+ function buildBadge(e, t, n) {
586
+ return `![${e}](https://img.shields.io/badge/${encodeValue(e)}-${encodeValue(t)}-${n}?style=flat-square)`;
587
587
  }
588
- function xe(e) {
588
+ function buildCssGroup(e) {
589
589
  let { css: t } = e;
590
- return z("CSS", [
591
- L("CSS Files", t.files, "264de4"),
592
- L("CSS Lines", t.lines, "2965f1"),
593
- L("CSS Rules", t.rules, "7c3aed"),
594
- L("CSS Selectors", t.selectors, "8b5cf6"),
595
- L("CSS Declarations", t.declarations, "0284c7"),
596
- L("CSS At Rules", t.atRules, "f97316"),
597
- L("CSS Media Queries", t.mediaQueries, "ea580c"),
598
- L("CSS Custom Properties", t.customProperties, "16a34a"),
599
- L("CSS Comments", t.comments, "64748b"),
600
- ...R(e, "css")
590
+ return buildGroup("CSS", [
591
+ buildBadge("CSS Files", t.files, "264de4"),
592
+ buildBadge("CSS Lines", t.lines, "2965f1"),
593
+ buildBadge("CSS Rules", t.rules, "7c3aed"),
594
+ buildBadge("CSS Selectors", t.selectors, "8b5cf6"),
595
+ buildBadge("CSS Declarations", t.declarations, "0284c7"),
596
+ buildBadge("CSS At Rules", t.atRules, "f97316"),
597
+ buildBadge("CSS Media Queries", t.mediaQueries, "ea580c"),
598
+ buildBadge("CSS Custom Properties", t.customProperties, "16a34a"),
599
+ buildBadge("CSS Comments", t.comments, "64748b"),
600
+ ...buildCustomBadges(e, "css")
601
601
  ]);
602
602
  }
603
- function R(e, t) {
604
- return e.custom.filter((e) => e.group === t).map((e) => L(e.label, e.count, e.color));
603
+ function buildCustomBadges(e, t) {
604
+ return e.custom.filter((e) => e.group === t).map((e) => buildBadge(e.label, e.count, e.color));
605
605
  }
606
- function Se(e) {
607
- let t = R(e, "conventions");
608
- return t.length === 0 ? "" : z("Conventions", t);
606
+ function buildCustomGroup(e) {
607
+ let t = buildCustomBadges(e, "conventions");
608
+ return t.length === 0 ? "" : buildGroup("Conventions", t);
609
609
  }
610
- function Ce(e) {
610
+ function buildCustomStatisticInstancesSection(e) {
611
611
  return e.custom.filter((e) => (e.instances?.length ?? 0) > 0).map((e) => {
612
612
  let t = (e.instances ?? []).map((e) => `- \`${e.file}:${e.line}\` — measured ${e.measured}`);
613
- return z(`📝 ${e.label}`, t);
613
+ return buildGroup(`📝 ${e.label}`, t);
614
614
  }).join("\n\n");
615
615
  }
616
- function z(e, t) {
616
+ function buildGroup(e, t) {
617
617
  return `### ${e}\n\n${t.join("\n")}`;
618
618
  }
619
- function we(e) {
619
+ function buildHclGroup(e) {
620
620
  let { hcl: t } = e;
621
- return z("HCL", [
622
- L("HCL Files", t.files, "844fba"),
623
- L("HCL Lines", t.lines, "a78bfa"),
624
- L("HCL Blocks", t.blocks, "7c3aed"),
625
- L("HCL Resources", t.resources, "0284c7"),
626
- L("HCL Variables", t.variables, "16a34a"),
627
- L("HCL Outputs", t.outputs, "059669"),
628
- L("HCL Attributes", t.attributes, "0ea5e9"),
629
- L("HCL Interpolations", t.interpolations, "db2777"),
630
- L("HCL Comments", t.comments, "64748b"),
631
- ...R(e, "hcl")
621
+ return buildGroup("HCL", [
622
+ buildBadge("HCL Files", t.files, "844fba"),
623
+ buildBadge("HCL Lines", t.lines, "a78bfa"),
624
+ buildBadge("HCL Blocks", t.blocks, "7c3aed"),
625
+ buildBadge("HCL Resources", t.resources, "0284c7"),
626
+ buildBadge("HCL Variables", t.variables, "16a34a"),
627
+ buildBadge("HCL Outputs", t.outputs, "059669"),
628
+ buildBadge("HCL Attributes", t.attributes, "0ea5e9"),
629
+ buildBadge("HCL Interpolations", t.interpolations, "db2777"),
630
+ buildBadge("HCL Comments", t.comments, "64748b"),
631
+ ...buildCustomBadges(e, "hcl")
632
632
  ]);
633
633
  }
634
- function Te(e) {
634
+ function buildJavascriptGroup(e) {
635
635
  let { javascript: t } = e;
636
- return z("JavaScript", [
637
- L("JavaScript Files", t.files, "f7df1e"),
638
- L("Test Files", t.testFiles, "10b981"),
639
- L("External Packages", t.externalPackages, "8b5cf6"),
640
- L("Classes", t.classes, "7c3aed"),
641
- L("Functions", t.functions, "16a34a"),
642
- L("Methods", t.methods, "15803d"),
643
- L("Sync Functions", t.syncFunctions, "4ade80"),
644
- L("Async Functions", t.asyncFunctions, "059669"),
645
- L("Constants", t.constants, "dc2626"),
646
- L("Imports", t.imports, "0284c7"),
647
- L("Exported Symbols", t.exported, "ea580c"),
648
- L("Comments", t.comments, "64748b"),
649
- L("Comment Lines", t.commentLines, "475569"),
650
- L("TODO Comments", t.todos, "ca8a04")
636
+ return buildGroup("JavaScript", [
637
+ buildBadge("JavaScript Files", t.files, "f7df1e"),
638
+ buildBadge("Test Files", t.testFiles, "10b981"),
639
+ buildBadge("External Packages", t.externalPackages, "8b5cf6"),
640
+ buildBadge("Classes", t.classes, "7c3aed"),
641
+ buildBadge("Functions", t.functions, "16a34a"),
642
+ buildBadge("Methods", t.methods, "15803d"),
643
+ buildBadge("Sync Functions", t.syncFunctions, "4ade80"),
644
+ buildBadge("Async Functions", t.asyncFunctions, "059669"),
645
+ buildBadge("Constants", t.constants, "dc2626"),
646
+ buildBadge("Imports", t.imports, "0284c7"),
647
+ buildBadge("Exported Symbols", t.exported, "ea580c"),
648
+ buildBadge("Comments", t.comments, "64748b"),
649
+ buildBadge("Comment Lines", t.commentLines, "475569"),
650
+ buildBadge("TODO Comments", t.todos, "ca8a04")
651
651
  ]);
652
652
  }
653
- function Ee(e) {
653
+ function buildJsonGroup(e) {
654
654
  let { json: t } = e;
655
- return z("JSON", [
656
- L("JSON Files", t.files, "a16207"),
657
- L("JSON Lines", t.lines, "ca8a04"),
658
- L("JSON Objects", t.objects, "7c3aed"),
659
- L("JSON Arrays", t.arrays, "8b5cf6"),
660
- L("JSON Properties", t.properties, "0284c7"),
661
- L("JSON Strings", t.strings, "16a34a"),
662
- L("JSON Numbers", t.numbers, "059669"),
663
- L("JSON Booleans", t.booleans, "0ea5e9"),
664
- L("JSON Nulls", t.nulls, "64748b"),
665
- L("JSON Items", t.items, "475569"),
666
- L("JSON Nodes", t.totalNodes, "dc2626"),
667
- L("JSON Max Depth", t.maxDepth, "ea580c"),
668
- ...R(e, "json")
655
+ return buildGroup("JSON", [
656
+ buildBadge("JSON Files", t.files, "a16207"),
657
+ buildBadge("JSON Lines", t.lines, "ca8a04"),
658
+ buildBadge("JSON Objects", t.objects, "7c3aed"),
659
+ buildBadge("JSON Arrays", t.arrays, "8b5cf6"),
660
+ buildBadge("JSON Properties", t.properties, "0284c7"),
661
+ buildBadge("JSON Strings", t.strings, "16a34a"),
662
+ buildBadge("JSON Numbers", t.numbers, "059669"),
663
+ buildBadge("JSON Booleans", t.booleans, "0ea5e9"),
664
+ buildBadge("JSON Nulls", t.nulls, "64748b"),
665
+ buildBadge("JSON Items", t.items, "475569"),
666
+ buildBadge("JSON Nodes", t.totalNodes, "dc2626"),
667
+ buildBadge("JSON Max Depth", t.maxDepth, "ea580c"),
668
+ ...buildCustomBadges(e, "json")
669
669
  ]);
670
670
  }
671
- function De(e) {
671
+ function buildJupyterGroup(e) {
672
672
  let { jupyter: t } = e;
673
- return z("Jupyter", [
674
- L("Notebooks", t.files, "f37626"),
675
- L("Notebook Cells", t.cells, "e8a33d"),
676
- L("Code Cells", t.codeCells, "3776ab"),
677
- L("Markdown Cells", t.markdownCells, "083fa1"),
678
- L("Raw Cells", t.rawCells, "9ca3af"),
679
- L("Executed Cells", t.executedCells, "16a34a"),
680
- L("Cell Outputs", t.outputs, "059669"),
681
- L("Notebook Code Lines", t.codeLines, "4b8bbe"),
682
- L("Notebook Classes", t.classes, "7c3aed"),
683
- L("Notebook Functions", t.functions, "22c55e"),
684
- L("Notebook Imports", t.imports, "0284c7"),
685
- L("Notebook Decorators", t.decorators, "db2777"),
686
- L("Notebook Prose Lines", t.markdownLines, "1f6feb"),
687
- L("Notebook Headings", t.headings, "a78bfa"),
688
- L("Notebook Links", t.links, "10b981"),
689
- L("Notebook Images", t.images, "34d399"),
690
- L("Notebook Code Blocks", t.codeBlocks, "dc2626"),
691
- L("Notebook Properties", t.properties, "ca8a04"),
692
- L("Notebook Nodes", t.totalNodes, "a16207"),
693
- L("Notebook Max Depth", t.maxDepth, "ea580c"),
694
- ...R(e, "jupyter")
673
+ return buildGroup("Jupyter", [
674
+ buildBadge("Notebooks", t.files, "f37626"),
675
+ buildBadge("Notebook Cells", t.cells, "e8a33d"),
676
+ buildBadge("Code Cells", t.codeCells, "3776ab"),
677
+ buildBadge("Markdown Cells", t.markdownCells, "083fa1"),
678
+ buildBadge("Raw Cells", t.rawCells, "9ca3af"),
679
+ buildBadge("Executed Cells", t.executedCells, "16a34a"),
680
+ buildBadge("Cell Outputs", t.outputs, "059669"),
681
+ buildBadge("Notebook Code Lines", t.codeLines, "4b8bbe"),
682
+ buildBadge("Notebook Classes", t.classes, "7c3aed"),
683
+ buildBadge("Notebook Functions", t.functions, "22c55e"),
684
+ buildBadge("Notebook Imports", t.imports, "0284c7"),
685
+ buildBadge("Notebook Decorators", t.decorators, "db2777"),
686
+ buildBadge("Notebook Prose Lines", t.markdownLines, "1f6feb"),
687
+ buildBadge("Notebook Headings", t.headings, "a78bfa"),
688
+ buildBadge("Notebook Links", t.links, "10b981"),
689
+ buildBadge("Notebook Images", t.images, "34d399"),
690
+ buildBadge("Notebook Code Blocks", t.codeBlocks, "dc2626"),
691
+ buildBadge("Notebook Properties", t.properties, "ca8a04"),
692
+ buildBadge("Notebook Nodes", t.totalNodes, "a16207"),
693
+ buildBadge("Notebook Max Depth", t.maxDepth, "ea580c"),
694
+ ...buildCustomBadges(e, "jupyter")
695
695
  ]);
696
696
  }
697
- function Oe(e) {
697
+ function buildMarkdownGroup(e) {
698
698
  let { markdown: t } = e;
699
- return z("Markdown", [
700
- L("Markdown Files", t.files, "083fa1"),
701
- L("Markdown Lines", t.lines, "1f6feb"),
702
- L("H1", t.headingLevel1, "7c3aed"),
703
- L("H2", t.headingLevel2, "8b5cf6"),
704
- L("H3", t.headingLevel3, "a78bfa"),
705
- L("H4", t.headingLevel4, "c4b5fd"),
706
- L("H5", t.headingLevel5, "ddd6fe"),
707
- L("H6", t.headingLevel6, "ede9fe"),
708
- L("Paragraphs", t.paragraphs, "64748b"),
709
- L("Lists", t.lists, "16a34a"),
710
- L("List Items", t.listItems, "22c55e"),
711
- L("Task List Items", t.taskListItems, "4ade80"),
712
- L("Tables", t.tables, "0284c7"),
713
- L("Table Rows", t.tableRows, "0ea5e9"),
714
- L("Links", t.links, "059669"),
715
- L("Images", t.images, "10b981"),
716
- L("Code Blocks", t.codeBlocks, "dc2626"),
717
- L("Inline Code", t.inlineCode, "ef4444"),
718
- L("Block Quotes", t.blockQuotes, "ca8a04"),
719
- L("Thematic Breaks", t.thematicBreaks, "a16207"),
720
- ...R(e, "markdown")
699
+ return buildGroup("Markdown", [
700
+ buildBadge("Markdown Files", t.files, "083fa1"),
701
+ buildBadge("Markdown Lines", t.lines, "1f6feb"),
702
+ buildBadge("H1", t.headingLevel1, "7c3aed"),
703
+ buildBadge("H2", t.headingLevel2, "8b5cf6"),
704
+ buildBadge("H3", t.headingLevel3, "a78bfa"),
705
+ buildBadge("H4", t.headingLevel4, "c4b5fd"),
706
+ buildBadge("H5", t.headingLevel5, "ddd6fe"),
707
+ buildBadge("H6", t.headingLevel6, "ede9fe"),
708
+ buildBadge("Paragraphs", t.paragraphs, "64748b"),
709
+ buildBadge("Lists", t.lists, "16a34a"),
710
+ buildBadge("List Items", t.listItems, "22c55e"),
711
+ buildBadge("Task List Items", t.taskListItems, "4ade80"),
712
+ buildBadge("Tables", t.tables, "0284c7"),
713
+ buildBadge("Table Rows", t.tableRows, "0ea5e9"),
714
+ buildBadge("Links", t.links, "059669"),
715
+ buildBadge("Images", t.images, "10b981"),
716
+ buildBadge("Code Blocks", t.codeBlocks, "dc2626"),
717
+ buildBadge("Inline Code", t.inlineCode, "ef4444"),
718
+ buildBadge("Block Quotes", t.blockQuotes, "ca8a04"),
719
+ buildBadge("Thematic Breaks", t.thematicBreaks, "a16207"),
720
+ ...buildCustomBadges(e, "markdown")
721
721
  ]);
722
722
  }
723
- function ke(e) {
723
+ function buildPythonGroup(e) {
724
724
  let { python: t } = e;
725
- return z("Python", [
726
- L("Python Files", t.files, "3776ab"),
727
- L("Python Lines", t.lines, "4b8bbe"),
728
- L("Python Classes", t.classes, "7c3aed"),
729
- L("Python Functions", t.functions, "16a34a"),
730
- L("Python Protocols", t.protocols, "0ea5e9"),
731
- L("Python Constants", t.constants, "dc2626"),
732
- L("Python Imports", t.imports, "0284c7"),
733
- L("Python Decorators", t.decorators, "db2777"),
734
- L("Docstrings", t.docstrings, "6366f1"),
735
- L("Docstring Lines", t.docstringLines, "818cf8"),
736
- L("Python Comments", t.comments, "64748b"),
737
- L("Python Comment Lines", t.commentLines, "475569"),
738
- ...R(e, "python")
725
+ return buildGroup("Python", [
726
+ buildBadge("Python Files", t.files, "3776ab"),
727
+ buildBadge("Python Lines", t.lines, "4b8bbe"),
728
+ buildBadge("Python Classes", t.classes, "7c3aed"),
729
+ buildBadge("Python Functions", t.functions, "16a34a"),
730
+ buildBadge("Python Protocols", t.protocols, "0ea5e9"),
731
+ buildBadge("Python Constants", t.constants, "dc2626"),
732
+ buildBadge("Python Imports", t.imports, "0284c7"),
733
+ buildBadge("Python Decorators", t.decorators, "db2777"),
734
+ buildBadge("Docstrings", t.docstrings, "6366f1"),
735
+ buildBadge("Docstring Lines", t.docstringLines, "818cf8"),
736
+ buildBadge("Python Comments", t.comments, "64748b"),
737
+ buildBadge("Python Comment Lines", t.commentLines, "475569"),
738
+ ...buildCustomBadges(e, "python")
739
739
  ]);
740
740
  }
741
- function Ae(e, t) {
742
- return z(t === "repository" ? "Repository" : "Project", [
743
- L("Lines of Code", e.linesOfCode, "22c55e"),
744
- L("Repository Size", D(e.repositoryBytes), "6b7280"),
745
- L("Folders", e.folders, "4a4a4a"),
746
- L("Source Files", e.sourceFiles, "3178c6"),
747
- ...R(e, "repository")
741
+ function buildRepositoryGroup(e, t) {
742
+ return buildGroup(t === "repository" ? "Repository" : "Project", [
743
+ buildBadge("Lines of Code", e.linesOfCode, "22c55e"),
744
+ buildBadge("Repository Size", formatBytes(e.repositoryBytes), "6b7280"),
745
+ buildBadge("Folders", e.folders, "4a4a4a"),
746
+ buildBadge("Source Files", e.sourceFiles, "3178c6"),
747
+ ...buildCustomBadges(e, "repository")
748
748
  ]);
749
749
  }
750
- function je(e) {
750
+ function buildShellGroup(e) {
751
751
  let { shell: t } = e;
752
- return z("Shell", [
753
- L("Shell Files", t.files, "89e051"),
754
- L("Shell Lines", t.lines, "4eaa25"),
755
- L("Shell Functions", t.functions, "16a34a"),
756
- L("Shell Variables", t.variables, "0284c7"),
757
- L("Shell Exports", t.exports, "ea580c"),
758
- L("Shell Conditionals", t.conditionals, "7c3aed"),
759
- L("Shell Loops", t.loops, "8b5cf6"),
760
- L("Shell Pipelines", t.pipelines, "059669"),
761
- L("Shebangs", t.shebangs, "6b7280"),
762
- L("Shell Comments", t.comments, "64748b"),
763
- L("Shell Comment Lines", t.commentLines, "475569"),
764
- ...R(e, "shell")
752
+ return buildGroup("Shell", [
753
+ buildBadge("Shell Files", t.files, "89e051"),
754
+ buildBadge("Shell Lines", t.lines, "4eaa25"),
755
+ buildBadge("Shell Functions", t.functions, "16a34a"),
756
+ buildBadge("Shell Variables", t.variables, "0284c7"),
757
+ buildBadge("Shell Exports", t.exports, "ea580c"),
758
+ buildBadge("Shell Conditionals", t.conditionals, "7c3aed"),
759
+ buildBadge("Shell Loops", t.loops, "8b5cf6"),
760
+ buildBadge("Shell Pipelines", t.pipelines, "059669"),
761
+ buildBadge("Shebangs", t.shebangs, "6b7280"),
762
+ buildBadge("Shell Comments", t.comments, "64748b"),
763
+ buildBadge("Shell Comment Lines", t.commentLines, "475569"),
764
+ ...buildCustomBadges(e, "shell")
765
765
  ]);
766
766
  }
767
- function Me(e) {
767
+ function buildSqlGroup(e) {
768
768
  let { sql: t } = e;
769
- return z("SQL", [
770
- L("SQL Files", t.files, "e38c00"),
771
- L("SQL Lines", t.lines, "f29111"),
772
- L("SQL Statements", t.statements, "7c3aed"),
773
- L("SQL Selects", t.selects, "16a34a"),
774
- L("SQL Inserts", t.inserts, "22c55e"),
775
- L("SQL Updates", t.updates, "0ea5e9"),
776
- L("SQL Deletes", t.deletes, "dc2626"),
777
- L("SQL Creates", t.creates, "0284c7"),
778
- L("SQL Joins", t.joins, "8b5cf6"),
779
- L("SQL CTEs", t.commonTableExpressions, "059669"),
780
- L("SQL Comments", t.comments, "64748b"),
781
- ...R(e, "sql")
769
+ return buildGroup("SQL", [
770
+ buildBadge("SQL Files", t.files, "e38c00"),
771
+ buildBadge("SQL Lines", t.lines, "f29111"),
772
+ buildBadge("SQL Statements", t.statements, "7c3aed"),
773
+ buildBadge("SQL Selects", t.selects, "16a34a"),
774
+ buildBadge("SQL Inserts", t.inserts, "22c55e"),
775
+ buildBadge("SQL Updates", t.updates, "0ea5e9"),
776
+ buildBadge("SQL Deletes", t.deletes, "dc2626"),
777
+ buildBadge("SQL Creates", t.creates, "0284c7"),
778
+ buildBadge("SQL Joins", t.joins, "8b5cf6"),
779
+ buildBadge("SQL CTEs", t.commonTableExpressions, "059669"),
780
+ buildBadge("SQL Comments", t.comments, "64748b"),
781
+ ...buildCustomBadges(e, "sql")
782
782
  ]);
783
783
  }
784
- function Ne(e) {
785
- return e.length === 0 ? "" : z("Measured Targets", e.map((e) => L(`${e.name} Size`, Re(e), "6b7280")));
784
+ function buildTargetsGroup(e) {
785
+ return e.length === 0 ? "" : buildGroup("Measured Targets", e.map((e) => buildBadge(`${e.name} Size`, formatTargetSize(e), "6b7280")));
786
786
  }
787
- function Pe(e) {
787
+ function buildTomlGroup(e) {
788
788
  let { toml: t } = e;
789
- return z("TOML", [
790
- L("TOML Files", t.files, "9c4221"),
791
- L("TOML Lines", t.lines, "b45309"),
792
- L("TOML Tables", t.tables, "7c3aed"),
793
- L("TOML Array Tables", t.arrayTables, "8b5cf6"),
794
- L("TOML Keys", t.keys, "0284c7"),
795
- L("TOML Arrays", t.arrays, "16a34a"),
796
- L("TOML Comments", t.comments, "64748b"),
797
- ...R(e, "toml")
789
+ return buildGroup("TOML", [
790
+ buildBadge("TOML Files", t.files, "9c4221"),
791
+ buildBadge("TOML Lines", t.lines, "b45309"),
792
+ buildBadge("TOML Tables", t.tables, "7c3aed"),
793
+ buildBadge("TOML Array Tables", t.arrayTables, "8b5cf6"),
794
+ buildBadge("TOML Keys", t.keys, "0284c7"),
795
+ buildBadge("TOML Arrays", t.arrays, "16a34a"),
796
+ buildBadge("TOML Comments", t.comments, "64748b"),
797
+ ...buildCustomBadges(e, "toml")
798
798
  ]);
799
799
  }
800
- function Fe(e) {
800
+ function buildTypescriptGroup(e) {
801
801
  let { typescript: t } = e;
802
- return z("TypeScript", [
803
- L("TypeScript Files", t.files, "3178c6"),
804
- L("Interfaces", t.interfaces, "0ea5e9"),
805
- L("Generic Declarations", t.genericDeclarations, "0369a1"),
806
- L("Enums", t.enums, "f97316"),
807
- L("Decorators", t.decorators, "db2777"),
808
- L("Doc Comments", t.docComments, "6366f1"),
809
- ...R(e, "typescript")
802
+ return buildGroup("TypeScript", [
803
+ buildBadge("TypeScript Files", t.files, "3178c6"),
804
+ buildBadge("Interfaces", t.interfaces, "0ea5e9"),
805
+ buildBadge("Generic Declarations", t.genericDeclarations, "0369a1"),
806
+ buildBadge("Enums", t.enums, "f97316"),
807
+ buildBadge("Decorators", t.decorators, "db2777"),
808
+ buildBadge("Doc Comments", t.docComments, "6366f1"),
809
+ ...buildCustomBadges(e, "typescript")
810
810
  ]);
811
811
  }
812
- function Ie(e) {
812
+ function buildYamlGroup(e) {
813
813
  let { yaml: t } = e;
814
- return z("YAML", [
815
- L("YAML Files", t.files, "cb171e"),
816
- L("YAML Lines", t.lines, "e34c26"),
817
- L("YAML Documents", t.documents, "f97316"),
818
- L("YAML Mappings", t.mappings, "7c3aed"),
819
- L("YAML Sequences", t.sequences, "8b5cf6"),
820
- L("YAML Keys", t.keys, "0284c7"),
821
- L("YAML Scalars", t.scalars, "16a34a"),
822
- L("YAML Anchors", t.anchors, "059669"),
823
- L("YAML Aliases", t.aliases, "10b981"),
824
- L("YAML Comments", t.comments, "64748b"),
825
- L("YAML Max Depth", t.maxDepth, "ea580c"),
826
- ...R(e, "yaml")
814
+ return buildGroup("YAML", [
815
+ buildBadge("YAML Files", t.files, "cb171e"),
816
+ buildBadge("YAML Lines", t.lines, "e34c26"),
817
+ buildBadge("YAML Documents", t.documents, "f97316"),
818
+ buildBadge("YAML Mappings", t.mappings, "7c3aed"),
819
+ buildBadge("YAML Sequences", t.sequences, "8b5cf6"),
820
+ buildBadge("YAML Keys", t.keys, "0284c7"),
821
+ buildBadge("YAML Scalars", t.scalars, "16a34a"),
822
+ buildBadge("YAML Anchors", t.anchors, "059669"),
823
+ buildBadge("YAML Aliases", t.aliases, "10b981"),
824
+ buildBadge("YAML Comments", t.comments, "64748b"),
825
+ buildBadge("YAML Max Depth", t.maxDepth, "ea580c"),
826
+ ...buildCustomBadges(e, "yaml")
827
827
  ]);
828
828
  }
829
- function Le(e) {
829
+ function encodeValue(e) {
830
830
  return String(e).replaceAll("-", "--").replaceAll("_", "__").replaceAll(" ", "_");
831
831
  }
832
- function Re(e) {
833
- let t = D(e.bytes);
832
+ function formatTargetSize(e) {
833
+ let t = formatBytes(e.bytes);
834
834
  return e.compression === "none" ? t : `${t} ${e.compression}`;
835
835
  }
836
836
  //#endregion
837
837
  //#region packages/ic-suite/codometer/codometer-output/src/modules/markdown/markdown.service.ts
838
- var B, V = B = class {
838
+ var L, R = L = class MarkdownService {
839
839
  logger;
840
840
  constructor(e) {
841
- this.logger = e, this.logger.setContext(B.name);
841
+ this.logger = e, this.logger.setContext(L.name);
842
842
  }
843
843
  buildAnchorHelpers(e) {
844
844
  return {
@@ -859,32 +859,32 @@ var B, V = B = class {
859
859
  buildBadgeGroups(e) {
860
860
  let { statistics: t } = e;
861
861
  return [
862
- Ae(t, e.scope),
863
- Ne(e.targets),
864
- Fe(t),
865
- Te(t),
866
- ke(t),
867
- Ee(t),
868
- Ie(t),
869
- Pe(t),
870
- je(t),
871
- Me(t),
872
- we(t),
873
- xe(t),
874
- Se(t),
875
- De(t),
876
- Oe(t)
862
+ buildRepositoryGroup(t, e.scope),
863
+ buildTargetsGroup(e.targets),
864
+ buildTypescriptGroup(t),
865
+ buildJavascriptGroup(t),
866
+ buildPythonGroup(t),
867
+ buildJsonGroup(t),
868
+ buildYamlGroup(t),
869
+ buildTomlGroup(t),
870
+ buildShellGroup(t),
871
+ buildSqlGroup(t),
872
+ buildHclGroup(t),
873
+ buildCssGroup(t),
874
+ buildCustomGroup(t),
875
+ buildJupyterGroup(t),
876
+ buildMarkdownGroup(t)
877
877
  ].filter((e) => e !== "").join("\n\n");
878
878
  }
879
879
  buildBlockRegex(e) {
880
880
  return new RegExp(String.raw`${this.escapeRegex(e.startMarker)}[\s\S]*?${this.escapeRegex(e.endMarker)}`);
881
881
  }
882
882
  escapeRegex(e) {
883
- return e.replaceAll(ye, String.raw`\$&`);
883
+ return e.replaceAll(de, String.raw`\$&`);
884
884
  }
885
885
  readExisting(e) {
886
886
  try {
887
- return l(u.resolve(e), "utf8");
887
+ return l(d.resolve(e), "utf8");
888
888
  } catch {
889
889
  return "";
890
890
  }
@@ -897,11 +897,11 @@ var B, V = B = class {
897
897
  };
898
898
  }
899
899
  syncAnchoredBlock(e) {
900
- if (e.path === void 0) throw new I();
901
- let t = u.resolve(e.path), n = this.readExisting(t), r = this.wrapInAnchors(e), i = this.buildBlockRegex(e.destination), a = i.exec(n)?.[0];
900
+ if (e.path === void 0) throw new MissingMarkdownPathError();
901
+ let t = d.resolve(e.path), n = this.readExisting(t), r = this.wrapInAnchors(e), i = this.buildBlockRegex(e.destination), a = i.exec(n)?.[0];
902
902
  if (e.check) return a === r;
903
903
  if (!n.includes(e.destination.startMarker)) {
904
- let e = n === "" ? "" : `${n.replace(be, "")}\n\n`;
904
+ let e = n === "" ? "" : `${n.replace(fe, "")}\n\n`;
905
905
  return this.writeMarkdownFile(t, `${e}${r}\n`), !0;
906
906
  }
907
907
  return this.writeMarkdownFile(t, n.replace(i, () => r)), !0;
@@ -910,7 +910,7 @@ var B, V = B = class {
910
910
  return `${e.destination.startMarker}\n\n${e.content}\n${e.destination.endMarker}`;
911
911
  }
912
912
  writeMarkdownFile(e, t) {
913
- c(u.dirname(e), { recursive: !0 }), ee(e, t, "utf8"), this.logger.info("📝 Wrote the markdown badges", void 0, { path: e });
913
+ c(d.dirname(e), { recursive: !0 }), u(e, t, "utf8"), this.logger.info("📝 Wrote the markdown badges", void 0, { path: e });
914
914
  }
915
915
  renderBadges(e) {
916
916
  return this.renderDocument({
@@ -927,9 +927,9 @@ var B, V = B = class {
927
927
  });
928
928
  }
929
929
  renderDocument(e) {
930
- let t = [ve];
930
+ let t = [I];
931
931
  e.description !== void 0 && t.push(e.description), t.push(this.buildBadgeGroups(e));
932
- let n = Ce(e.statistics);
932
+ let n = buildCustomStatisticInstancesSection(e.statistics);
933
933
  return n !== "" && t.push(n), t.join("\n\n");
934
934
  }
935
935
  sync(e) {
@@ -953,27 +953,27 @@ var B, V = B = class {
953
953
  });
954
954
  }
955
955
  };
956
- V = B = v([r(), _("design:paramtypes", [b === void 0 ? Object : b])], V);
956
+ R = L = __decorate([r(), __decorateMetadata("design:paramtypes", [C === void 0 ? Object : C])], R);
957
957
  //#endregion
958
958
  //#region packages/ic-suite/codometer/codometer-output/src/modules/markdown/markdown.module.ts
959
- var H = class {};
960
- H = v([i({
959
+ var z = class MarkdownModule {};
960
+ z = __decorate([i({
961
961
  controllers: [],
962
- exports: [V],
963
- imports: [x],
964
- providers: [V]
965
- })], H);
962
+ exports: [R],
963
+ imports: [w],
964
+ providers: [R]
965
+ })], z);
966
966
  //#endregion
967
967
  //#region packages/ic-suite/codometer/codometer-output/src/modules/delivery/delivery.constants.ts
968
- var ze = {
968
+ var B = {
969
969
  custom: [],
970
970
  description: void 0,
971
- endMarker: ie,
971
+ endMarker: h,
972
972
  path: void 0,
973
- startMarker: m,
973
+ startMarker: g,
974
974
  type: "markdown",
975
975
  write: void 0
976
- }, U = class {
976
+ }, V = class DeliveryService {
977
977
  jsonService;
978
978
  markdownService;
979
979
  constructor(e, t) {
@@ -983,13 +983,13 @@ var ze = {
983
983
  if (e.format === void 0) return;
984
984
  if (e.format === "json") {
985
985
  process.stdout.write(this.jsonService.render({
986
- indentation: e.destinations.json?.indentation ?? p,
986
+ indentation: e.destinations.json?.indentation ?? m,
987
987
  report: e.report
988
988
  }));
989
989
  return;
990
990
  }
991
991
  let t = this.markdownService.renderBlock({
992
- destination: e.consoleMarkdown ?? ze,
992
+ destination: e.consoleMarkdown ?? B,
993
993
  scope: e.scope,
994
994
  statistics: e.measurement.statistics,
995
995
  targets: this.readTargetSizes(e.measurement)
@@ -1030,19 +1030,19 @@ var ze = {
1030
1030
  return this.deliverConsole(e), this.deliverJson(e, t), this.deliverMarkdown(e, t), t;
1031
1031
  }
1032
1032
  };
1033
- U = v([r(), _("design:paramtypes", [P === void 0 ? Object : P, V === void 0 ? Object : V])], U);
1033
+ V = __decorate([r(), __decorateMetadata("design:paramtypes", [P === void 0 ? Object : P, R === void 0 ? Object : R])], V);
1034
1034
  //#endregion
1035
1035
  //#region packages/ic-suite/codometer/codometer-output/src/modules/delivery/delivery.module.ts
1036
- var W = class {};
1037
- W = v([i({
1036
+ var H = class DeliveryModule {};
1037
+ H = __decorate([i({
1038
1038
  controllers: [],
1039
- exports: [U],
1040
- imports: [F, H],
1041
- providers: [U]
1042
- })], W);
1039
+ exports: [V],
1040
+ imports: [F, z],
1041
+ providers: [V]
1042
+ })], H);
1043
1043
  //#endregion
1044
1044
  //#region packages/ic-suite/codometer/codometer-output/src/modules/destinations/destinations.service.ts
1045
- var G = class {
1045
+ var U = class DestinationsService {
1046
1046
  constructor() {}
1047
1047
  findConfiguredOutput(e, t) {
1048
1048
  return e.find((e) => e.type === t);
@@ -1053,8 +1053,8 @@ var G = class {
1053
1053
  let i = this.findConfiguredOutput(e.configuration.outputs, "json");
1054
1054
  if (typeof r == "string") return {
1055
1055
  custom: i?.custom ?? [],
1056
- indentation: i?.indentation ?? p,
1057
- path: u.resolve(e.workingDirectory, r)
1056
+ indentation: i?.indentation ?? m,
1057
+ path: d.resolve(e.workingDirectory, r)
1058
1058
  };
1059
1059
  if (i === void 0) {
1060
1060
  r === !0 && n.push("--output-json needs a path, or a \"json\" entry in the configuration's \"outputs\" to resolve one from: neither was found, so there is nowhere to write it. Pass --output-json <path>, or declare a \"json\" output.");
@@ -1063,7 +1063,7 @@ var G = class {
1063
1063
  return {
1064
1064
  custom: i.custom,
1065
1065
  indentation: i.indentation,
1066
- path: u.resolve(e.workingDirectory, i.path)
1066
+ path: d.resolve(e.workingDirectory, i.path)
1067
1067
  };
1068
1068
  }
1069
1069
  resolveMarkdown(e, t, n) {
@@ -1073,9 +1073,9 @@ var G = class {
1073
1073
  if (typeof r == "string") return {
1074
1074
  custom: i?.custom ?? [],
1075
1075
  description: i?.description,
1076
- endMarker: i?.endMarker ?? ie,
1076
+ endMarker: i?.endMarker ?? h,
1077
1077
  path: this.resolvePath(e.workingDirectory, r),
1078
- startMarker: i?.startMarker ?? m,
1078
+ startMarker: i?.startMarker ?? g,
1079
1079
  type: "markdown",
1080
1080
  write: i?.write
1081
1081
  };
@@ -1094,10 +1094,10 @@ var G = class {
1094
1094
  };
1095
1095
  }
1096
1096
  resolvePath(e, t) {
1097
- return t === void 0 ? void 0 : u.resolve(e, t);
1097
+ return t === void 0 ? void 0 : d.resolve(e, t);
1098
1098
  }
1099
1099
  listOutputPaths(e) {
1100
- return [e.destinations.json?.path, e.destinations.markdown?.path].filter((e) => e !== void 0).map((t) => u.relative(e.workingDirectory, t).split(u.sep).join("/"));
1100
+ return [e.destinations.json?.path, e.destinations.markdown?.path].filter((e) => e !== void 0).map((t) => d.relative(e.workingDirectory, t).split(d.sep).join("/"));
1101
1101
  }
1102
1102
  resolveConsoleMarkdown(e) {
1103
1103
  return this.resolveMarkdown(e, !1, []);
@@ -1113,41 +1113,41 @@ var G = class {
1113
1113
  };
1114
1114
  }
1115
1115
  selectScope(e) {
1116
- return ae.some((t) => o(u.join(e, t))) ? "repository" : "project";
1116
+ return re.some((t) => o(d.join(e, t))) ? "repository" : "project";
1117
1117
  }
1118
1118
  };
1119
- G = v([r(), _("design:paramtypes", [])], G);
1119
+ U = __decorate([r(), __decorateMetadata("design:paramtypes", [])], U);
1120
1120
  //#endregion
1121
1121
  //#region packages/ic-suite/codometer/codometer-output/src/modules/destinations/destinations.module.ts
1122
- var K = class {};
1123
- K = v([i({
1122
+ var W = class DestinationsModule {};
1123
+ W = __decorate([i({
1124
1124
  controllers: [],
1125
- exports: [G],
1125
+ exports: [U],
1126
1126
  imports: [],
1127
- providers: [G]
1128
- })], K);
1127
+ providers: [U]
1128
+ })], W);
1129
1129
  //#endregion
1130
1130
  //#region packages/ic-suite/codometer/codometer-output/src/modules/documents/documents.service.ts
1131
- var q, J = q = class {
1131
+ var G, K = G = class DocumentsService {
1132
1132
  logger;
1133
1133
  constructor(e) {
1134
- this.logger = e, this.logger.setContext(q.name);
1134
+ this.logger = e, this.logger.setContext(G.name);
1135
1135
  }
1136
1136
  async readDocument(e) {
1137
1137
  try {
1138
- return (await ce(e, "utf8")).trimEnd();
1138
+ return (await ae(e, "utf8")).trimEnd();
1139
1139
  } catch {
1140
1140
  return "";
1141
1141
  }
1142
1142
  }
1143
1143
  async emit(e) {
1144
1144
  let { body: t, destination: n, label: r, markers: i } = e, a = this.wrap(t, i);
1145
- if (n.output !== void 0 && (await le(n.output, `${a}\n`, "utf8"), this.logger.info("📝 Wrote a report", void 0, {
1145
+ if (n.output !== void 0 && (await v(n.output, `${a}\n`, "utf8"), this.logger.info("📝 Wrote a report", void 0, {
1146
1146
  label: r,
1147
1147
  path: n.output
1148
1148
  })), n.markdown !== void 0) {
1149
1149
  let e = await this.readDocument(n.markdown), t = this.splice(e, a, i);
1150
- await le(n.markdown, `${t}\n`, "utf8"), this.logger.info("📝 Spliced a report", void 0, {
1150
+ await v(n.markdown, `${t}\n`, "utf8"), this.logger.info("📝 Spliced a report", void 0, {
1151
1151
  label: r,
1152
1152
  path: n.markdown
1153
1153
  });
@@ -1170,22 +1170,22 @@ var q, J = q = class {
1170
1170
  ].join("\n");
1171
1171
  }
1172
1172
  };
1173
- J = q = v([r(), _("design:paramtypes", [b === void 0 ? Object : b])], J);
1173
+ K = G = __decorate([r(), __decorateMetadata("design:paramtypes", [C === void 0 ? Object : C])], K);
1174
1174
  //#endregion
1175
1175
  //#region packages/ic-suite/codometer/codometer-output/src/modules/documents/documents.module.ts
1176
- var Y = class {};
1177
- Y = v([i({
1176
+ var q = class DocumentsModule {};
1177
+ q = __decorate([i({
1178
1178
  controllers: [],
1179
- exports: [J],
1180
- imports: [x],
1181
- providers: [J]
1182
- })], Y);
1179
+ exports: [K],
1180
+ imports: [w],
1181
+ providers: [K]
1182
+ })], q);
1183
1183
  //#endregion
1184
1184
  //#region packages/ic-suite/codometer/codometer-output/src/modules/render/render.constants.ts
1185
- var Be = "## ⏲️ Codometer", Ve = {
1185
+ var J = "## ⏲️ Codometer", pe = {
1186
1186
  end: "<!-- codometer-changes:end -->",
1187
1187
  start: "<!-- codometer-changes:start -->"
1188
- }, He = ["| | Metric | Value | `main` | Change |", "|--|--------|-------|--------|--------|"], X = class {
1188
+ }, Y = ["| | Metric | Value | `main` | Change |", "|--|--------|-------|--------|--------|"], X = class RenderService {
1189
1189
  constructor() {}
1190
1190
  groupByProject(e, t) {
1191
1191
  let n = /* @__PURE__ */ new Map();
@@ -1219,7 +1219,7 @@ var Be = "## ⏲️ Codometer", Ve = {
1219
1219
  ];
1220
1220
  }
1221
1221
  renderProject(e, t, n) {
1222
- let r = t.filter((e) => _e(e));
1222
+ let r = t.filter((e) => hasChanged(e));
1223
1223
  if (r.length === 0 && n.length === 0) return [];
1224
1224
  let i = this.readIsOpen(r, n) ? " open" : "", a = r.length === 0 ? `\`${e}\`` : `\`${e}\` — ${r.length} changed`;
1225
1225
  return [
@@ -1227,7 +1227,7 @@ var Be = "## ⏲️ Codometer", Ve = {
1227
1227
  `<summary>${a}</summary>`,
1228
1228
  "",
1229
1229
  ...this.renderFailures(n),
1230
- ...r.length === 0 ? [] : [...He, ...r.map((e) => this.renderRow(e))],
1230
+ ...r.length === 0 ? [] : [...Y, ...r.map((e) => this.renderRow(e))],
1231
1231
  "</details>",
1232
1232
  ""
1233
1233
  ];
@@ -1237,15 +1237,15 @@ var Be = "## ⏲️ Codometer", Ve = {
1237
1237
  return `| ${[
1238
1238
  this.readStatus(e),
1239
1239
  e.removed ? `~~${e.label}~~` : e.label,
1240
- e.removed ? "—" : k(e.value, e.unit),
1241
- e.baseValue === void 0 ? "—" : k(e.baseValue, e.unit),
1242
- ge(t, e.unit)
1240
+ e.removed ? "—" : formatValue(e.value, e.unit),
1241
+ e.baseValue === void 0 ? "—" : formatValue(e.baseValue, e.unit),
1242
+ formatDelta(t, e.unit)
1243
1243
  ].join(" | ")} |`;
1244
1244
  }
1245
1245
  renderSection(e) {
1246
1246
  let t = this.groupByProject(e.rows, (e) => e.project), n = this.groupByProject(e.failures, (e) => e.project), r = this.readProjects(e).flatMap((e) => this.renderProject(e, t.get(e) ?? [], n.get(e) ?? [])), i = this.renderComparison(e.baselineUrl);
1247
1247
  return [
1248
- Be,
1248
+ J,
1249
1249
  "",
1250
1250
  ...r.length === 0 ? [...i, "No codometer changes to report for this pull request."] : [
1251
1251
  ...i,
@@ -1255,11 +1255,11 @@ var Be = "## ⏲️ Codometer", Ve = {
1255
1255
  ].join("\n");
1256
1256
  }
1257
1257
  };
1258
- X = v([r(), _("design:paramtypes", [])], X);
1258
+ X = __decorate([r(), __decorateMetadata("design:paramtypes", [])], X);
1259
1259
  //#endregion
1260
1260
  //#region packages/ic-suite/codometer/codometer-output/src/modules/render/render.module.ts
1261
- var Z = class {};
1262
- Z = v([i({
1261
+ var Z = class RenderModule {};
1262
+ Z = __decorate([i({
1263
1263
  controllers: [],
1264
1264
  exports: [X],
1265
1265
  imports: [],
@@ -1267,7 +1267,7 @@ Z = v([i({
1267
1267
  })], Z);
1268
1268
  //#endregion
1269
1269
  //#region packages/ic-suite/codometer/codometer-output/src/modules/report/report.service.ts
1270
- var Q = class {
1270
+ var Q = class ReportService {
1271
1271
  constructor() {}
1272
1272
  buildLimit(e) {
1273
1273
  return {
@@ -1324,15 +1324,15 @@ var Q = class {
1324
1324
  };
1325
1325
  }
1326
1326
  };
1327
- Q = v([r(), _("design:paramtypes", [])], Q);
1327
+ Q = __decorate([r(), __decorateMetadata("design:paramtypes", [])], Q);
1328
1328
  //#endregion
1329
1329
  //#region packages/ic-suite/codometer/codometer-output/src/modules/report/report.module.ts
1330
- var $ = class {};
1331
- $ = v([i({
1330
+ var $ = class ReportModule {};
1331
+ $ = __decorate([i({
1332
1332
  controllers: [],
1333
1333
  exports: [Q],
1334
1334
  imports: [],
1335
1335
  providers: [Q]
1336
1336
  })], $);
1337
1337
  //#endregion
1338
- export { me as ABSENT_LABEL, Ve as CODOMETER_MARKERS, T as CONFIGURATION_HEADING, w as ChangesModule, C as ChangesService, M as ConfigurationListingModule, A as ConfigurationListingService, W as DeliveryModule, U as DeliveryService, K as DestinationsModule, G as DestinationsService, Y as DocumentsModule, J as DocumentsService, Be as HEADING, F as JsonModule, P as JsonService, E as LIMIT_TABLE_COLUMNS, H as MarkdownModule, V as MarkdownService, I as MissingMarkdownPathError, h as REPORT_GLOBS, j as RenderConfigurationService, Z as RenderModule, X as RenderService, $ as ReportModule, Q as ReportService, he as SIZE_METRIC_SUFFIX, He as TABLE_HEADER, g as codometerReportSchema, D as formatBytes, O as formatCount, ge as formatDelta, k as formatValue, _e as hasChanged };
1338
+ export { le as ABSENT_LABEL, pe as CODOMETER_MARKERS, O as CONFIGURATION_HEADING, D as ChangesModule, E as ChangesService, M as ConfigurationListingModule, A as ConfigurationListingService, H as DeliveryModule, V as DeliveryService, W as DestinationsModule, U as DestinationsService, q as DocumentsModule, K as DocumentsService, J as HEADING, F as JsonModule, P as JsonService, k as LIMIT_TABLE_COLUMNS, z as MarkdownModule, R as MarkdownService, MissingMarkdownPathError, y as REPORT_GLOBS, j as RenderConfigurationService, Z as RenderModule, X as RenderService, $ as ReportModule, Q as ReportService, ue as SIZE_METRIC_SUFFIX, Y as TABLE_HEADER, b as codometerReportSchema, formatBytes, formatCount, formatDelta, formatValue, hasChanged };