create-prisma 0.4.2-pr.53.196.1 → 0.4.2-pr.53.197.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
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-BPGG92im.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.197.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
|
@@ -18,7 +18,7 @@ This builds the app and starts it with Composer. PostgreSQL projects get a local
|
|
|
18
18
|
|
|
19
19
|
The deploy script builds the framework output, provisions Prisma Postgres when selected, applies migrations, and deploys the app to Prisma Compute.
|
|
20
20
|
|
|
21
|
-
The starter users are inserted idempotently on the first database query. `{{runScriptCommand packageManager "db:seed"}}`
|
|
21
|
+
The starter users are inserted idempotently on the first database query through the Composer service binding. `{{runScriptCommand packageManager "db:seed"}}` is only for seeding an explicit `DATABASE_URL` outside Composer.
|
|
22
22
|
|
|
23
23
|
{{#if (eq provider "mongo")}}
|
|
24
24
|
MongoDB is not provisioned by Composer. Set `MONGODB_URL` before running Composer locally or deploying.
|
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
|
-
{{#if (eq provider "postgres")}}
|
|
3
|
-
import { readFile } from "node:fs/promises";
|
|
4
|
-
|
|
5
|
-
async function loadComposerDevDatabaseUrl(): Promise<string | undefined> {
|
|
6
|
-
try {
|
|
7
|
-
const contents = await readFile(
|
|
8
|
-
new URL("../../.prisma-composer/dev/env.json", import.meta.url),
|
|
9
|
-
"utf8",
|
|
10
|
-
);
|
|
11
|
-
const env = JSON.parse(contents) as Record<string, unknown>;
|
|
12
|
-
const value = env.COMPOSER_APP_DATABASE_URL;
|
|
13
|
-
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
14
|
-
} catch {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
process.env.DATABASE_URL ??= await loadComposerDevDatabaseUrl();
|
|
20
|
-
{{/if}}
|
|
21
2
|
|
|
22
3
|
if (!process.env.DATABASE_URL) {
|
|
23
4
|
throw new Error(
|
|
24
|
-
"DATABASE_URL is not set.
|
|
5
|
+
"DATABASE_URL is not set. Set it explicitly for this standalone command. Composer apps seed through their service binding on the first database query.",
|
|
25
6
|
);
|
|
26
7
|
}
|
|
27
8
|
|