create-prisma 0.4.2-next.37.87.1 → 0.4.2-next.37.88.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
|
@@ -13,12 +13,21 @@ import { execa } from "execa";
|
|
|
13
13
|
import { styleText } from "node:util";
|
|
14
14
|
|
|
15
15
|
//#region src/telemetry/client.ts
|
|
16
|
-
const TELEMETRY_API_KEY = "";
|
|
16
|
+
const TELEMETRY_API_KEY = "phc_cmc85avbWyuJ2JyKdGPdv7dxXli8xLdWDBPbvIXWJfs";
|
|
17
17
|
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
18
18
|
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
19
19
|
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;
|
|
20
|
+
function isTruthyEnvValue(value) {
|
|
21
|
+
return [
|
|
22
|
+
"1",
|
|
23
|
+
"true",
|
|
24
|
+
"yes",
|
|
25
|
+
"on"
|
|
26
|
+
].includes(String(value ?? "").trim().toLowerCase());
|
|
27
|
+
}
|
|
20
28
|
function shouldDisableTelemetry() {
|
|
21
|
-
return true;
|
|
29
|
+
if (isTruthyEnvValue(process.env.CI) || isTruthyEnvValue(process.env.GITHUB_ACTIONS)) return true;
|
|
30
|
+
return process.env.CREATE_PRISMA_DISABLE_TELEMETRY !== void 0 || process.env.CREATE_PRISMA_TELEMETRY_DISABLED !== void 0 || process.env.DO_NOT_TRACK !== void 0;
|
|
22
31
|
}
|
|
23
32
|
function getTelemetryConfigDir() {
|
|
24
33
|
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
@@ -40,7 +49,7 @@ async function getAnonymousId() {
|
|
|
40
49
|
}
|
|
41
50
|
function getCommonProperties() {
|
|
42
51
|
return {
|
|
43
|
-
"cli-version": "0.4.2-next.37.
|
|
52
|
+
"cli-version": "0.4.2-next.37.88.1",
|
|
44
53
|
"node-version": process.version,
|
|
45
54
|
platform: process.platform,
|
|
46
55
|
arch: process.arch
|
|
@@ -78,6 +87,8 @@ async function trackCliTelemetry(event, properties) {
|
|
|
78
87
|
|
|
79
88
|
//#endregion
|
|
80
89
|
//#region src/telemetry/create.ts
|
|
90
|
+
const CREATE_PRISMA_NEXT_COMPLETED_EVENT = "cli:create_prisma_next_command_completed";
|
|
91
|
+
const CREATE_PRISMA_NEXT_FAILED_EVENT = "cli:create_prisma_next_command_failed";
|
|
81
92
|
function getTargetDirectoryState(context) {
|
|
82
93
|
if (!context.targetPathState.exists) return "new";
|
|
83
94
|
if (context.targetPathState.isEmptyDirectory) return "empty_directory";
|
|
@@ -112,13 +123,13 @@ function getErrorCode(error) {
|
|
|
112
123
|
return typeof code === "number" || typeof code === "string" ? code : null;
|
|
113
124
|
}
|
|
114
125
|
async function trackCreateCompleted(params) {
|
|
115
|
-
await trackCliTelemetry(
|
|
126
|
+
await trackCliTelemetry(CREATE_PRISMA_NEXT_COMPLETED_EVENT, {
|
|
116
127
|
...getBaseCreateProperties(params.input, params.context),
|
|
117
128
|
"duration-ms": params.durationMs
|
|
118
129
|
});
|
|
119
130
|
}
|
|
120
131
|
async function trackCreateFailed(params) {
|
|
121
|
-
await trackCliTelemetry(
|
|
132
|
+
await trackCliTelemetry(CREATE_PRISMA_NEXT_FAILED_EVENT, {
|
|
122
133
|
...getBaseCreateProperties(params.input, params.context),
|
|
123
134
|
"duration-ms": params.durationMs,
|
|
124
135
|
"failure-stage": params.stage,
|
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-W3plkOl1.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.88.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.
|
|
3
|
+
"version": "0.4.2-next.37.88.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",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dev": "tsdown --watch",
|
|
38
38
|
"start": "bun run ./dist/cli.mjs",
|
|
39
39
|
"test": "bun run test:unit && bun run test:e2e",
|
|
40
|
-
"test:unit": "bun test ./tests/install.test.ts",
|
|
40
|
+
"test:unit": "bun test ./tests/install.test.ts ./tests/telemetry.test.ts",
|
|
41
41
|
"test:e2e": "bun test --timeout 180000 ./tests/e2e/create-prisma.e2e.test.ts",
|
|
42
42
|
"check": "bun run format:check && bun run lint",
|
|
43
43
|
"lint": "oxlint . --deny-warnings",
|