Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/typescript-seven-builds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"trigger.dev": patch
"@trigger.dev/build": patch
"@trigger.dev/redis-worker": patch
---

Refresh package builds for TypeScript 7 compatibility while preserving existing runtime entry points. TypeScript remains an optional peer for the decorator metadata build extension, so installing the Trigger.dev CLI does not install an additional compiler.
2 changes: 1 addition & 1 deletion apps/webapp/app/utils/searchParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function createSearchParams<TParams extends ParamType>(
return { success: true, params: new SearchParams<TParams>(parsed.params as TParams, schema) };
}

function parseSearchParams<TParams extends ParamType>(params: TParams, schema: ZodType<TParams>) {
function parseSearchParams<TParams>(params: unknown, schema: ZodType<TParams>) {
const parsedParams = schema.safeParse(params);

if (!parsedParams.success) {
Expand Down
2 changes: 2 additions & 0 deletions apps/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@
"tailwindcss": "^4.3.1",
"tsconfig-paths": "^3.14.1",
"tsx": "^4.20.6",
"typescript": "catalog:",
"typescript-legacy-api": "npm:typescript@6.0.3",
"vite-tsconfig-paths": "^5.1.4",
"vite": "^6.4.2"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/scripts/runOpsLegacyGuard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* pnpm --filter webapp run guard:runops-legacy # regenerate baseline
* pnpm --filter webapp run guard:runops-legacy -- --check # CI gate
*/
import ts from "typescript";
import ts from "typescript-legacy-api";
import * as fs from "node:fs";
import * as path from "node:path";

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"pkg-pr-new": "0.0.75",
"pkg-types": "1.1.3",
"tsx": "^3.7.1",
"turbo": "^1.10.3",
"turbo": "^1.13.4",
"typescript": "catalog:",
"vite-tsconfig-paths": "^4.0.5",
"vitest": "4.1.7"
Expand All @@ -90,11 +90,9 @@
"antlr4ts@0.5.0-alpha.4": "patches/antlr4ts@0.5.0-alpha.4.patch",
"@window-splitter/state@1.1.3": "patches/@window-splitter__state@1.1.3.patch",
"streamdown@2.5.0": "patches/streamdown@2.5.0.patch",
"tsup@8.4.0": "patches/tsup@8.4.0.patch",
"@remix-run/router@1.23.3": "patches/@remix-run__router@1.23.3.patch"
},
"overrides": {
"typescript": "catalog:",
"@types/node": "24.13.3",
"react@^18": "18.3.1",
"react-dom@^18": "18.3.1",
Expand Down
13 changes: 11 additions & 2 deletions packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,17 @@
"@types/resolve": "^1.20.6",
"esbuild": "^0.23.0",
"rimraf": "6.0.1",
"tshy": "^3.0.2",
"tsx": "4.17.0"
"tshy": "^4.1.3",
"tsx": "4.17.0",
"typescript": "6.0.3"
},
"peerDependencies": {
"typescript": ">=5.0.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"engines": {
"node": ">=18.20.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"find-up": "^7.0.0",
"rimraf": "^6.0.1",
"ts-essentials": "10.0.1",
"tshy": "^3.0.2",
"tshy": "^4.1.3",
"tsx": "4.17.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"rimraf": "^6.0.1",
"superjson": "^2.2.1",
"ts-essentials": "10.0.1",
"tshy": "^3.0.2",
"tshy": "^4.1.3",
"tsx": "4.17.0"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
},
"scripts": {
"clean": "rimraf dist .turbo",
"build": "tsup",
"dev": "tsup --watch",
"build": "tsdown",
"dev": "tsdown --watch",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/node": "^24.13.3",
"rimraf": "6.0.1",
"tsup": "^8.4.0",
"tsdown": "0.22.10",
"typescript": "catalog:"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineConfig } from "tsup";
import { defineConfig } from "tsdown";

export default defineConfig({
entry: ["src/index.ts"],
format: ["cjs", "esm"],
fixedExtension: false,
dts: true,
splitting: false,
sourcemap: true,
clean: true,
treeshake: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"devDependencies": {
"@types/node": "^24.13.3",
"rimraf": "6.0.1",
"tshy": "^3.0.2",
"tshy": "^4.1.3",
"typescript": "catalog:",
"tsx": "4.17.0",
"esbuild": "^0.23.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/react": "*",
"@types/react-dom": "*",
"rimraf": "^6.0.1",
"tshy": "^3.0.2",
"tshy": "^4.1.3",
"tsx": "4.17.0"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/redis-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
],
"scripts": {
"clean": "rimraf dist .turbo",
"build": "tsup",
"dev": "tsup --watch",
"build": "tsdown",
"dev": "tsdown --watch",
"typecheck": "tsc --noEmit -p tsconfig.src.json",
"test": "vitest --sequence.concurrent=false --no-file-parallelism"
},
Expand All @@ -38,7 +38,7 @@
"@types/lodash.omit": "^4.5.7",
"@types/seedrandom": "^3.0.8",
"rimraf": "6.0.1",
"tsup": "^8.4.0",
"tsdown": "0.22.10",
"tsx": "4.17.0"
},
"engines": {
Expand Down
9 changes: 5 additions & 4 deletions packages/redis-worker/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { nanoid } from "nanoid";
import pLimit from "p-limit";
import { z } from "zod";
import { type AnyQueueItem, SimpleQueue } from "./queue.js";
import { parseExpression } from "cron-parser";
import cronParser from "cron-parser";

export const CronSchema = z.object({
cron: z.string(),
Expand Down Expand Up @@ -1130,9 +1130,10 @@ class Worker<TCatalog extends WorkerCatalog> {
}

private calculateNextScheduledAt(cron: string, lastTimestamp?: Date): Date {
const scheduledAt = parseExpression(cron, {
currentDate: lastTimestamp,
})
const scheduledAt = cronParser
.parseExpression(cron, {
currentDate: lastTimestamp,
})
.next()
.toDate();

Expand Down
74 changes: 74 additions & 0 deletions packages/redis-worker/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { defineConfig } from "tsdown";

export default defineConfig({
entry: ["src/index.ts"],
format: ["cjs", "esm"],
fixedExtension: false,
tsconfig: "tsconfig.src.json",
dts: {
sourcemap: false,
},
sourcemap: true,
// The CJS declarations are emitted in a separate pass, so their output can
// disable source maps without affecting the runtime bundle.
outputOptions(options, _format, { cjsDts }) {
if (!cjsDts) return;

return {
...options,
sourcemap: false,
};
},
clean: true,
treeshake: true,
minify: false,
deps: {
onlyBundle: false,
alwaysBundle: [
// Always bundle internal packages
/^@internal/,
// Always bundle ESM-only packages
"nanoid",
"p-limit",
],
dts: {
// The TypeScript 7 declaration emitter consumes referenced package declarations.
neverBundle: [/^@internal/],
},
Comment thread
carderne marked this conversation as resolved.
},
// rolldown injects its own `__require` helper in the ESM output as
// `createRequire(import.meta.url)` with no fallback. When this ESM bundle is
// re-bundled into a CJS consumer (e.g. the webapp server), esbuild replaces
// `import.meta.url` with `undefined`, so `createRequire(undefined)` throws at
// startup. Patch the helper to fall back to a valid path, matching the
// fallback the previous tsup banner provided.
plugins: [
// The ESM declarations share an output pass with the runtime bundle.
// Remove their dangling map comment while retaining runtime source maps.
{
name: "strip-declaration-sourcemap-comments",
generateBundle(_options, bundle) {
for (const output of Object.values(bundle)) {
if (output.type !== "chunk" || !/\.d\.(?:c|m)?ts$/.test(output.fileName)) {
continue;
}

output.code = output.code.replace(/\n?\/\/# sourceMappingURL=.*$/m, "");
}
},
},
{
name: "resilient-create-require",
renderChunk(code: string) {
if (!code.includes("createRequire(import.meta.url)")) return null;
return {
code: code.replaceAll(
"createRequire(import.meta.url)",
"createRequire(import.meta.url || process.cwd() + '/index.js')"
),
map: null,
};
},
},
],
});
27 changes: 0 additions & 27 deletions packages/redis-worker/tsup.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/rsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@types/react": "*",
"@types/react-dom": "*",
"rimraf": "^6.0.1",
"tshy": "^3.0.2",
"tshy": "^4.1.3",
"tsx": "4.17.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/schema-to-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"arktype": "^2.0.0",
"runtypes": "^6.7.0",
"superstruct": "^2.0.2",
"tshy": "^3.0.2",
"tshy": "^4.1.3",
"@sinclair/typebox": "^0.34.3",
"valibot": "^1.1.0",
"yup": "^1.7.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/trigger-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@
"ai-v7": "npm:ai@7.0.0-canary.159",
"encoding": "^0.1.13",
"rimraf": "^6.0.1",
"tshy": "^3.0.2",
"tshy": "^4.1.3",
"tsx": "4.17.0",
"typed-emitter": "^2.1.0",
"typescript": "catalog:",
"zod": "3.25.76"
},
"peerDependencies": {
Expand Down
Loading
Loading