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 all projects dependencies #1775

Merged
merged 24 commits into from
Dec 9, 2024

Conversation

0237h
Copy link
Collaborator

@0237h 0237h commented Nov 27, 2024

Changes

Project

  • Remove @babel/core
  • Remove @babel/preset-env
  • Remove @babel/preset-typescript
  • eslint

cli

  • Add node: prefix for built-in modules (e.g. node:fs)
  • Remove dockerode
  • Remove tern
  • Upgrade moduleResolution to bundler, module to ESNext and target to ESNext making it an ESM module
  • binary-install-raw
    • Replace with binary-install
  • chokidar
    • Import type FSWatcher as namespace no longer available
    • Remove await for onTrigger as it's no longer async
  • http-ipfs-client
    • Migrate from http-ipfs-client to kubo-rpc-client with dynamic import as it's ESM only1
    • Make createCompiler async due to dynamic import
  • immutable
    • Map([ [ 'k', 'v' ] ]) or Map({ k: 'v' }) instead of Map.of2
    • Replace immutable.Collection<ProtocolName, string[]> with immutable.Collection<ProtocolName, immutable.List<string>>
  • js-yaml
    • Replace safe* variants with load/loadall/dump3
  • oclif/core
    • Use gluegun.prompt instead of ux.prompt4
    • Fix prompt variable assignments from object destructuring (thanks @YaroShkvorets)
    • Migrate to ESM5
  • sync-request
    • Replace with async fetch call6
    • Make generateTypes async and update NEAR test snapshot
  • vitest
    • Remove concurrent for tests using the file system
  • web3-eth-abi
    • Import decodeLogs method directly as there is no more default export
  • yaml
    • Remove strOptions7

ts

  • Remove common/eager_offset.ts
  • assemblyscript/asc
    • Use assemblyscript/asc as import
    • asc.main no longer as callback for error, uses stderr and is async8
    • Remove asc.ready9
    • Remove ascMain in package.json10
    • Replace Promise.allSettled with for loop in tests for resolving WASM generation promises in sequence (prevent WASM file corruption since they use same file outputWasmPath).
    • Silence warning 235 on compilation about exports11

website

  • Fix eslint config

Examples

  • ethereum-basic-event-handlers
    • Fix chai max version to 4.x.x as chai 5.x.x is ESM and hardhat doesn't support ESM Typescript projects yet12
    • Rename ethers.BaseContract.address to ethers.BaseContract.target
    • Remove @nomiclabs/hardhat-ethers
    • Remove @nomiclabs/hardhat-etherscan
    • Remove @typechain/ethers-v5
    • Remove @typechain/hardhat
    • Remove ethers
    • Remove hardhat-gas-reporter
    • Remove solidity-coverage
    • Remove typechain

Footnotes

  1. https://github.com/ipfs/helia/issues/157

  2. https://github.com/immutable-js/immutable-js/blob/b3a1c9f13880048d744366ae561c39a34b26190a/CHANGELOG.md#breaking-changes

  3. https://github.com/nodeca/js-yaml/blob/0d3ca7a27b03a6c974790a30a89e456007d62976/migrate_v3_to_v4.md#safeload-safeloadall-safedump--load-loadall-dump

  4. https://github.com/oclif/core/discussions/999

  5. https://oclif.io/docs/esm/

  6. https://www.npmjs.com/package/sync-request

  7. https://github.com/eemeli/yaml/pull/235

  8. https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0

  9. https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0

  10. https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0

  11. https://github.com/AssemblyScript/assemblyscript/issues/2277

  12. https://hardhat.org/hardhat-runner/docs/advanced/using-esm#esm-and-typescript-projects

@0237h 0237h self-assigned this Nov 27, 2024
Copy link

changeset-bot bot commented Nov 27, 2024

🦋 Changeset detected

