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: update dependencies and require node 18 #161

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

pmmmwh
Copy link
Contributor

@pmmmwh pmmmwh commented Jun 10, 2024

This PR updates all the dependencies consumed by del - particularly moving from rimraf@3 to rimraf@5 which upgrades to glob@9 (unused code path).

The main intention is to resolve as much deprecation warnings from npm as possible; but I also bumped minimum supported Node.js version to 18 since that's the oldest version in maintenance, since I presume the upgrade of dependencies would at least warrant a minor and might as well bundle "breaking" changes altogether.

Fixes #162

Comment on lines -17 to -28
unlink: gracefulFs.unlink,
unlinkSync: gracefulFs.unlinkSync,
chmod: gracefulFs.chmod,
chmodSync: gracefulFs.chmodSync,
stat: gracefulFs.stat,
statSync: gracefulFs.statSync,
lstat: gracefulFs.lstat,
lstatSync: gracefulFs.lstatSync,
rmdir: gracefulFs.rmdir,
rmdirSync: gracefulFs.rmdirSync,
readdir: gracefulFs.readdir,
readdirSync: gracefulFs.readdirSync,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the support for a custom fs layer in rimraf have long been removed - hence cleaning this up and removing the dependency on graceful-fs in the process.

package.json Show resolved Hide resolved
@pmmmwh pmmmwh force-pushed the chore/update-deps branch from 6cbaa48 to 1670c1f Compare June 10, 2024 12:03
@pmmmwh pmmmwh force-pushed the chore/update-deps branch from 1670c1f to 6b52365 Compare June 10, 2024 12:10
@kibertoad
Copy link

@sindresorhus If compatibility with older Node versions is important for you at this point, I can prepare an alternative PR that only updates the rimraf, which is the most impactful part here.

@pmmmwh
Copy link
Contributor Author

pmmmwh commented Jun 24, 2024

@sindresorhus If compatibility with older Node versions is important for you at this point, I can prepare an alternative PR that only updates the rimraf, which is the most impactful part here.

While looking at other deps used by del and other packages Sindre maintains my hunch is that this wouldn't be the case, but I can also update this PR to not do that (it's done such that we can bump other dependencies too).

Also - tests are failing on Windows, I'm not entirely sure why and don't have a Windows machine lying around to test - will try to dig into it but help would be appreciated ...

benchmark.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

Sorry, missed this one. I'm happy to merge it when tests are passing.

@kibertoad
Copy link

@pmmmwh I primarily use Windows, let me know if you would like some help with this

@pmmmwh pmmmwh force-pushed the chore/update-deps branch from f6fb083 to 6223872 Compare July 11, 2024 22:43
@pmmmwh
Copy link
Contributor Author

pmmmwh commented Jul 13, 2024

I did some testing on a Windows VM - it seems like this is caused by a bug in rimraf which causes intermittent EPERM issues due to async timing. The test that fails here suffers from this due to the amount of tries.

From my testing, the issue seemed to be related to how rimraf doesn't use fs/promises but rather promisify fs themselves - will try to raise a PR there to see if it will get resolved.

@pmmmwh
Copy link
Contributor Author

pmmmwh commented Jul 14, 2024

Created isaacs/rimraf#314 - unfortunately this is targeting v6 which only supports Node.js v20+ - we'll have to see if back porting the fix is acceptable for what we're doing here.

@sindresorhus don't really know what's the way forward here - I could change the test slightly to ignore EPERM on Windows (I think it's originally here for macOS issues), but not sure if that's preferable ...

index.js Outdated
import pMap from 'p-map';

const rimrafP = promisify(rimraf);
import {rimraf} from 'rimraf';
Copy link

@fregante fregante Sep 20, 2024

Choose a reason for hiding this comment

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

I don’t think this is needed anymore, right? This has been available since node 14.14

fs.rmSync(dir, { recursive: true, force: true });

@mark-wiemer
Copy link

Blocked on isaacs/rimraf#303

@mark-wiemer
Copy link

Fixes #162

index.js Outdated Show resolved Hide resolved
sindresorhus and others added 3 commits October 7, 2024 11:41
Co-authored-by: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com>
@sindresorhus sindresorhus merged commit dc976d6 into sindresorhus:main Oct 7, 2024
9 checks passed
sindresorhus added a commit that referenced this pull request Oct 7, 2024
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
@pmmmwh
Copy link
Contributor Author

pmmmwh commented Oct 7, 2024

Since we've moved to native fs.rm - I think we can safely drop the rimraf dependency too?

@sindresorhus
Copy link
Owner

Already done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecated dependencies (rimraf v3)
5 participants