From a8d204e48f27be02813479ba1bf327a77c1719a9 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:06:52 -0700 Subject: [PATCH] Replace `mkdirp` with `fs.mkdirSync(path, { recursive: true })` --- bin/__tests__/jscodeshift-test.js | 1 - package.json | 3 +-- utils/testUtils.js | 3 +-- yarn.lock | 5 ----- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bin/__tests__/jscodeshift-test.js b/bin/__tests__/jscodeshift-test.js index ba66c7b1..1255d214 100644 --- a/bin/__tests__/jscodeshift-test.js +++ b/bin/__tests__/jscodeshift-test.js @@ -18,7 +18,6 @@ const child_process = require('child_process'); const fs = require('fs'); const path = require('path'); const temp = require('temp'); -const mkdirp = require('mkdirp'); const testUtils = require('../../utils/testUtils'); const {chdir} = require('process'); diff --git a/package.json b/package.json index 39752924..081c150e 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,7 @@ "babel-eslint": "^10.0.1", "eslint": "8.56.0", "jest": "^29.7.0", - "jsdoc": "^4.0.3", - "mkdirp": "^3.0.1" + "jsdoc": "^4.0.3" }, "jest": { "roots": [ diff --git a/utils/testUtils.js b/utils/testUtils.js index a7a1cea2..3d5d44d4 100644 --- a/utils/testUtils.js +++ b/utils/testUtils.js @@ -9,14 +9,13 @@ 'use strict'; const fs = require('fs'); -const mkdirp = require('mkdirp'); const path = require('path'); const temp = require('temp'); function renameFileTo(oldPath, newFilename, extension = '') { const projectPath = path.dirname(oldPath); const newPath = path.join(projectPath, newFilename + extension); - mkdirp.sync(path.dirname(newPath)); + fs.mkdirSync(path.dirname(newPath), { recursive: true }); fs.renameSync(oldPath, newPath); return newPath; } diff --git a/yarn.lock b/yarn.lock index e42f6989..698430f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2429,11 +2429,6 @@ mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" - integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"