Skip to content

Commit

Permalink
deps: clean dependendies and add check script (#450)
Browse files Browse the repository at this point in the history
* Ignore eslint in scripts

* Use async calls

* Ignore tests

* Show testonly dependencies

* Calculate deps

* Add docs

* Implement methods on Package

* Cleanup

* Rename deps to imports

* Fix exceptions

* Pass method

* Go trough all packages

* Improve logs

* Rename file

* Remove old scripts

* Exit with 1 if failing

* Fix validator-set-vote-weighted

* Validator set static

* Fix validator

* Fix utils

* Fix transaction pool

* Fix test-framework

* Fix packages

* Add deps check

* style: resolve style guide violations

* Fix ci

* Fix api

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>
  • Loading branch information
sebastijankuzner and sebastijankuzner authored Feb 26, 2024
1 parent 163ba87 commit 5306586
Show file tree
Hide file tree
Showing 47 changed files with 544 additions and 507 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ distribution
node_modules
LICENSE
CODE_OF_CONDUCT.md
scripts

packages/p2p/source/hapi-nes
52 changes: 52 additions & 0 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
jobs:
source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: false
version: latest
- name: Get pnpm store directory
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache pnpm modules
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
restore-keys: ${{ runner.os }}-pnpm-
- name: Cache lerna
uses: actions/cache@v3
with:
key: ${{ runner.os }}-lerna
path: ./.cache
restore-keys: ${{ runner.os }}-lerna-
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Check dependencies
run: pnpm run deps:check
strategy:
matrix:
node-version:
- 20.x
name: Dependencies
on:
pull_request:
types:
- ready_for_review
- synchronize
- opened
push:
branches:
- main
- develop
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
"clean:all": "pnpm run clean && pnpm run clean:node_modules && rm -r .cache",
"clean:node_modules": "del packages/*/node_modules && del node_modules",
"deps": "cross-env-shell ./scripts/deps/update.sh",
"deps:missing": "node ./scripts/deps/missing.js",
"deps:check": "node ./scripts/deps/check.js",
"deps:types": "./node_modules/typesync/bin/typesync",
"deps:unused": "node ./scripts/deps/unused.js",
"docker": "node ./scripts/docker/generate-docker.js",
"format": "pnpm run lint && pnpm run prettier",
"lint": "eslint packages/*/source --ext .ts --ignore-pattern *.test.ts --fix",
Expand Down
2 changes: 0 additions & 2 deletions packages/api-database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"dayjs": "1.11.10",
"pg": "8.11.3",
"reflect-metadata": "0.2.0",
"typeorm": "0.3.17"
},
"devDependencies": {
Expand Down
5 changes: 0 additions & 5 deletions packages/api-development/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@
"dependencies": {
"@hapi/boom": "10.0.1",
"@hapi/hapi": "21.3.2",
"@hapi/hoek": "11.0.4",
"@mainsail/api-common": "workspace:*",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/transactions": "workspace:*",
"@mainsail/utils": "workspace:*",
"joi": "17.11.0",
"nanomatch": "1.2.13",
"rate-limiter-flexible": "3.0.6",
"semver": "7.5.4"
},
"devDependencies": {
"@types/ip": "1.1.3",
"@types/semver": "7.5.6",
"uvu": "^0.5.6"
},
Expand Down
5 changes: 1 addition & 4 deletions packages/api-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@
"dependencies": {
"@hapi/boom": "10.0.1",
"@hapi/hapi": "21.3.2",
"@hapi/hoek": "11.0.4",
"@mainsail/api-common": "workspace:*",
"@mainsail/api-database": "workspace:*",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"dayjs": "1.11.10",
"joi": "17.11.0",
"nanomatch": "1.2.13",
"rate-limiter-flexible": "3.0.6"
"joi": "17.11.0"
},
"devDependencies": {
"@types/ip": "1.1.3",
Expand Down
10 changes: 1 addition & 9 deletions packages/api-transaction-pool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,15 @@
"dependencies": {
"@hapi/boom": "10.0.1",
"@hapi/hapi": "21.3.2",
"@hapi/hoek": "11.0.4",
"@mainsail/api-common": "workspace:*",
"@mainsail/api-database": "workspace:*",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/transactions": "workspace:*",
"@mainsail/utils": "workspace:*",
"dayjs": "1.11.10",
"joi": "17.11.0",
"nanomatch": "1.2.13",
"rate-limiter-flexible": "3.0.6"
"joi": "17.11.0"
},
"devDependencies": {
"@types/ip": "1.1.3",
"@types/semver": "7.5.6",
"got": "11.8.6",
"uvu": "^0.5.6"
},
"engines": {
Expand Down
18 changes: 9 additions & 9 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@
"@mainsail/api-database": "workspace:*",
"@mainsail/api-http": "workspace:*",
"@mainsail/cli": "workspace:*",
"@mainsail/configuration-generator": "workspace:*",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/logger-pino": "workspace:*",
"@mainsail/test-framework": "workspace:*",
"@mainsail/utils": "workspace:*",
"boxen": "4.2.0",
"cross-env": "7.0.3",
"dayjs": "1.11.10",
"envfile": "7.0.0",
"execa": "5.1.1",
"fs-extra": "11.2.0",
"joi": "17.11.0",
"kleur": "4.1.5",
"prompts": "2.4.2",
"tmp": "0.2.1",
"uvu": "^0.5.6"
"kleur": "4.1.5"
},
"devDependencies": {
"@mainsail/test-framework": "workspace:*",
"@types/boxen": "3.0.1",
"@types/execa": "2.0.0",
"@types/fs-extra": "11.0.4",
"@types/prompts": "2.4.9",
"@types/tmp": "0.2.6"
"@types/tmp": "0.2.6",
"cross-env": "7.0.3",
"env-paths": "2.2.1",
"execa": "5.1.1",
"prompts": "2.4.2",
"tmp": "0.2.1",
"uvu": "^0.5.6"
},
"peerDependencies": {
"pm2": "^5.3.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/configuration-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
"@mainsail/validation": "workspace:*",
"bip39": "3.1.0",
"dayjs": "1.11.10",
"env-paths": "2.2.1",
"envfile": "7.0.0",
"fs-extra": "11.2.0"
},
"devDependencies": {
"@types/env-paths": "2.1.0",
"@types/fs-extra": "11.0.4",
"@types/tmp": "0.2.6",
"env-paths": "2.2.1",
"tmp": "0.2.1",
"uvu": "^0.5.6"
},
Expand Down
4 changes: 0 additions & 4 deletions packages/consensus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"dayjs": "1.11.10",
"delay": "5.0.0",
"lmdb": "2.9.2"
},
"devDependencies": {
"@mainsail/test-framework": "workspace:*",
"@types/delay": "3.1.0",
"@types/seedrandom": "^3.0.8",
"rewiremock": "3.14.5",
"uvu": "^0.5.6"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
},
"dependencies": {
"inversify": "6.0.2",
"reflect-metadata": "0.2.0",
"reflect-metadata": "0.2.0"
},
"devDependencies": {
"uvu": "^0.5.6"
},
"engines": {
Expand Down
14 changes: 7 additions & 7 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"@mainsail/proposer": "workspace:*",
"@mainsail/serializer": "workspace:*",
"@mainsail/state": "workspace:*",
"@mainsail/test-framework": "workspace:*",
"@mainsail/transaction-pool": "workspace:*",
"@mainsail/transactions": "workspace:*",
"@mainsail/utils": "workspace:*",
Expand All @@ -91,25 +90,26 @@
"@mainsail/webhooks": "workspace:*",
"bip39": "3.1.0",
"boxen": "4.2.0",
"cross-env": "7.0.3",
"dayjs": "1.11.10",
"env-paths": "2.2.1",
"envfile": "7.0.0",
"execa": "5.1.1",
"fs-extra": "11.2.0",
"joi": "17.11.0",
"kleur": "4.1.5",
"prompts": "2.4.2",
"tmp": "0.2.1",
"uvu": "^0.5.6"
"prompts": "2.4.2"
},
"devDependencies": {
"@mainsail/test-framework": "workspace:*",
"@types/boxen": "3.0.1",
"@types/env-paths": "2.1.0",
"@types/execa": "2.0.0",
"@types/fs-extra": "11.0.4",
"@types/prompts": "2.4.9",
"@types/tmp": "0.2.6"
"@types/tmp": "0.2.6",
"cross-env": "7.0.3",
"execa": "5.1.1",
"tmp": "0.2.1",
"uvu": "^0.5.6"
},
"peerDependencies": {
"pm2": "^5.3.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto-address-keccak256/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"dependencies": {
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/crypto-config": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"ethers": "^6.9.0"
},
"devDependencies": {
"@mainsail/crypto-config": "workspace:*",
"@mainsail/crypto-key-pair-ecdsa": "workspace:*",
"@mainsail/crypto-key-pair-schnorr": "workspace:*",
"@mainsail/crypto-validation": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/crypto-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
"dependencies": {
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/crypto-config": "workspace:*",
"@mainsail/crypto-transaction": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"@mainsail/validation": "workspace:*",
"ajv": "8.12.0"
},
"devDependencies": {
"@mainsail/crypto-address-bech32m": "workspace:*",
"@mainsail/crypto-config": "workspace:*",
"@mainsail/crypto-key-pair-schnorr": "workspace:*",
"@mainsail/crypto-validation": "workspace:*",
"@mainsail/validation": "workspace:*",
"@types/lodash.clone": "^4.5.9",
"lodash.clone": "^4.5.0",
"uvu": "^0.5.6"
Expand Down
7 changes: 1 addition & 6 deletions packages/crypto-commit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@
"dependencies": {
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/crypto-block": "workspace:*",
"@mainsail/crypto-config": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"ajv": "8.12.0"
"@mainsail/utils": "workspace:*"
},
"devDependencies": {
"@mainsail/crypto-validation": "workspace:*",
"@mainsail/validation": "workspace:*",
"uvu": "^0.5.6"
},
"engines": {
Expand Down
8 changes: 1 addition & 7 deletions packages/crypto-consensus-bls12-381/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@
"@mainsail/contracts": "workspace:*",
"@mainsail/crypto-key-pair-bls12-381": "workspace:*",
"@mainsail/crypto-signature-bls12-381": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"ajv": "8.12.0",
"dayjs": "1.11.10",
"inversify": "6.0.2",
"reflect-metadata": "0.2.0",
"type-fest": "4.8.3"
"@mainsail/kernel": "workspace:*"
},
"devDependencies": {
"uvu": "^0.5.6"
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto-key-pair-bls12-381/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
"@chainsafe/blst": "^0.2.9",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/crypto-config": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"@scure/bip39": "^1.2.1",
"bls12-381-keygen": "^0.2.3",
"wif": "^4.0.0"
},
"devDependencies": {
"@mainsail/crypto-config": "workspace:*",
"@mainsail/crypto-validation": "workspace:*",
"@mainsail/validation": "workspace:*",
"@types/wif": "^2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto-key-pair-ecdsa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"dependencies": {
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/crypto-config": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"bcrypto": "5.5.2",
"wif": "^4.0.0"
},
"devDependencies": {
"@mainsail/crypto-config": "workspace:*",
"@mainsail/crypto-validation": "workspace:*",
"@mainsail/validation": "workspace:*",
"@types/wif": "^2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto-key-pair-ed25519/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"dependencies": {
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/crypto-config": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"@noble/ed25519": "^2.0.0",
Expand All @@ -31,6 +30,7 @@
"wif": "^4.0.0"
},
"devDependencies": {
"@mainsail/crypto-config": "workspace:*",
"@mainsail/crypto-validation": "workspace:*",
"@mainsail/validation": "workspace:*",
"@types/wif": "^2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto-key-pair-schnorr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"dependencies": {
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/crypto-config": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"bcrypto": "5.5.2",
"wif": "^4.0.0"
},
"devDependencies": {
"@mainsail/crypto-config": "workspace:*",
"@mainsail/crypto-validation": "workspace:*",
"@mainsail/validation": "workspace:*",
"@types/wif": "^2.0.5",
Expand Down
Loading

0 comments on commit 5306586

Please sign in to comment.