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

chore(deps): bump chalk from ^1.1.3 to ^4.0.0 #310

Merged

Conversation

aloisklink
Copy link
Contributor

Description

Bumps chalk from ^1.1.3 to ^4.0.0.

Chalk's major changes were:

  • Minimum required Node version is Node v10 (v4)
  • chalk.constructor has been replaced with chalk.Instance (v3)
  • chalk.enabled has been replaced with chalk.level (v3)

Motivation and Context

Jest v28 uses Chalk v4 as a dependency, so using the same version in jest-image-snapshot will mean users only need to download one version of chalk.

How Has This Been Tested?

jest tests pass.

I've tried testing this branch on my own project (remark-mermaid-dataurl) using the following, and it works fine.

    "jest-image-snapshot": "git+https://github.com/aloisklink/jest-image-snapshot.git#chore/update-chalk-to-v4",

Additionally, my package-lock.json file lost 107 lines, so a bunch of packages were no longer needed.

alois@computer:~/Documents/remark-mermaid-dataurl (master)$ git diff --stat package-lock.json
 package-lock.json | 115 ++++++++-----------------------------------------------------------------------------------------------------------
 1 file changed, 8 insertions(+), 107 deletions(-)

Types of Changes

  • Dependency update

Checklist:

  • [ ] My change requires a change to the documentation and I have updated the documentation accordingly. No change required.
  • My changes are in sync with the code style of this project.
  • There aren't any other open Pull Requests for the same issue/update.
  • These changes should be applied to a maintenance branch.
    • Not 100% sure, but I don't think this applies.
  • I have added the Apache 2.0 license header to any new files created.
    • No files changed.

What is the Impact to Developers Using Jest-Image-Snapshot?

No major changes, except that their package-lock.json file should be slightly simpler, and their node_modules folder slightly smaller (assuming that they have no other packages that rely on chalk v1).

Bumps [chalk][1] from `^1.1.3` to `^4.0.0`.
- [Release notes](https://github.com/chalk/chalk/releases)
  - [v2.0.0](https://github.com/chalk/chalk/releases/tag/v2.0.0)
  - [v3.0.0](https://github.com/chalk/chalk/releases/tag/v3.0.0)
  - [v4.0.0](https://github.com/chalk/chalk/releases/tag/v4.0.0)
- [Commits](chalk/chalk@v1.1.3...v4.0.0)

Chalk's major changes were:
  - Minimum required Node version is Node v10 (v4)
  - `chalk.constructor` has been replaced with `chalk.Instance` (v3)
  - `chalk.enabled` has been replaced with `chalk.level` (v3)

Jest v28 uses Chalk v4 as a dependency, so using the same version
in jest-image-snapshot will mean users only need to download one
version of chalk.

[1]: https://www.npmjs.com/package/chalk
Comment on lines +2629 to +2633
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
"dev": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

chalk v1.1.3 is now only required as a "dev" dependency, and should completely disappear from your package-lock.json file once you update eslint-config-amex to a newer version.

Comment on lines -39 to -43
const ChalkMock = () => ({
bold: {
red: input => input,
},
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't seem to do anything, so I've removed it.
I'm guessing that maybe this code was used in earlier tests but is no longer needed.

@10xLaCroixDrinker 10xLaCroixDrinker requested review from a team September 1, 2022 22:11
@10xLaCroixDrinker 10xLaCroixDrinker merged commit 916e76f into americanexpress:main Sep 14, 2022
@aloisklink aloisklink deleted the chore/update-chalk-to-v4 branch September 14, 2022 16:14
@oneamexbot
Copy link
Contributor

🎉 This PR is included in version 6.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

goverdhan07 pushed a commit to goverdhan07/jest-image-snapshot that referenced this pull request Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants