Files
Alaister YoungandAlaister Young cf223ae74a [FE-3106] (part 13) – chore(studio): remove next entry files and config (#53222)
Removes the Next-only entry files and config now that every page lives
in `routes/**` (FE-3106). `routes/__root.tsx` already mirrors
`pages/_app.tsx` (dayjs plugins, providers, telemetry, error boundary,
favicons). Part 13 of the stack.

**Depends on:** #53221

**Changed:**
- `components/interfaces/App/{NotFoundPage,ServerErrorPage}.tsx` – the
404/500 pages, rendered by `__root.tsx`, now with native
`Link`/`useNavigate` and `<img>`
- `routes/api/{status-page,scoped-access-token-permissions}.ts` – App
Router handlers from `app/api/**` moved in (`NextResponse.json` →
`Response.json`); `buildAPIPermissionScopeMap` moves to `lib/api/`
- `package.json`, `tsconfig.json` – no `next typegen` step or
`.next/types` include
- `packages/ui-patterns/.../InstructionBlocks.tsx` – asset map typed
`StaticImageData | string`: under Vite a png import is a URL string,
which Next's global image types used to hide
- `vite.config.ts`, `knip.jsonc`, `turbo.jsonc` and comments across
studio – Next build references removed

**Removed:**
- `pages/{_app,_document,404,500}.tsx`, `pages/_error.jsx`,
`pages/README.md`, `app/**`, `next.config.ts`, `proxy.ts`,
`instrumentation{,-client}.ts`, `sentry.{server,edge}.config.ts`,
`fonts/index.ts` (next/font), `BootTimeoutFallback`,
`postcss.config.cjs`, the `next/server` shim
- `@next/bundle-analyzer`, `raw-loader`, `postcss`,
`@tailwindcss/postcss` dev dependencies

Addresses
[FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages).

## To test

- Open an unknown URL – the 404 page renders with working "Head back"
- `/api/status-page` and `/api/scoped-access-token-permissions` on
platform – same JSON and `Cache-Control`
- Fonts (Inter, Manrope, Source Code Pro) still load

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-17 17:33:02 +09:00

64 lines
4.0 KiB
TypeScript

/**
* Registry of integration overview markdown, keyed by integration id
* (= directory name under `static-data/integrations/`).
*
* The import specifiers must stay as string literals: the bundler can only
* code-split and apply its md-as-string loader (`rawTextLoader` plugin in
* vite.config.ts) to imports it can statically analyze. A template-literal specifier like
* ``import(`@/static-data/integrations/${id}/overview.md`)`` happens to work
* under webpack/turbopack (context modules) but is left untouched by
* Vite/Rolldown and throws `TypeError: Failed to resolve module specifier`
* at runtime in the TanStack build.
*
* `overviews.test.ts` asserts this map stays in sync with the files on disk —
* when adding a new `overview.md`, add its entry here.
*/
const INTEGRATION_OVERVIEWS = {
airtable_wrapper: () => import('@/static-data/integrations/airtable_wrapper/overview.md'),
auth0_wrapper: () => import('@/static-data/integrations/auth0_wrapper/overview.md'),
bigquery_wrapper: () => import('@/static-data/integrations/bigquery_wrapper/overview.md'),
cal_wrapper: () => import('@/static-data/integrations/cal_wrapper/overview.md'),
calendly_wrapper: () => import('@/static-data/integrations/calendly_wrapper/overview.md'),
cfd1_wrapper: () => import('@/static-data/integrations/cfd1_wrapper/overview.md'),
clerk_wrapper: () => import('@/static-data/integrations/clerk_wrapper/overview.md'),
clickhouse_wrapper: () => import('@/static-data/integrations/clickhouse_wrapper/overview.md'),
cognito_wrapper: () => import('@/static-data/integrations/cognito_wrapper/overview.md'),
cron: () => import('@/static-data/integrations/cron/overview.md'),
data_api: () => import('@/static-data/integrations/data_api/overview.md'),
firebase_wrapper: () => import('@/static-data/integrations/firebase_wrapper/overview.md'),
graphiql: () => import('@/static-data/integrations/graphiql/overview.md'),
hubspot_wrapper: () => import('@/static-data/integrations/hubspot_wrapper/overview.md'),
iceberg_wrapper: () => import('@/static-data/integrations/iceberg_wrapper/overview.md'),
logflare_wrapper: () => import('@/static-data/integrations/logflare_wrapper/overview.md'),
mssql_wrapper: () => import('@/static-data/integrations/mssql_wrapper/overview.md'),
notion_wrapper: () => import('@/static-data/integrations/notion_wrapper/overview.md'),
orb_wrapper: () => import('@/static-data/integrations/orb_wrapper/overview.md'),
paddle_wrapper: () => import('@/static-data/integrations/paddle_wrapper/overview.md'),
queues: () => import('@/static-data/integrations/queues/overview.md'),
redis_wrapper: () => import('@/static-data/integrations/redis_wrapper/overview.md'),
s3_vectors_wrapper: () => import('@/static-data/integrations/s3_vectors_wrapper/overview.md'),
s3_wrapper: () => import('@/static-data/integrations/s3_wrapper/overview.md'),
slack_wrapper: () => import('@/static-data/integrations/slack_wrapper/overview.md'),
snowflake_wrapper: () => import('@/static-data/integrations/snowflake_wrapper/overview.md'),
stripe_sync_engine: () => import('@/static-data/integrations/stripe_sync_engine/overview.md'),
stripe_wrapper: () => import('@/static-data/integrations/stripe_wrapper/overview.md'),
vault: () => import('@/static-data/integrations/vault/overview.md'),
warehouse: () => import('@/static-data/integrations/warehouse/overview.md'),
webhooks: () => import('@/static-data/integrations/webhooks/overview.md'),
} satisfies Record<string, () => Promise<{ default: string }>>
export const INTEGRATION_OVERVIEW_IDS = Object.keys(
INTEGRATION_OVERVIEWS
) as (keyof typeof INTEGRATION_OVERVIEWS)[]
/**
* Loads the overview markdown for an integration. Resolves to `null` when the
* integration has no bundled overview (e.g. marketplace apps).
*/
export async function loadIntegrationOverview(integrationId: string): Promise<string | null> {
const load = INTEGRATION_OVERVIEWS[integrationId as keyof typeof INTEGRATION_OVERVIEWS]
if (!load) return null
const mod = await load()
return String(mod.default)
}