Skip to content

Commit 2f5d135

Browse files
fix: include Prisma Compute skill in addons (#42)
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
1 parent 0695cdc commit 2f5d135

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ Prisma Compute deployment is currently supported for:
145145
- Prisma IDE extension install
146146

147147
These can be selected interactively or enabled with flags.
148+
When Prisma Compute deploy is selected, the skills add-on recommends the `prisma-compute` skill too.
148149

149150
## Deploy to Prisma Compute
150151

src/commands/create.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ async function collectCreateContext(
342342
useDefaults,
343343
provider: prismaSetupContext.databaseProvider,
344344
shouldUsePrismaPostgres: prismaSetupContext.shouldUsePrismaPostgres,
345+
shouldUseComputeDeploy: Boolean(computeDeployContext),
345346
});
346347
if (addonSetupContext === undefined) {
347348
return;

src/tasks/setup-addons.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,13 @@ type SkillOption = {
113113
};
114114

115115
function getAvailablePrismaSkills(provider: DatabaseProvider): PrismaSkillName[] {
116+
const skills: PrismaSkillName[] = [...SHARED_PRISMA_SKILLS, "prisma-compute"];
117+
116118
if (provider === "postgresql") {
117-
return [...SHARED_PRISMA_SKILLS, "prisma-postgres"];
119+
return [...skills, "prisma-postgres"];
118120
}
119121

120-
return [...SHARED_PRISMA_SKILLS];
122+
return skills;
121123
}
122124

123125
function getSkillOptions(provider: DatabaseProvider): SkillOption[] {
@@ -133,6 +135,11 @@ function getSkillOptions(provider: DatabaseProvider): SkillOption[] {
133135
label: "prisma-client-api",
134136
hint: "Prisma Client query patterns",
135137
},
138+
"prisma-compute": {
139+
value: "prisma-compute",
140+
label: "prisma-compute",
141+
hint: "Prisma Compute deploy and hosting workflows",
142+
},
136143
"prisma-database-setup": {
137144
value: "prisma-database-setup",
138145
label: "prisma-database-setup",
@@ -198,11 +205,16 @@ function uniqueValues<T>(values: T[]): T[] {
198205
function getRecommendedPrismaSkills(
199206
provider: DatabaseProvider,
200207
shouldUsePrismaPostgres: boolean,
208+
shouldUseComputeDeploy: boolean,
201209
): PrismaSkillName[] {
202-
const skills = [...getAvailablePrismaSkills(provider)];
210+
const skills = [...SHARED_PRISMA_SKILLS];
211+
212+
if (provider === "postgresql" && shouldUsePrismaPostgres) {
213+
skills.push("prisma-postgres");
214+
}
203215

204-
if (!shouldUsePrismaPostgres) {
205-
return skills.filter((skill) => skill !== "prisma-postgres");
216+
if (shouldUseComputeDeploy) {
217+
skills.push("prisma-compute");
206218
}
207219

208220
return uniqueValues(skills);
@@ -324,6 +336,7 @@ export async function collectCreateAddonSetupContext(
324336
useDefaults: boolean;
325337
provider: DatabaseProvider;
326338
shouldUsePrismaPostgres: boolean;
339+
shouldUseComputeDeploy: boolean;
327340
},
328341
): Promise<CreateAddonSetupContext | null | undefined> {
329342
const hasExplicitAddonSelection =
@@ -359,6 +372,7 @@ export async function collectCreateAddonSetupContext(
359372
const recommendedSkills = getRecommendedPrismaSkills(
360373
options.provider,
361374
options.shouldUsePrismaPostgres,
375+
options.shouldUseComputeDeploy,
362376
);
363377
const skills = !addons.includes("skills")
364378
? []

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const extensionTargets = ["vscode", "cursor", "windsurf"] as const;
2727
export const prismaSkillNames = [
2828
"prisma-cli",
2929
"prisma-client-api",
30+
"prisma-compute",
3031
"prisma-database-setup",
3132
"prisma-upgrade-v7",
3233
"prisma-postgres",

0 commit comments

Comments
 (0)