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

Add a sherif monorepo linter to the CI #452

Merged
merged 6 commits into from
Jul 9, 2024
Merged
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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ jobs:
with:
node-version: 20.x
cache: pnpm
- run: pnpm install
- run: pnpm run fmt:global-check
- run: |
pnpm install
pnpm run fmt:global-check
pnpm run lint:monorepo
8 changes: 4 additions & 4 deletions examples/4337-gas-metering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
"@alchemy/aa-core": "2.3.1",
"@gelatonetwork/relay-sdk": "^5.5.6",
"alchemy-sdk": "3.1.2",
"dotenv": "16.4.5",
"ethers": "^6.12.1",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"permissionless": "0.1.29",
"viem": "2.12.5"
},
"devDependencies": {
"@types/node": "20.14.0",
"@types/node": "^20.14.8",
"tsx": "4.11.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated nit that I'm just noticing now: it feels weird that we write dependencies differently for different packages in our repository. Here, we are using "x.y.z", while in others we are using "^x.y.z", even though there is nothing special about these dependencies for expressing them differently from a semver perspective.

Not for this PR, just something that I wanted to bring up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there's a purpose, the problem is that there are no comments allowed in the package.json, so that knowledge may be lost. There are some hacky solutions though: https://stackoverflow.com/questions/14221579/how-do-i-add-comments-to-package-json-for-npm-install

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These packages are getting pinned by the lock file. The places where versioning matters more are for dependencies, because those get transitively installed.

I think that git blame might be able to include documentation for these.

"typescript": "^5.4.5"
"typescript": "^5.5.2"
}
}
2 changes: 1 addition & 1 deletion examples/4337-passkeys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
"vite": "^5.3.1",
"vite-plugin-commonjs": "^0.10.1"
}
}
}
8 changes: 4 additions & 4 deletions modules/4337/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@
"url": "https://github.com/safe-global/safe-modules/issues"
},
"devDependencies": {
"@account-abstraction/contracts": "^0.7.0",
"@noble/curves": "^1.4.0",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@openzeppelin/contracts": "^5.0.2",
"@safe-global/safe-4337-local-bundler": "workspace:^0.0.0",
"@safe-global/safe-4337-provider": "workspace:^0.0.0",
"@simplewebauthn/server": "10.0.0",
"@simplewebauthn/server": "^10.0.0",
"@types/chai": "^4.3.16",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.8",
Expand All @@ -74,6 +73,7 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@safe-global/safe-contracts": "^1.4.1-build.0"
"@account-abstraction/contracts": "0.7.0",
"@safe-global/safe-contracts": "1.4.1-build.0"
nlordell marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
16 changes: 8 additions & 8 deletions modules/allowances/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@openzeppelin/contracts": "^5.0.2",
"@safe-global/safe-deployments": "^1.36.0",
"@safe-global/safe-deployments": "^1.37.0",
"@safe-global/safe-singleton-factory": "^1.0.25",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/mocha": "^10.0.6",
"@types/node": "^20.14.0",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.8",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"ethers": "^6.12.1",
"hardhat": "^2.22.3",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"hardhat-deploy": "^0.12.4",
"solhint": "5.0.1",
"solhint": "^5.0.1",
"solidity-coverage": "^0.8.12",
"ts-node": "^10.9.2",
"typechain": "^8.3.2",
"typescript": "5.4.5"
"typescript": "^5.5.2"
}
}
}
16 changes: 8 additions & 8 deletions modules/passkey/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@
"devDependencies": {
"@noble/curves": "^1.4.0",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.10",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@safe-global/mock-contract": "^4.1.0",
"@safe-global/safe-4337": "workspace:^0.3.0-1",
"@safe-global/safe-4337-local-bundler": "workspace:^0.0.0",
"@safe-global/safe-contracts": "^1.4.1-build.0",
"@simplewebauthn/server": "^10.0.0",
"@types/node": "^20.14.0",
"@types/node": "^20.14.8",
"dotenv": "^16.4.5",
"ethers": "^6.12.1",
"hardhat": "^2.22.3",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"hardhat-deploy": "^0.12.4",
"solhint": "^5.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
"typescript": "^5.5.2"
},
"dependencies": {
"@account-abstraction/contracts": "^0.7.0",
"@openzeppelin/contracts": "^5.0.0",
"@safe-global/safe-contracts": "^1.4.1-build.0",
"@account-abstraction/contracts": "0.7.0",
"@openzeppelin/contracts": "=5.0.0",
"cbor": "^9.0.2"
}
}
10 changes: 5 additions & 5 deletions modules/recovery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@
"devDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@types/node": "^20.14.0",
"@types/node": "^20.14.8",
"@types/yargs": "^17.0.32",
"dotenv": "^16.4.5",
"ethers": "^6.12.1",
"hardhat": "^2.22.3",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"hardhat-deploy": "^0.12.4",
"typescript": "^5.4.5",
"typescript": "^5.5.2",
"yargs": "^17.7.2"
},
"dependencies": {
"candide-contracts": "github:5afe/CandideWalletContracts#113d3c059e039e332637e8f686d9cbd505f1e738",
"@openzeppelin/contracts": "=4.9.6",
"@safe-global/safe-contracts": "=1.4.1-build.0"
}
}
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "@safe-global/safe-modules",
"version": "1.0.0",
"description": "A monorepo for Safe modules",
"private": true,
"packageManager": "pnpm@9.4.0",
"main": "dist/index.js",
"workspaces": [
"packages/*",
Expand All @@ -10,7 +12,8 @@
],
"scripts": {
"fmt:global": "prettier --write .",
"fmt:global-check": "prettier --check ."
"fmt:global-check": "prettier --check .",
"lint:monorepo": "sherif -i @openzeppelin/contracts -i @safe-global/safe-contracts"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -39,6 +42,7 @@
"eslint-plugin-react-refresh": "^0.4.7",
"prettier": "^3.3.0",
"prettier-plugin-solidity": "^1.3.1",
"rimraf": "^5.0.7"
"rimraf": "^5.0.7",
"sherif": "^0.10.0"
}
}
12 changes: 6 additions & 6 deletions packages/4337-local-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"prepare": "pnpm run build"
},
"dependencies": {
"@account-abstraction/contracts": "^0.7.0",
"@account-abstraction/contracts": "0.7.0",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@safe-global/safe-4337-provider": "workspace:^0.0.0",
"@safe-global/safe-contracts" : "^1.4.1-build.0",
"ethers": "^6.12.1",
"hardhat": "^2.22.3",
"@safe-global/safe-contracts": "^1.4.1-build.0",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"hardhat-deploy": "^0.12.4",
"node-fetch": "^3.3.2",
"typescript": "^5.4.5"
"typescript": "^5.5.2"
}
}
}
12 changes: 7 additions & 5 deletions packages/4337-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
"prepare": "pnpm run build"
},
"dependencies": {
"@types/node": "^20.14.0",
"ethers": "^6.12.1",
"rimraf" :"^5.0.7",
"typescript": "^5.4.5"
"ethers": "^6.13.1",
"rimraf": "^5.0.7",
"typescript": "^5.5.2"
},
"devDependencies": {
"@types/node": "^20.14.8"
}
}
}
Loading
Loading