create-prisma 0.0.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ Release notes are generated from merged pull requests using `changelogithub`.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # create-prisma
2
+
3
+ A modern Prisma 7 CLI with first-party project templates and great init DX.
4
+
5
+ ## Stack
6
+
7
+ - `trpc-cli` for command routing
8
+ - `zod@4` for validated input schemas
9
+ - `@clack/prompts@1` for interactive UX
10
+ - `execa` for external command execution
11
+ - `fs-extra` for filesystem operations
12
+ - `handlebars` for conditional template rendering
13
+ - `tsdown` for ESM builds
14
+
15
+ ## Usage
16
+
17
+ Run directly with Bun:
18
+
19
+ ```bash
20
+ bunx create-prisma@latest
21
+ ```
22
+
23
+ Create a new project (default command):
24
+
25
+ ```bash
26
+ create-prisma
27
+ ```
28
+
29
+ Create a Hono project non-interactively:
30
+
31
+ ```bash
32
+ create-prisma --name my-api --template hono --provider postgresql
33
+ ```
34
+
35
+ Create a Next.js project non-interactively:
36
+
37
+ ```bash
38
+ create-prisma --name my-web --template next --provider postgresql
39
+ ```
40
+
41
+ Initialize Prisma explicitly in the current project:
42
+
43
+ ```bash
44
+ create-prisma init
45
+ ```
46
+
47
+ Set package manager non-interactively:
48
+
49
+ ```bash
50
+ create-prisma init --package-manager pnpm --install
51
+ ```
52
+
53
+ Skip Prisma Client generation:
54
+
55
+ ```bash
56
+ create-prisma init --no-generate
57
+ ```
58
+
59
+ Show verbose command output:
60
+
61
+ ```bash
62
+ create-prisma init --verbose
63
+ ```
64
+
65
+ Run fully non-interactive with defaults:
66
+
67
+ ```bash
68
+ create-prisma init --yes
69
+ ```
70
+
71
+ Use Prisma Postgres auto-provisioning for PostgreSQL:
72
+
73
+ ```bash
74
+ create-prisma init --provider postgresql --prisma-postgres
75
+ ```
76
+
77
+ Or run locally:
78
+
79
+ ```bash
80
+ bun install
81
+ bun run build
82
+ bun run start
83
+ ```
84
+
85
+ The CLI updates `package.json` with Prisma dependencies, optionally runs dependency installation with your selected package manager, and scaffolds Prisma 7 setup files from Handlebars templates:
86
+ - `prisma/schema.prisma`
87
+ - `prisma/index.ts`
88
+ - `prisma.config.ts`
89
+ - `.env` (creates or updates `DATABASE_URL`, and writes `CLAIM_URL` when Prisma Postgres is provisioned)
90
+ - runs `prisma generate` automatically after scaffolding
91
+
92
+ `create` is the default command and currently supports:
93
+ - templates: `hono`, `next`
94
+ - project name via `--name`
95
+ - schema presets via `--schema-preset empty|basic` (default: `basic`)
96
+
97
+ `init` configures Prisma in the current project and supports schema presets too (default: `empty`).
98
+ Both commands prompt for database choice, package manager, and whether to install dependencies now.
99
+ Supported providers in this flow: `postgresql`, `mysql`, `sqlite`, `sqlserver`, `cockroachdb`.
100
+ Supported package managers: `bun`, `pnpm`, `npm`.
101
+ Package manager prompt auto-detects from `package.json`/lockfiles/user agent and uses that as the initial selection.
102
+ `--yes` accepts defaults (`postgresql`, detected package manager, Prisma Postgres enabled for PostgreSQL, install enabled) and skips prompts.
103
+ `--no-generate` skips automatic `prisma generate`.
104
+ `--verbose` prints full install/generate command output; default mode keeps output concise.
105
+ `--force` (create only) allows scaffolding in a non-empty target directory.
106
+ If Prisma files already exist, `init` asks whether to keep existing files or overwrite them.
107
+ When `postgresql` is selected, `init` can provision Prisma Postgres via `create-db --json` and auto-fill `DATABASE_URL`.
108
+
109
+ ## Scripts
110
+
111
+ - `bun run build` - Build to `dist/`
112
+ - `bun run dev` - Watch mode build
113
+ - `bun run start` - Run built CLI
114
+ - `bun run typecheck` - TypeScript checks only
115
+ - `bun run bump` - Create a release PR (interactive semver bump)
116
+ - `bun run bump -- patch|minor|major|x.y.z` - Non-interactive bump
117
+ - `bun run bump -- --dry-run patch` - Preview next version without changing files
118
+ - `bun run release-notes` - Generate GitHub release notes via `changelogithub`
119
+
120
+ ## Release Workflow
121
+
122
+ This repo uses a manual, script-driven release flow:
123
+
124
+ 1. Run `bun run bump` (or pass `patch|minor|major|x.y.z`).
125
+ 2. The script creates a `release/vX.Y.Z` branch and a PR with commit `chore(release): X.Y.Z`.
126
+ 3. Merge that PR to `main` with squash (keep commit title `chore(release): X.Y.Z`).
127
+ 4. GitHub Actions creates the `vX.Y.Z` tag and GitHub Release notes via `changelogithub`.
128
+ 5. GitHub Actions publishes only for `chore(release):` commits, using npm trusted publishing (OIDC, no npm token secret).
package/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { };
package/dist/cli.mjs ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import "./create-fJECj1B0.mjs";
3
+ import { createCreatePrismaCli } from "./index.mjs";
4
+
5
+ //#region src/cli.ts
6
+ createCreatePrismaCli().run();
7
+
8
+ //#endregion
9
+ export { };