@cplieger/deadset-ts 8.0.0-dev.7 → 8.0.0-dev.9

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.
Files changed (137) hide show
  1. package/dist/bin/node-host.js +21 -3
  2. package/dist/src/analysis.js +94 -299
  3. package/dist/src/config.js +6 -83
  4. package/dist/src/configuration-files.js +2 -9
  5. package/dist/src/configured-declarations.js +15 -20
  6. package/dist/src/consumers.js +3 -30
  7. package/dist/src/contract/config.generated.js +544 -0
  8. package/dist/src/contract/contract.generated.js +20 -10
  9. package/dist/src/contract/report.generated.js +3 -2
  10. package/dist/src/conventions.js +3 -8
  11. package/dist/src/edges.js +36 -112
  12. package/dist/src/exempt-classes.js +0 -2
  13. package/dist/src/exempt.js +1 -1
  14. package/dist/src/failure.js +36 -0
  15. package/dist/src/findings/completion.js +5 -4
  16. package/dist/src/findings/emitters.js +1 -1
  17. package/dist/src/findings/intra-function.js +1 -1
  18. package/dist/src/findings/non-code-artifacts.js +2 -2
  19. package/dist/src/findings/unused-declarations.js +1 -1
  20. package/dist/src/findings/visibility-narrowing.js +2 -2
  21. package/dist/src/findings-pass.js +1 -1
  22. package/dist/src/framework-lifecycle.js +7 -7
  23. package/dist/src/fs/document.js +52 -0
  24. package/dist/src/fs/manifest.js +7 -0
  25. package/dist/src/injection-container.js +1 -1
  26. package/dist/src/json-document.js +194 -67
  27. package/dist/src/kinds.js +0 -7
  28. package/dist/src/load/classify.js +236 -0
  29. package/dist/src/load/diagnostics.js +79 -0
  30. package/dist/src/load/discover.js +230 -0
  31. package/dist/src/{emit-map.js → load/emit-map.js} +1 -1
  32. package/dist/src/load/expected-module.js +136 -0
  33. package/dist/src/load/load.js +22 -0
  34. package/dist/src/load/module-lookup.js +37 -0
  35. package/dist/src/load/plan.js +155 -0
  36. package/dist/src/{test-globals.js → load/test-globals.js} +51 -56
  37. package/dist/src/load/test-joins.js +82 -0
  38. package/dist/src/{workspace-manifests.js → load/workspace-manifests.js} +3 -3
  39. package/dist/src/{workspace-programs.js → load/workspace-programs.js} +37 -40
  40. package/dist/src/{workspace-resolution.js → load/workspace-resolution.js} +21 -59
  41. package/dist/src/{workspace-run.js → load/workspace-run.js} +4 -3
  42. package/dist/src/{workspace.js → load/workspace.js} +21 -17
  43. package/dist/src/outside-tests.js +1 -1
  44. package/dist/src/print.js +10 -79
  45. package/dist/src/report-schema.js +3 -224
  46. package/dist/src/resolve.js +245 -715
  47. package/dist/src/run.js +59 -72
  48. package/dist/src/schema.js +320 -344
  49. package/dist/src/scope.js +37 -113
  50. package/dist/src/serialization-contract.js +1 -1
  51. package/dist/src/session.js +22 -28
  52. package/dist/src/source-files.js +1 -1
  53. package/dist/src/suppress-file.js +15 -17
  54. package/dist/src/suppress.js +3 -3
  55. package/dist/src/template-field.js +4 -4
  56. package/dist/src/type-errors.js +11 -216
  57. package/dist/src/usage.js +10 -0
  58. package/dist/src/verbs/analyze.js +100 -122
  59. package/dist/src/verbs/describe.js +5 -12
  60. package/dist/src/verbs/explain.js +3 -3
  61. package/dist/src/verbs/print-projects.js +2 -2
  62. package/dist/src/verbs/version.js +12 -2
  63. package/jsr.json +1 -1
  64. package/package.json +1 -1
  65. package/src/analysis.ts +95 -460
  66. package/src/config.ts +31 -298
  67. package/src/configuration-files.ts +8 -10
  68. package/src/configured-declarations.ts +18 -23
  69. package/src/consumers.ts +6 -57
  70. package/src/contract/config.generated.ts +798 -0
  71. package/src/contract/contract.generated.ts +20 -10
  72. package/src/contract/report.generated.ts +3 -2
  73. package/src/conventions.ts +6 -12
  74. package/src/edges.ts +39 -124
  75. package/src/exempt-classes.ts +0 -5
  76. package/src/exempt.ts +4 -4
  77. package/src/failure.ts +63 -0
  78. package/src/findings/completion.ts +5 -6
  79. package/src/findings/emitter.ts +2 -2
  80. package/src/findings/emitters.ts +1 -1
  81. package/src/findings/intra-function.ts +1 -1
  82. package/src/findings/non-code-artifacts.ts +4 -4
  83. package/src/findings/unused-declarations.ts +1 -1
  84. package/src/findings/visibility-narrowing.ts +2 -2
  85. package/src/findings-pass.ts +3 -3
  86. package/src/framework-lifecycle.ts +7 -7
  87. package/src/fs/document.ts +70 -0
  88. package/src/fs/manifest.ts +8 -0
  89. package/src/host.ts +12 -5
  90. package/src/injection-container.ts +1 -1
  91. package/src/json-document.ts +236 -76
  92. package/src/kinds.ts +0 -8
  93. package/src/load/classify.ts +352 -0
  94. package/src/load/diagnostics.ts +141 -0
  95. package/src/load/discover.ts +378 -0
  96. package/src/{emit-map.ts → load/emit-map.ts} +1 -1
  97. package/src/load/expected-module.ts +188 -0
  98. package/src/load/load.ts +61 -0
  99. package/src/load/module-lookup.ts +50 -0
  100. package/src/load/plan.ts +258 -0
  101. package/src/{test-globals.ts → load/test-globals.ts} +59 -65
  102. package/src/load/test-joins.ts +98 -0
  103. package/src/{workspace-manifests.ts → load/workspace-manifests.ts} +4 -4
  104. package/src/{workspace-programs.ts → load/workspace-programs.ts} +59 -53
  105. package/src/{workspace-resolution.ts → load/workspace-resolution.ts} +31 -78
  106. package/src/{workspace-run.ts → load/workspace-run.ts} +14 -11
  107. package/src/{workspace.ts → load/workspace.ts} +28 -21
  108. package/src/outside-tests.ts +1 -1
  109. package/src/partial.ts +1 -1
  110. package/src/print.ts +11 -92
  111. package/src/report-schema.ts +3 -299
  112. package/src/resolve.ts +281 -1105
  113. package/src/run.ts +68 -80
  114. package/src/schema.ts +391 -389
  115. package/src/scope.ts +45 -131
  116. package/src/serialization-contract.ts +1 -1
  117. package/src/session.ts +52 -53
  118. package/src/source-files.ts +1 -1
  119. package/src/suppress-file.ts +15 -20
  120. package/src/suppress.ts +3 -3
  121. package/src/template-field.ts +10 -7
  122. package/src/type-errors.ts +18 -288
  123. package/src/usage.ts +10 -0
  124. package/src/verbs/analyze.ts +139 -157
  125. package/src/verbs/describe.ts +4 -11
  126. package/src/verbs/explain.ts +3 -7
  127. package/src/verbs/print-projects.ts +2 -2
  128. package/src/verbs/verb.ts +2 -2
  129. package/src/verbs/version.ts +13 -2
  130. package/dist/src/base-url.js +0 -18
  131. package/dist/src/discover.js +0 -374
  132. package/dist/src/setup-failure.js +0 -19
  133. package/dist/src/test-joins.js +0 -101
  134. package/src/base-url.ts +0 -24
  135. package/src/discover.ts +0 -548
  136. package/src/setup-failure.ts +0 -37
  137. package/src/test-joins.ts +0 -118
