This repository was archived by the owner on Oct 7, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 131
BREAKING: TS Refactor #202
Merged
Merged
Changes from 52 commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
aa6526d
Refactor to TS
gantunesr 192c48a
Move files and update structure
gantunesr ae34346
Update dependencies and configuration
gantunesr 4d8cf0d
Update test and mock files
gantunesr b7cc77c
Solve yarn issues
gantunesr 7eae2b3
Update configuration and dependencies
gantunesr d014dbc
Bump jest
gantunesr 98769cd
Create types file
gantunesr a605feb
Solve lint issues
gantunesr f51af43
Remove private member
gantunesr d9e1de5
Solve lint issues
gantunesr 601cb3c
Add typings
gantunesr fd02507
Update mock-encryptor
gantunesr 46bc491
Update types
gantunesr d1401a2
Update .eslintrc.js
gantunesr 3ce7a6e
Update test
gantunesr 6933b78
Update KeyringController
gantunesr 3b5ea22
Add build command (not working properly)
gantunesr fdff1ec
Move declarations to new file
gantunesr ab03e00
Update jest.config
gantunesr 734c7fb
Update TS config
gantunesr b90bb01
Fix tests
gantunesr 41f4045
Remove log
gantunesr c9d7857
Disable TS warning
gantunesr c95429a
Remove forgetKeyring
gantunesr c833be6
Change type any to Json
gantunesr e7b8a5f
Prettier
gantunesr 473c047
Remove log
gantunesr 258c349
Typecast serialize result to any
gantunesr 6fa1e73
Remove Json
gantunesr a7905a7
Rename privateKeyArray to privateKeys
gantunesr 37f0d37
Update mocks dir structure
gantunesr 1ba064e
Install depcheck and rv @metamask/eslint-config-commonjs
gantunesr 4d8bb84
Revert "Install depcheck and rv @metamask/eslint-config-commonjs"
gantunesr d43832b
Revert "Update mocks dir structure"
gantunesr 9fe79f0
Update mocks dir structure
gantunesr 921bcb4
Install depcheck and rv @metamask/eslint-config-commonjs
gantunesr 9ccd731
Update dependencies
gantunesr 0dbb136
Update dependencies
gantunesr 84b4e2e
Improve types
gantunesr a319df4
Improve types
gantunesr 9dd451b
Update errors
gantunesr 85aa914
Add constants file
gantunesr c80f3d3
Update error messages
gantunesr 8b930ff
Update State
gantunesr 4ed4fe2
Update types, constants, and errors
gantunesr 2973637
Fix tests and lint
gantunesr e4898e4
Update dependencies
gantunesr 5832e7d
Update types
gantunesr 7d6a833
Rebase
gantunesr 979774b
Lint
gantunesr 2ec20ff
Update data type
gantunesr c85a7bd
Update syntax to arrow function
gantunesr 0638515
Add KeyringControllerArgs
gantunesr 526182c
Add default to opts arg in addNewKeyring
gantunesr acd549e
Remove string casting
gantunesr 1d38cfc
Declare backfilled types
gantunesr 8aa5ba0
Rename arg from _address to rawAddress
gantunesr c59a832
Remove noImplicitAny
gantunesr f609772
Remove unneed optionals
gantunesr 17b6354
Update data type for arg in newKeyring method
gantunesr 70d5d8c
Fix style
gantunesr d892064
Improve KeyringControllerArgs
gantunesr 13240e6
Update logic in addNewKeyring for switch-case statement
gantunesr 1b460f3
Update import
gantunesr 05c1920
Update logic for newKeyring to throw an error instead of returning un…
gantunesr 8915012
Update types in tests
gantunesr 3550b93
Update KeyringControllerArgs in types file
gantunesr b257e31
Update mocks
gantunesr a96cbca
Add backfill for normalize method and remove type casting
gantunesr 9b48af0
Fix data type
gantunesr ce7d126
Add SerializedKeyring
gantunesr b620d2a
Lint
gantunesr ded3cef
Move mocks to test dir
gantunesr 352b11c
Update build config
gantunesr 476124b
Improve keyring mock
gantunesr 7f29186
Improve error messages
gantunesr c1843f5
Update tests
gantunesr 5f4d845
Export KeyringControllerError enum
gantunesr 2272c18
Update exports
gantunesr d0f6e63
Improve stripHexPrefix
gantunesr 1b8c42b
Sort methods
gantunesr f054c3b
Replace State with Json
gantunesr 5a1df64
Improve types
gantunesr b76b3db
Update dependencies
gantunesr 850cb00
Bump @typescript-eslint/parser from 5.53.0 to 5.55.0 for TypeScript 5
leotm b4a3005
Upgrade TypeScript from 4.9.3-5 to 5.0.2 stable
leotm cfe3e44
Bump remaining harmless ESLint deps
leotm b618965
Add prettierignore and revert .yarnrc.yml file
gantunesr a12ce45
Update sinon import
gantunesr 91fd437
Remove type cast in submitPassword test
gantunesr 5b17f35
Remove type cast in persistAllKeyrings test
gantunesr 5dc6cb0
Add @ts-expect-error to remove type casts
gantunesr 9c59391
Set password to only string
gantunesr 6eff4a1
Remove type from forEach
gantunesr e36c134
Update hex methods
gantunesr 4fba438
Remove KeyringType as data type in methods
gantunesr 7044d64
Move displayForKeyring outside class
gantunesr 7c871f4
Merge branch 'refactor-typescript' of https://github.com/MetaMask/Key…
gantunesr f722305
Clean up code
gantunesr 3edc176
Update @metamask/eth-sig-util type file
gantunesr 10bb8c8
Validate that data is Json in newKeyring method
gantunesr a344342
Console.error in restoreKeyring
gantunesr 1c76cf0
Remove unnecessary comment
gantunesr c87885c
Refactor removeAccount method
gantunesr ee755fd
Change data type from Hex to string
gantunesr c7afbff
Change data type from Hex to string
gantunesr ee12163
Update test name
gantunesr 1ae48d3
Sort methods
gantunesr ea8dda7
Sort methods
gantunesr 977facf
Improve data types in test suite
gantunesr 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,10 @@ | ||
{ | ||
"ignores": [ | ||
"@lavamoat/allow-scripts", | ||
"@metamask/auto-changelog", | ||
"@types/*", | ||
"prettier-plugin-packagejson", | ||
"ts-node", | ||
"typedoc" | ||
] | ||
} |
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 |
---|---|---|
@@ -1,13 +1,36 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@metamask/eslint-config', '@metamask/eslint-config-commonjs'], | ||
|
||
extends: ['@metamask/eslint-config'], | ||
|
||
overrides: [ | ||
{ | ||
files: ['test/**/*.js'], | ||
files: ['*.ts'], | ||
extends: ['@metamask/eslint-config-typescript'], | ||
}, | ||
|
||
{ | ||
files: ['*.js'], | ||
parserOptions: { | ||
sourceType: 'script', | ||
}, | ||
extends: ['@metamask/eslint-config-nodejs'], | ||
}, | ||
|
||
{ | ||
files: ['*.test.ts', '*.test.js'], | ||
extends: [ | ||
'@metamask/eslint-config-jest', | ||
'@metamask/eslint-config-nodejs', | ||
], | ||
}, | ||
], | ||
|
||
ignorePatterns: [ | ||
'!.eslintrc.js', | ||
'!.prettierrc.js', | ||
'dist/', | ||
'docs/', | ||
'.yarn/', | ||
], | ||
}; |
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 |
---|---|---|
|
@@ -13,3 +13,6 @@ coverage | |
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# distribution | ||
dist |
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,4 @@ | ||
// eslint-disable-next-line import/unambiguous | ||
gantunesr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
declare module '@metamask/eth-hd-keyring'; | ||
declare module '@metamask/eth-simple-keyring'; | ||
declare module 'obs-store'; |
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 |
---|---|---|
|
@@ -18,31 +18,42 @@ | |
}, | ||
"license": "ISC", | ||
"author": "Dan Finlay <[email protected]>", | ||
"main": "index.js", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"index.js" | ||
"dist/" | ||
], | ||
"scripts": { | ||
"build": "tsc --project tsconfig.build.json", | ||
"build:docs": "typedoc", | ||
"lint": "yarn lint:eslint && yarn lint:misc --check", | ||
"lint:dependencies": "depcheck", | ||
"lint:eslint": "eslint . --cache --ext js,ts", | ||
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", | ||
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern", | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"@ethereumjs/tx": "^4.1.1", | ||
"@metamask/browser-passworder": "^4.0.2", | ||
"@metamask/eth-hd-keyring": "^6.0.0", | ||
"@metamask/eth-sig-util": "5.0.2", | ||
"@metamask/eth-simple-keyring": "^5.0.0", | ||
"@metamask/utils": "5.0.0", | ||
gantunesr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"obs-store": "^4.0.3" | ||
}, | ||
"devDependencies": { | ||
"@lavamoat/allow-scripts": "^2.1.0", | ||
"@metamask/auto-changelog": "^3.0.0", | ||
"@metamask/eslint-config": "^11.1.0", | ||
"@metamask/eslint-config-commonjs": "^11.1.0", | ||
"@metamask/eslint-config-jest": "^11.1.0", | ||
"@metamask/eslint-config-nodejs": "^11.1.0", | ||
"@metamask/eslint-config-typescript": "^11.1.0", | ||
"@types/jest": "^29.4.0", | ||
"@types/sinon": "^10.0.13", | ||
"@typescript-eslint/eslint-plugin": "^5.53.0", | ||
"@typescript-eslint/parser": "^5.53.0", | ||
"depcheck": "^1.4.3", | ||
"eslint": "^8.29.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
|
@@ -51,10 +62,14 @@ | |
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"ethereumjs-wallet": "^1.0.1", | ||
"jest": "^27.0.6", | ||
"jest": "^29.0.0", | ||
"prettier": "^2.8.1", | ||
"prettier-plugin-packagejson": "^2.3.0", | ||
"sinon": "^11.1.1" | ||
"sinon": "15.0.1", | ||
gantunesr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"ts-jest": "^29.0.3", | ||
"ts-node": "^10.7.0", | ||
"typedoc": "^0.23.15", | ||
"typescript": "~4.8.4" | ||
gantunesr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
|
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.