create-prisma 0.4.2-next.37.88.1 → 0.4.2-next.37.90.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.
Files changed (36) hide show
  1. package/README.md +0 -1
  2. package/dist/cli.mjs +1 -1
  3. package/dist/{create-W3plkOl1.mjs → create-DMLjT4OB.mjs} +57 -57
  4. package/dist/index.d.mts +1 -13
  5. package/dist/index.mjs +3 -3
  6. package/package.json +1 -1
  7. package/templates/create/_shared/prisma/seed.ts.hbs +1 -4
  8. package/templates/create/astro/README.md.hbs +2 -7
  9. package/templates/create/astro/src/lib/prisma.ts.hbs +4 -8
  10. package/templates/create/astro/src/pages/api/users.ts.hbs +1 -10
  11. package/templates/create/astro/src/pages/index.astro.hbs +3 -38
  12. package/templates/create/elysia/README.md.hbs +3 -5
  13. package/templates/create/elysia/src/index.ts.hbs +3 -4
  14. package/templates/create/elysia/src/lib/prisma.ts.hbs +4 -8
  15. package/templates/create/hono/README.md.hbs +3 -5
  16. package/templates/create/hono/src/index.ts.hbs +1 -4
  17. package/templates/create/hono/src/lib/prisma.ts.hbs +4 -8
  18. package/templates/create/nest/README.md.hbs +3 -5
  19. package/templates/create/nest/src/app.module.ts.hbs +5 -6
  20. package/templates/create/nest/src/lib/prisma.ts.hbs +4 -8
  21. package/templates/create/nest/src/users.controller.ts.hbs +1 -2
  22. package/templates/create/nest/src/users.service.ts.hbs +1 -2
  23. package/templates/create/next/README.md.hbs +3 -5
  24. package/templates/create/next/src/app/page.tsx.hbs +2 -38
  25. package/templates/create/next/src/lib/prisma.ts.hbs +4 -8
  26. package/templates/create/nuxt/README.md.hbs +3 -5
  27. package/templates/create/nuxt/app/pages/index.vue.hbs +2 -38
  28. package/templates/create/nuxt/server/api/users.get.ts.hbs +1 -6
  29. package/templates/create/nuxt/server/utils/prisma.ts.hbs +4 -8
  30. package/templates/create/svelte/README.md.hbs +2 -7
  31. package/templates/create/svelte/src/lib/server/prisma.ts.hbs +4 -8
  32. package/templates/create/svelte/src/routes/+page.server.ts.hbs +1 -6
  33. package/templates/create/svelte/src/routes/+page.svelte.hbs +0 -154
  34. package/templates/create/tanstack-start/README.md.hbs +3 -5
  35. package/templates/create/tanstack-start/src/lib/prisma.server.ts.hbs +4 -8
  36. package/templates/create/tanstack-start/src/routes/index.tsx.hbs +5 -45
package/README.md CHANGED
@@ -118,7 +118,6 @@ create-prisma --name my-app --template nest --provider postgres --prisma-postgre
118
118
  - `--provider postgres|postgresql|mongo|mongodb` (default: `postgres`)
119
119
  - `--authoring psl|typescript` (default: `psl`)
120
120
  - `--package-manager` choose the package manager/runtime
121
- - `--schema-preset empty|basic` (default: `basic`)
122
121
  - `--database-url` set `DATABASE_URL`
123
122
  - `--yes` accept defaults and skip prompts
124
123
  - `--no-install` scaffold only
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./create-W3plkOl1.mjs";
2
+ import "./create-DMLjT4OB.mjs";
3
3
  import { createCreatePrismaCli } from "./index.mjs";
4
4
 
5
5
  //#region src/cli.ts
@@ -49,7 +49,7 @@ async function getAnonymousId() {
49
49
  }