@@ -0,0 +1,544 @@
1
+ // Code generated by scripts/gen-config.ts from the Contract copy under fixtures/ (npm run gen). DO NOT EDIT.
2
+ export const SETTINGS = [
3
+ {
4
+ key: "contract_version",
5
+ role: "setting",
6
+ read: true,
7
+ default: "8.0.0",
8
+ value: { type: "string", pattern: "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
9
+ },
10
+ { key: "target", role: "section", read: true },
11
+ {
12
+ key: "target.kind",
13
+ role: "setting",
14
+ read: true,
15
+ required: true,
16
+ value: {
17
+ oneOf: [
18
+ { type: "string", enum: ["application", "library"] },
19
+ {
20
+ type: "object",
21
+ additionalProperties: false,
22
+ required: ["ts"],
23
+ properties: { ts: { type: "string", enum: ["application", "library"] } },
24
+ },
25
+ ],
26
+ },
27
+ perLanguage: ["go", "ts"],
28
+ },
29
+ { key: "analysis", role: "section", read: true },
30
+ { key: "analysis.languages", role: "setting", read: false },
31
+ {
32
+ key: "analysis.min_confidence",
33
+ role: "setting",
34
+ read: true,
35
+ default: "probable",
36
+ option: "min-confidence",
37
+ value: { type: "string", enum: ["certain", "probable", "possible"] },
38
+ },
39
+ {
40
+ key: "analysis.generated_files",
41
+ role: "setting",
42
+ read: true,
43
+ default: "exclude",
44
+ value: { type: "string", enum: ["exclude", "include"] },
45
+ },
46
+ {
47
+ key: "analysis.consumer_tests",
48
+ role: "setting",
49
+ read: true,
50
+ default: "test",
51
+ value: { type: "string", enum: ["test", "production"] },
52
+ },
53
+ {
54
+ key: "analysis.configurations",
55
+ role: "setting",
56
+ read: true,
57
+ default: [],
58
+ value: {
59
+ type: "array",
60
+ items: {
61
+ oneOf: [
62
+ {
63
+ type: "object",
64
+ additionalProperties: false,
65
+ required: ["id", "os", "arch"],
66
+ properties: {
67
+ id: { type: "string", minLength: 1 },
68
+ os: { type: "string", minLength: 1 },
69
+ arch: { type: "string", minLength: 1 },
70
+ tags: { type: "array", uniqueItems: true, items: { type: "string", minLength: 1 } },
71
+ },
72
+ },
73
+ {
74
+ type: "object",
75
+ additionalProperties: false,
76
+ required: ["id", "project"],
77
+ properties: {
78
+ id: { type: "string", minLength: 1 },
79
+ project: {
80
+ type: "string",
81
+ minLength: 1,
82
+ pattern: "^(?:[^/.\\x00-\\x1f\\x7f][^/\\x00-\\x1f\\x7f]*|\\.[^/.\\x00-\\x1f\\x7f][^/\\x00-\\x1f\\x7f]*|\\.\\.[^/\\x00-\\x1f\\x7f]+)(?:/(?:[^/.\\x00-\\x1f\\x7f][^/\\x00-\\x1f\\x7f]*|\\.[^/.\\x00-\\x1f\\x7f][^/\\x00-\\x1f\\x7f]*|\\.\\.[^/\\x00-\\x1f\\x7f]+))*$",
83
+ },
84
+ },
85
+ },
86
+ ],
87
+ },
88
+ },
89
+ },
90
+ { key: "analysis.matrix", role: "section", read: true },
91
+ {
92
+ key: "analysis.matrix.complete",
93
+ role: "setting",
94
+ read: true,
95
+ default: false,
96
+ value: { type: "boolean" },
97
+ },
98
+ {
99
+ key: "analysis.template_dirs",
100
+ role: "setting",
101
+ read: true,
102
+ default: [],
103
+ value: { type: "array", uniqueItems: true, items: { type: "string", minLength: 1 } },
104
+ },
105
+ {
106
+ key: "analysis.template_delimiters",
107
+ role: "setting",
108
+ read: true,
109
+ default: { left: "{{", right: "}}" },
110
+ value: {
111
+ type: "object",
112
+ additionalProperties: false,
113
+ required: ["left", "right"],
114
+ properties: {
115
+ left: { type: "string", minLength: 1 },
116
+ right: { type: "string", minLength: 1 },
117
+ },
118
+ },
119
+ },
120
+ { key: "consumers", role: "section", read: true },
121
+ {
122
+ key: "consumers.complete",
123
+ role: "setting",
124
+ read: true,
125
+ default: false,
126
+ value: { type: "boolean" },
127
+ },
128
+ { key: "roots", role: "section", read: true },
129
+ {
130
+ key: "roots.patterns",
131
+ role: "setting",
132
+ read: true,
133
+ default: [],
134
+ value: { type: "array", uniqueItems: true, items: { type: "string", minLength: 1 } },
135
+ },
136
+ {
137
+ key: "severity",
138
+ role: "keyed",
139
+ read: true,
140
+ default: {},
141
+ value: { type: "string", enum: ["allow", "warn", "deny"] },
142
+ keyPattern: "^DS[0-9]{2}([0-9]{2})?$",
143
+ values: [
144
+ "DS10",
145
+ "DS1001",
146
+ "DS1002",
147
+ "DS1003",
148
+ "DS1004",
149
+ "DS1005",
150
+ "DS1006",
151
+ "DS11",
152
+ "DS1101",
153
+ "DS1102",
154
+ "DS1103",
155
+ "DS1104",
156
+ "DS12",
157
+ "DS1201",
158
+ "DS1202",
159
+ "DS1203",
160
+ "DS13",
161
+ "DS1301",
162
+ "DS14",
163
+ "DS1401",
164
+ "DS1402",
165
+ "DS1403",
166
+ "DS1404",
167
+ "DS1405",
168
+ "DS1406",
169
+ "DS15",
170
+ "DS1501",
171
+ "DS1502",
172
+ "DS1503",
173
+ "DS16",
174
+ "DS1601",
175
+ "DS1602",
176
+ "DS17",
177
+ "DS1701",
178
+ "DS1702",
179
+ "DS9001",
180
+ "DS9002",
181
+ "DS9005",
182
+ ],
183
+ },
184
+ { key: "exemptions", role: "section", read: true },
185
+ {
186
+ key: "exemptions.disabled",
187
+ role: "setting",
188
+ read: true,
189
+ default: [],
190
+ value: {
191
+ type: "array",
192
+ uniqueItems: true,
193
+ items: {
194
+ type: "string",
195
+ enum: [
196
+ "interface-satisfaction",
197
+ "encoding-reflection",
198
+ "format-verb-contract",
199
+ "errors-duck-typing",
200
+ "enum-group",
201
+ "generated-file",
202
+ "linkname-cgo-asm-plugin",
203
+ "template-field",
204
+ "reflective-lookup",
205
+ "decorator",
206
+ "injection-container",
207
+ "framework-lifecycle",
208
+ "serialization-contract",
209
+ ],
210
+ },
211
+ },
212
+ },
213
+ { key: "reporters", role: "section", read: true },
214
+ {
215
+ key: "reporters.formats",
216
+ role: "setting",
217
+ read: true,
218
+ default: ["text"],
219
+ value: {
220
+ type: "array",
221
+ uniqueItems: true,
222
+ minItems: 1,
223
+ items: { type: "string", enum: ["text", "json", "github", "sarif", "template"] },
224
+ },
225
+ },
226
+ {
227
+ key: "reporters.sort",
228
+ role: "setting",
229
+ read: true,
230
+ default: "position",
231
+ option: "sort",
232
+ value: { type: "string", enum: ["position", "size"] },
233
+ },
234
+ {
235
+ key: "reporters.cascade",
236
+ role: "setting",
237
+ read: true,
238
+ default: "roots",
239
+ option: "cascade",
240
+ value: { type: "string", enum: ["roots", "full"] },
241
+ },
242
+ {
243
+ key: "reporters.max_findings",
244
+ role: "setting",
245
+ read: true,
246
+ default: 0,
247
+ option: "max-findings",
248
+ value: { type: "integer", minimum: 0, maximum: 9007199254740991 },
249
+ },
250
+ {
251
+ key: "reporters.fail_on",
252
+ role: "setting",
253
+ read: true,
254
+ default: "deny",
255
+ option: "fail-on",
256
+ value: { type: "string", enum: ["allow", "warn", "deny"] },
257
+ },
258
+ { key: "providers", role: "section", read: false },
259
+ { key: "providers.analyzers", role: "setting", read: false },
260
+ { key: "go", role: "section", read: false },
261
+ { key: "ts", role: "section", read: true },
262
+ {
263
+ key: "ts.test_files",
264
+ role: "setting",
265
+ read: true,
266
+ default: [
267
+ "**/*.test.{ts,tsx,mts,cts}",
268
+ "**/*.test-d.{ts,tsx,mts,cts}",
269
+ "**/*.spec-d.{ts,tsx,mts,cts}",
270
+ "**/*.spec.*",
271
+ "**/__tests__/**",
272
+ "**/__mocks__/**",
273
+ "**/test-d/**",
274
+ ],
275
+ value: {
276
+ type: "array",
277
+ uniqueItems: true,
278
+ minItems: 1,
279
+ items: { type: "string", minLength: 1 },
280
+ },
281
+ },
282
+ {
283
+ key: "ts.entry_files",
284
+ role: "setting",
285
+ read: true,
286
+ default: [],
287
+ value: { type: "array", uniqueItems: true, items: { type: "string", minLength: 1 } },
288
+ },
289
+ {
290
+ key: "ts.component_extensions",
291
+ role: "setting",
292
+ read: true,
293
+ default: [".vue", ".svelte", ".astro"],
294
+ value: {
295
+ type: "array",
296
+ uniqueItems: true,
297
+ items: { type: "string", pattern: "^\\.[A-Za-z0-9]+$" },
298
+ },
299
+ },
300
+ {
301
+ key: "ts.disabled_conventions",
302
+ role: "setting",
303
+ read: true,
304
+ default: [],
305
+ value: {
306
+ type: "array",
307
+ uniqueItems: true,
308
+ items: { type: "string", pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$" },
309
+ },
310
+ },
311
+ {
312
+ key: "ts.injection_registrations",
313
+ role: "setting",
314
+ read: true,
315
+ default: [],
316
+ value: {
317
+ type: "array",
318
+ items: {
319
+ oneOf: [
320
+ {
321
+ type: "object",
322
+ additionalProperties: false,
323
+ required: ["symbol"],
324
+ properties: { symbol: { type: "string", pattern: "^ts://" } },
325
+ },
326
+ {
327
+ type: "object",
328
+ additionalProperties: false,
329
+ required: ["module", "name"],
330
+ properties: {
331
+ module: { type: "string", pattern: "^[^./#]" },
332
+ name: { type: "string", minLength: 1 },
333
+ },
334
+ },
335
+ {
336
+ type: "object",
337
+ additionalProperties: false,
338
+ required: ["global"],
339
+ properties: { global: { type: "string", minLength: 1 } },
340
+ },
341
+ ],
342
+ },
343
+ },
344
+ },
345
+ {
346
+ key: "ts.lifecycle_contracts",
347
+ role: "setting",
348
+ read: true,
349
+ default: [],
350
+ value: {
351
+ type: "array",
352
+ items: {
353
+ type: "object",
354
+ additionalProperties: false,
355
+ required: ["members"],
356
+ anyOf: [
357
+ { required: ["components"], properties: { components: { minItems: 1 } } },
358
+ { required: ["bases"], properties: { bases: { minItems: 1 } } },
359
+ ],
360
+ properties: {
361
+ components: {
362
+ type: "array",
363
+ items: {
364
+ oneOf: [
365
+ {
366
+ type: "object",
367
+ additionalProperties: false,
368
+ required: ["symbol"],
369
+ properties: { symbol: { type: "string", pattern: "^ts://" } },
370
+ },
371
+ {
372
+ type: "object",
373
+ additionalProperties: false,
374
+ required: ["module", "name"],
375
+ properties: {
376
+ module: { type: "string", pattern: "^[^./#]" },
377
+ name: { type: "string", minLength: 1 },
378
+ },
379
+ },
380
+ {
381
+ type: "object",
382
+ additionalProperties: false,
383
+ required: ["global"],
384
+ properties: { global: { type: "string", minLength: 1 } },
385
+ },
386
+ ],
387
+ },
388
+ },
389
+ bases: {
390
+ type: "array",
391
+ items: {
392
+ oneOf: [
393
+ {
394
+ type: "object",
395
+ additionalProperties: false,
396
+ required: ["symbol"],
397
+ properties: { symbol: { type: "string", pattern: "^ts://" } },
398
+ },
399
+ {
400
+ type: "object",
401
+ additionalProperties: false,
402
+ required: ["module", "name"],
403
+ properties: {
404
+ module: { type: "string", pattern: "^[^./#]" },
405
+ name: { type: "string", minLength: 1 },
406
+ },
407
+ },
408
+ {
409
+ type: "object",
410
+ additionalProperties: false,
411
+ required: ["global"],
412
+ properties: { global: { type: "string", minLength: 1 } },
413
+ },
414
+ ],
415
+ },
416
+ },
417
+ members: {
418
+ type: "array",
419
+ uniqueItems: true,
420
+ minItems: 1,
421
+ items: { type: "string", minLength: 1 },
422
+ },
423
+ },
424
+ },
425
+ },
426
+ },
427
+ {
428
+ key: "ts.serializers",
429
+ role: "setting",
430
+ read: true,
431
+ default: [],
432
+ value: {
433
+ type: "array",
434
+ items: {
435
+ oneOf: [
436
+ {
437
+ type: "object",
438
+ additionalProperties: false,
439
+ required: ["symbol"],
440
+ properties: { symbol: { type: "string", pattern: "^ts://" } },
441
+ },
442
+ {
443
+ type: "object",
444
+ additionalProperties: false,
445
+ required: ["module", "name"],
446
+ properties: {
447
+ module: { type: "string", pattern: "^[^./#]" },
448
+ name: { type: "string", minLength: 1 },
449
+ },
450
+ },
451
+ {
452
+ type: "object",
453
+ additionalProperties: false,
454
+ required: ["global"],
455
+ properties: { global: { type: "string", minLength: 1 } },
456
+ },
457
+ ],
458
+ },
459
+ },
460
+ },
461
+ {
462
+ key: "ts.roots_complete",
463
+ role: "setting",
464
+ read: true,
465
+ default: false,
466
+ value: { type: "boolean" },
467
+ },
468
+ {
469
+ key: "provenance",
470
+ role: "ignored",
471
+ read: true,
472
+ value: { type: "string", pattern: "^(default|(repository|central|flag): [^\\r\\n]+)$" },
473
+ keyPattern: "^[a-z][a-z_]*(\\.[A-Za-z0-9_]+)*$",
474
+ },
475
+ ];
476
+ /** The bound on a configuration document, in bytes. */
477
+ export const CONFIG_MAX_BYTES = 1048576;
478
+ /** The scope document's schema, as the validator reads it. */
479
+ export const SCOPE_SCHEMA = {
480
+ type: "object",
481
+ additionalProperties: false,
482
+ required: ["target"],
483
+ properties: {
484
+ target: {
485
+ type: "object",
486
+ additionalProperties: false,
487
+ required: ["path"],
488
+ properties: {
489
+ id: { type: "string", minLength: 1 },
490
+ role: { type: "string", enum: ["target"] },
491
+ path: { type: "string", minLength: 1 },
492
+ },
493
+ },
494
+ workspace: { type: "string", minLength: 1 },
495
+ consumers: {
496
+ type: "array",
497
+ items: {
498
+ type: "object",
499
+ additionalProperties: false,
500
+ required: ["path"],
501
+ properties: {
502
+ id: { type: "string", minLength: 1 },
503
+ role: { type: "string", enum: ["consumer"] },
504
+ path: { type: "string", minLength: 1 },
505
+ },
506
+ },
507
+ },
508
+ },
509
+ };
510
+ /** The edges document's schema, as the validator reads it. */
511
+ export const EDGES_SCHEMA = {
512
+ type: "object",
513
+ additionalProperties: false,
514
+ required: ["edges"],
515
+ properties: {
516
+ description: { type: "string" },
517
+ edges: {
518
+ type: "object",
519
+ propertyNames: { $ref: "#/$defs/edge_identifier" },
520
+ additionalProperties: {
521
+ type: "object",
522
+ additionalProperties: false,
523
+ required: ["provides", "used_by"],
524
+ properties: {
525
+ because: { type: "string" },
526
+ provides: { $ref: "#/$defs/reference" },
527
+ used_by: { $ref: "#/$defs/reference" },
528
+ },
529
+ },
530
+ },
531
+ },
532
+ $defs: {
533
+ reference: {
534
+ type: "string",
535
+ allOf: [
536
+ { pattern: "^[a-z][a-z0-9]*://[^ \\t\\r\\n#]+#[^ \\t\\r\\n]*$" },
537
+ {
538
+ pattern: "^(?:[^'\\[*]|'(?:[^'\\\\]|\\\\[^\\r\\n])*'|\\[[^\\]]*\\])*(?:'(?:[^'\\\\]|\\\\[^\\r\\n])*\\\\?|\\[[^\\]]*)?$",
539
+ },
540
+ ],
541
+ },
542
+ edge_identifier: { type: "string", pattern: "^[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$" },
543
+ },
544
+ };
@@ -1072,13 +1072,23 @@ export const EVIDENCE = [
1072
1072
  ],
1073
1073
  },
1074
1074
  ];
