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

Update dependencies #2011

Merged
merged 65 commits into from
Aug 30, 2024
Merged

Update dependencies #2011

merged 65 commits into from
Aug 30, 2024

Conversation

hellwolf
Copy link
Contributor

@hellwolf hellwolf commented Aug 27, 2024

  • 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

Copy link

Changelog Reminder

Reminder to update the CHANGELOG.md for any of the modified packages in this PR.

  • CHANGELOG.md modified
  • Double check before merge

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.36%. Comparing base (3d5df70) to head (ff9ed76).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2011      +/-   ##
==========================================
- Coverage   88.45%   88.36%   -0.09%     
==========================================
  Files         111      111              
  Lines        6971     6999      +28     
  Branches      933      962      +29     
==========================================
+ Hits         6166     6185      +19     
- Misses        803      812       +9     
  Partials        2        2              
Flag Coverage Δ
ethereum-contracts 94.51% <ø> (ø)
sdk-core 88.36% <ø> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hellwolf hellwolf changed the title Update all dependencies, targeting patch+minor Update dependencies Aug 27, 2024
@hellwolf hellwolf marked this pull request as ready for review August 29, 2024 07:42
@@ -2,6 +2,7 @@
. "$(dirname "$0")/_/husky.sh"

# always lint these
npm run lint:syncpack
Copy link
Contributor Author

Choose a reason for hiding this comment

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

might be assuming too much: if you don't use nix, you need to have shellcheck and actionlint installed globally.

Copy link
Contributor

Choose a reason for hiding this comment

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

shellcheck can be installed from NPM and could be added as a dev dependency to the project. Doesn't seem to be the case for actionlint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me clean up a bit of the shell scripts that have these dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up with some warning messages.

@@ -2,6 +2,7 @@
. "$(dirname "$0")/_/husky.sh"

# always lint these
npm run lint:syncpack
Copy link
Contributor

Choose a reason for hiding this comment

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

shellcheck can be installed from NPM and could be added as a dev dependency to the project. Doesn't seem to be the case for actionlint.

package.json Outdated
"@types/lodash": "^4.17.7",
"@types/mocha": "^10.0.7",
"@typescript-eslint/eslint-plugin": "8.3.0",
"@typescript-eslint/parser": "8.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if some of these locked versions are on purpose

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably not, not sure why it happenned with syncpack updating them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Codified the rules with the syncpack:

semverGroups:
  # Note: rule priority is top (high) to bottom (low)
  - label: Use looser ranges for metadata and ethereum-contracts local packages
    dependencies:
      - "@superfluid-finance/metadata"
      - "@superfluid-finance/ethereum-contracts"
    range: "^"
  - label: Use exact version for prod dependencies
    dependencyTypes: ["prod"]
    range: ""
  - label: Use looser range by default
    range: "^"

@d10r
Copy link
Collaborator

d10r commented Aug 29, 2024

getting this when committing in ethereum-contracts:

husky - DEPRECATED

Please remove the following two lines from .husky/pre-commit:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

They WILL FAIL in v10.0.0

@d10r
Copy link
Collaborator

d10r commented Aug 29, 2024

new behaviour:

Versions
= Pin stack-trace to the same version, since newer version starts to use ES module 
     1 ✓ already valid
= Default Version Group ========================================================
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/ethereum-contracts/package.json > devDependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/js-sdk/package.json > dependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/sdk-core/package.json > dependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/subgraph/package.json > devDependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/automation-contracts/scheduler/package.json > devDependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/automation-contracts/autowrap/package.json > devDependencies [LocalPackageMismatch]
   117 ✓ already valid
     6 ✓ can be auto-fixed
Semver Ranges
= the version property of package.json files must always be exact ==============
✓ 11 valid
= Use looser ranges for metadata and ethereum-contracts local packages =========
✓ 11 valid
= Use exact version for prod dependencies ======================================
✓ 23 valid
= Use looser range by default ==================================================
✓ 79 valid
husky - pre-commit script failed (code 1)

I used yarn manage-versions to fix, which had this side effect:

+++ b/packages/subgraph/package.json
@@ -5,11 +5,11 @@
     "dependencies": {
         "@graphprotocol/graph-cli": "0.80.1",
         "@graphprotocol/graph-ts": "0.35.1",
-        "@superfluid-finance/sdk-core": "0.8.0",
+        "@superfluid-finance/sdk-core": "^0.8.0",

probably not intended (?)

@hellwolf
Copy link
Contributor Author

getting this when committing in ethereum-contracts:

husky - DEPRECATED

Please remove the following two lines from .husky/pre-commit:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

They WILL FAIL in v10.0.0

fixed

@hellwolf
Copy link
Contributor Author

new behaviour:

Versions
= Pin stack-trace to the same version, since newer version starts to use ES module 
     1 ✓ already valid
= Default Version Group ========================================================
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/ethereum-contracts/package.json > devDependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/js-sdk/package.json > dependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/sdk-core/package.json > dependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/subgraph/package.json > devDependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/automation-contracts/scheduler/package.json > devDependencies [LocalPackageMismatch]
✘ @superfluid-finance/metadata ^1.4.1 → ^1.5.0 packages/automation-contracts/autowrap/package.json > devDependencies [LocalPackageMismatch]
   117 ✓ already valid
     6 ✓ can be auto-fixed
Semver Ranges
= the version property of package.json files must always be exact ==============
✓ 11 valid
= Use looser ranges for metadata and ethereum-contracts local packages =========
✓ 11 valid
= Use exact version for prod dependencies ======================================
✓ 23 valid
= Use looser range by default ==================================================
✓ 79 valid
husky - pre-commit script failed (code 1)

I used yarn manage-versions to fix, which had this side effect:

+++ b/packages/subgraph/package.json
@@ -5,11 +5,11 @@
     "dependencies": {
         "@graphprotocol/graph-cli": "0.80.1",
         "@graphprotocol/graph-ts": "0.35.1",
-        "@superfluid-finance/sdk-core": "0.8.0",
+        "@superfluid-finance/sdk-core": "^0.8.0",

probably not intended (?)

Our rules for semvers of packages is coded in .syncpackrc.yml, this currently requires 'exact' version for prod packages except metadata and ethereum-contracts:

semverGroups:
  # Note: rule priority is top (high) to bottom (low)
  - label: Use looser ranges for metadata and ethereum-contracts local packages
    dependencies:
      - "@superfluid-finance/metadata"
      - "@superfluid-finance/ethereum-contracts"
    range: "^"
  - label: Use exact version for prod dependencies
    dependencyTypes: ["prod"]
    range: ""
  - label: Use looser range by default
    range: "^"

Lerna has a option --exact when managing versions.

But I'd like to review the semverGroups rule before closing the PR, since I find the exceptions "fishy".

@hellwolf hellwolf merged commit 9a4abaf into dev Aug 30, 2024
23 of 24 checks passed
@hellwolf hellwolf deleted the update-deps-20240822 branch August 30, 2024 08:42
Copy link

XKCD Comic Relif

Link: https://xkcd.com/2011
https://xkcd.com/2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants