Skip to content

Commit

Permalink
chore(deps): update dependency rimraf to v5 (#8727)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency rimraf to v6

* fix: use v5

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
  • Loading branch information
renovate[bot] and chenjiahan authored Dec 16, 2024
1 parent 37dbdec commit 87884e0
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 99 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"@types/is-ci": "^3.0.4",
"@types/jest": "29.5.14",
"@types/node": "^20.12.7",
"@types/rimraf": "3.0.2",
"check-dependency-version-consistency": "^5.0.0",
"commander": "12.1.0",
"cross-env": "^7.0.3",
Expand All @@ -74,7 +73,7 @@
"lint-staged": "^15.0.0",
"prettier": "3.4.2",
"prettier-2": "npm:prettier@2.8.8",
"rimraf": "3.0.2",
"rimraf": "^5.0.10",
"ts-jest": "29.2.5",
"typescript": "^5.6.3",
"webpack": "^5.94.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-test-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"mkdirp": "0.5.6",
"path-serializer": "0.3.4",
"pretty-format": "29.7.0",
"rimraf": "3.0.2",
"rimraf": "^5.0.10",
"webpack": "^5.94.0",
"webpack-merge": "5.9.0",
"webpack-sources": "3.2.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-test-tools/src/case/diff.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import fs from "fs-extra";
import rimraf from "rimraf";
import { rimrafSync } from "rimraf";

import createLazyTestEnv from "../helper/legacy/createLazyTestEnv";
import { DiffProcessor, type IDiffProcessorOptions } from "../processor";
Expand Down Expand Up @@ -43,7 +43,7 @@ export function createDiffCase(name: string, src: string, dist: string) {
});

beforeAll(async () => {
rimraf.sync(dist);
rimrafSync(dist);
await tester.prepare();
});

Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-test-tools/src/helper/legacy/copyDiff.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-nocheck
const fs = require("node:fs");
const path = require("node:path");
const rimraf = require("rimraf");
const { rimrafSync } = require("rimraf");

