Skip to content

Repo: Update our types to reflect process.stdout possibly being undefined #7896

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

Open
JoshuaKGoldberg opened this issue Nov 11, 2023 · 3 comments
Labels
accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

Suggestion

#1619 -> #7835 (comment). process.stdout is supposed to be defined per @types/node. Is it still the case that someone else might wipe it out? Is that a bug somewhere else?

@JoshuaKGoldberg JoshuaKGoldberg added triage Waiting for team members to take a look repo maintenance things to do with maintenance of the repo, and not with code/docs labels Nov 11, 2023
@bradzacher
Copy link
Member

It's specifically undefined in the case that code is bundled for a browser.
It's not a standard NodeJS thing.
Most of the global process things will not be defined and will crash in that usecase.
The reason we want to support this is so that prettier (a major consumer of our tooling) can consume our package without a patch or polyfill.

@JoshuaKGoldberg
Copy link
Member Author

Maybe we should change the types for our repo then, to catch this automatically?

@JoshuaKGoldberg JoshuaKGoldberg changed the title Repo: Investigate process.stdout being undefined and maybe file upstream bug(s) Repo: Investigate process.stdout being undefined and maybe change our types to reflect that? Nov 11, 2023
@bradzacher
Copy link
Member

Definitely open to patching the types!

@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs and removed repo maintenance things to do with maintenance of the repo, and not with code/docs triage Waiting for team members to take a look labels Nov 12, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title Repo: Investigate process.stdout being undefined and maybe change our types to reflect that? Repo: Update our types to reflect process.stdout possibly being undefined Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

No branches or pull requests

2 participants