Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: isaacs/rimraf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 79b933fb362b2c51bedfa448be848e1d7ed32d7e
Choose a base ref
...
head repository: isaacs/rimraf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3b6b098c16a535295dbaada20d5b237fd4f7469c
Choose a head ref

Commits on Aug 20, 2018

  1. travis node version updates

    isaacs committed Aug 20, 2018
    Copy the full SHA
    692022b View commit details
  2. update tap, add package-lock

    isaacs committed Aug 20, 2018
    Copy the full SHA
    f0bc3a1 View commit details

Commits on Jan 2, 2019

  1. Copy the full SHA
    8f1d3a1 View commit details
  2. bin test

    isaacs committed Jan 2, 2019
    Copy the full SHA
    21fd3df View commit details
  3. autopublish scripts

    isaacs committed Jan 2, 2019
    Copy the full SHA
    42fe369 View commit details
  4. 2.6.3

    isaacs committed Jan 2, 2019
    Copy the full SHA
    9442819 View commit details

Commits on Aug 14, 2019

  1. feat: make it possible to omit glob dependency

    PR-URL: #192
    Credit: @bcoe
    Close: #192
    Reviewed-by: @isaacs
    bcoe authored and isaacs committed Aug 14, 2019
    2
    Copy the full SHA
    dc1682d View commit details
  2. 2.7.0

    isaacs committed Aug 14, 2019
    Copy the full SHA
    250ee15 View commit details
  3. fix: use var instead of let

    PR-URL: #195
    Credit: @Tidyzq
    Close: #195
    Reviewed-by: @isaacs
    Tidyzq authored and isaacs committed Aug 14, 2019
    Copy the full SHA
    012ecbb View commit details
  4. 2.7.1

    isaacs committed Aug 14, 2019
    Copy the full SHA
    bb57274 View commit details
  5. Copy the full SHA
    a01826d View commit details
  6. Use const/let

    BREAKING CHANGE: this drops support for node <6
    isaacs committed Aug 14, 2019
    Copy the full SHA
    592a4b6 View commit details
  7. Use arrow functions

    BREAKING CHANGE: this drops support for node 0.x
    isaacs committed Aug 14, 2019
    Copy the full SHA
    d7e41a2 View commit details
  8. Copy the full SHA
    736887a View commit details
  9. Copy the full SHA
    d6ab4ec View commit details
  10. 3.0.0

    isaacs committed Aug 14, 2019
    Copy the full SHA
    191ae69 View commit details

Commits on Aug 19, 2019

  1. update travis.yml

    isaacs committed Aug 19, 2019
    Copy the full SHA
    3d4af41 View commit details
  2. changelog

    Close #201
    isaacs committed Aug 19, 2019
    Copy the full SHA
    d82bc81 View commit details

Commits on Jan 28, 2020

  1. funding

    isaacs committed Jan 28, 2020
    Copy the full SHA
    692915d View commit details
  2. 3.0.1

    isaacs committed Jan 28, 2020
    Copy the full SHA
    d709272 View commit details

Commits on Feb 9, 2020

  1. fix: do not check errors with instanceof.

    This should avoid the cross-VM type issues we see in Jest.
    
    Fixes #208
    
    PR-URL: #209
    Credit: @aslushnikov
    Close: #209
    Reviewed-by: @isaacs
    aslushnikov authored and isaacs committed Feb 9, 2020
    Copy the full SHA
    aa50e02 View commit details
  2. 3.0.2

    isaacs committed Feb 9, 2020
    Copy the full SHA
    8c10fb8 View commit details

Commits on Feb 17, 2022

  1. ci: makework

    isaacs committed Feb 17, 2022
    Copy the full SHA
    438210f View commit details
  2. chore: add copyright year to license

    License Year Bot committed Feb 17, 2022
    Copy the full SHA
    e499eb1 View commit details

Commits on Feb 27, 2022

  1. update tap

    isaacs committed Feb 27, 2022
    Copy the full SHA
    9219c93 View commit details

Commits on Nov 27, 2022

  1. docs(readme): Fix link to mkdirp

    Points the link to isaacs' fork (original user/repo no longer exists and gives a 404)
    mikesprague authored Nov 27, 2022
    Copy the full SHA
    b517d5d View commit details
  2. Copy the full SHA
    1cd86ea View commit details

