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

knip.jsonc

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