@cplieger/deadset-ts 8.0.0-dev.6 → 8.0.0-dev.8

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 (193) hide show
  1. package/dist/bin/mapper-connection.js +2 -1
  2. package/dist/bin/node-host.js +24 -5
  3. package/dist/src/analysis.js +37 -56
  4. package/dist/src/automatic-types.js +10 -29
  5. package/dist/src/build-scripts.js +17 -29
  6. package/dist/src/component-layer.js +4 -2
  7. package/dist/src/components.js +2 -3
  8. package/dist/src/config.js +6 -82
  9. package/dist/src/configuration-files.js +27 -168
  10. package/dist/src/configured-declarations.js +15 -20
  11. package/dist/src/consumers.js +2 -2
  12. package/dist/src/contract/config.generated.js +544 -0
  13. package/dist/src/contract/contract.generated.js +13 -0
  14. package/dist/src/contract/report.generated.js +3 -2
  15. package/dist/src/conventions.js +20 -60
  16. package/dist/src/dependencies.js +25 -43
  17. package/dist/src/discover.js +14 -40
  18. package/dist/src/edges.js +38 -122
  19. package/dist/src/element-access.js +4 -6
  20. package/dist/src/entry-point-gaps.js +2 -8
  21. package/dist/src/entry-points.js +3 -10
  22. package/dist/src/enum-group.js +3 -10
  23. package/dist/src/erased-stores.js +4 -6
  24. package/dist/src/exempt-classes.js +0 -4
  25. package/dist/src/exempt.js +6 -22
  26. package/dist/src/file-facts.js +2 -25
  27. package/dist/src/findings/completion.js +5 -4
  28. package/dist/src/findings/emitters.js +1 -1
  29. package/dist/src/findings/intra-function.js +1 -1
  30. package/dist/src/findings/non-code-artifacts.js +2 -2
  31. package/dist/src/findings/reads-and-writes.js +2 -1
  32. package/dist/src/findings/self-check.js +3 -2
  33. package/dist/src/findings/unused-declarations.js +1 -1
  34. package/dist/src/findings/visibility-narrowing.js +2 -2
  35. package/dist/src/findings-pass.js +7 -12
  36. package/dist/src/framework-lifecycle.js +7 -7
  37. package/dist/src/fs/document.js +59 -0
  38. package/dist/src/fs/manifest.js +43 -0
  39. package/dist/src/fs/tree.js +88 -0
  40. package/dist/src/git-ignore.js +34 -25
  41. package/dist/src/html-entries.js +6 -33
  42. package/dist/src/in-operands.js +2 -1
  43. package/dist/src/injection-container.js +1 -1
  44. package/dist/src/intra-function-parts.js +10 -13
  45. package/dist/src/inventory.js +2 -21
  46. package/dist/src/json-document.js +198 -67
  47. package/dist/src/keyof-comparisons.js +4 -6
  48. package/dist/src/kinds.js +0 -7
  49. package/dist/src/manifest.js +5 -43
  50. package/dist/src/mdx-entries.js +3 -26
  51. package/dist/src/partial.js +2 -1
  52. package/dist/src/paths.js +26 -15
  53. package/dist/src/position.js +2 -1
  54. package/dist/src/print.js +11 -79
  55. package/dist/src/product.js +13 -0
  56. package/dist/src/references.js +14 -27
  57. package/dist/src/report-schema.js +3 -225
  58. package/dist/src/report.js +22 -31
  59. package/dist/src/reporters/sarif.js +4 -2
  60. package/dist/src/reporters/template.js +4 -19
  61. package/dist/src/resolve.js +245 -724
  62. package/dist/src/roots.js +7 -17
  63. package/dist/src/run.js +55 -61
  64. package/dist/src/schema.js +320 -343
  65. package/dist/src/scope.js +34 -103
  66. package/dist/src/serialization-contract.js +5 -9
  67. package/dist/src/session.js +2 -1
  68. package/dist/src/suppress-file.js +21 -25
  69. package/dist/src/suppress.js +3 -3
  70. package/dist/src/symbol-keys.js +3 -5
  71. package/dist/src/template-field.js +9 -19
  72. package/dist/src/test-globals.js +6 -28
  73. package/dist/src/test-joins.js +6 -6
  74. package/dist/src/text/compare.js +26 -0
  75. package/dist/src/text/glob.js +194 -0
  76. package/dist/src/text/shell.js +159 -0
  77. package/dist/src/{yaml-document.js → text/yaml.js} +38 -0
  78. package/dist/src/type-errors.js +14 -38
  79. package/dist/src/unseen-loads.js +2 -9
  80. package/dist/src/unwrap.js +23 -0
  81. package/dist/src/usage.js +10 -0
  82. package/dist/src/verbs/analyze.js +25 -26
  83. package/dist/src/verbs/describe.js +4 -4
  84. package/dist/src/verbs/explain.js +8 -6
  85. package/dist/src/verbs/print-projects.js +4 -3
  86. package/dist/src/verbs/print-retained.js +2 -1
  87. package/dist/src/verbs/print-roots.js +2 -1
  88. package/dist/src/verbs/version.js +2 -1
  89. package/dist/src/workflow-steps.js +9 -46
  90. package/dist/src/workspace-manifests.js +2 -2
  91. package/dist/src/workspace-programs.js +5 -3
  92. package/dist/src/workspace-resolution.js +13 -17
  93. package/dist/src/workspace.js +28 -116
  94. package/jsr.json +1 -1
  95. package/package.json +1 -1
  96. package/src/analysis.ts +55 -76
  97. package/src/automatic-types.ts +11 -29
  98. package/src/build-scripts.ts +17 -38
  99. package/src/component-layer.ts +4 -2
  100. package/src/components.ts +2 -4
  101. package/src/config.ts +31 -296
  102. package/src/configuration-files.ts +27 -170
  103. package/src/configured-declarations.ts +18 -23
  104. package/src/consumers.ts +4 -4
  105. package/src/contract/config.generated.ts +798 -0
  106. package/src/contract/contract.generated.ts +25 -0
  107. package/src/contract/report.generated.ts +3 -2
  108. package/src/conventions.ts +26 -74
  109. package/src/dependencies.ts +32 -50
  110. package/src/discover.ts +15 -40
  111. package/src/edges.ts +41 -140
  112. package/src/element-access.ts +4 -7
  113. package/src/entry-point-gaps.ts +3 -9
  114. package/src/entry-points.ts +2 -13
  115. package/src/enum-group.ts +2 -11
  116. package/src/erased-stores.ts +3 -7
  117. package/src/exempt-classes.ts +0 -5
  118. package/src/exempt.ts +8 -30
  119. package/src/file-facts.ts +6 -24
  120. package/src/findings/completion.ts +5 -6
  121. package/src/findings/emitter.ts +2 -2
  122. package/src/findings/emitters.ts +1 -1
  123. package/src/findings/intra-function.ts +1 -1
  124. package/src/findings/non-code-artifacts.ts +4 -4
  125. package/src/findings/reads-and-writes.ts +2 -1
  126. package/src/findings/self-check.ts +3 -2
  127. package/src/findings/unused-declarations.ts +1 -1
  128. package/src/findings/visibility-narrowing.ts +2 -2
  129. package/src/findings-pass.ts +9 -15
  130. package/src/framework-lifecycle.ts +7 -7
  131. package/src/fs/document.ts +74 -0
  132. package/src/fs/manifest.ts +52 -0
  133. package/src/fs/tree.ts +110 -0
  134. package/src/git-ignore.ts +38 -25
  135. package/src/host.ts +12 -5
  136. package/src/html-entries.ts +6 -33
  137. package/src/in-operands.ts +2 -1
  138. package/src/injection-container.ts +1 -1
  139. package/src/intra-function-parts.ts +10 -14
  140. package/src/inventory.ts +2 -20
  141. package/src/json-document.ts +241 -76
  142. package/src/keyof-comparisons.ts +3 -7
  143. package/src/kinds.ts +0 -8
  144. package/src/manifest.ts +5 -46
  145. package/src/mdx-entries.ts +3 -26
  146. package/src/partial.ts +2 -1
  147. package/src/paths.ts +27 -15
  148. package/src/position.ts +2 -1
  149. package/src/print.ts +12 -92
  150. package/src/product.ts +18 -0
  151. package/src/references.ts +14 -29
  152. package/src/report-schema.ts +3 -301
  153. package/src/report.ts +24 -34
  154. package/src/reporters/sarif.ts +4 -4
  155. package/src/reporters/template.ts +4 -20
  156. package/src/resolve.ts +283 -1114
  157. package/src/roots.ts +7 -20
  158. package/src/run.ts +57 -75
  159. package/src/schema.ts +391 -388
  160. package/src/scope.ts +40 -126
  161. package/src/serialization-contract.ts +5 -10
  162. package/src/session.ts +2 -1
  163. package/src/suppress-file.ts +21 -29
  164. package/src/suppress.ts +3 -3
  165. package/src/symbol-keys.ts +2 -5
  166. package/src/template-field.ts +15 -25
  167. package/src/test-globals.ts +9 -27
  168. package/src/test-joins.ts +6 -8
  169. package/src/text/compare.ts +27 -0
  170. package/src/text/glob.ts +210 -0
  171. package/src/text/shell.ts +161 -0
  172. package/src/{yaml-document.ts → text/yaml.ts} +46 -0
  173. package/src/type-errors.ts +25 -36
  174. package/src/unseen-loads.ts +1 -12
  175. package/src/unwrap.ts +34 -0
  176. package/src/usage.ts +10 -0
  177. package/src/verbs/analyze.ts +32 -42
  178. package/src/verbs/describe.ts +4 -4
  179. package/src/verbs/explain.ts +8 -10
  180. package/src/verbs/print-projects.ts +4 -3
  181. package/src/verbs/print-retained.ts +2 -1
  182. package/src/verbs/print-roots.ts +2 -1
  183. package/src/verbs/verb.ts +2 -2
  184. package/src/verbs/version.ts +2 -1
  185. package/src/workflow-steps.ts +9 -44
  186. package/src/workspace-manifests.ts +2 -2
  187. package/src/workspace-programs.ts +5 -3
  188. package/src/workspace-resolution.ts +21 -17
  189. package/src/workspace.ts +35 -121
  190. package/dist/src/glob.js +0 -65
  191. package/dist/src/pnpm-workspace.js +0 -120
  192. package/src/glob.ts +0 -67
  193. package/src/pnpm-workspace.ts +0 -135
@@ -0,0 +1,798 @@
1
+ // Code generated by scripts/gen-config.ts from the Contract copy under fixtures/ (npm run gen). DO NOT EDIT.
2
+
3
+ import type { Language } from "./contract.generated.ts";
4
+
5
+ /** One key of the closed key list, as this analyzer reads it. */
6
+ export interface SettingRow {
7
+ readonly key: string;
8
+ readonly role: "section" | "setting" | "keyed" | "ignored";
9
+ readonly read: boolean;
10
+ readonly required?: true;
11
+ readonly default?: unknown;
12
+ readonly option?: string;
13
+ readonly value?: Readonly<Record<string, unknown>>;
14
+ readonly keyPattern?: string;
15
+ readonly values?: readonly string[];
16
+ readonly perLanguage?: readonly Language[];
17
+ }
18
+
19
+ export const SETTINGS: readonly SettingRow[] = [
20
+ {
21
+ key: "contract_version",
22
+ role: "setting",
23
+ read: true,
24
+ default: "8.0.0",
25
+ value: { type: "string", pattern: "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
26
+ },
27
+ { key: "target", role: "section", read: true },
28
+ {
29
+ key: "target.kind",
30
+ role: "setting",
31
+ read: true,
32
+ required: true,
33
+ value: {
34
+ oneOf: [
35
+ { type: "string", enum: ["application", "library"] },
36
+ {
37
+ type: "object",
38
+ additionalProperties: false,
39
+ required: ["ts"],
40
+ properties: { ts: { type: "string", enum: ["application", "library"] } },
41
+ },
42
+ ],
43
+ },
44
+ perLanguage: ["go", "ts"],
45
+ },
46
+ { key: "analysis", role: "section", read: true },
47
+ { key: "analysis.languages", role: "setting", read: false },
48
+ {
49
+ key: "analysis.min_confidence",
50
+ role: "setting",
51
+ read: true,
52
+ default: "probable",
53
+ option: "min-confidence",
54
+ value: { type: "string", enum: ["certain", "probable", "possible"] },
55
+ },
56
+ {
57
+ key: "analysis.generated_files",
58
+ role: "setting",
59
+ read: true,
60
+ default: "exclude",
61
+ value: { type: "string", enum: ["exclude", "include"] },
62
+ },
63
+ {
64
+ key: "analysis.consumer_tests",
65
+ role: "setting",
66
+ read: true,
67
+ default: "test",
68
+ value: { type: "string", enum: ["test", "production"] },
69
+ },
70
+ {
71
+ key: "analysis.configurations",
72
+ role: "setting",
73
+ read: true,
74
+ default: [],
75
+ value: {
76
+ type: "array",
77
+ items: {
78
+ oneOf: [
79
+ {
80
+ type: "object",
81
+ additionalProperties: false,
82
+ required: ["id", "os", "arch"],
83
+ properties: {
84
+ id: { type: "string", minLength: 1 },
85
+ os: { type: "string", minLength: 1 },
86
+ arch: { type: "string", minLength: 1 },
87
+ tags: { type: "array", uniqueItems: true, items: { type: "string", minLength: 1 } },
88
+ },
89
+ },
90
+ {
91
+ type: "object",
92
+ additionalProperties: false,
93
+ required: ["id", "project"],
94
+ properties: {
95
+ id: { type: "string", minLength: 1 },
96
+ project: {
97
+ type: "string",
98
+ minLength: 1,
99
+ pattern:
100
+ "^(?:[^/.\\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]+))*$",
101
+ },
102
+ },
103
+ },
104
+ ],
105
+ },
106
+ },
107
+ },
108
+ { key: "analysis.matrix", role: "section", read: true },
109
+ {
110
+ key: "analysis.matrix.complete",
111
+ role: "setting",
112
+ read: true,
113
+ default: false,
114
+ value: { type: "boolean" },
115
+ },
116
+ {
117
+ key: "analysis.template_dirs",
118
+ role: "setting",
119
+ read: true,
120
+ default: [],
121
+ value: { type: "array", uniqueItems: true, items: { type: "string", minLength: 1 } },
122
+ },
123
+ {
124
+ key: "analysis.template_delimiters",
125
+ role: "setting",
126
+ read: true,
127
+ default: { left: "{{", right: "}}" },
128
+ value: {
129
+ type: "object",
130
+ additionalProperties: false,
131
+ required: ["left", "right"],
132
+ properties: {
133
+ left: { type: "string", minLength: 1 },
134
+ right: { type: "string", minLength: 1 },
135
+ },
136
+ },
137
+ },
138
+ { key: "consumers", role: "section", read: true },
139
+ {
140
+ key: "consumers.complete",
141
+ role: "setting",
142
+ read: true,
143
+ default: false,
144
+ value: { type: "boolean" },
145
+ },
146
+ { key: "roots", role: "section", read: true },
147
+ {
148
+ key: "roots.patterns",
149
+ role: "setting",
150
+ read: true,
151
+ default: [],
152
+ value: { type: "array", uniqueItems: true, items: { type: "string", minLength: 1 } },
153
+ },
154
+ {
155
+ key: "severity",
156
+ role: "keyed",
157
+ read: true,
158
+ default: {},
159
+ value: { type: "string", enum: ["allow", "warn", "deny"] },
160
+ keyPattern: "^DS[0-9]{2}([0-9]{2})?$",
161
+ values: [
162
+ "DS10",
163
+ "DS1001",
164
+ "DS1002",
165
+ "DS1003",
166
+ "DS1004",
167
+ "DS1005",
168
+ "DS1006",
169
+ "DS11",
170
+ "DS1101",
171
+ "DS1102",
172
+ "DS1103",
173
+ "DS1104",
174
+ "DS12",
175
+ "DS1201",
176
+ "DS1202",
177
+ "DS1203",
178
+ "DS13",
179
+ "DS1301",
180
+ "DS14",
181
+ "DS1401",
182
+ "DS1402",
183
+ "DS1403",
184
+ "DS1404",
185
+ "DS1405",
186
+ "DS1406",
187
+ "DS15",
188
+ "DS1501",
189
+ "DS1502",
190
+ "DS1503",
191
+ "DS16",
192
+ "DS1601",
193
+ "DS1602",
194
+ "DS17",
195
+ "DS1701",
196
+ "DS1702",
197
+ "DS9001",
198
+ "DS9002",
199
+ "DS9005",
200
+ ],
201
+ },
202
+ { key: "exemptions", role: "section", read: true },
203
+ {
204
+ key: "exemptions.disabled",
205
+ role: "setting",
206
+ read: true,
207
+ default: [],
208
+ value: {
209
+ type: "array",
210
+ uniqueItems: true,
211
+ items: {
212
+ type: "string",
213
+ enum: [
214
+ "interface-satisfaction",
215
+ "encoding-reflection",
216
+ "format-verb-contract",
217
+ "errors-duck-typing",
218
+ "enum-group",
219
+ "generated-file",
220
+ "linkname-cgo-asm-plugin",
221
+ "template-field",
222
+ "reflective-lookup",
223
+ "decorator",
224
+ "injection-container",
225
+ "framework-lifecycle",
226
+ "serialization-contract",
227
+ ],
228
+ },
229
+ },
230
+ },
231
+ { key: "reporters", role: "section", read: true },
232
+ {
233
+ key: "reporters.formats",
234
+ role: "setting",
235
+ read: true,
236
+ default: ["text"],
237
+ value: {
238
+ type: "array",
239
+ uniqueItems: true,
240
+ minItems: 1,
241
+ items: { type: "string", enum: ["text", "json", "github", "sarif", "template"] },
242
+ },
243
+ },
244
+ {
245
+ key: "reporters.sort",
246
+ role: "setting",
247
+ read: true,
248
+ default: "position",
249
+ option: "sort",
250
+ value: { type: "string", enum: ["position", "size"] },
251
+ },
252
+ {
253
+ key: "reporters.cascade",
254
+ role: "setting",
255
+ read: true,
256
+ default: "roots",
257
+ option: "cascade",
258
+ value: { type: "string", enum: ["roots", "full"] },
259
+ },
260
+ {
261
+ key: "reporters.max_findings",
262
+ role: "setting",
263
+ read: true,
264
+ default: 0,
265
+ option: "max-findings",
266
+ value: { type: "integer", minimum: 0, maximum: 9007199254740991 },
267
+ },
268
+ {
269
+ key: "reporters.fail_on",
270
+ role: "setting",
271
+ read: true,
272
+ default: "deny",
273
+ option: "fail-on",
274
+ value: { type: "string", enum: ["allow", "warn", "deny"] },
275
+ },
276
+ { key: "providers", role: "section", read: false },
277
+ { key: "providers.analyzers", role: "setting", read: false },
278
+ { key: "go", role: "section", read: false },
279
+ { key: "ts", role: "section", read: true },
280
+ {
281
+ key: "ts.test_files",
282
+ role: "setting",
283
+ read: true,
284
+ default: [
285
+ "**/*.test.{ts,tsx,mts,cts}",
286
+ "**/*.test-d.{ts,tsx,mts,cts}",
287
+ "**/*.spec-d.{ts,tsx,mts,cts}",
288
+ "**/*.spec.*",
289
+ "**/__tests__/**",
290
+ "**/__mocks__/**",
291
+ "**/test-d/**",
292
+ ],
293
+ value: {
294
+ type: "array",
295
+ uniqueItems: true,
296
+ minItems: 1,
297
+ items: { type: "string", minLength: 1 },
298
+ },
299
+ },
300
+ {
301
+ key: "ts.entry_files",
302
+ role: "setting",
303
+ read: true,
304
+ default: [],
305
+ value: { type: "array", uniqueItems: true, items: { type: "string", minLength: 1 } },
306
+ },
307
+ {
308
+ key: "ts.component_extensions",
309
+ role: "setting",
310
+ read: true,
311
+ default: [".vue", ".svelte", ".astro"],
312
+ value: {
313
+ type: "array",
314
+ uniqueItems: true,
315
+ items: { type: "string", pattern: "^\\.[A-Za-z0-9]+$" },
316
+ },
317
+ },
318
+ {
319
+ key: "ts.disabled_conventions",
320
+ role: "setting",
321
+ read: true,
322
+ default: [],
323
+ value: {
324
+ type: "array",
325
+ uniqueItems: true,
326
+ items: { type: "string", pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$" },
327
+ },
328
+ },
329
+ {
330
+ key: "ts.injection_registrations",
331
+ role: "setting",
332
+ read: true,
333
+ default: [],
334
+ value: {
335
+ type: "array",
336
+ items: {
337
+ oneOf: [
338
+ {
339
+ type: "object",
340
+ additionalProperties: false,
341
+ required: ["symbol"],
342
+ properties: { symbol: { type: "string", pattern: "^ts://" } },
343
+ },
344
+ {
345
+ type: "object",
346
+ additionalProperties: false,
347
+ required: ["module", "name"],
348
+ properties: {
349
+ module: { type: "string", pattern: "^[^./#]" },
350
+ name: { type: "string", minLength: 1 },
351
+ },
352
+ },
353
+ {
354
+ type: "object",
355
+ additionalProperties: false,
356
+ required: ["global"],
357
+ properties: { global: { type: "string", minLength: 1 } },
358
+ },
359
+ ],
360
+ },
361
+ },
362
+ },
363
+ {
364
+ key: "ts.lifecycle_contracts",
365
+ role: "setting",
366
+ read: true,
367
+ default: [],
368
+ value: {
369
+ type: "array",
370
+ items: {
371
+ type: "object",
372
+ additionalProperties: false,
373
+ required: ["members"],
374
+ anyOf: [
375
+ { required: ["components"], properties: { components: { minItems: 1 } } },
376
+ { required: ["bases"], properties: { bases: { minItems: 1 } } },
377
+ ],
378
+ properties: {
379
+ components: {
380
+ type: "array",
381
+ items: {
382
+ oneOf: [
383
+ {
384
+ type: "object",
385
+ additionalProperties: false,
386
+ required: ["symbol"],
387
+ properties: { symbol: { type: "string", pattern: "^ts://" } },
388
+ },
389
+ {
390
+ type: "object",
391
+ additionalProperties: false,
392
+ required: ["module", "name"],
393
+ properties: {
394
+ module: { type: "string", pattern: "^[^./#]" },
395
+ name: { type: "string", minLength: 1 },
396
+ },
397
+ },
398
+ {
399
+ type: "object",
400
+ additionalProperties: false,
401
+ required: ["global"],
402
+ properties: { global: { type: "string", minLength: 1 } },
403
+ },
404
+ ],
405
+ },
406
+ },
407
+ bases: {
408
+ type: "array",
409
+ items: {
410
+ oneOf: [
411
+ {
412
+ type: "object",
413
+ additionalProperties: false,
414
+ required: ["symbol"],
415
+ properties: { symbol: { type: "string", pattern: "^ts://" } },
416
+ },
417
+ {
418
+ type: "object",
419
+ additionalProperties: false,
420
+ required: ["module", "name"],
421
+ properties: {
422
+ module: { type: "string", pattern: "^[^./#]" },
423
+ name: { type: "string", minLength: 1 },
424
+ },
425
+ },
426
+ {
427
+ type: "object",
428
+ additionalProperties: false,
429
+ required: ["global"],
430
+ properties: { global: { type: "string", minLength: 1 } },
431
+ },
432
+ ],
433
+ },
434
+ },
435
+ members: {
436
+ type: "array",
437
+ uniqueItems: true,
438
+ minItems: 1,
439
+ items: { type: "string", minLength: 1 },
440
+ },
441
+ },
442
+ },
443
+ },
444
+ },
445
+ {
446
+ key: "ts.serializers",
447
+ role: "setting",
448
+ read: true,
449
+ default: [],
450
+ value: {
451
+ type: "array",
452
+ items: {
453
+ oneOf: [
454
+ {
455
+ type: "object",
456
+ additionalProperties: false,
457
+ required: ["symbol"],
458
+ properties: { symbol: { type: "string", pattern: "^ts://" } },
459
+ },
460
+ {
461
+ type: "object",
462
+ additionalProperties: false,
463
+ required: ["module", "name"],
464
+ properties: {
465
+ module: { type: "string", pattern: "^[^./#]" },
466
+ name: { type: "string", minLength: 1 },
467
+ },
468
+ },
469
+ {
470
+ type: "object",
471
+ additionalProperties: false,
472
+ required: ["global"],
473
+ properties: { global: { type: "string", minLength: 1 } },
474
+ },
475
+ ],
476
+ },
477
+ },
478
+ },
479
+ {
480
+ key: "ts.roots_complete",
481
+ role: "setting",
482
+ read: true,
483
+ default: false,
484
+ value: { type: "boolean" },
485
+ },
486
+ {
487
+ key: "provenance",
488
+ role: "ignored",
489
+ read: true,
490
+ value: { type: "string", pattern: "^(default|(repository|central|flag): [^\\r\\n]+)$" },
491
+ keyPattern: "^[a-z][a-z_]*(\\.[A-Za-z0-9_]+)*$",
492
+ },
493
+ ];
494
+
495
+ /** The bound on a configuration document, in bytes. */
496
+ export const CONFIG_MAX_BYTES = 1048576;
497
+
498
+ /** The scope document's schema, as the validator reads it. */
499
+ export const SCOPE_SCHEMA = {
500
+ type: "object",
501
+ additionalProperties: false,
502
+ required: ["target"],
503
+ properties: {
504
+ target: {
505
+ type: "object",
506
+ additionalProperties: false,
507
+ required: ["path"],
508
+ properties: {
509
+ id: { type: "string", minLength: 1 },
510
+ role: { type: "string", enum: ["target"] },
511
+ path: { type: "string", minLength: 1 },
512
+ },
513
+ },
514
+ workspace: { type: "string", minLength: 1 },
515
+ consumers: {
516
+ type: "array",
517
+ items: {
518
+ type: "object",
519
+ additionalProperties: false,
520
+ required: ["path"],
521
+ properties: {
522
+ id: { type: "string", minLength: 1 },
523
+ role: { type: "string", enum: ["consumer"] },
524
+ path: { type: "string", minLength: 1 },
525
+ },
526
+ },
527
+ },
528
+ },
529
+ };
530
+
531
+ /** The edges document's schema, as the validator reads it. */
532
+ export const EDGES_SCHEMA = {
533
+ type: "object",
534
+ additionalProperties: false,
535
+ required: ["edges"],
536
+ properties: {
537
+ description: { type: "string" },
538
+ edges: {
539
+ type: "object",
540
+ propertyNames: { $ref: "#/$defs/edge_identifier" },
541
+ additionalProperties: {
542
+ type: "object",
543
+ additionalProperties: false,
544
+ required: ["provides", "used_by"],
545
+ properties: {
546
+ because: { type: "string" },
547
+ provides: { $ref: "#/$defs/reference" },
548
+ used_by: { $ref: "#/$defs/reference" },
549
+ },
550
+ },
551
+ },
552
+ },
553
+ $defs: {
554
+ reference: {
555
+ type: "string",
556
+ allOf: [
557
+ { pattern: "^[a-z][a-z0-9]*://[^ \\t\\r\\n#]+#[^ \\t\\r\\n]*$" },
558
+ {
559
+ pattern:
560
+ "^(?:[^'\\[*]|'(?:[^'\\\\]|\\\\[^\\r\\n])*'|\\[[^\\]]*\\])*(?:'(?:[^'\\\\]|\\\\[^\\r\\n])*\\\\?|\\[[^\\]]*)?$",
561
+ },
562
+ ],
563
+ },
564
+ edge_identifier: { type: "string", pattern: "^[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$" },
565
+ },
566
+ };
567
+
568
+ /** The object at settings#/target.kind/oneOf/1. */
569
+ export interface TargetKind2 {
570
+ readonly ts: "application" | "library";
571
+ }
572
+
573
+ /** The object at settings#/analysis.configurations/items/oneOf/0. */
574
+ export interface AnalysisConfigurationsEntry1 {
575
+ readonly id: string;
576
+ readonly os: string;
577
+ readonly arch: string;
578
+ readonly tags?: readonly string[];
579
+ }
580
+
581
+ /** The object at settings#/analysis.configurations/items/oneOf/1. */
582
+ export interface AnalysisConfigurationsEntry2 {
583
+ readonly id: string;
584
+ readonly project: string;
585
+ }
586
+
587
+ /** The object at settings#/analysis.template_delimiters. */
588
+ export interface AnalysisTemplateDelimiters {
589
+ readonly left: string;
590
+ readonly right: string;
591
+ }
592
+
593
+ /** The object at settings#/ts.injection_registrations/items/oneOf/0. */
594
+ export interface TsInjectionRegistrationsEntry1 {
595
+ readonly symbol: string;
596
+ }
597
+
598
+ /** The object at settings#/ts.injection_registrations/items/oneOf/1. */
599
+ export interface TsInjectionRegistrationsEntry2 {
600
+ readonly module: string;
601
+ readonly name: string;
602
+ }
603
+
604
+ /** The object at settings#/ts.injection_registrations/items/oneOf/2. */
605
+ export interface TsInjectionRegistrationsEntry3 {
606
+ readonly global: string;
607
+ }
608
+
609
+ /** The object at settings#/ts.lifecycle_contracts/items/properties/components/items/oneOf/0. */
610
+ export interface ComponentsEntry1 {
611
+ readonly symbol: string;
612
+ }
613
+
614
+ /** The object at settings#/ts.lifecycle_contracts/items/properties/components/items/oneOf/1. */
615
+ export interface ComponentsEntry2 {
616
+ readonly module: string;
617
+ readonly name: string;
618
+ }
619
+
620
+ /** The object at settings#/ts.lifecycle_contracts/items/properties/components/items/oneOf/2. */
621
+ export interface ComponentsEntry3 {
622
+ readonly global: string;
623
+ }
624
+
625
+ /** The object at settings#/ts.lifecycle_contracts/items/properties/bases/items/oneOf/0. */
626
+ export interface BasesEntry1 {
627
+ readonly symbol: string;
628
+ }
629
+
630
+ /** The object at settings#/ts.lifecycle_contracts/items/properties/bases/items/oneOf/1. */
631
+ export interface BasesEntry2 {
632
+ readonly module: string;
633
+ readonly name: string;
634
+ }
635
+
636
+ /** The object at settings#/ts.lifecycle_contracts/items/properties/bases/items/oneOf/2. */
637
+ export interface BasesEntry3 {
638
+ readonly global: string;
639
+ }
640
+
641
+ /** The object at settings#/ts.lifecycle_contracts/items. */
642
+ export interface TsLifecycleContractsEntry {
643
+ readonly components?: readonly (ComponentsEntry1 | ComponentsEntry2 | ComponentsEntry3)[];
644
+ readonly bases?: readonly (BasesEntry1 | BasesEntry2 | BasesEntry3)[];
645
+ readonly members: readonly string[];
646
+ }
647
+
648
+ /** The object at settings#/ts.serializers/items/oneOf/0. */
649
+ export interface TsSerializersEntry1 {
650
+ readonly symbol: string;
651
+ }
652
+
653
+ /** The object at settings#/ts.serializers/items/oneOf/1. */
654
+ export interface TsSerializersEntry2 {
655
+ readonly module: string;
656
+ readonly name: string;
657
+ }
658
+
659
+ /** The object at settings#/ts.serializers/items/oneOf/2. */
660
+ export interface TsSerializersEntry3 {
661
+ readonly global: string;
662
+ }
663
+
664
+ /** The resolved configuration: every key this analyzer reads, a required one included. */
665
+ export interface ResolvedConfig {
666
+ readonly contract_version: string;
667
+ readonly target: {
668
+ readonly kind: "application" | "library" | TargetKind2;
669
+ };
670
+ readonly analysis: {
671
+ readonly min_confidence: "certain" | "probable" | "possible";
672
+ readonly generated_files: "exclude" | "include";
673
+ readonly consumer_tests: "test" | "production";
674
+ readonly configurations: readonly (
675
+ AnalysisConfigurationsEntry1 | AnalysisConfigurationsEntry2
676
+ )[];
677
+ readonly matrix: {
678
+ readonly complete: boolean;
679
+ };
680
+ readonly template_dirs: readonly string[];
681
+ readonly template_delimiters: AnalysisTemplateDelimiters;
682
+ };
683
+ readonly consumers: {
684
+ readonly complete: boolean;
685
+ };
686
+ readonly roots: {
687
+ readonly patterns: readonly string[];
688
+ };
689
+ readonly severity: Readonly<Record<string, "allow" | "warn" | "deny">>;
690
+ readonly exemptions: {
691
+ readonly disabled: readonly (
692
+ | "interface-satisfaction"
693
+ | "encoding-reflection"
694
+ | "format-verb-contract"
695
+ | "errors-duck-typing"
696
+ | "enum-group"
697
+ | "generated-file"
698
+ | "linkname-cgo-asm-plugin"
699
+ | "template-field"
700
+ | "reflective-lookup"
701
+ | "decorator"
702
+ | "injection-container"
703
+ | "framework-lifecycle"
704
+ | "serialization-contract"
705
+ )[];
706
+ };
707
+ readonly reporters: {
708
+ readonly formats: readonly ("text" | "json" | "github" | "sarif" | "template")[];
709
+ readonly sort: "position" | "size";
710
+ readonly cascade: "roots" | "full";
711
+ readonly max_findings: number;
712
+ readonly fail_on: "allow" | "warn" | "deny";
713
+ };
714
+ readonly ts: {
715
+ readonly test_files: readonly string[];
716
+ readonly entry_files: readonly string[];
717
+ readonly component_extensions: readonly string[];
718
+ readonly disabled_conventions: readonly string[];
719
+ readonly injection_registrations: readonly (
720
+ | TsInjectionRegistrationsEntry1
721
+ | TsInjectionRegistrationsEntry2
722
+ | TsInjectionRegistrationsEntry3
723
+ )[];
724
+ readonly lifecycle_contracts: readonly TsLifecycleContractsEntry[];
725
+ readonly serializers: readonly (
726
+ TsSerializersEntry1 | TsSerializersEntry2 | TsSerializersEntry3
727
+ )[];
728
+ readonly roots_complete: boolean;
729
+ };
730
+ }
731
+
732
+ /** A configuration resolved with no setting required of its sources, for a question that asks none. */
733
+ export interface PartialConfig {
734
+ readonly contract_version: string;
735
+ readonly target: {
736
+ readonly kind?: "application" | "library" | TargetKind2;
737
+ };
738
+ readonly analysis: {
739
+ readonly min_confidence: "certain" | "probable" | "possible";
740
+ readonly generated_files: "exclude" | "include";
741
+ readonly consumer_tests: "test" | "production";
742
+ readonly configurations: readonly (
743
+ AnalysisConfigurationsEntry1 | AnalysisConfigurationsEntry2
744
+ )[];
745
+ readonly matrix: {
746
+ readonly complete: boolean;
747
+ };
748
+ readonly template_dirs: readonly string[];
749
+ readonly template_delimiters: AnalysisTemplateDelimiters;
750
+ };
751
+ readonly consumers: {
752
+ readonly complete: boolean;
753
+ };
754
+ readonly roots: {
755
+ readonly patterns: readonly string[];
756
+ };
757
+ readonly severity: Readonly<Record<string, "allow" | "warn" | "deny">>;
758
+ readonly exemptions: {
759
+ readonly disabled: readonly (
760
+ | "interface-satisfaction"
761
+ | "encoding-reflection"
762
+ | "format-verb-contract"
763
+ | "errors-duck-typing"
764
+ | "enum-group"
765
+ | "generated-file"
766
+ | "linkname-cgo-asm-plugin"
767
+ | "template-field"
768
+ | "reflective-lookup"
769
+ | "decorator"
770
+ | "injection-container"
771
+ | "framework-lifecycle"
772
+ | "serialization-contract"
773
+ )[];
774
+ };
775
+ readonly reporters: {
776
+ readonly formats: readonly ("text" | "json" | "github" | "sarif" | "template")[];
777
+ readonly sort: "position" | "size";
778
+ readonly cascade: "roots" | "full";
779
+ readonly max_findings: number;
780
+ readonly fail_on: "allow" | "warn" | "deny";
781
+ };
782
+ readonly ts: {
783
+ readonly test_files: readonly string[];
784
+ readonly entry_files: readonly string[];
785
+ readonly component_extensions: readonly string[];
786
+ readonly disabled_conventions: readonly string[];
787
+ readonly injection_registrations: readonly (
788
+ | TsInjectionRegistrationsEntry1
789
+ | TsInjectionRegistrationsEntry2
790
+ | TsInjectionRegistrationsEntry3
791
+ )[];
792
+ readonly lifecycle_contracts: readonly TsLifecycleContractsEntry[];
793
+ readonly serializers: readonly (
794
+ TsSerializersEntry1 | TsSerializersEntry2 | TsSerializersEntry3
795
+ )[];
796
+ readonly roots_complete: boolean;
797
+ };
798
+ }