-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: upgrade to TypeScript 7 #4318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
carderne
wants to merge
5
commits into
main
Choose a base branch
from
ts7
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6be020b
chore: upgrade to TypeScript 7
carderne 55b7acf
fix redis-worker
carderne 11ed568
fix redis esm build
carderne 1d1bee1
fix(build): keep TypeScript compiler optional for consumers
carderne 5f35b92
fix(redis-worker): omit dangling declaration map references
carderne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/plugins/tsup.config.ts → packages/plugins/tsdown.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/], | ||
| }, | ||
| }, | ||
| // 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, | ||
| }; | ||
| }, | ||
| }, | ||
| ], | ||
| }); | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.