Skip to content
Source
Sign inSign up
Open History to see the last commit

knip.jsonc

177 lines7.4 KB

1{
2 "$schema": "https://unpkg.com/knip@6/schema.json",
3 // Exported types are part of our contracts even before they have consumers.
4 "rules": { "types": "off", "nsTypes": "off" },
5 // These executables are supplied by the OS or installed separately from npm.
6 "ignoreBinaries": ["eas", "file", "mkfifo", "pkill", "pkg-config", "plutil", "sips"],
7 "workspaces": {
8 ".": {
9 // Keep vendored reference repositories outside the root project.
10 "project": ["*.{js,mjs,cjs,ts,mts,cts}", ".github/**/*.cjs"],
11 "entry": [
12 // CodeRabbit loads its configuration by filename.
13 ".coderabbit.config.ts",
14 ".github/scripts/thread-transfer-report.cjs",
15 ".github/scripts/pr-limits.cjs",
16 ],
17 "vite": { "entry": [".github/**/*.test.cjs"] },
18 "vitest": { "entry": [".github/**/*.test.cjs"] },
19 },
20 "scripts": {
21 // Knip loads its preprocessor through a CLI option; native verification and
22 // worktree setup (from t3.json) run directly. release-desktop.yml bundles the
23 // Windows verify script with esbuild through a path knip does not trace,
24 // electron-builder loads the macOS signer and the Linux afterPack hook by path, and mobile-e2e.ts runs
25 // agent-device's CLI by path, and mobile-behavior.ts spawns its runner by path.
26 // release-desktop.yml runs the desktop launch check through xvfb-run, which knip
27 // does not trace.
28 "entry": [
29 // These fixture scripts are injected into a browser page by path.
30 "fixtures/*/*.js",
31 "knip-schemas.ts",
32 "linux-after-pack.ts",
33 "mobile-behavior/run.ts",
34 "mobile-native-client.ts",
35 // e2e loads its config and the scenarios by path, and starts the app script.
36 "e2e.config.ts",
37 "prove-scenario.ts",
38 "scenarios/*.ts",
39 "setup-worktree.ts",
40 "sign-macos.ts",
41 "prepare-server-compile-cache.cjs",
42 "smoke-desktop-app.ts",
43 "verify-windows-desktop-artifact.ts",
44 ],
45 "ignoreDependencies": ["esbuild"],
46 // The `t3` npm package's files: copied into the package, never imported.
47 // knip-schemas.test.ts writes a throwaway project to .knip-test-*, which a
48 // knip run beside it in check:changed must not report.
49 "ignore": ["npm-launcher/**", ".knip-test-*/**"],
50 },
51 "apps/server": {
52 // Vite+ pack entries and the launcher used by installed background services.
53 "entry": [
54 "src/bin.ts!",
55 "src/claude-history-worker.ts!",
56 "scripts/cli.ts",
57 "scripts/fetch-expo-schema.ts",
58 "scripts/probe-claude-fork-local-rollback-replay.ts",
59 "scripts/update-test-shard-weights.ts",
60 "scripts/verify-background-live.ts",
61 "src/provider/testFixtures/*.mjs",
62 // graphqlgen reads its config.
63 "graphql.config.ts",
64 ],
65 // The generated operations export every selection's class.
66 "ignoreIssues": { "**/*.graphql.ts": ["exports", "types", "namespaceMembers"] },
67 // Keep the transitive Effect runtime pinned for standalone npm installs.
68 // The Vite+ web build prerequisite.
69 // Native and disk-loaded provider packages stay external to the bundle; the
70 // CLI archive and desktop sidecar stage them from this manifest.
71 "ignoreDependencies": [
72 "@effect/platform-node-shared",
73 "@t3tools/web",
74 "@napi-rs/keyring",
75 "ffi-rs",
76 "transcribe-cpp",
77 ],
78 },
79 "apps/desktop": {
80 // Electron loads these bundles by filename rather than importing them.
81 "entry": [
82 "gnome-extension/extension.js!",
83 "src/electron/WindowsForegroundFocusWorker.ts!",
84 "src/snapShot/GlobalShiftShortcutWorker.ts!",
85 "src/snapShot/RegionSnapShotWorker.ts!",
86 "src/snapShot/SnapShotAccessibilityWorker.ts!",
87 "src/boot.ts!",
88 "src/compileCache.ts!",
89 "src/serverCompileCache.ts!",
90 "src/main.ts!",
91 "src/preload.ts!",
92 "src/preview-pick-preload.ts!",
93 "src/preview-pip-preload.ts!",
94 "src/mac-permission-preload.ts!",
95 "src/preview/Annotation.css!",
96 ],
97 // The injected runtime resolves Playwright by string; release tooling runs
98 // electron-builder from this workspace, outside its package scripts.
99 "ignoreDependencies": ["playwright-core", "electron-builder"],
100 },
101 "apps/web": {
102 // Worktree setup (scripts/setup-worktree.ts) runs this directly, and evidence
103 // fixtures run under node.
104 "entry": ["scripts/warm-dep-cache.ts", "test/fixtures/**/*.mjs"],
105 // UI component modules are copied and adapted as cohesive sets. Keep their
106 // named subcomponents even before they have callers; the file audit still
107 // reports an entire component module when nothing imports it.
108 "ignoreIssues": { "src/components/ui/*.tsx": ["exports", "nsExports", "duplicates"] },
109 },
110 "apps/marketing": {
111 // `astro check` runs from the typecheck task in vite.config.ts, which knip does not read.
112 "ignoreDependencies": ["@astrojs/check"],
113 },
114 "apps/mobile": {
115 // Expo loads plugins and the fingerprint config by string; Metro embeds the browser entry in the native WebView.
116 "entry": [
117 "index.ts!",
118 "fingerprint.config.js",
119 "plugins/*.cjs",
120 "scripts/generate-device-stream.mts",
121 "src/features/devices/device-stream.browser.ts!",
122 "src/features/browser/preview-stream.browser.ts!",
123 ],
124 // Fonts are configured as asset paths; Expo autolinks the native packages.
125 "ignoreDependencies": [
126 "@expo-google-fonts/dm-sans",
127 "@t3tools/mobile-review-diff-native",
128 "@t3tools/mobile-terminal-native",
129 ],
130 },
131 "apps/mobile/modules/t3-highlights": {
132 // Nitrogen discovers HybridObject specifications by filename.
133 "entry": ["src/*.nitro.ts!"],
134 },
135 "apps/mobile/modules/t3-source-text": {
136 // React Native codegen discovers component specifications by filename.
137 "entry": ["src/*NativeComponent.ts!"],
138 },
139 "infra/task-cache": {
140 "ignore": ["vendor/**"],
141 // The bootstrap and Vite+ hook are loaded by shell/package configuration.
142 "entry": [
143 "alchemy.run.ts!",
144 "scripts/install.ts",
145 "scripts/install-ci.ts",
146 "src/runHook.ts",
147 "src/flush.ts",
148 "src/nativeRunHook.js",
149 "src/preload.mjs",
150 ],
151 },
152 "infra/relay": {
153 // Alchemy loads src/worker.ts as the Worker entry and reads its default export.
154 "entry": ["alchemy.run.ts!", "src/persistence/schema.ts!", "src/worker.ts!"],
155 },
156 "packages/*": {
157 // These workspace packages are private to this monorepo.
158 "includeEntryExports": true,
159 },
160 "packages/effect-acp": {
161 "includeEntryExports": true,
162 "entry": ["test/fixtures/*.ts"],
163 // Generated upstream protocol definitions are retained as a complete set.
164 "ignoreIssues": { "src/_generated/**": ["exports", "types"] },
165 },
166 "packages/effect-codex-app-server": {
167 "includeEntryExports": true,
168 "entry": ["test/fixtures/*.ts"],
169 "ignoreIssues": { "src/_generated/**": ["exports", "types"] },
170 },
171 "packages/source-control-github": {
172 // graphqlgen reads its config; the generated operations export every selection's class.
173 "entry": ["graphql.config.ts", "scripts/measure-pr-preview.ts"],
174 "ignoreIssues": { "**/*.graphql.ts": ["exports", "types", "namespaceMembers"] },
175 },
176 },