tokenbridge-contracts icon indicating copy to clipboard operation
tokenbridge-contracts copied to clipboard

Migrate from npm to yarn

Open k1rill-fedoseev opened this issue 4 years ago • 3 comments

I noticed that yarn package manager works much faster than the default npm. Also, yarn is used in the monorepo, so I propose to use it in this repo as well.

While changes delta in this PR is insane, there are only a few things were done:

  • Move ./contracts/* to ./contracts/contracts/*, update import paths in deploy scripts.
  • Add contracts, deploy, upgrade workspaces to the root package.json
  • Remove npm's package-lock.json files, generate yarn.lock by running yarn install. As a side effect, this caused a lot of dependency updates.
  • Enable linting for ./deploy and ./upgrade, it was already configured previously, but was not run.
  • Run yarn lint:js:fix and yarn lint:sol:fix to fix appeared lint errors.
  • Replace usages of npm with yarn commands in docs, scripts, Dockerfiles, etc.

k1rill-fedoseev avatar Sep 08 '20 09:09 k1rill-fedoseev

Could you share ideas why previously the lint does not require such changes for the contracts?

akolotov avatar Sep 11 '20 19:09 akolotov

why is it require to move contracts to ./contracts/contracts/ instead of ./contracts?

akolotov avatar Sep 11 '20 19:09 akolotov

Could you share ideas why previously the lint does not require such changes for the contracts?

I think some linting rules were changed or added to the new version of solhint.

why is it require to move contracts to ./contracts/contracts/ instead of ./contracts?

That is the recommended way to use yarn workspaces, to keep each workspace code and dependencies in its own directory.

k1rill-fedoseev avatar Sep 12 '20 07:09 k1rill-fedoseev