npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@polyprism/ts-type

v0.3.1

Published

Prisma 6 & 7 generator that emits TypeScript type aliases (`export type User = { ... }`) from your schema. Pure ESM, zero runtime deps, configurable naming + annotations. Part of PolyPrism.

Readme

@polyprism/ts-type

A Prisma 6 & 7 generator that emits TypeScript type aliases from your schema.prisma. Part of PolyPrism.

export type User = {
  id: string;
  email: string;
  name: string | null;
  role: Role;
};

Pure ESM, Prisma 7-native, zero third-party runtime dependencies. CI tests against both Prisma 6 and Prisma 7. The generated code imports nothing from PolyPrism itself — drop the generator and your output keeps compiling.

Install

pnpm add -D prisma @polyprism/ts-type

Configure

generator polyprismCodegen {
  provider = "polyprism-ts-type"
  output   = "../generated"
}

⚠️ The provider string is the bin name (no @scope/ prefix).

Run

pnpm prisma generate

Output

// generated/User.ts
import type { Role } from "./enums/Role.js";

export type User = {
  id: string;
  email: string;
  name: string | null;
  role: Role;
};

Every enum is also emitted as its own standalone ESM file at <output>/enums/<EnumName>.ts, so you can Object.values(MyEnum) directly without re-exporting through @prisma/client (whose CJS shape doesn't always play nicely with ESM consumers).

When to pick this over ts-interface

type and interface are nearly identical in TypeScript, but they diverge in a few places:

  • type aliases can union with other types directly (type T = User | Admin).
  • type aliases compose into intersection (type T = A & B) and conditional types more ergonomically.
  • interface is open to declaration merging; type is closed — which some teams prefer as a "no surprises" property.
  • Some teams just prefer one for stylistic consistency.

If you don't have a strong preference, @polyprism/ts-interface is the more conventional pick.

What you get out of the box

  • Prisma 6 & 7 compatibility — same generator binary, both Prisma majors. CI tests against both, including the Prisma 7 prisma.config.ts layout.
  • Pure ESM from day one — not retrofitted from a CJS codebase. No require(), no .cjs re-export shims, no surprise.
  • Zero third-party runtime dependencies. This package depends only on @polyprism/core and @polyprism/ts-shared, neither of which has a third-party runtime dep.
  • Eight /// annotations@hide, @deprecated, @json (four forms), @type, @name, @normalise, @coerce, @noCoerce. Plus prisma-json-types-generator shorthand compatibility (/// [TypeName]).
  • Three-axis naming config — independently control file, type, and field naming (snake_case, kebab-case, PascalCase, camelCase, or preserve).
  • Per-identifier @name(NewName) override — escape hatch for the global naming rule.
  • @db.X(p, s) precision captured as JSDoc so the schema-level info survives codegen.
  • Optional barrel (emitIndex = true).
  • Pretty-formatted inline JSON types — multi-property objects from @json({ ... }) get broken onto multiple lines instead of collapsed onto one.

Config options + annotations

Identical across all ts-* patterns — see the root README for the full config reference and annotation grammar.

Sibling patterns

Same schema, different output shape — just swap the provider:

More patterns on the roadmap: Zod, Valibot, ArkType, TypeBox.

License

MIT © Travis Fitzgerald