1075
- export const SETUP_CLASSES = [
1076
- { class: "missing-module", languages: ["go", "ts"] },
1077
- { class: "incomplete-module-sum", languages: ["go"] },
1078
- { class: "missing-consumer", languages: ["go", "ts"] },
1079
- { class: "workspace-member-without-source", languages: ["ts"] },
1080
- { class: "convention-not-literal", languages: ["ts"] },
1081
- { class: "no-program", languages: ["go", "ts"] },
1082
- ];
1083
- /** The text opening the line of the error stream that names one setup failure. */
1084
- export const SETUP_FAILURE_PREFIX = "setup failure: ";
1075
+ /** Each group of failure classes, and the text opening the line that names one of its failures. */
1076
+ export const FAILURE_PREFIXES = { setup: "setup failure: ", run: "run failure: " };
1077
+ /** Each failure class the Contract names, and its group. */
1078
+ export const FAILURE_CLASSES = {
1079
+ "missing-module": "setup",
1080
+ "incomplete-module-sum": "setup",
1081
+ "missing-consumer": "setup",
1082
+ "workspace-member-without-source": "setup",
1083
+ "convention-not-literal": "setup",
1084
+ "no-program": "setup",
1085
+ "unreadable-document": "setup",
1086
+ "unwritten-output": "run",
1087
+ "unreportable-path": "run",
1088
+ "memory-exhausted": "run",
1089
+ "missing-analyzer": "run",
1090
+ "unadmitted-analyzer": "run",
1091
+ "unresolved-edge": "run",
1092
+ "interrupted-run": "run",
1093
+ "product-fault": "run",
1094
+ };
@@ -235,7 +235,7 @@ export const REPORT_SCHEMAS = {
235
235
  additionalProperties: false,
236
236
  required: ["edge", "side", "symbol", "state"],
237
237
  properties: {
238
- edge: { type: "string", pattern: "^[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$" },
238
+ edge: { $ref: "finding.schema.json#/$defs/edge_identifier" },
239
239
  side: { type: "string", enum: ["provides", "used_by"] },
240
240
  symbol: { type: "string" },
241
241
  state: { type: "string", enum: ["live", "dead", "absent"] },
@@ -609,7 +609,7 @@ export const REPORT_SCHEMAS = {
609
609
  uniqueItems: true,
610
610
  items: { type: "string", minLength: 1 },
611
611
  },
612
- edge: { type: "string", pattern: "^[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$" },
612
+ edge: { $ref: "#/$defs/edge_identifier" },
613
613
  sides: {
614
614
  type: "array",
615
615
  minItems: 1,
@@ -765,6 +765,7 @@ export const REPORT_SCHEMAS = {
765
765
  },
766
766
  ],
767
767
  $defs: {
768
+ edge_identifier: { type: "string", pattern: "^[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$" },
768
769
  position: {
769
770
  type: "object",
770
771
  additionalProperties: false,
@@ -15,7 +15,7 @@ import { bytewise } from "./text/compare.js";
15
15
  import { isRecord } from "./json-document.js";
16
16
  import { unwrapped } from "./unwrap.js";
17
17
  import { filesIn } from "./fs/tree.js";
18
- import { INSTALLED_PACKAGES, MANIFEST, readJSON } from "./fs/manifest.js";
18
+ import { DEPENDENCY_SECTIONS, INSTALLED_PACKAGES, MANIFEST, readJSON } from "./fs/manifest.js";
19
19
  import { globExpression } from "./text/glob.js";
20
20
  import { yamlDocument } from "./text/yaml.js";
21
21
  const JSON_EXTENSION = ".json";
@@ -29,11 +29,6 @@ const YAML_NAME = /\.ya?ml$/u;
29
29
  const JSON_RC = /^\.[\w-]+rc$/u;
30
30
  /** The sections an installed package is required by, so its absence fails the run. */
31
31
  const REQUIRED_SECTIONS = ["dependencies", "devDependencies"];
32
- const DEPENDENCY_SECTIONS = [
33
- ...REQUIRED_SECTIONS,
34
- "peerDependencies",
35
- "optionalDependencies",
36
- ];
37
32
  function declares(manifest, name, sections = DEPENDENCY_SECTIONS) {
38
33
  if (!isRecord(manifest)) {
39
34
  return false;
@@ -776,7 +771,7 @@ export function readConventions(host, parse, manifests, disabled, rows = CONVENT
776
771
  failures.push({
777
772
  dir: manifest.dir,
778
773
  failure: {
779
- setupClass: "missing-module",
774
+ failureClass: "missing-module",
780
775
  detail: `${manifest.path} declares ${row.package}, which no node_modules at or ` +
781
776
  `above its directory holds: run the package manager's install`,
782
777
  },
@@ -801,7 +796,7 @@ export function readConventions(host, parse, manifests, disabled, rows = CONVENT
801
796
  failures.push({
802
797
  dir: manifest.dir,
803
798
  failure: {
804
- setupClass: "convention-not-literal",
799
+ failureClass: "convention-not-literal",
805
800
  detail: where === "." ? failed : `${where}/${failed}`,
806
801
  },
807
802
  });