Skip to content

Commit 3f11367

Browse files
committed
prisma extension fixes WIP
1 parent 1a7ee24 commit 3f11367

File tree

47 files changed

+861
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+861
-12
lines changed

packages/build/src/extensions/prisma.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { cp, readdir } from "node:fs/promises";
66
import { dirname, join, resolve } from "node:path";
77

88
export type PrismaExtensionOptions = {
9-
schema: string;
9+
schema?: string;
10+
config?: string;
1011
migrate?: boolean;
1112
version?: string;
1213
/**
@@ -75,7 +76,7 @@ export class PrismaExtension implements BuildExtension {
7576
}
7677

7778
// Resolve the path to the prisma schema, relative to the config.directory
78-
this._resolvedSchemaPath = resolve(context.workingDir, this.options.schema);
79+
this._resolvedSchemaPath = resolve(context.workingDir, this.options.schema!);
7980

8081
context.logger.debug(`Resolved the prisma schema to: ${this._resolvedSchemaPath}`);
8182

@@ -114,7 +115,7 @@ export class PrismaExtension implements BuildExtension {
114115

115116
const usingSchemaFolder = dirname(this._resolvedSchemaPath).endsWith("schema");
116117

117-
const commands: string[] = [];
118+
let commands: string[] = [];
118119

119120
let prismaDir: string | undefined;
120121

@@ -224,9 +225,10 @@ export class PrismaExtension implements BuildExtension {
224225

225226
await cp(migrationsDir, migrationsDestinationPath, { recursive: true });
226227

227-
commands.push(
228-
`${binaryForRuntime(manifest.runtime)} node_modules/prisma/build/index.js migrate deploy`
229-
);
228+
commands = [
229+
`${binaryForRuntime(manifest.runtime)} node_modules/prisma/build/index.js migrate deploy`,
230+
...commands,
231+
];
230232
}
231233

232234
env.DATABASE_URL = manifest.deploy.env?.DATABASE_URL;

0 commit comments

Comments
 (0)