Support EVM signing: Add typescript [1/N]#123
Draft
janjakubnanista wants to merge 1 commit into
Draft
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR introduces TypeScript support to the export-and-sign frame to improve developer experience ahead of planned EVM signing work.
Changes:
- Switch webpack entrypoint to TypeScript and add TS compilation via
ts-loader. - Add TypeScript project configuration (
tsconfig.json) plus minimal ambient typings for CSS imports. - Add Jest config (TS) and update dependencies / rebuild committed
distartifacts.
Reviewed changes
Copilot reviewed 5 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| export-and-sign/webpack.config.ts | Moves webpack config to TS, changes entry to src/index.ts, and adds ts-loader + TS extensions. |
| export-and-sign/tsconfig.json | Introduces TypeScript compiler configuration for the package. |
| export-and-sign/src/index.ts | Converts entry to TS, adjusts module import to extensionless ./event-handlers, and adds global typing for window.TKHQ. |
| export-and-sign/src/globals.d.ts | Adds ambient module declaration for *.css imports. |
| export-and-sign/src/event-handlers.ts | Adds an EVM transaction-type branch in signing logic (currently a Solana copy). |
| export-and-sign/package.json | Adds TS-related tooling dependencies (typescript, ts-loader, ts-node, etc.). |
| export-and-sign/package-lock.json | Lockfile updates corresponding to dependency changes. |
| export-and-sign/jest.config.ts | Adds a Jest configuration file in TypeScript. |
| export-and-sign/dist/index.html | Updates built HTML output to reference newly built bundles. |
| export-and-sign/dist/bundle.e56c39bc6a2a3cd0b44a.js | Newly generated production bundle. |
| export-and-sign/dist/bundle.e56c39bc6a2a3cd0b44a.js.map | Source map for the new production bundle. |
| export-and-sign/dist/bundle.e56c39bc6a2a3cd0b44a.js.LICENSE.txt | License file for the new bundle. |
| export-and-sign/dist/bundle.539e9a91965e314c7b7e.js | Removes an older generated bundle. |
Files not reviewed (1)
- export-and-sign/package-lock.json: Generated file
Comments suppressed due to low confidence (2)
export-and-sign/src/event-handlers.ts:258
- The new "EVM" signing branch is currently just a copy of the Solana path: it deserializes with Solana's VersionedTransaction and signs with a Solana Keypair. This will produce an invalid EVM signature/transaction and is unsafe to ship as "EVM" support. If EVM signing isn't implemented yet in this PR, it should fail fast rather than returning a misleading signed payload.
export-and-sign/src/index.ts:6 - This file now exports from "./event-handlers" (TS), but the repo still has at least one consumer importing "./src/event-handlers.js" (see export-and-sign/index.test.js). Since src/event-handlers.js no longer exists, Jest will fail module resolution. Update the test imports (and any other callers) or add a small src/event-handlers.js shim that re-exports from the TS module.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
+13
| "target": "esnext", | ||
| "allowJs": true, | ||
| "types": ["jest", "node"], | ||
| "paths": { | ||
| "@shared/*": ["../shared/*"] | ||
| } |
Comment on lines
28
to
34
| "@babel/core": "7.23.0", | ||
| "@babel/preset-env": "7.22.20", | ||
| "@swc/register": "0.1.10", | ||
| "@testing-library/dom": "9.3.3", | ||
| "@testing-library/jest-dom": "6.1.3", | ||
| "@types/node": "26.1.1", | ||
| "babel-jest": "29.7.0", |
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.
In this PR
Adding TypeScript to
export-and-signto improve the dev experience before we add new functionality.https://linear.app/turnkey/issue/REQ-418/export-and-sign-add-support-for-evm