Skip to content

fix: upgrade most packages that use rimraf and glob #14153

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

Merged
merged 29 commits into from
May 1, 2025
Merged

Conversation

ShadowCat567
Copy link
Contributor

@ShadowCat567 ShadowCat567 commented Apr 1, 2025

Description of changes

Currently when you install @amplify/cli, this message appears:

npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported

This PR is an attempt to upgrade as many packages as possible that use the deprecated version of these dependencies as well as upgrade the versions of rimraf and glob that are used in our repository (inflight is a dependency of versions of glob before v9, upgrading to v9 or higher resolves the inflight problem).
Many packages were out of date and using deprecated versions of rimraf and glob that had memory leaks. This PR fixes the vast majority of the outdated packages.
Some notes about glob and rimraf:

  • glob and rimraf not longer have default exports, since we were using rimraf.sync and glob.sync, I switched us to their named export equivalents
  • apparently -f/-r/-rf has never done anything, it seems people would add them because rm takes these arguments

Moved some of the packages that cannot be updated to devDependencies.
Most remaining outdated packages that have not been moved to devDependencies come from data repositories, these will be addressed in a separate PR.

Issue #, if available #13889

Description of how you validated changes

Ensured that the project still builds and the tests still work.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ShadowCat567 ShadowCat567 changed the title fix: testing something fix: fix: upgrade most packages that use rimraf and glob Apr 1, 2025
@ShadowCat567 ShadowCat567 changed the title fix: fix: upgrade most packages that use rimraf and glob fix: upgrade most packages that use rimraf and glob Apr 1, 2025
@Amplifiyer
Copy link
Contributor

Do we need this PR?

@ShadowCat567
Copy link
Contributor Author

Do we need this PR?

This is an attempt to upgrade packages that use old versions of glob and rimraf, since when you install amplify-cli this message appears:

npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported

The memory leak issue is the most concerning of the 3 warnings, and it comes from versions of glob prior to v9 having a dependency on inflight (older versions of rimraf have a dependency on glob, so they also have this memory leak issue).
This PR aims to get as many packages as possible to use recent version of rimraf and glob, however it is not possible to get all of our packages in Gen1 CLI to stop using old version of rimraf and glob since we have some deprecated packages (like istanbul) that use them and won't receive updates.
If you think that because we can't entirely upgrade out of using old version of rimraf and glob, this PR is irrelevant, I can close it.

@ShadowCat567
Copy link
Contributor Author

Do we need this PR?

Additionally if this PR is deemed unnecessary, is it worth the effort to do similar updates in the Gen2 CLI and Data repositories?

@Amplifiyer
Copy link
Contributor

We should do this unless there are blockers. Also looking at istanbul it seems we are not even using it anymore? I don't see the coverage:collect being used anywhere. If we can remove it even better.

@ShadowCat567 ShadowCat567 marked this pull request as ready for review April 9, 2025 23:01
@ShadowCat567 ShadowCat567 requested review from a team as code owners April 9, 2025 23:01
Copy link
Contributor

@Amplifiyer Amplifiyer left a comment

Choose a reason for hiding this comment

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

Looks good overall.

@ShadowCat567 ShadowCat567 requested a review from Amplifiyer May 1, 2025 16:17
@ShadowCat567 ShadowCat567 merged commit c85ed14 into dev May 1, 2025
6 checks passed
@ShadowCat567 ShadowCat567 deleted the testing-installs branch May 1, 2025 16:42
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