@cplieger/deadset-ts 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +68 -50
  2. package/dist/bin/component-mapper.js +5 -0
  3. package/dist/bin/mapper-connection.js +101 -0
  4. package/dist/bin/node-host.js +24 -2
  5. package/dist/src/analysis.js +230 -37
  6. package/dist/src/component-files.js +612 -0
  7. package/dist/src/component-layer.js +132 -0
  8. package/dist/src/config.js +9 -2
  9. package/dist/src/configuration-files.js +186 -0
  10. package/dist/src/conformance-record.js +2 -2
  11. package/dist/src/convention-rows.js +383 -0
  12. package/dist/src/conventions.js +456 -0
  13. package/dist/src/dependencies.js +30 -3
  14. package/dist/src/discover.js +11 -4
  15. package/dist/src/emit-map.js +72 -0
  16. package/dist/src/entry-point-gaps.js +81 -35
  17. package/dist/src/entry-points.js +47 -32
  18. package/dist/src/exempt.js +11 -3
  19. package/dist/src/findings/completion.js +19 -29
  20. package/dist/src/findings/emitters.js +22 -1
  21. package/dist/src/findings/unused-declarations.js +7 -2
  22. package/dist/src/graph.js +13 -5
  23. package/dist/src/inventory.js +4 -2
  24. package/dist/src/kinds.js +2 -2
  25. package/dist/src/manifest.js +37 -11
  26. package/dist/src/matrix.js +21 -13
  27. package/dist/src/partial.js +3 -1
  28. package/dist/src/pnpm-workspace.js +120 -0
  29. package/dist/src/position.js +17 -2
  30. package/dist/src/print.js +2 -0
  31. package/dist/src/references.js +209 -30
  32. package/dist/src/report.js +26 -6
  33. package/dist/src/reporters/annotations.js +10 -3
  34. package/dist/src/reporters/template.js +6 -3
  35. package/dist/src/resolve.js +31 -6
  36. package/dist/src/roots.js +37 -8
  37. package/dist/src/run.js +13 -3
  38. package/dist/src/schema.js +4 -2
  39. package/dist/src/session.js +141 -34
  40. package/dist/src/setup-failure.js +23 -0
  41. package/dist/src/source-files.js +4 -61
  42. package/dist/src/sweep.js +4 -2
  43. package/dist/src/template-field.js +38 -6
  44. package/dist/src/test-support.js +59 -0
  45. package/dist/src/type-errors.js +252 -0
  46. package/dist/src/type-query-alias.js +92 -0
  47. package/dist/src/verbs/analyze.js +24 -4
  48. package/dist/src/verbs/explain.js +4 -1
  49. package/dist/src/verbs/print-projects.js +17 -56
  50. package/dist/src/verbs/print-retained.js +7 -2
  51. package/dist/src/verbs/print-roots.js +7 -2
  52. package/dist/src/version-range.js +255 -0
  53. package/dist/src/version.js +1 -1
  54. package/dist/src/workspace-manifests.js +68 -0
  55. package/dist/src/workspace-programs.js +342 -0
  56. package/dist/src/workspace-resolution.js +307 -0
  57. package/dist/src/workspace-run.js +75 -0
  58. package/dist/src/workspace.js +358 -0
  59. package/jsr.json +1 -1
  60. package/package.json +2 -1
  61. package/src/analysis.ts +395 -71
  62. package/src/component-files.ts +718 -0
  63. package/src/component-layer.ts +160 -0
  64. package/src/config.ts +11 -2
  65. package/src/configuration-files.ts +235 -0
  66. package/src/conformance-record.ts +2 -2
  67. package/src/convention-rows.ts +440 -0
  68. package/src/conventions.ts +640 -0
  69. package/src/dependencies.ts +36 -2
  70. package/src/discover.ts +11 -7
  71. package/src/emit-map.ts +93 -0
  72. package/src/entry-point-gaps.ts +92 -38
  73. package/src/entry-points.ts +66 -36
  74. package/src/exempt.ts +21 -3
  75. package/src/findings/completion.ts +24 -33
  76. package/src/findings/emitters.ts +32 -1
  77. package/src/findings/unused-declarations.ts +9 -2
  78. package/src/graph.ts +15 -4
  79. package/src/host.ts +23 -0
  80. package/src/index.ts +1 -1
  81. package/src/inventory.ts +13 -2
  82. package/src/kinds.ts +2 -2
  83. package/src/manifest.ts +47 -14
  84. package/src/matrix.ts +43 -15
  85. package/src/partial.ts +6 -1
  86. package/src/pnpm-workspace.ts +135 -0
  87. package/src/position.ts +23 -2
  88. package/src/print.ts +2 -0
  89. package/src/references.ts +227 -28
  90. package/src/report.ts +56 -6
  91. package/src/reporters/annotations.ts +12 -3
  92. package/src/reporters/template.ts +6 -3
  93. package/src/resolve.ts +59 -6
  94. package/src/roots.ts +60 -9
  95. package/src/run.ts +15 -5
  96. package/src/schema.ts +4 -2
  97. package/src/session.ts +218 -37
  98. package/src/setup-failure.ts +39 -0
  99. package/src/source-files.ts +4 -66
  100. package/src/sweep.ts +9 -2
  101. package/src/template-field.ts +42 -7
  102. package/src/test-support.ts +77 -0
  103. package/src/type-errors.ts +340 -0
  104. package/src/type-query-alias.ts +133 -0
  105. package/src/verbs/analyze.ts +38 -4
  106. package/src/verbs/explain.ts +4 -1
  107. package/src/verbs/print-projects.ts +17 -69
  108. package/src/verbs/print-retained.ts +7 -2
  109. package/src/verbs/print-roots.ts +7 -2
  110. package/src/verbs/verb.ts +6 -3
  111. package/src/version-range.ts +309 -0
  112. package/src/version.ts +1 -1
  113. package/src/workspace-manifests.ts +100 -0
  114. package/src/workspace-programs.ts +486 -0
  115. package/src/workspace-resolution.ts +393 -0
  116. package/src/workspace-run.ts +148 -0
  117. package/src/workspace.ts +463 -0
