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

knip.jsonc

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