From c74479d6d3f5601fce3d42108834e75b00595fed Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 6 Sep 2026 15:05:07 +0000 Subject: [PATCH] chore: prune 6 unused dependencies, 2 dead scripts, and dead Tailwind globs Dependencies with zero imports anywhere in src, e2e, scripts, supabase, or any config file: - @stripe/stripe-js: checkout and portal go through the create-checkout and create-portal Edge Functions and a plain URL redirect (src/lib/stripe.ts). The browser SDK is never loaded. - i18next-browser-languagedetector: src/i18n.ts sets lng and fallbackLng explicitly and SettingsPage calls changeLanguage. No detector is registered. - @types/jspdf and @types/react-joyride: both runtime packages ship their own declarations, so the DefinitelyTyped stubs are redundant. - baseline-browser-mapping and caniuse-lite: incidentally added as direct dependencies, never imported. Both stay installed transitively through autoprefixer/browserslist, which is the only consumer. npm now records them as dev-only, since browserslist is a devDependency; that is safe here because every install path in this repo (Dockerfile, all three workflow jobs, Vercel) runs a plain `npm ci` with devDependencies included. No path uses --omit=dev or --production. @types/file-saver stays: file-saver ships no declarations of its own. Also removes two npm scripts and three dead Tailwind content globs: - test:coverage, superseded by `npm test -- --coverage`. No workflow, script, or docs file invokes it. Two rows in .audit/crossfire.tsv do mention it, but those are historical records of August runs, not callers, and that log is deliberately left untouched. - test:e2e:ui, which nothing references at all. - the ./pages, ./components, and ./app content globs, for directories that do not exist in this repo. The verify script keeps the docs:check step main added in #39. Verified on main fe679fd, from a clean npm ci: docs:check, lint, typecheck, 956 unit tests, 121 edge tests, build, and 126 Chromium e2e tests pass. Coverage 90.45% statements. --- package-lock.json | 41 ++--------------------------------------- package.json | 8 -------- tailwind.config.ts | 2 +- vite.config.ts | 2 ++ 4 files changed, 5 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index 99c1022e5..d4e2128bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,15 +46,10 @@ "@radix-ui/react-toggle-group": "^1.1.10", "@radix-ui/react-tooltip": "^1.2.7", "@sentry/react": "^10.65.0", - "@stripe/stripe-js": "^8.7.0", "@supabase/supabase-js": "^2.49.1", "@tanstack/react-query": "^5.83.0", - "@types/jspdf": "^1.3.3", - "@types/react-joyride": "^2.0.2", "@vercel/analytics": "^2.0.1", "@vercel/speed-insights": "^2.0.0", - "baseline-browser-mapping": "^2.9.19", - "caniuse-lite": "^1.0.30001766", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", @@ -65,7 +60,6 @@ "framer-motion": "^12.31.0", "html-to-image": "^1.11.13", "i18next": "^23.16.8", - "i18next-browser-languagedetector": "^8.0.4", "input-otp": "^1.4.2", "jspdf": "^4.1.0", "jspdf-autotable": "^5.0.7", @@ -3706,15 +3700,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@stripe/stripe-js": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-8.11.0.tgz", - "integrity": "sha512-3fVF4z3efsgwgyj64nFK+6F4/vMw0mUXD2TBbOfftJtKVNx4JNv3CSfe1fY4DCtCk0JFp8/YPNcRkzgV0HJ8cg==", - "license": "MIT", - "engines": { - "node": ">=12.16" - } - }, "node_modules/@supabase/auth-js": { "version": "2.114.0", "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.114.0.tgz", @@ -4553,12 +4538,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/jspdf": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/jspdf/-/jspdf-1.3.3.tgz", - "integrity": "sha512-DqwyAKpVuv+7DniCp2Deq1xGvfdnKSNgl9Agun2w6dFvR5UKamiv4VfYUgcypd8S9ojUyARFIlZqBrYrBMQlew==", - "license": "MIT" - }, "node_modules/@types/mdast": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", @@ -4622,15 +4601,6 @@ "@types/react": "^18.0.0" } }, - "node_modules/@types/react-joyride": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/react-joyride/-/react-joyride-2.0.2.tgz", - "integrity": "sha512-RbixI8KE4K4B4bVzigT765oiQMCbWqlb9vj5qz1pFvkOvynkiAGurGVVf+nGszGGa89WrQhUnAwd0t1tqxeoDw==", - "license": "MIT", - "dependencies": { - "@types/react": "*" - } - }, "node_modules/@types/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -5490,6 +5460,7 @@ "version": "2.11.20", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.20.tgz", "integrity": "sha512-H0ulySigv6icDJ1F7SjtdCD6PrhTpdYCmP0CactWy1+ekh0AFd0o1Wn5T8b+hnTmdBx19u9yhL6wvCylXMY7zw==", + "dev": true, "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.cjs" @@ -5649,6 +5620,7 @@ "version": "1.0.30001810", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz", "integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==", + "dev": true, "funding": [ { "type": "opencollective", @@ -7528,15 +7500,6 @@ "@babel/runtime": "^7.23.2" } }, - "node_modules/i18next-browser-languagedetector": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.2.1.tgz", - "integrity": "sha512-bZg8+4bdmaOiApD7N7BPT9W8MLZG+nPTOFlLiJiT8uzKXFjhxw4v2ierCXOwB5sFDMtuA5G4kgYZ0AznZxQ/cw==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.23.2" - } - }, "node_modules/iceberg-js": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/iceberg-js/-/iceberg-js-0.8.1.tgz", diff --git a/package.json b/package.json index 462c16db0..0cd48a647 100644 --- a/package.json +++ b/package.json @@ -17,14 +17,12 @@ "typecheck": "tsc --noEmit -p tsconfig.app.json", "preview": "vite preview", "test": "vitest run", - "test:coverage": "vitest run --coverage", "test:watch": "vitest", "test:edge": "deno test --allow-read --allow-env=EXA_API_KEY,SUPABASE_URL,SUPABASE_SERVICE_ROLE_KEY,SPARRING_INTEGRITY_SECRET,OPENAI_API_KEY --allow-net=127.0.0.1 supabase/functions/", "test:db": "supabase test db", "test:e2e": "playwright test --project=desktop-chromium --project=mobile-chromium", "test:e2e:webkit": "playwright test --project=webkit", "test:e2e:staging": "playwright test --project=staging", - "test:e2e:ui": "playwright test --ui", "verify": "npm run docs:check && npm run lint && npm run typecheck && npm test -- --coverage && npm run test:edge && npm run build && CI=1 PORT=18080 PLAYWRIGHT_BASE_URL=http://127.0.0.1:18080 npm run test:e2e" }, "dependencies": { @@ -66,15 +64,10 @@ "@radix-ui/react-toggle-group": "^1.1.10", "@radix-ui/react-tooltip": "^1.2.7", "@sentry/react": "^10.65.0", - "@stripe/stripe-js": "^8.7.0", "@supabase/supabase-js": "^2.49.1", "@tanstack/react-query": "^5.83.0", - "@types/jspdf": "^1.3.3", - "@types/react-joyride": "^2.0.2", "@vercel/analytics": "^2.0.1", "@vercel/speed-insights": "^2.0.0", - "baseline-browser-mapping": "^2.9.19", - "caniuse-lite": "^1.0.30001766", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", @@ -85,7 +78,6 @@ "framer-motion": "^12.31.0", "html-to-image": "^1.11.13", "i18next": "^23.16.8", - "i18next-browser-languagedetector": "^8.0.4", "input-otp": "^1.4.2", "jspdf": "^4.1.0", "jspdf-autotable": "^5.0.7", diff --git a/tailwind.config.ts b/tailwind.config.ts index be80c573d..a414493f9 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -4,7 +4,7 @@ import typography from "@tailwindcss/typography"; export default { darkMode: ["class"], - content: ["./pages/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", "./app/**/*.{ts,tsx}", "./src/**/*.{ts,tsx}"], + content: ["./src/**/*.{ts,tsx}"], prefix: "", theme: { container: { diff --git a/vite.config.ts b/vite.config.ts index c4aa9d1a1..89ff64f8b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,6 +14,8 @@ export default defineConfig(({ mode }) => ({ }, plugins: [react()], optimizeDeps: { + // Narrows dev prebundling to the SPA entry. Without this, Vite crawls all + // 84 HTML files under the root, including the prerendered pages in public/. entries: ['index.html'], }, resolve: {