Unverified Commit f6cc0ded authored by Chulki Lee's avatar Chulki Lee Committed by GitHub

Remove mkdirp (#21365)

Closes #17042

I removed mkdirp from package.json taskfil.js, and ran `yarn && ./check-pre-compiled.sh `. Please let me know if anything else is needed!

(Extracted from #20411)

Note that now compiled webpack has mkdirP function
parent 3368fdde
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Copyright 2010 James Halliday (mail@substack.net)
This project is free software released under the MIT/X11 license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
module.exports=(()=>{var r={186:(r,e,i)=>{var t=i(622);var n=i(747);var s=parseInt("0777",8);r.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(r,e,i,a){if(typeof e==="function"){i=e;e={}}else if(!e||typeof e!=="object"){e={mode:e}}var u=e.mode;var c=e.fs||n;if(u===undefined){u=s&~process.umask()}if(!a)a=null;var o=i||function(){};r=t.resolve(r);c.mkdir(r,u,function(i){if(!i){a=a||r;return o(null,a)}switch(i.code){case"ENOENT":mkdirP(t.dirname(r),e,function(i,t){if(i)o(i,t);else mkdirP(r,e,o,t)});break;default:c.stat(r,function(r,e){if(r||!e.isDirectory())o(i,a);else o(null,a)});break}})}mkdirP.sync=function sync(r,e,i){if(!e||typeof e!=="object"){e={mode:e}}var a=e.mode;var u=e.fs||n;if(a===undefined){a=s&~process.umask()}if(!i)i=null;r=t.resolve(r);try{u.mkdirSync(r,a);i=i||r}catch(n){switch(n.code){case"ENOENT":i=sync(t.dirname(r),e,i);sync(r,e,i);break;default:var c;try{c=u.statSync(r)}catch(r){throw n}if(!c.isDirectory())throw n;break}}return i}},747:r=>{"use strict";r.exports=require("fs")},622:r=>{"use strict";r.exports=require("path")}};var e={};function __nccwpck_require__(i){if(e[i]){return e[i].exports}var t=e[i]={exports:{}};var n=true;try{r[i](t,t.exports,__nccwpck_require__);n=false}finally{if(n)delete e[i]}return t.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(186)})();
\ No newline at end of file
{"name":"mkdirp","main":"index.js","author":"James Halliday <mail@substack.net> (http://substack.net)","license":"MIT"}
......@@ -36452,6 +36452,112 @@ module.exports = function isExtendable(val) {
};
/***/ }),
/***/ 50998:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
var path = __webpack_require__(85622);
var fs = __webpack_require__(35747);
var _0777 = parseInt('0777', 8);
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
function mkdirP (p, opts, f, made) {
if (typeof opts === 'function') {
f = opts;
opts = {};
}
else if (!opts || typeof opts !== 'object') {
opts = { mode: opts };
}
var mode = opts.mode;
var xfs = opts.fs || fs;
if (mode === undefined) {
mode = _0777
}
if (!made) made = null;
var cb = f || function () {};
p = path.resolve(p);
xfs.mkdir(p, mode, function (er) {
if (!er) {
made = made || p;
return cb(null, made);
}
switch (er.code) {
case 'ENOENT':
if (path.dirname(p) === p) return cb(er);
mkdirP(path.dirname(p), opts, function (er, made) {
if (er) cb(er, made);
else mkdirP(p, opts, cb, made);
});
break;
// In the case of any other error, just see if there's a dir
// there already. If so, then hooray! If not, then something
// is borked.
default:
xfs.stat(p, function (er2, stat) {
// if the stat fails, then that's super weird.
// let the original error be the failure reason.
if (er2 || !stat.isDirectory()) cb(er, made)
else cb(null, made);
});
break;
}
});
}
mkdirP.sync = function sync (p, opts, made) {
if (!opts || typeof opts !== 'object') {
opts = { mode: opts };
}
var mode = opts.mode;
var xfs = opts.fs || fs;
if (mode === undefined) {
mode = _0777
}
if (!made) made = null;
p = path.resolve(p);
try {
xfs.mkdirSync(p, mode);
made = made || p;
}
catch (err0) {
switch (err0.code) {
case 'ENOENT' :
made = sync(path.dirname(p), opts, made);
sync(p, opts, made);
break;
// In the case of any other error, just see if there's a dir
// there already. If so, then hooray! If not, then something
// is borked.
default:
var stat;
try {
stat = xfs.statSync(p);
}
catch (err1) {
throw err0;
}
if (!stat.isDirectory()) throw err0;
break;
}
}
return made;
};
/***/ }),
/***/ 57925:
......@@ -78593,7 +78699,7 @@ module.exports = (a, b) => {
const fs = __webpack_require__(35747);
const path = __webpack_require__(85622);
const mkdirp = __webpack_require__(94327);
const mkdirp = __webpack_require__(50998);
const { Tracer } = __webpack_require__(92430);
const validateOptions = __webpack_require__(33225);
const schema = __webpack_require__(49049);
......@@ -86946,7 +87052,7 @@ module.exports = class NodeMainTemplatePlugin {
const fs = __webpack_require__(35747);
const path = __webpack_require__(85622);
const mkdirp = __webpack_require__(94327);
const mkdirp = __webpack_require__(50998);
class NodeOutputFileSystem {
constructor() {
......@@ -105954,14 +106060,6 @@ module.exports = require("next/dist/compiled/is-wsl");;
/***/ }),
/***/ 94327:
/***/ (function(module) {
"use strict";
module.exports = require("next/dist/compiled/mkdirp");;
/***/ }),
/***/ 36386:
/***/ (function(module) {
......@@ -204,7 +204,6 @@
"loader-utils": "2.0.0",
"lodash.curry": "4.1.1",
"lru-cache": "5.1.1",
"mkdirp": "0.5.3",
"nanoid": "3.1.20",
"neo-async": "2.6.1",
"ora": "4.0.4",
......
......@@ -368,14 +368,6 @@ export async function ncc_lru_cache(task, opts) {
.target('compiled/lru-cache')
}
// eslint-disable-next-line camelcase
externals['mkdirp'] = 'next/dist/compiled/mkdirp'
export async function ncc_mkdirp(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('mkdirp')))
.ncc({ packageName: 'mkdirp', externals })
.target('compiled/mkdirp')
}
// eslint-disable-next-line camelcase
externals['nanoid'] = 'next/dist/compiled/nanoid'
export async function ncc_nanoid(task, opts) {
await task
......@@ -707,7 +699,6 @@ export async function ncc(task) {
'ncc_loader_utils',
'ncc_lodash_curry',
'ncc_lru_cache',
'ncc_mkdirp',
'ncc_nanoid',
'ncc_neo_async',
'ncc_ora',
......
......@@ -10764,12 +10764,6 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113"
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
mkdirp@0.5.3:
version "0.5.3"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c"
dependencies:
minimist "^1.2.5"
mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.0, mkdirp@~0.5.1:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment