create-prisma 0.4.2-pr.53.192.1 → 0.4.2-pr.53.194.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 +3 -3
- package/dist/cli.mjs +1 -1
- package/dist/{create-SAjMvp0a.mjs → create-BlE_5uZk.mjs} +15 -15
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
- package/templates/create/_shared/README.md.hbs +2 -2
- package/templates/create/astro/src/pages/index.astro.hbs +2 -2
- package/templates/create/next/src/app/page.tsx.hbs +2 -2
- package/templates/create/nuxt/app/pages/index.vue.hbs +2 -2
- package/templates/create/svelte/src/routes/+page.svelte.hbs +2 -2
- package/templates/create/tanstack-start/src/routes/__root.tsx.hbs +2 -2
- package/templates/create/tanstack-start/src/routes/index.tsx.hbs +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# create-prisma
|
|
2
2
|
|
|
3
|
-
Create a Prisma
|
|
3
|
+
Create a Prisma 8 app with Prisma Composer built in.
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ yarn dlx create-prisma@next my-app
|
|
|
13
13
|
bunx create-prisma@next my-app
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
The CLI initializes Prisma
|
|
16
|
+
The CLI initializes Prisma 8 with the aligned `@prisma/cli` prerelease, installs dependencies, emits the contract, and generates a deployable Composer app. PostgreSQL projects use Composer's native Prisma Postgres provider, including migrations and a typed runtime client.
|
|
17
17
|
|
|
18
18
|
The only Composer prompt is:
|
|
19
19
|
|
|
@@ -49,7 +49,7 @@ PostgreSQL and MongoDB are supported with PSL or TypeScript contract authoring.
|
|
|
49
49
|
- `--force`
|
|
50
50
|
- `--verbose`
|
|
51
51
|
|
|
52
|
-
This branch intentionally targets Prisma
|
|
52
|
+
This branch intentionally targets Prisma 8 only. It does not generate a Prisma 7 compatibility path.
|
|
53
53
|
|
|
54
54
|
## Development
|
|
55
55
|
|
package/dist/cli.mjs
CHANGED
|
@@ -40,7 +40,7 @@ async function getAnonymousId() {
|
|
|
40
40
|
}
|
|
41
41
|
function getCommonProperties() {
|
|
42
42
|
return {
|
|
43
|
-
"cli-version": "0.4.2-pr.53.
|
|
43
|
+
"cli-version": "0.4.2-pr.53.194.1",
|
|
44
44
|
"node-version": process.version,
|
|
45
45
|
platform: process.platform,
|
|
46
46
|
arch: process.arch
|
|
@@ -166,7 +166,7 @@ const CommonCommandOptionsSchema = z.object({
|
|
|
166
166
|
verbose: z.boolean().optional().describe("Show verbose command output during setup")
|
|
167
167
|
});
|
|
168
168
|
const PrismaSetupOptionsSchema = z.object({
|
|
169
|
-
provider: DatabaseProviderSchema.optional().describe("Prisma
|
|
169
|
+
provider: DatabaseProviderSchema.optional().describe("Prisma 8 database target: PostgreSQL relational models or MongoDB document models"),
|
|
170
170
|
authoring: AuthoringStyleSchema.optional().describe("Contract authoring style"),
|
|
171
171
|
packageManager: PackageManagerSchema.optional().describe("Package manager used for dependency installation"),
|
|
172
172
|
deploy: z.boolean().optional().describe("Deploy the generated app to Prisma immediately")
|
|
@@ -801,7 +801,7 @@ async function promptForPackageManager(detected) {
|
|
|
801
801
|
async function promptForDeployment() {
|
|
802
802
|
const shouldDeploy = await confirm({
|
|
803
803
|
message: "Deploy to Prisma now?",
|
|
804
|
-
initialValue:
|
|
804
|
+
initialValue: true
|
|
805
805
|
});
|
|
806
806
|
if (isCancel(shouldDeploy)) {
|
|
807
807
|
cancel("Operation cancelled.");
|
|
@@ -928,9 +928,9 @@ async function executePrismaSetupContext(context, options = {}) {
|
|
|
928
928
|
const projectName = options.projectName ?? path.basename(projectDir);
|
|
929
929
|
const template = options.template ?? "minimal";
|
|
930
930
|
const progress = context.verbose ? void 0 : options.progressSpinner ?? spinner();
|
|
931
|
-
if (progress !== void 0 && !options.progressSpinner) progress.start("Creating Prisma
|
|
931
|
+
if (progress !== void 0 && !options.progressSpinner) progress.start("Creating Prisma 8 project...");
|
|
932
932
|
try {
|
|
933
|
-
progress?.message("Preparing Prisma
|
|
933
|
+
progress?.message("Preparing Prisma 8 project files...");
|
|
934
934
|
await runPrismaInit(context, projectDir);
|
|
935
935
|
await scaffoldCreateSharedTemplates({
|
|
936
936
|
projectDir,
|
|
@@ -945,11 +945,11 @@ async function executePrismaSetupContext(context, options = {}) {
|
|
|
945
945
|
if (context.databaseProvider === "mongo") await ensureMongoEnvironment(projectDir);
|
|
946
946
|
progress?.message(`Installing dependencies with ${getInstallCommand(context.packageManager)}...`);
|
|
947
947
|
await installProjectDependencies(context.packageManager, projectDir, { verbose: context.verbose });
|
|
948
|
-
progress?.message("Generating Prisma
|
|
948
|
+
progress?.message("Generating Prisma 8 contract artifacts...");
|
|
949
949
|
await emitContract(context, projectDir);
|
|
950
|
-
progress?.stop("Prisma
|
|
950
|
+
progress?.stop("Prisma 8 project ready.");
|
|
951
951
|
} catch (error) {
|
|
952
|
-
progress?.stop("Could not create Prisma
|
|
952
|
+
progress?.stop("Could not create Prisma 8 project.");
|
|
953
953
|
cancel(getCommandErrorMessage(error));
|
|
954
954
|
return false;
|
|
955
955
|
}
|
|
@@ -962,13 +962,13 @@ async function executePrismaSetupContext(context, options = {}) {
|
|
|
962
962
|
}
|
|
963
963
|
if (options.createdProjectPath) note(path.resolve(options.createdProjectPath), "Project path");
|
|
964
964
|
note(formatNextSteps(buildNextSteps(context, options)), "Next steps");
|
|
965
|
-
outro(context.shouldDeploy ? "Prisma
|
|
965
|
+
outro(context.shouldDeploy ? "Prisma 8 app deployed." : "Prisma 8 setup complete.");
|
|
966
966
|
return true;
|
|
967
967
|
}
|
|
968
968
|
|
|
969
969
|
//#endregion
|
|
970
970
|
//#region src/ui/branding.ts
|
|
971
|
-
const prismaTitle = `${styleText(["bold", "cyanBright"], "◭")} ${styleText(["bold", "cyanBright"], "Create")} ${styleText(["bold", "magentaBright"], "Prisma")} ${styleText(["bold", "blueBright"], "
|
|
971
|
+
const prismaTitle = `${styleText(["bold", "cyanBright"], "◭")} ${styleText(["bold", "cyanBright"], "Create")} ${styleText(["bold", "magentaBright"], "Prisma")} ${styleText(["bold", "blueBright"], "8")}`;
|
|
972
972
|
function getCreatePrismaIntro() {
|
|
973
973
|
return prismaTitle;
|
|
974
974
|
}
|
|
@@ -1041,7 +1041,7 @@ async function promptForCreateTemplate() {
|
|
|
1041
1041
|
{
|
|
1042
1042
|
value: "minimal",
|
|
1043
1043
|
label: "Minimal",
|
|
1044
|
-
hint: "Script-first Prisma
|
|
1044
|
+
hint: "Script-first Prisma 8 starter with no web framework"
|
|
1045
1045
|
},
|
|
1046
1046
|
{
|
|
1047
1047
|
value: "hono",
|
|
@@ -1191,7 +1191,7 @@ async function collectCreateContext(input) {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
async function executeCreateContext(context) {
|
|
1193
1193
|
const createSpinner = context.prismaSetupContext.verbose ? void 0 : spinner();
|
|
1194
|
-
createSpinner?.start("Creating Prisma
|
|
1194
|
+
createSpinner?.start("Creating Prisma 8 project...");
|
|
1195
1195
|
try {
|
|
1196
1196
|
if (context.prismaSetupContext.verbose) log.step(`Scaffolding ${context.template} starter.`);
|
|
1197
1197
|
await scaffoldCreateFrameworkTemplate({
|
|
@@ -1204,7 +1204,7 @@ async function executeCreateContext(context) {
|
|
|
1204
1204
|
});
|
|
1205
1205
|
if (context.prismaSetupContext.verbose) log.success("Starter files scaffolded.");
|
|
1206
1206
|
} catch (error) {
|
|
1207
|
-
createSpinner?.stop("Could not create Prisma
|
|
1207
|
+
createSpinner?.stop("Could not create Prisma 8 project.");
|
|
1208
1208
|
return {
|
|
1209
1209
|
ok: false,
|
|
1210
1210
|
stage: "scaffold_template",
|
|
@@ -1218,7 +1218,7 @@ async function executeCreateContext(context) {
|
|
|
1218
1218
|
projectDir: context.targetDirectory
|
|
1219
1219
|
});
|
|
1220
1220
|
} catch (error) {
|
|
1221
|
-
createSpinner?.stop("Could not create Prisma
|
|
1221
|
+
createSpinner?.stop("Could not create Prisma 8 project.");
|
|
1222
1222
|
return {
|
|
1223
1223
|
ok: false,
|
|
1224
1224
|
stage: "scaffold_template",
|
|
@@ -1244,7 +1244,7 @@ async function executeCreateContext(context) {
|
|
|
1244
1244
|
stage: "prisma_setup"
|
|
1245
1245
|
};
|
|
1246
1246
|
} catch (error) {
|
|
1247
|
-
createSpinner?.stop("Could not create Prisma
|
|
1247
|
+
createSpinner?.stop("Could not create Prisma 8 project.");
|
|
1248
1248
|
return {
|
|
1249
1249
|
ok: false,
|
|
1250
1250
|
stage: "prisma_setup",
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as PackageManagerSchema, r as CreateCommandInputSchema, t as runCreateCommand } from "./create-
|
|
2
|
+
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as PackageManagerSchema, r as CreateCommandInputSchema, t as runCreateCommand } from "./create-BlE_5uZk.mjs";
|
|
3
3
|
import { os } from "@orpc/server";
|
|
4
4
|
import { createCli } from "trpc-cli";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/index.ts
|
|
8
|
-
const CLI_VERSION = "0.4.2-pr.53.
|
|
8
|
+
const CLI_VERSION = "0.4.2-pr.53.194.1";
|
|
9
9
|
const CreateCliInputSchema = z.tuple([z.string().trim().min(1, "Please enter a valid project name").optional().describe("Project name / directory"), CreateCommandInputSchema]);
|
|
10
10
|
function normalizeCreateCliInput(input) {
|
|
11
11
|
const [projectName, options] = input;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-prisma",
|
|
3
|
-
"version": "0.4.2-pr.53.
|
|
3
|
+
"version": "0.4.2-pr.53.194.1",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "Create Prisma
|
|
5
|
+
"description": "Create Prisma 8 projects with first-party templates and great DX.",
|
|
6
6
|
"homepage": "https://github.com/prisma/create-prisma",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/prisma/create-prisma/issues"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{projectName}}
|
|
2
2
|
|
|
3
|
-
A minimal {{template}} app with Prisma
|
|
3
|
+
A minimal {{template}} app with Prisma 8 and Prisma Composer.
|
|
4
4
|
|
|
5
5
|
## Run locally
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ MongoDB is not provisioned by Composer. Set `MONGODB_URL` before running Compose
|
|
|
25
25
|
## Prisma
|
|
26
26
|
|
|
27
27
|
- Contract: `src/prisma/contract{{#if (eq authoring "typescript")}}.ts{{else}}.prisma{{/if}}`
|
|
28
|
-
- Prisma
|
|
28
|
+
- Prisma 8 config: `prisma-next.config.ts`
|
|
29
29
|
- Universal CLI config: `prisma.config.ts`
|
|
30
30
|
- Composer app: `module.ts` and `service.ts`
|
|
31
31
|
|
|
@@ -22,11 +22,11 @@ const users = await listUsers(10).catch(() => undefined);
|
|
|
22
22
|
<body>
|
|
23
23
|
<main class="shell">
|
|
24
24
|
<div class="hero">
|
|
25
|
-
<p class="eyebrow">Astro + Prisma
|
|
25
|
+
<p class="eyebrow">Astro + Prisma 8</p>
|
|
26
26
|
|
|
27
27
|
<h1>Users from your database, loaded on the server.</h1>
|
|
28
28
|
<p class="lede">
|
|
29
|
-
This page reads from <code>src/pages/index.astro</code> using the Prisma
|
|
29
|
+
This page reads from <code>src/pages/index.astro</code> using the Prisma 8 helper in
|
|
30
30
|
<code>src/prisma/users.ts</code>. An Astro API route is also scaffolded in
|
|
31
31
|
<code>src/pages/api/users.ts</code>.
|
|
32
32
|
</p>
|
|
@@ -12,11 +12,11 @@ export default async function Home() {
|
|
|
12
12
|
return (
|
|
13
13
|
<main className="shell">
|
|
14
14
|
<div className="hero">
|
|
15
|
-
<p className="eyebrow">Next.js + Prisma
|
|
15
|
+
<p className="eyebrow">Next.js + Prisma 8</p>
|
|
16
16
|
|
|
17
17
|
<h1>Users from your database, loaded on the server.</h1>
|
|
18
18
|
<p className="lede">
|
|
19
|
-
This page reads from <code>src/app/page.tsx</code> using the Prisma
|
|
19
|
+
This page reads from <code>src/app/page.tsx</code> using the Prisma 8 helper in{" "}
|
|
20
20
|
<code>src/prisma/users.ts</code>.
|
|
21
21
|
</p>
|
|
22
22
|
</div>
|
|
@@ -32,12 +32,12 @@ function formatCreatedAt(value: string): string {
|
|
|
32
32
|
<template>
|
|
33
33
|
<main class="shell">
|
|
34
34
|
<div class="hero">
|
|
35
|
-
<p class="eyebrow">Nuxt + Prisma
|
|
35
|
+
<p class="eyebrow">Nuxt + Prisma 8</p>
|
|
36
36
|
|
|
37
37
|
<h1>Users from your database, loaded through Nitro.</h1>
|
|
38
38
|
<p class="lede">
|
|
39
39
|
This page fetches <code>/api/users</code> from <code>server/api/users.get.ts</code> using
|
|
40
|
-
the Prisma
|
|
40
|
+
the Prisma 8 helper in <code>src/prisma/users.ts</code>.
|
|
41
41
|
</p>
|
|
42
42
|
</div>
|
|
43
43
|
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
<section class="shell">
|
|
19
19
|
<div class="hero">
|
|
20
|
-
<p class="eyebrow">SvelteKit + Prisma
|
|
20
|
+
<p class="eyebrow">SvelteKit + Prisma 8</p>
|
|
21
21
|
<h1>Users from your database, loaded on the server.</h1>
|
|
22
22
|
<p class="lede">
|
|
23
|
-
This page reads from <code>+page.server.ts</code> using the Prisma
|
|
23
|
+
This page reads from <code>+page.server.ts</code> using the Prisma 8 helper in
|
|
24
24
|
<code>src/prisma/users.ts</code>.
|
|
25
25
|
</p>
|
|
26
26
|
</div>
|
|
@@ -18,7 +18,7 @@ export const Route = createRootRoute({
|
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
name: "description",
|
|
21
|
-
content: "TanStack Start + Prisma
|
|
21
|
+
content: "TanStack Start + Prisma 8 starter generated by create-prisma.",
|
|
22
22
|
},
|
|
23
23
|
],
|
|
24
24
|
links: [
|
|
@@ -42,7 +42,7 @@ function RootDocument({ children }: { children: ReactNode }) {
|
|
|
42
42
|
<header className="topbar">
|
|
43
43
|
<div>
|
|
44
44
|
<p className="eyebrow">create-prisma</p>
|
|
45
|
-
<h1>TanStack Start + Prisma
|
|
45
|
+
<h1>TanStack Start + Prisma 8</h1>
|
|
46
46
|
</div>
|
|
47
47
|
|
|
48
48
|
<nav className="nav">
|
|
@@ -33,11 +33,11 @@ function Home() {
|
|
|
33
33
|
return (
|
|
34
34
|
<main className="shell">
|
|
35
35
|
<div className="hero">
|
|
36
|
-
<p className="eyebrow">TanStack Start + Prisma
|
|
36
|
+
<p className="eyebrow">TanStack Start + Prisma 8</p>
|
|
37
37
|
|
|
38
38
|
<h1>Users from your database, loaded through a server function.</h1>
|
|
39
39
|
<p className="lede">
|
|
40
|
-
This route uses TanStack Start's server function API and the Prisma
|
|
40
|
+
This route uses TanStack Start's server function API and the Prisma 8 helper in{" "}
|
|
41
41
|
<code>src/prisma/users.ts</code>.
|
|
42
42
|
</p>
|
|
43
43
|
</div>
|