@cplieger/deadset-ts 2.2.1 → 3.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.
- package/README.md +9 -16
- package/dist/src/analysis.js +142 -0
- package/dist/src/components.js +289 -0
- package/dist/src/config.js +6 -0
- package/dist/src/discover.js +98 -24
- package/dist/src/entry-point-gaps.js +278 -0
- package/dist/src/entry-points.js +385 -0
- package/dist/src/finding.js +12 -0
- package/dist/src/glob.js +65 -0
- package/dist/src/graph.js +116 -0
- package/dist/src/index.js +1 -2
- package/dist/src/manifest.js +120 -0
- package/dist/src/print.js +3 -6
- package/dist/src/references.js +156 -106
- package/dist/src/resolve.js +82 -20
- package/dist/src/roots.js +345 -0
- package/dist/src/run.js +59 -10
- package/dist/src/schema.js +1 -1
- package/dist/src/session.js +6 -1
- package/dist/src/source-files.js +122 -0
- package/dist/src/sweep.js +156 -0
- package/dist/src/version.js +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/analysis.ts +236 -0
- package/src/components.ts +372 -0
- package/src/config.ts +30 -2
- package/src/discover.ts +144 -29
- package/src/entry-point-gaps.ts +304 -0
- package/src/entry-points.ts +496 -0
- package/src/finding.ts +43 -0
- package/src/glob.ts +67 -0
- package/src/graph.ts +178 -0
- package/src/index.ts +1 -20
- package/src/manifest.ts +174 -0
- package/src/print.ts +5 -6
- package/src/references.ts +201 -111
- package/src/resolve.ts +117 -24
- package/src/roots.ts +467 -0
- package/src/run.ts +66 -11
- package/src/schema.ts +5 -2
- package/src/session.ts +6 -1
- package/src/source-files.ts +157 -0
- package/src/sweep.ts +230 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every entry-point convention this analyzer declines, each with the tool it belongs
|
|
3
|
+
* to and why. A file only a declined convention enters is reported as never
|
|
4
|
+
* imported, so a project that relies on one names the file in `ts.entry_files` or
|
|
5
|
+
* `roots.patterns`, and this list is what tells it to.
|
|
6
|
+
*
|
|
7
|
+
* Every row carries a reason, because the list is read where the rows are shown
|
|
8
|
+
* one at a time: beside a finding, or in a report's declared gaps.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** One declined entry-point convention. */
|
|
12
|
+
export interface DeclinedConvention {
|
|
13
|
+
/** The tool the convention belongs to, by the name of the package or service. */
|
|
14
|
+
readonly tool: string;
|
|
15
|
+
/** What is declined: one convention of a tool whose others are entered, or all of them. */
|
|
16
|
+
readonly convention: string;
|
|
17
|
+
readonly reason: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** What is declined for a tool none of whose conventions is entered. */
|
|
21
|
+
const EVERY_CONVENTION = "its configuration and every file it loads by its own convention";
|
|
22
|
+
|
|
23
|
+
/** Why a tool none of whose conventions is entered declines them. */
|
|
24
|
+
const UNREAD =
|
|
25
|
+
"No rule reads it, so a file only it loads is reported as never imported unless " +
|
|
26
|
+
"ts.entry_files or roots.patterns names it.";
|
|
27
|
+
|
|
28
|
+
/** The tools none of whose conventions is entered. */
|
|
29
|
+
const UNREAD_TOOLS: readonly string[] = [
|
|
30
|
+
"angular",
|
|
31
|
+
"astro",
|
|
32
|
+
"astro-db",
|
|
33
|
+
"astro-markdoc",
|
|
34
|
+
"astro-og-canvas",
|
|
35
|
+
"ava",
|
|
36
|
+
"babel",
|
|
37
|
+
"biome",
|
|
38
|
+
"borp",
|
|
39
|
+
"bumpp",
|
|
40
|
+
"bun",
|
|
41
|
+
"c8",
|
|
42
|
+
"capacitor",
|
|
43
|
+
"catalyst",
|
|
44
|
+
"changelogen",
|
|
45
|
+
"changelogithub",
|
|
46
|
+
"changesets",
|
|
47
|
+
"commitizen",
|
|
48
|
+
"commitlint",
|
|
49
|
+
"convex",
|
|
50
|
+
"create-typescript-app",
|
|
51
|
+
"cspell",
|
|
52
|
+
"cucumber",
|
|
53
|
+
"cypress",
|
|
54
|
+
"danger",
|
|
55
|
+
"dependency-cruiser",
|
|
56
|
+
"docusaurus",
|
|
57
|
+
"dotenv",
|
|
58
|
+
"drizzle",
|
|
59
|
+
"electron-vite",
|
|
60
|
+
"eleventy",
|
|
61
|
+
"esbuild",
|
|
62
|
+
"eve",
|
|
63
|
+
"execa",
|
|
64
|
+
"expo",
|
|
65
|
+
"expressive-code",
|
|
66
|
+
"fast",
|
|
67
|
+
"fumadocs",
|
|
68
|
+
"gatsby",
|
|
69
|
+
"github-action",
|
|
70
|
+
"github-actions",
|
|
71
|
+
"glob",
|
|
72
|
+
"graphql-codegen",
|
|
73
|
+
"hardhat",
|
|
74
|
+
"husky",
|
|
75
|
+
"i18next-parser",
|
|
76
|
+
"jest",
|
|
77
|
+
"karma",
|
|
78
|
+
"knex",
|
|
79
|
+
"ladle",
|
|
80
|
+
"laravel-vite-plugin",
|
|
81
|
+
"lefthook",
|
|
82
|
+
"lint-staged",
|
|
83
|
+
"linthtml",
|
|
84
|
+
"lit",
|
|
85
|
+
"lockfile-lint",
|
|
86
|
+
"lost-pixel",
|
|
87
|
+
"lunaria",
|
|
88
|
+
"markdownlint",
|
|
89
|
+
"marko",
|
|
90
|
+
"mdx",
|
|
91
|
+
"mdxlint",
|
|
92
|
+
"metro",
|
|
93
|
+
"mise",
|
|
94
|
+
"mocha",
|
|
95
|
+
"moonrepo",
|
|
96
|
+
"msw",
|
|
97
|
+
"nano-spawn",
|
|
98
|
+
"nano-staged",
|
|
99
|
+
"nest",
|
|
100
|
+
"netlify",
|
|
101
|
+
"next",
|
|
102
|
+
"next-intl",
|
|
103
|
+
"next-mdx",
|
|
104
|
+
"nitro",
|
|
105
|
+
"node",
|
|
106
|
+
"node-modules-inspector",
|
|
107
|
+
"nodemon",
|
|
108
|
+
"npm-package-json-lint",
|
|
109
|
+
"nuxt",
|
|
110
|
+
"nuxtjs-i18n",
|
|
111
|
+
"nx",
|
|
112
|
+
"nyc",
|
|
113
|
+
"oclif",
|
|
114
|
+
"openapi-ts",
|
|
115
|
+
"openclaw",
|
|
116
|
+
"orval",
|
|
117
|
+
"oxfmt",
|
|
118
|
+
"oxlint",
|
|
119
|
+
"panda-css",
|
|
120
|
+
"parcel",
|
|
121
|
+
"payload",
|
|
122
|
+
"pino",
|
|
123
|
+
"playwright-ct",
|
|
124
|
+
"playwright-test",
|
|
125
|
+
"plop",
|
|
126
|
+
"pm2",
|
|
127
|
+
"pnpm",
|
|
128
|
+
"postcss",
|
|
129
|
+
"pre-commit",
|
|
130
|
+
"preconstruct",
|
|
131
|
+
"prettier",
|
|
132
|
+
"prisma",
|
|
133
|
+
"quasar",
|
|
134
|
+
"qwik",
|
|
135
|
+
"railway",
|
|
136
|
+
"raycast",
|
|
137
|
+
"react-cosmos",
|
|
138
|
+
"react-email",
|
|
139
|
+
"react-native",
|
|
140
|
+
"react-router",
|
|
141
|
+
"relay",
|
|
142
|
+
"release-it",
|
|
143
|
+
"remark",
|
|
144
|
+
"remix",
|
|
145
|
+
"rolldown",
|
|
146
|
+
"rollup",
|
|
147
|
+
"rsbuild",
|
|
148
|
+
"rslib",
|
|
149
|
+
"rspack",
|
|
150
|
+
"rstest",
|
|
151
|
+
"sanity",
|
|
152
|
+
"semantic-release",
|
|
153
|
+
"sentry",
|
|
154
|
+
"serverless-framework",
|
|
155
|
+
"simple-git-hooks",
|
|
156
|
+
"size-limit",
|
|
157
|
+
"sst",
|
|
158
|
+
"starlight",
|
|
159
|
+
"stencil",
|
|
160
|
+
"storybook",
|
|
161
|
+
"stylelint",
|
|
162
|
+
"svelte",
|
|
163
|
+
"sveltejs-package",
|
|
164
|
+
"sveltekit",
|
|
165
|
+
"svgo",
|
|
166
|
+
"svgr",
|
|
167
|
+
"swc",
|
|
168
|
+
"syncpack",
|
|
169
|
+
"tailwind",
|
|
170
|
+
"tanstack-router",
|
|
171
|
+
"taskfile",
|
|
172
|
+
"tauri",
|
|
173
|
+
"temporal",
|
|
174
|
+
"textlint",
|
|
175
|
+
"travis",
|
|
176
|
+
"ts-node",
|
|
177
|
+
"tsd",
|
|
178
|
+
"tsdown",
|
|
179
|
+
"tsup",
|
|
180
|
+
"tsx",
|
|
181
|
+
"turbo",
|
|
182
|
+
"typedoc",
|
|
183
|
+
"typescript",
|
|
184
|
+
"typescript-content-mapper",
|
|
185
|
+
"unbuild",
|
|
186
|
+
"unocss",
|
|
187
|
+
"unplugin-auto-import",
|
|
188
|
+
"unplugin-icons",
|
|
189
|
+
"unplugin-vue-components",
|
|
190
|
+
"unplugin-vue-i18n",
|
|
191
|
+
"unplugin-vue-markdown",
|
|
192
|
+
"unplugin-vue-router",
|
|
193
|
+
"varlock",
|
|
194
|
+
"vercel",
|
|
195
|
+
"vercel-og",
|
|
196
|
+
"vike",
|
|
197
|
+
"vite-plugin-pages",
|
|
198
|
+
"vite-plugin-pwa",
|
|
199
|
+
"vite-plugin-vue-layouts-next",
|
|
200
|
+
"vite-plus",
|
|
201
|
+
"vite-pwa-assets-generator",
|
|
202
|
+
"vitepress",
|
|
203
|
+
"vue",
|
|
204
|
+
"webdriver-io",
|
|
205
|
+
"wireit",
|
|
206
|
+
"wrangler",
|
|
207
|
+
"wxt",
|
|
208
|
+
"xo",
|
|
209
|
+
"yarn",
|
|
210
|
+
"yorkie",
|
|
211
|
+
"zx",
|
|
212
|
+
];
|
|
213
|
+
|
|
214
|
+
/** The conventions declined for a tool some of whose conventions are entered. */
|
|
215
|
+
const PARTLY_ENTERED: readonly DeclinedConvention[] = [
|
|
216
|
+
{
|
|
217
|
+
tool: "eslint",
|
|
218
|
+
convention: "the legacy .eslintrc configuration files",
|
|
219
|
+
reason:
|
|
220
|
+
"Only the flat configuration's file names are entered, so a legacy configuration " +
|
|
221
|
+
"file the program holds is reported as never imported.",
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
tool: "playwright",
|
|
225
|
+
convention: "a testMatch written as a regular expression",
|
|
226
|
+
reason:
|
|
227
|
+
"A testMatch that is not a string literal leaves the test-file set unknown, and an " +
|
|
228
|
+
"unknown set enters nothing.",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
tool: "playwright",
|
|
232
|
+
convention: "the globalSetup and globalTeardown files",
|
|
233
|
+
reason:
|
|
234
|
+
"No rule enters them, so a setup file only the runner loads is reported as never imported.",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
tool: "playwright",
|
|
238
|
+
convention: "the testDir and testMatch of an entry in projects",
|
|
239
|
+
reason:
|
|
240
|
+
"Only the configuration object's own testDir and testMatch are read, so a test " +
|
|
241
|
+
"directory a project entry moves is not entered.",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
tool: "stryker",
|
|
245
|
+
convention: "a configuration file named on the command line",
|
|
246
|
+
reason: "Only the file names the tool looks for by default are entered.",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
tool: "vite",
|
|
250
|
+
convention: "its configuration and every entry point it names",
|
|
251
|
+
reason:
|
|
252
|
+
"Only a worker a call addresses by a literal is entered; no rule reads the " +
|
|
253
|
+
"configuration, so a file only it names is reported as never imported.",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
tool: "vitest",
|
|
257
|
+
convention: "the benchmark and type-test files",
|
|
258
|
+
reason:
|
|
259
|
+
"A test file is one ts.test_files classifies, so a *.bench.* or *.test-d.* file is " +
|
|
260
|
+
"entered only where a configured pattern names it.",
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
tool: "vitest",
|
|
264
|
+
convention: "the mock files below a __mocks__ directory",
|
|
265
|
+
reason:
|
|
266
|
+
"No rule enters a file by its directory, so a mock only the runner's module mocking " +
|
|
267
|
+
"loads is reported as never imported.",
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
tool: "vitest",
|
|
271
|
+
convention: "the setup files of a configuration that moves its root",
|
|
272
|
+
reason:
|
|
273
|
+
"A configuration writing root reads its setup files against a directory its text " +
|
|
274
|
+
"may not state, so none of them is entered.",
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
tool: "vitest",
|
|
278
|
+
convention: "the test files a configuration's include member names",
|
|
279
|
+
reason:
|
|
280
|
+
"A test file is one ts.test_files classifies rather than one the runner's include " +
|
|
281
|
+
"reads, so the two are kept equal by configuration.",
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
tool: "webpack",
|
|
285
|
+
convention: "its configuration and every entry point it names",
|
|
286
|
+
reason:
|
|
287
|
+
"Only a worker a call addresses by a literal is entered; no rule reads the " +
|
|
288
|
+
"configuration, so a file only it names is reported as never imported.",
|
|
289
|
+
},
|
|
290
|
+
];
|
|
291
|
+
|
|
292
|
+
/** Two strings ordered bytewise. */
|
|
293
|
+
function compare(a: string, b: string): number {
|
|
294
|
+
if (a === b) {
|
|
295
|
+
return 0;
|
|
296
|
+
}
|
|
297
|
+
return a < b ? -1 : 1;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/** Every declined entry-point convention, ordered by tool and then by convention. */
|
|
301
|
+
export const DECLINED_CONVENTIONS: readonly DeclinedConvention[] = [
|
|
302
|
+
...UNREAD_TOOLS.map((tool) => ({ tool, convention: EVERY_CONVENTION, reason: UNREAD })),
|
|
303
|
+
...PARTLY_ENTERED,
|
|
304
|
+
].sort((a, b) => compare(a.tool, b.tool) || compare(a.convention, b.convention));
|