@codometer/measurement 0.0.78 → 0.0.79
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/CHANGELOG.md +12 -0
- package/dist/src/index.d.ts +34 -55
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.0.79 (2026-11-11)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **codometer:** ✨ tighten the comment budgets and shorten every comment over them ([#2262](https://github.com/organizzolini/codebase/pull/2262), [#2261](https://github.com/organizzolini/codebase/issues/2261))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated codometer-configuration to 0.0.79
|
|
10
|
+
- Updated codometer-languages to 0.0.79
|
|
11
|
+
- Updated codometer-core to 0.0.79
|
|
12
|
+
|
|
1
13
|
## 0.0.78 (2026-11-10)
|
|
2
14
|
|
|
3
15
|
### 🚀 Features
|
package/dist/src/index.d.ts
CHANGED
|
@@ -166,20 +166,18 @@ declare interface DuplicateTargetFinding {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
* Raised when a target carrying a limit matched no files
|
|
169
|
+
* Raised when a target carrying a limit matched no files.
|
|
170
170
|
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
171
|
+
* A limit asserts its files exist, so an empty match means a stale glob or a
|
|
172
|
+
* build that never ran, and a zero would pass every limit.
|
|
173
|
+
*
|
|
174
|
+
* Targets nobody limited are left alone.
|
|
175
175
|
*/
|
|
176
176
|
export declare class EmptyTargetError extends Error {
|
|
177
177
|
constructor(target: string, metric: string);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
/**
|
|
181
|
-
* What one limit found once it was pointed at its metric. A breach carries `breached`; a held limit is reported alike.
|
|
182
|
-
*/
|
|
180
|
+
/** One limit's result against its metric; a breach sets `breached`. */
|
|
183
181
|
export declare interface EvaluatedLimit {
|
|
184
182
|
/** Whether the measured value came out above the limit. */
|
|
185
183
|
breached: boolean;
|
|
@@ -222,9 +220,7 @@ declare class IgnoreRulesService {
|
|
|
222
220
|
readScope(args: ReadIgnoreScopeArguments): IgnoreScope | undefined;
|
|
223
221
|
}
|
|
224
222
|
|
|
225
|
-
/**
|
|
226
|
-
* A gitignore rule set and the directory its patterns are relative to, so `/output` claims that project's `output`.
|
|
227
|
-
*/
|
|
223
|
+
/** `.gitignore` rules and the directory their patterns are relative to. */
|
|
228
224
|
declare interface IgnoreScope {
|
|
229
225
|
/** Directory the patterns are relative to, `/`-separated from the walk root. `""` is the root itself. */
|
|
230
226
|
directory: string;
|
|
@@ -234,9 +230,7 @@ declare interface IgnoreScope {
|
|
|
234
230
|
/** What a directory entry counts as while an input's tree is walked. */
|
|
235
231
|
export declare type InputEntryKind = "directory" | "file" | "other";
|
|
236
232
|
|
|
237
|
-
/**
|
|
238
|
-
* What every analysis declared for one input reported over its files. Analyses not requested report `undefined`, never a zero.
|
|
239
|
-
*/
|
|
233
|
+
/** One input's analysis results; skipped ones are `undefined`, not zero. */
|
|
240
234
|
export declare interface InputMeasurement {
|
|
241
235
|
/** How many files the input's globs claimed. */
|
|
242
236
|
files: number;
|
|
@@ -316,18 +310,14 @@ export declare class InputsService {
|
|
|
316
310
|
matchFiles(args: MatchInputFilesArguments): string[];
|
|
317
311
|
}
|
|
318
312
|
|
|
319
|
-
/**
|
|
320
|
-
* One limit that could not be held against anything. Collected rather than thrown, so one run reports every such limit.
|
|
321
|
-
*/
|
|
313
|
+
/** A limit that bound to nothing, collected rather than thrown. */
|
|
322
314
|
declare interface LimitFailure {
|
|
323
315
|
/** The dotted path exactly as the limit was written. */
|
|
324
316
|
metric: string;
|
|
325
317
|
reason: string;
|
|
326
318
|
}
|
|
327
319
|
|
|
328
|
-
/**
|
|
329
|
-
* Every declared limit's result, plus those that bound to nothing. A limit that could not bind is neither a breach nor a pass.
|
|
330
|
-
*/
|
|
320
|
+
/** Every limit's result, with unbound limits neither breached nor passed. */
|
|
331
321
|
declare interface LimitsEvaluation {
|
|
332
322
|
failures: LimitFailure[];
|
|
333
323
|
limits: EvaluatedLimit[];
|
|
@@ -342,10 +332,9 @@ export declare class LimitsModule {
|
|
|
342
332
|
/**
|
|
343
333
|
* Holds measured metrics to the limits declared against them.
|
|
344
334
|
*
|
|
345
|
-
* Every metric is addressable
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* worth is the caller's to say.
|
|
335
|
+
* Every metric is addressable by a dotted path of target and metric name.
|
|
336
|
+
* Nothing here decides what a breach costs: it reports which limits were
|
|
337
|
+
* exceeded and by how much; the caller decides the rest.
|
|
349
338
|
*/
|
|
350
339
|
export declare class LimitsService {
|
|
351
340
|
constructor();
|
|
@@ -375,10 +364,7 @@ export declare class LimitsService {
|
|
|
375
364
|
evaluate(args: EvaluateLimitsArguments): LimitsEvaluation;
|
|
376
365
|
}
|
|
377
366
|
|
|
378
|
-
/**
|
|
379
|
-
* Values beside a log line rather than inside it: counts and durations change
|
|
380
|
-
* per occurrence, so they stay queryable fields.
|
|
381
|
-
*/
|
|
367
|
+
/** Values beside the log line, kept as queryable fields. */
|
|
382
368
|
declare interface LogData {
|
|
383
369
|
[key: string]: unknown;
|
|
384
370
|
/** How many things the operation handled. */
|
|
@@ -392,11 +378,10 @@ declare interface LogData {
|
|
|
392
378
|
}
|
|
393
379
|
|
|
394
380
|
/**
|
|
395
|
-
* Transient logger, so each injecting class gets its own instance.
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
* Varying values such as counts go in `data`, so messages stay groupable.
|
|
381
|
+
* Transient logger, so each injecting class gets its own instance. Consumers
|
|
382
|
+
* call `setContext(ClassName.name)`. Backed by pino: JSON in production,
|
|
383
|
+
* pretty-printed in development. Messages start with an emoji naming the subject,
|
|
384
|
+
* then a present or past-tense verb. Varying values such as counts go in `data`.
|
|
400
385
|
*/
|
|
401
386
|
declare @Injectable({ scope: Scope.TRANSIENT })
|
|
402
387
|
class LoggerService
|
|
@@ -414,7 +399,7 @@ implements LoggerServiceContract
|
|
|
414
399
|
private static readonly isProduction =
|
|
415
400
|
process.env["NODE_ENV"] === "production";
|
|
416
401
|
|
|
417
|
-
/** Built
|
|
402
|
+
/** Built lazily, so `logToStandardError` can still set the destination. */
|
|
418
403
|
private static rootLogger: pino.Logger | undefined;
|
|
419
404
|
|
|
420
405
|
/** Whether lines go to standard error instead of standard output. */
|
|
@@ -674,7 +659,7 @@ implements LoggerServiceContract
|
|
|
674
659
|
}
|
|
675
660
|
}
|
|
676
661
|
|
|
677
|
-
/**
|
|
662
|
+
/** Public logger shape, for test doubles without the service. */
|
|
678
663
|
declare interface LoggerServiceContract extends ConsoleLogger {
|
|
679
664
|
/** Normalizes unknown errors into a stable message and timestamped log line. */
|
|
680
665
|
buildErrorLogEntry(
|
|
@@ -709,9 +694,7 @@ export declare interface MeasureArguments {
|
|
|
709
694
|
workingDirectory: string;
|
|
710
695
|
}
|
|
711
696
|
|
|
712
|
-
/**
|
|
713
|
-
* What one target measured, as the limits layer reads it. Declared here so this layer needs no measurement types.
|
|
714
|
-
*/
|
|
697
|
+
/** One target's measurements, as the limits layer reads them. */
|
|
715
698
|
declare interface MeasuredTarget {
|
|
716
699
|
files: number;
|
|
717
700
|
language: CodeStatisticsResult | undefined;
|
|
@@ -719,9 +702,7 @@ declare interface MeasuredTarget {
|
|
|
719
702
|
size: SizeResult | undefined;
|
|
720
703
|
}
|
|
721
704
|
|
|
722
|
-
/**
|
|
723
|
-
* Everything one run measured, input by input. `statistics` holds the codebase's language metrics, held out for consumers.
|
|
724
|
-
*/
|
|
705
|
+
/** Everything one run measured, input by input; `statistics` stands apart. */
|
|
725
706
|
export declare interface MeasurementResult {
|
|
726
707
|
/**
|
|
727
708
|
* What the run could not do, collected rather than thrown.
|
|
@@ -810,10 +791,9 @@ declare interface MetricIndexResult {
|
|
|
810
791
|
/**
|
|
811
792
|
* Makes every measured number addressable by a dotted path.
|
|
812
793
|
*
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
* way, so the naming lives here rather than in either caller.
|
|
794
|
+
* One index answers both which metric a limit targets and which metrics the
|
|
795
|
+
* report lists. Both need every number named the same way, so the naming lives
|
|
796
|
+
* here, not in either caller.
|
|
817
797
|
*/
|
|
818
798
|
export declare class MetricIndexService {
|
|
819
799
|
constructor();
|
|
@@ -843,7 +823,7 @@ export declare class MetricIndexService {
|
|
|
843
823
|
index(targets: readonly MeasuredTarget[]): MetricIndexResult;
|
|
844
824
|
}
|
|
845
825
|
|
|
846
|
-
/**
|
|
826
|
+
/** Message split into emoji and the prose telemetry stores. */
|
|
847
827
|
declare interface ParsedLogMessage {
|
|
848
828
|
emoji: string | undefined;
|
|
849
829
|
text: string;
|
|
@@ -912,10 +892,9 @@ export declare interface TargetMetricIndex {
|
|
|
912
892
|
/**
|
|
913
893
|
* Raised when a limit's dotted path does not name exactly one metric.
|
|
914
894
|
*
|
|
915
|
-
*
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
* nobody would ever discover was wrong.
|
|
895
|
+
* A path naming nothing gates nothing while looking like a gate. A path naming
|
|
896
|
+
* several would have to pick one, and a limit quietly holding the wrong metric
|
|
897
|
+
* would never be discovered.
|
|
919
898
|
*/
|
|
920
899
|
export declare class UnboundMetricError extends Error {
|
|
921
900
|
constructor(path: string, reason: string);
|
|
@@ -924,11 +903,11 @@ export declare class UnboundMetricError extends Error {
|
|
|
924
903
|
/**
|
|
925
904
|
* Raised when a file a target matched cannot be read.
|
|
926
905
|
*
|
|
927
|
-
* Louder than
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
*
|
|
931
|
-
* breach pass.
|
|
906
|
+
* Louder than discovery's directory tolerance, on purpose: an unreadable
|
|
907
|
+
* directory narrows the measurement, while an unreadable matched file makes the
|
|
908
|
+
* total wrong.
|
|
909
|
+
*
|
|
910
|
+
* Quietly short by one file, a number would let a breach pass.
|
|
932
911
|
*/
|
|
933
912
|
export declare class UnreadableTargetFileError extends Error {
|
|
934
913
|
constructor(filePath: string, reason: string);
|
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"url": "https://github.com/organizzolini/codebase/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@codometer/configuration": "0.0.
|
|
8
|
-
"@codometer/core": "0.0.
|
|
9
|
-
"@codometer/languages": "0.0.
|
|
7
|
+
"@codometer/configuration": "0.0.79",
|
|
8
|
+
"@codometer/core": "0.0.79",
|
|
9
|
+
"@codometer/languages": "0.0.79",
|
|
10
10
|
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
11
11
|
"ignore": "7.0.14",
|
|
12
12
|
"pino": "^10.3.1",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"strict": true
|
|
65
65
|
},
|
|
66
66
|
"types": "./dist/src/index.d.ts",
|
|
67
|
-
"version": "0.0.
|
|
67
|
+
"version": "0.0.79"
|
|
68
68
|
}
|