Commits on Dec 8, 2022

  1. build: harden isaacs-makework.yml permissions (#244)

    Signed-off-by: Alex <aleksandrosansan@gmail.com>
    sashashura authored Dec 8, 2022
    Copy the full SHA
    8caf0de View commit details

Commits on Jan 10, 2023

  1. Rimraf version 4, first pass

    isaacs committed Jan 10, 2023
    Copy the full SHA
    a71e7f9 View commit details
  2. Copy the full SHA
    715816e View commit details
  3. Promisify fs methods manually

    This works around the occasional slowness observed in fs.promises
    methods, as well as providing a polyfill for node v10, while also
    avoiding the warning about the fs/promises API being experimental on
    that version.
    isaacs committed Jan 10, 2023
    Copy the full SHA
    618317d View commit details
  4. Copy the full SHA
    5b2d1d4 View commit details
  5. Copy the full SHA
    7ac3401 View commit details
  6. Copy the full SHA
    664acc1 View commit details
  7. skip the use-native test before loading tap

    Otherwise we get a coverage line missing
    isaacs committed Jan 10, 2023
    Copy the full SHA
    e62def8 View commit details
  8. Put temp files in a temp folder

    Try to avoid the situation where this approach:
    
        rimraf(path).then(() => rimraf(dirname(path))
    
    fails with EBUSY, due to the semi-presence of marked-for-deletion
    entries.
    isaacs committed Jan 10, 2023
    Copy the full SHA
    be07333 View commit details
  9. Copy the full SHA
    516bd00 View commit details
  10. Copy the full SHA
    2d03377 View commit details
  11. Copy the full SHA
    ad4f2db View commit details
  12. Copy the full SHA
    0c82d74 View commit details
  13. add cli script

    isaacs committed Jan 10, 2023
    Copy the full SHA
    d4eec2e View commit details
  14. Copy the full SHA
    2442655 View commit details
  15. do not ever actually try to rmdir /

    When preserveRoot is set to false, we may remove all the children of
    the root directory, but we'll never actually succeed in rmdir()-ing the
    root dir itself, so don't try.
    isaacs committed Jan 10, 2023
    Copy the full SHA
    4b228c9 View commit details
  16. doc: correct os.tmp default

    isaacs committed Jan 10, 2023
    Copy the full SHA
    6b8aa29 View commit details
  17. benchmarks

    Add a `npm run benchmark` script.
    isaacs committed Jan 10, 2023
    Copy the full SHA
    51d43c1 View commit details
  18. Copy the full SHA
    99496cd View commit details
  19. update tap

    isaacs committed Jan 10, 2023
    Copy the full SHA
    b6f7819 View commit details
  20. Copy the full SHA
    40f64ec View commit details
  21. prettier formatting

    isaacs committed Jan 10, 2023
    Copy the full SHA
    e7501cd View commit details
  22. test for fix-eperm

    isaacs committed Jan 10, 2023
    Copy the full SHA
    d1d5495 View commit details
Showing with 10,428 additions and 554 deletions.
  1. +3 −0 .github/FUNDING.yml
  2. +38 −0 .github/workflows/benchmark.yml
  3. +43 −0 .github/workflows/ci.yml
  4. +13 −0 .github/workflows/commit-if-modified.sh
  5. +15 −0 .github/workflows/copyright-year.sh
  6. +40 −0 .github/workflows/isaacs-makework.yml
  7. +16 −0 .github/workflows/package-json-repo.js
  8. +4 −4 .gitignore
  9. +9 −0 .prettierignore
  10. +0 −8 .travis.yml
  11. +76 −0 CHANGELOG.md
  12. +1 −1 LICENSE
  13. +128 −64 README.md
  14. +2 −0 benchmark/.gitignore
  15. +24 −0 benchmark/create-fixture.js
  16. +18 −0 benchmark/index.js
  17. +65 −0 benchmark/old-rimraf/CHANGELOG.md
  18. +15 −0 benchmark/old-rimraf/LICENSE
  19. +101 −0 benchmark/old-rimraf/README.md
  20. +68 −0 benchmark/old-rimraf/bin.js
  21. +32 −0 benchmark/old-rimraf/package.json
  22. +75 −79 { → benchmark/old-rimraf}/rimraf.js
  23. +65 −0 benchmark/print-results.js
  24. +40 −0 benchmark/rimrafs.js
  25. +100 −0 benchmark/run-test.js
  26. +0 −50 bin.js
  27. +15 −0 fixup.sh
  28. +9 −0 libtap-settings.js
  29. +1 −0 map.js
  30. +5,616 −0 package-lock.json
  31. +62 −14 package.json
  32. +145 −0 src/bin.ts
  33. +69 −0 src/default-tmp.ts
  34. +51 −0 src/fix-eperm.ts
  35. +80 −0 src/fs.ts
  36. +18 −0 src/ignore-enoent.ts
  37. +108 −0 src/index.ts
  38. +5 −0 src/opt-arg.ts
  39. +58 −0 src/path-arg.ts
  40. +1 −0 src/platform.ts
  41. +13 −0 src/readdir-or-error.ts
  42. +69 −0 src/retry-busy.ts
  43. +8 −0 src/rimraf-manual.ts
  44. +167 −0 src/rimraf-move-remove.ts
  45. +17 −0 src/rimraf-native.ts
  46. +68 −0 src/rimraf-posix.ts
  47. +132 −0 src/rimraf-windows.ts
  48. +5 −0 src/use-native.ts
  49. +256 −0 tap-snapshots/test/index.js.test.cjs
  50. +19 −0 tap-snapshots/test/retry-busy.js.test.cjs
  51. +60 −0 tap-snapshots/test/rimraf-move-remove.js.test.cjs
  52. +29 −0 tap-snapshots/test/rimraf-native.js.test.cjs
  53. +60 −0 tap-snapshots/test/rimraf-windows.js.test.cjs
  54. +0 −106 test/basic.js
  55. +188 −0 test/bin.js
  56. +0 −187 test/custom-fs.js
  57. +56 −0 test/default-tmp.js
  58. +83 −0 test/delete-many-files.js
  59. +0 −41 test/fill.js
  60. +145 −0 test/fix-eperm.js
  61. +80 −0 test/fs.ts
  62. +25 −0 test/ignore-enoent.js
  63. +186 −0 test/index.js
  64. +5 −0 test/opt-arg.js
  65. +82 −0 test/path-arg.js
  66. +10 −0 test/platform.js
  67. +37 −0 test/readdir-or-error.js
  68. +110 −0 test/retry-busy.js
  69. +26 −0 test/rimraf-manual.js
  70. +499 −0 test/rimraf-move-remove.js
  71. +23 −0 test/rimraf-native.js
  72. +189 −0 test/rimraf-posix.js
  73. +489 −0 test/rimraf-windows.js
  74. +32 −0 test/use-native.js
  75. +17 −0 tsconfig-base.json
  76. +7 −0 tsconfig-cjs.json
  77. +7 −0 tsconfig-esm.json
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [isaacs]
38 changes: 38 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'benchmarks'

on: workflow_dispatch

jobs:
benchmark:
strategy:
matrix:
node-version: [16.x, 19.x]
platform:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest

runs-on: ${{ matrix.platform.os }}

defaults:
run:
shell: bash

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: benchmark
run: node benchmark/index.js
env:
RIMRAF_TEST_START_CHAR: a
RIMRAF_TEST_END_CHAR: f
RIMRAF_TEST_DEPTH: 5
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 19.x]
platform:
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash
- os: windows-latest
shell: bash
- os: windows-latest
shell: powershell
fail-fast: false

runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run Tests
run: npm test -- -t0 -c
env:
RIMRAF_TEST_START_CHAR: a
RIMRAF_TEST_END_CHAR: f
RIMRAF_TEST_DEPTH: 5
13 changes: 13 additions & 0 deletions .github/workflows/commit-if-modified.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
git config --global user.email "$1"
shift
git config --global user.name "$1"
shift
message="$1"
shift
if [ $(git status --porcelain "$@" | egrep '^ M' | wc -l) -gt 0 ]; then
git add "$@"
git commit -m "$message"
git push || git pull --rebase
git push
fi
15 changes: 15 additions & 0 deletions .github/workflows/copyright-year.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
dir=${1:-$PWD}
dates=($(git log --date=format:%Y --pretty=format:'%ad' --reverse | sort | uniq))
if [ "${#dates[@]}" -eq 1 ]; then
datestr="${dates}"
else
datestr="${dates}-${dates[${#dates[@]}-1]}"
fi

stripDate='s/^((.*)Copyright\b(.*?))((?:,\s*)?(([0-9]{4}\s*-\s*[0-9]{4})|(([0-9]{4},\s*)*[0-9]{4})))(?:,)?\s*(.*)\n$/$1$9\n/g'
addDate='s/^.*Copyright(?:\s*\(c\))? /Copyright \(c\) '$datestr' /g'
for l in $dir/LICENSE*; do
perl -pi -e "$stripDate" $l
perl -pi -e "$addDate" $l
done
40 changes: 40 additions & 0 deletions .github/workflows/isaacs-makework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "various tidying up tasks to silence nagging"

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write # for commit-if-modified.sh to push

jobs:
makework:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2.1.4
with:
node-version: 16.x
- name: put repo in package.json
run: node .github/workflows/package-json-repo.js
- name: check in package.json if modified
run: |
bash -x .github/workflows/commit-if-modified.sh \
"package-json-repo-bot@example.com" \
"package.json Repo Bot" \
"chore: add repo to package.json" \
package.json package-lock.json
- name: put all dates in license copyright line
run: bash .github/workflows/copyright-year.sh
- name: check in licenses if modified
run: |
bash .github/workflows/commit-if-modified.sh \
"license-year-bot@example.com" \
"License Year Bot" \
"chore: add copyright year to license" \
LICENSE*
16 changes: 16 additions & 0 deletions .github/workflows/package-json-repo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node

const pf = require.resolve(`${process.cwd()}/package.json`)
const pj = require(pf)

if (!pj.repository && process.env.GITHUB_REPOSITORY) {
const fs = require('fs')
const server = process.env.GITHUB_SERVER_URL || 'https://github.com'
const repo = `${server}/${process.env.GITHUB_REPOSITORY}`
pj.repository = repo
const json = fs.readFileSync(pf, 'utf8')
const match = json.match(/^\s*\{[\r\n]+([ \t]*)"/)
const indent = match[1]
const output = JSON.stringify(pj, null, indent || 2) + '\n'
fs.writeFileSync(pf, output)
}
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
npm-debug.log
.nyc_output
coverage
/node_modules/
/.nyc_output
/coverage
/dist
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/node_modules
/example
/.github
/dist
.env
/tap-snapshots
/.nyc_output
/coverage
/benchmark
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# v4.0

- Remove `glob` dependency entirely. This library now only
accepts actual file and folder names to delete.
- Accept array of paths or single path.
- Windows performance and reliability improved.
- All strategies separated into explicitly exported methods.
- Drop support for Node.js below version 14
- rewrite in TypeScript
- ship CJS/ESM hybrid module

# v3.0

- Add `--preserve-root` option to executable (default true)
- Drop support for Node.js below version 6

# v2.7

- Make `glob` an optional dependency

# 2.6

- Retry on EBUSY on non-windows platforms as well
- Make `rimraf.sync` 10000% more reliable on Windows

# 2.5

- Handle Windows EPERM when lstat-ing read-only dirs
- Add glob option to pass options to glob

# 2.4

- Add EPERM to delay/retry loop
- Add `disableGlob` option

# 2.3

- Make maxBusyTries and emfileWait configurable
- Handle weird SunOS unlink-dir issue
- Glob the CLI arg for better Windows support

# 2.2

- Handle ENOENT properly on Windows
- Allow overriding fs methods
- Treat EPERM as indicative of non-empty dir
- Remove optional graceful-fs dep
- Consistently return null error instead of undefined on success
- win32: Treat ENOTEMPTY the same as EBUSY
- Add `rimraf` binary

# 2.1

- Fix SunOS error code for a non-empty directory
- Try rmdir before readdir
- Treat EISDIR like EPERM
- Remove chmod
- Remove lstat polyfill, node 0.7 is not supported

# 2.0

- Fix myGid call to check process.getgid
- Simplify the EBUSY backoff logic.
- Use fs.lstat in node >= 0.7.9
- Remove gently option
- remove fiber implementation
- Delete files that are marked read-only

# 1.0

- Allow ENOENT in sync method
- Throw when no callback is provided
- Make opts.gently an absolute path
- use 'stat' if 'lstat' is not available
- Consistent error naming, and rethrow non-ENOENT stat errors
- add fiber implementation
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Loading