Files
zooqueenandHanzo Dev de2426e6eb sqlite: type the scalar lists and stop typechecking against es5
The schema is sqlite, but the app is upstream Papermark written for postgres,
and three of the gaps between them were failing the build.

  lists — postgres `String[]` has no sqlite equivalent, so allowList, denyList,
    emails, domains and globalBlockList became `Json` and read back as
    `Prisma.JsonValue`. Callers still treat them as arrays, so `.length`,
    `.some()` and spreading them were all errors: 52 of the 99. The generated
    payload types are now narrowed to `string[]`, which is what those columns
    actually hold. Model-scoped, because `domains` is a string list on
    ViewerGroup but a `Domain[]` relation on Team and User.

  target — `es5` made every `for...of` over a Set or Map an error while the
    code shipped through SWC untouched. tsc is `noEmit` here, so this only ever
    described the typecheck, never the output.

  svg — `next-env.d.ts` carries the declaration for static image imports and is
    gitignored, so a typecheck that had not been preceded by a build could not
    resolve them. Committed as types/next.d.ts so tsc stands on its own.

The enum shim grew the list handling and is renamed for what it now does. Its
"nothing injected" check also treated an already-shimmed client as a missing
one, which failed any second install that did not regenerate first.

99 errors -> 37, no file worse than it was.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-09 11:46:36 -07:00

8 lines
372 B
TypeScript

/// <reference types="next" />
/// <reference types="next/image-types/global" />
// Next writes these same two references into next-env.d.ts at build time, and
// that file is gitignored — so a typecheck that runs before a build has no
// declaration for `*.svg` and every static image import fails to resolve.
// Committing them makes `tsc --noEmit` stand on its own.