create-prisma 0.4.2-next.37.79.1 → 0.4.2-next.37.81.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/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./create-Btn7yJR3.mjs";
2
+ import "./create-C-bVmrxB.mjs";
3
3
  import { createCreatePrismaCli } from "./index.mjs";
4
4
 
5
5
  //#region src/cli.ts
@@ -40,7 +40,7 @@ async function getAnonymousId() {
40
40
  }
41
41
  function getCommonProperties() {
42
42
  return {
43
- "cli-version": "0.4.2-next.37.79.1",
43
+ "cli-version": "0.4.2-next.37.81.1",
44
44
  "node-version": process.version,
45
45
  platform: process.platform,
46
46
  arch: process.arch
@@ -819,6 +819,8 @@ const DEFAULT_AUTHORING = "psl";
819
819
  const DEFAULT_SCHEMA_PRESET$1 = "basic";
820
820
  const DEFAULT_INSTALL = true;
821
821
  const DEFAULT_EMIT = true;
822
+ const DEFAULT_INTERACTIVE_PRISMA_POSTGRES = true;
823
+ const DEFAULT_AUTOMATED_PRISMA_POSTGRES = false;
822
824
  const MONGO_DOCKER_COMPOSE = `services:
823
825
  mongodb:
824
826
  image: mongo:latest
@@ -906,6 +908,19 @@ async function promptForAuthoringStyle() {
906
908
  }
907
909
  return AuthoringStyleSchema.parse(authoring);
908
910
  }
911
+ async function promptForPrismaPostgres() {
912
+ const shouldUsePrismaPostgres = await confirm({
913
+ message: "Provision a Prisma Postgres database?",
914
+ active: "Provision Prisma Postgres",
915
+ inactive: "Use my own database",
916
+ initialValue: DEFAULT_INTERACTIVE_PRISMA_POSTGRES
917
+ });
918
+ if (isCancel(shouldUsePrismaPostgres)) {
919
+ cancel("Operation cancelled.");
920
+ return;
921
+ }
922
+ return Boolean(shouldUsePrismaPostgres);
923
+ }
909
924
  function getPackageManagerHint(option, detected) {
910
925
  const hint = {
911
926
  npm: "Node.js default",
@@ -981,11 +996,9 @@ async function collectPrismaSetupContext(input, options = {}) {
981
996
  const shouldEmit = input.emit ?? DEFAULT_EMIT;
982
997
  const databaseProvider = input.provider ?? (useDefaults ? DEFAULT_DATABASE_PROVIDER : await promptForDatabaseProvider());
983
998
  if (!databaseProvider) return;
984
- const authoring = input.authoring ?? (useDefaults ? DEFAULT_AUTHORING : await promptForAuthoringStyle());
985
- if (!authoring) return;
986
- const schemaPreset = input.schemaPreset ?? options.defaultSchemaPreset ?? DEFAULT_SCHEMA_PRESET$1;
987
999
  const databaseUrl = input.databaseUrl;
988
- const shouldUsePrismaPostgres = input.prismaPostgres === true;
1000
+ const shouldUsePrismaPostgres = input.prismaPostgres ?? (databaseProvider === "postgres" && !databaseUrl && !useDefaults ? await promptForPrismaPostgres() : DEFAULT_AUTOMATED_PRISMA_POSTGRES);
1001
+ if (shouldUsePrismaPostgres === void 0) return;
989
1002
  if (shouldUsePrismaPostgres && databaseProvider !== "postgres") {
990
1003
  cancel("--prisma-postgres is only supported with --provider postgres.");
991
1004
  return;
@@ -994,6 +1007,9 @@ async function collectPrismaSetupContext(input, options = {}) {
994
1007
  cancel("Use either --database-url or --prisma-postgres, not both.");
995
1008
  return;
996
1009
  }
1010
+ const authoring = input.authoring ?? (useDefaults ? DEFAULT_AUTHORING : await promptForAuthoringStyle());
1011
+ if (!authoring) return;
1012
+ const schemaPreset = input.schemaPreset ?? options.defaultSchemaPreset ?? DEFAULT_SCHEMA_PRESET$1;
997
1013
  const detectedPackageManager = await detectPackageManager(projectDir);
998
1014
  const packageManager = input.packageManager ?? (useDefaults ? detectedPackageManager : await promptForPackageManager(detectedPackageManager));
999
1015
  if (!packageManager) return;
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-Btn7yJR3.mjs";
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-C-bVmrxB.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.79.1";
7
+ const CLI_VERSION = "0.4.2-next.37.81.1";
8
8
  const router = os.router({ create: os.meta({
9
9
  description: "Create a new project with Prisma setup",
10
10
  default: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma",
3
- "version": "0.4.2-next.37.79.1",
3
+ "version": "0.4.2-next.37.81.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",