create-prisma 0.11.7 → 0.12.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/README.md +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +8 -4
- package/dist/index.mjs +19 -10
- package/dist/{json-output-Cow6mEVn.mjs → json-output-CH9M3gTl.mjs} +101 -20
- package/package.json +1 -1
- package/templates/create/_shared/prisma.config.ts.hbs +1 -1
- package/templates/create/nuxt/package.json.hbs +1 -1
package/README.md
CHANGED
|
@@ -60,6 +60,7 @@ older cached version. Prisma Compute does not support Deno deployments yet.
|
|
|
60
60
|
- `--package-manager npm|pnpm|yarn|bun|deno`
|
|
61
61
|
- `--deploy` / `--no-deploy`
|
|
62
62
|
- `--workspace <id-or-name>`
|
|
63
|
+
- `--skills <agents>|none`: agents to install skill files for, comma-separated from `claude`, `cursor`, `agents`, `devin` (default: all). `--skills none` writes no `.claude/`, `.cursor/`, `.agents/`, or `.devin/` directories, no `postinstall` hook, and no `skills:sync` script, and records `skills: { agents: [] }` in `prisma.config.ts`. Interactive runs ask instead.
|
|
63
64
|
- `--yes`
|
|
64
65
|
- `--force`: overwrite generated starter and Prisma files in a non-empty directory. This replaces existing Prisma config, contract, and database-client files; back up edits first. A non-empty standard `migrations` path is protected: use a new directory for a fresh starter, or continue working in the existing project with the Prisma CLI. Custom migration paths are not detected.
|
|
65
66
|
- `--verbose`
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ApplicationLayer } from "./json-output-
|
|
2
|
+
import { a as ApplicationLayer } from "./json-output-CH9M3gTl.mjs";
|
|
3
3
|
import { runCreatePrismaCli } from "./index.mjs";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
import { NodeRuntime } from "@effect/platform-node-shared";
|
package/dist/index.d.mts
CHANGED
|
@@ -41,6 +41,7 @@ declare class CommandRunner extends CommandRunner_base {
|
|
|
41
41
|
declare const DatabaseProviderSchema: Schema.Literals<readonly ["postgres", "mongo"]>;
|
|
42
42
|
declare const PackageManagerSchema: Schema.Literals<readonly ["npm", "pnpm", "yarn", "bun", "deno"]>;
|
|
43
43
|
declare const AuthoringStyleSchema: Schema.Literals<readonly ["psl", "typescript"]>;
|
|
44
|
+
declare const AgentSkillTargetSchema: Schema.Literals<readonly ["claude", "cursor", "agents", "devin"]>;
|
|
44
45
|
declare const CreateTemplateSchema: Schema.Literals<readonly ["minimal", "hono", "elysia", "nest", "next", "svelte", "astro", "nuxt", "tanstack-start"]>;
|
|
45
46
|
declare const CreateCommandInputSchema: Schema.Struct<{
|
|
46
47
|
readonly name: Schema.optionalKey<Schema.Trim>;
|
|
@@ -51,6 +52,7 @@ declare const CreateCommandInputSchema: Schema.Struct<{
|
|
|
51
52
|
readonly packageManager: Schema.optionalKey<Schema.Literals<readonly ["npm", "pnpm", "yarn", "bun", "deno"]>>;
|
|
52
53
|
readonly deploy: Schema.optionalKey<Schema.Boolean>;
|
|
53
54
|
readonly workspace: Schema.optionalKey<Schema.decodeTo<Schema.NonEmptyString, Schema.Trim, never, never>>;
|
|
55
|
+
readonly skills: Schema.optionalKey<Schema.decodeTo<Schema.NonEmptyString, Schema.Trim, never, never>>;
|
|
54
56
|
readonly yes: Schema.optionalKey<Schema.Boolean>;
|
|
55
57
|
readonly verbose: Schema.optionalKey<Schema.Boolean>;
|
|
56
58
|
readonly json: Schema.optionalKey<Schema.Boolean>;
|
|
@@ -60,7 +62,7 @@ type CreateCommandInput = typeof CreateCommandInputSchema.Type;
|
|
|
60
62
|
//#region src/create-outcome.d.ts
|
|
61
63
|
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"]>;
|
|
62
64
|
type CreateFailureStage = typeof CreateFailureStageSchema.Type;
|
|
63
|
-
declare const CreateCancellationStageSchema: Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "deployment_intent", "select_workspace"]>;
|
|
65
|
+
declare const CreateCancellationStageSchema: Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "select_workspace"]>;
|
|
64
66
|
type CreateCancellationStage = typeof CreateCancellationStageSchema.Type;
|
|
65
67
|
//#endregion
|
|
66
68
|
//#region src/result.d.ts
|
|
@@ -116,7 +118,7 @@ declare const CreateCommandFailureResultSchema: Schema.Struct<{
|
|
|
116
118
|
readonly schemaVersion: Schema.Literal<1>;
|
|
117
119
|
readonly ok: Schema.Literal<false>;
|
|
118
120
|
readonly error: Schema.Struct<{
|
|
119
|
-
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", "deployment_intent", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
|
|
121
|
+
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", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
|
|
120
122
|
readonly message: Schema.String;
|
|
121
123
|
}>;
|
|
122
124
|
readonly project: Schema.optionalKey<Schema.Struct<{
|
|
@@ -163,7 +165,7 @@ declare const CreateCommandResultSchema: Schema.Union<readonly [Schema.Struct<{
|
|
|
163
165
|
readonly schemaVersion: Schema.Literal<1>;
|
|
164
166
|
readonly ok: Schema.Literal<false>;
|
|
165
167
|
readonly error: Schema.Struct<{
|
|
166
|
-
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", "deployment_intent", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
|
|
168
|
+
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", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
|
|
167
169
|
readonly message: Schema.String;
|
|
168
170
|
}>;
|
|
169
171
|
readonly project: Schema.optionalKey<Schema.Struct<{
|
|
@@ -187,6 +189,7 @@ declare const createPrismaCommand: Command.Command<"create-prisma", {
|
|
|
187
189
|
readonly packageManager: "npm" | "pnpm" | "yarn" | "bun" | "deno" | undefined;
|
|
188
190
|
readonly deploy: boolean | undefined;
|
|
189
191
|
readonly workspace: string | undefined;
|
|
192
|
+
readonly skills: string | undefined;
|
|
190
193
|
readonly force: boolean | undefined;
|
|
191
194
|
readonly yes: boolean | undefined;
|
|
192
195
|
readonly verbose: boolean | undefined;
|
|
@@ -201,6 +204,7 @@ declare function createCreatePrismaCli(): Command.Command<"create-prisma", {
|
|
|
201
204
|
readonly packageManager: "npm" | "pnpm" | "yarn" | "bun" | "deno" | undefined;
|
|
202
205
|
readonly deploy: boolean | undefined;
|
|
203
206
|
readonly workspace: string | undefined;
|
|
207
|
+
readonly skills: string | undefined;
|
|
204
208
|
readonly force: boolean | undefined;
|
|
205
209
|
readonly yes: boolean | undefined;
|
|
206
210
|
readonly verbose: boolean | undefined;
|
|
@@ -209,4 +213,4 @@ declare function createCreatePrismaCli(): Command.Command<"create-prisma", {
|
|
|
209
213
|
declare function runCreatePrismaCli(argv?: readonly string[]): Effect.Effect<void, never, Command.Environment | CommandRunner>;
|
|
210
214
|
declare function create(input?: CreateCommandInput): Promise<void>;
|
|
211
215
|
//#endregion
|
|
212
|
-
export { 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 };
|
|
216
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as
|
|
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-CH9M3gTl.mjs";
|
|
3
3
|
import { Console, Effect, Option } from "effect";
|
|
4
4
|
import { Argument, CliError, Command, Flag } from "effect/unstable/cli";
|
|
5
5
|
|
|
6
6
|
//#region src/index.ts
|
|
7
|
-
const CLI_VERSION = "0.
|
|
7
|
+
const CLI_VERSION = "0.12.0";
|
|
8
8
|
const optionalArgument = (name, description) => Argument.string(name).pipe(Argument.withDescription(description), Argument.optional, Argument.map(Option.getOrUndefined));
|
|
9
9
|
const optionalBoolean = (name, description) => Flag.boolean(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
|
|
10
10
|
const optionalString = (name, description) => Flag.string(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
|
|
@@ -17,6 +17,7 @@ const createPrismaCommand = Command.make("create-prisma", {
|
|
|
17
17
|
packageManager: Flag.choice("package-manager", packageManagers).pipe(Flag.withDescription("Package manager used for dependency installation"), Flag.optional, Flag.map(Option.getOrUndefined)),
|
|
18
18
|
deploy: optionalBoolean("deploy", "Deploy the generated app to Prisma immediately"),
|
|
19
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`),
|
|
20
21
|
force: optionalBoolean("force", "Overwrite generated starter and Prisma files; refuses a non-empty migrations path"),
|
|
21
22
|
yes: optionalBoolean("yes", "Skip prompts and accept default choices"),
|
|
22
23
|
verbose: optionalBoolean("verbose", "Show verbose command output during setup"),
|
|
@@ -30,6 +31,7 @@ const createPrismaCommand = Command.make("create-prisma", {
|
|
|
30
31
|
...options.packageManager ? { packageManager: options.packageManager } : {},
|
|
31
32
|
...options.deploy !== void 0 ? { deploy: options.deploy } : {},
|
|
32
33
|
...options.workspace ? { workspace: options.workspace } : {},
|
|
34
|
+
...options.skills ? { skills: options.skills } : {},
|
|
33
35
|
...options.force !== void 0 ? { force: options.force } : {},
|
|
34
36
|
...options.yes !== void 0 ? { yes: options.yes } : {},
|
|
35
37
|
...options.verbose !== void 0 ? { verbose: options.verbose } : {},
|
|
@@ -38,13 +40,20 @@ const createPrismaCommand = Command.make("create-prisma", {
|
|
|
38
40
|
const result = yield* runCreateCommandEffect(input);
|
|
39
41
|
if (input.json) yield* writeJsonResult(result);
|
|
40
42
|
if (!result.ok) yield* Effect.sync(() => void (process.exitCode = 1));
|
|
41
|
-
})).pipe(Command.withDescription("Create a new project with Prisma setup"), Command.withExamples([
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
+
]));
|
|
48
57
|
const silentConsole = Object.assign(Object.create(console), {
|
|
49
58
|
log() {},
|
|
50
59
|
error() {}
|
|
@@ -71,4 +80,4 @@ function create(input = {}) {
|
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
//#endregion
|
|
74
|
-
export { AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
|
|
83
|
+
export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
|
|
@@ -66,6 +66,7 @@ const CreateCancellationStageSchema = Schema.Literals([
|
|
|
66
66
|
"database_provider",
|
|
67
67
|
"authoring_style",
|
|
68
68
|
"package_manager",
|
|
69
|
+
"agent_skills",
|
|
69
70
|
"deployment_intent",
|
|
70
71
|
"select_workspace"
|
|
71
72
|
]);
|
|
@@ -115,6 +116,13 @@ const packageManagers = [
|
|
|
115
116
|
"deno"
|
|
116
117
|
];
|
|
117
118
|
const authoringStyles = ["psl", "typescript"];
|
|
119
|
+
const agentSkillTargets = [
|
|
120
|
+
"claude",
|
|
121
|
+
"cursor",
|
|
122
|
+
"agents",
|
|
123
|
+
"devin"
|
|
124
|
+
];
|
|
125
|
+
const SKILLS_NONE = "none";
|
|
118
126
|
const createTemplates = [
|
|
119
127
|
"minimal",
|
|
120
128
|
"hono",
|
|
@@ -130,6 +138,7 @@ const DatabaseProviderInputSchema = Schema.Literals(databaseProviderInputs);
|
|
|
130
138
|
const DatabaseProviderSchema = Schema.Literals(databaseProviders);
|
|
131
139
|
const PackageManagerSchema = Schema.Literals(packageManagers);
|
|
132
140
|
const AuthoringStyleSchema = Schema.Literals(authoringStyles);
|
|
141
|
+
const AgentSkillTargetSchema = Schema.Literals(agentSkillTargets);
|
|
133
142
|
const CreateTemplateSchema = Schema.Literals(createTemplates);
|
|
134
143
|
const OptionalBoolean = Schema.optionalKey(Schema.Boolean);
|
|
135
144
|
const OptionalTrimmedString = Schema.optionalKey(Schema.Trim);
|
|
@@ -144,7 +153,8 @@ const PrismaSetupOptionsSchema = Schema.Struct({
|
|
|
144
153
|
authoring: Schema.optionalKey(AuthoringStyleSchema),
|
|
145
154
|
packageManager: Schema.optionalKey(PackageManagerSchema),
|
|
146
155
|
deploy: OptionalBoolean,
|
|
147
|
-
workspace: OptionalNonEmptyTrimmedString
|
|
156
|
+
workspace: OptionalNonEmptyTrimmedString,
|
|
157
|
+
skills: OptionalNonEmptyTrimmedString
|
|
148
158
|
});
|
|
149
159
|
const PrismaSetupCommandInputSchema = Schema.Struct({
|
|
150
160
|
...CommonCommandOptionsSchema.fields,
|
|
@@ -167,6 +177,37 @@ function normalizeDatabaseProvider(value) {
|
|
|
167
177
|
default: return value;
|
|
168
178
|
}
|
|
169
179
|
}
|
|
180
|
+
function isAgentSkillTarget(name) {
|
|
181
|
+
return agentSkillTargets.includes(name);
|
|
182
|
+
}
|
|
183
|
+
/** Parses `--skills`: a comma-separated list of agent names, or `none`. */
|
|
184
|
+
function parseAgentSkillSelection(value) {
|
|
185
|
+
const names = value.split(",").map((name) => name.trim()).filter((name) => name.length > 0);
|
|
186
|
+
const known = agentSkillTargets.join(", ");
|
|
187
|
+
if (names.includes(SKILLS_NONE)) return names.length === 1 ? {
|
|
188
|
+
ok: true,
|
|
189
|
+
agents: []
|
|
190
|
+
} : {
|
|
191
|
+
ok: false,
|
|
192
|
+
message: `--skills ${SKILLS_NONE} cannot be combined with agent names.`
|
|
193
|
+
};
|
|
194
|
+
const agents = [];
|
|
195
|
+
for (const name of names) {
|
|
196
|
+
if (!isAgentSkillTarget(name)) return {
|
|
197
|
+
ok: false,
|
|
198
|
+
message: `--skills names '${name}', which is not a known agent. Use a comma-separated list of ${known}, or ${SKILLS_NONE}.`
|
|
199
|
+
};
|
|
200
|
+
if (!agents.includes(name)) agents.push(name);
|
|
201
|
+
}
|
|
202
|
+
if (agents.length === 0) return {
|
|
203
|
+
ok: false,
|
|
204
|
+
message: `--skills was given no agent names. Use a comma-separated list of ${known}, or ${SKILLS_NONE}.`
|
|
205
|
+
};
|
|
206
|
+
return {
|
|
207
|
+
ok: true,
|
|
208
|
+
agents
|
|
209
|
+
};
|
|
210
|
+
}
|
|
170
211
|
|
|
171
212
|
//#endregion
|
|
172
213
|
//#region src/result.ts
|
|
@@ -346,7 +387,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
|
|
|
346
387
|
return anonymousId;
|
|
347
388
|
});
|
|
348
389
|
const getCommonProperties = () => ({
|
|
349
|
-
"cli-version": "0.
|
|
390
|
+
"cli-version": "0.12.0",
|
|
350
391
|
"node-version": process.version,
|
|
351
392
|
platform: process.platform,
|
|
352
393
|
arch: process.arch
|
|
@@ -415,6 +456,7 @@ function getBaseCreateProperties(input, context) {
|
|
|
415
456
|
"database-provider": context?.prismaSetupContext.databaseProvider ?? input.provider ?? null,
|
|
416
457
|
"authoring-style": context?.prismaSetupContext.authoring ?? input.authoring ?? null,
|
|
417
458
|
"package-manager": context?.prismaSetupContext.packageManager ?? input.packageManager ?? null,
|
|
459
|
+
"agent-skills": context ? [...context.prismaSetupContext.skillAgents] : input.skills ?? null,
|
|
418
460
|
"should-deploy": context?.prismaSetupContext.shouldDeploy ?? input.deploy ?? null,
|
|
419
461
|
"target-directory-state": context ? getTargetDirectoryState(context) : null
|
|
420
462
|
};
|
|
@@ -730,6 +772,7 @@ function createTemplateContext(options) {
|
|
|
730
772
|
provider: options.provider,
|
|
731
773
|
authoring: options.authoring,
|
|
732
774
|
packageManager: options.packageManager,
|
|
775
|
+
skillAgents: options.skillAgents ?? agentSkillTargets,
|
|
733
776
|
tsdownEntry: tsdownEntries[options.template] ?? null
|
|
734
777
|
};
|
|
735
778
|
}
|
|
@@ -765,10 +808,10 @@ const scaffoldCreateTemplateEffect = Effect.fn("Templates.scaffold")(function* (
|
|
|
765
808
|
const dependencyVersionMap = {
|
|
766
809
|
"@astrojs/node": "^10.0.2",
|
|
767
810
|
"@elysiajs/node": "^1.4.5",
|
|
768
|
-
"@prisma/composer": "0.
|
|
769
|
-
"@prisma/composer-prisma-cloud": "0.
|
|
770
|
-
"@prisma/orm-mongo": "8.0.0-rc.
|
|
771
|
-
"@prisma/orm-postgres": "8.0.0-rc.
|
|
811
|
+
"@prisma/composer": "0.19.0",
|
|
812
|
+
"@prisma/composer-prisma-cloud": "0.19.0",
|
|
813
|
+
"@prisma/orm-mongo": "8.0.0-rc.10",
|
|
814
|
+
"@prisma/orm-postgres": "8.0.0-rc.10",
|
|
772
815
|
"@sveltejs/adapter-node": "^5.3.2",
|
|
773
816
|
"@types/node": "^25.6.2",
|
|
774
817
|
alchemy: "2.0.0-beta.74",
|
|
@@ -843,7 +886,7 @@ const runSetupCommand = Effect.fn("runSetupCommand")(function* (options) {
|
|
|
843
886
|
|
|
844
887
|
//#endregion
|
|
845
888
|
//#region src/tasks/install.ts
|
|
846
|
-
function getPrismaScriptMap(packageManager) {
|
|
889
|
+
function getPrismaScriptMap(packageManager, skillsSync) {
|
|
847
890
|
if (packageManager === "deno") {
|
|
848
891
|
const prismaCommand = (needsDatabase, ...args) => [
|
|
849
892
|
"deno run -A",
|
|
@@ -872,7 +915,7 @@ function getPrismaScriptMap(packageManager) {
|
|
|
872
915
|
migrate: prismaCommand("db", "migrate"),
|
|
873
916
|
"migration:status": prismaCommand("migration", "status"),
|
|
874
917
|
"migration:show": prismaCommand("migration", "show"),
|
|
875
|
-
"skills:sync": `${prismaCommand("skills", "sync")} || exit 0`
|
|
918
|
+
...skillsSync ? { "skills:sync": `${prismaCommand("skills", "sync")} || exit 0` } : {}
|
|
876
919
|
};
|
|
877
920
|
}
|
|
878
921
|
function getComposerScriptMap(packageManager) {
|
|
@@ -933,7 +976,7 @@ const addPackageDependencyEffect = Effect.fn("Dependencies.add")(function* (opts
|
|
|
933
976
|
packageJson.scripts = sortRecord(packageJson.scripts);
|
|
934
977
|
yield* writePackageJson(packageJsonPath, packageJson);
|
|
935
978
|
});
|
|
936
|
-
const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(function* (provider, packageManager, _authoring, projectDir = process.cwd()) {
|
|
979
|
+
const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(function* (provider, packageManager, _authoring, projectDir = process.cwd(), options = {}) {
|
|
937
980
|
const dependencies = [getDbPackages(provider)];
|
|
938
981
|
if (provider === "postgres" && packageManager !== "deno") dependencies.push("temporal-polyfill");
|
|
939
982
|
if (provider === "mongo") dependencies.push("arktype", "mongodb");
|
|
@@ -941,7 +984,7 @@ const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(func
|
|
|
941
984
|
yield* addPackageDependencyEffect({
|
|
942
985
|
dependencies,
|
|
943
986
|
devDependencies: ["@types/node", "prisma"],
|
|
944
|
-
scripts: getPrismaScriptMap(packageManager),
|
|
987
|
+
scripts: getPrismaScriptMap(packageManager, options.skillsSync ?? true),
|
|
945
988
|
projectDir
|
|
946
989
|
});
|
|
947
990
|
});
|
|
@@ -1479,11 +1522,18 @@ const runPrismaInit = Effect.fn("PrismaSetup.init")(function* (context, projectD
|
|
|
1479
1522
|
getContractPath(context.authoring),
|
|
1480
1523
|
"--skip-install"
|
|
1481
1524
|
]);
|
|
1482
|
-
if (context.packageManager === "deno")
|
|
1525
|
+
if (context.packageManager === "deno") {
|
|
1526
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1527
|
+
for (const primer of ["prisma-8.md", "prisma-next.md"]) yield* fs.remove(path.join(projectDir, primer), { force: true });
|
|
1528
|
+
}
|
|
1483
1529
|
});
|
|
1484
1530
|
const initializeAgentSkills = Effect.fn("PrismaSetup.initializeSkills")(function* (context, projectDir) {
|
|
1485
|
-
if (context.
|
|
1486
|
-
yield* runPrismaCli(context, projectDir, [
|
|
1531
|
+
if (context.skillAgents.length === 0) return;
|
|
1532
|
+
yield* runPrismaCli(context, projectDir, [
|
|
1533
|
+
"init",
|
|
1534
|
+
"--yes",
|
|
1535
|
+
`--skills=${context.skillAgents.join(",")}`
|
|
1536
|
+
]);
|
|
1487
1537
|
});
|
|
1488
1538
|
|
|
1489
1539
|
//#endregion
|
|
@@ -1580,6 +1630,29 @@ const promptForPackageManager = Effect.fn("Prompts.packageManager")(function* (d
|
|
|
1580
1630
|
}
|
|
1581
1631
|
return yield* decodePromptValue(PackageManagerSchema, value);
|
|
1582
1632
|
});
|
|
1633
|
+
const promptForAgentSkills = Effect.fn("Prompts.agentSkills")(function* (output) {
|
|
1634
|
+
const value = yield* Effect.tryPromise(() => confirm({
|
|
1635
|
+
message: "Install agent skills for coding assistants (Claude Code, Cursor, Codex, Devin)?",
|
|
1636
|
+
initialValue: true,
|
|
1637
|
+
output
|
|
1638
|
+
}));
|
|
1639
|
+
if (isCancel(value)) {
|
|
1640
|
+
yield* Effect.sync(() => cancel("Operation cancelled.", { output }));
|
|
1641
|
+
return yield* new CreateCancellationError({ stage: "agent_skills" });
|
|
1642
|
+
}
|
|
1643
|
+
return value ? agentSkillTargets : [];
|
|
1644
|
+
});
|
|
1645
|
+
const resolveRequestedAgentSkills = Effect.fn("PrismaSetup.resolveSkills")(function* (value, output) {
|
|
1646
|
+
const selection = parseAgentSkillSelection(value);
|
|
1647
|
+
if (selection.ok) return selection.agents;
|
|
1648
|
+
yield* Effect.sync(() => cancel(selection.message, { output }));
|
|
1649
|
+
return yield* new CreateFailure({
|
|
1650
|
+
stage: "collect_context",
|
|
1651
|
+
reason: "invalid_input",
|
|
1652
|
+
message: selection.message,
|
|
1653
|
+
errorReported: true
|
|
1654
|
+
});
|
|
1655
|
+
});
|
|
1583
1656
|
const promptForDeployment = Effect.fn("Prompts.deployment")(function* (output) {
|
|
1584
1657
|
const value = yield* Effect.tryPromise(() => confirm({
|
|
1585
1658
|
message: "Deploy to Prisma now?",
|
|
@@ -1595,6 +1668,7 @@ const promptForDeployment = Effect.fn("Prompts.deployment")(function* (output) {
|
|
|
1595
1668
|
const collectPrismaSetupContextEffect = Effect.fn("PrismaSetup.collectContext")(function* (input, options = {}) {
|
|
1596
1669
|
const projectDir = path.resolve(options.projectDir ?? process.cwd());
|
|
1597
1670
|
const { json, output, useDefaults } = resolveExecutionSettings(input);
|
|
1671
|
+
const requestedSkillAgents = input.skills === void 0 ? void 0 : yield* resolveRequestedAgentSkills(input.skills, output);
|
|
1598
1672
|
const databaseProvider = input.provider ?? (useDefaults ? DEFAULT_DATABASE_PROVIDER : yield* promptForDatabaseProvider(output));
|
|
1599
1673
|
const authoring = input.authoring ?? (useDefaults ? DEFAULT_AUTHORING : yield* promptForAuthoringStyle(output));
|
|
1600
1674
|
const detectedPackageManager = yield* detectPackageManagerEffect(projectDir);
|
|
@@ -1614,6 +1688,7 @@ const collectPrismaSetupContextEffect = Effect.fn("PrismaSetup.collectContext")(
|
|
|
1614
1688
|
reason: "unsupported_configuration",
|
|
1615
1689
|
message: "Prisma Compute does not support Deno deployments yet. Use --no-deploy."
|
|
1616
1690
|
});
|
|
1691
|
+
const skillAgents = packageManager === "deno" ? [] : requestedSkillAgents ?? (useDefaults ? agentSkillTargets : yield* promptForAgentSkills(output));
|
|
1617
1692
|
const shouldDeploy = packageManager === "deno" ? false : input.deploy ?? (json ? true : useDefaults ? false : yield* promptForDeployment(output));
|
|
1618
1693
|
return {
|
|
1619
1694
|
projectDir,
|
|
@@ -1623,6 +1698,7 @@ const collectPrismaSetupContextEffect = Effect.fn("PrismaSetup.collectContext")(
|
|
|
1623
1698
|
databaseProvider,
|
|
1624
1699
|
authoring,
|
|
1625
1700
|
packageManager,
|
|
1701
|
+
skillAgents,
|
|
1626
1702
|
shouldDeploy,
|
|
1627
1703
|
shouldPromptForWorkspace: !useDefaults,
|
|
1628
1704
|
...input.workspace ? { workspace: input.workspace } : {}
|
|
@@ -1708,9 +1784,10 @@ const executePrismaSetupContextEffect = Effect.fn("PrismaSetup.execute")(functio
|
|
|
1708
1784
|
template,
|
|
1709
1785
|
provider: context.databaseProvider,
|
|
1710
1786
|
authoring: context.authoring,
|
|
1711
|
-
packageManager: context.packageManager
|
|
1787
|
+
packageManager: context.packageManager,
|
|
1788
|
+
skillAgents: context.skillAgents
|
|
1712
1789
|
}), "configure_project", "project_configuration_failed");
|
|
1713
|
-
yield* atCreateStage(writePrismaDependenciesEffect(context.databaseProvider, context.packageManager, context.authoring, projectDir), "configure_project", "project_configuration_failed");
|
|
1790
|
+
yield* atCreateStage(writePrismaDependenciesEffect(context.databaseProvider, context.packageManager, context.authoring, projectDir, { skillsSync: context.skillAgents.length > 0 }), "configure_project", "project_configuration_failed");
|
|
1714
1791
|
yield* Effect.sync(() => progress?.message(`Installing dependencies with ${getInstallCommand(context.packageManager)}...`));
|
|
1715
1792
|
yield* atCreateStage(installProjectDependenciesEffect(context.packageManager, projectDir, {
|
|
1716
1793
|
verbose: context.verbose,
|
|
@@ -1725,7 +1802,8 @@ const executePrismaSetupContextEffect = Effect.fn("PrismaSetup.execute")(functio
|
|
|
1725
1802
|
template,
|
|
1726
1803
|
provider: context.databaseProvider,
|
|
1727
1804
|
authoring: context.authoring,
|
|
1728
|
-
packageManager: context.packageManager
|
|
1805
|
+
packageManager: context.packageManager,
|
|
1806
|
+
skillAgents: context.skillAgents
|
|
1729
1807
|
});
|
|
1730
1808
|
yield* ensureComposerTypeScriptOptions(projectDir);
|
|
1731
1809
|
if (context.databaseProvider === "mongo") yield* ensureMongoEnvironment(projectDir);
|
|
@@ -1734,8 +1812,10 @@ const executePrismaSetupContextEffect = Effect.fn("PrismaSetup.execute")(functio
|
|
|
1734
1812
|
yield* ensureGitignoreEntry(projectDir, "/.prisma-composer");
|
|
1735
1813
|
}
|
|
1736
1814
|
}), "configure_project", "project_configuration_failed");
|
|
1737
|
-
|
|
1738
|
-
|
|
1815
|
+
if (context.skillAgents.length > 0) {
|
|
1816
|
+
yield* Effect.sync(() => progress?.message("Installing Prisma agent skills..."));
|
|
1817
|
+
yield* atCreateStage(initializeAgentSkills(context, projectDir), "initialize_agent_skills", "agent_skills_init_failed");
|
|
1818
|
+
}
|
|
1739
1819
|
yield* Effect.sync(() => progress?.message("Generating Prisma 8 contract artifacts..."));
|
|
1740
1820
|
yield* atCreateStage(runPrismaCli(context, projectDir, ["contract", "emit"]), "emit_contract", "contract_emit_failed");
|
|
1741
1821
|
if (context.databaseProvider === "postgres") {
|
|
@@ -2028,7 +2108,8 @@ const executeCreateContext = Effect.fn("Create.execute")(function* (context) {
|
|
|
2028
2108
|
template: context.template,
|
|
2029
2109
|
provider: context.prismaSetupContext.databaseProvider,
|
|
2030
2110
|
authoring: context.prismaSetupContext.authoring,
|
|
2031
|
-
packageManager: context.prismaSetupContext.packageManager
|
|
2111
|
+
packageManager: context.prismaSetupContext.packageManager,
|
|
2112
|
+
skillAgents: context.prismaSetupContext.skillAgents
|
|
2032
2113
|
}).pipe(Effect.andThen(writeCreateTemplateDependenciesEffect({
|
|
2033
2114
|
template: context.template,
|
|
2034
2115
|
packageManager: context.prismaSetupContext.packageManager,
|
|
@@ -2156,4 +2237,4 @@ function isJsonOutputRequested(argv) {
|
|
|
2156
2237
|
const writeJsonResult = Effect.fn("JsonOutput.write")((result) => Effect.sync(() => process.stdout.write(`${JSON.stringify(result)}\n`)));
|
|
2157
2238
|
|
|
2158
2239
|
//#endregion
|
|
2159
|
-
export {
|
|
2240
|
+
export { authoringStyles as _, ApplicationLayer as a, normalizeDatabaseProvider as b, CreateCommandResultSchema as c, AuthoringStyleSchema as d, CreateCommandInputSchema as f, agentSkillTargets as g, PackageManagerSchema as h, getErrorMessage as i, createCommandFailureResult as l, DatabaseProviderSchema as m, writeJsonResult as n, applicationRuntime as o, CreateTemplateSchema as p, runCreateCommandEffect as r, CREATE_PRISMA_RESULT_SCHEMA_VERSION as s, isJsonOutputRequested as t, AgentSkillTargetSchema as u, createTemplates as v, packageManagers as x, databaseProviderInputs as y };
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@ import { defineConfig as ormConfig } from "@prisma/orm-{{#if (eq provider "postg
|
|
|
20
20
|
|
|
21
21
|
export default definePrismaConfig({
|
|
22
22
|
skills: {
|
|
23
|
-
agents: [
|
|
23
|
+
agents: [{{#each skillAgents}}"{{this}}"{{#unless @last}}, {{/unless}}{{/each}}],
|
|
24
24
|
},
|
|
25
25
|
orm: ormConfig({
|
|
26
26
|
contract: "./src/prisma/contract{{#if (eq authoring "typescript")}}.ts{{else}}.prisma{{/if}}",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dev": "nuxt dev",
|
|
12
12
|
"generate": "nuxt generate",
|
|
13
13
|
"preview": "nuxt preview",
|
|
14
|
-
"postinstall": "nuxt prepare && {{runScriptCommand packageManager "skills:sync"}}",
|
|
14
|
+
"postinstall": "nuxt prepare{{#if skillAgents.length}} && {{runScriptCommand packageManager "skills:sync"}}{{/if}}",
|
|
15
15
|
"typecheck": "nuxt typecheck"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|