Skip to content

Commit b549399

Browse files
committed
Update to latest from beta docs
1 parent a1cc839 commit b549399

File tree

1 file changed

+24
-39
lines changed

1 file changed

+24
-39
lines changed

docs/upgrading-beta.mdx

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
---
22
title: "Upgrade to new build system"
33
sidebarTitle: "Beta Upgrade"
4-
description: "How to use the new build system preview release"
4+
description: "How to update to 3.0.0 from the beta"
55
---
66

7-
Based on feedback and a steady flow of issues from our previous build system, we're happy to share with you a preview release of our new build system that (hopefully) fixes most of the issues you may have faced.
7+
The Trigger.dev packages are now at version `3.0.x` in the `latest` tag. This is our first official release of v3 under the latest tag, and we recommend anyone still using packages in the `beta` tag to upgrade to the latest version. This guide will help you upgrade your project to the latest version of Trigger.dev.
8+
9+
The major changes in this release are a new build system, which is more flexible and powerful than the previous build system. We've also made some changes to the `trigger.dev` CLI to improve the developer experience.
810

911
The main features of the new build sytem are:
1012

@@ -16,26 +18,26 @@ The main features of the new build sytem are:
1618

1719
## Update packages
1820

19-
To use the new build system, you have to update to use our preview packages. Update the `@trigger.dev/sdk` package in your package.json:
21+
To use the new build system, you have to update to use our latest packages. Update the `@trigger.dev/sdk` package in your package.json:
2022

2123
```json
22-
"@trigger.dev/sdk": "0.0.0-prerelease-20240911144933"
24+
"@trigger.dev/sdk": "^3.0.0",
2325
```
2426

25-
You will also need to update your usage of the `trigger.dev` CLI to use the preview release. If you run the CLI via `npx` you can update to the preview release like so:
27+
You will also need to update your usage of the `trigger.dev` CLI to use the latest release. If you run the CLI via `npx` you can update to the latest release like so:
2628

2729
```sh
2830
# old way
29-
npx trigger.dev@latest dev
31+
npx trigger.dev@3.0.0-beta.56 dev
3032

31-
# using the preview release
32-
npx trigger.dev@0.0.0-prerelease-20240911144933 dev
33+
# using the latest release
34+
npx trigger.dev@latest dev
3335
```
3436

35-
If you've added the `trigger.dev` CLI to your `devDependencies`, then you should update the version to point to the preview release:
37+
If you've added the `trigger.dev` CLI to your `devDependencies`, then you should update the version to point to the latest release:
3638

3739
```json
38-
"trigger.dev": "0.0.0-prerelease-20240911144933"
40+
"trigger.dev": "^3.0.0",
3941
```
4042

4143
Once you do that make sure you re-install your dependencies using `npm i` or the equivalent with your preferred package manager.
@@ -86,7 +88,7 @@ The `additionalFiles` option has been moved to our new build extension system.
8688
To use build extensions, you'll need to add the `@trigger.dev/build` package to your `devDependencies`:
8789

8890
```sh
89-
npm add @trigger.dev/build@0.0.0-prerelease-20240911144933 -D
91+
npm add @trigger.dev/build@latest -D
9092
```
9193

9294
Now you can import the `additionalFiles` build extension and use it in your `trigger.config.ts` file:
@@ -112,7 +114,7 @@ The `additionalPackages` option has been moved to our new build extension system
112114
To use build extensions, you'll need to add the `@trigger.dev/build` package to your `devDependencies`:
113115

114116
```sh
115-
npm add @trigger.dev/build@0.0.0-prerelease-20240911144933 -D
117+
npm add @trigger.dev/build@latest -D
116118
```
117119

118120
Now you can import the `additionalPackages` build extension and use it in your `trigger.config.ts` file:
@@ -136,7 +138,7 @@ The `resolveEnvVars` export has been moved to our new build extension system.
136138
To use build extensions, you'll need to add the `@trigger.dev/build` package to your `devDependencies`:
137139

138140
```sh
139-
npm add @trigger.dev/build@0.0.0-prerelease-20240911144933 -D
141+
npm add @trigger.dev/build@latest -D
140142
```
141143

