Skip to content

Commit

Permalink
Merge branch 'main' into token-vault
Browse files Browse the repository at this point in the history
  • Loading branch information
r-czajkowski committed Nov 30, 2023
2 parents c960102 + 918977c commit c3c674d
Show file tree
Hide file tree
Showing 15 changed files with 564 additions and 215 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Auto-fix linting
d2a058fe6cfbab6f82d0d977d1b2d8bd9f494df1
0976ac1b09b7257fe74389bafe94697059a07aed
2 changes: 1 addition & 1 deletion .github/workflows/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
repos:
- repo: local
hooks:
# Root
- id: root-lint
name: "lint root"
entry: /usr/bin/env bash -c "npm run format"
exclude: (^core/|^dapp/|^website/)
language: script
description: "Checks code according to the package's linter configuration"
# Core
- id: core-lint-sol
name: "lint core sol"
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Packages that have own prettier configuration.
core/
dapp/
website/

# Auto-generated files.
pnpm-lock.yaml
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require("@thesis/prettier-config"),
}
6 changes: 6 additions & 0 deletions .syncpackrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencyTypes": [
"prod",
"dev"
]
}
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ please see the [documentation](https://pnpm.io/installation).
#### Package Dependencies

To install the packages dependencies run:

```sh
pnpm install
```
Expand All @@ -30,19 +31,21 @@ automatically discover code issues, before they submit the code.
To setup the hooks follow the steps:

1. Install `pre-commit` tool:
```sh
brew install pre-commit
```

```sh
brew install pre-commit
```

2. Install the hooks for the repository:
```sh
pre-commit install
```
```sh
pre-commit install
```

#### Testing

To test the pre-commit hooks configuration you can invoke them with one of the
commands:

```sh
# Execute hooks for all files:
pre-commit run --all-files
Expand All @@ -51,6 +54,25 @@ pre-commit run --all-files
pre-commit run --files ./core/contracts/Acre.sol
```

### Syncpack

[Syncpack](https://jamiemason.github.io/syncpack/) is a tool that helps manage
multiple package.json files in a monorepo.

#### Usage

To list dependencies from all packages run:

```sh
pnpm syncpack list
```

To update a dependency (e.g. `eslint`) in all packages run:

```sh
pnpm syncpack update --filter eslint
```

### Slither

[Slither](https://github.com/crytic/slither) is a static analysis framework used
Expand Down
2 changes: 1 addition & 1 deletion core/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
...require("@thesis-co/prettier-config"),
...require("../.prettierrc.js"),
plugins: ["prettier-plugin-solidity"],
overrides: [
{
Expand Down
36 changes: 18 additions & 18 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@
"test": "hardhat test"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.0.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.2",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.1",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@openzeppelin/hardhat-upgrades": "^2.3.3",
"@openzeppelin/hardhat-upgrades": "^2.4.1",
"@thesis-co/eslint-config": "^0.6.1",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^4.2.0",
"@types/mocha": ">=9.1.0",
"@types/node": ">=16.0.0",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^20.9.4",
"chai": "^4.3.10",
"eslint": "^8.51.0",
"ethers": "^6.8.0",
"hardhat": "^2.18.2",
"eslint": "^8.54.0",
"ethers": "^6.8.1",
"hardhat": "^2.19.1",
"hardhat-deploy": "^0.11.43",
"hardhat-gas-reporter": "^1.0.8",
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3",
"solhint": "^3.6.2",
"hardhat-gas-reporter": "^1.0.9",
"prettier": "^3.1.0",
"prettier-plugin-solidity": "^1.2.0",
"solhint": "^4.0.0",
"solhint-config-thesis": "github:thesis/solhint-config",
"solidity-coverage": "^0.8.0",
"solidity-coverage": "^0.8.5",
"ts-node": "^10.9.1",
"typechain": "^8.3.2",
"typescript": "^5.2.2"
"typescript": "^5.3.2"
},
"dependencies": {
"@openzeppelin/contracts": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion dapp/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
...require("@thesis-co/prettier-config"),
...require("../.prettierrc.js"),
}
19 changes: 9 additions & 10 deletions dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@
"@emotion/styled": "^11.11.0",
"@ledgerhq/wallet-api-client": "^1.2.1",
"@ledgerhq/wallet-api-client-react": "^1.1.2",
"framer-motion": "^10.16.4",
"framer-motion": "^10.16.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@thesis-co/eslint-config": "^0.6.1",
"@thesis/prettier-config": "github:thesis/prettier-config",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "^8.53.0",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vitejs/plugin-react": "^4.2.0",
"eslint": "^8.54.0",
"prettier": "^3.1.0",
"typescript": "^5.2.2",
"vite": "^4.4.5"
"typescript": "^5.3.2",
"vite": "^5.0.2"
}
}
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"private": true,
"packageManager": "[email protected]"
"private": true,
"packageManager": "[email protected]",
"scripts": {
"format": "prettier --check .",
"format:fix": "prettier --write ."
},
"devDependencies": {
"@thesis/prettier-config": "github:thesis/prettier-config",
"prettier": "^3.1.0",
"syncpack": "^11.2.1"
}
}
Loading

0 comments on commit c3c674d

Please sign in to comment.