create-prisma 0.4.2-next.37.106.1 → 0.4.2-next.37.108.1
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/README.md +14 -14
- package/dist/cli.mjs +1 -1
- package/dist/{create-DNd0H1pd.mjs → create-C7SXN6bn.mjs} +2 -2
- package/dist/index.d.mts +16 -18
- package/dist/index.mjs +13 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,23 +24,23 @@ plan/apply path for initial schema setup.
|
|
|
24
24
|
Use the package runner you already have:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npx create-prisma@next
|
|
27
|
+
npx create-prisma@next my-app
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
pnpm dlx create-prisma@next
|
|
31
|
+
pnpm dlx create-prisma@next my-app
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
yarn dlx create-prisma@next
|
|
35
|
+
yarn dlx create-prisma@next my-app
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
bunx create-prisma@next
|
|
39
|
+
bunx create-prisma@next my-app
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
deno run -A npm:create-prisma@next
|
|
43
|
+
deno run -A npm:create-prisma@next my-app
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
If you already have it available locally:
|
|
@@ -60,49 +60,49 @@ create-prisma
|
|
|
60
60
|
Create a Minimal project non-interactively:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
create-prisma
|
|
63
|
+
create-prisma my-script --template minimal --provider postgres
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
Create a Hono app non-interactively:
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
create-prisma
|
|
69
|
+
create-prisma my-api --template hono --provider postgres
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
Create a MongoDB app:
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
|
-
create-prisma
|
|
75
|
+
create-prisma my-api --template hono --provider mongodb
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
Scaffold into the current directory:
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
create-prisma
|
|
81
|
+
create-prisma . --template hono --provider postgres
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
Use TypeScript contract authoring:
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
|
-
create-prisma
|
|
87
|
+
create-prisma my-app --template next --authoring typescript
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
Use Prisma Postgres auto-provisioning:
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
create-prisma
|
|
93
|
+
create-prisma my-app --template nest --provider postgres --prisma-postgres
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
Target a specific Prisma Next release (useful for regression / bisect work):
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
create-prisma
|
|
99
|
+
create-prisma my-app --template hono --prisma-next-version 0.10.0
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
Scaffold against an open PR via pkg.pr.new:
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
|
-
create-prisma
|
|
105
|
+
create-prisma my-app --template hono --prisma-next-version pkg-pr-new:bad6795
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
## Supported Templates
|
|
@@ -132,7 +132,7 @@ create-prisma --name my-app --template hono --prisma-next-version pkg-pr-new:bad
|
|
|
132
132
|
|
|
133
133
|
## Useful Flags
|
|
134
134
|
|
|
135
|
-
- `--name` project name
|
|
135
|
+
- positional project name or `--name` project name / relative path
|
|
136
136
|
- `--template` choose the template
|
|
137
137
|
- `--provider postgres|postgresql|mongo|mongodb` (default: `postgres`)
|
|
138
138
|
- `--authoring psl|typescript` (default: `psl`)
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
import { cancel, confirm, intro, isCancel, log, note, outro, select, spinner, text } from "@clack/prompts";
|
|
3
4
|
import fs from "fs-extra";
|
|
4
5
|
import path from "node:path";
|
|
@@ -8,7 +9,6 @@ import { PostHog } from "posthog-node";
|
|
|
8
9
|
import Handlebars from "handlebars";
|
|
9
10
|
import { existsSync } from "node:fs";
|
|
10
11
|
import { fileURLToPath } from "node:url";
|
|
11
|
-
import { z } from "zod";
|
|
12
12
|
import { execa } from "execa";
|
|
13
13
|
import { styleText } from "node:util";
|
|
14
14
|
|
|
@@ -131,7 +131,7 @@ async function getAnonymousId() {
|
|
|
131
131
|
}
|
|
132
132
|
function getCommonProperties() {
|
|
133
133
|
return {
|
|
134
|
-
"cli-version": "0.4.2-next.37.
|
|
134
|
+
"cli-version": "0.4.2-next.37.108.1",
|
|
135
135
|
"node-version": process.version,
|
|
136
136
|
platform: process.platform,
|
|
137
137
|
arch: process.arch
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import * as _orpc_server0 from "@orpc/server";
|
|
3
3
|
import * as trpc_cli0 from "trpc-cli";
|
|
4
|
-
import * as zod from "zod";
|
|
5
4
|
import { z } from "zod";
|
|
6
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
7
5
|
|
|
8
6
|
//#region node_modules/@orpc/client/dist/index.d.mts
|
|
9
7
|
declare const COMMON_ORPC_ERROR_DEFS: {
|
|
@@ -249,33 +247,33 @@ type CreateCommandInput = z.infer<typeof CreateCommandInputSchema>;
|
|
|
249
247
|
//#endregion
|
|
250
248
|
//#region src/index.d.ts
|
|
251
249
|
declare const router: {
|
|
252
|
-
create: _orpc_server0.Procedure<_orpc_server0.MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>,
|
|
253
|
-
yes:
|
|
254
|
-
verbose:
|
|
255
|
-
provider:
|
|
250
|
+
create: _orpc_server0.Procedure<_orpc_server0.MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>, z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodObject<{
|
|
251
|
+
yes: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
253
|
+
provider: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
256
254
|
postgres: "postgres";
|
|
257
255
|
postgresql: "postgresql";
|
|
258
256
|
mongo: "mongo";
|
|
259
257
|
mongodb: "mongodb";
|
|
260
|
-
}>,
|
|
261
|
-
authoring:
|
|
258
|
+
}>, z.ZodTransform<"postgres" | "mongo", "postgres" | "postgresql" | "mongo" | "mongodb">>>;
|
|
259
|
+
authoring: z.ZodOptional<z.ZodEnum<{
|
|
262
260
|
psl: "psl";
|
|
263
261
|
typescript: "typescript";
|
|
264
262
|
}>>;
|
|
265
|
-
packageManager:
|
|
263
|
+
packageManager: z.ZodOptional<z.ZodEnum<{
|
|
266
264
|
npm: "npm";
|
|
267
265
|
pnpm: "pnpm";
|
|
268
266
|
yarn: "yarn";
|
|
269
267
|
bun: "bun";
|
|
270
268
|
deno: "deno";
|
|
271
269
|
}>>;
|
|
272
|
-
prismaPostgres:
|
|
273
|
-
databaseUrl:
|
|
274
|
-
install:
|
|
275
|
-
emit:
|
|
276
|
-
prismaNextVersion:
|
|
277
|
-
name:
|
|
278
|
-
template:
|
|
270
|
+
prismaPostgres: z.ZodOptional<z.ZodBoolean>;
|
|
271
|
+
databaseUrl: z.ZodOptional<z.ZodString>;
|
|
272
|
+
install: z.ZodOptional<z.ZodBoolean>;
|
|
273
|
+
emit: z.ZodOptional<z.ZodBoolean>;
|
|
274
|
+
prismaNextVersion: z.ZodOptional<z.ZodString>;
|
|
275
|
+
name: z.ZodOptional<z.ZodString>;
|
|
276
|
+
template: z.ZodOptional<z.ZodEnum<{
|
|
279
277
|
minimal: "minimal";
|
|
280
278
|
hono: "hono";
|
|
281
279
|
elysia: "elysia";
|
|
@@ -286,8 +284,8 @@ declare const router: {
|
|
|
286
284
|
nuxt: "nuxt";
|
|
287
285
|
"tanstack-start": "tanstack-start";
|
|
288
286
|
}>>;
|
|
289
|
-
force:
|
|
290
|
-
},
|
|
287
|
+
force: z.ZodOptional<z.ZodBoolean>;
|
|
288
|
+
}, z.core.$strip>], null>, Schema<void, void>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
291
289
|
};
|
|
292
290
|
declare function createCreatePrismaCli(): trpc_cli0.TrpcCli;
|
|
293
291
|
declare function create(input?: CreateCommandInput): Promise<void>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as DatabaseUrlSchema, r as CreateCommandInputSchema, s as PackageManagerSchema, t as runCreateCommand } from "./create-
|
|
2
|
+
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as DatabaseUrlSchema, r as CreateCommandInputSchema, s as PackageManagerSchema, t as runCreateCommand } from "./create-C7SXN6bn.mjs";
|
|
3
3
|
import { os } from "@orpc/server";
|
|
4
4
|
import { createCli } from "trpc-cli";
|
|
5
|
+
import { z } from "zod";
|
|
5
6
|
|
|
6
7
|
//#region src/index.ts
|
|
7
|
-
const CLI_VERSION = "0.4.2-next.37.
|
|
8
|
+
const CLI_VERSION = "0.4.2-next.37.108.1";
|
|
9
|
+
const CreateCliInputSchema = z.tuple([z.string().trim().min(1, "Please enter a valid project name").optional().describe("Project name / directory"), CreateCommandInputSchema]);
|
|
10
|
+
function normalizeCreateCliInput(input) {
|
|
11
|
+
const [projectName, options] = input;
|
|
12
|
+
return {
|
|
13
|
+
...options,
|
|
14
|
+
name: options.name ?? projectName
|
|
15
|
+
};
|
|
16
|
+
}
|
|
8
17
|
const router = os.router({ create: os.meta({
|
|
9
18
|
description: "Create a new project with Prisma setup",
|
|
10
19
|
default: true,
|
|
11
20
|
negateBooleans: true
|
|
12
|
-
}).input(
|
|
13
|
-
await runCreateCommand(input
|
|
21
|
+
}).input(CreateCliInputSchema).handler(async ({ input }) => {
|
|
22
|
+
await runCreateCommand(normalizeCreateCliInput(input));
|
|
14
23
|
}) });
|
|
15
24
|
function createCreatePrismaCli() {
|
|
16
25
|
return createCli({
|
package/package.json
CHANGED