facebook / jscodeshift

A JavaScript codemod toolkit.
https://jscodeshift.com
MIT License
9.31k stars 480 forks source link

Replace `temp` package with vendored code to avoid deprecated `rimraf` transitive dependency #618

Closed kitten closed 1 day ago

kitten commented 2 months ago

This is simply to avoid the dependency chain on rimraf via temp@0.8.4 -> rimraf@2.6.3, which has been deprecated. The temp package hasn't seen a release in a while, and minimal functionality is used from it. The temp.track functionality also doesn't seem to be used, which would make it pretty trivial to vendor the code.

Switching to alternatives like tempy likely isn't attractive either since it's ESM-only while jscodeshift is not. Older versions of tempy also depend transitively on deprecated versions of rimraf.

Tests pass and cover changes as-is.

Note: The vendored code has an added copyright notice line for node-temp.

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jscodeshift ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2024 7:05pm
kitten commented 2 months ago

@Daniel15: Sorry about that! ❤️ There's a test in the latest commit now that checks that the remote transformer files actually work.

trivikr commented 1 day ago

The temp was replaced by tmp in https://github.com/facebook/jscodeshift/pull/633