Add `--skip-install` (parity with `prisma orm init --skip-install`): no way to scaffold files without installing dependencies

Aperta
#107 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
nodejs, typescript
Ambito
cli

Direzione di ricerca

Start at the create-prisma CLI flag parsing and follow the install and post-install flow, using prisma orm init --skip-install as the behavioral reference. Verify that scaffolding still writes all files, skipped mode reports nextActions in both output modes, deploy is rejected, and normal installation behavior remains unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Summary

create-prisma has no way to generate a project without installing dependencies. prisma orm init has --skip-install; create-prisma rejects it:

$ npm create prisma@latest -- nest-ref --template nest --provider postgres --yes --skip-install

ERROR
  Unrecognized flag: --skip-install in command create-prisma

([email protected], npm 11.6.2, Node 24.11.1, macOS.)

Why it matters

  • Inspecting a template. I wanted to compare what --template nest emits against a hand-wired NestJS 12 project. That needs the files, not node_modules. A full install of the nest template pulls in @prisma/composer, alchemy, tsdown and friends, which takes minutes on a cold cache for something I was going to delete.
  • Agents and CI. The CLI already advertises itself as agent-friendly (--yes, --json). Agents typically generate first and install once, after they have edited package.json (for example to add @nestjs/cli, or to pin a different @prisma/orm-postgres rc). Today that means "install, edit, install again".
  • Offline / monorepo scaffolding. In a pnpm or turborepo workspace, the install has to run from the workspace root anyway; the nested install create-prisma performs is wasted and can leave a stray lockfile.
  • --json implies deploy. The help text says --json "deploys unless --no-deploy", so the only non-interactive mode does more work by default, not less. A --skip-install flag is the natural counterpart.

Proposal

Add --skip-install (matching the prisma orm init flag name so the two CLIs read the same):

--skip-install    Write the project files but do not install dependencies
                  (also skips the initial `prisma contract emit`, which needs them)

Behaviour:

  1. Scaffold all files exactly as today, including package.json.
  2. Skip the package-manager install step and the post-install steps that need node_modules (prisma contract emit, prisma db init, skills sync).
  3. Print the commands the user needs to run next, and include them in the --json result as nextActions, the same way prisma orm init does:
{
  "ok": true,
  "packagesInstalled": { "status": "skipped" },
  "contractEmitted": false,
  "nextActions": [
    { "kind": "run-command", "command": "npm install" },
    { "kind": "run-command", "command": "npx prisma contract emit" }
  ]
}
  1. --skip-install with --deploy should be an error (deploy needs a build).

Alternatives

  • --package-manager none: less discoverable and does not express intent.
  • Generating into a temp dir and killing the process during install: what I actually did, which is not great.
Lingua principale
TypeScript
Stelle
12
Fork
0
Merge medio
43m
PR unite (30g)
8

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di prisma/create-prisma

Tutte le issue di prisma/create-prisma

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.