create-prisma 0.2.0 → 0.3.0-pr.25.36.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/README.md +25 -4
- package/dist/cli.mjs +1 -1
- package/dist/{create-DgN5mAMV.mjs → create-YmOSipHM.mjs} +212 -17
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +2 -2
- package/package.json +27 -19
- package/templates/create/next/eslint.config.mjs +1 -6
- package/templates/create/next/src/app/globals.css +2 -8
- package/templates/create/svelte/.vscode/extensions.json +1 -1
- package/templates/create/svelte/src/app.d.ts +7 -7
- package/templates/create/svelte/src/app.html +8 -8
- package/templates/create/svelte/svelte.config.js +7 -7
- package/templates/create/svelte/tsconfig.json +18 -18
- package/templates/create/svelte/vite.config.ts +3 -3
- package/templates/create/tanstack-start/.yarnrc.yml.hbs +4 -0
- package/templates/create/tanstack-start/README.md.hbs +31 -0
- package/templates/create/tanstack-start/deno.json.hbs +13 -0
- package/templates/create/tanstack-start/package.json.hbs +33 -0
- package/templates/create/tanstack-start/prisma/schema.prisma.hbs +22 -0
- package/templates/create/tanstack-start/prisma/seed.ts.hbs +37 -0
- package/templates/create/tanstack-start/prisma.config.ts +13 -0
- package/templates/create/tanstack-start/src/lib/prisma.server.ts.hbs +53 -0
- package/templates/create/tanstack-start/src/routeTree.gen.ts +74 -0
- package/templates/create/tanstack-start/src/router.tsx +18 -0
- package/templates/create/tanstack-start/src/routes/__root.tsx.hbs +71 -0
- package/templates/create/tanstack-start/src/routes/index.tsx.hbs +145 -0
- package/templates/create/tanstack-start/src/styles.css +187 -0
- package/templates/create/tanstack-start/tsconfig.json +22 -0
- package/templates/create/tanstack-start/vite.config.ts +8 -0
- package/templates/create/turborepo/apps/api/tsconfig.json +1 -3
- package/templates/create/turborepo/packages/db/tsconfig.json +1 -5
- package/templates/create/turborepo/turbo.json +3 -9
package/README.md
CHANGED
|
@@ -68,6 +68,12 @@ Create a Nuxt project non-interactively:
|
|
|
68
68
|
create-prisma --name my-nuxt-app --template nuxt --provider postgresql
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
Create a TanStack Start project non-interactively:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
create-prisma --name my-start-app --template tanstack-start --provider postgresql
|
|
75
|
+
```
|
|
76
|
+
|
|
71
77
|
Create a Turborepo project with a `packages/db` Prisma package:
|
|
72
78
|
|
|
73
79
|
```bash
|
|
@@ -114,21 +120,24 @@ Or run locally:
|
|
|
114
120
|
|
|
115
121
|
```bash
|
|
116
122
|
bun install
|
|
123
|
+
bun run check
|
|
117
124
|
bun run build
|
|
118
125
|
bun run start
|
|
119
126
|
```
|
|
120
127
|
|
|
121
128
|
The CLI updates `package.json` with Prisma dependencies, optionally runs dependency installation with your selected package manager, and scaffolds Prisma 7 setup files directly inside each app template:
|
|
129
|
+
|
|
122
130
|
- `prisma/schema.prisma`
|
|
123
131
|
- `prisma/seed.ts`
|
|
124
|
-
- `src/lib/prisma.ts`
|
|
132
|
+
- `src/lib/prisma.ts`, `src/lib/prisma.server.ts`, `src/lib/server/prisma.ts`, `server/utils/prisma.ts`, or `packages/db/src/client.ts`
|
|
125
133
|
- `prisma.config.ts`
|
|
126
134
|
- `src/generated/prisma` or `server/generated/prisma` (Nuxt) or `packages/db/src/generated/prisma` (Turborepo)
|
|
127
135
|
- `.env` (creates or updates `DATABASE_URL`, and writes `CLAIM_URL` when Prisma Postgres is provisioned)
|
|
128
136
|
- runs `prisma generate` automatically after scaffolding
|
|
129
137
|
|
|
130
138
|
`create` is the default command and currently supports:
|
|
131
|
-
|
|
139
|
+
|
|
140
|
+
- templates: `hono`, `next`, `svelte`, `astro`, `nuxt`, `tanstack-start`, `turborepo`
|
|
132
141
|
- project name via `--name`
|
|
133
142
|
- schema presets via `--schema-preset empty|basic` (default: `basic`)
|
|
134
143
|
|
|
@@ -145,11 +154,20 @@ When add-ons are enabled, `create` prompts for the relevant agent and IDE select
|
|
|
145
154
|
When `postgresql` is selected, `create` can provision Prisma Postgres via `create-db --json` and auto-fill `DATABASE_URL`.
|
|
146
155
|
Generated projects also include `db:seed` and configure Prisma's `migrations.seed` hook to run `tsx prisma/seed.ts`.
|
|
147
156
|
|
|
157
|
+
## Telemetry
|
|
158
|
+
|
|
159
|
+
Published builds may send anonymous PostHog telemetry for `create` runs to help improve the CLI. It does not include project names, file paths, or database URLs. Disable it with `DO_NOT_TRACK`, `CREATE_PRISMA_DISABLE_TELEMETRY`, or `CREATE_PRISMA_TELEMETRY_DISABLED`.
|
|
160
|
+
|
|
148
161
|
## Scripts
|
|
149
162
|
|
|
150
163
|
- `bun run build` - Build to `dist/`
|
|
164
|
+
- `bun run check` - Run formatting and lint checks
|
|
151
165
|
- `bun run dev` - Watch mode build
|
|
152
166
|
- `bun run start` - Run built CLI
|
|
167
|
+
- `bun run lint` - Run `oxlint` with warnings treated as failures
|
|
168
|
+
- `bun run lint:fix` - Apply safe `oxlint` fixes
|
|
169
|
+
- `bun run format` - Format the repo with `oxfmt`
|
|
170
|
+
- `bun run format:check` - Check formatting with `oxfmt`
|
|
153
171
|
- `bun run typecheck` - TypeScript checks only
|
|
154
172
|
- `bun run bump` - Create a release PR (interactive semver bump)
|
|
155
173
|
- `bun run bump -- patch|minor|major|x.y.z` - Non-interactive bump
|
|
@@ -163,5 +181,8 @@ This repo uses a manual, script-driven release flow:
|
|
|
163
181
|
1. Run `bun run bump` (or pass `patch|minor|major|x.y.z`).
|
|
164
182
|
2. The script creates a `release/vX.Y.Z` branch and a PR with commit `chore(release): X.Y.Z`.
|
|
165
183
|
3. Merge that PR to `main` with squash (keep commit title `chore(release): X.Y.Z`).
|
|
166
|
-
4. GitHub Actions
|
|
167
|
-
5. GitHub Actions
|
|
184
|
+
4. GitHub Actions runs `bun run check`, `bun run typecheck`, and `bun run build` before publishing.
|
|
185
|
+
5. GitHub Actions creates the `vX.Y.Z` tag and GitHub Release notes via `changelogithub`.
|
|
186
|
+
6. GitHub Actions publishes only for `chore(release):` commits, using npm trusted publishing (OIDC, no npm token secret).
|
|
187
|
+
|
|
188
|
+
Every PR from a branch in this repository also publishes a preview package to npm using the dist-tag `pr<PR_NUMBER>`, so PR 3 is installable as `create-prisma@pr3`.
|
package/dist/cli.mjs
CHANGED
|
@@ -7,6 +7,9 @@ import { existsSync } from "node:fs";
|
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { execa } from "execa";
|
|
10
|
+
import { randomUUID } from "node:crypto";
|
|
11
|
+
import os from "node:os";
|
|
12
|
+
import { PostHog } from "posthog-node";
|
|
10
13
|
import { styleText } from "node:util";
|
|
11
14
|
|
|
12
15
|
//#region src/constants/dependencies.ts
|
|
@@ -44,6 +47,7 @@ const createTemplates = [
|
|
|
44
47
|
"svelte",
|
|
45
48
|
"astro",
|
|
46
49
|
"nuxt",
|
|
50
|
+
"tanstack-start",
|
|
47
51
|
"turborepo"
|
|
48
52
|
];
|
|
49
53
|
const createAddons = [
|
|
@@ -529,6 +533,7 @@ const requiredPrismaFileGroups = [
|
|
|
529
533
|
["prisma.config.ts", "packages/db/prisma.config.ts"],
|
|
530
534
|
[
|
|
531
535
|
"src/lib/prisma.ts",
|
|
536
|
+
"src/lib/prisma.server.ts",
|
|
532
537
|
"src/lib/server/prisma.ts",
|
|
533
538
|
"server/utils/prisma.ts",
|
|
534
539
|
"packages/db/src/client.ts"
|
|
@@ -803,7 +808,7 @@ async function finalizePrismaFiles(options) {
|
|
|
803
808
|
const schemaPath = path.join(prismaProjectDir, "prisma/schema.prisma");
|
|
804
809
|
const configPath = path.join(prismaProjectDir, "prisma.config.ts");
|
|
805
810
|
await ensureRequiredPrismaFiles(projectDir);
|
|
806
|
-
const singletonPath = await fs.pathExists(path.join(prismaProjectDir, "src/lib/prisma.ts")) ? path.join(prismaProjectDir, "src/lib/prisma.ts") : await fs.pathExists(path.join(prismaProjectDir, "src/lib/server/prisma.ts")) ? path.join(prismaProjectDir, "src/lib/server/prisma.ts") : await fs.pathExists(path.join(prismaProjectDir, "server/utils/prisma.ts")) ? path.join(prismaProjectDir, "server/utils/prisma.ts") : path.join(prismaProjectDir, "src/client.ts");
|
|
811
|
+
const singletonPath = await fs.pathExists(path.join(prismaProjectDir, "src/lib/prisma.ts")) ? path.join(prismaProjectDir, "src/lib/prisma.ts") : await fs.pathExists(path.join(prismaProjectDir, "src/lib/prisma.server.ts")) ? path.join(prismaProjectDir, "src/lib/prisma.server.ts") : await fs.pathExists(path.join(prismaProjectDir, "src/lib/server/prisma.ts")) ? path.join(prismaProjectDir, "src/lib/server/prisma.ts") : await fs.pathExists(path.join(prismaProjectDir, "server/utils/prisma.ts")) ? path.join(prismaProjectDir, "server/utils/prisma.ts") : path.join(prismaProjectDir, "src/client.ts");
|
|
807
812
|
const generatedDir = await fs.pathExists(path.join(prismaProjectDir, "server/utils/prisma.ts")) ? "server/generated" : "src/generated";
|
|
808
813
|
const envResult = await ensureEnvVarInEnv(prismaProjectDir, "DATABASE_URL", options.databaseUrl ?? getDefaultDatabaseUrl(options.provider), {
|
|
809
814
|
mode: options.databaseUrl ? "upsert" : "keep-existing",
|
|
@@ -1493,6 +1498,139 @@ async function executeCreateAddonSetupContext(params) {
|
|
|
1493
1498
|
addonSpinner.stop("Add-ons applied.");
|
|
1494
1499
|
}
|
|
1495
1500
|
|
|
1501
|
+
//#endregion
|
|
1502
|
+
//#region src/telemetry/client.ts
|
|
1503
|
+
const TELEMETRY_API_KEY = "";
|
|
1504
|
+
const TELEMETRY_HOST = "https://us.i.posthog.com";
|
|
1505
|
+
const TELEMETRY_CONFIG_FILE = "telemetry.json";
|
|
1506
|
+
const TELEMETRY_REQUEST_TIMEOUT_MS = 800;
|
|
1507
|
+
const TELEMETRY_SHUTDOWN_TIMEOUT_MS = 800;
|
|
1508
|
+
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;
|
|
1509
|
+
function shouldDisableTelemetry() {
|
|
1510
|
+
return true;
|
|
1511
|
+
}
|
|
1512
|
+
function getTelemetryConfigDir() {
|
|
1513
|
+
if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
|
|
1514
|
+
if (process.platform === "win32") return path.join(process.env.APPDATA ?? path.join(os.homedir(), "AppData", "Roaming"), "create-prisma");
|
|
1515
|
+
return path.join(process.env.XDG_CONFIG_HOME ?? path.join(os.homedir(), ".config"), "create-prisma");
|
|
1516
|
+
}
|
|
1517
|
+
async function getAnonymousId() {
|
|
1518
|
+
const telemetryConfigPath = path.join(getTelemetryConfigDir(), TELEMETRY_CONFIG_FILE);
|
|
1519
|
+
try {
|
|
1520
|
+
const config = await fs.readJSON(telemetryConfigPath);
|
|
1521
|
+
if (typeof config.anonymousId === "string" && UUID_V4_REGEX.test(config.anonymousId)) return config.anonymousId;
|
|
1522
|
+
} catch {}
|
|
1523
|
+
const anonymousId = randomUUID();
|
|
1524
|
+
try {
|
|
1525
|
+
await fs.ensureDir(path.dirname(telemetryConfigPath));
|
|
1526
|
+
await fs.writeJSON(telemetryConfigPath, { anonymousId }, { spaces: 2 });
|
|
1527
|
+
} catch {}
|
|
1528
|
+
return anonymousId;
|
|
1529
|
+
}
|
|
1530
|
+
function getCommonProperties() {
|
|
1531
|
+
return {
|
|
1532
|
+
"cli-version": "0.3.0-pr.25.36.1",
|
|
1533
|
+
"node-version": process.version,
|
|
1534
|
+
platform: process.platform,
|
|
1535
|
+
arch: process.arch
|
|
1536
|
+
};
|
|
1537
|
+
}
|
|
1538
|
+
function sanitizeProperties(properties) {
|
|
1539
|
+
return Object.fromEntries(Object.entries(properties).filter(([, value]) => value !== void 0));
|
|
1540
|
+
}
|
|
1541
|
+
async function trackCliTelemetry(event, properties) {
|
|
1542
|
+
if (shouldDisableTelemetry()) return;
|
|
1543
|
+
let client;
|
|
1544
|
+
try {
|
|
1545
|
+
client = new PostHog(TELEMETRY_API_KEY, {
|
|
1546
|
+
host: TELEMETRY_HOST,
|
|
1547
|
+
captureMode: "json",
|
|
1548
|
+
disableGeoip: true,
|
|
1549
|
+
flushAt: 1,
|
|
1550
|
+
flushInterval: 0,
|
|
1551
|
+
persistence: "memory",
|
|
1552
|
+
requestTimeout: TELEMETRY_REQUEST_TIMEOUT_MS
|
|
1553
|
+
});
|
|
1554
|
+
await client.captureImmediate({
|
|
1555
|
+
distinctId: await getAnonymousId(),
|
|
1556
|
+
event,
|
|
1557
|
+
properties: sanitizeProperties({
|
|
1558
|
+
...getCommonProperties(),
|
|
1559
|
+
...properties,
|
|
1560
|
+
$process_person_profile: false
|
|
1561
|
+
}),
|
|
1562
|
+
disableGeoip: true
|
|
1563
|
+
});
|
|
1564
|
+
} catch {} finally {
|
|
1565
|
+
if (client) await client.shutdown(TELEMETRY_SHUTDOWN_TIMEOUT_MS).catch(() => {});
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
//#endregion
|
|
1570
|
+
//#region src/telemetry/create.ts
|
|
1571
|
+
function getRequestedAddons(input) {
|
|
1572
|
+
const addons = [];
|
|
1573
|
+
if (input.skills === true) addons.push("skills");
|
|
1574
|
+
if (input.mcp === true) addons.push("mcp");
|
|
1575
|
+
if (input.extension === true) addons.push("extension");
|
|
1576
|
+
return addons;
|
|
1577
|
+
}
|
|
1578
|
+
function getTargetDirectoryState(context) {
|
|
1579
|
+
if (!context.targetPathState.exists) return "new";
|
|
1580
|
+
if (context.targetPathState.isEmptyDirectory) return "empty_directory";
|
|
1581
|
+
return "non_empty_directory";
|
|
1582
|
+
}
|
|
1583
|
+
function getBaseCreateProperties(input, context) {
|
|
1584
|
+
const resolvedAddons = context?.addonSetupContext?.addons ?? getRequestedAddons(input);
|
|
1585
|
+
return {
|
|
1586
|
+
command: "create",
|
|
1587
|
+
"uses-defaults": input.yes === true,
|
|
1588
|
+
verbose: input.verbose === true,
|
|
1589
|
+
force: input.force === true,
|
|
1590
|
+
template: context?.template ?? input.template ?? null,
|
|
1591
|
+
"database-provider": context?.prismaSetupContext.databaseProvider ?? input.provider ?? null,
|
|
1592
|
+
"package-manager": context?.prismaSetupContext.packageManager ?? input.packageManager ?? null,
|
|
1593
|
+
"schema-preset": context?.schemaPreset ?? input.schemaPreset ?? null,
|
|
1594
|
+
"should-install": context?.prismaSetupContext.shouldInstall ?? input.install ?? null,
|
|
1595
|
+
"should-generate": context?.prismaSetupContext.shouldGenerate ?? input.generate ?? null,
|
|
1596
|
+
"uses-prisma-postgres": context?.prismaSetupContext.shouldUsePrismaPostgres ?? input.prismaPostgres ?? null,
|
|
1597
|
+
addons: resolvedAddons,
|
|
1598
|
+
"addon-count": resolvedAddons.length,
|
|
1599
|
+
"addon-scope": context?.addonSetupContext?.scope ?? null,
|
|
1600
|
+
"skills-count": context?.addonSetupContext?.skills.length ?? null,
|
|
1601
|
+
"skills-agents-count": context?.addonSetupContext?.skillsAgents.length ?? null,
|
|
1602
|
+
"mcp-agents-count": context?.addonSetupContext?.mcpAgents.length ?? null,
|
|
1603
|
+
"extension-target-count": context?.addonSetupContext?.extensionTargets.length ?? null,
|
|
1604
|
+
"target-directory-state": context ? getTargetDirectoryState(context) : null
|
|
1605
|
+
};
|
|
1606
|
+
}
|
|
1607
|
+
function getErrorName(error) {
|
|
1608
|
+
if (error instanceof Error) return error.name;
|
|
1609
|
+
return error === void 0 ? null : "UnknownError";
|
|
1610
|
+
}
|
|
1611
|
+
function getErrorCode(error) {
|
|
1612
|
+
if (typeof error !== "object" || error === null) return null;
|
|
1613
|
+
const exitCode = Reflect.get(error, "exitCode");
|
|
1614
|
+
if (typeof exitCode === "number") return exitCode;
|
|
1615
|
+
const code = Reflect.get(error, "code");
|
|
1616
|
+
return typeof code === "number" || typeof code === "string" ? code : null;
|
|
1617
|
+
}
|
|
1618
|
+
async function trackCreateCompleted(params) {
|
|
1619
|
+
await trackCliTelemetry("cli:create_command_completed", {
|
|
1620
|
+
...getBaseCreateProperties(params.input, params.context),
|
|
1621
|
+
"duration-ms": params.durationMs
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
async function trackCreateFailed(params) {
|
|
1625
|
+
await trackCliTelemetry("cli:create_command_failed", {
|
|
1626
|
+
...getBaseCreateProperties(params.input, params.context),
|
|
1627
|
+
"duration-ms": params.durationMs,
|
|
1628
|
+
"failure-stage": params.stage,
|
|
1629
|
+
"error-name": getErrorName(params.error),
|
|
1630
|
+
"error-code": getErrorCode(params.error)
|
|
1631
|
+
});
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1496
1634
|
//#endregion
|
|
1497
1635
|
//#region src/ui/branding.ts
|
|
1498
1636
|
const prismaTitle = `${styleText(["bold", "cyan"], "Create")} ${styleText(["bold", "magenta"], "Prisma")}`;
|
|
@@ -1560,6 +1698,11 @@ async function promptForCreateTemplate() {
|
|
|
1560
1698
|
label: "Nuxt",
|
|
1561
1699
|
hint: "Official minimal Nuxt starter with Nitro API route example"
|
|
1562
1700
|
},
|
|
1701
|
+
{
|
|
1702
|
+
value: "tanstack-start",
|
|
1703
|
+
label: "TanStack Start",
|
|
1704
|
+
hint: "TanStack Start React app with file routes and server functions"
|
|
1705
|
+
},
|
|
1563
1706
|
{
|
|
1564
1707
|
value: "turborepo",
|
|
1565
1708
|
label: "Turborepo",
|
|
@@ -1591,14 +1734,43 @@ async function inspectTargetPath(targetPath) {
|
|
|
1591
1734
|
};
|
|
1592
1735
|
}
|
|
1593
1736
|
async function runCreateCommand(rawInput = {}) {
|
|
1737
|
+
const startedAt = Date.now();
|
|
1738
|
+
let input = {};
|
|
1739
|
+
let context;
|
|
1740
|
+
let failureStage = "validate_input";
|
|
1594
1741
|
try {
|
|
1595
|
-
|
|
1742
|
+
input = CreateCommandInputSchema.parse(rawInput);
|
|
1596
1743
|
intro(getCreatePrismaIntro());
|
|
1597
|
-
|
|
1744
|
+
failureStage = "collect_context";
|
|
1745
|
+
context = await collectCreateContext(input);
|
|
1598
1746
|
if (!context) return;
|
|
1599
|
-
|
|
1747
|
+
failureStage = "unknown";
|
|
1748
|
+
const executionResult = await executeCreateContext(context);
|
|
1749
|
+
if (!executionResult.ok) {
|
|
1750
|
+
if (executionResult.error) cancel(`Create command failed: ${executionResult.error instanceof Error ? executionResult.error.message : String(executionResult.error)}`);
|
|
1751
|
+
await trackCreateFailed({
|
|
1752
|
+
input,
|
|
1753
|
+
context,
|
|
1754
|
+
durationMs: Date.now() - startedAt,
|
|
1755
|
+
error: executionResult.error,
|
|
1756
|
+
stage: executionResult.stage
|
|
1757
|
+
});
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
await trackCreateCompleted({
|
|
1761
|
+
input,
|
|
1762
|
+
context,
|
|
1763
|
+
durationMs: Date.now() - startedAt
|
|
1764
|
+
});
|
|
1600
1765
|
} catch (error) {
|
|
1601
1766
|
cancel(`Create command failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1767
|
+
await trackCreateFailed({
|
|
1768
|
+
input,
|
|
1769
|
+
context,
|
|
1770
|
+
durationMs: Date.now() - startedAt,
|
|
1771
|
+
error,
|
|
1772
|
+
stage: failureStage
|
|
1773
|
+
});
|
|
1602
1774
|
}
|
|
1603
1775
|
}
|
|
1604
1776
|
async function collectCreateContext(input) {
|
|
@@ -1655,22 +1827,45 @@ async function executeCreateContext(context) {
|
|
|
1655
1827
|
scaffoldSpinner.stop("Project files scaffolded.");
|
|
1656
1828
|
} catch (error) {
|
|
1657
1829
|
scaffoldSpinner.stop("Could not scaffold project files.");
|
|
1658
|
-
|
|
1659
|
-
|
|
1830
|
+
return {
|
|
1831
|
+
ok: false,
|
|
1832
|
+
stage: "scaffold_template",
|
|
1833
|
+
error
|
|
1834
|
+
};
|
|
1660
1835
|
}
|
|
1661
1836
|
if (context.targetPathState.exists && !context.targetPathState.isEmptyDirectory && context.force) log.warn(`Used --force in non-empty directory ${formatPathForDisplay(context.targetDirectory)}.`);
|
|
1662
1837
|
const cdStep = `- cd ${formatPathForDisplay(context.targetDirectory)}`;
|
|
1663
|
-
if (context.addonSetupContext)
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1838
|
+
if (context.addonSetupContext) try {
|
|
1839
|
+
await executeCreateAddonSetupContext({
|
|
1840
|
+
context: context.addonSetupContext,
|
|
1841
|
+
packageManager: context.prismaSetupContext.packageManager,
|
|
1842
|
+
projectDir: context.targetDirectory,
|
|
1843
|
+
verbose: context.prismaSetupContext.verbose
|
|
1844
|
+
});
|
|
1845
|
+
} catch (error) {
|
|
1846
|
+
return {
|
|
1847
|
+
ok: false,
|
|
1848
|
+
stage: "addons",
|
|
1849
|
+
error
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
try {
|
|
1853
|
+
if (!await executePrismaSetupContext(context.prismaSetupContext, {
|
|
1854
|
+
prependNextSteps: [cdStep],
|
|
1855
|
+
projectDir: context.targetDirectory,
|
|
1856
|
+
includeDevNextStep: true
|
|
1857
|
+
})) return {
|
|
1858
|
+
ok: false,
|
|
1859
|
+
stage: "prisma_setup"
|
|
1860
|
+
};
|
|
1861
|
+
} catch (error) {
|
|
1862
|
+
return {
|
|
1863
|
+
ok: false,
|
|
1864
|
+
stage: "prisma_setup",
|
|
1865
|
+
error
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
return { ok: true };
|
|
1674
1869
|
}
|
|
1675
1870
|
|
|
1676
1871
|
//#endregion
|
package/dist/index.d.mts
CHANGED
|
@@ -201,6 +201,7 @@ declare const CreateTemplateSchema: z.ZodEnum<{
|
|
|
201
201
|
svelte: "svelte";
|
|
202
202
|
astro: "astro";
|
|
203
203
|
nuxt: "nuxt";
|
|
204
|
+
"tanstack-start": "tanstack-start";
|
|
204
205
|
turborepo: "turborepo";
|
|
205
206
|
}>;
|
|
206
207
|
declare const DatabaseUrlSchema: z.ZodString;
|
|
@@ -236,6 +237,7 @@ declare const CreateCommandInputSchema: z.ZodObject<{
|
|
|
236
237
|
svelte: "svelte";
|
|
237
238
|
astro: "astro";
|
|
238
239
|
nuxt: "nuxt";
|
|
240
|
+
"tanstack-start": "tanstack-start";
|
|
239
241
|
turborepo: "turborepo";
|
|
240
242
|
}>>;
|
|
241
243
|
skills: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -279,6 +281,7 @@ declare const router: {
|
|
|
279
281
|
svelte: "svelte";
|
|
280
282
|
astro: "astro";
|
|
281
283
|
nuxt: "nuxt";
|
|
284
|
+
"tanstack-start": "tanstack-start";
|
|
282
285
|
turborepo: "turborepo";
|
|
283
286
|
}>>;
|
|
284
287
|
skills: zod.ZodOptional<zod.ZodBoolean>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as DatabaseUrlSchema, i as DatabaseProviderSchema, n as CreateCommandInputSchema, o as PackageManagerSchema, r as CreateTemplateSchema, s as SchemaPresetSchema, t as runCreateCommand } from "./create-
|
|
2
|
+
import { a as DatabaseUrlSchema, i as DatabaseProviderSchema, n as CreateCommandInputSchema, o as PackageManagerSchema, r as CreateTemplateSchema, s as SchemaPresetSchema, t as runCreateCommand } from "./create-YmOSipHM.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.
|
|
7
|
+
const CLI_VERSION = "0.3.0-pr.25.36.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,20 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-prisma",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-pr.25.36.1",
|
|
4
|
+
"private": false,
|
|
4
5
|
"description": "Create Prisma 7 projects with first-party templates and great DX.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "https://github.com/prisma/create-prisma"
|
|
8
|
-
},
|
|
9
6
|
"homepage": "https://github.com/prisma/create-prisma",
|
|
10
7
|
"bugs": {
|
|
11
8
|
"url": "https://github.com/prisma/create-prisma/issues"
|
|
12
9
|
},
|
|
13
|
-
"
|
|
14
|
-
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/prisma/create-prisma"
|
|
13
|
+
},
|
|
15
14
|
"bin": {
|
|
16
15
|
"create-prisma": "dist/cli.mjs"
|
|
17
16
|
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"templates",
|
|
20
|
+
"README.md",
|
|
21
|
+
"CHANGELOG.md"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
18
24
|
"main": "./dist/index.mjs",
|
|
19
25
|
"types": "./dist/index.d.mts",
|
|
20
26
|
"exports": {
|
|
@@ -26,21 +32,15 @@
|
|
|
26
32
|
"import": "./dist/cli.mjs"
|
|
27
33
|
}
|
|
28
34
|
},
|
|
29
|
-
"files": [
|
|
30
|
-
"dist",
|
|
31
|
-
"templates",
|
|
32
|
-
"README.md",
|
|
33
|
-
"CHANGELOG.md"
|
|
34
|
-
],
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=18.0.0",
|
|
37
|
-
"bun": ">=1.3.0"
|
|
38
|
-
},
|
|
39
|
-
"packageManager": "bun@1.3.9",
|
|
40
35
|
"scripts": {
|
|
41
36
|
"build": "tsdown",
|
|
42
37
|
"dev": "tsdown --watch",
|
|
43
38
|
"start": "bun run ./dist/cli.mjs",
|
|
39
|
+
"check": "bun run format:check && bun run lint",
|
|
40
|
+
"lint": "oxlint . --deny-warnings",
|
|
41
|
+
"lint:fix": "oxlint . --fix",
|
|
42
|
+
"format": "oxfmt --write .",
|
|
43
|
+
"format:check": "oxfmt --check .",
|
|
44
44
|
"typecheck": "tsc --noEmit",
|
|
45
45
|
"bump": "bun run scripts/bump-version.ts",
|
|
46
46
|
"release": "bun run bump",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"execa": "^9.6.1",
|
|
53
53
|
"fs-extra": "^11.3.3",
|
|
54
54
|
"handlebars": "^4.7.8",
|
|
55
|
+
"posthog-node": "4.18.0",
|
|
55
56
|
"trpc-cli": "^0.12.4",
|
|
56
57
|
"zod": "^4.3.6"
|
|
57
58
|
},
|
|
@@ -60,7 +61,14 @@
|
|
|
60
61
|
"@types/fs-extra": "^11.0.4",
|
|
61
62
|
"@types/node": "^25.3.0",
|
|
62
63
|
"changelogithub": "^14.0.0",
|
|
64
|
+
"oxfmt": "^0.37.0",
|
|
65
|
+
"oxlint": "^1.52.0",
|
|
63
66
|
"tsdown": "^0.20.3",
|
|
64
67
|
"typescript": "^5.9.3"
|
|
65
|
-
}
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"bun": ">=1.3.0",
|
|
71
|
+
"node": ">=18.0.0"
|
|
72
|
+
},
|
|
73
|
+
"packageManager": "bun@1.3.9"
|
|
66
74
|
}
|
|
@@ -5,12 +5,7 @@ import nextTs from "eslint-config-next/typescript";
|
|
|
5
5
|
const eslintConfig = defineConfig([
|
|
6
6
|
...nextVitals,
|
|
7
7
|
...nextTs,
|
|
8
|
-
globalIgnores([
|
|
9
|
-
".next/**",
|
|
10
|
-
"out/**",
|
|
11
|
-
"build/**",
|
|
12
|
-
"next-env.d.ts",
|
|
13
|
-
]),
|
|
8
|
+
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
|
|
14
9
|
]);
|
|
15
10
|
|
|
16
11
|
export default eslintConfig;
|
|
@@ -12,10 +12,7 @@ html {
|
|
|
12
12
|
|
|
13
13
|
body {
|
|
14
14
|
margin: 0;
|
|
15
|
-
font-family:
|
|
16
|
-
"Instrument Sans",
|
|
17
|
-
"Segoe UI",
|
|
18
|
-
sans-serif;
|
|
15
|
+
font-family: "Instrument Sans", "Segoe UI", sans-serif;
|
|
19
16
|
background: #f7f8fb;
|
|
20
17
|
color: #0f172a;
|
|
21
18
|
}
|
|
@@ -116,10 +113,7 @@ code {
|
|
|
116
113
|
padding: 0.15rem 0.4rem;
|
|
117
114
|
border-radius: 0.35rem;
|
|
118
115
|
background: #eef2f7;
|
|
119
|
-
font-family:
|
|
120
|
-
SFMono-Regular,
|
|
121
|
-
Consolas,
|
|
122
|
-
monospace;
|
|
116
|
+
font-family: SFMono-Regular, Consolas, monospace;
|
|
123
117
|
font-size: 0.95em;
|
|
124
118
|
}
|
|
125
119
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// See https://svelte.dev/docs/kit/types#app.d.ts
|
|
2
2
|
// for information about these interfaces
|
|
3
3
|
declare global {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
namespace App {
|
|
5
|
+
// interface Error {}
|
|
6
|
+
// interface Locals {}
|
|
7
|
+
// interface PageData {}
|
|
8
|
+
// interface PageState {}
|
|
9
|
+
// interface Platform {}
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
%sveltekit.head%
|
|
7
|
+
</head>
|
|
8
|
+
<body data-sveltekit-preload-data="hover">
|
|
9
|
+
<div style="display: contents">%sveltekit.body%</div>
|
|
10
|
+
</body>
|
|
11
11
|
</html>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import adapter from
|
|
1
|
+
import adapter from "@sveltejs/adapter-auto";
|
|
2
2
|
|
|
3
3
|
/** @type {import('@sveltejs/kit').Config} */
|
|
4
4
|
const config = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
kit: {
|
|
6
|
+
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
|
7
|
+
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
|
8
|
+
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
|
9
|
+
adapter: adapter(),
|
|
10
|
+
},
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export default config;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
"extends": "./.svelte-kit/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rewriteRelativeImportExtensions": true,
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"checkJs": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"sourceMap": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"moduleResolution": "bundler"
|
|
14
|
+
}
|
|
15
|
+
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
|
16
|
+
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
|
17
|
+
//
|
|
18
|
+
// To make changes to top-level options such as include and exclude, we recommend extending
|
|
19
|
+
// the generated config; see https://svelte.dev/docs/kit/configuration#typescript
|
|
20
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { sveltekit } from
|
|
2
|
-
import { defineConfig } from
|
|
1
|
+
import { sveltekit } from "@sveltejs/kit/vite";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
3
|
|
|
4
4
|
export default defineConfig({
|
|
5
|
-
|
|
5
|
+
plugins: [sveltekit()],
|
|
6
6
|
});
|