fix(sdk): Re-export schemaTask types to prevent the TypeScript error TS2742 (#2735)

Fixes this type of error when exporting a `schemaTask` in a monorepo:

```
error TS2742: The inferred type of 'helloWorldSchema' cannot be named without a reference to '@trigger.dev/core/v3'. This is likely not portable.
```
This commit is contained in:
Eric Allam
2025-12-03 16:12:23 +00:00
committed by GitHub
parent 255a73a2fe
commit 9821d02af7
3 changed files with 17 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
fix(sdk): Re-export schemaTask types to prevent the TypeScript error TS2742: The inferred type of 'task' cannot be named without a reference to '@trigger.dev/core/v3'. This is likely not portable.
+4 -1
View File
@@ -28,7 +28,6 @@ import {
TaskRunExecutionResult,
TaskRunPromise,
} from "@trigger.dev/core/v3";
import { PollOptions, runs } from "./runs.js";
import { tracer } from "./tracer.js";
import type {
@@ -115,6 +114,10 @@ export type {
TaskPayload,
TaskRunResult,
TriggerOptions,
TaskWithSchema,
TaskWithSchemaOptions,
TaskSchema,
TaskOptionsWithSchema,
};
export { SubtaskUnwrapError, TaskRunPromise };
+8
View File
@@ -39,6 +39,10 @@ import type {
TriggerOptions,
TaskRunResult,
TaskFromIdentifier,
TaskWithSchemaOptions,
TaskSchema,
TaskWithSchema,
TaskOptionsWithSchema,
} from "./shared.js";
export type {
@@ -56,6 +60,10 @@ export type {
TriggerOptions,
TaskRunResult,
TaskFromIdentifier,
TaskWithSchemaOptions,
TaskSchema,
TaskWithSchema,
TaskOptionsWithSchema,
};
export type * from "./hooks.js";