trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.03k stars 2.31k forks source link

devDeps: deduplicate babel packages #6185

Closed legobeat closed 10 months ago

legobeat commented 10 months ago

PR description

Currently yarn.lock pins multiple different versions of the same package, even if a single version would satisfy all the constraints. This wastes disk space, computational time, human time, and environmental resources ;)

This PR deduplicates packages with the @babel/ and babel- prefixes, saving ~400MB.

#Before
$ du -hs node_modules
2.1G    node_modules

# After
$ du -hs node_modules
1.7G    node_modules

Based on #6177 as they touch the same lines and that one seems higher priority.

Testing instructions

Documentation

Breaking changes and new features

legobeat commented 10 months ago

The same CI job+commit failing here passes over in https://github.com/legobeat/truffle/pull/8 so I guess this is just a flaky test?

haltman-at commented 10 months ago

Did you PR the right thing? I'm only changes to semver packages in this PR.

legobeat commented 10 months ago

Did you PR the right thing? I'm only changes to semver packages in this PR.

What I meant with this:

Based on https://github.com/trufflesuite/truffle/pull/6177 as they touch the same lines and that one seems higher priority.

...is that those changes are also part of this PR. The rest (in fact, the bulk) are in yarn.lock in 56846157f7b74b8ca6a665418a4dbc93c103972f. May not be immediately obvious if you're reviewing through GitHub web.

haltman-at commented 10 months ago

Oh, I see!

haltman-at commented 10 months ago

Well, now this has a yarn.lock conflict...

legobeat commented 10 months ago

@haltman-at rebased and resolved

haltman-at commented 10 months ago

Hm, something seems to be going wrong. A test in codec-components seems to be consistently failing. @cliffoo, any ideas by any chance?

legobeat commented 10 months ago

Putting in draft until this is resolved:

$ lerna run docs --stream --concurrency=1
lerna notice cli v5.6.2
lerna info versioning independent
lerna info ci enabled
lerna info Executing command in 3 packages: "yarn run docs"
@truffle/codec: $ ./scripts/generate-docs
@truffle/codec: [info] Documentation generated at ./dist/docs
@truffle/codec: [info] JSON written to ./dist/api.json
@truffle/preserve: $ typedoc --options ./docs/typedoc.json
@truffle/preserve: [info] Documentation generated at ./dist/docs
@truffle/preserve: [info] JSON written to ./docs/api.json
@truffle/codec-components: $ vite build
@truffle/codec-components: failed to load config from /home/runner/work/truffle/truffle/packages/codec-components/vite.config.js
@truffle/codec-components: error during build:
@truffle/codec-components: TypeError: Cannot redefine property: File
@truffle/codec-components:     at Function.defineProperty (<anonymous>)
@truffle/codec-components:     at Object.<anonymous> (/home/runner/work/truffle/truffle/node_modules/@babel/core/lib/index.js:7:8)
@truffle/codec-components:     at Module._compile (node:internal/modules/cjs/loader:1241:14)
@truffle/codec-components:     at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
@truffle/codec-components:     at Module.load (node:internal/modules/cjs/loader:1091:32)
@truffle/codec-components:     at Module._load (node:internal/modules/cjs/loader:938:12)
@truffle/codec-components:     at Module.require (node:internal/modules/cjs/loader:1115:19)
@truffle/codec-components:     at require (node:internal/modules/helpers:130:18)
@truffle/codec-components:     at Object.<anonymous> (/home/runner/work/truffle/truffle/node_modules/@babel/core/lib/config/helpers/config-api.js:16:9)
@truffle/codec-components:     at Module._compile (node:internal/modules/cjs/loader:1241:14)
@truffle/codec-components: error Command failed with exit code 1.
@truffle/codec-components: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run docs exited 1 in '@truffle/codec-components'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Process completed with exit code 1.
haltman-at commented 10 months ago

Oh, ick -- it looks like this failure is happening on develop as well. So it's not due to this PR. But that leaves the question of why something is going wrong on develop...

legobeat commented 10 months ago

Hmm:

legobeat commented 10 months ago

@haltman-at #6186