@@ -0,0 +1,383 @@
1
+ /**
2
+ * The convention rows this analyzer carries: the file-system conventions of one
3
+ * framework or tool each, as data. Nothing outside the table names a framework.
4
+ *
5
+ * A row's globs are matched against the directory of the manifest that declares its
6
+ * enabling package. A glob may hold `<id>` placeholders, each standing for the
7
+ * directory one of the row's moves resolves to.
8
+ */
9
+ const SCRIPT = "{js,jsx,ts,tsx}";
10
+ const MODULE = "{js,mjs,ts,mts}";
11
+ const ANY_MODULE = "{js,mjs,cjs,ts,mts,cts}";
12
+ const VITE_CONFIG = `vite.config.${ANY_MODULE}`;
13
+ const SVELTEKIT_ROUTE_FILES = "+{page,layout,server,page.server,layout.server,error}";
14
+ /** SvelteKit's entries other than its parameter matchers. */
15
+ const SVELTEKIT_ENTRIES = [
16
+ `<routes>/**/${SVELTEKIT_ROUTE_FILES}.{js,ts,svelte}`,
17
+ `<routes>/**/${SVELTEKIT_ROUTE_FILES}@*.{js,ts,svelte}`,
18
+ "<hooksClient>{,/index}.{js,ts}",
19
+ "<hooksServer>{,/index}.{js,ts}",
20
+ "<hooksUniversal>{,/index}.{js,ts}",
21
+ "<serviceWorker>{,/index}.{js,ts}",
22
+ "<src>/instrumentation.server.{js,ts}",
23
+ ];
24
+ const SVELTEKIT_PLUGIN = { module: "@sveltejs/kit/vite", export: "sveltekit" };
25
+ /** The entries React Router's framework mode and Remix share below their app directory. */
26
+ const APP_DIRECTORY_ENTRIES = [
27
+ `<app>/root.${SCRIPT}`,
28
+ `<app>/routes.${MODULE}`,
29
+ `<app>/entry.{client,server}.${SCRIPT}`,
30
+ `<app>/routes/**/*.${SCRIPT}`,
31
+ ];
32
+ const SOLIDSTART_PLUGIN = { module: "@solidjs/start/config", export: "solidStart" };
33
+ const NUXT_CONFIG = [`nuxt.config.${ANY_MODULE}`];
34
+ /** Every row, ordered by name and then by range. */
35
+ export const CONVENTION_ROWS = [
36
+ {
37
+ name: "astro",
38
+ package: "astro",
39
+ range: ">=5.0.0 <8.0.0",
40
+ entries: [
41
+ "<src>/pages/**/*.{astro,js,ts}",
42
+ "<src>/middleware{,/index}.{js,ts}",
43
+ "<src>/actions/index.{js,ts}",
44
+ `<src>/{content,live}.config.${MODULE}`,
45
+ `<src>/content/config.${MODULE}`,
46
+ ],
47
+ excludes: ["<src>/pages/**/_*", "<src>/pages/**/_*/**"],
48
+ moves: [
49
+ {
50
+ id: "src",
51
+ defaults: ["src"],
52
+ readings: [{ property: "srcDir", files: [`astro.config.${ANY_MODULE}`] }],
53
+ },
54
+ ],
55
+ },
56
+ {
57
+ name: "eslint",
58
+ package: "eslint",
59
+ range: ">=10.0.0 <11.0.0",
60
+ entries: [`**/eslint.config.${ANY_MODULE}`],
61
+ moves: [],
62
+ },
63
+ {
64
+ name: "expo-router",
65
+ package: "expo-router",
66
+ range: ">=3.0.0 <58.0.0",
67
+ entries: [`{,src/}app/**/*.${SCRIPT}`],
68
+ moves: [],
69
+ },
70
+ {
71
+ name: "next",
72
+ package: "next",
73
+ range: ">=13.4.0 <17.0.0",
74
+ entries: [
75
+ `{,src/}app/**/{layout,page,loading,not-found,error,route,template,default,forbidden,unauthorized}.${SCRIPT}`,
76
+ `{,src/}app/global-{error,not-found}.${SCRIPT}`,
77
+ `{,src/}app/**/{icon,apple-icon,opengraph-image,twitter-image}.${SCRIPT}`,
78
+ "{,src/}app/**/sitemap.{js,ts}",
79
+ "{,src/}app/{robots,manifest}.{js,ts}",
80
+ "{,src/}app/(*)/{robots,manifest}.{js,ts}",
81
+ `{,src/}pages/**/*.${SCRIPT}`,
82
+ `{,src/}{proxy,middleware,instrumentation,instrumentation-client,mdx-components}.${SCRIPT}`,
83
+ ],
84
+ moves: [],
85
+ },
86
+ {
87
+ name: "nuxt",
88
+ package: "nuxt",
89
+ range: ">=3.0.0 <5.0.0",
90
+ entries: [
91
+ "<srcDir>/{app,error}.{vue,jsx,tsx}",
92
+ `<srcDir>/app.config.${MODULE}`,
93
+ "<srcDir>/router.options.{js,ts}",
94
+ "<pages>/**/*.{vue,js,jsx,ts,tsx}",
95
+ "<layouts>/**/*.{vue,jsx,tsx}",
96
+ "<middleware>/**/*.{js,ts}",
97
+ "<plugins>/**/*.{js,ts}",
98
+ "<modules>/*.{js,ts}",
99
+ "<modules>/*/index.{js,ts}",
100
+ `<serverDir>/{api,routes,middleware,plugins,tasks}/**/*.${MODULE}`,
101
+ `layers/*/nuxt.config.${MODULE}`,
102
+ ],
103
+ moves: [
104
+ {
105
+ id: "srcDir",
106
+ defaults: ["app", "."],
107
+ readings: [{ property: "srcDir", files: NUXT_CONFIG }],
108
+ },
109
+ {
110
+ id: "pages",
111
+ base: "<srcDir>",
112
+ defaults: ["pages"],
113
+ readings: [{ property: "dir.pages", files: NUXT_CONFIG }],
114
+ },
115
+ {
116
+ id: "layouts",
117
+ base: "<srcDir>",
118
+ defaults: ["layouts"],
119
+ readings: [{ property: "dir.layouts", files: NUXT_CONFIG }],
120
+ },
121
+ {
122
+ id: "middleware",
123
+ base: "<srcDir>",
124
+ defaults: ["middleware"],
125
+ readings: [{ property: "dir.middleware", files: NUXT_CONFIG }],
126
+ },
127
+ {
128
+ id: "plugins",
129
+ base: "<srcDir>",
130
+ defaults: ["plugins"],
131
+ readings: [{ property: "dir.plugins", files: NUXT_CONFIG }],
132
+ },
133
+ {
134
+ id: "modules",
135
+ defaults: ["modules"],
136
+ readings: [{ property: "dir.modules", files: NUXT_CONFIG }],
137
+ },
138
+ {
139
+ id: "serverDir",
140
+ defaults: ["server"],
141
+ readings: [{ property: "serverDir", files: NUXT_CONFIG }],
142
+ },
143
+ ],
144
+ },
145
+ {
146
+ name: "qwik-city",
147
+ package: "@builder.io/qwik-city",
148
+ range: ">=1.0.0 <2.0.0",
149
+ entries: [
150
+ "<srcDir>/root.{jsx,tsx}",
151
+ `<srcDir>/entry.*.${SCRIPT}`,
152
+ `<routesDir>/**/*.${SCRIPT}`,
153
+ ],
154
+ moves: [
155
+ {
156
+ id: "srcDir",
157
+ defaults: ["src"],
158
+ readings: [
159
+ {
160
+ property: "srcDir",
161
+ files: [VITE_CONFIG],
162
+ call: { module: "@builder.io/qwik/optimizer", export: "qwikVite" },
163
+ },
164
+ ],
165
+ },
166
+ {
167
+ id: "routesDir",
168
+ defaults: ["<srcDir>/routes"],
169
+ readings: [
170
+ {
171
+ property: "routesDir",
172
+ files: [VITE_CONFIG],
173
+ call: { module: "@builder.io/qwik-city/vite", export: "qwikCity" },
174
+ },
175
+ ],
176
+ },
177
+ ],
178
+ },
179
+ {
180
+ name: "react-router",
181
+ package: "@react-router/dev",
182
+ range: ">=7.0.0 <9.0.0",
183
+ entries: APP_DIRECTORY_ENTRIES,
184
+ moves: [
185
+ {
186
+ id: "app",
187
+ defaults: ["app"],
188
+ readings: [{ property: "appDirectory", files: [`react-router.config.${MODULE}`] }],
189
+ },
190
+ ],
191
+ },
192
+ {
193
+ name: "remix",
194
+ package: "@remix-run/dev",
195
+ range: ">=2.0.0 <3.0.0",
196
+ entries: APP_DIRECTORY_ENTRIES,
197
+ moves: [
198
+ {
199
+ id: "app",
200
+ defaults: ["app"],
201
+ readings: [
202
+ { property: "appDirectory", files: ["remix.config.{js,cjs,mjs}"] },
203
+ {
204
+ property: "appDirectory",
205
+ files: [VITE_CONFIG],
206
+ call: { module: "@remix-run/dev", export: "vitePlugin" },
207
+ },
208
+ {
209
+ property: "appDirectory",
210
+ files: [VITE_CONFIG],
211
+ call: { module: "@remix-run/dev", export: "unstable_vitePlugin" },
212
+ },
213
+ ],
214
+ },
215
+ ],
216
+ },
217
+ {
218
+ name: "solidstart",
219
+ package: "@solidjs/start",
220
+ range: ">=1.0.0 <3.0.0",
221
+ entries: [
222
+ `<appRoot>/app.${SCRIPT}`,
223
+ `<appRoot>/entry-{client,server}.${SCRIPT}`,
224
+ "<appRoot>/middleware{,/index}.{js,ts}",
225
+ `<routeDir>/**/*.${SCRIPT}`,
226
+ ],
227
+ moves: [
228
+ {
229
+ id: "appRoot",
230
+ defaults: ["src"],
231
+ readings: [
232
+ { property: "appRoot", files: [`app.config.${MODULE}`] },
233
+ { property: "appRoot", files: [VITE_CONFIG], call: SOLIDSTART_PLUGIN },
234
+ ],
235
+ },
236
+ {
237
+ id: "routeDir",
238
+ base: "<appRoot>",
239
+ defaults: ["routes"],
240
+ readings: [
241
+ { property: "routeDir", files: [`app.config.${MODULE}`] },
242
+ { property: "routeDir", files: [VITE_CONFIG], call: SOLIDSTART_PLUGIN },
243
+ ],
244
+ },
245
+ ],
246
+ },
247
+ {
248
+ name: "storybook",
249
+ package: "storybook",
250
+ range: ">=7.0.0 <11.0.0",
251
+ entries: [
252
+ `.storybook/{main,preview,manager,test-runner,vitest.setup}.{js,jsx,mjs,cjs,ts,tsx,mts,cts}`,
253
+ "**/*.stories.{js,jsx,mjs,ts,tsx,mts,svelte,vue}",
254
+ ],
255
+ moves: [],
256
+ },
257
+ {
258
+ name: "sveltekit",
259
+ package: "@sveltejs/kit",
260
+ range: ">=2.0.0 <3.0.0",
261
+ entries: [...SVELTEKIT_ENTRIES, "<params>/*.{js,ts}"],
262
+ moves: [
263
+ {
264
+ id: "src",
265
+ defaults: ["src"],
266
+ readings: [
267
+ { property: "kit.files.src", files: ["svelte.config.{js,mjs,ts}"] },
268
+ { property: "files.src", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
269
+ ],
270
+ },
271
+ {
272
+ id: "routes",
273
+ defaults: ["<src>/routes"],
274
+ readings: [
275
+ { property: "kit.files.routes", files: ["svelte.config.{js,mjs,ts}"] },
276
+ { property: "files.routes", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
277
+ ],
278
+ },
279
+ {
280
+ id: "params",
281
+ defaults: ["<src>/params"],
282
+ readings: [
283
+ { property: "kit.files.params", files: ["svelte.config.{js,mjs,ts}"] },
284
+ { property: "files.params", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
285
+ ],
286
+ },
287
+ {
288
+ id: "hooksClient",
289
+ defaults: ["<src>/hooks.client"],
290
+ readings: [
291
+ { property: "kit.files.hooks.client", files: ["svelte.config.{js,mjs,ts}"] },
292
+ { property: "files.hooks.client", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
293
+ ],
294
+ },
295
+ {
296
+ id: "hooksServer",
297
+ defaults: ["<src>/hooks.server"],
298
+ readings: [
299
+ { property: "kit.files.hooks.server", files: ["svelte.config.{js,mjs,ts}"] },
300
+ { property: "files.hooks.server", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
301
+ ],
302
+ },
303
+ {
304
+ id: "hooksUniversal",
305
+ defaults: ["<src>/hooks"],
306
+ readings: [
307
+ { property: "kit.files.hooks.universal", files: ["svelte.config.{js,mjs,ts}"] },
308
+ { property: "files.hooks.universal", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
309
+ ],
310
+ },
311
+ {
312
+ id: "serviceWorker",
313
+ defaults: ["<src>/service-worker"],
314
+ readings: [
315
+ { property: "kit.files.serviceWorker", files: ["svelte.config.{js,mjs,ts}"] },
316
+ { property: "files.serviceWorker", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
317
+ ],
318
+ },
319
+ ],
320
+ },
321
+ {
322
+ name: "sveltekit",
323
+ package: "@sveltejs/kit",
324
+ range: ">=3.0.0 <4.0.0",
325
+ entries: [...SVELTEKIT_ENTRIES, "<params>.{js,ts}"],
326
+ moves: [
327
+ {
328
+ id: "src",
329
+ defaults: ["src"],
330
+ readings: [{ property: "files.src", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN }],
331
+ },
332
+ {
333
+ id: "routes",
334
+ defaults: ["<src>/routes"],
335
+ readings: [{ property: "files.routes", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN }],
336
+ },
337
+ {
338
+ id: "params",
339
+ defaults: ["<src>/params"],
340
+ readings: [{ property: "files.params", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN }],
341
+ },
342
+ {
343
+ id: "hooksClient",
344
+ defaults: ["<src>/hooks.client"],
345
+ readings: [
346
+ { property: "files.hooks.client", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
347
+ ],
348
+ },
349
+ {
350
+ id: "hooksServer",
351
+ defaults: ["<src>/hooks.server"],
352
+ readings: [
353
+ { property: "files.hooks.server", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
354
+ ],
355
+ },
356
+ {
357
+ id: "hooksUniversal",
358
+ defaults: ["<src>/hooks"],
359
+ readings: [
360
+ { property: "files.hooks.universal", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
361
+ ],
362
+ },
363
+ {
364
+ id: "serviceWorker",
365
+ defaults: ["<src>/service-worker"],
366
+ readings: [
367
+ { property: "files.serviceWorker", files: [VITE_CONFIG], call: SVELTEKIT_PLUGIN },
368
+ ],
369
+ },
370
+ ],
371
+ },
372
+ {
373
+ name: "vitest",
374
+ package: "vitest",
375
+ range: ">=3.2.0 <6.0.0",
376
+ entries: [
377
+ `**/{vitest,vite}.config.${ANY_MODULE}`,
378
+ `**/{vitest,vite}.config.*.${ANY_MODULE}`,
379
+ `**/{vitest,vite}.*.config.${ANY_MODULE}`,
380
+ ],
381
+ moves: [],
382
+ },
383
+ ];