Repository navigation
Conversation
Add typescript and @types/node, a tsconfig that compiles src/ into dist/, and a build:ts script that runs before the native build. The package entry point and published files now point at dist/. Enable the oxlint typescript plugin and ignore dist/ in oxlint and oxfmt.
Move index.js to src/index.ts and add types for the public API. The ReindexError conversion checks the error's constructor name instead of using `instanceof Error`, because errors from the native module can come from a different realm (e.g. under jest).
Type check in the node-lint job, and build dist/ before publishing the main package so it isn't published without its entry point.
Half-Shot
force-pushed
the
hs/typescript
branch
from
October 6, 2026 15:25
cc021e5 to
1919c5f
Compare
Half-Shot
marked this pull request as ready for review
October 6, 2026 15:29
kaylendog
requested changes
Nov 16, 2026
| "build:ts": "tsc" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^26.2.0", |
Contributor
There was a problem hiding this comment.
I think the minimum Node we support is 22 per .node-version in the repo root?
Suggested change
| "@types/node": "^26.2.0", | |
| "@types/node": "^22", |
Or whatever. A later @types/node would let us easily introduce code the earlier versions don't support, I think? Further to that, a
"engines": { "node": ">=22" }
may be in order.
Comment on lines
+20
to
+21
| "noUncheckedIndexedAccess": true, | ||
| "exactOptionalPropertyTypes": true, |
Contributor
There was a problem hiding this comment.
Could we perhaps also enable noImplicitOverride, noPropertyAccessFromIndexSignature, noImplicitReturns and noFallthroughCasesInSwitch? I don't think src/index.ts is susceptible to any of these right now, these are just my preferences :3
Suggested change
| "noUncheckedIndexedAccess": true, | |
| "exactOptionalPropertyTypes": true, | |
| "noUncheckedIndexedAccess": true, | |
| "exactOptionalPropertyTypes": true, | |
| "noImplicitOverride": true, | |
| "noPropertyAccessFromIndexSignature": true, | |
| "noImplicitReturns": true, | |
| "noFallthroughCasesInSwitch": true, |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This does a few things to migrate seshat-node to Typescript, and provide a type definition file.
This:
Element Web may then remove it's own https://github.com/element-hq/element-web/blob/develop/apps/desktop/src/%40types/matrix-org-seshat.d.ts after this has made it into a release.