Skip to content

Commit

Permalink
Ensure support for typescript@~5.7.0 (#760)
Browse files Browse the repository at this point in the history
## Summary
<!-- Succinctly describe your change, providing context, what you've
changed, and why. -->

Ensures support for `typescript@~5.7.0` by adding a new PR check. See
[Announcing TypeScript 5.7 -
TypeScript](https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/).

Ideally we would take advantage of the new
`rewriteRelativeImportExtensions` added in microsoft/TypeScript#59767
which would allow us to correctly import `.ts` extensions instead of
requiring `.js`, ready for better Deno/Bun support, as well as Node
support when running `.ts` files directly.

Unfortunately, `typescript<5.0.0` doesn't support the compiled output;
we'll have to wait for v4 to use that.

## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by
wrapping it in "~~"" and suffix it with "N/A My reason for skipping
this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [ ] ~Added a [docs PR](https://github.com/inngest/website) that
references this PR~ N/A KTLO
- [x] Added unit/integration tests
- [x] Added changesets if applicable

## Related

- https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/
- microsoft/TypeScript#59767
  • Loading branch information
jpwilliams authored Nov 25, 2024
1 parent 4df83d8 commit efc6c79
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 55 deletions.
7 changes: 7 additions & 0 deletions .changeset/weak-worms-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"inngest": patch
---

Ensure support for `typescript@~5.7.0`

No notable changes have been made, though minor TypeScript versions often affect transpiled outputs.
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
matrix:
tsVersion:
- "latest"
- "~5.7.0"
- "~5.6.0"
- "~5.5.0"
- "~5.4.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/inngest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"shx": "^0.3.4",
"ts-jest": "^29.1.0",
"tsx": "^3.12.7",
"typescript": "~5.6.2"
"typescript": "~5.7.2"
},
"volta": {
"node": "18.12.1",
Expand Down
13 changes: 13 additions & 0 deletions packages/inngest/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
"resolveJsonModule": true,
"noUncheckedIndexedAccess": true,
"strictNullChecks": true,

// In TS 5.7+ we can use these to ensure we can import `.ts` extensions and
// have them compile to `.js` imports. This also then means we're compatible
// with Node/Deno/Bun's TS running instead of leaking compilation
// requirements into the source code.
//
// Importing `.ts` extensions fails miserably when using compiled output
// with TS<5.0 though, so we must keep this commented out and unactioned
// until we can safely assume at least TS>=5.0.
//
// "rewriteRelativeImportExtensions": true,
// "allowImportingTsExtensions": true,

"paths": {
"inngest": ["./src"],
"inngest/*": ["./src/*"],
Expand Down
Loading

0 comments on commit efc6c79

Please sign in to comment.