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

Remove mkdirp #21365

Merged
merged 2 commits into from
Jan 26, 2021
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
2 changes: 1 addition & 1 deletion packages/next/compiled/cacache/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/compiled/cache-loader/cjs.js

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions packages/next/compiled/mkdirp/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/compiled/mkdirp/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/compiled/mkdirp/package.json

This file was deleted.

118 changes: 108 additions & 10 deletions packages/next/compiled/webpack/bundle4.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {

Expand Down
1 change: 0 additions & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 0 additions & 9 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down
6 changes: 0 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==

[email protected]:
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"
Expand Down