Skip to content
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

Use SWC with ts-node #3696

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ignores:
- 'jest-silent-reporter'
- 'prettier-plugin-packagejson'
# Ignore plugins we explicitly use with tools
- '@swc/core'
- 'babel-jest'
# Ignore dependencies which plug into the NPM lifecycle
- '@lavamoat/preinstall-always-fail'
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"build:watch": "yarn run build --watch",
"changelog:update": "yarn workspaces foreach --parallel --interlaced --verbose run changelog:update",
"changelog:validate": "yarn workspaces foreach --parallel --interlaced --verbose run changelog:validate",
"child-workspace-package-names-as-json": "ts-node scripts/child-workspace-package-names-as-json.ts",
"create-package": "ts-node scripts/create-package",
"child-workspace-package-names-as-json": "ts-node --swc scripts/child-workspace-package-names-as-json.ts",
"create-package": "ts-node --swc scripts/create-package",
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn constraints && yarn lint:dependencies",
"lint:dependencies": "depcheck && yarn dedupe --check",
"lint:dependencies:fix": "depcheck && yarn dedupe",
Expand All @@ -35,7 +35,7 @@
"test:packages": "yarn test:verbose --silent --collectCoverage=false --reporters=jest-silent-reporter",
"test:scripts": "yarn jest --config ./jest.config.scripts.js --silent",
"test:verbose": "yarn workspaces foreach --parallel --verbose run test:verbose",
"update-readme-content": "ts-node scripts/update-readme-content.ts"
"update-readme-content": "ts-node --swc scripts/update-readme-content.ts"
},
"simple-git-hooks": {
"pre-push": "yarn lint"
Expand All @@ -56,6 +56,7 @@
"@metamask/eth-json-rpc-provider": "^2.3.0",
"@metamask/json-rpc-engine": "^7.3.0",
"@metamask/utils": "^8.2.0",
"@swc/core": "^1.3.101",
"@types/jest": "^27.4.1",
"@types/node": "^16.18.54",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand Down Expand Up @@ -100,7 +101,8 @@
"eth-sig-util>ethereumjs-util>secp256k1": true,
"ethereumjs-util>ethereum-cryptography>keccak": true,
"ethereumjs-util>ethereum-cryptography>secp256k1": true,
"simple-git-hooks": false
"simple-git-hooks": false,
"@swc/core": true
}
}
}
149 changes: 140 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,7 @@ __metadata:
"@metamask/eth-json-rpc-provider": ^2.3.0
"@metamask/json-rpc-engine": ^7.3.0
"@metamask/utils": ^8.2.0
"@swc/core": ^1.3.101
"@types/jest": ^27.4.1
"@types/node": ^16.18.54
"@typescript-eslint/eslint-plugin": ^5.62.0
Expand Down Expand Up @@ -3128,6 +3129,136 @@ __metadata:
languageName: node
linkType: hard

"@swc/core-darwin-arm64@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-darwin-arm64@npm:1.3.101"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@swc/core-darwin-x64@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-darwin-x64@npm:1.3.101"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@swc/core-linux-arm-gnueabihf@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.101"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@swc/core-linux-arm64-gnu@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.101"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-arm64-musl@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-linux-arm64-musl@npm:1.3.101"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-x64-gnu@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-linux-x64-gnu@npm:1.3.101"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-x64-musl@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-linux-x64-musl@npm:1.3.101"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@swc/core-win32-arm64-msvc@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.101"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@swc/core-win32-ia32-msvc@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.101"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@swc/core-win32-x64-msvc@npm:1.3.101":
version: 1.3.101
resolution: "@swc/core-win32-x64-msvc@npm:1.3.101"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@swc/core@npm:^1.3.101":
version: 1.3.101
resolution: "@swc/core@npm:1.3.101"
dependencies:
"@swc/core-darwin-arm64": 1.3.101
"@swc/core-darwin-x64": 1.3.101
"@swc/core-linux-arm-gnueabihf": 1.3.101
"@swc/core-linux-arm64-gnu": 1.3.101
"@swc/core-linux-arm64-musl": 1.3.101
"@swc/core-linux-x64-gnu": 1.3.101
"@swc/core-linux-x64-musl": 1.3.101
"@swc/core-win32-arm64-msvc": 1.3.101
"@swc/core-win32-ia32-msvc": 1.3.101
"@swc/core-win32-x64-msvc": 1.3.101
"@swc/counter": ^0.1.1
"@swc/types": ^0.1.5
peerDependencies:
"@swc/helpers": ^0.5.0
dependenciesMeta:
"@swc/core-darwin-arm64":
optional: true
"@swc/core-darwin-x64":
optional: true
"@swc/core-linux-arm-gnueabihf":
optional: true
"@swc/core-linux-arm64-gnu":
optional: true
"@swc/core-linux-arm64-musl":
optional: true
"@swc/core-linux-x64-gnu":
optional: true
"@swc/core-linux-x64-musl":
optional: true
"@swc/core-win32-arm64-msvc":
optional: true
"@swc/core-win32-ia32-msvc":
optional: true
"@swc/core-win32-x64-msvc":
optional: true
peerDependenciesMeta:
"@swc/helpers":
optional: true
checksum: d9db5cc3306dc48e3f9fda4597c702de99851156a904be1974d69684589b52c73918270dbef06568e2ba5f9efb17a92333b361a79d1e138fad19a386c0f8c2c1
languageName: node
linkType: hard