Latest commit: 6e31985

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@graphprotocol/graph-cli Minor
@graphprotocol/graph-ts Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@0237h 0237h force-pushed the chore/update-dependencies branch 6 times, most recently from ca5979a to b8abfa9 Compare November 29, 2024 22:32
@YaroShkvorets YaroShkvorets marked this pull request as ready for review December 2, 2024 23:50
@0237h 0237h force-pushed the chore/update-dependencies branch from b8abfa9 to 1d49367 Compare December 3, 2024 15:37
`yaml-ts`
- Replace `safe*` variants with `load`/`loadall`/`dump` -> https://github.com/nodeca/js-yaml/blob/0d3ca7a27b03a6c974790a30a89e456007d62976/migrate_v3_to_v4.md#safeload-safeloadall-safedump--load-loadall-dump

`immutable`
- `Map([ [ 'k', 'v' ] ])` or `Map({ k: 'v' })` instead of `Map.of` -> https://github.com/immutable-js/immutable-js/blob/b3a1c9f13880048d744366ae561c39a34b26190a/CHANGELOG.md#breaking-changes
- Replace `immutable.Collection<ProtocolName, string[]>` with `immutable.Collection<ProtocolName, immutable.List<string>>`

`oclif/core`
- Use `gluegun.prompt` instead of `ux.prompt` -> oclif/core#999
- Fix `prompt` variable assignments from object destructuring (thanks @YaroShkvorets)
- Migrate to ESM -> https://oclif.io/docs/esm/

`assemblyscript/asc`
- Use `assemblyscript/asc` as import
- `asc.main` no longer as callback for error, uses stderr and is async -> https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0
- Remove `asc.ready` -> https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0
- Remove `ascMain` in `package.json` -> https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0
- Replace `Promise.allSettled` with for loop in tests for resolving WASM generation promises in sequence (prevent WASM file corruption since they use same file `outputWasmPath`).

`yaml`
- Remove `strOptions` -> eemeli/yaml#235

`chokidar`
- Import type `FSWatcher` as namespace no longer available
- Remove `await` for `onTrigger` as it's no longer async

`http-ipfs-client`
- Migrate from `http-ipfs-client` to `kubo-rpc-client` with dynamic import as it's ESM only -> ipfs/helia#157
- Make `createCompiler` async due to dynamic import

`cli/package.json`
- Upgrade `moduleResolution` to `bundler`, `module` to `ESNext` and `target` to `ESNext` making it an ESM module

`eslint`
- Move `.eslintignore` inside config ->
- Use `ESLINT_USE_FLAT_CONFIG=false` in pnpm scripts
- Update config annotations

`sync-request`
- Deprecated, replace with async `fetch` call -> https://www.npmjs.com/package/sync-request
- Make `generateTypes` async and update NEAR test snapshot

`web3-eth-abi`
- Import `decodeLogs` method directly as there is no more default export

`vitest`
- Remove `concurrent` for tests using filesystem

`dockerode`
- Remove dependency

`tern`
- Remove dependency

`binary-install-raw`
- Replace with `binary-install`

`ethereum-basic-event-handlers`
- Fix `chai` max version to `4.2.0` as `hardhat` doesn't support ESM Typescript -> https://hardhat.org/hardhat-runner/docs/advanced/using-esm#esm-and-typescript-projects
- `ethers.BaseContract.address` renamed to `ethers.BaseContract.target`

---------

Co-authored-by: YaroShkvorets <[email protected]>
@0237h 0237h force-pushed the chore/update-dependencies branch from 1d49367 to b03ae1b Compare December 3, 2024 17:58
.eslintrc.cjs Outdated Show resolved Hide resolved
.eslintrc.cjs Outdated Show resolved Hide resolved
Copy link
Collaborator

@YaroShkvorets YaroShkvorets left a comment

Choose a reason for hiding this comment

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

Made a few changes:

  • removed packages/cli/yarn.lock since we are using pnpm throughout
  • removed babel.config.js
  • migrated eslint config to latest standard
  • reviewed eslint rules
  • fixed various lint warnings

@0237h 0237h merged commit 7faa309 into graphprotocol:main Dec 9, 2024
9 checks passed
@0237h 0237h deleted the chore/update-dependencies branch December 9, 2024 15:03
@YaroShkvorets YaroShkvorets mentioned this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants