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/core

v0.3.1

Published

Prisma schema IR, reader, annotation parser, and naming layer powering PolyPrism's Prisma 6 & 7 generators. Pure ESM, zero third-party runtime deps.

Downloads

2,093

Readme

@polyprism/core

Internal runtime + IR layer behind PolyPrism — a Prisma 6 & 7 generator that emits TypeScript types from your schema.prisma in whichever shape fits the layer you're writing: interface, type, plain class, or an opinionated domain class with setter-driven @normalise/@coerce data laundering today, with Zod / Valibot / ArkType / TypeBox on the roadmap.

One Prisma schema. Many shapes. Pick your output by changing a single config string.

Pure ESM, Prisma 7-native, zero third-party runtime dependencies on any published @polyprism/* package. CI tests against both Prisma 6 and Prisma 7.

You're probably looking for a pattern package

You don't install @polyprism/core directly — each pattern package pulls it in transitively.

| Install | What it emits | |---|---| | @polyprism/ts-interface | export interface User { ... } | | @polyprism/ts-type | export type User = { ... }; | | @polyprism/ts-class | export class User { ... } — plain class, public fields | | @polyprism/ts-domain-class | Opinionated domain class — private fields, getters/setters with @normalise/@coerce data laundering, from(), toJSON(), builder |

What @polyprism/core actually does

It's the brain every pattern package shares:

  • IRModelDef, FieldDef, EnumDef, AnnotationSet. A language-agnostic intermediate representation of your Prisma schema that every emitter reads from.
  • Schema reader — DMMF → IR translation. Internal; never exported. This firewall is what lets pattern packages stay third-party-runtime-dep-free, and keeps Prisma's officially-unstable DMMF surface from leaking into user code.
  • Annotation parserparseAnnotations understands eight triple-slash annotations: @hide, @deprecated, @json (four forms), @type, @name, @normalise, @coerce, @noCoerce. Plus prisma-json-types-generator shorthand compatibility (/// [TypeName]).
  • Naming resolverresolveTypeIdent, resolveFieldIdent, resolveTypeFilename. Three-axis (file / type / field) casing config: snake, kebab, Pascal, camel, preserve. With per-identifier @name(NewName) overrides.
  • Generator runtimedefineGenerator, GeneratorContext, virtual filesystem for testability.
  • Shared emitter helpersemitEnums, emitJsonTypes, prettyFormatType, createInMemoryFileWriter.

Why this is a separate package

Two reasons:

  1. Pattern packages stay tiny. Each @polyprism/ts-* package ships only its emitter and depends on @polyprism/core (plus @polyprism/ts-shared for the TS family) — nothing else. For ts-interface, ts-type, and ts-class, the generated code imports nothing from PolyPrism either, so you can drop the generator and your output keeps compiling. ts-domain-class is the one exception: it emits imports from @polyprism/runtime — a ~70 LOC, zero-third-party-dep runtime helper — in exchange for setter-driven @normalise / @coerce data laundering.
  2. One brain, many emitters. Every pattern reads the same IR, so the interface version and the class version of your schema agree on field names, file layout, JSON-type handling, and annotation behaviour — by construction, not by convention.

Links

License

MIT © Travis Fitzgerald