"@swc/counter@npm:^0.1.1":
version: 0.1.2
resolution: "@swc/counter@npm:0.1.2"
checksum: 8427c594f1f0cf44b83885e9c8fe1e370c9db44ae96e07a37c117a6260ee97797d0709483efbcc244e77bac578690215f45b23254c4cd8a70fb25ddbb50bf33e
languageName: node
linkType: hard

"@swc/types@npm:^0.1.5":
version: 0.1.5
resolution: "@swc/types@npm:0.1.5"
checksum: 6aee11f62d3d805a64848e0bd5f0e0e615f958e327a9e1260056c368d7d28764d89e38bd8005a536c9bf18afbcd303edd84099d60df34a2975d62540f61df13b
languageName: node
linkType: hard

"@tootallnate/once@npm:1":
version: 1.1.2
resolution: "@tootallnate/once@npm:1.1.2"
Expand Down Expand Up @@ -3731,9 +3862,9 @@ __metadata:
linkType: hard

"acorn-walk@npm:^8.1.1":
version: 8.2.0
resolution: "acorn-walk@npm:8.2.0"
checksum: 1715e76c01dd7b2d4ca472f9c58968516a4899378a63ad5b6c2d668bba8da21a71976c14ec5f5b75f887b6317c4ae0b897ab141c831d741dc76024d8745f1ad1
version: 8.3.1
resolution: "acorn-walk@npm:8.3.1"
checksum: 5c8926ddb5400bc825b6baca782931f9df4ace603ba1a517f5243290fd9cdb089d52877840687b5d5c939591ebc314e2e63721514feaa37c6829c828f2b940ce
languageName: node
linkType: hard

Expand All @@ -3747,11 +3878,11 @@ __metadata:
linkType: hard

"acorn@npm:^8.2.4, acorn@npm:^8.4.1, acorn@npm:^8.9.0":
version: 8.10.0
resolution: "acorn@npm:8.10.0"
version: 8.11.2
resolution: "acorn@npm:8.11.2"
bin:
acorn: bin/acorn
checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d
checksum: 818450408684da89423e3daae24e4dc9b68692db8ab49ea4569c7c5abb7a3f23669438bf129cc81dfdada95e1c9b944ee1bfca2c57a05a4dc73834a612fbf6a7
languageName: node
linkType: hard

Expand Down Expand Up @@ -10776,8 +10907,8 @@ __metadata:
linkType: hard

"ts-node@npm:^10.9.1":
version: 10.9.1
resolution: "ts-node@npm:10.9.1"
version: 10.9.2
resolution: "ts-node@npm:10.9.2"
dependencies:
"@cspotcode/source-map-support": ^0.8.0
"@tsconfig/node10": ^1.0.7
Expand Down Expand Up @@ -10809,7 +10940,7 @@ __metadata:
ts-node-script: dist/bin-script.js
ts-node-transpile-only: dist/bin-transpile.js
ts-script: dist/bin-script-deprecated.js
checksum: 090adff1302ab20bd3486e6b4799e90f97726ed39e02b39e566f8ab674fd5bd5f727f43615debbfc580d33c6d9d1c6b1b3ce7d8e3cca3e20530a145ffa232c35
checksum: fde256c9073969e234526e2cfead42591b9a2aec5222bac154b0de2fa9e4ceb30efcd717ee8bc785a56f3a119bdd5aa27b333d9dbec94ed254bd26f8944c67ac
languageName: node
linkType: hard

Expand Down