-
Notifications
You must be signed in to change notification settings - Fork 16
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
chore: js tooling improvements #609
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
52433b1
Fix pnpm warning
fvictorio 0fa20ab
Add syncpakc
fvictorio 327f50d
Add syncpack
fvictorio b33ac11
Run syncpack format
fvictorio 695a61f
Run syncpack on CI
fvictorio ce30c1e
Add setup-node action
fvictorio 88a320e
Fixes related to upgrading prettier
fvictorio b072058
Run prettier
fvictorio 1bf2427
Add setup-rust action
fvictorio 213dad3
Run prettier in edr_napi
fvictorio 513f246
Add lint scripts to packages
fvictorio 8eadf7c
Run prettier in crates/tools/js/benchmark
fvictorio 9bfb4c9
Port benchmark code to typescript
fvictorio 16ef9ba
Add eslint to all packages
fvictorio e183c79
Upgrade @types/node to v20
fvictorio 176e83c
Fix broken build:edr script
fvictorio 46d0eb3
Resolve benchmark output path
fvictorio 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 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,24 @@ | ||
name: Setup node | ||
description: Sets up node and pnpm | ||
|
||
inputs: | ||
pnpm-version: | ||
description: Version of pnpm to install | ||
required: false | ||
default: "9" | ||
node-version: | ||
description: Version of node to install | ||
required: false | ||
default: "20" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: ${{ inputs.pnpm-version }} | ||
- uses: actions/setup-node@v4 | ||
id: setup-node | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: pnpm |
This file contains 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,13 @@ | ||
name: Setup rust | ||
description: Sets up rust | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Rust (stable) | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@v2 |
This file contains 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 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 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 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 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 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 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,3 +1,4 @@ | ||
{ | ||
"proseWrap": "never" | ||
"proseWrap": "never", | ||
"trailingComma": "es5" | ||
} |
This file contains 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,22 @@ | ||
// @ts-check | ||
|
||
/** @type {import("syncpack").RcFile} */ | ||
const config = { | ||
versionGroups: [ | ||
// smock only works with ethers v5 | ||
{ | ||
packages: ["hardhat-edr-smock-test"], | ||
dependencies: ["ethers"], | ||
// latest ethers v5 version | ||
pinVersion: "5.7.2", | ||
}, | ||
], | ||
semverGroups: [ | ||
{ | ||
dependencies: ["typescript"], | ||
range: "~", | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = config; |
This file contains 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,17 @@ | ||
module.exports = { | ||
extends: [`${__dirname}/../../config/eslint/eslintrc.js`], | ||
parserOptions: { | ||
project: `${__dirname}/tsconfig.json`, | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
"@typescript-eslint/restrict-template-expressions": "off", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
devDependencies: true, | ||
}, | ||
], | ||
"prefer-template": "off", | ||
}, | ||
}; |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just validating my understanding: this is not necessary because the
test
command has a pre-test step that builds.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. That wasn't the case before (because the
pretest
script was only runningbuild:edr
), but now both EDR is built and the tests code is type-checked before running the tests.