outdated CJS-only dependencies
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 316
- Forks
- 98
- Avg merge
- 12h 32m
- Merged PRs (30d)
- 2
Description
This issue tracks some of the dependencies that are at least 1 major behind but cannot update b/c they don't have CJS builds (which breaks supported CJS CLIs):
The following deps come (mostly?) fromsindresorhus and have switched to ESM-only builds in a major:
is-wslusing v2, latest is v3widest-lineusing v3, latest is v5string-widthusing v4, latest is v7supports-colorusing v8, latest is 10
As long as we keep supporting CJS we should either replace usage of these deps or wait until node stabilizes requireing ESM from CJS (currently in RC state):
https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require
One of the requirements for this to work is that the ESM modules should not have TLA, is-wsl doesn't:
https://github.com/sindresorhus/is-wsl/blob/main/index.js
If all of the listed deps don't have TLA in their exports, the feature is GA and supported in our minimum required node version in oclif then we should give it a try and bump everything.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by checking the versions of is-wsl, widest-line, string-width, and supports-color, then compare the minimum Node.js version supported by oclif with Node's CJS-to-ESM require support. Review the linked Node.js documentation and related issue. Done means confirming that all listed ESM exports lack top-level await, the feature is supported by the minimum Node version, and the dependencies can be bumped without breaking supported CJS CLIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100