Skip to content

Commit 5f35b92

Browse files
committed
fix(redis-worker): omit dangling declaration map references
1 parent 1d1bee1 commit 5f35b92

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/build": patch
4+
"@trigger.dev/redis-worker": patch
5+
---
6+
7+
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.

packages/redis-worker/tsdown.config.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@ export default defineConfig({
55
format: ["cjs", "esm"],
66
fixedExtension: false,
77
tsconfig: "tsconfig.src.json",
8-
dts: true,
8+
dts: {
9+
sourcemap: false,
10+
},
911
sourcemap: true,
12+
// The CJS declarations are emitted in a separate pass, so their output can
13+
// disable source maps without affecting the runtime bundle.
14+
outputOptions(options, _format, { cjsDts }) {
15+
if (!cjsDts) return;
16+
17+
return {
18+
...options,
19+
sourcemap: false,
20+
};
21+
},
1022
clean: true,
1123
treeshake: true,
1224
minify: false,
@@ -31,6 +43,20 @@ export default defineConfig({
3143
// startup. Patch the helper to fall back to a valid path, matching the
3244
// fallback the previous tsup banner provided.
3345
plugins: [
46+
// The ESM declarations share an output pass with the runtime bundle.
47+
// Remove their dangling map comment while retaining runtime source maps.
48+
{
49+
name: "strip-declaration-sourcemap-comments",
50+
generateBundle(_options, bundle) {
51+
for (const output of Object.values(bundle)) {
52+
if (output.type !== "chunk" || !/\.d\.(?:c|m)?ts$/.test(output.fileName)) {
53+
continue;
54+
}
55+
56+
output.code = output.code.replace(/\n?\/\/# sourceMappingURL=.*$/m, "");
57+
}
58+
},
59+
},
3460
{
3561
name: "resilient-create-require",
3662
renderChunk(code: string) {

0 commit comments

Comments
 (0)