50
50
  function getCommonProperties() {
51
51
  return {
52
- "cli-version": "0.4.2-next.37.88.1",
52
+ "cli-version": "0.4.2-next.37.90.1",
53
53
  "node-version": process.version,
54
54
  platform: process.platform,
55
55
  arch: process.arch
@@ -104,7 +104,6 @@ function getBaseCreateProperties(input, context) {
104
104
  "database-provider": context?.prismaSetupContext.databaseProvider ?? input.provider ?? null,
105
105
  "authoring-style": context?.prismaSetupContext.authoring ?? input.authoring ?? null,
106
106
  "package-manager": context?.prismaSetupContext.packageManager ?? input.packageManager ?? null,
107
- "schema-preset": context?.prismaSetupContext.schemaPreset ?? input.schemaPreset ?? null,
108
107
  "should-install": context?.prismaSetupContext.shouldInstall ?? input.install ?? null,
109
108
  "should-emit": context?.prismaSetupContext.shouldEmit ?? input.emit ?? null,
110
109
  "uses-prisma-postgres": context?.prismaSetupContext.shouldUsePrismaPostgres ?? input.prismaPostgres ?? null,
@@ -216,7 +215,6 @@ const packageManagers = [
216
215
  "bun",
217
216
  "deno"
218
217
  ];
219
- const schemaPresets = ["empty", "basic"];
220
218
  const authoringStyles = ["psl", "typescript"];
221
219
  const createTemplates = [
222
220
  "hono",
@@ -235,7 +233,6 @@ function normalizeDatabaseProvider(value) {
235
233
  }
236
234
  const DatabaseProviderSchema = z.enum(databaseProviderInputs).transform(normalizeDatabaseProvider);
237
235
  const PackageManagerSchema = z.enum(packageManagers);
238
- const SchemaPresetSchema = z.enum(schemaPresets);
239
236
  const AuthoringStyleSchema = z.enum(authoringStyles);
240
237
  const CreateTemplateSchema = z.enum(createTemplates);
241
238
  const DatabaseUrlSchema = z.string().trim().min(1, "Please enter a valid database URL");
@@ -250,8 +247,7 @@ const PrismaSetupOptionsSchema = z.object({
250
247
  prismaPostgres: z.boolean().optional().describe("Provision Prisma Postgres with create-db when target is postgres"),
251
248
  databaseUrl: DatabaseUrlSchema.optional().describe("DATABASE_URL value"),
252
249
  install: z.boolean().optional().describe("Install dependencies with selected package manager"),
253
- emit: z.boolean().optional().describe("Emit Prisma Next contract artifacts after scaffolding"),
254
- schemaPreset: SchemaPresetSchema.optional().describe("Schema preset to scaffold in prisma/contract.prisma or prisma/contract.ts")
250
+ emit: z.boolean().optional().describe("Emit Prisma Next contract artifacts after scaffolding")
255
251
  });
256
252
  const PrismaSetupCommandInputSchema = CommonCommandOptionsSchema.extend(PrismaSetupOptionsSchema.shape);
257
253
  const CreateScaffoldOptionsSchema = z.object({
@@ -571,21 +567,20 @@ function getCreateTemplateDir(template) {
571
567
  function getCreateSharedTemplateDir() {
572
568
  return resolveTemplatesDir("templates/create/_shared");
573
569
  }
574
- function createTemplateContext(projectName, template, provider, authoring, schemaPreset, packageManager) {
570
+ function createTemplateContext(projectName, template, provider, authoring, packageManager) {
575
571
  return {
576
572
  projectName,
577
573
  template,
578
574
  provider,
579
575
  authoring,
580
- schemaPreset,
581
576
  packageManager
582
577
  };
583
578
  }
584
579
  async function scaffoldCreateTemplate(opts) {
585
- const { projectDir, projectName, template, provider, authoring, schemaPreset, packageManager } = opts;
580
+ const { projectDir, projectName, template, provider, authoring, packageManager } = opts;
586
581
  const templateRoot = getCreateTemplateDir(template);
587
582
  const sharedTemplateRoot = getCreateSharedTemplateDir();
588
- const context = createTemplateContext(projectName, template, provider, authoring, schemaPreset, packageManager);
583
+ const context = createTemplateContext(projectName, template, provider, authoring, packageManager);
589
584
  await renderTemplateTree({
590
585
  templateRoot: sharedTemplateRoot,
591
586
  outputDir: projectDir,
@@ -834,11 +829,11 @@ function getCreateDbCommand(packageManager) {
834
829
  //#region src/tasks/setup-prisma.ts
835
830
  const DEFAULT_DATABASE_PROVIDER = "postgres";
836
831
  const DEFAULT_AUTHORING = "psl";
837
- const DEFAULT_SCHEMA_PRESET$1 = "basic";
838
832
  const DEFAULT_INSTALL = true;
839
833
  const DEFAULT_EMIT = true;
840
834
  const DEFAULT_INTERACTIVE_PRISMA_POSTGRES = true;
841
835
  const DEFAULT_AUTOMATED_PRISMA_POSTGRES = false;
836
+ const CLAUDE_SKILLS_DIR = ".claude/skills";
842
837
  const MONGO_DOCKER_COMPOSE = `services:
843
838
  mongodb:
844
839
  image: mongo:latest
@@ -878,31 +873,6 @@ const requiredPrismaFileGroups = [
878
873
  function getContractPath(authoring) {
879
874
  return `prisma/contract${authoring === "typescript" ? ".ts" : ".prisma"}`;
880
875
  }
881
- function getEmptyContractContent(provider, authoring) {
882
- if (authoring === "psl") return "// use prisma-next\n";
883
- if (provider === "mongo") return `import { defineContract } from "@prisma-next/mongo/contract-builder";
884
- import mongoFamily from "@prisma-next/mongo/family";
885
- import mongoTarget from "@prisma-next/mongo/target";
886
-
887
- export const contract = defineContract(
888
- { family: mongoFamily, target: mongoTarget },
889
- () => ({
890
- models: {},
891
- }),
892
- );
893
- `;
894
- return `import { defineContract } from "@prisma-next/postgres/contract-builder";
895
- import sqlFamily from "@prisma-next/postgres/family";
896
- import postgresTarget from "@prisma-next/postgres/target";
897
-
898
- export const contract = defineContract(
899
- { family: sqlFamily, target: postgresTarget },
900
- () => ({
901
- models: {},
902
- }),
903
- );
904
- `;
905
- }
906
876
  async function promptForDatabaseProvider() {
907
877
  const databaseProvider = await select({
908
878
  message: "Select your database",
@@ -1044,7 +1014,6 @@ async function collectPrismaSetupContext(input, options = {}) {
1044
1014
  }
1045
1015
  const authoring = input.authoring ?? (useDefaults ? DEFAULT_AUTHORING : await promptForAuthoringStyle());
1046
1016
  if (!authoring) return;
1047
- const schemaPreset = input.schemaPreset ?? options.defaultSchemaPreset ?? DEFAULT_SCHEMA_PRESET$1;
1048
1017
  const detectedPackageManager = await detectPackageManager(projectDir);
1049
1018
  const packageManager = input.packageManager ?? (useDefaults ? detectedPackageManager : await promptForPackageManager(detectedPackageManager));
1050
1019
  if (!packageManager) return;
@@ -1056,7 +1025,6 @@ async function collectPrismaSetupContext(input, options = {}) {
1056
1025
  shouldEmit,
1057
1026
  databaseProvider,
1058
1027
  authoring,
1059
- schemaPreset,
1060
1028
  databaseUrl,
1061
1029
  shouldUsePrismaPostgres,
1062
1030
  packageManager,
@@ -1276,7 +1244,6 @@ async function runPrismaNextInitForContext(context, projectDir) {
1276
1244
  CI: "1"
1277
1245
  }
1278
1246
  });
1279
- if (context.schemaPreset === "empty") await fs.writeFile(path.join(projectDir, getContractPath(context.authoring)), getEmptyContractContent(context.databaseProvider, context.authoring), "utf8");
1280
1247
  if (context.verbose) log.success("Prisma Next project files ready.");
1281
1248
  return true;
1282
1249
  } catch (error) {
@@ -1328,7 +1295,11 @@ function getSkillsSyncCliArgs(packageManager) {
1328
1295
  ]);
1329
1296
  }
1330
1297
  async function syncAgentSkillsForContext(context, projectDir) {
1331
- if (!context.shouldInstall) return { didSyncAgentSkills: false };
1298
+ if (!context.shouldInstall) return {
1299
+ didSyncAgentSkills: false,
1300
+ didSyncClaudeSkills: false
1301
+ };
1302
+ const claudeDirectory = await prepareClaudeSkillsDirectory(projectDir);
1332
1303
  const syncCommand = getSkillsSyncCliCommand(context.packageManager);
1333
1304
  if (context.verbose) log.step(`Running ${syncCommand}`);
1334
1305
  try {
@@ -1342,15 +1313,40 @@ async function syncAgentSkillsForContext(context, projectDir) {
1342
1313
  }
1343
1314
  });
1344
1315
  if (context.verbose) log.success("Prisma Next agent skills synced.");
1345
- return { didSyncAgentSkills: true };
1316
+ return {
1317
+ didSyncAgentSkills: true,
1318
+ didSyncClaudeSkills: claudeDirectory.warning === void 0,
1319
+ warning: claudeDirectory.warning
1320
+ };
1346
1321
  } catch (error) {
1347
1322
  if (context.verbose) log.warn("Could not sync Prisma Next agent skills.");
1323
+ if (claudeDirectory.didCreateClaudeRoot) await removeEmptyClaudeSkillsDirectory(projectDir);
1348
1324
  return {
1349
1325
  didSyncAgentSkills: false,
1350
- warning: `Agent skill sync failed: ${getCommandErrorMessage(error)}`
1326
+ didSyncClaudeSkills: false,
1327
+ warning: [claudeDirectory.warning, `Agent skill sync failed: ${getCommandErrorMessage(error)}`].filter(Boolean).join("\n")
1351
1328
  };
1352
1329
  }
1353
1330
  }
1331
+ async function prepareClaudeSkillsDirectory(projectDir) {
1332
+ const claudeRoot = path.join(projectDir, ".claude");
1333
+ const didCreateClaudeRoot = !await fs.pathExists(claudeRoot);
1334
+ try {
1335
+ await fs.ensureDir(path.join(projectDir, CLAUDE_SKILLS_DIR));
1336
+ return { didCreateClaudeRoot };
1337
+ } catch (error) {
1338
+ return {
1339
+ didCreateClaudeRoot: false,
1340
+ warning: `Could not prepare ${CLAUDE_SKILLS_DIR}: ${getCommandErrorMessage(error)}`
1341
+ };
1342
+ }
1343
+ }
1344
+ async function removeEmptyClaudeSkillsDirectory(projectDir) {
1345
+ const claudeSkillsDir = path.join(projectDir, CLAUDE_SKILLS_DIR);
1346
+ const claudeRoot = path.dirname(claudeSkillsDir);
1347
+ if (await fs.pathExists(claudeSkillsDir) && (await fs.readdir(claudeSkillsDir)).length === 0) await fs.remove(claudeSkillsDir);
1348
+ if (await fs.pathExists(claudeRoot) && (await fs.readdir(claudeRoot)).length === 0) await fs.remove(claudeRoot);
1349
+ }
1354
1350
  async function finalizePrismaFilesForContext(context, projectDir, provisionResult) {
1355
1351
  try {
1356
1352
  await finalizePrismaFiles({
@@ -1423,7 +1419,7 @@ function buildNextStepsForContext(opts) {
1423
1419
  });
1424
1420
  if (!didSyncAgentSkills) nextSteps.push({
1425
1421
  command: getRunScriptCommand(context.packageManager, "skills:sync"),
1426
- description: "Sync the Prisma Next agent skills into .agents/skills."
1422
+ description: "Sync the Prisma Next agent skills from installed packages."
1427
1423
  });
1428
1424
  if (!didEmitContract || !context.shouldEmit) nextSteps.push({
1429
1425
  command: getRunScriptCommand(context.packageManager, "contract:emit"),
@@ -1445,7 +1441,7 @@ function buildNextStepsForContext(opts) {
1445
1441
  command: getRunScriptCommand(context.packageManager, "migration:apply"),
1446
1442
  description: "Apply the planned migration to the database."
1447
1443
  });
1448
- if (context.schemaPreset === "basic") nextSteps.push({
1444
+ nextSteps.push({
1449
1445
  command: getRunScriptCommand(context.packageManager, "db:seed"),
1450
1446
  description: "Insert the sample user and post data from prisma/seed.ts."
1451
1447
  });
@@ -1458,10 +1454,17 @@ function buildNextStepsForContext(opts) {
1458
1454
  function formatNextSteps(nextSteps) {
1459
1455
  return nextSteps.map((step) => `${step.command}\n ${step.description}`).join("\n\n");
1460
1456
  }
1461
- function formatAgentPrompt(didSyncAgentSkills) {
1462
- const prompt = "What can I do with Prisma Next?";
1463
- if (didSyncAgentSkills) return `Ask your agent:\n${prompt}`;
1464
- return `After syncing the Prisma Next skills, ask your agent:\n${prompt}`;
1457
+ function formatAgentPrompt(didSyncAgentSkills, didSyncClaudeSkills) {
1458
+ const promptLines = [
1459
+ "Ask your agent:",
1460
+ "What can I do with Prisma Next?",
1461
+ "",
1462
+ "Learn more:",
1463
+ `Docs: prisma-next.md`,
1464
+ `Skill: ${didSyncAgentSkills ? ".agents/skills/prisma-next/SKILL.md" : ".agents/skills/prisma-next/SKILL.md (after skills sync)"}`
1465
+ ];
1466
+ if (didSyncClaudeSkills) promptLines.push(`Claude: .claude/skills/prisma-next/SKILL.md`);
1467
+ return promptLines.join("\n");
1465
1468
  }
1466
1469
  async function executePrismaSetupContext(context, options = {}) {
1467
1470
  const projectDir = path.resolve(options.projectDir ?? context.projectDir);
@@ -1512,8 +1515,8 @@ async function executePrismaSetupContext(context, options = {}) {
1512
1515
  });
1513
1516
  progressSpinner?.stop("Prisma Next project ready.");
1514
1517
  if (warningLines.length > 0) note(warningLines.map((line) => line.replace(/^- /, "")).join("\n"), "Heads up");
1515
- note(formatAgentPrompt(skillSyncResult.didSyncAgentSkills), "Agent prompt");
1516
- note(formatNextSteps(nextSteps), "Next steps for Prisma Next");
1518
+ note(formatAgentPrompt(skillSyncResult.didSyncAgentSkills, skillSyncResult.didSyncClaudeSkills), "Agent prompt");
1519
+ if (context.verbose) note(formatNextSteps(nextSteps), "Next steps for Prisma Next");
1517
1520
  outro("Prisma Next setup complete.");
1518
1521
  return true;
1519
1522
  }
@@ -1529,7 +1532,6 @@ function getCreatePrismaIntro() {
1529
1532
  //#region src/commands/create.ts
1530
1533
  const DEFAULT_PROJECT_NAME = "my-app";
1531
1534
  const DEFAULT_TEMPLATE = "hono";
1532
- const DEFAULT_SCHEMA_PRESET = "basic";
1533
1535
  function toPackageName(projectName) {
1534
1536
  return projectName.toLowerCase().replace(/[^a-z0-9._-]/g, "-").replace(/^-+/, "").replace(/-+$/, "") || "app";
1535
1537
  }
@@ -1688,10 +1690,7 @@ async function collectCreateContext(input) {
1688
1690
  cancel(`Target directory ${formatPathForDisplay(targetDirectory)} is not empty. Use --force to continue.`);
1689
1691
  return;
1690
1692
  }
1691
- const prismaSetupContext = await collectPrismaSetupContext(input, {
1692
- projectDir: targetDirectory,
1693
- defaultSchemaPreset: DEFAULT_SCHEMA_PRESET
1694
- });
1693
+ const prismaSetupContext = await collectPrismaSetupContext(input, { projectDir: targetDirectory });
1695
1694
  if (!prismaSetupContext) return;
1696
1695
  return {
1697
1696
  targetDirectory,
@@ -1706,15 +1705,16 @@ async function executeCreateContext(context) {
1706
1705
  const createSpinner = context.prismaSetupContext.verbose ? void 0 : spinner();
1707
1706
  createSpinner?.start("Creating Prisma Next project...");
1708
1707
  try {
1708
+ if (context.prismaSetupContext.verbose) log.step(`Scaffolding ${context.template} starter.`);
1709
1709
  await scaffoldCreateTemplate({
1710
1710
  projectDir: context.targetDirectory,
1711
1711
  projectName: context.projectPackageName,
1712
1712
  template: context.template,
1713
- schemaPreset: context.prismaSetupContext.schemaPreset,
1714
1713
  provider: context.prismaSetupContext.databaseProvider,
1715
1714
  authoring: context.prismaSetupContext.authoring,
1716
1715
  packageManager: context.prismaSetupContext.packageManager
1717
1716
  });
1717
+ if (context.prismaSetupContext.verbose) log.success("Starter files scaffolded.");
1718
1718
  } catch (error) {
1719
1719
  createSpinner?.stop("Could not create Prisma Next project.");
1720
1720
  return {
@@ -1764,4 +1764,4 @@ async function executeCreateContext(context) {
1764
1764
  }
1765
1765
 
1766
1766
  //#endregion
1767
- export { DatabaseProviderSchema as a, SchemaPresetSchema as c, CreateTemplateSchema as i, AuthoringStyleSchema as n, DatabaseUrlSchema as o, CreateCommandInputSchema as r, PackageManagerSchema as s, runCreateCommand as t };
1767
+ export { DatabaseProviderSchema as a, CreateTemplateSchema as i, AuthoringStyleSchema as n, DatabaseUrlSchema as o, CreateCommandInputSchema as r, PackageManagerSchema as s, runCreateCommand as t };
package/dist/index.d.mts CHANGED
@@ -190,10 +190,6 @@ declare const PackageManagerSchema: z.ZodEnum<{
190
190
  bun: "bun";
191
191
  deno: "deno";
192
192
  }>;
193
- declare const SchemaPresetSchema: z.ZodEnum<{
194
- empty: "empty";
195
- basic: "basic";
196
- }>;
197
193
  declare const AuthoringStyleSchema: z.ZodEnum<{
198
194
  psl: "psl";
199
195
  typescript: "typescript";
@@ -233,10 +229,6 @@ declare const CreateCommandInputSchema: z.ZodObject<{
233
229
  databaseUrl: z.ZodOptional<z.ZodString>;
234
230
  install: z.ZodOptional<z.ZodBoolean>;
235
231
  emit: z.ZodOptional<z.ZodBoolean>;
236
- schemaPreset: z.ZodOptional<z.ZodEnum<{
237
- empty: "empty";
238
- basic: "basic";
239
- }>>;
240
232
  name: z.ZodOptional<z.ZodString>;
241
233
  template: z.ZodOptional<z.ZodEnum<{
242
234
  hono: "hono";
@@ -278,10 +270,6 @@ declare const router: {
278
270
  databaseUrl: zod.ZodOptional<zod.ZodString>;
279
271
  install: zod.ZodOptional<zod.ZodBoolean>;
280
272
  emit: zod.ZodOptional<zod.ZodBoolean>;
281
- schemaPreset: zod.ZodOptional<zod.ZodEnum<{
282
- empty: "empty";
283
- basic: "basic";
284
- }>>;
285
273
  name: zod.ZodOptional<zod.ZodString>;
286
274
  template: zod.ZodOptional<zod.ZodEnum<{
287
275
  hono: "hono";
@@ -299,4 +287,4 @@ declare const router: {
299
287
  declare function createCreatePrismaCli(): trpc_cli0.TrpcCli;
300
288
  declare function create(input?: CreateCommandInput): Promise<void>;
301
289
  //#endregion
302
- export { AuthoringStyleSchema, type CreateCommandInput, CreateCommandInputSchema, CreateTemplateSchema, DatabaseProviderSchema, DatabaseUrlSchema, PackageManagerSchema, SchemaPresetSchema, create, createCreatePrismaCli, router };
290
+ export { AuthoringStyleSchema, type CreateCommandInput, CreateCommandInputSchema, CreateTemplateSchema, DatabaseProviderSchema, DatabaseUrlSchema, PackageManagerSchema, create, createCreatePrismaCli, router };
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { a as DatabaseProviderSchema, c as SchemaPresetSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as DatabaseUrlSchema, r as CreateCommandInputSchema, s as PackageManagerSchema, t as runCreateCommand } from "./create-W3plkOl1.mjs";
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-DMLjT4OB.mjs";
3
3
  import { os } from "@orpc/server";
4
4
  import { createCli } from "trpc-cli";
5
5
 
6
6
  //#region src/index.ts
7
- const CLI_VERSION = "0.4.2-next.37.88.1";
7
+ const CLI_VERSION = "0.4.2-next.37.90.1";
8
8
  const router = os.router({ create: os.meta({
9
9
  description: "Create a new project with Prisma setup",
10
10
  default: true,
@@ -24,4 +24,4 @@ async function create(input = {}) {
24
24
  }
25
25
 
26
26
  //#endregion
27
- export { AuthoringStyleSchema, CreateCommandInputSchema, CreateTemplateSchema, DatabaseProviderSchema, DatabaseUrlSchema, PackageManagerSchema, SchemaPresetSchema, create, createCreatePrismaCli, router };
27
+ export { AuthoringStyleSchema, CreateCommandInputSchema, CreateTemplateSchema, DatabaseProviderSchema, DatabaseUrlSchema, PackageManagerSchema, create, createCreatePrismaCli, router };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma",
3
- "version": "0.4.2-next.37.88.1",
3
+ "version": "0.4.2-next.37.90.1",
4
4
  "private": false,
5
5
  "description": "Create Prisma Next projects with first-party templates and great DX.",
6
6
  "homepage": "https://github.com/prisma/create-prisma",
@@ -1,4 +1,3 @@
1
- {{#if (eq schemaPreset "basic")}}
2
1
  {{#if (requiresDotenvConfigImport packageManager)}}
3
2
  import "dotenv/config";
4
3
  {{/if}}
@@ -51,6 +50,4 @@ try {
51
50
  await db.runtime().close();
52
51
  }
53
52
  {{/if}}
54
- {{else}}
55
- console.log("No seed data for the empty schema preset.");
56
- {{/if}}
53
+
@@ -32,18 +32,13 @@ Database helper scripts are added to `package.json`:
32
32
  - `{{runScriptCommand packageManager "migration:plan"}}` - create a migration plan
33
33
  - `{{runScriptCommand packageManager "migration:apply"}}` - apply a planned migration
34
34
  {{/if}}
35
- {{#if (eq schemaPreset "basic")}}
35
+
36
36
  - `{{runScriptCommand packageManager "db:seed"}}` - insert sample users manually
37
- {{/if}}
38
37
 
39
- For provider-specific Prisma Next reference docs, see `prisma-next.md`. Agent-specific project guidance is scaffolded in `.agents/skills/prisma-next/SKILL.md`.
38
+ For provider-specific Prisma Next reference docs, see `prisma-next.md`. Agent-specific project guidance starts in `.agents/skills/prisma-next/SKILL.md`; after skills sync, Claude Code also gets `.claude/skills/prisma-next/SKILL.md`.
40
39
  The Astro Vite dev server also auto-emits Prisma Next contract artifacts when the contract changes.
41
40
 
42
41
  Node-based Prisma Next projects expect Node.js 24 LTS or newer.
43
- {{#if (eq schemaPreset "basic")}}
44
42
 
45
43
  The starter page queries a basic `User` model in `src/pages/index.astro`, and `src/pages/api/users.ts` shows an Astro API route backed by the same Prisma Next helper.
46
- {{else}}
47
44
 
48
- The starter page keeps the official Astro minimal structure and points you to your Prisma Next contract for the first model.
49
- {{/if}}
@@ -4,13 +4,13 @@ import mongo from "@prisma-next/mongo/runtime";
4
4
  {{else}}
5
5
  import postgres from "@prisma-next/postgres/runtime";
6
6
  {{/if}}
7
- {{#if (eq schemaPreset "basic")}}
7
+
8
8
  {{#if (eq provider "mongo")}}
9
9
  import type { DefaultModelRow } from "@prisma-next/mongo-orm";
10
10
  {{else}}
11
11
  import type { DefaultModelRow } from "@prisma-next/sql-orm-client";
12
12
  {{/if}}
13
- {{/if}}
13
+
14
14
  import type { Contract } from "../../prisma/contract.d";
15
15
  import contractJson from "../../prisma/contract.json" with { type: "json" };
16
16
 
@@ -26,7 +26,6 @@ export const db = postgres<Contract>({
26
26
  });
27
27
  {{/if}}
28
28
 
29
- {{#if (eq schemaPreset "basic")}}
30
29
  type UserRow = DefaultModelRow<Contract, "User">;
31
30
 
32
31
  {{#if (eq provider "mongo")}}
@@ -48,10 +47,9 @@ function toStarterUser(user: Pick<UserRow, "id" | "email" | "name" | "createdAt"
48
47
  };
49
48
  }
50
49
  {{/if}}
51
- {{/if}}
52
50
 
53
51
  export async function listUsers(limit = 10) {
54
- {{#if (eq schemaPreset "basic")}}
52
+
55
53
  {{#if (eq provider "mongo")}}
56
54
  const users: ReturnType<typeof toStarterUser>[] = [];
57
55
 
@@ -65,9 +63,7 @@ export async function listUsers(limit = 10) {
65
63
 
66
64
  return users.map(toStarterUser);
67
65
  {{/if}}
68
- {{else}}
69
- return [];
70
- {{/if}}
66
+
71
67
  }
72
68
 
73
69
  export type StarterUser = Awaited<ReturnType<typeof listUsers>>[number];
@@ -1,5 +1,5 @@
1
1
  import type { APIRoute } from "astro";
2
- {{#if (eq schemaPreset "basic")}}
2
+
3
3
  import { listUsers } from "../../lib/prisma";
4
4
 
5
5
  export const GET: APIRoute = async () => {
@@ -23,13 +23,4 @@ export const GET: APIRoute = async () => {
23
23
  },
24
24
  });
25
25
  };
26
- {{else}}
27
26
 
28
- export const GET: APIRoute = async () => {
29
- return new Response(JSON.stringify([]), {
30
- headers: {
31
- "Content-Type": "application/json",
32
- },
33
- });
34
- };
35
- {{/if}}
@@ -1,5 +1,5 @@
1
1
  ---
2
- {{#if (eq schemaPreset "basic")}}
2
+
3
3
  import { listUsers } from "../lib/prisma";
4
4
 
5
5
  const formatter = new Intl.DateTimeFormat("en", {
@@ -8,7 +8,7 @@ const formatter = new Intl.DateTimeFormat("en", {
8
8
  });
9
9
 
10
10
  const users = await listUsers(10).catch(() => undefined);
11
- {{/if}}
11
+
12
12
  ---
13
13
 
14
14
  <html lang="en">
@@ -23,7 +23,7 @@ const users = await listUsers(10).catch(() => undefined);
23
23
  <main class="shell">
24
24
  <div class="hero">
25
25
  <p class="eyebrow">Astro + Prisma Next</p>
26
- {{#if (eq schemaPreset "basic")}}
26
+
27
27
  <h1>Users from your database, loaded on the server.</h1>
28
28
  <p class="lede">
29
29
  This page reads from <code>src/pages/index.astro</code> using the Prisma Next helper in
@@ -65,42 +65,7 @@ const users = await listUsers(10).catch(() => undefined);
65
65
  </ul>
66
66
  )}
67
67
  </section>
68
- {{else}}
69
- <h1>Your Astro app is ready.</h1>
70
- <p class="lede">
71
- Edit your Prisma Next contract, run <code>contract:emit</code>, then load your data
72
- in Astro pages or API routes with the helper in <code>src/lib/prisma.ts</code>.
73
- </p>
74
- </div>
75
68
 
76
- <section class="panel">
77
- <div class="panel-header">
78
- <h2>What's included</h2>
79
- <span>Starter kit</span>
80
- </div>
81
-
82
- <ul class="users">
83
- <li>
84
- <div>
85
- <strong>Prisma client</strong>
86
- <p>Use the shared Prisma Next runtime from <code>src/lib/prisma.ts</code>.</p>
87
- </div>
88
- </li>
89
- <li>
90
- <div>
91
- <strong>API route example</strong>
92
- <p>See <code>src/pages/api/users.ts</code> for an Astro server endpoint.</p>
93
- </div>
94
- </li>
95
- <li>
96
- <div>
97
- <strong>Manual database setup</strong>
98
- <p>Run the schema setup commands when you are ready.</p>
99
- </div>
100
- </li>
101
- </ul>
102
- </section>
103
- {{/if}}
104
69
  </main>
105
70
  </body>
106
71
  </html>
@@ -30,14 +30,12 @@ Database helper scripts are added to `package.json`:
30
30
  - `{{runScriptCommand packageManager "migration:plan"}}` - create a migration plan
31
31
  - `{{runScriptCommand packageManager "migration:apply"}}` - apply a planned migration
32
32
  {{/if}}
33
- {{#if (eq schemaPreset "basic")}}
33
+
34
34
  - `{{runScriptCommand packageManager "db:seed"}}` - insert sample users manually
35
- {{/if}}
36
35
 
37
- For provider-specific Prisma Next reference docs, see `prisma-next.md`. Agent-specific project guidance is scaffolded in `.agents/skills/prisma-next/SKILL.md`.
36
+ For provider-specific Prisma Next reference docs, see `prisma-next.md`. Agent-specific project guidance starts in `.agents/skills/prisma-next/SKILL.md`; after skills sync, Claude Code also gets `.claude/skills/prisma-next/SKILL.md`.
38
37
 
39
38
  Node-based Prisma Next projects expect Node.js 24 LTS or newer.
40
- {{#if (eq schemaPreset "basic")}}
41
39
 
42
40
  The template includes a basic `User` model and a sample `GET /users` endpoint.
43
- {{/if}}
41
+
@@ -6,9 +6,8 @@ import "dotenv/config";
6
6
  import { node } from "@elysiajs/node";
7
7
  {{/if}}
8
8
  import { Elysia } from "elysia";
9
- {{#if (eq schemaPreset "basic")}}
9
+
10
10
  import { listUsers } from "./lib/prisma{{#if (eq packageManager "deno")}}.ts{{/if}}";
11
- {{/if}}
12
11
 
13
12
  const rawPort = ({{#if (eq packageManager "deno")}}Deno.env.get("PORT"){{else}}process.env.PORT{{/if}} ?? "").trim();
14
13
  const parsedPort = rawPort.length > 0 ? Number(rawPort) : Number.NaN;
@@ -21,7 +20,7 @@ const app = new Elysia({{#if (eq packageManager "deno")}}{{else}}{ adapter: node
21
20
  message: "hello from create-prisma + elysia",
22
21
  };
23
22
  })
24
- {{#if (eq schemaPreset "basic")}}
23
+
25
24
  .get("/users", async ({ set }) => {
26
25
  const users = await listUsers(10).catch((error) => {
27
26
  console.error("Failed to query users:", error);
@@ -35,7 +34,7 @@ const app = new Elysia({{#if (eq packageManager "deno")}}{{else}}{ adapter: node
35
34
 
36
35
  return users;
37
36
  })
38
- {{/if}}
37
+
39
38
  {{#if (eq packageManager "deno")}}
40
39
  ;
41
40
 
@@ -4,13 +4,13 @@ import mongo from "@prisma-next/mongo/runtime";
4
4
  {{else}}
5
5
  import postgres from "@prisma-next/postgres/runtime";
6
6
  {{/if}}
7
- {{#if (eq schemaPreset "basic")}}
7
+
8
8
  {{#if (eq provider "mongo")}}
9
9
  import type { DefaultModelRow } from "@prisma-next/mongo-orm";
10
10
  {{else}}
11
11
  import type { DefaultModelRow } from "@prisma-next/sql-orm-client";
12
12
  {{/if}}
13
- {{/if}}
13
+
14
14
  import type { Contract } from "../../prisma/contract.d";
15
15
  import contractJson from "../../prisma/contract.json" with { type: "json" };
16
16
 
@@ -26,7 +26,6 @@ export const db = postgres<Contract>({
26
26
  });
27
27
  {{/if}}
28
28
 
29
- {{#if (eq schemaPreset "basic")}}
30
29
  type UserRow = DefaultModelRow<Contract, "User">;
31
30
 
32
31
  {{#if (eq provider "mongo")}}
@@ -48,10 +47,9 @@ function toStarterUser(user: Pick<UserRow, "id" | "email" | "name" | "createdAt"
48
47
  };
49
48
  }
50
49
  {{/if}}
51
- {{/if}}
52
50
 
53
51
  export async function listUsers(limit = 10) {
54
- {{#if (eq schemaPreset "basic")}}
52
+
55
53
  {{#if (eq provider "mongo")}}
56
54
  const users: ReturnType<typeof toStarterUser>[] = [];
57
55
 
@@ -65,9 +63,7 @@ export async function listUsers(limit = 10) {
65
63
 
66
64
  return users.map(toStarterUser);
67
65
  {{/if}}
68
- {{else}}
69
- return [];
70
- {{/if}}
66
+
71
67
  }
72
68
 
73
69
  export type StarterUser = Awaited<ReturnType<typeof listUsers>>[number];
@@ -30,14 +30,12 @@ Database helper scripts are added to `package.json`:
30
30
  - `{{runScriptCommand packageManager "migration:plan"}}` - create a migration plan
31
31
  - `{{runScriptCommand packageManager "migration:apply"}}` - apply a planned migration
32
32
  {{/if}}
33
- {{#if (eq schemaPreset "basic")}}
33
+
34
34
  - `{{runScriptCommand packageManager "db:seed"}}` - insert sample users manually
35
- {{/if}}
36
35
 
37
- For provider-specific Prisma Next reference docs, see `prisma-next.md`. Agent-specific project guidance is scaffolded in `.agents/skills/prisma-next/SKILL.md`.
36
+ For provider-specific Prisma Next reference docs, see `prisma-next.md`. Agent-specific project guidance starts in `.agents/skills/prisma-next/SKILL.md`; after skills sync, Claude Code also gets `.claude/skills/prisma-next/SKILL.md`.
38
37
 
39
38
  Node-based Prisma Next projects expect Node.js 24 LTS or newer.
40
- {{#if (eq schemaPreset "basic")}}
41
39
 
42
40
  The template includes a basic `User` model and a sample `GET /users` endpoint.
43
- {{/if}}
41
+