Files
supabase/apps/studio/turbo.jsonc
Alaister YoungandAlaister Young 0c97b9789b [FE-3107] chore(studio): remove remaining Next.js references (#54426)
Removes the remaining Next.js dependencies, compatibility shims, test
mocks, ESLint/TypeScript presets, and webpack/Next workarounds from
Studio following the TanStack Start migration.

Addresses FE-3107.

**Removed:**

- `next` and `next-router-mock` from `apps/studio/package.json` (and
updated `pnpm-lock.yaml`)
- Orphaned `apps/studio/compat/next/script.tsx` shim, `script.test.tsx`,
`compat/**` knip entry, and `nextCompat()` / `ssr.noExternal` `/^next/`
plumbing from `apps/studio/vite.config.ts`
- `apps/studio/tests/lib/route-mock.ts` and all `next-router-mock`
setup/imports across `tests/vitestSetup.ts`,
`tests/lib/custom-render.tsx`, and 12 test files
- `apps/studio/tests/pages/` directory (moved the 3 remaining tests to
`components/interfaces/Organization/Organization.utils.test.ts` and
`apps/studio/tests/routes/`)
- Unused `'use client'` directives across 23 Studio files
- Next.js/webpack workarounds: `graphiqlViteWorkers()` in
`vite.config.ts`, webpack `import.meta.glob` `try/catch` fallback in
`ConnectStepsSection.tsx`, shell `NODE_ENV=test` override in
`vite.config.ts` / root `package.json` / `studio-e2e-test.yml`, Next
`getPathMatch` and `_next` passthrough in `redirects.shared.*`,
`window.next?.router` check in `monaco-graphiql-coexistence.spec.ts`,
and unused `ANALYZE` env var in `apps/studio/turbo.jsonc`
- Next-only Sentry/chunk-load filters (`NEXT_NOT_FOUND`,
`NEXT_REDIRECT`, Next `/org/[slug]/` regex, `/app:\/\//`, dead
`includeThirdPartyErrorFilter` plumbing, webpack chunk error regex) and
stale Next/Pages Router comments, docs, and `#__next` CSS selector

**Changed:**

- `apps/studio/eslint.config.cjs`: switched from
`eslint-config-supabase/next` to the new `eslint-config-supabase/react`
preset (dropping `@next/next/no-img-element: off`, keeping `.next` /
`next-env.d.ts` ignored for local checkouts with stale pre-migration
build artifacts)
- `apps/studio/tsconfig.json`: extends `tsconfig/base.json` directly
instead of `tsconfig/nextjs.json` (identical resolved compiler options)
- `apps/studio/.github/eslint-rule-baselines.json`: pruned 33 stale
`pages/...` and `types/next.ts` entries without changing any rule
thresholds
- `apps/studio/tests/lib/custom-render.tsx`: backed
`TestFrameworkProvider` with TanStack Router instead of
`next-router-mock`
-
`apps/studio/components/interfaces/Integrations/GraphQL/GraphiQLTab.tsx`:
imports `graphiql/setup-workers/vite` directly
- `apps/studio/styles/globals.css`: replaced `@source
'../pages/**/*.{js,ts,jsx,tsx}'` with `@source
'../routes/**/*.{js,ts,jsx,tsx}'`
- `apps/studio/turbo.jsonc`: declared `"NEXT_PUBLIC_*"` in
`tasks.build.env` now that Turborepo infers `nitro` instead of `nextjs`
-
`apps/studio/components/interfaces/Organization/Organization.utils.ts`:
narrowed `buildOrgUrl`'s `slug` parameter to `string[] | undefined`

**Added:**

- `packages/eslint-config-supabase/shared.js` and
`packages/eslint-config-supabase/react.js` (plus `presets.test.ts`),
decoupling non-Next React apps from `eslint-config-next` with verified
zero non-`@next/*` rule drift while keeping
`eslint-config-supabase/next` unchanged for the Next.js apps

## To test

- Run `pnpm --filter eslint-config-supabase run test` and confirm preset
parity tests pass
- Run `pnpm --filter studio run lint`, `pnpm --filter studio run
lint:ratchet`, `pnpm --filter studio run typecheck`, `pnpm knip
--workspace apps/studio`, and `pnpm --filter studio run test`
- Run `pnpm --filter studio run build` and verify the production build,
prerendered routes, chunk-cycle check, and GraphiQL web workers succeed
- Smoke-test Studio locally (`pnpm dev:studio`): verify GraphiQL loads
cleanly, ConnectSheet framework steps render, and Tailwind styles on
route pages are intact

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-12-02 17:01:50 +08:00

119 lines
4.3 KiB
JSON

{
"$schema": "./../../node_modules/turbo/schema.json",
"extends": ["//"],
"tasks": {
// `eslint .` also runs the type-aware rules in eslint.type-checks.config.cjs, which is
// its own task so turbo can cache and parallelize it. Both read the shared ESLint config,
// which lives in a workspace package that turbo doesn't hash for this task by default.
"lint": {
"dependsOn": ["lint:type-checks"],
"inputs": ["$TURBO_DEFAULT$", "$TURBO_ROOT$/packages/eslint-config-supabase/**"],
},
"lint:type-checks": {
"inputs": ["$TURBO_DEFAULT$", "$TURBO_ROOT$/packages/eslint-config-supabase/**"],
"outputs": [],
},
"build": {
"dependsOn": ["^build"],
"env": [
"CI",
// vite.config.ts inlines every NEXT_PUBLIC_* var into the client bundle.
// Without `next` in package.json, Turborepo's framework inference no
// longer adds `NEXT_PUBLIC_*` automatically, so declare it explicitly.
"NEXT_PUBLIC_*",
"NIMBUS_PROD_PROJECTS_URL",
"NIMBUS_PROD_PROJECTS_URL_WS",
"NODE_ENV",
"SUPABASE_URL",
"VERCEL",
"VERCEL_ENV",
// Vite embeds this ID in server-function request pins.
// A different deployment ID requires fresh build output.
"VERCEL_DEPLOYMENT_ID",
// Project-level Vercel settings Nitro's vercel preset reads at build
// time; they change the emitted routes and asset paths.
"VERCEL_SKEW_PROTECTION_ENABLED",
"VERCEL_IMMUTABLE_STATIC_FILES_ENABLED",
"VERCEL_HASH_SALT",
"MAINTENANCE_MODE",
// These envs are technically passthrough env vars because they're only used on the server side
"PLATFORM_PG_META_URL",
"STUDIO_PG_META_URL",
"PG_META_CRYPTO_KEY",
"PGRST_DB_SCHEMAS",
"PGRST_DB_MAX_ROWS",
"PGRST_DB_EXTRA_SEARCH_PATH",
"POSTGRES_PASSWORD",
"POSTGRES_HOST",
"POSTGRES_USER_READ_WRITE",
"POSTGRES_USER_READ_ONLY",
"POSTGRES_DB",
"POSTGRES_PORT",
"READ_ONLY_URL",
"READ_ONLY_API_KEY",
"SUPABASE_SERVICE_KEY",
"SUPABASE_ANON_KEY",
"SUPABASE_PUBLISHABLE_KEY",
"SUPABASE_SECRET_KEY",
"SUPABASE_PUBLIC_URL",
"DEFAULT_PROJECT_NAME",
"DEFAULT_ORGANIZATION_NAME",
"OPENAI_API_KEY",
"BRAINTRUST_API_KEY",
"BRAINTRUST_PROJECT_ID",
"AUTH_JWT_SECRET",
"LOGFLARE_API_KEY",
"LOGFLARE_PUBLIC_ACCESS_TOKEN",
"LOGFLARE_PRIVATE_ACCESS_TOKEN",
"LOGFLARE_URL",
"SENTRY_ORG",
"SENTRY_PROJECT",
"SENTRY_AUTH_TOKEN",
"SKIP_ASSET_UPLOAD",
"AWS_BEDROCK_PROFILE",
"AWS_BEDROCK_ROLE_ARN",
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY",
"VERCEL_URL",
"IS_BRAINTRUST_PUSH",
"GITHUB_HEAD_REF",
"GITHUB_REF_NAME",
"GITHUB_PR_NUMBER",
"IS_THROTTLED",
"AI_PRO_MODEL",
"AI_NORMAL_MODEL",
"SUPPORT_SUPABASE_SECRET_KEY",
"INCIDENT_IO_API_KEY",
"INCIDENT_IO_WIDGET_URL",
"INCIDENT_IO_STATUS_PAGE_ID",
// Selects the build mode for the studio's `build`/`start` scripts
// (e.g. e2e sets `MODE=test`). Listed so turbo invalidates the
// cache when it changes — without this, switching between test and
// production builds reuses a stale cached output.
"MODE",
// Read by the Nitro server behind `pnpm start`. Declared so the turbo
// env lint rule passes even though turbo doesn't drive `start`.
"PORT",
// Vite's built-in `import.meta.env.SSR` flag (used in ConnectStepsSection
// to gate Vite-only `import.meta.glob`). Not a real process env var
// but turbo's `no-undeclared-env-vars` lint flags any `env.SSR` access.
"SSR",
],
"passThroughEnv": [
"CURRENT_CLI_VERSION",
"VERCEL_GIT_COMMIT_REF",
"VERCEL_GIT_COMMIT_SHA",
"SNIPPETS_MANAGEMENT_FOLDER",
"EDGE_FUNCTIONS_MANAGEMENT_FOLDER",
"S3_PROTOCOL_ACCESS_KEY_ID",
"S3_PROTOCOL_ACCESS_KEY_SECRET",
],
"outputs": [
// TanStack Start via Nitro: node server and Vercel Build Output.
".output/**",
".vercel/output/**",
],
},
},
}