feat: update rimraf to 5.x, closes #11456

isekai-main
Barış Soner Uşaklı 2 years ago
parent c3cedefef3
commit 43c6087b34

@ -119,7 +119,7 @@
"ioredis": "5.3.1", "ioredis": "5.3.1",
"request": "2.88.2", "request": "2.88.2",
"request-promise-native": "1.0.9", "request-promise-native": "1.0.9",
"rimraf": "4.4.1", "rimraf": "5.0.0",
"rss": "1.2.2", "rss": "1.2.2",
"rtlcss": "4.0.0", "rtlcss": "4.0.0",
"sanitize-html": "2.10.0", "sanitize-html": "2.10.0",

@ -3,7 +3,6 @@
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');
const rimraf = require('rimraf');
const file = require('../file'); const file = require('../file');
const plugins = require('../plugins'); const plugins = require('../plugins');
@ -66,7 +65,7 @@ async function clearModules() {
p => path.join(__dirname, '../../build/public/src', p) p => path.join(__dirname, '../../build/public/src', p)
); );
await Promise.all( await Promise.all(
builtPaths.map(builtPath => rimraf(builtPath)) builtPaths.map(builtPath => fs.promises.rm(builtPath, { recursive: true, force: true }))
); );
} }
@ -83,8 +82,7 @@ JS.buildModules = async function () {
}; };
JS.linkStatics = async function () { JS.linkStatics = async function () {
await rimraf(path.join(__dirname, '../../build/public/plugins')); await fs.promises.rm(path.join(__dirname, '../../build/public/plugins'), { recursive: true, force: true });
await Promise.all(Object.keys(plugins.staticDirs).map(async (mappedPath) => { await Promise.all(Object.keys(plugins.staticDirs).map(async (mappedPath) => {
const sourceDir = plugins.staticDirs[mappedPath]; const sourceDir = plugins.staticDirs[mappedPath];
const destDir = path.join(__dirname, '../../build/public/plugins', mappedPath); const destDir = path.join(__dirname, '../../build/public/plugins', mappedPath);

@ -5,7 +5,6 @@ const nconf = require('nconf');
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');
const rimraf = require('rimraf');
const file = require('../file'); const file = require('../file');
@ -133,7 +132,7 @@ async function assignFileToTranslations(translations, path) {
} }
exports.build = async function buildLanguages() { exports.build = async function buildLanguages() {
await rimraf(buildLanguagesPath); await fs.promises.rm(buildLanguagesPath, { recursive: true, force: true });
const data = await getTranslationMetadata(); const data = await getTranslationMetadata();
await buildTranslations(data); await buildTranslations(data);
}; };

@ -1,7 +1,6 @@
'use strict'; 'use strict';
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');
const rimraf = require('rimraf');
const winston = require('winston'); const winston = require('winston');
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
@ -109,7 +108,7 @@ async function compileTemplate(filename, source) {
Templates.compileTemplate = compileTemplate; Templates.compileTemplate = compileTemplate;
async function compile() { async function compile() {
await rimraf(viewsPath); await fs.promises.rm(viewsPath, { recursive: true, force: true });
await mkdirp(viewsPath); await mkdirp(viewsPath);
let files = await plugins.getActive(); let files = await plugins.getActive();

@ -4,7 +4,7 @@ const async = require('async');
const _ = require('lodash'); const _ = require('lodash');
const path = require('path'); const path = require('path');
const nconf = require('nconf'); const nconf = require('nconf');
const rimraf = require('rimraf'); const { rimraf } = require('rimraf');
const db = require('../database'); const db = require('../database');
const posts = require('../posts'); const posts = require('../posts');

@ -4,8 +4,6 @@ const path = require('path');
const fs = require('fs'); const fs = require('fs');
const assert = require('assert'); const assert = require('assert');
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');
const rimraf = require('rimraf');
const async = require('async');
const db = require('./mocks/databasemock'); const db = require('./mocks/databasemock');
const file = require('../src/file'); const file = require('../src/file');
@ -89,7 +87,7 @@ describe('Build', () => {
const build = require('../src/meta/build'); const build = require('../src/meta/build');
before(async () => { before(async () => {
await rimraf(path.join(__dirname, '../build/public')); await fs.promises.rm(path.join(__dirname, '../build/public'), { recursive: true, force: true });
await db.sortedSetAdd('plugins:active', Date.now(), 'nodebb-plugin-markdown'); await db.sortedSetAdd('plugins:active', Date.now(), 'nodebb-plugin-markdown');
}); });

@ -206,8 +206,9 @@ async function setupMockDefaults() {
id: 'nodebb-theme-persona', id: 'nodebb-theme-persona',
}); });
const rimraf = require('rimraf'); const fs = require('fs');
await rimraf('test/uploads'); await fs.promises.rm('test/uploads', { recursive: true, force: true });
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');

Loading…
Cancel
Save