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: v4.1.2
Choose a base ref
...
head repository: isaacs/rimraf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.1.3
Choose a head ref
  • 6 commits
  • 16 files changed
  • 1 contributor

Commits on Jan 24, 2023

  1. changelog typo

    isaacs committed Jan 24, 2023
    Copy the full SHA
    30f81ca View commit details

Commits on Jan 30, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ecdc477 View commit details
  2. deploy typedocs to gh pages

    isaacs committed Jan 30, 2023
    Copy the full SHA
    6bfd096 View commit details

Commits on Mar 1, 2023

  1. formatting tests

    isaacs committed Mar 1, 2023
    Copy the full SHA
    49a2958 View commit details
  2. Copy the full SHA
    8d77621 View commit details
  3. 4.1.3

    isaacs committed Mar 1, 2023
    Copy the full SHA
    450e3d2 View commit details
49 changes: 49 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Generate typedocs
run: npm run typedoc
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
50 changes: 50 additions & 0 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Generate typedocs
run: npm run typedoc

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,6 @@
/.nyc_output
/coverage
/dist
!/typedoc.json
!/tsconfig-*.json
!/.prettierignore
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# v4.1

- Improved hybrid module with no need to look at the `.default`
dangly bit. `.default` preserved as a reference to `rimraf`
dangly bit. `.default` preserved as a reference to `rimraf`
for compatibility with anyone who came to rely on it in v4.0.
- Accept and ignore `-rf` and `-fr` arguments to the bin.

@@ -15,8 +15,8 @@
- Drop support for Node.js below version 14
- rewrite in TypeScript
- ship CJS/ESM hybrid module
- Error on ignore unknown arguments to the bin. (Previously they
were silently ignored.)
- Error on unknown arguments to the bin. (Previously they were
silently ignored.)

# v3.0

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rimraf",
"version": "4.1.2",
"version": "4.1.3",
"main": "./dist/cjs/src/index-cjs.js",
"module": "./dist/mjs/index.js",
"bin": "./dist/cjs/src/bin.js",
36 changes: 21 additions & 15 deletions test/default-tmp.js
Original file line number Diff line number Diff line change
@@ -2,9 +2,12 @@ const t = require('tap')

t.test('posix platform', async t => {
const { tmpdir } = require('os')
const { defaultTmp, defaultTmpSync } = t.mock('../dist/cjs/src/default-tmp.js', {
'../dist/cjs/src/platform.js': 'posix',
})
const { defaultTmp, defaultTmpSync } = t.mock(
'../dist/cjs/src/default-tmp.js',
{
'../dist/cjs/src/platform.js': 'posix',
}
)
t.equal(defaultTmpSync('anything'), tmpdir())
t.equal(await defaultTmp('anything').then(t => t), tmpdir())
})
@@ -20,19 +23,22 @@ t.test('windows', async t => {
throw Object.assign(new Error('no ents here'), { code: 'ENOENT' })
}
}
const { defaultTmp, defaultTmpSync } = t.mock('../dist/cjs/src/default-tmp.js', {
os: {
tmpdir: () => 'C:\\Windows\\Temp',
},
path: require('path').win32,
'../dist/cjs/src/platform.js': 'win32',
'../dist/cjs/src/fs.js': {
statSync: tempDirCheck,
promises: {
stat: async path => tempDirCheck(path),
const { defaultTmp, defaultTmpSync } = t.mock(
'../dist/cjs/src/default-tmp.js',
{
os: {
tmpdir: () => 'C:\\Windows\\Temp',
},
path: require('path').win32,
'../dist/cjs/src/platform.js': 'win32',
'../dist/cjs/src/fs.js': {
statSync: tempDirCheck,
promises: {
stat: async path => tempDirCheck(path),
},
},
},
})
}
)

const expect = {
'c:\\some\\path': 'C:\\Windows\\Temp',
6 changes: 1 addition & 5 deletions test/delete-many-files.js
Original file line number Diff line number Diff line change
@@ -13,11 +13,7 @@ const START = (process.env.RIMRAF_TEST_START_CHAR || 'a').charCodeAt(0)
const END = (process.env.RIMRAF_TEST_END_CHAR || 'f').charCodeAt(0)
const DEPTH = +process.env.RIMRAF_TEST_DEPTH || 4

const {
statSync,
mkdirSync,
readdirSync,
} = require('../dist/cjs/src/fs.js')
const { statSync, mkdirSync, readdirSync } = require('../dist/cjs/src/fs.js')
const { writeFileSync } = require('fs')
const { resolve, dirname } = require('path')

5 changes: 4 additions & 1 deletion test/ignore-enoent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const t = require('tap')
const { ignoreENOENT, ignoreENOENTSync } = require('../dist/cjs/src/ignore-enoent.js')
const {
ignoreENOENT,
ignoreENOENTSync,
} = require('../dist/cjs/src/ignore-enoent.js')

const enoent = Object.assign(new Error('no ent'), { code: 'ENOENT' })
const eperm = Object.assign(new Error('eperm'), { code: 'EPERM' })
15 changes: 12 additions & 3 deletions test/rimraf-manual.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
const t = require('tap')

const { rimrafWindows, rimrafWindowsSync } = require('../dist/cjs/src/rimraf-windows.js')
const {
rimrafWindows,
rimrafWindowsSync,
} = require('../dist/cjs/src/rimraf-windows.js')

const { rimrafPosix, rimrafPosixSync } = require('../dist/cjs/src/rimraf-posix.js')
const {
rimrafPosix,
rimrafPosixSync,
} = require('../dist/cjs/src/rimraf-posix.js')

const { rimrafManual, rimrafManualSync } = require('../dist/cjs/src/rimraf-manual.js')
const {
rimrafManual,
rimrafManualSync,
} = require('../dist/cjs/src/rimraf-manual.js')

if (!process.env.__TESTING_RIMRAF_PLATFORM__) {
const otherPlatform = process.platform !== 'win32' ? 'win32' : 'posix'
9 changes: 6 additions & 3 deletions test/rimraf-move-remove.js
Original file line number Diff line number Diff line change
@@ -57,9 +57,12 @@ t.only('actually delete some stuff', async t => {
// but actually do wait to clean them up, though
t.teardown(() => Promise.all(danglers))

const { rimrafPosix, rimrafPosixSync } = t.mock('../dist/cjs/src/rimraf-posix.js', {
'../dist/cjs/src/fs.js': fsMock,
})
const { rimrafPosix, rimrafPosixSync } = t.mock(
'../dist/cjs/src/rimraf-posix.js',
{
'../dist/cjs/src/fs.js': fsMock,
}
)

const { rimrafMoveRemove, rimrafMoveRemoveSync } = t.mock(
'../dist/cjs/src/rimraf-move-remove.js',
9 changes: 6 additions & 3 deletions test/rimraf-native.js
Original file line number Diff line number Diff line change
@@ -12,9 +12,12 @@ const fs = {
},
}

const { rimrafNative, rimrafNativeSync } = t.mock('../dist/cjs/src/rimraf-native.js', {
'../dist/cjs/src/fs.js': fs,
})
const { rimrafNative, rimrafNativeSync } = t.mock(
'../dist/cjs/src/rimraf-native.js',
{
'../dist/cjs/src/fs.js': fs,
}
)

t.test('calls the right node function', async t => {
await rimrafNative('path', { x: 'y' })
Loading