create-prisma 0.13.5 → 0.14.0-pr.127.414.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.
Files changed (42) hide show
  1. package/README.md +11 -2
  2. package/dist/cli.d.mts +1 -1
  3. package/dist/cli.mjs +2 -5
  4. package/dist/index.d.mts +53 -36
  5. package/dist/index.mjs +2 -82
  6. package/dist/{json-output-kf2v8luZ.mjs → src-Dnqle6oR.mjs} +483 -206
  7. package/package.json +17 -18
  8. package/templates/create/{hono → _package-manager}/.yarnrc.yml.hbs +3 -0
  9. package/templates/create/_shared/README.md.hbs +2 -2
  10. package/templates/create/_shared/prisma.config.ts.hbs +12 -5
  11. package/templates/create/astro/package.json.hbs +5 -5
  12. package/templates/create/elysia/package.json.hbs +4 -4
  13. package/templates/create/elysia/src/index.ts.hbs +1 -1
  14. package/templates/create/hono/package.json.hbs +5 -5
  15. package/templates/create/minimal/package.json.hbs +1 -1
  16. package/templates/create/nest/package.json.hbs +6 -6
  17. package/templates/create/next/eslint.config.mjs +1 -0
  18. package/templates/create/next/package.json.hbs +10 -10
  19. package/templates/create/nuxt/app/pages/index.vue.hbs +1 -0
  20. package/templates/create/nuxt/package.json.hbs +11 -8
  21. package/templates/create/svelte/package.json.hbs +12 -8
  22. package/templates/create/svelte/src/lib/index.ts +1 -1
  23. package/templates/create/svelte/src/routes/+layout.svelte +1 -1
  24. package/templates/create/svelte/src/routes/+page.svelte.hbs +2 -1
  25. package/templates/create/svelte/tsconfig.json +3 -6
  26. package/templates/create/svelte/vite.config.ts +2 -1
  27. package/templates/create/tanstack-start/package.json.hbs +11 -13
  28. package/templates/create/tanstack-start/tsconfig.json +0 -1
  29. package/templates/create/tanstack-start/vite.config.ts +2 -7
  30. package/templates/create/turborepo/apps/server/package.json +1 -1
  31. package/templates/create/turborepo/tsconfig.json +1 -7
  32. package/templates/create/_shared/prisma-composer.config.ts.hbs +0 -13
  33. package/templates/create/astro/.yarnrc.yml.hbs +0 -3
  34. package/templates/create/elysia/.yarnrc.yml.hbs +0 -3
  35. package/templates/create/minimal/.yarnrc.yml.hbs +0 -3
  36. package/templates/create/nest/.yarnrc.yml.hbs +0 -3
  37. package/templates/create/next/.yarnrc.yml.hbs +0 -3
  38. package/templates/create/nuxt/.yarnrc.yml.hbs +0 -3
  39. package/templates/create/svelte/.yarnrc.yml.hbs +0 -3
  40. package/templates/create/svelte/svelte.config.js +0 -10
  41. package/templates/create/tanstack-start/.yarnrc.yml.hbs +0 -4
  42. package/templates/create/turborepo/.yarnrc.yml.hbs +0 -3
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Create a Prisma 8 app with Prisma Composer built in.
4
4
 
5
+ Requires Node.js 22.22 or newer.
6
+
5
7
  ## Quick start
6
8
 
7
9
  Use your package manager:
@@ -32,7 +34,7 @@ Deploy to Prisma now?
32
34
 
33
35
  Choose no to deploy later with the generated `deploy` script.
34
36
 
35
- New apps explicitly use `us-east-1` in `prisma-composer.config.ts`. Change the
37
+ New apps explicitly use `us-east-1` in the Composer section of `prisma.config.ts`. Change the
36
38
  `prismaCloud({ region })` option before deploying if you need another region.
37
39
  Composer requires a region when creating a new project; leaving it unspecified
38
40
  only works when deploying into an existing project whose region can be inherited.
@@ -81,6 +83,13 @@ older cached version. Prisma Compute does not support Deno deployments yet.
81
83
  - `--verbose`
82
84
  - `--json`
83
85
 
86
+ Without `--force`, non-empty directories are left unchanged. Interactive runs offer to create
87
+ an available name, choose another name, or cancel. An existing app without `prisma.config.ts`
88
+ also offers to add Prisma through the official `prisma orm init` command. This runs ORM setup
89
+ only, not starter generation or deployment; Prisma's own overwrite-consent prompts remain active.
90
+ The default project name skips occupied paths. `--yes`, `--json` and non-TTY collisions still fail
91
+ without modifying the existing directory.
92
+
84
93
  ### JSON output for agents and automation
85
94
 
86
95
  Use `--json` when another program is driving `create-prisma`:
@@ -110,4 +119,4 @@ bun run build
110
119
 
111
120
  ## Telemetry
112
121
 
113
- Published builds may send anonymous usage telemetry. It never includes project names, file paths, or database URLs. Failure events carry only stable identifiers such as exit codes and tool error codes, never messages or command output. Disable it with `DO_NOT_TRACK`, `CREATE_PRISMA_DISABLE_TELEMETRY`, or `CREATE_PRISMA_TELEMETRY_DISABLED`.
122
+ Published builds may send anonymous usage telemetry. It never includes project names, file paths, or database URLs. Failure events carry only stable identifiers such as exit codes and tool error codes, never messages or command output. A run rejected for a non-empty directory reports only whether that directory held an existing app, a Prisma project, or other files. Disable it with `DO_NOT_TRACK`, `CREATE_PRISMA_DISABLE_TELEMETRY`, or `CREATE_PRISMA_TELEMETRY_DISABLED`.
package/dist/cli.d.mts CHANGED
@@ -1 +1 @@
1
- export { };
1
+ export {}
package/dist/cli.mjs CHANGED
@@ -1,11 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { a as ApplicationLayer } from "./json-output-kf2v8luZ.mjs";
3
- import { runCreatePrismaCli } from "./index.mjs";
2
+ import { a as ApplicationLayer, i as runCreatePrismaCli } from "./src-Dnqle6oR.mjs";
4
3
  import { Effect } from "effect";
5
4
  import { NodeRuntime } from "@effect/platform-node-shared";
6
-
7
5
  //#region src/cli.ts
8
6
  runCreatePrismaCli().pipe(Effect.provide(ApplicationLayer), NodeRuntime.runMain({ disableErrorReporting: true }));
9
-
10
7
  //#endregion
11
- export { };
8
+ export {};
package/dist/index.d.mts CHANGED
@@ -1,9 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Context, Effect, Layer, Schema } from "effect";
3
- import { Command } from "effect/unstable/cli";
4
- import * as effect_FileSystem0 from "effect/FileSystem";
5
- import * as effect_Cause0 from "effect/Cause";
6
-
3
+ import { Command } from "effect/cli";
7
4
  //#region src/utils/child-process-failure.d.ts
8
5
  declare const ChildProcessFailureSchema: Schema.Literals<readonly ["cancelled", "command_not_found", "interrupted", "max_buffer", "non_zero_exit", "permission_denied", "spawn_failed", "terminated", "timed_out"]>;
9
6
  type ChildProcessFailure = typeof ChildProcessFailureSchema.Type;
@@ -14,7 +11,7 @@ type CommandSpec = {
14
11
  args: readonly string[];
15
12
  cwd: string;
16
13
  env?: NodeJS.ProcessEnv;
17
- stdio?: "pipe" | "inherit";
14
+ stdio?: "pipe" | "inherit" | ["inherit", "pipe", "inherit"];
18
15
  onStderrLine?: (line: string) => void;
19
16
  };
