create-prisma 0.10.0-pr.72.261.1 → 0.10.0
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 +1 -1
- package/dist/{create-JgaDOyzC.mjs → create-BoFbgXIm.mjs} +18 -11
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/templates/create/_shared/module.ts.hbs +2 -2
- package/templates/create/_shared/service.ts.hbs +2 -2
- package/templates/create/_shared/src/prisma/composer.ts.hbs +2 -2
- package/templates/create/_shared/src/prisma/db.ts.hbs +0 -2
package/dist/cli.mjs
CHANGED
|
@@ -30,12 +30,21 @@ function createCommandFailureResult(stage, message, project) {
|
|
|
30
30
|
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/telemetry/client.ts
|
|
33
|
-
const TELEMETRY_API_KEY = "";
|
|
33
|
+
const TELEMETRY_API_KEY = "phc_cmc85avbWyuJ2JyKdGPdv7dxXli8xLdWDBPbvIXWJfs";
|
|
34
34
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
35
35
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
36
36
|
const UUID_V4_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
37
|
+
function isTruthyEnvValue(value) {
|
|
38
|
+
return [
|
|
39
|
+
"1",
|
|
40
|
+
"true",
|
|
41
|
+
"yes",
|
|
42
|
+
"on"
|
|
43
|
+
].includes(String(value ?? "").trim().toLowerCase());
|
|
44
|
+
}
|
|
37
45
|
function shouldDisableTelemetry() {
|
|
38
|
-
return true;
|
|
46
|
+
if (isTruthyEnvValue(process.env.CI) || isTruthyEnvValue(process.env.GITHUB_ACTIONS)) return true;
|
|
47
|
+
return process.env.CREATE_PRISMA_DISABLE_TELEMETRY !== void 0 || process.env.CREATE_PRISMA_TELEMETRY_DISABLED !== void 0 || process.env.DO_NOT_TRACK !== void 0;
|
|
39
48
|
}
|
|
40
49
|
function getTelemetryConfigDir() {
|
|
41
50
|
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
@@ -57,7 +66,7 @@ async function getAnonymousId() {
|
|
|
57
66
|
}
|
|
58
67
|
function getCommonProperties() {
|
|
59
68
|
return {
|
|
60
|
-
"cli-version": "0.10.0
|
|
69
|
+
"cli-version": "0.10.0",
|
|
61
70
|
"node-version": process.version,
|
|
62
71
|
platform: process.platform,
|
|
63
72
|
arch: process.arch
|
|
@@ -491,8 +500,8 @@ async function scaffoldCreateFrameworkTemplate(opts) {
|
|
|
491
500
|
const dependencyVersionMap = {
|
|
492
501
|
"@astrojs/node": "^10.0.2",
|
|
493
502
|
"@elysiajs/node": "^1.4.5",
|
|
494
|
-
"@prisma/composer": "0.
|
|
495
|
-
"@prisma/composer-prisma-cloud": "0.
|
|
503
|
+
"@prisma/composer": "0.15.0",
|
|
504
|
+
"@prisma/composer-prisma-cloud": "0.15.0",
|
|
496
505
|
"@prisma/orm-mongo": "8.0.0-rc.8",
|
|
497
506
|
"@prisma/orm-postgres": "8.0.0-rc.8",
|
|
498
507
|
"@sveltejs/adapter-node": "^5.3.2",
|
|
@@ -505,12 +514,11 @@ const dependencyVersionMap = {
|
|
|
505
514
|
mongodb: "^7.1.0",
|
|
506
515
|
"mongodb-memory-server": "^11.1.0",
|
|
507
516
|
nitro: "^3.0.260610-beta",
|
|
508
|
-
prisma: "8.0.0-rc.
|
|
509
|
-
"temporal-polyfill": "^1.0.4",
|
|
517
|
+
prisma: "8.0.0-rc.11",
|
|
510
518
|
tsx: "^4.21.0",
|
|
511
519
|
typescript: "^5.9.3"
|
|
512
520
|
};
|
|
513
|
-
const PRISMA_PLATFORM_CLI_PACKAGE = "prisma@8.0.0-rc.
|
|
521
|
+
const PRISMA_PLATFORM_CLI_PACKAGE = "prisma@8.0.0-rc.11";
|
|
514
522
|
const PRISMA_DENO_CLI_PACKAGE = PRISMA_PLATFORM_CLI_PACKAGE;
|
|
515
523
|
function getDependencyVersion(packageName) {
|
|
516
524
|
return dependencyVersionMap[packageName];
|
|
@@ -650,7 +658,6 @@ async function addPackageDependency(opts) {
|
|
|
650
658
|
}
|
|
651
659
|
async function writePrismaDependencies(provider, packageManager, _authoring, projectDir = process.cwd()) {
|
|
652
660
|
const dependencies = [getDbPackages(provider)];
|
|
653
|
-
if (provider === "postgres" && packageManager !== "deno") dependencies.push("temporal-polyfill");
|
|
654
661
|
if (provider === "mongo") dependencies.push("arktype", "mongodb");
|
|
655
662
|
if (packageManager === "deno") dependencies.push("dotenv");
|
|
656
663
|
await addPackageDependency({
|
|
@@ -1462,7 +1469,7 @@ function parseVersion(version) {
|
|
|
1462
1469
|
Number.parseInt(patch, 10)
|
|
1463
1470
|
];
|
|
1464
1471
|
}
|
|
1465
|
-
function
|
|
1472
|
+
function supportsPrismaNext(nodeVersion = process.versions.node) {
|
|
1466
1473
|
const current = parseVersion(nodeVersion);
|
|
1467
1474
|
for (let index = 0; index < MINIMUM_NODE_VERSION.length; index += 1) {
|
|
1468
1475
|
if (current[index] > MINIMUM_NODE_VERSION[index]) return true;
|
|
@@ -1603,7 +1610,7 @@ async function runCreateCommand(rawInput = {}) {
|
|
|
1603
1610
|
try {
|
|
1604
1611
|
input = CreateCommandInputSchema.parse(rawInput);
|
|
1605
1612
|
if (input.json && input.verbose) throw new Error("--verbose cannot be used with --json because JSON mode is output-only.");
|
|
1606
|
-
if (!
|
|
1613
|
+
if (!supportsPrismaNext()) {
|
|
1607
1614
|
const message = getUnsupportedNodeMessage();
|
|
1608
1615
|
cancel(message, { output });
|
|
1609
1616
|
process.exitCode = 1;
|
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, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as runCreateCommand } from "./create-
|
|
2
|
+
import { a as DatabaseProviderSchema, i as CreateTemplateSchema, n as AuthoringStyleSchema, o as PackageManagerSchema, r as CreateCommandInputSchema, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as runCreateCommand } from "./create-BoFbgXIm.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.10.0
|
|
8
|
+
const CLI_VERSION = "0.10.0";
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{{#unless (eq packageManager "deno")}}
|
|
2
2
|
import { module } from "@prisma/composer";
|
|
3
3
|
{{#if (eq provider "postgres")}}
|
|
4
|
-
import {
|
|
4
|
+
import { pnPostgres } from "@prisma/composer-prisma-cloud/prisma-next";
|
|
5
5
|
|
|
6
6
|
import { appContract } from "./src/prisma/composer.ts";
|
|
7
7
|
{{else}}
|
|
@@ -12,7 +12,7 @@ import app from "./service.ts";
|
|
|
12
12
|
export default module("{{projectName}}", ({ provision }) => {
|
|
13
13
|
{{#if (eq provider "postgres")}}
|
|
14
14
|
const database = provision(
|
|
15
|
-
|
|
15
|
+
pnPostgres({
|
|
16
16
|
name: "database",
|
|
17
17
|
contract: appContract,
|
|
18
18
|
config: "./prisma.config.ts",
|
|
@@ -10,7 +10,7 @@ import { type } from "arktype";
|
|
|
10
10
|
{{/if}}
|
|
11
11
|
import { compute } from "@prisma/composer-prisma-cloud";
|
|
12
12
|
{{#if (eq provider "postgres")}}
|
|
13
|
-
import {
|
|
13
|
+
import { pnPostgres } from "@prisma/composer-prisma-cloud/prisma-next";
|
|
14
14
|
|
|
15
15
|
import { appContract } from "./src/prisma/composer.ts";
|
|
16
16
|
{{/if}}
|
|
@@ -19,7 +19,7 @@ export default compute({
|
|
|
19
19
|
name: "app",
|
|
20
20
|
deps: {
|
|
21
21
|
{{#if (eq provider "postgres")}}
|
|
22
|
-
database:
|
|
22
|
+
database: pnPostgres(appContract),
|
|
23
23
|
{{/if}}
|
|
24
24
|
},
|
|
25
25
|
{{#if (eq provider "mongo")}}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{{#unless (eq packageManager "deno")}}
|
|
2
2
|
{{#if (eq provider "postgres")}}
|
|
3
|
-
import {
|
|
3
|
+
import { pnContract } from "@prisma/composer-prisma-cloud/prisma-next";
|
|
4
4
|
|
|
5
5
|
import type { Contract } from "./{{#if (eq authoring "typescript")}}generated/{{/if}}contract.d.ts";
|
|
6
6
|
import contractJson from "./{{#if (eq authoring "typescript")}}generated/{{/if}}contract.json" with { type: "json" };
|
|
7
7
|
|
|
8
|
-
export const appContract =
|
|
8
|
+
export const appContract = pnContract<Contract>(contractJson);
|
|
9
9
|
{{/if}}
|
|
10
10
|
{{/unless}}
|
|
@@ -12,8 +12,6 @@ if (!databaseUrl) {
|
|
|
12
12
|
|
|
13
13
|
export const db = postgres<Contract>({ contractJson, url: databaseUrl });
|
|
14
14
|
{{else}}
|
|
15
|
-
import "temporal-polyfill/global";
|
|
16
|
-
|
|
17
15
|
import service from "../../service.ts";
|
|
18
16
|
import type { Contract } from "./{{#if (eq authoring "typescript")}}generated/{{/if}}contract.d.ts";
|
|
19
17
|
import contractJson from "./{{#if (eq authoring "typescript")}}generated/{{/if}}contract.json" with { type: "json" };
|