module.exports = function copyDiff(src, dest, initial) {
fs.mkdirSync(dest, { recursive: true });
Expand All @@ -17,7 +17,7 @@ module.exports = function copyDiff(src, dest, initial) {
if (/^DELETE\s*$/.test(content.toString("utf-8"))) {
fs.unlinkSync(destFile);
} else if (/^DELETE_DIRECTORY\s*$/.test(content.toString("utf-8"))) {
rimraf.sync(destFile);
rimrafSync(destFile);
} else {
fs.writeFileSync(destFile, content);
if (initial) {
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-test-tools/src/test/creator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import rimraf from "rimraf";
import { rimrafSync } from "rimraf";

import createLazyTestEnv from "../helper/legacy/createLazyTestEnv";
import type {
Expand Down Expand Up @@ -125,7 +125,7 @@ export class BasicCaseCreator<T extends ECompilerType> {

protected clean(folders: string[]) {
for (const f of folders) {
rimraf.sync(f);
rimrafSync(f);
fs.mkdirSync(f, { recursive: true });
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require("path");
const fs = require("fs");
const rimraf = require("rimraf");
const { rimrafSync } = require("rimraf");

let first_asset_mtime;

Expand All @@ -19,7 +19,7 @@ module.exports = {
};
},
async build(context, compiler) {
rimraf.sync(context.getDist());
rimrafSync(context.getDist());
await new Promise(resolve => {
compiler.run(() => {
first_asset_mtime = fs.statSync(path.join(context.getDist("main.js")))?.mtime;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require("path");
const fs = require("fs");
const rimraf = require("rimraf");
const { rimrafSync } = require("rimraf");

let first_asset_mtime;

Expand All @@ -18,7 +18,7 @@ module.exports = {
};
},
async build(context, compiler) {
rimraf.sync(context.getDist());
rimrafSync(context.getDist());
await new Promise(resolve => {
compiler.run(() => {
first_asset_mtime = fs.statSync(path.join(context.getDist("main.js")))?.mtime;
Expand Down
47 changes: 14 additions & 33 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions tests/plugin-test/copy-plugin/CopyPlugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ const rspack = require("@rspack/core");
const { run, runEmit, runChange } = require("./helpers/run");

const { readAssets, getCompiler, compile } = require("./helpers");
const rimraf = require("rimraf");
const { rimrafSync } = require("rimraf");

const FIXTURES_DIR = path.join(__dirname, "fixtures");

describe("CopyPlugin", () => {
beforeEach(() => {
rimraf.sync(path.join(__dirname, "build"));
rimrafSync(path.join(__dirname, "build"));
});
describe("basic", () => {
it("should copy a file", done => {
Expand Down
6 changes: 3 additions & 3 deletions tests/plugin-test/html-plugin/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const path = require("path");
const fs = require("fs");
/// DIFF const webpack = require("webpack");
const webpack = require("@rspack/core");
const rimraf = require("rimraf");
const { rimrafSync } = require("rimraf");
const _ = require("lodash");
/// DIFF const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const MiniCssExtractPlugin = webpack.CssExtractRspackPlugin;
Expand Down Expand Up @@ -119,8 +119,8 @@ function getChunksInfoFromStats(stats) {
}

describe("HtmlWebpackPlugin", () => {
beforeEach((done) => {
rimraf(OUTPUT_DIR, done);
beforeEach(() => {
rimrafSync(OUTPUT_DIR);
});

it("generates a default index.html file for a single entry point", (done) => {
Expand Down
16 changes: 8 additions & 8 deletions tests/webpack-cli-test/build/cache/cache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

const path = require("path");
// eslint-disable-next-line node/no-unpublished-require
const rimraf = require("rimraf");
const { rimrafSync } = require("rimraf");
const { run } = require("../../utils/test-utils");

describe("cache", () => {
it("should work", async () => {
rimraf.sync(
rimrafSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-default-development"),
);

Expand All @@ -30,10 +30,10 @@ describe("cache", () => {
});

it("should work in multi compiler mode", async () => {
rimraf.sync(
rimrafSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-first-development"),
);
rimraf.sync(
rimrafSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-second-development"),
);

Expand All @@ -56,7 +56,7 @@ describe("cache", () => {
});

it("should work in multi compiler mode with the `--config-name` argument", async () => {
rimraf.sync(
rimrafSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-third-development"),
);

Expand Down Expand Up @@ -93,7 +93,7 @@ describe("cache", () => {
});

it("should work with the `--merge` argument", async () => {
rimraf.sync(
rimrafSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-fourth-development"),
);

Expand Down Expand Up @@ -132,7 +132,7 @@ describe("cache", () => {
});

it("should work with the `--config-name` and `--merge` argument", async () => {
rimraf.sync(
rimrafSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-fifth-development"),
);

Expand Down Expand Up @@ -179,7 +179,7 @@ describe("cache", () => {
});

it("should work with autoloading configuration", async () => {
rimraf.sync(
rimrafSync(
path.join(
__dirname,
"../../../node_modules/.cache/webpack/cache-test-autoloading-development",
Expand Down
4 changes: 2 additions & 2 deletions tests/webpack-cli-test/scripts/cleanup-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line node/no-unpublished-require
const rimraf = require("rimraf");
const { rimrafSync } = require("rimraf");
const { join } = require("path");
const collectTestFolders = require("./utils");

Expand All @@ -22,7 +22,7 @@ const folderStrategy = (stats, file) => {

const cleanupOutputDirs = () => {
for (const outputFolder of collectTestFolders(folderStrategy)) {
outputDirectories.forEach((dir) => rimraf.sync(join(outputFolder, dir)));
outputDirectories.forEach((dir) => rimrafSync(join(outputFolder, dir)));
}
};

Expand Down
14 changes: 7 additions & 7 deletions tests/webpack-test/BuildDependencies.longtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const path = require("path");
const child_process = require("child_process");
const fs = require("fs");
const rimraf = require("rimraf");
const { rimrafSync } = require("rimraf");

const cacheDirectory = path.resolve(__dirname, "js/buildDepsCache");
const outputDirectory = path.resolve(__dirname, "js/buildDeps");
Expand Down Expand Up @@ -98,15 +98,15 @@ const exec = (n, options = {}) => {
const supportsEsm = +process.versions.modules >= 83;

describe.skip("BuildDependencies", () => {
beforeEach(done => {
rimraf(cacheDirectory, done);
beforeEach(() => {
rimrafSync(cacheDirectory);
});
beforeEach(done => {
rimraf(outputDirectory, done);
beforeEach(() => {
rimrafSync(outputDirectory);
});

beforeEach(done => {
rimraf(inputDirectory, done);
beforeEach(() => {
rimrafSync(inputDirectory);
});
beforeEach(done => {
fs.mkdir(inputDirectory, { recursive: true }, done);
Expand Down
Loading

2 comments on commit 87884e0

@rspack-bot
Copy link

Choose a reason for hiding this comment

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

📝 Ran ecosystem CI: Open

suite result
modernjs ❌ failure
_selftest ✅ success
rsdoctor ❌ failure
rspress ✅ success
rslib ✅ success
rsbuild ❌ failure
examples ❌ failure
devserver ❌ failure
nuxt ✅ success

@rspack-bot
Copy link

Choose a reason for hiding this comment

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

📝 Benchmark detail: Open

Name Base (2024-12-16 2f4992b) Current Change
10000_big_production-mode_disable-minimize + exec 38.4 s ± 586 ms 38.3 s ± 346 ms -0.42 %
10000_development-mode + exec 1.89 s ± 64 ms 1.85 s ± 69 ms -2.01 %
10000_development-mode_hmr + exec 690 ms ± 23 ms 679 ms ± 6.3 ms -1.58 %
10000_production-mode + exec 2.49 s ± 47 ms 2.43 s ± 20 ms -2.42 %
arco-pro_development-mode + exec 1.77 s ± 76 ms 1.75 s ± 85 ms -1.09 %
arco-pro_development-mode_hmr + exec 379 ms ± 1.4 ms 378 ms ± 2.3 ms -0.12 %
arco-pro_production-mode + exec 3.33 s ± 128 ms 3.3 s ± 118 ms -0.95 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.41 s ± 149 ms 3.36 s ± 87 ms -1.44 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.34 s ± 90 ms 3.32 s ± 95 ms -0.57 %
threejs_development-mode_10x + exec 1.62 s ± 14 ms 1.61 s ± 17 ms -0.36 %
threejs_development-mode_10x_hmr + exec 787 ms ± 10 ms 782 ms ± 16 ms -0.66 %
threejs_production-mode_10x + exec 5.42 s ± 77 ms 5.4 s ± 68 ms -0.37 %
10000_big_production-mode_disable-minimize + rss memory 9499 MiB ± 255 MiB 9492 MiB ± 270 MiB -0.07 %
10000_development-mode + rss memory 629 MiB ± 18.3 MiB 674 MiB ± 27.9 MiB +7.27 %
10000_development-mode_hmr + rss memory 1515 MiB ± 164 MiB 1533 MiB ± 249 MiB +1.24 %
10000_production-mode + rss memory 590 MiB ± 18 MiB 648 MiB ± 27.8 MiB +9.85 %
arco-pro_development-mode + rss memory 570 MiB ± 26.4 MiB 577 MiB ± 47.3 MiB +1.22 %
arco-pro_development-mode_hmr + rss memory 640 MiB ± 39 MiB 616 MiB ± 42.6 MiB -3.71 %
arco-pro_production-mode + rss memory 690 MiB ± 48.5 MiB 738 MiB ± 62.8 MiB +6.95 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 736 MiB ± 73.2 MiB 744 MiB ± 59.6 MiB +1.19 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 728 MiB ± 34.9 MiB 747 MiB ± 55.1 MiB +2.66 %
threejs_development-mode_10x + rss memory 590 MiB ± 19.2 MiB 627 MiB ± 27.4 MiB +6.18 %
threejs_development-mode_10x_hmr + rss memory 1125 MiB ± 168 MiB 1194 MiB ± 99.7 MiB +6.16 %
threejs_production-mode_10x + rss memory 896 MiB ± 52.9 MiB 942 MiB ± 79.5 MiB +5.14 %

Please sign in to comment.