20
17
  type CommandResult = {
@@ -31,7 +28,7 @@ declare const CommandExecutionError_base: Schema.Class<CommandExecutionError, Sc
31
28
  readonly stderr: Schema.String;
32
29
  readonly cause: Schema.optionalKey<Schema.Defect>;
33
30
  readonly childProcessFailure: Schema.optional<Schema.Literals<readonly ["cancelled", "command_not_found", "interrupted", "max_buffer", "non_zero_exit", "permission_denied", "spawn_failed", "terminated", "timed_out"]>>;
34
- }>, effect_Cause0.YieldableError>;
31
+ }>, import("effect/Cause").YieldableError>;
35
32
  declare class CommandExecutionError extends CommandExecutionError_base {
36
33
  get message(): string;
37
34
  }
@@ -44,35 +41,35 @@ declare class CommandRunner extends CommandRunner_base {
44
41
  }
45
42
  //#endregion
46
43
  //#region src/types.d.ts
47
- declare const DatabaseProviderSchema: Schema.Literals<readonly ["postgres", "mongo"]>;
48
- declare const PackageManagerSchema: Schema.Literals<readonly ["npm", "pnpm", "yarn", "bun", "deno"]>;
49
- declare const AuthoringStyleSchema: Schema.Literals<readonly ["psl", "typescript"]>;
50
- declare const AgentSkillTargetSchema: Schema.Literals<readonly ["claude", "cursor", "agents", "devin"]>;
51
- declare const CreateTemplateSchema: Schema.Literals<readonly ["minimal", "hono", "elysia", "nest", "next", "turborepo", "svelte", "astro", "nuxt", "tanstack-start"]>;
52
- declare const CreateCommandInputSchema: Schema.Struct<{
53
- readonly name: Schema.optionalKey<Schema.Trim>;
54
- readonly template: Schema.optionalKey<Schema.Literals<readonly ["minimal", "hono", "elysia", "nest", "next", "turborepo", "svelte", "astro", "nuxt", "tanstack-start"]>>;
55
- readonly force: Schema.optionalKey<Schema.Boolean>;
44
+ export declare const DatabaseProviderSchema: Schema.Literals<readonly ["postgres", "mongo"]>;
45
+ export declare const PackageManagerSchema: Schema.Literals<readonly ["npm", "pnpm", "yarn", "bun", "deno"]>;
46
+ export declare const AuthoringStyleSchema: Schema.Literals<readonly ["psl", "typescript"]>;
47
+ export declare const AgentSkillTargetSchema: Schema.Literals<readonly ["claude", "cursor", "agents", "devin"]>;
48
+ export declare const CreateTemplateSchema: Schema.Literals<readonly ["minimal", "hono", "elysia", "nest", "next", "turborepo", "svelte", "astro", "nuxt", "tanstack-start"]>;
49
+ export declare const CreateCommandInputSchema: Schema.Struct<{
50
+ readonly yes: Schema.optionalKey<Schema.Boolean>;
51
+ readonly verbose: Schema.optionalKey<Schema.Boolean>;
52
+ readonly json: Schema.optionalKey<Schema.Boolean>;
56
53
  readonly provider: Schema.optionalKey<Schema.Literals<readonly ["postgres", "mongo"]>>;
57
54
  readonly authoring: Schema.optionalKey<Schema.Literals<readonly ["psl", "typescript"]>>;
58
55
  readonly packageManager: Schema.optionalKey<Schema.Literals<readonly ["npm", "pnpm", "yarn", "bun", "deno"]>>;
59
56
  readonly deploy: Schema.optionalKey<Schema.Boolean>;
60
57
  readonly workspace: Schema.optionalKey<Schema.decodeTo<Schema.NonEmptyString, Schema.Trim, never, never>>;
61
58
  readonly skills: Schema.optionalKey<Schema.decodeTo<Schema.NonEmptyString, Schema.Trim, never, never>>;
62
- readonly yes: Schema.optionalKey<Schema.Boolean>;
63
- readonly verbose: Schema.optionalKey<Schema.Boolean>;
64
- readonly json: Schema.optionalKey<Schema.Boolean>;
59
+ readonly name: Schema.optionalKey<Schema.Trim>;
60
+ readonly template: Schema.optionalKey<Schema.Literals<readonly ["minimal", "hono", "elysia", "nest", "next", "turborepo", "svelte", "astro", "nuxt", "tanstack-start"]>>;
61
+ readonly force: Schema.optionalKey<Schema.Boolean>;
65
62
  }>;
66
63
  type CreateCommandInput = typeof CreateCommandInputSchema.Type;
67
64
  //#endregion
68
65
  //#region src/create-outcome.d.ts
69
66
  declare const CreateFailureStageSchema: Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>;
70
67
  type CreateFailureStage = typeof CreateFailureStageSchema.Type;
71
- declare const CreateCancellationStageSchema: Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "authenticate", "select_workspace"]>;
68
+ declare const CreateCancellationStageSchema: Schema.Literals<readonly ["project_name", "directory_conflict", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "authenticate", "select_workspace", "initialize_prisma"]>;
72
69
  type CreateCancellationStage = typeof CreateCancellationStageSchema.Type;
73
70
  //#endregion
74
71
  //#region src/result.d.ts
75
- declare const CREATE_PRISMA_RESULT_SCHEMA_VERSION: 1;
72
+ export declare const CREATE_PRISMA_RESULT_SCHEMA_VERSION: 1;
76
73
  declare const CreateNextStepSchema: Schema.Struct<{
77
74
  readonly command: Schema.String;
78
75
  readonly description: Schema.String;
@@ -120,11 +117,22 @@ declare const CreateCommandSuccessResultSchema: Schema.Struct<{
120
117
  readonly warnings: Schema.$Array<Schema.String>;
121
118
  }>;
122
119
  type CreateCommandSuccessResult = typeof CreateCommandSuccessResultSchema.Type;
120
+ declare const CreateCommandInitializedResultSchema: Schema.Struct<{
121
+ readonly schemaVersion: Schema.Literal<1>;
122
+ readonly ok: Schema.Literal<true>;
123
+ readonly operation: Schema.Literal<"orm_init">;
124
+ readonly project: Schema.Struct<{
125
+ readonly name: Schema.String;
126
+ readonly path: Schema.String;
127
+ }>;
128
+ readonly initialization: Schema.Unknown;
129
+ }>;
130
+ type CreateCommandInitializedResult = typeof CreateCommandInitializedResultSchema.Type;
123
131
  declare const CreateCommandFailureResultSchema: Schema.Struct<{
124
132
  readonly schemaVersion: Schema.Literal<1>;
125
133
  readonly ok: Schema.Literal<false>;
126
134
  readonly error: Schema.Struct<{
127
- readonly stage: Schema.Union<readonly [Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>, Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "authenticate", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
135
+ readonly stage: Schema.Union<readonly [Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>, Schema.Literals<readonly ["project_name", "directory_conflict", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "authenticate", "select_workspace", "initialize_prisma"]>, Schema.Literal<"parse_arguments">]>;
128
136
  readonly message: Schema.String;
129
137
  }>;
130
138
  readonly project: Schema.optionalKey<Schema.Struct<{
@@ -137,7 +145,7 @@ declare const CreateCommandFailureResultSchema: Schema.Struct<{
137
145
  }>>;
138
146
  }>;
139
147
  type CreateCommandFailureResult = typeof CreateCommandFailureResultSchema.Type;
140
- declare const CreateCommandResultSchema: Schema.Union<readonly [Schema.Struct<{
148
+ export declare const CreateCommandResultSchema: Schema.Union<readonly [Schema.Struct<{
141
149
  readonly schemaVersion: Schema.Literal<1>;
142
150
  readonly ok: Schema.Literal<true>;
143
151
  readonly project: Schema.Struct<{
@@ -167,11 +175,20 @@ declare const CreateCommandResultSchema: Schema.Union<readonly [Schema.Struct<{
167
175
  readonly description: Schema.String;
168
176
  }>>;
169
177
  readonly warnings: Schema.$Array<Schema.String>;
178
+ }>, Schema.Struct<{
179
+ readonly schemaVersion: Schema.Literal<1>;
180
+ readonly ok: Schema.Literal<true>;
181
+ readonly operation: Schema.Literal<"orm_init">;
182
+ readonly project: Schema.Struct<{
183
+ readonly name: Schema.String;
184
+ readonly path: Schema.String;
185
+ }>;
186
+ readonly initialization: Schema.Unknown;
170
187
  }>, Schema.Struct<{
171
188
  readonly schemaVersion: Schema.Literal<1>;
172
189
  readonly ok: Schema.Literal<false>;
173
190
  readonly error: Schema.Struct<{
174
- readonly stage: Schema.Union<readonly [Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>, Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "authenticate", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
191
+ readonly stage: Schema.Union<readonly [Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>, Schema.Literals<readonly ["project_name", "directory_conflict", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "authenticate", "select_workspace", "initialize_prisma"]>, Schema.Literal<"parse_arguments">]>;
175
192
  readonly message: Schema.String;
176
193
  }>;
177
194
  readonly project: Schema.optionalKey<Schema.Struct<{
@@ -186,13 +203,13 @@ declare const CreateCommandResultSchema: Schema.Union<readonly [Schema.Struct<{
186
203
  type CreateCommandResult = typeof CreateCommandResultSchema.Type;
187
204
  //#endregion
188
205
  //#region src/index.d.ts
189
- declare const createPrismaCommand: Command.Command<"create-prisma", {
206
+ export declare const createPrismaCommand: Command.Command<"create-prisma", {
190
207
  readonly projectName: string | undefined;
191
208
  readonly name: string | undefined;
192
- readonly template: "minimal" | "hono" | "elysia" | "nest" | "next" | "turborepo" | "svelte" | "astro" | "nuxt" | "tanstack-start" | undefined;
193
- readonly provider: "postgres" | "mongo" | undefined;
209
+ readonly template: "astro" | "elysia" | "hono" | "minimal" | "nest" | "next" | "nuxt" | "svelte" | "tanstack-start" | "turborepo" | undefined;
210
+ readonly provider: "mongo" | "postgres" | undefined;
194
211
  readonly authoring: "psl" | "typescript" | undefined;
195
- readonly packageManager: "npm" | "pnpm" | "yarn" | "bun" | "deno" | undefined;
212
+ readonly packageManager: "bun" | "deno" | "npm" | "pnpm" | "yarn" | undefined;
196
213
  readonly deploy: boolean | undefined;
197
214
  readonly workspace: string | undefined;
198
215
  readonly skills: string | undefined;
@@ -200,14 +217,14 @@ declare const createPrismaCommand: Command.Command<"create-prisma", {
200
217
  readonly yes: boolean | undefined;
201
218
  readonly verbose: boolean | undefined;
202
219
  readonly json: boolean | undefined;
203
- }, {}, never, effect_FileSystem0.FileSystem | CommandRunner>;
204
- declare function createCreatePrismaCli(): Command.Command<"create-prisma", {
220
+ }, {}, never, CommandRunner | import("effect/FileSystem").FileSystem>;
221
+ export declare function createCreatePrismaCli(): Command.Command<"create-prisma", {
205
222
  readonly projectName: string | undefined;
206
223
  readonly name: string | undefined;
207
- readonly template: "minimal" | "hono" | "elysia" | "nest" | "next" | "turborepo" | "svelte" | "astro" | "nuxt" | "tanstack-start" | undefined;
208
- readonly provider: "postgres" | "mongo" | undefined;
224
+ readonly template: "astro" | "elysia" | "hono" | "minimal" | "nest" | "next" | "nuxt" | "svelte" | "tanstack-start" | "turborepo" | undefined;
225
+ readonly provider: "mongo" | "postgres" | undefined;
209
226
  readonly authoring: "psl" | "typescript" | undefined;
210
- readonly packageManager: "npm" | "pnpm" | "yarn" | "bun" | "deno" | undefined;
227
+ readonly packageManager: "bun" | "deno" | "npm" | "pnpm" | "yarn" | undefined;
211
228
  readonly deploy: boolean | undefined;
212
229
  readonly workspace: string | undefined;
213
230
  readonly skills: string | undefined;
@@ -215,8 +232,8 @@ declare function createCreatePrismaCli(): Command.Command<"create-prisma", {
215
232
  readonly yes: boolean | undefined;
216
233
  readonly verbose: boolean | undefined;
217
234
  readonly json: boolean | undefined;
218
- }, {}, never, effect_FileSystem0.FileSystem | CommandRunner>;
219
- declare function runCreatePrismaCli(argv?: readonly string[]): Effect.Effect<void, never, Command.Environment | CommandRunner>;
220
- declare function create(input?: CreateCommandInput): Promise<void>;
235
+ }, {}, never, CommandRunner | import("effect/FileSystem").FileSystem>;
236
+ export declare function runCreatePrismaCli(argv?: readonly string[]): Effect.Effect<void, never, CommandRunner | Command.Environment>;
237
+ export declare function create(input?: CreateCommandInput): Promise<void>;
221
238
  //#endregion
222
- export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, type CreateCommandFailureResult, type CreateCommandFailureStage, type CreateCommandInput, CreateCommandInputSchema, type CreateCommandResult, CreateCommandResultSchema, type CreateCommandSuccessResult, type CreateNextStep, type CreateProjectResult, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
239
+ export type { CreateCommandFailureResult, CreateCommandFailureStage, CreateCommandInitializedResult, CreateCommandInput, CreateCommandResult, CreateCommandSuccessResult, CreateNextStep, CreateProjectResult };
package/dist/index.mjs CHANGED
@@ -1,83 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { _ as authoringStyles, b as normalizeDatabaseProvider, c as CreateCommandResultSchema, d as AuthoringStyleSchema, f as CreateCommandInputSchema, g as agentSkillTargets, h as PackageManagerSchema, i as getErrorMessage, l as createCommandFailureResult, m as DatabaseProviderSchema, n as writeJsonResult, o as applicationRuntime, p as CreateTemplateSchema, r as runCreateCommandEffect, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as isJsonOutputRequested, u as AgentSkillTargetSchema, v as createTemplates, x as packageManagers, y as databaseProviderInputs } from "./json-output-kf2v8luZ.mjs";
3
- import { Console, Effect, Option } from "effect";
4
- import { Argument, CliError, Command, Flag } from "effect/unstable/cli";
5
-
6
- //#region src/index.ts
7
- const CLI_VERSION = "0.13.5";
8
- const optionalArgument = (name, description) => Argument.string(name).pipe(Argument.withDescription(description), Argument.optional, Argument.map(Option.getOrUndefined));
9
- const optionalBoolean = (name, description) => Flag.boolean(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
10
- const optionalString = (name, description) => Flag.string(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
11
- const createPrismaCommand = Command.make("create-prisma", {
12
- projectName: optionalArgument("project-name", "Project name / directory"),
13
- name: optionalString("name", "Project name / directory"),
14
- template: Flag.choice("template", createTemplates).pipe(Flag.withDescription("Project template"), Flag.optional, Flag.map(Option.getOrUndefined)),
15
- provider: Flag.choice("provider", databaseProviderInputs).pipe(Flag.withDescription("Database provider"), Flag.optional, Flag.map(Option.map(normalizeDatabaseProvider)), Flag.map(Option.getOrUndefined)),
16
- authoring: Flag.choice("authoring", authoringStyles).pipe(Flag.withDescription("Contract authoring style"), Flag.optional, Flag.map(Option.getOrUndefined)),
17
- packageManager: Flag.choice("package-manager", packageManagers).pipe(Flag.withDescription("Package manager used for dependency installation"), Flag.optional, Flag.map(Option.getOrUndefined)),
18
- deploy: optionalBoolean("deploy", "Deploy the generated app to Prisma immediately"),
19
- workspace: optionalString("workspace", "Prisma workspace id or name to deploy into"),
20
- skills: optionalString("skills", `Agents to install skills for, comma-separated (${agentSkillTargets.join(", ")}); 'none' installs no agent skill files`),
21
- force: optionalBoolean("force", "Overwrite generated starter and Prisma files; refuses a non-empty migrations path"),
22
- yes: optionalBoolean("yes", "Skip prompts and accept default choices"),
23
- verbose: optionalBoolean("verbose", "Show verbose command output during setup"),
24
- json: optionalBoolean("json", "Emit one quiet JSON result for agents and automation (non-interactive; deploys unless --no-deploy)")
25
- }, Effect.fn("Cli.create")(function* (options) {
26
- const input = {
27
- ...options.name ?? options.projectName ? { name: options.name ?? options.projectName } : {},
28
- ...options.template ? { template: options.template } : {},
29
- ...options.provider ? { provider: options.provider } : {},
30
- ...options.authoring ? { authoring: options.authoring } : {},
31
- ...options.packageManager ? { packageManager: options.packageManager } : {},
32
- ...options.deploy !== void 0 ? { deploy: options.deploy } : {},
33
- ...options.workspace ? { workspace: options.workspace } : {},
34
- ...options.skills ? { skills: options.skills } : {},
35
- ...options.force !== void 0 ? { force: options.force } : {},
36
- ...options.yes !== void 0 ? { yes: options.yes } : {},
37
- ...options.verbose !== void 0 ? { verbose: options.verbose } : {},
38
- ...options.json !== void 0 ? { json: options.json } : {}
39
- };
40
- const result = yield* runCreateCommandEffect(input);
41
- if (input.json) yield* writeJsonResult(result);
42
- if (!result.ok) yield* Effect.sync(() => void (process.exitCode = 1));
43
- })).pipe(Command.withDescription("Create a new project with Prisma setup"), Command.withExamples([
44
- {
45
- command: "create-prisma my-app",
46
- description: "Create a project interactively"
47
- },
48
- {
49
- command: "create-prisma my-app --yes --json",
50
- description: "Create and deploy with machine-readable output"
51
- },
52
- {
53
- command: "create-prisma my-app --yes --skills none",
54
- description: "Create without agent skill files or the skills-sync postinstall hook"
55
- }
56
- ]));
57
- const silentConsole = Object.assign(Object.create(console), {
58
- log() {},
59
- error() {}
60
- });
61
- function createCreatePrismaCli() {
62
- return createPrismaCommand;
63
- }
64
- function runCreatePrismaCli(argv = process.argv.slice(2)) {
65
- const json = isJsonOutputRequested(argv);
66
- const args = argv[0] === "create" ? argv.slice(1) : argv;
67
- let program = Command.runWith(createPrismaCommand, {
68
- version: CLI_VERSION,
69
- renderErrors: !json
70
- })(args).pipe(Effect.catch((error) => Effect.gen(function* () {
71
- if (error instanceof CliError.ShowHelp && error.errors.length === 0) return;
72
- process.exitCode = 1;
73
- if (json) yield* writeJsonResult(createCommandFailureResult("parse_arguments", error instanceof CliError.ShowHelp ? error.errors.map((item) => item.message).join("; ") : getErrorMessage(error)));
74
- })));
75
- if (json) program = Effect.provideService(program, Console.Console, silentConsole);
76
- return program;
77
- }
78
- function create(input = {}) {
79
- return applicationRuntime.runPromise(runCreateCommandEffect(input).pipe(Effect.asVoid));
80
- }
81
-
82
- //#endregion
83
- export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
2
+ import { c as AgentSkillTargetSchema, d as CreateTemplateSchema, f as DatabaseProviderSchema, i as runCreatePrismaCli, l as AuthoringStyleSchema, n as createCreatePrismaCli, o as CREATE_PRISMA_RESULT_SCHEMA_VERSION, p as PackageManagerSchema, r as createPrismaCommand, s as CreateCommandResultSchema, t as create, u as CreateCommandInputSchema } from "./src-Dnqle6oR.mjs";
3
+ export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };