
Product
Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.
@prisma-next/ts-render
Advanced tools
TypeScript source-text rendering utilities: JSON-to-TS literal printer and abstract expression base class
Internal package. This package is an implementation detail of
prisma-nextand is published only to support its runtime. Its API is unstable and may change without notice. Do not depend on this package directly; installprisma-nextinstead.
TypeScript source-text rendering utilities shared by any Prisma Next component that has to emit hand-editable .ts files — today the Postgres and Mongo migration-authoring surfaces, later any new target that ships a migration-authoring experience.
Two small pieces:
TsExpression — abstract base class for any node that renders as a TypeScript expression in a generated source file. Subclasses supply renderTypeScript(): string and importRequirements(): readonly ImportRequirement[]. Hierarchical so that composite nodes (e.g. a DataTransformCall containing slot expressions) can recurse into their children.jsonToTsSource(value) — pure JSON-to-TypeScript-source printer. Accepts unknown for ergonomics with structural types whose fields happen to be JSON-compatible, and throws at runtime on anything that is not a JSON primitive / array / object.jsonToTsSource is deliberately the second stage of a two-stage pipeline:
jsValue → codec.encodeJson → JsonValue → jsonToTsSource → TS source text
Stage 1 (codec.encodeJson) is a codec responsibility — date serialization, opaque domain types (vector, bigint, uuid), JSON canonicalization. Stage 2 (this module) is a pure printer that must never grow type-specific branches. To render a non-JSON JS value (Date, Vector, BigInt, Buffer, …), encode it through the relevant codec's encodeJson first.
import { type ImportRequirement, TsExpression, jsonToTsSource } from '@prisma-next/ts-render';
class CreateTableCall extends TsExpression {
constructor(
readonly schema: string,
readonly table: string,
readonly columns: ReadonlyArray<{ name: string; typeSql: string; nullable: boolean }>,
) {
super();
}
override renderTypeScript(): string {
return `createTable(${jsonToTsSource(this.schema)}, ${jsonToTsSource(this.table)}, ${jsonToTsSource(this.columns)})`;
}
override importRequirements(): readonly ImportRequirement[] {
return [{ moduleSpecifier: '@prisma-next/postgres/migration', symbol: 'createTable' }];
}
}
FAQs
TypeScript source-text rendering utilities: JSON-to-TS literal printer and abstract expression base class
The npm package @prisma-next/ts-render receives a total of 19,760 weekly downloads. As such, @prisma-next/ts-render popularity was classified as popular.
We found that @prisma-next/ts-render demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.