Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

devDeps: deduplicate babel packages #6185

Merged
merged 2 commits into from Sep 7, 2023

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Sep 5, 2023

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

  • I thought about documentation and added the doc-change-required label to this PR if documentation updates are required.

Breaking changes and new features

  • I have added any needed breaking-change and new-feature labels for the appropriate packages.

@legobeat legobeat changed the title Devdeps dedupe babel chore(devDeps): deduplicate babel packages Sep 5, 2023
@legobeat legobeat changed the title chore(devDeps): deduplicate babel packages devDeps: deduplicate babel packages Sep 6, 2023
@legobeat legobeat marked this pull request as draft September 6, 2023 00:18
@legobeat

This comment was marked as resolved.

@haltman-at
Copy link
Contributor

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

@legobeat
Copy link
Contributor Author

legobeat commented Sep 6, 2023

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

What I meant with this:

Based on #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 5684615. May not be immediately obvious if you're reviewing through GitHub web.

@haltman-at
Copy link
Contributor

Oh, I see!

@haltman-at
Copy link
Contributor

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

@legobeat
Copy link
Contributor Author

legobeat commented Sep 6, 2023

@haltman-at rebased and resolved

@haltman-at
Copy link
Contributor

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

@legobeat
Copy link
Contributor Author

legobeat commented Sep 7, 2023

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.

@legobeat legobeat marked this pull request as draft September 7, 2023 00:41
@haltman-at
Copy link
Contributor

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
Copy link
Contributor Author

legobeat commented Sep 7, 2023

@haltman-at #6186

@legobeat legobeat marked this pull request as ready for review September 7, 2023 04:58
Copy link
Contributor

@haltman-at haltman-at left a comment

Choose a reason for hiding this comment

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

Seems fine now that it's passing?

Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@gnidan gnidan merged commit 25f02d2 into trufflesuite:develop Sep 7, 2023
10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants