Skip to content

Commit ed2a26c

Browse files
authored
v3: fix additionalFiles, uncaught exceptions, and improve errors (#1048)
* fix additionalFiles for paths up the tree * warn if additionalFiles pattern produced no matches * improve deploy warnings and errors, fail early * changeset
1 parent 4a68e71 commit ed2a26c

File tree

6 files changed

+364
-32
lines changed

6 files changed

+364
-32
lines changed

.changeset/angry-eagles-trade.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
- Fix additionalFiles that aren't decendants
7+
- Stop swallowing uncaught exceptions in prod
8+
- Improve warnings and errors, fail early on critical warnings
9+
- New arg to --save-logs even for successful builds

docs/v3/trigger-config.mdx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const config: TriggerConfig = {
5353

5454
## ESM-only packages
5555

56-
We'll let you know when run the CLI dev command if this is a problem. Some packages are ESM-only so they don't work directly from CJS when using Node.js. In that case you need to add them to the `dependenciesToBundle` array in your `trigger.config.ts` file.
56+
We'll let you know when running the CLI dev command if this is a problem. Some packages are ESM-only so they don't work directly from CJS when using Node.js. In that case you need to add them to the `dependenciesToBundle` array in your `trigger.config.ts` file.
5757

5858
```ts trigger.config.ts
5959
import type { TriggerConfig } from "@trigger.dev/sdk/v3";
@@ -92,14 +92,27 @@ Prisma works by generating a client from your `prisma.schema` file. This means y
9292
9393
<Step title="package.json postinstall `prisma generate`">
9494
95-
```json
95+
96+
<CodeGroup>
97+
98+
```json default path
9699
{
97100
"scripts": {
98101
"postinstall": "prisma generate"
99102
}
100103
}
101104
```
102105
106+
```json custom path
107+
{
108+
"scripts": {
109+
"postinstall": "prisma generate --schema=./custom/path/to/schema.prisma"
110+
}
111+
}
112+
```
113+
114+
</CodeGroup>
115+
103116
Anything you put in `postinstall` will be run as part of the install step. This is how Next.js recommends you set up Prisma anyway.
104117
105118
</Step>
@@ -111,7 +124,12 @@ Prisma works by generating a client from your `prisma.schema` file. This means y
111124

112125
export const config: TriggerConfig = {
113126
//..other stuff
127+
128+
// using the default path
114129
additionalFiles: ["./prisma/schema.prisma"],
130+
// or a custom path, for example in a monorepo
131+
additionalFiles: ["../../custom/path/to/schema.prisma"],
132+
115133
additionalPackages: ["prisma@5.11.0"],
116134
};
117135
```

0 commit comments

Comments
 (0)