Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency rimraf to v5 #8727

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading