@cplieger/deadset-ts 7.2.0-dev.4 → 8.0.0-dev.10

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