-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathknip.jsonc
More file actions
186 lines (186 loc) · 8.85 KB
/
Copy pathknip.jsonc
File metadata and controls
186 lines (186 loc) · 8.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
{
"$schema": "https://unpkg.com/knip@6/schema-jsonc.json",
// `tests/__snapshots__/tsnapi/**` is `tsnapi`'s generated API-snapshot
// fixture content (see `tests/exports.test.ts` and the root AGENTS.md
// "Development" section) - compared byte-for-byte against a fresh build,
// never imported. Not source to analyze.
"ignore": ["tests/__snapshots__/tsnapi/**"],
// `@iconify-json/*` icon collections and `@unocss/preset-icons` are
// resolved by UnoCSS's `presetIcons()` at build time by package presence
// (scanning `i-ph:*` classes against the installed collection), never
// imported in source - the same false-positive class knip's own docs
// describe for icon-collection dependencies.
"ignoreDependencies": ["@iconify-json/.+", "@unocss/preset-icons"],
"workspaces": {
".": {
// `design/*.ts` is the shared design system (AGENTS.md § "Design
// system") consumed by every plugin/example's own `uno.config.ts` and
// `design.ts` via relative imports (`../../design/uno.config`). Those
// are UnoCSS/plugin config files, not part of the reachability graph
// knip builds for "unused files", so the shared source is otherwise
// reported as unused from the root workspace.
//
// `skills/devframe/templates/*.ts` are the devframe-authoring skill's
// copy-and-run reference snippets (`skills/devframe/SKILL.md`) - each
// one a standalone, runnable example, not imported by anything else.
"entry": ["design/*.ts", "skills/devframe/templates/*.ts", "scripts/smoke-bun.ts"],
// `spa-devframe.ts` imports `valibot` to illustrate schema validation
// for a consumer's own devframe - it's a dependency of the example a
// reader copies out, not of this repo's root tooling.
"ignoreDependencies": ["valibot"]
},
"docs": {
// `devframe` is referenced only inside fenced code samples in the
// guide markdown (e.g. `docs/guide/rpc.md`), which knip doesn't parse
// as source - not a real unused dependency.
"ignoreDependencies": ["devframe"]
},
"examples/hub-next": {
// The React client build's root sits at `src/client` (`next dev
// src/client`), not the workspace root, so knip's default PostCSS
// config glob (workspace-root `postcss.config.*`) misses it.
"postcss": {
"config": ["src/client/postcss.config.mjs"]
},
// `BUILTIN_PLUGIN_PACKAGES` (`src/client/devframe/next-devframe-hub.ts`)
// lists these as string literals and loads them via a runtime
// `import()` carrying `webpackIgnore`/`turbopackIgnore` comments -
// deliberately invisible to bundlers (and knip) so Next never inlines
// their node-only code. They're genuinely used at runtime.
"ignoreDependencies": [
"@devframes/plugin-code-server",
"@devframes/plugin-git",
"@devframes/plugin-inspect",
"@devframes/plugin-messages",
"@devframes/plugin-og",
"@devframes/plugin-terminals"
]
},
"examples/hub-next-minimal": {
// `BUILTIN_PLUGIN_PACKAGES` (`src/client/hub.ts`) lists these as string
// literals loaded through a runtime `import()` carrying
// `webpackIgnore`/`turbopackIgnore` — deliberately invisible to bundlers
// (and knip) so Next never inlines their node-only code. They're
// genuinely used at runtime. (`data-inspector` and `assets` load via
// their own string-literal helpers, so knip sees those directly.)
"ignoreDependencies": [
"@devframes/plugin-a11y",
"@devframes/plugin-code-server",
"@devframes/plugin-git",
"@devframes/plugin-inspect",
"@devframes/plugin-messages",
"@devframes/plugin-og",
"@devframes/plugin-terminals"
]
},
"examples/next-runtime-snapshot": {
// Same nested Next.js client root as `hub-next` above.
"postcss": {
"config": ["src/client/postcss.config.mjs"]
}
},
"packages/devframe": {
// Every `package.json#exports` subpath maps to one of these source
// files (see `tsdown.config.ts`'s `serverEntries`/`clientEntries`).
// Knip's package.json→dist→src source mapping needs `outDir` set on
// the workspace `tsconfig.json`, but this repo's packages resolve
// each other's `src/*.ts` directly across workspaces (via the `paths`
// aliases in `tsconfig.base.json`), and `outDir` breaks `tsc`'s
// `rootDir` inference for every consumer that does - so entries are
// listed explicitly instead. Keep this in sync with the `exports` map.
"entry": [
"src/{index,constants}.ts",
"src/adapters/{build,cac,dev,embedded,initiate}.ts",
"src/adapters/mcp/index.ts",
"src/client/index.ts",
"src/internal/index.ts",
"src/node/index.ts",
"src/node/{auth,hub-internals}/index.ts",
"src/recipes/{common-rpc-functions,interactive-auth}.ts",
"src/rpc/{index,client,server}.ts",
"src/rpc/dump/index.ts",
"src/rpc/transports/{sse-client,sse-server,ws-bun,ws-client,ws-server}.ts",
"src/types/index.ts",
"src/utils/*.ts"
]
},
"packages/hub": {
"entry": ["src/{index,constants}.ts", "src/{client,node,types}/index.ts", "src/node/{index,initiate}.ts"]
},
"packages/hub-ui": {
// `playground/client-scripts/*.ts` are dock `action` entries the
// playground's `seed.ts` points at by their runtime URL string
// (`action.importFrom`), not a static import knip's graph can see —
// the same shape as a devframe's `clientScript`/`clientScripts` entry.
"entry": ["playground/client-scripts/*.ts"]
},
"packages/json-render": {
// `src/node/index.ts` is already picked up via `tsdown.config.ts`
// (its literal `entry` object parses cleanly); only `core.ts`/`hub.ts`
// need to be declared explicitly.
"entry": ["src/{index,core,hub}.ts"]
},
"packages/nuxt": {
// `@nuxt/kit`'s own `defineNuxtModule` return type resolves through
// `@nuxt/schema`; tsdown's dts bundler inlines that as a lazy
// `import("@nuxt/schema")` type reference in the built
// `dist/module.d.mts` (visible only once this workspace has been
// built locally) - a transitive type-only leak from a dependency's
// own dependency, not a real gap in this package's own manifest.
"ignoreDependencies": ["@nuxt/schema"]
},
"packages/json-render-ui": {
// `src/components/index.ts` is already picked up via
// `tsdown.config.ts`; only `spa.ts`/`hub.ts` (node-safe entries) and
// the prebuilt renderer module (built by its own Vite config, consumed
// at runtime via the hub's renderer manifest) need declaring.
"entry": ["src/{index,spa,hub}.ts", "src/renderer-module/index.ts"],
// The standalone SPA's own Vite config (`src/spa/vite.config.ts`)
// mounts `unocss/vite` with no explicit config path, so UnoCSS
// discovers this nested `uno.config.ts` by directory proximity to
// `root` - not an import knip's graph can see. Keep the package-root
// config the Storybook build uses alongside it.
"unocss": {
"config": ["uno.config.ts", "src/spa/uno.config.ts"]
}
},
// Every built-in plugin ships the same entry shape (see each
// `tsdown.config.ts`'s `serverEntries`/`clientEntries`): a root
// `index.ts`, an optional `cli.ts`/`vite.ts`/`constants.ts`/`types.ts`,
// and `client|node|rpc|inject|engine|registry/index.ts` subdirectories.
// One shared pattern covers them all - see `packages/devframe` above for
// why this is explicit instead of relying on source mapping.
"plugins/*": {
"entry": [
"src/{index,cli,vite,constants,types}.ts",
"src/{client,node,rpc,inject,engine,registry}/index.ts"
]
},
"plugins/a11y": {
// `storybook-solidjs-vite` (not an official `@storybook/*` framework
// package) doesn't match knip's Storybook plugin trigger, so it never
// auto-enables here. Mirror the plugin's own defaults by hand.
"storybook": {
"config": [".storybook/main.ts"],
"entry": [".storybook/preview.tsx"],
"project": [".storybook/**/*.{js,jsx,ts,tsx,mts}"]
},
// A workspace-specific `entry` replaces (rather than merges with) the
// `plugins/*` glob's `entry` above, so repeat that pattern here
// alongside the stories.
"entry": [
"src/{index,cli,vite,constants,types}.ts",
"src/{client,node,rpc,inject,engine,registry}/index.ts",
"src/**/*.stories.tsx"
]
},
"plugins/git": {
// The React client build's root sits at `src/client` (`next dev
// src/client`), not the workspace root, so knip's default PostCSS
// config glob (workspace-root `postcss.config.*`) misses it.
"postcss": {
"config": ["src/client/postcss.config.mjs"]
}
}
}
}