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: remove ansi-escapes #13471

Closed
wants to merge 3 commits into from

Conversation

mrazauskas
Copy link
Contributor

Summary

Just an idea – ansi-escapes package can be replaced with a handful of one-liners. There is nothing wrong with ansi-escapes. Only that it ships old type-fest that is causing typecheck issues with latest TS and needs special resolutions. Also currently Jest ships that old type-fest as a transitive dependency, but it is not used at all.

Test plan

Green CI.

import * as preRunMessage from './preRunMessage';
import * as specialChars from './specialChars';

export {ansiEscapes};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One more idea. Additionally jest-watcher could also expose ansiEscapes so that plugins could use this implementation as well.

@cpojer
Copy link
Member

cpojer commented Oct 19, 2022

Only that it ships old type-fest that is causing typecheck issues with latest TS and needs special resolutions.

This is the primary reason for suggesting this PR, right? The issue only concerns the Jest repository, not anyone who is using Jest, is that correct?

@SimenB
Copy link
Member

SimenB commented Oct 19, 2022

Instead of bloating jest-util further, should we stick it in a @jest/ansi-escapes?

@@ -19916,6 +19914,13 @@ __metadata:
languageName: node
linkType: hard

"type-fest@npm:^0.21.3":
Copy link
Member

Choose a reason for hiding this comment

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

this isn't now shipped right? comes from some dev dep?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. For instance lerna-lite ships same old ansi-escapes through inquirer. They cannot update inquirer, because newer version is ESM only.

Copy link
Member

Choose a reason for hiding this comment

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

ESM only... gotta love it 😅

yarn.lock Show resolved Hide resolved
@mrazauskas
Copy link
Contributor Author

@cpojer The issue with TypeScript 4.8 appeared in #13177, it was solved by adding resolutions. This PR is simply meant to get rid of resolutions. I was mentioning the idea to remove ansi-escapes as a solution in the same #13177. The removal became possible after #13399, because terminal-link was depending on ansi-escapes as well.

@cpojer
Copy link
Member

cpojer commented Oct 19, 2022

Jest is too big and bloated. I don't think the project should keep taking on more responsibilities. If this is purely a Jest-internal maintenance issue on keeping around a single resolution (a package manager feature that exists exactly for the purpose we are using it for) then I would prefer not to adopt more code into this repo since the original package is working as expected.

@SimenB
Copy link
Member

SimenB commented Oct 19, 2022

As long as our dependency on ansi-escapes@4 does not cause downstream issues for people on TS 4.8 (i.e., this PR would solve issues outside of this repo), I agree with Christoph

@mrazauskas mrazauskas closed this Oct 19, 2022
@mrazauskas mrazauskas deleted the chore-remove-ansi-escapes branch October 19, 2022 07:28
@mrazauskas
Copy link
Contributor Author

Thanks for your time (;

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants