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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@thinkeloquent/core-prisma-orchestrator

v1.0.4

Published

CLI orchestrator for managing multiple Prisma schemas in a monorepo

Readme

@thinkeloquent/core-prisma-orchestrator

CLI orchestrator for managing multiple Prisma schemas in a monorepo. Coordinates Prisma operations (generate, migrate, format, etc.) across multiple apps with independent schemas.

Features

  • 🔄 Multi-App Generation: Generate Prisma clients for all apps in parallel
  • 🔀 Dependency-Aware Migrations: Run migrations in correct order based on app dependencies
  • Parallel Execution: Fast operations with concurrent processing
  • 📋 Config-Driven: JSON configuration or auto-discovery
  • 🎯 Selective Operations: Target specific apps when needed
  • 🔍 Validation: Built-in schema and config validation

Installation

npm install @thinkeloquent/core-prisma-orchestrator --save-dev

Configuration

Create mta-prisma.config.json in your project root:

{
  "apps": [
    {
      "name": "auth",
      "schemaPath": "apps/auth/prisma/schema.prisma",
      "outputName": "client-auth",
      "dependencies": []
    },
    {
      "name": "billing",
      "schemaPath": "apps/billing/prisma/schema.prisma",
      "outputName": "client-billing",
      "dependencies": ["auth"]
    }
  ],
  "strategy": "orchestrated"
}

If no config file exists, the CLI will auto-discover apps from apps/*/prisma/schema.prisma.

Usage

Generate Clients

# Generate all apps
npx mta-prisma generate

# Generate specific app
npx mta-prisma generate --app auth

# Watch mode
npx mta-prisma watch

# Watch specific app
npx mta-prisma watch --app auth

Migrations

# Development migrations (all apps)
npx mta-prisma migrate:dev

# Migrate specific app
npx mta-prisma migrate:dev --app auth

# Named migration
npx mta-prisma migrate:dev --name "add-user-roles"

# Production deployment
npx mta-prisma migrate:deploy

# Show status
npx mta-prisma migrate:status

# Show diff between schema and database
npx mta-prisma migrate:diff
npx mta-prisma migrate:diff --app auth

# Resolve migration issues
npx mta-prisma migrate:resolve 20231201_init --applied
npx mta-prisma migrate:resolve 20231201_init --rolled-back

# Create baseline for existing database
npx mta-prisma migrate:baseline initial_baseline

# Reset (DESTRUCTIVE)
npx mta-prisma migrate:reset --force

Schema Utilities

# Format all schemas
npx mta-prisma format

# Validate all schemas
npx mta-prisma validate

# Open Prisma Studio
npx mta-prisma studio auth

# Show configuration info
npx mta-prisma info

CLI Options

Global Options

  • -c, --config <path>: Path to config file (default: mta-prisma.config.json)
  • --verbose: Enable verbose logging
  • --dry-run: Show what would be done without executing

Command-Specific Options

See npx mta-prisma <command> --help for detailed options.

Configuration Schema

AppConfig

interface AppConfig {
  name: string;                    // App name
  schemaPath: string;              // Path to schema.prisma
  outputName: string;              // Generated client output name
  dependencies?: string[];         // Apps this depends on
  enabled?: boolean;               // Whether to include this app
  databaseUrlEnv?: string;         // Custom env var for DATABASE_URL
}

MtaPrismaConfig

interface MtaPrismaConfig {
  apps: AppConfig[];                        // List of apps
  strategy: 'orchestrated' | 'merged';      // Migration strategy
  mergedSchemaPath?: string;                // Path for merged schema
  databaseUrl?: string;                     // Default database URL
  prismaFlags?: {                           // Additional Prisma flags
    generate?: string[];
    migrate?: string[];
    studio?: string[];
  };
}

Examples

Multi-App Monorepo

monorepo/
├── apps/
│   ├── auth/
│   │   └── prisma/
│   │       └── schema.prisma
│   └── billing/
│       └── prisma/
│           └── schema.prisma
├── mta-prisma.config.json
└── package.json

Per-App Schema

// apps/auth/prisma/schema.prisma
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
  output   = "../node_modules/.prisma/client-auth"
}

model User {
  id    String @id
  email String @unique
}

Integration with Prisma

This CLI wraps the official Prisma CLI and adds multi-schema orchestration. All standard Prisma commands work with --schema flag under the hood.

License

MIT