@boringparts/verule 0.1.0 → 0.2.0
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/additional-inputs.d.ts +1 -1
- package/dist/additional-inputs.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/config-loader.js +111 -13
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/main.d.ts +12370 -1
- package/dist/main.js +234 -297
- package/dist/observation.d.ts +4 -22
- package/dist/observation.js +86 -150
- package/dist/projects.js +4 -1
- package/dist/report-wire.d.ts +136 -499
- package/dist/report-wire.js +54 -163
- package/dist/session-command.d.ts +1 -1
- package/dist/session-command.js +2 -4
- package/dist/session.d.ts +0 -3
- package/dist/session.js +27 -162
- package/dist/shared-session.js +1 -6
- package/dist/types.d.ts +10 -31
- package/dist/types.js +9 -7
- package/dist/watch-command.d.ts +50 -225
- package/dist/watch-command.js +3 -8
- package/dist/watch.d.ts +1 -3
- package/dist/watch.js +1 -15
- package/package.json +18 -5
package/dist/watch-command.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
57
57
|
kind: z.ZodLiteral<"rule">;
|
|
58
58
|
id: z.ZodString;
|
|
59
59
|
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
-
kind: z.ZodLiteral<"
|
|
60
|
+
kind: z.ZodLiteral<"summary">;
|
|
61
61
|
id: z.ZodString;
|
|
62
62
|
}, z.core.$strip>], "kind">>;
|
|
63
63
|
}, z.core.$strip>>;
|
|
@@ -76,9 +76,9 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
76
76
|
message: z.ZodString;
|
|
77
77
|
evidence: z.ZodArray<z.ZodObject<{
|
|
78
78
|
kind: z.ZodEnum<{
|
|
79
|
-
model: "model";
|
|
80
79
|
note: "note";
|
|
81
80
|
source: "source";
|
|
81
|
+
summary: "summary";
|
|
82
82
|
type: "type";
|
|
83
83
|
}>;
|
|
84
84
|
message: z.ZodString;
|
|
@@ -91,7 +91,13 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
91
91
|
start: z.ZodNumber;
|
|
92
92
|
end: z.ZodNumber;
|
|
93
93
|
}, z.core.$strip>>;
|
|
94
|
-
|
|
94
|
+
summaryId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
summarySource: z.ZodOptional<z.ZodEnum<{
|
|
96
|
+
builtin: "builtin";
|
|
97
|
+
community: "community";
|
|
98
|
+
local: "local";
|
|
99
|
+
package: "package";
|
|
100
|
+
}>>;
|
|
95
101
|
declaration: z.ZodOptional<z.ZodString>;
|
|
96
102
|
}, z.core.$strip>>;
|
|
97
103
|
projects: z.ZodArray<z.ZodString>;
|
|
@@ -116,11 +122,6 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
116
122
|
id: z.ZodString;
|
|
117
123
|
digest: z.ZodString;
|
|
118
124
|
}, z.core.$strip>>;
|
|
119
|
-
models: z.ZodArray<z.ZodObject<{
|
|
120
|
-
id: z.ZodString;
|
|
121
|
-
version: z.ZodOptional<z.ZodString>;
|
|
122
|
-
digest: z.ZodString;
|
|
123
|
-
}, z.core.$strip>>;
|
|
124
125
|
}, z.core.$strip>;
|
|
125
126
|
inlineIgnores: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
126
127
|
status: z.ZodEnum<{
|
|
@@ -182,24 +183,34 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
182
183
|
candidateCount: z.ZodNumber;
|
|
183
184
|
checkpointCount: z.ZodNumber;
|
|
184
185
|
providers: z.ZodArray<z.ZodString>;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
lowering: z.ZodObject<{
|
|
187
|
+
functionsLowered: z.ZodNumber;
|
|
188
|
+
verticesCreated: z.ZodNumber;
|
|
189
|
+
durationMs: z.ZodNumber;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
irCache: z.ZodObject<{
|
|
192
|
+
functionHits: z.ZodNumber;
|
|
193
|
+
functionMisses: z.ZodNumber;
|
|
194
|
+
filesReused: z.ZodNumber;
|
|
195
|
+
filesInvalidated: z.ZodNumber;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
summaryLookup: z.ZodObject<{
|
|
198
|
+
lookups: z.ZodNumber;
|
|
199
|
+
hits: z.ZodNumber;
|
|
200
|
+
misses: z.ZodNumber;
|
|
201
|
+
hitsBySource: z.ZodObject<{
|
|
202
|
+
local: z.ZodNumber;
|
|
203
|
+
package: z.ZodNumber;
|
|
204
|
+
community: z.ZodNumber;
|
|
205
|
+
builtin: z.ZodNumber;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
}, z.core.$strip>;
|
|
193
208
|
limit: z.ZodOptional<z.ZodObject<{
|
|
194
209
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
195
210
|
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
196
211
|
}, z.core.$strip>>;
|
|
197
212
|
truncated: z.ZodBoolean;
|
|
198
213
|
droppedCount: z.ZodNumber;
|
|
199
|
-
engineExtractions: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
200
|
-
extractions: z.ZodNumber;
|
|
201
|
-
candidates: z.ZodNumber;
|
|
202
|
-
}, z.core.$strip>>;
|
|
203
214
|
details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
204
215
|
kind: z.ZodEnum<{
|
|
205
216
|
checkpoint: "checkpoint";
|
|
@@ -347,71 +358,6 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
347
358
|
end: z.ZodNumber;
|
|
348
359
|
}, z.core.$strip>>;
|
|
349
360
|
}, z.core.$strip>>;
|
|
350
|
-
localGaps: z.ZodArray<z.ZodObject<{
|
|
351
|
-
status: z.ZodEnum<{
|
|
352
|
-
resolved_by_override: "resolved_by_override";
|
|
353
|
-
unresolved: "unresolved";
|
|
354
|
-
}>;
|
|
355
|
-
factTypeId: z.ZodString;
|
|
356
|
-
providerId: z.ZodString;
|
|
357
|
-
field: z.ZodOptional<z.ZodString>;
|
|
358
|
-
gap: z.ZodObject<{
|
|
359
|
-
kind: z.ZodString;
|
|
360
|
-
message: z.ZodString;
|
|
361
|
-
at: z.ZodOptional<z.ZodObject<{
|
|
362
|
-
file: z.ZodString;
|
|
363
|
-
line: z.ZodNumber;
|
|
364
|
-
column: z.ZodNumber;
|
|
365
|
-
endLine: z.ZodNumber;
|
|
366
|
-
endColumn: z.ZodNumber;
|
|
367
|
-
start: z.ZodNumber;
|
|
368
|
-
end: z.ZodNumber;
|
|
369
|
-
}, z.core.$strip>>;
|
|
370
|
-
}, z.core.$strip>;
|
|
371
|
-
subjectLocation: z.ZodOptional<z.ZodObject<{
|
|
372
|
-
file: z.ZodString;
|
|
373
|
-
line: z.ZodNumber;
|
|
374
|
-
column: z.ZodNumber;
|
|
375
|
-
endLine: z.ZodNumber;
|
|
376
|
-
endColumn: z.ZodNumber;
|
|
377
|
-
start: z.ZodNumber;
|
|
378
|
-
end: z.ZodNumber;
|
|
379
|
-
}, z.core.$strip>>;
|
|
380
|
-
resolvedBy: z.ZodOptional<z.ZodObject<{
|
|
381
|
-
providerId: z.ZodString;
|
|
382
|
-
operation: z.ZodString;
|
|
383
|
-
conclusion: z.ZodString;
|
|
384
|
-
at: z.ZodOptional<z.ZodObject<{
|
|
385
|
-
file: z.ZodString;
|
|
386
|
-
line: z.ZodNumber;
|
|
387
|
-
column: z.ZodNumber;
|
|
388
|
-
endLine: z.ZodNumber;
|
|
389
|
-
endColumn: z.ZodNumber;
|
|
390
|
-
start: z.ZodNumber;
|
|
391
|
-
end: z.ZodNumber;
|
|
392
|
-
}, z.core.$strip>>;
|
|
393
|
-
}, z.core.$strip>>;
|
|
394
|
-
impact: z.ZodOptional<z.ZodString>;
|
|
395
|
-
}, z.core.$strip>>;
|
|
396
|
-
providerEvaluations: z.ZodArray<z.ZodObject<{
|
|
397
|
-
providerId: z.ZodString;
|
|
398
|
-
factTypeId: z.ZodOptional<z.ZodString>;
|
|
399
|
-
status: z.ZodEnum<{
|
|
400
|
-
evaluated: "evaluated";
|
|
401
|
-
reused: "reused";
|
|
402
|
-
skipped: "skipped";
|
|
403
|
-
}>;
|
|
404
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
405
|
-
subjectLocation: z.ZodOptional<z.ZodObject<{
|
|
406
|
-
file: z.ZodString;
|
|
407
|
-
line: z.ZodNumber;
|
|
408
|
-
column: z.ZodNumber;
|
|
409
|
-
endLine: z.ZodNumber;
|
|
410
|
-
endColumn: z.ZodNumber;
|
|
411
|
-
start: z.ZodNumber;
|
|
412
|
-
end: z.ZodNumber;
|
|
413
|
-
}, z.core.$strip>>;
|
|
414
|
-
}, z.core.$strip>>;
|
|
415
361
|
providers: z.ZodArray<z.ZodString>;
|
|
416
362
|
cleanupPaths: z.ZodArray<z.ZodObject<{
|
|
417
363
|
instanceKey: z.ZodString;
|
|
@@ -442,13 +388,13 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
442
388
|
start: z.ZodNumber;
|
|
443
389
|
end: z.ZodNumber;
|
|
444
390
|
}, z.core.$strip>>;
|
|
445
|
-
|
|
391
|
+
summaryIds: z.ZodArray<z.ZodString>;
|
|
446
392
|
summary: z.ZodString;
|
|
447
393
|
evidence: z.ZodArray<z.ZodObject<{
|
|
448
394
|
kind: z.ZodEnum<{
|
|
449
|
-
model: "model";
|
|
450
395
|
note: "note";
|
|
451
396
|
source: "source";
|
|
397
|
+
summary: "summary";
|
|
452
398
|
type: "type";
|
|
453
399
|
}>;
|
|
454
400
|
message: z.ZodString;
|
|
@@ -461,7 +407,13 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
461
407
|
start: z.ZodNumber;
|
|
462
408
|
end: z.ZodNumber;
|
|
463
409
|
}, z.core.$strip>>;
|
|
464
|
-
|
|
410
|
+
summaryId: z.ZodOptional<z.ZodString>;
|
|
411
|
+
summarySource: z.ZodOptional<z.ZodEnum<{
|
|
412
|
+
builtin: "builtin";
|
|
413
|
+
community: "community";
|
|
414
|
+
local: "local";
|
|
415
|
+
package: "package";
|
|
416
|
+
}>>;
|
|
465
417
|
declaration: z.ZodOptional<z.ZodString>;
|
|
466
418
|
}, z.core.$strip>>;
|
|
467
419
|
}, z.core.$strip>>;
|
|
@@ -593,71 +545,6 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
593
545
|
end: z.ZodNumber;
|
|
594
546
|
}, z.core.$strip>>;
|
|
595
547
|
}, z.core.$strip>>;
|
|
596
|
-
localGaps: z.ZodArray<z.ZodObject<{
|
|
597
|
-
status: z.ZodEnum<{
|
|
598
|
-
resolved_by_override: "resolved_by_override";
|
|
599
|
-
unresolved: "unresolved";
|
|
600
|
-
}>;
|
|
601
|
-
factTypeId: z.ZodString;
|
|
602
|
-
providerId: z.ZodString;
|
|
603
|
-
field: z.ZodOptional<z.ZodString>;
|
|
604
|
-
gap: z.ZodObject<{
|
|
605
|
-
kind: z.ZodString;
|
|
606
|
-
message: z.ZodString;
|
|
607
|
-
at: z.ZodOptional<z.ZodObject<{
|
|
608
|
-
file: z.ZodString;
|
|
609
|
-
line: z.ZodNumber;
|
|
610
|
-
column: z.ZodNumber;
|
|
611
|
-
endLine: z.ZodNumber;
|
|
612
|
-
endColumn: z.ZodNumber;
|
|
613
|
-
start: z.ZodNumber;
|
|
614
|
-
end: z.ZodNumber;
|
|
615
|
-
}, z.core.$strip>>;
|
|
616
|
-
}, z.core.$strip>;
|
|
617
|
-
subjectLocation: z.ZodOptional<z.ZodObject<{
|
|
618
|
-
file: z.ZodString;
|
|
619
|
-
line: z.ZodNumber;
|
|
620
|
-
column: z.ZodNumber;
|
|
621
|
-
endLine: z.ZodNumber;
|
|
622
|
-
endColumn: z.ZodNumber;
|
|
623
|
-
start: z.ZodNumber;
|
|
624
|
-
end: z.ZodNumber;
|
|
625
|
-
}, z.core.$strip>>;
|
|
626
|
-
resolvedBy: z.ZodOptional<z.ZodObject<{
|
|
627
|
-
providerId: z.ZodString;
|
|
628
|
-
operation: z.ZodString;
|
|
629
|
-
conclusion: z.ZodString;
|
|
630
|
-
at: z.ZodOptional<z.ZodObject<{
|
|
631
|
-
file: z.ZodString;
|
|
632
|
-
line: z.ZodNumber;
|
|
633
|
-
column: z.ZodNumber;
|
|
634
|
-
endLine: z.ZodNumber;
|
|
635
|
-
endColumn: z.ZodNumber;
|
|
636
|
-
start: z.ZodNumber;
|
|
637
|
-
end: z.ZodNumber;
|
|
638
|
-
}, z.core.$strip>>;
|
|
639
|
-
}, z.core.$strip>>;
|
|
640
|
-
impact: z.ZodOptional<z.ZodString>;
|
|
641
|
-
}, z.core.$strip>>;
|
|
642
|
-
providerEvaluations: z.ZodArray<z.ZodObject<{
|
|
643
|
-
providerId: z.ZodString;
|
|
644
|
-
factTypeId: z.ZodOptional<z.ZodString>;
|
|
645
|
-
status: z.ZodEnum<{
|
|
646
|
-
evaluated: "evaluated";
|
|
647
|
-
reused: "reused";
|
|
648
|
-
skipped: "skipped";
|
|
649
|
-
}>;
|
|
650
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
651
|
-
subjectLocation: z.ZodOptional<z.ZodObject<{
|
|
652
|
-
file: z.ZodString;
|
|
653
|
-
line: z.ZodNumber;
|
|
654
|
-
column: z.ZodNumber;
|
|
655
|
-
endLine: z.ZodNumber;
|
|
656
|
-
endColumn: z.ZodNumber;
|
|
657
|
-
start: z.ZodNumber;
|
|
658
|
-
end: z.ZodNumber;
|
|
659
|
-
}, z.core.$strip>>;
|
|
660
|
-
}, z.core.$strip>>;
|
|
661
548
|
providers: z.ZodArray<z.ZodString>;
|
|
662
549
|
cleanupPaths: z.ZodArray<z.ZodObject<{
|
|
663
550
|
instanceKey: z.ZodString;
|
|
@@ -688,13 +575,13 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
688
575
|
start: z.ZodNumber;
|
|
689
576
|
end: z.ZodNumber;
|
|
690
577
|
}, z.core.$strip>>;
|
|
691
|
-
|
|
578
|
+
summaryIds: z.ZodArray<z.ZodString>;
|
|
692
579
|
summary: z.ZodString;
|
|
693
580
|
evidence: z.ZodArray<z.ZodObject<{
|
|
694
581
|
kind: z.ZodEnum<{
|
|
695
|
-
model: "model";
|
|
696
582
|
note: "note";
|
|
697
583
|
source: "source";
|
|
584
|
+
summary: "summary";
|
|
698
585
|
type: "type";
|
|
699
586
|
}>;
|
|
700
587
|
message: z.ZodString;
|
|
@@ -707,7 +594,13 @@ export declare const watchReportRecordSchema: z.ZodObject<{
|
|
|
707
594
|
start: z.ZodNumber;
|
|
708
595
|
end: z.ZodNumber;
|
|
709
596
|
}, z.core.$strip>>;
|
|
710
|
-
|
|
597
|
+
summaryId: z.ZodOptional<z.ZodString>;
|
|
598
|
+
summarySource: z.ZodOptional<z.ZodEnum<{
|
|
599
|
+
builtin: "builtin";
|
|
600
|
+
community: "community";
|
|
601
|
+
local: "local";
|
|
602
|
+
package: "package";
|
|
603
|
+
}>>;
|
|
711
604
|
declaration: z.ZodOptional<z.ZodString>;
|
|
712
605
|
}, z.core.$strip>>;
|
|
713
606
|
}, z.core.$strip>>;
|
|
@@ -755,77 +648,9 @@ export declare const watchFailureRecordSchema: z.ZodObject<{
|
|
|
755
648
|
}>;
|
|
756
649
|
code: z.ZodString;
|
|
757
650
|
message: z.ZodString;
|
|
758
|
-
conflict: z.ZodOptional<z.ZodObject<{
|
|
759
|
-
factTypeId: z.ZodString;
|
|
760
|
-
projectId: z.ZodString;
|
|
761
|
-
snapshotId: z.ZodNumber;
|
|
762
|
-
subjectHandleId: z.ZodString;
|
|
763
|
-
subjectLocation: z.ZodOptional<z.ZodObject<{
|
|
764
|
-
file: z.ZodString;
|
|
765
|
-
line: z.ZodNumber;
|
|
766
|
-
column: z.ZodNumber;
|
|
767
|
-
endLine: z.ZodNumber;
|
|
768
|
-
endColumn: z.ZodNumber;
|
|
769
|
-
start: z.ZodNumber;
|
|
770
|
-
end: z.ZodNumber;
|
|
771
|
-
}, z.core.$strip>>;
|
|
772
|
-
condition: z.ZodOptional<z.ZodUnknown>;
|
|
773
|
-
reason: z.ZodString;
|
|
774
|
-
parties: z.ZodTuple<[z.ZodObject<{
|
|
775
|
-
providerId: z.ZodString;
|
|
776
|
-
providers: z.ZodArray<z.ZodString>;
|
|
777
|
-
conclusion: z.ZodUnknown;
|
|
778
|
-
conclusionSummary: z.ZodString;
|
|
779
|
-
evidence: z.ZodArray<z.ZodObject<{
|
|
780
|
-
kind: z.ZodEnum<{
|
|
781
|
-
model: "model";
|
|
782
|
-
note: "note";
|
|
783
|
-
source: "source";
|
|
784
|
-
type: "type";
|
|
785
|
-
}>;
|
|
786
|
-
message: z.ZodString;
|
|
787
|
-
at: z.ZodOptional<z.ZodObject<{
|
|
788
|
-
file: z.ZodString;
|
|
789
|
-
line: z.ZodNumber;
|
|
790
|
-
column: z.ZodNumber;
|
|
791
|
-
endLine: z.ZodNumber;
|
|
792
|
-
endColumn: z.ZodNumber;
|
|
793
|
-
start: z.ZodNumber;
|
|
794
|
-
end: z.ZodNumber;
|
|
795
|
-
}, z.core.$strip>>;
|
|
796
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
797
|
-
declaration: z.ZodOptional<z.ZodString>;
|
|
798
|
-
}, z.core.$strip>>;
|
|
799
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
800
|
-
providerId: z.ZodString;
|
|
801
|
-
providers: z.ZodArray<z.ZodString>;
|
|
802
|
-
conclusion: z.ZodUnknown;
|
|
803
|
-
conclusionSummary: z.ZodString;
|
|
804
|
-
evidence: z.ZodArray<z.ZodObject<{
|
|
805
|
-
kind: z.ZodEnum<{
|
|
806
|
-
model: "model";
|
|
807
|
-
note: "note";
|
|
808
|
-
source: "source";
|
|
809
|
-
type: "type";
|
|
810
|
-
}>;
|
|
811
|
-
message: z.ZodString;
|
|
812
|
-
at: z.ZodOptional<z.ZodObject<{
|
|
813
|
-
file: z.ZodString;
|
|
814
|
-
line: z.ZodNumber;
|
|
815
|
-
column: z.ZodNumber;
|
|
816
|
-
endLine: z.ZodNumber;
|
|
817
|
-
endColumn: z.ZodNumber;
|
|
818
|
-
start: z.ZodNumber;
|
|
819
|
-
end: z.ZodNumber;
|
|
820
|
-
}, z.core.$strip>>;
|
|
821
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
822
|
-
declaration: z.ZodOptional<z.ZodString>;
|
|
823
|
-
}, z.core.$strip>>;
|
|
824
|
-
}, z.core.$strip>], null>;
|
|
825
|
-
}, z.core.$strip>>;
|
|
826
651
|
}, z.core.$strip>;
|
|
827
652
|
export type WireWatchFailureRecord = z.infer<typeof watchFailureRecordSchema>;
|
|
828
|
-
export declare function formatWatchReportText(record: WireWatchReportRecord): import("@
|
|
653
|
+
export declare function formatWatchReportText(record: WireWatchReportRecord): import("@boringparts/cli-contract").TextFragment | import("@boringparts/cli-contract").TextLine;
|
|
829
654
|
/**
|
|
830
655
|
* Streams complete analysis reports and single-round failures for `verule watch`,
|
|
831
656
|
* preserving the long-lived analysis session across edits until aborted.
|
package/dist/watch-command.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { text } from "@
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { text } from "@boringparts/cli-contract";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { loadProjectConfigWithDependencies } from "./config-loader.js";
|
|
5
5
|
import { REPORT_SCHEMA_VERSION, watchProject } from "./index.js";
|
|
6
|
-
import { appendGapLines, checkReportSchema,
|
|
6
|
+
import { appendGapLines, checkReportSchema, formatDiagnosticsLines, toWireReport, } from "./report-wire.js";
|
|
7
7
|
export const recomputationScopeSchema = z.object({
|
|
8
8
|
recomputedProjects: z.array(z.string()),
|
|
9
9
|
reusedProjects: z.array(z.string()),
|
|
@@ -29,7 +29,6 @@ export const watchFailureRecordSchema = z.object({
|
|
|
29
29
|
trigger: z.enum(["initial", "change"]),
|
|
30
30
|
code: z.string(),
|
|
31
31
|
message: z.string(),
|
|
32
|
-
conflict: factConflictDetailsSchema.optional(),
|
|
33
32
|
});
|
|
34
33
|
export function formatWatchReportText(record) {
|
|
35
34
|
const lines = formatDiagnosticsLines(record);
|
|
@@ -59,7 +58,6 @@ export async function* streamWatchEvents(workingDirectory, configOption, signal,
|
|
|
59
58
|
return {
|
|
60
59
|
config: loaded.config,
|
|
61
60
|
watchFiles: loaded.watchFiles,
|
|
62
|
-
adapterResolutionRoot: dirname(loaded.configPath),
|
|
63
61
|
};
|
|
64
62
|
},
|
|
65
63
|
});
|
|
@@ -94,9 +92,6 @@ export async function* streamWatchEvents(workingDirectory, configOption, signal,
|
|
|
94
92
|
trigger: event.trigger,
|
|
95
93
|
code: event.code,
|
|
96
94
|
message: event.message,
|
|
97
|
-
...(event.conflict !== undefined
|
|
98
|
-
? { conflict: toWireFactConflict(event.conflict) }
|
|
99
|
-
: {}),
|
|
100
95
|
});
|
|
101
96
|
}
|
|
102
97
|
}
|
package/dist/watch.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { type AnalysisSession, type CheckReport, type
|
|
1
|
+
import { type AnalysisSession, type CheckReport, type MemoryStats, type ObserveLimitInput, type ObserveMode, type ObserveOptions, type RecomputationScope, type SourceTarget, type VeruleConfig, type VeruleErrorCode, type WatchConfigLoadResult, type WatchEvent, type WatchProjectOptions } from "./types.ts";
|
|
2
2
|
export type WorkspaceFailureInfo = {
|
|
3
3
|
readonly code: VeruleErrorCode;
|
|
4
4
|
readonly message: string;
|
|
5
|
-
readonly conflict?: FactConflictDetails;
|
|
6
5
|
};
|
|
7
6
|
export type WorkspaceControllerOptions = {
|
|
8
7
|
readonly cwd: string;
|
|
9
8
|
readonly config?: VeruleConfig;
|
|
10
|
-
readonly adapterResolutionRoot?: string;
|
|
11
9
|
readonly loadConfig?: () => Promise<WatchConfigLoadResult>;
|
|
12
10
|
readonly watchFiles?: readonly string[];
|
|
13
11
|
readonly observe?: ObserveMode;
|
package/dist/watch.js
CHANGED
|
@@ -29,7 +29,6 @@ export function toExecutionErrorInfo(err) {
|
|
|
29
29
|
return {
|
|
30
30
|
code: err.code,
|
|
31
31
|
message: err.message,
|
|
32
|
-
...(err.conflict !== undefined ? { conflict: err.conflict } : {}),
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
return {
|
|
@@ -150,7 +149,6 @@ function createAbortPromise(signal) {
|
|
|
150
149
|
*/
|
|
151
150
|
export function createWorkspaceController(options) {
|
|
152
151
|
const absCwd = resolve(options.cwd);
|
|
153
|
-
let adapterResolutionRoot = resolve(options.adapterResolutionRoot ?? absCwd);
|
|
154
152
|
const debounceMs = options.debounceMs ?? 50;
|
|
155
153
|
let session;
|
|
156
154
|
let lastConfig;
|
|
@@ -325,7 +323,6 @@ export function createWorkspaceController(options) {
|
|
|
325
323
|
async function resolveCurrentConfig() {
|
|
326
324
|
if (options.loadConfig) {
|
|
327
325
|
const loaded = await options.loadConfig();
|
|
328
|
-
adapterResolutionRoot = resolve(absCwd, loaded.adapterResolutionRoot ?? adapterResolutionRoot);
|
|
329
326
|
if (loaded.watchFiles) {
|
|
330
327
|
configWatchFiles.clear();
|
|
331
328
|
for (const file of loaded.watchFiles) {
|
|
@@ -445,7 +442,6 @@ export function createWorkspaceController(options) {
|
|
|
445
442
|
session = await openSession({
|
|
446
443
|
cwd: absCwd,
|
|
447
444
|
config: lastConfig,
|
|
448
|
-
adapterResolutionRoot,
|
|
449
445
|
...(options.observe !== undefined
|
|
450
446
|
? { observe: options.observe }
|
|
451
447
|
: {}),
|
|
@@ -476,7 +472,6 @@ export function createWorkspaceController(options) {
|
|
|
476
472
|
changed: mergedChanged,
|
|
477
473
|
created: mergedCreated,
|
|
478
474
|
deleted: mergedDeleted,
|
|
479
|
-
adapterResolutionRoot,
|
|
480
475
|
...(reloadedConfig !== undefined ? { config: reloadedConfig } : {}),
|
|
481
476
|
});
|
|
482
477
|
}
|
|
@@ -538,7 +533,6 @@ export function createWorkspaceController(options) {
|
|
|
538
533
|
session = await openSession({
|
|
539
534
|
cwd: absCwd,
|
|
540
535
|
config: lastConfig,
|
|
541
|
-
adapterResolutionRoot,
|
|
542
536
|
...(options.observe !== undefined
|
|
543
537
|
? { observe: options.observe }
|
|
544
538
|
: {}),
|
|
@@ -575,9 +569,7 @@ export function createWorkspaceController(options) {
|
|
|
575
569
|
await applyPathsInternal(candidates);
|
|
576
570
|
}
|
|
577
571
|
if (lastFailure !== undefined) {
|
|
578
|
-
throw new VeruleExecutionError(lastFailure.code, lastFailure.message
|
|
579
|
-
? { conflict: lastFailure.conflict }
|
|
580
|
-
: undefined);
|
|
572
|
+
throw new VeruleExecutionError(lastFailure.code, lastFailure.message);
|
|
581
573
|
}
|
|
582
574
|
if (!session) {
|
|
583
575
|
throw new VeruleExecutionError("SESSION_CLOSED", "Analysis session is not open.");
|
|
@@ -661,9 +653,6 @@ export async function* watchProject(options) {
|
|
|
661
653
|
const controller = createWorkspaceController({
|
|
662
654
|
cwd: options.cwd,
|
|
663
655
|
...(options.config !== undefined ? { config: options.config } : {}),
|
|
664
|
-
...(options.adapterResolutionRoot !== undefined
|
|
665
|
-
? { adapterResolutionRoot: options.adapterResolutionRoot }
|
|
666
|
-
: {}),
|
|
667
656
|
...(options.loadConfig !== undefined
|
|
668
657
|
? { loadConfig: options.loadConfig }
|
|
669
658
|
: {}),
|
|
@@ -738,7 +727,6 @@ export async function* watchProject(options) {
|
|
|
738
727
|
trigger: "initial",
|
|
739
728
|
code: info.code,
|
|
740
729
|
message: info.message,
|
|
741
|
-
...(info.conflict !== undefined ? { conflict: info.conflict } : {}),
|
|
742
730
|
};
|
|
743
731
|
}
|
|
744
732
|
while (true) {
|
|
@@ -760,7 +748,6 @@ export async function* watchProject(options) {
|
|
|
760
748
|
trigger: "change",
|
|
761
749
|
code: info.code,
|
|
762
750
|
message: info.message,
|
|
763
|
-
...(info.conflict !== undefined ? { conflict: info.conflict } : {}),
|
|
764
751
|
};
|
|
765
752
|
continue;
|
|
766
753
|
}
|
|
@@ -794,7 +781,6 @@ export async function* watchProject(options) {
|
|
|
794
781
|
trigger: "change",
|
|
795
782
|
code: info.code,
|
|
796
783
|
message: info.message,
|
|
797
|
-
...(info.conflict !== undefined ? { conflict: info.conflict } : {}),
|
|
798
784
|
};
|
|
799
785
|
}
|
|
800
786
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boringparts/verule",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/boringparts/verule.git",
|
|
7
|
+
"directory": "packages/verule"
|
|
8
|
+
},
|
|
4
9
|
"bin": {
|
|
5
10
|
"verule": "./dist/cli.js"
|
|
6
11
|
},
|
|
@@ -18,20 +23,27 @@
|
|
|
18
23
|
"access": "public"
|
|
19
24
|
},
|
|
20
25
|
"dependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"tssae": "0.
|
|
26
|
+
"@boringparts/cli-contract": "0.7.0",
|
|
27
|
+
"tssae": "^0.2.0",
|
|
23
28
|
"zod": "^4.6.7"
|
|
24
29
|
},
|
|
25
30
|
"devDependencies": {
|
|
26
|
-
"@types/node": "
|
|
31
|
+
"@types/node": "~24.0.0",
|
|
27
32
|
"@verule/test-hosts": "0.0.0",
|
|
28
33
|
"@verule/tooling-config": "0.0.0",
|
|
29
34
|
"oxfmt": "^0.79.0",
|
|
30
35
|
"oxlint": "1.94.0",
|
|
31
36
|
"typescript-7": "npm:typescript@^7.0.2"
|
|
32
37
|
},
|
|
38
|
+
"devEngines": {
|
|
39
|
+
"runtime": {
|
|
40
|
+
"name": "node",
|
|
41
|
+
"version": "24.0.0",
|
|
42
|
+
"onFail": "download"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
33
45
|
"engines": {
|
|
34
|
-
"node": "
|
|
46
|
+
"node": ">=24.0.0"
|
|
35
47
|
},
|
|
36
48
|
"scripts": {
|
|
37
49
|
"build": "rm -rf dist && tsc -p tsconfig.build.json --pretty false",
|
|
@@ -41,6 +53,7 @@
|
|
|
41
53
|
"lint:fix": "oxlint --format=unix . --fix",
|
|
42
54
|
"postbuild": "node -e \"if (process.platform !== 'win32') require('node:fs').chmodSync('dist/cli.js', 0o755)\"",
|
|
43
55
|
"test": "node --conditions=source --test --test-reporter=spec 'test/*.test.ts' 'test/unit/**/*.test.ts' 'test/integration/**/*.test.ts'",
|
|
56
|
+
"test:dist": "node --test --test-reporter=spec 'test/*.test.ts'",
|
|
44
57
|
"test:e2e": "node --test --test-reporter=spec test/e2e/cli.test.ts",
|
|
45
58
|
"typecheck": "tsc -p tsconfig.node.json --noEmit --pretty false && node --conditions=source scripts/typecheck-cli-hosts.ts"
|
|
46
59
|
}
|