Skip to content

Commit

Permalink
Update dependencies (#2011)
Browse files Browse the repository at this point in the history
- Dependency updates:
  - update all dependencies, targeting minor versions
  - update major versions of:
    - hardhat 9
    - syncpack
    - solhint
    - webpack-cli 5
    - prettier-eslint, @typescript-eslint/eslint-plugin, @typescript-eslint/parser
    - @nomicfoundation/hardhat-ethers
    - node-jq
    - chai-as-promised
    - nyc
    - @graphql-codegen/near-operation-file-preset
- syncpack linting:
  - integrated into ci and pre-commit
  - format all package.json
  - pin stack-trace package version due to its es module usage
- removed dependency resolutions:
  - root: mocha
  - sdk-core: graphql
- upgrade nodejs usage
  - making node22 default
  - testing matrix expanded to 18,20,22
- update to yarn 1.22.22

**Dependencies left not updated to new major versions**

◉   @nomicfoundation/hardhat-chai-matchers 1.0.6 → 2.0.7  - https://github.com/nomicfoundation/hardhat
◉   eslint 8.57.0 → 9.9.1                          - https://github.com/eslint/eslint
◉   web3 ^1.10.4 → 4.12.1                           - https://github.com/ChainSafe/web3.js
◉   @openzeppelin/contracts 4.9.6 → 5.0.2         - https://github.com/OpenZeppelin/openzeppelin-contracts
◉   ethers ^5.7.2 → 6.13.2                         - https://github.com/ethers-io/ethers.js
◉   auto-bind 4.0.0 → 5.0.1                       - https://github.com/sindresorhus/auto-bind
◉   node-fetch 2.7.0 → 3.3.2                      - https://github.com/node-fetch/node-fetch
◉   graphql-request ^6.1.0 → 7.1.0                 - https://github.com/jasonkuhrt/graphql-request
◉   @reduxjs/toolkit ^1.9.7 → 2.2.7                - https://github.com/reduxjs/redux-toolkit
◉   react-redux ^8.1.3 → 9.1.2                     - https://github.com/reduxjs/react-redux
  • Loading branch information
hellwolf authored Aug 30, 2024
1 parent 3d5df70 commit 9a4abaf
Show file tree
Hide file tree
Showing 30 changed files with 3,977 additions and 3,108 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/call.test-ethereum-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
id: set-matrix
run: |
if [ "${{ inputs.run-coverage-tests }}" == "true" ];then
echo "matrix={\"node-version\": [20]}" >> "$GITHUB_OUTPUT"
echo "matrix={\"node-version\": [22]}" >> "$GITHUB_OUTPUT"
else
echo "matrix={\"node-version\": [18, 20]}" >> "$GITHUB_OUTPUT"
echo "matrix={\"node-version\": [18, 20, 22]}" >> "$GITHUB_OUTPUT"
fi
test-ethereum-contracts:
Expand All @@ -40,6 +40,7 @@ jobs:

strategy:
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }}
fail-fast: false

env:
DEV_SHELL_NAME: ci-node${{ matrix.node-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/call.test-local-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:

env:
DEV_SHELL_NAME: ci-node20
DEV_SHELL_NAME: ci-node22
ethereum-contracts-working-directory: ./packages/ethereum-contracts
sdk-core-working-directory: ./packages/sdk-core
subgraph-working-directory: ./packages/subgraph
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
run: |
./tasks/setup-graph-node.sh &
# wait for it to warm up
sleep 30
sleep 15
working-directory: ${{ env.subgraph-working-directory }}

- name: Run subgraph integration test suite
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/call.test-sdk-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
id: set-matrix
run: |
if [ "${{ inputs.run-coverage-tests }}" == "true" ];then
echo "matrix={\"node-version\": [20]}" >> "$GITHUB_OUTPUT"
echo "matrix={\"node-version\": [22]}" >> "$GITHUB_OUTPUT"
else
echo "matrix={\"node-version\": [18, 20]}" >> "$GITHUB_OUTPUT"
echo "matrix={\"node-version\": [18, 20, 22]}" >> "$GITHUB_OUTPUT"
fi
test-sdk-core:
Expand All @@ -43,6 +43,7 @@ jobs:

strategy:
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }}
fail-fast: false

env:
DEV_SHELL_NAME: ci-node${{ matrix.node-version }}
Expand Down Expand Up @@ -119,13 +120,15 @@ jobs:
run: |
./tasks/setup-graph-node.sh &
# wait for it to warm up
sleep 30
sleep 15
working-directory: ${{ env.subgraph-working-directory }}

- name: Build and deploy local subgraph
if: steps.base.outputs.cache-hit != 'true'
run: |
yarn build-and-deploy-local
# wait for it to sync
sleep 15
working-directory: ${{ env.subgraph-working-directory }}

- name: Run test suite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:
- name: "Docker compose"
run: |
./tasks/setup-graph-node.sh &
# wait 5 seconds for it to warm up
sleep 5
# wait for it to sync
sleep 15
working-directory: ./packages/subgraph

- name: "Prepare and Deploy Local Subgraph"
Expand Down
18 changes: 14 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env bash

maybe_run() {
exec=$1
shift
if which "$exec" &>/dev/null; then
"$@"
else
echo "⚠️ Please install $exec!"
fi
}

# always lint these
npm run lint:shellcheck
npm run lint:actionlint
npm run lint:syncpack
maybe_run shellcheck npm run lint:shellcheck
maybe_run actionlint npm run lint:actionlint

# only lint the workspace if there is staged files
for i in $(jq -r '.workspaces.packages | .[]' package.json); do
Expand Down
23 changes: 23 additions & 0 deletions .syncpackrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
indent: " " # four spaces
dependencyTypes: ["!peer", "!resolutions"] # let us take care of the peer dependency resolutions by hand
sortAz: ["!scripts"] # we prefer to sort scripts by-hand, because sometimes it uses run-s pattern
semverGroups:
# Note: rule priority is top (high) to bottom (low)
- label: Use looser ranges for metadata local packages
dependencies:
# Note: - Metadata updates often include new network configuration, which we do not want to force a new SDK
# version in order for the client to be able to use.
# - Probably this is better set in peerDependencies, instaed. However, that might be a breaking change to
# the current developers of SDK.
- "@superfluid-finance/metadata"
range: "^"
- label: Use exact version for prod dependencies
dependencyTypes: ["prod"]
range: ""
- label: Use looser range by default
range: "^"
versionGroups:
- label: Pin stack-trace to the same version, since newer version starts to use ES module
dependencies:
- "stack-trace"
pinVersion: "0.0.10"
Loading

0 comments on commit 9a4abaf

Please sign in to comment.