142144
Now you can import the `syncEnvVars` build extension and use it in your `trigger.config.ts` file:
@@ -184,7 +186,7 @@ export default defineConfig({
184186
We've created a build extension to support using Prisma in your Trigger.dev tasks. To use this extension, you'll need to add the `@trigger.dev/build` package to your `devDependencies`:
185187

186188
```sh
187-
npm add @trigger.dev/build@0.0.0-prerelease-20240911144933 -D
189+
npm add @trigger.dev/build@latest -D
188190
```
189191

190192
Then you can import the `prismaExtension` build extension and use it in your `trigger.config.ts` file, passing in the path to your Prisma schema file:
@@ -325,7 +327,7 @@ export default defineConfig({
325327
We no longer run typechecking during the deploy command. This was causing issues with some projects, and we found that it wasn't necessary to run typechecking during the deploy command. If you want to run typechecking before deploying to Trigger.dev, you can run the `tsc` command before running the `deploy` command.
326328

327329
```sh
328-
tsc && npx trigger.dev@0.0.0-prerelease-20240911144933 deploy
330+
tsc && npx trigger.dev@latest deploy
329331
```
330332

331333
Or if you are using GitHub actions, you can add an additional step to run the `tsc` command before deploying to Trigger.dev.
@@ -341,15 +343,15 @@ Or if you are using GitHub actions, you can add an additional step to run the `t
341343
env:
342344
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
343345
run: |
344-
npx trigger.dev@0.0.0-prerelease-20240911144933 deploy
346+
npx trigger.dev@latest deploy
345347
```
346348
347349
### deploy --dry-run
348350
349351
You can now inspect the build output of your project without actually deploying it to Trigger.dev by using the `--dry-run` flag:
350352

351353
```sh
352-
npx trigger.dev@0.0.0-prerelease-20240911144933 deploy --dry-run
354+
npx trigger.dev@latest deploy --dry-run
353355
```
354356

355357
This will save the build output and print the path to the build output directory. If you face any issues with deploying, please include the build output in your issue report.
@@ -359,8 +361,8 @@ This will save the build output and print the path to the build output directory
359361
You can now pass the path to your local `.env` file using the `--env-file` flag during `dev` and `deploy` commands:
360362

361363
```sh
362-
npx trigger.dev@0.0.0-prerelease-20240911144933 dev --env-file ../../.env
363-
npx trigger.dev@0.0.0-prerelease-20240911144933 deploy --env-file ../../.env
364+
npx trigger.dev@latest dev --env-file ../../.env
365+
npx trigger.dev@latest deploy --env-file ../../.env
364366
```
365367

366368
The `.env` file works slightly differently in `dev` vs `deploy`:
@@ -382,7 +384,7 @@ Debugging your tasks code in `dev` is now supported via VS Code, without having
382384
"request": "launch",
383385
"cwd": "${workspaceFolder}",
384386
"runtimeExecutable": "npx",
385-
"runtimeArgs": ["trigger.dev@0.0.0-prerelease-20240911144933", "dev"],
387+
"runtimeArgs": ["trigger.dev@latest", "dev"],
386388
"skipFiles": ["<node_internals>/**"],
387389
"sourceMaps": true
388390
}
@@ -397,15 +399,15 @@ Then you can start debugging your tasks code by selecting the `Trigger.dev: Dev`
397399
You can now authenticate the `dev` command using the `TRIGGER_ACCESS_TOKEN` environment variable. Previously this was only supported in the `deploy` command.
398400

399401
```sh
400-
TRIGGER_ACCESS_TOKEN=<your access token> npx trigger.dev@0.0.0-prerelease-20240911144933 dev
402+
TRIGGER_ACCESS_TOKEN=<your access token> npx trigger.dev@latest dev
401403
```
402404

403405
### Better deploy support for self-hosters
404406

405407
You can now specify a custom registry and namespace when deploying via a self-hosted instance of Trigger.dev:
406408

407409
```sh
408-
npx trigger.dev@0.0.0-prerelease-20240911144933 deploy --self-hosted --load-image --push --registry docker.io --namespace mydockerhubusername
410+
npx trigger.dev@latest deploy --self-hosted --load-image --push --registry docker.io --namespace mydockerhubusername
409411
```
410412

411413
All you have to do is create a repository in dockerhub that matches the project ref of your Trigger.dev project (e.g. `proj_rrkpdguyagvsoktglnod`)
@@ -420,20 +422,3 @@ All you have to do is create a repository in dockerhub that matches the project
420422

421423
- Path aliases are not yet support in your `trigger.config.ts` file. To workaround this issue you'll need to rewrite path aliases to their relative paths. (See [this](https://github.com/unjs/jiti/issues/166) and [this](https://knip.dev/reference/known-issues#path-aliases-in-config-files)) for more info.
422424
- `*.test.ts` and `.spec.ts` files inside the trigger dirs will be bundled and could cause issues. You'll need to move these files outside of the trigger dirs to avoid this issue.
423-
424-
## Changelog
425-
426-
### Changes and fixes in `0.0.0-prerelease-20240911144933`
427-
428-
- Fixed an issue where empty env vars in dev runs were overriding local `.env` file values.
429-
- Fixed an issue when importing v2 `@trigger.dev/sdk` would throw an error because of a missing package.json
430-
- Fixed node10 moduleResolution with some types
431-
- Added the ability to push to a custom registry when deploying to a self-hosted instance of Trigger.dev
432-
- Fix stuck dev runs when a child run fails with a process.exit
433-
- No longer ignoring `--project-ref` in the `deploy` command
434-
- No longer ignoring the `--config` option in the `deploy` command
435-
- Fixed the flushing of logs to the server when deployed.
436-
- `emitDecoratorMetadata` build extension now works when tsconfig.json file extends another tsconfig.json file
437-
- We now have the ability to force certain packages to be external (i.e. not be bundled), starting with `headers-generator`
438-
- You can now call `init` with the `--javascript` flag to initialize a project with JavaScript instead of TypeScript
439-
- Add support for Prisma TypedSQL in the prisma extension

0 commit comments

Comments
 (0)