create-prisma 0.4.2-next.37.79.1 → 0.4.2-next.37.80.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
|
@@ -40,7 +40,7 @@ async function getAnonymousId() {
|
|
|
40
40
|
}
|
|
41
41
|
function getCommonProperties() {
|
|
42
42
|
return {
|
|
43
|
-
"cli-version": "0.4.2-next.37.
|
|
43
|
+
"cli-version": "0.4.2-next.37.80.1",
|
|
44
44
|
"node-version": process.version,
|
|
45
45
|
platform: process.platform,
|
|
46
46
|
arch: process.arch
|
|
@@ -819,6 +819,7 @@ 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_PRISMA_POSTGRES = false;
|
|
822
823
|
const MONGO_DOCKER_COMPOSE = `services:
|
|
823
824
|
mongodb:
|
|
824
825
|
image: mongo:latest
|
|
@@ -906,6 +907,19 @@ async function promptForAuthoringStyle() {
|
|
|
906
907
|
}
|
|
907
908
|
return AuthoringStyleSchema.parse(authoring);
|
|
908
909
|
}
|
|
910
|
+
async function promptForPrismaPostgres() {
|
|
911
|
+
const shouldUsePrismaPostgres = await confirm({
|
|
912
|
+
message: "Provision a Prisma Postgres database?",
|
|
913
|
+
active: "Provision Prisma Postgres",
|
|
914
|
+
inactive: "Use my own database",
|
|
915
|
+
initialValue: DEFAULT_PRISMA_POSTGRES
|
|
916
|
+
});
|
|
917
|
+
if (isCancel(shouldUsePrismaPostgres)) {
|
|
918
|
+
cancel("Operation cancelled.");
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
return Boolean(shouldUsePrismaPostgres);
|
|
922
|
+
}
|
|
909
923
|
function getPackageManagerHint(option, detected) {
|
|
910
924
|
const hint = {
|
|
911
925
|
npm: "Node.js default",
|
|
@@ -981,11 +995,9 @@ async function collectPrismaSetupContext(input, options = {}) {
|
|
|
981
995
|
const shouldEmit = input.emit ?? DEFAULT_EMIT;
|
|
982
996
|
const databaseProvider = input.provider ?? (useDefaults ? DEFAULT_DATABASE_PROVIDER : await promptForDatabaseProvider());
|
|
983
997
|
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
998
|
const databaseUrl = input.databaseUrl;
|
|
988
|
-
const shouldUsePrismaPostgres = input.prismaPostgres ===
|
|
999
|
+
const shouldUsePrismaPostgres = input.prismaPostgres ?? (databaseProvider === "postgres" && !databaseUrl && !useDefaults ? await promptForPrismaPostgres() : DEFAULT_PRISMA_POSTGRES);
|
|
1000
|
+
if (shouldUsePrismaPostgres === void 0) return;
|
|
989
1001
|
if (shouldUsePrismaPostgres && databaseProvider !== "postgres") {
|
|
990
1002
|
cancel("--prisma-postgres is only supported with --provider postgres.");
|
|
991
1003
|
return;
|
|
@@ -994,6 +1006,9 @@ async function collectPrismaSetupContext(input, options = {}) {
|
|
|
994
1006
|
cancel("Use either --database-url or --prisma-postgres, not both.");
|
|
995
1007
|
return;
|
|
996
1008
|
}
|
|
1009
|
+
const authoring = input.authoring ?? (useDefaults ? DEFAULT_AUTHORING : await promptForAuthoringStyle());
|
|
1010
|
+
if (!authoring) return;
|
|
1011
|
+
const schemaPreset = input.schemaPreset ?? options.defaultSchemaPreset ?? DEFAULT_SCHEMA_PRESET$1;
|
|
997
1012
|
const detectedPackageManager = await detectPackageManager(projectDir);
|
|
998
1013
|
const packageManager = input.packageManager ?? (useDefaults ? detectedPackageManager : await promptForPackageManager(detectedPackageManager));
|
|
999
1014
|
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-
|
|
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-CfH21J9-.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.
|
|
7
|
+
const CLI_VERSION = "0.4.2-next.37.80.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