mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Makes knip a CI gate for Studio so dead files and unused dependencies fail the PR instead of piling up. Third PR in the stack, on top of #49719 (dead code) and #49720 (unused deps), which get Studio to a clean run. **Changed:** - knip `pnpx knip@~5.50.0` → root devDependency `knip@6.32.3`, `pnpm knip` now runs it. The old `pnpx` form was actually broken: it resolved knip's `typescript` peer to TS 7 and crashed with `ts.getDefaultLibFilePath is not a function`. (6.33.0 is newer but blocked by `minimumReleaseAge`.) - `knip.jsonc` rewritten for v6 with a `workspaces["apps/studio"]` block. Framework-convention files (`router.tsx`, `start.ts`, `routes/**`, `compat/**`, `api/server.js`) are `entry` rather than `ignore` — an ignored file's imports aren't traced, which is how `ShellFallback.tsx` (only imported from `routes/__root.tsx`) was being reported as dead. knip 6's Next.js plugin already covers `instrumentation*.ts`, `proxy.ts`, `pages/**`; its tanstack-router plugin only looks under `src/`, hence the manual entries. Narrow `ignoreIssues` for graphql-codegen output and the `CONSTRAINT_TYPE` enum; `ignoreDependencies` for the five implicit deps from #49720, each with a comment; `ignoreBinaries: ["vercel"]`. - `apps/studio/CLAUDE.md`: one bullet on the gate and where framework files go. **Added:** - `.github/workflows/studio-knip.yml` — path-filtered to `apps/studio/**` + knip/pnpm config, mirrors `studio-lint-ratchet.yml`'s setup (no sparse checkout: knip needs every workspace's `package.json` to resolve the graph). Runs `pnpm knip --workspace apps/studio --reporter symbols --reporter github-actions` so findings show up as inline PR annotations. ~5s locally. Scope notes: the gate is Studio-only — the full-monorepo run still has ~400 dead files in `www`/`docs`/`blocks`, which is a separate effort. `exclude: ["types", "exports"]` is kept, so unused exports aren't gated yet, but `enumMembers`/`duplicates` are (they caught real things in #49719). ## To test - `pnpm knip --workspace apps/studio` exits 0 on this branch - The `Studio Dead Code (knip)` workflow runs on this PR and is green - Sanity-check the gate bites: add a throwaway `apps/studio/lib/unused.ts`, run `pnpm knip --workspace apps/studio` → reports it and exits 1 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **CI** * Added automated dead-code and unused-dependency checks for the Studio workspace on relevant pushes and pull requests. * Results appear in workflow summaries and as inline pull request annotations. * **Maintenance** * Improved analysis of framework-convention files and Studio code. * Standardized the local code-quality check and updated its configuration support. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
84 lines
4.6 KiB
JSON
84 lines
4.6 KiB
JSON
{
|
|
"name": "supabase",
|
|
"description": "The Postgres Development Platform.",
|
|
"version": "0.0.0",
|
|
"author": "Supabase, Inc.",
|
|
"license": "Apache-2.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"preinstall": "npx only-allow pnpm",
|
|
"build": "turbo run build",
|
|
"build:studio": "turbo run build --filter=studio",
|
|
"build:studio:docker": "docker build . -f apps/studio/Dockerfile --target production -t supabase-studio:local --build-arg NEXT_PUBLIC_STUDIO_AUTH_MODE=supabase --no-cache",
|
|
"build:studio:docker:tanstack": "docker build . -f apps/studio/Dockerfile --target production -t supabase-studio:local-tanstack --build-arg NEXT_PUBLIC_STUDIO_AUTH_MODE=supabase --build-arg STUDIO_FRAMEWORK=tanstack --no-cache",
|
|
"build:design-system": "turbo run build --filter=design-system",
|
|
"build:docs": "turbo run build --filter=docs",
|
|
"clean": "turbo run clean --parallel && rimraf -G .turbo/cache && pnpm purge",
|
|
"dev": "turbo run dev --parallel",
|
|
"dev:studio": "turbo run dev --filter=studio --parallel",
|
|
"dev:studio-local": "pnpm setup:cli && NODE_ENV=test MODE=test pnpm --prefix ./apps/studio dev",
|
|
"dev:docs": "turbo run dev --filter=docs --parallel",
|
|
"dev:www": "turbo run dev --filter=www --parallel",
|
|
"dev:design-system": "turbo run dev --filter=design-system --parallel",
|
|
"lint": "turbo run lint",
|
|
"typecheck": "turbo --continue typecheck",
|
|
"test:case-hazards": "node scripts/check-case-hazards.mjs",
|
|
"test:prettier": "SORT_IMPORTS=false prettier --config prettier.config.mjs --cache --check '{apps,packages,blocks,examples,i18n}/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'",
|
|
"format": "SORT_IMPORTS=false prettier --config prettier.config.mjs --cache --write '{apps,packages,blocks,examples,i18n}/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'",
|
|
"test:docs": "turbo run test --filter=docs",
|
|
"test:ui": "turbo run test --filter=ui",
|
|
"test:ui-patterns": "turbo run test --filter=ui-patterns",
|
|
"test:studio": "turbo run test --filter=studio",
|
|
"test:studio:watch": "turbo run test --filter=studio -- watch",
|
|
"e2e:setup:cli": "supabase stop --all --no-backup --workdir ./e2e/studio; supabase start --exclude studio,mailpit --workdir ./e2e/studio && supabase status --output json --workdir ./e2e/studio > keys.json && node scripts/generateLocalEnv.js",
|
|
"e2e:setup:selfhosted": "SKIP_ASSET_UPLOAD=1 pnpm e2e:setup:cli && NODE_ENV=test MODE=test NODE_OPTIONS=\"--max-old-space-size=4096\" pnpm run build:studio && NODE_ENV=test MODE=test pnpm --prefix ./apps/studio start",
|
|
"e2e:setup:selfhosted:start-studio": "SKIP_ASSET_UPLOAD=1 NODE_ENV=test MODE=test pnpm --prefix ./apps/studio start",
|
|
"e2e:setup:platform": "SKIP_ASSET_UPLOAD=1 NODE_OPTIONS=\"--max-old-space-size=4096\" pnpm run build:studio && pnpm --prefix ./apps/studio start",
|
|
"e2e": "pnpm --prefix e2e/studio run e2e",
|
|
"e2e:ui": "pnpm --prefix e2e/studio run e2e:ui",
|
|
"e2e:docs": "pnpm --prefix e2e/docs run e2e:docs",
|
|
"e2e:docs:all": "pnpm --prefix e2e/docs run e2e:docs:all",
|
|
"e2e:docs:a11y": "pnpm --prefix e2e/docs run e2e:docs:a11y",
|
|
"e2e:docs:ui": "pnpm --prefix e2e/docs run e2e:ui",
|
|
"e2e:docs:local-smoke": "pnpm --prefix e2e/docs run e2e:docs:local-smoke",
|
|
"e2e:www": "pnpm --prefix e2e/www run e2e:www",
|
|
"e2e:www:all": "pnpm --prefix e2e/www run e2e:www:all",
|
|
"perf:kong": "ab -t 5 -c 20 -T application/json http://localhost:8000/",
|
|
"perf:meta": "ab -t 5 -c 20 -T application/json http://localhost:5555/tables",
|
|
"setup:cli": "supabase start -x studio && supabase status --output json > keys.json && node scripts/generateLocalEnv.js",
|
|
"generate:types": "supabase gen types typescript --local > ./supabase/functions/common/database-types.ts",
|
|
"api:codegen": "cd packages/api-types && pnpm run codegen",
|
|
"knip": "knip",
|
|
"authorize-vercel-deploys": "tsx scripts/authorizeVercelDeploys.ts"
|
|
},
|
|
"devDependencies": {
|
|
"@aws-sdk/client-secrets-manager": "^3.1041.0",
|
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
"@types/node": "catalog:",
|
|
"eslint": "^9.0.0",
|
|
"jsdom": "^28.1.0",
|
|
"knip": "6.32.3",
|
|
"prettier": "^3.8.0",
|
|
"prettier-plugin-sql-cst": "^0.18.0",
|
|
"rimraf": "^6.0.0",
|
|
"supabase": "^2.114.0",
|
|
"supports-color": "^8.0.0",
|
|
"tailwindcss": "catalog:",
|
|
"tsx": "catalog:",
|
|
"turbo": "2.9.14",
|
|
"@typescript/native": "catalog:",
|
|
"typescript": "catalog:",
|
|
"zod": "catalog:"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/supabase/supabase.git"
|
|
},
|
|
"engines": {
|
|
"pnpm": "11.13",
|
|
"node": ">=22.13"
|
|
},
|
|
"keywords": ["postgres", "firebase", "storage", "functions", "database", "auth"],
|
|
"packageManager": "pnpm@11.13.1"
|
|
}
|