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: replace mkdirp by make-dir@2 #839

Merged
merged 1 commit into from Mar 23, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"find-cache-dir": "^2.1.0",
"loader-utils": "^1.4.0",
"mkdirp": "^0.5.3",
"make-dir": "^2.1.0",
"pify": "^4.0.1",
"schema-utils": "^2.6.5"
},
Expand Down
5 changes: 2 additions & 3 deletions src/cache.js
Expand Up @@ -12,7 +12,6 @@ const os = require("os");
const path = require("path");
const zlib = require("zlib");
const crypto = require("crypto");
const mkdirpOrig = require("mkdirp");
const findCacheDir = require("find-cache-dir");
const promisify = require("pify");

Expand All @@ -24,7 +23,7 @@ const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const gunzip = promisify(zlib.gunzip);
const gzip = promisify(zlib.gzip);
const mkdirp = promisify(mkdirpOrig);
const makeDir = require("make-dir");

/**
* Read the contents from the compressed file.
Expand Down Expand Up @@ -99,7 +98,7 @@ const handleCache = async function(directory, params) {

// Make sure the directory exists.
try {
await mkdirp(directory);
await makeDir(directory);
} catch (err) {
if (fallback) {
return handleCache(os.tmpdir(), params);
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -4451,7 +4451,7 @@ mixin-deep@^1.2.0:
for-in "^1.0.2"
is-extendable "^1.0.1"

mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3:
mkdirp@^0.5.0, mkdirp@^0.5.1:
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this still trigger the deprecation warning anyway?

Copy link
Contributor Author

@JLHwung JLHwung Mar 23, 2020

Choose a reason for hiding this comment

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

mkdirp is now depended only by our devDependencies or peerDependencies.

$ yarn why mkdirp

=> Found "mkdirp@0.5.3"
info Reasons this module exists
   - "@babel#cli" depends on it
   - Hoisted from "@babel#cli#mkdirp"
   - Hoisted from "eslint#mkdirp"
   - Hoisted from "webpack#mkdirp"
   - Hoisted from "nyc#spawn-wrap#mkdirp"
   - Hoisted from "@babel#cli#output-file-sync#mkdirp"
   - Hoisted from "ava#unique-temp-dir#mkdirp"
   - Hoisted from "webpack#terser-webpack-plugin#cacache#mkdirp"
   - Hoisted from "chokidar#fsevents#node-pre-gyp#mkdirp"
   - Hoisted from "chokidar#fsevents#node-pre-gyp#tar#mkdirp"
   - Hoisted from "webpack#terser-webpack-plugin#cacache#move-concurrently#mkdirp"
   - Hoisted from "eslint#file-entry-cache#flat-cache#write#mkdirp"
   - Hoisted from "webpack#terser-webpack-plugin#cacache#move-concurrently#copy-concurrently#mkdirp"

Update: @babel/cli has switched to make-dir in babel/babel#8622 so this PR is also aligning to what we have done on @babel/cli.

version "0.5.3"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c"
integrity sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==
Expand Down