From b630c4e84117f6846a9cde484a3df856766598d4 Mon Sep 17 00:00:00 2001 From: Joe Lencioni Date: Wed, 9 Oct 2024 14:03:24 -0500 Subject: [PATCH] Update rimraf 2 to 5 v6 is out, but it drops support for node older than v20, which seems a little unnecessarily aggressive to me for this package, so I decided to go to v5 instead. --- index.js | 12 ++++---- package.json | 2 +- yarn.lock | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index dea5280..08bfdbb 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const { spawn, execSync } = require('child_process'); const fs = require('fs'); const path = require('path'); -const rimraf = require('rimraf'); +const { rimrafSync } = require('rimraf'); const getStorybook7BuildCommandParts = require('./getStorybook7BuildCommandParts'); const getStorybookVersionFromPackageJson = require('./getStorybookVersionFromPackageJson'); @@ -76,7 +76,7 @@ function resolveBuildCommandParts() { function buildStorybook({ configDir, staticDir, outputDir }) { return new Promise((resolve, reject) => { - rimraf.sync(outputDir); + rimrafSync(outputDir); const buildCommandParts = resolveBuildCommandParts(); const params = [ ...buildCommandParts, @@ -146,8 +146,8 @@ module.exports = function happoStorybookPlugin({ typeof skip === 'function' ? await skip() : Array.isArray(skip) - ? skip - : []; + ? skip + : []; validateSkipped(skipped); const iframeContent = fs.readFileSync(iframePath, 'utf-8'); fs.writeFileSync( @@ -157,7 +157,9 @@ module.exports = function happoStorybookPlugin({ ` - + `, ), ); diff --git a/package.json b/package.json index 8649c31..4bc57ef 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "webpack": "^4.0.0" }, "dependencies": { - "rimraf": "^2.6.3" + "rimraf": "^5.0.0" }, "packageManager": "yarn@4.1.1" } diff --git a/yarn.lock b/yarn.lock index 63f9003..e0be6a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9612,6 +9612,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^10.3.7": + version: 10.4.5 + resolution: "glob@npm:10.4.5" + dependencies: + foreground-child: "npm:^3.1.0" + jackspeak: "npm:^3.1.2" + minimatch: "npm:^9.0.4" + minipass: "npm:^7.1.2" + package-json-from-dist: "npm:^1.0.0" + path-scurry: "npm:^1.11.1" + bin: + glob: dist/esm/bin.mjs + checksum: 10c0/19a9759ea77b8e3ca0a43c2f07ecddc2ad46216b786bb8f993c445aee80d345925a21e5280c7b7c6c59e860a0154b84e4b2b60321fea92cd3c56b4a7489f160e + languageName: node + linkType: hard + "glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.2.0": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -9753,7 +9769,7 @@ __metadata: react-dom: "npm:^18.2.0" react-error-boundary: "npm:^4.0.13" react-tether: "npm:^2.0.0" - rimraf: "npm:^2.6.3" + rimraf: "npm:^5.0.0" storybook: "npm:^8.0.0" styled-components: "npm:^4.1.3" webpack: "npm:^4.0.0" @@ -10857,6 +10873,19 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^3.1.2": + version: 3.4.3 + resolution: "jackspeak@npm:3.4.3" + dependencies: + "@isaacs/cliui": "npm:^8.0.2" + "@pkgjs/parseargs": "npm:^0.11.0" + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 10c0/6acc10d139eaefdbe04d2f679e6191b3abf073f111edf10b1de5302c97ec93fffeb2fdd8681ed17f16268aa9dd4f8c588ed9d1d3bffbbfa6e8bf897cbb3149b9 + languageName: node + linkType: hard + "jake@npm:^10.8.5": version: 10.8.5 resolution: "jake@npm:10.8.5" @@ -11787,6 +11816,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^10.2.0": + version: 10.4.3 + resolution: "lru-cache@npm:10.4.3" + checksum: 10c0/ebd04fbca961e6c1d6c0af3799adcc966a1babe798f685bb84e6599266599cd95d94630b10262f5424539bc4640107e8a33aa28585374abf561d30d16f4b39fb + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -12134,6 +12170,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.4": + version: 9.0.5 + resolution: "minimatch@npm:9.0.5" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 10c0/de96cf5e35bdf0eab3e2c853522f98ffbe9a36c37797778d2665231ec1f20a9447a7e567cb640901f89e4daaa95ae5d70c65a9e8aa2bb0019b6facbc3c0575ed + languageName: node + linkType: hard + "minimist@npm:^1.2.0, minimist@npm:^1.2.5, minimist@npm:^1.2.6": version: 1.2.7 resolution: "minimist@npm:1.2.7" @@ -12222,6 +12267,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^7.1.2": + version: 7.1.2 + resolution: "minipass@npm:7.1.2" + checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 + languageName: node + linkType: hard + "minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -12872,6 +12924,13 @@ __metadata: languageName: node linkType: hard +"package-json-from-dist@npm:^1.0.0": + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 10c0/62ba2785eb655fec084a257af34dbe24292ab74516d6aecef97ef72d4897310bc6898f6c85b5cd22770eaa1ce60d55a0230e150fb6a966e3ecd6c511e23d164b + languageName: node + linkType: hard + "pako@npm:~0.2.0": version: 0.2.9 resolution: "pako@npm:0.2.9" @@ -13052,6 +13111,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^1.11.1": + version: 1.11.1 + resolution: "path-scurry@npm:1.11.1" + dependencies: + lru-cache: "npm:^10.2.0" + minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" + checksum: 10c0/32a13711a2a505616ae1cc1b5076801e453e7aae6ac40ab55b388bb91b9d0547a52f5aaceff710ea400205f18691120d4431e520afbe4266b836fadede15872d + languageName: node + linkType: hard + "path-to-regexp@npm:0.1.7": version: 0.1.7 resolution: "path-to-regexp@npm:0.1.7" @@ -14214,6 +14283,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^5.0.0": + version: 5.0.10 + resolution: "rimraf@npm:5.0.10" + dependencies: + glob: "npm:^10.3.7" + bin: + rimraf: dist/esm/bin.mjs + checksum: 10c0/7da4fd0e15118ee05b918359462cfa1e7fe4b1228c7765195a45b55576e8c15b95db513b8466ec89129666f4af45ad978a3057a02139afba1a63512a2d9644cc + languageName: node + linkType: hard + "rimraf@npm:~2.6.2": version: 2.6.3 resolution: "rimraf@npm:2.6.3"