From 468a163316ccab9f5eca37660a661c0bc10a46e7 Mon Sep 17 00:00:00 2001 From: Jonas Helming Date: Tue, 8 Oct 2024 17:08:33 +0200 Subject: [PATCH] Update rimraf to 5 fixed #14272 Signed-off-by: Jonas Helming --- examples/playwright/package.json | 2 +- package.json | 2 +- packages/filesystem/package.json | 3 +- .../src/node/download/file-download-cache.ts | 12 ++-- .../git/src/browser/git-scm-provider.spec.ts | 9 +-- yarn.lock | 70 ++++++++++++++++--- 6 files changed, 71 insertions(+), 27 deletions(-) diff --git a/examples/playwright/package.json b/examples/playwright/package.json index 3d42b8481bf3a..3d2e3ba098051 100644 --- a/examples/playwright/package.json +++ b/examples/playwright/package.json @@ -39,7 +39,7 @@ "allure-commandline": "^2.23.1", "allure-playwright": "^2.5.0", "cross-env": "^7.0.3", - "rimraf": "^2.6.1", + "rimraf": "^5.0.0", "typescript": "~5.4.5" }, "publishConfig": { diff --git a/package.json b/package.json index 157c3aca44982..af6e4fadc194b 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "puppeteer": "19.7.2", "puppeteer-core": "19.7.2", "puppeteer-to-istanbul": "1.4.0", - "rimraf": "^2.6.1", + "rimraf": "^5.0.0", "sinon": "^12.0.0", "temp": "^0.9.1", "tslint": "^5.12.0", diff --git a/packages/filesystem/package.json b/packages/filesystem/package.json index bcdd37c09bc2f..e870dcc25eff1 100644 --- a/packages/filesystem/package.json +++ b/packages/filesystem/package.json @@ -6,7 +6,6 @@ "@theia/core": "1.54.0", "@types/body-parser": "^1.17.0", "@types/multer": "^1.4.7", - "@types/rimraf": "^2.0.2", "@types/tar-fs": "^1.16.1", "async-mutex": "^0.3.1", "body-parser": "^1.18.3", @@ -14,7 +13,7 @@ "http-status-codes": "^1.3.0", "minimatch": "^5.1.0", "multer": "1.4.4-lts.1", - "rimraf": "^2.6.2", + "rimraf": "^5.0.0", "stat-mode": "^1.0.0", "tar-fs": "^1.16.2", "trash": "^7.2.0", diff --git a/packages/filesystem/src/node/download/file-download-cache.ts b/packages/filesystem/src/node/download/file-download-cache.ts index d1bb3285958b8..2a838b08e4280 100644 --- a/packages/filesystem/src/node/download/file-download-cache.ts +++ b/packages/filesystem/src/node/download/file-download-cache.ts @@ -15,7 +15,7 @@ // ***************************************************************************** import { injectable, inject } from '@theia/core/shared/inversify'; import { ILogger } from '@theia/core/lib/common/logger'; -import * as rimraf from 'rimraf'; +import { rimraf } from 'rimraf'; export interface DownloadStorageItem { file: string; @@ -70,11 +70,11 @@ export class FileDownloadCache { } protected deleteRecursively(pathToDelete: string): void { - rimraf(pathToDelete, error => { - if (error) { - this.logger.warn(`An error occurred while deleting the temporary data from the disk. Cannot clean up: ${pathToDelete}.`, error); - } - }); + try { + rimraf(pathToDelete); + } catch (error) { + this.logger.warn(`An error occurred while deleting the temporary data from the disk. Cannot clean up: ${pathToDelete}.`, error); + } } protected expireDownloads(): void { diff --git a/packages/git/src/browser/git-scm-provider.spec.ts b/packages/git/src/browser/git-scm-provider.spec.ts index a3255b6b63ffb..e3a948c88e1d7 100644 --- a/packages/git/src/browser/git-scm-provider.spec.ts +++ b/packages/git/src/browser/git-scm-provider.spec.ts @@ -31,7 +31,7 @@ import { expect } from 'chai'; import * as fs from 'fs-extra'; import * as os from 'os'; import * as path from 'path'; -import * as rimraf from 'rimraf'; +import { rimraf } from 'rimraf'; import * as sinon from 'sinon'; import { Git, GitFileStatus, Repository } from '../common'; import { DugiteGit } from '../node/dugite-git'; @@ -109,12 +109,7 @@ describe('GitScmProvider', () => { }); afterEach(async () => { - await new Promise((resolve, reject) => rimraf(FileUri.fsPath(repository.localUri), error => { - if (error) { - reject(error); - } - resolve(); - })); + rimraf(FileUri.fsPath(repository.localUri)); }); it('should unstage all the changes', async () => { diff --git a/yarn.lock b/yarn.lock index 29d43d8b58818..0ebf1283b521e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1956,7 +1956,7 @@ dependencies: "@types/node" "*" -"@types/glob@*", "@types/glob@^8.1.0": +"@types/glob@^8.1.0": version "8.1.0" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.1.0.tgz#b63e70155391b0584dce44e7ea25190bbc38f2fc" integrity sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w== @@ -2215,14 +2215,6 @@ dependencies: "@types/node" "*" -"@types/rimraf@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.5.tgz#368fb04d59630b727fc05a74d2ca557f64a8ef98" - integrity sha512-YyP+VfeaqAyFmXoTh3HChxOQMyjByRMsHU7kc5KOJkSlXudhMhQIALbYV7rHh/l8d2lX3VUQzprrcAgWdRuU8g== - dependencies: - "@types/glob" "*" - "@types/node" "*" - "@types/route-parser@^0.1.1": version "0.1.7" resolved "https://registry.yarnpkg.com/@types/route-parser/-/route-parser-0.1.7.tgz#76d324537c9f0aaf65c96588c6ab5f3b84ae1505" @@ -6257,6 +6249,18 @@ glob@^10.2.2: minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-scurry "^1.10.1" +glob@^10.3.7: + version "10.4.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" + integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + glob@^7.0.6, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@^7.2.0, glob@^7.2.3: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -7237,6 +7241,15 @@ jackspeak@^2.3.5: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" +jackspeak@^3.1.2: + version "3.4.3" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" + integrity sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jake@^10.8.5: version "10.8.7" resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.7.tgz#63a32821177940c33f356e0ba44ff9d34e1c7d8f" @@ -7882,6 +7895,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -8210,6 +8228,13 @@ minimatch@^8.0.2: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -8304,6 +8329,11 @@ minipass@^5.0.0: resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== +minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" @@ -9329,6 +9359,11 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" +package-json-from-dist@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" + integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw== + pacote@^15.2.0: version "15.2.0" resolved "https://registry.yarnpkg.com/pacote/-/pacote-15.2.0.tgz#0f0dfcc3e60c7b39121b2ac612bf8596e95344d3" @@ -9500,6 +9535,14 @@ path-scurry@^1.10.1, path-scurry@^1.6.1: lru-cache "^9.1.1 || ^10.0.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -10375,7 +10418,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@2, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@2, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -10396,6 +10439,13 @@ rimraf@^4.4.1: dependencies: glob "^9.2.0" +rimraf@^5.0.0: + version "5.0.10" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.10.tgz#23b9843d3dc92db71f96e1a2ce92e39fd2a8221c" + integrity sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ== + dependencies: + glob "^10.3.7" + rimraf@~2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"