@rushstack/package-extractor 0.10.7 → 0.10.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17874,10 +17874,10 @@ module.exports = fill;
17874
17874
 
17875
17875
  /***/ }),
17876
17876
 
17877
- /***/ 873878:
17878
- /*!********************************************************************************************************************!*\
17879
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/copy-sync/copy-sync.js ***!
17880
- \********************************************************************************************************************/
17877
+ /***/ 159693:
17878
+ /*!****************************************************************************************************************!*\
17879
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy-sync.js ***!
17880
+ \****************************************************************************************************************/
17881
17881
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
17882
17882
 
17883
17883
  "use strict";
@@ -17885,14 +17885,13 @@ module.exports = fill;
17885
17885
 
17886
17886
  const fs = __webpack_require__(/*! graceful-fs */ 764420)
17887
17887
  const path = __webpack_require__(/*! path */ 16928)
17888
- const mkdirpSync = (__webpack_require__(/*! ../mkdirs */ 679918).mkdirsSync)
17889
- const utimesSync = (__webpack_require__(/*! ../util/utimes.js */ 557395).utimesMillisSync)
17890
-
17891
- const notExist = Symbol('notExist')
17888
+ const mkdirsSync = (__webpack_require__(/*! ../mkdirs */ 595531).mkdirsSync)
17889
+ const utimesMillisSync = (__webpack_require__(/*! ../util/utimes */ 59032).utimesMillisSync)
17890
+ const stat = __webpack_require__(/*! ../util/stat */ 536793)
17892
17891
 
17893
17892
  function copySync (src, dest, opts) {
17894
17893
  if (typeof opts === 'function') {
17895
- opts = {filter: opts}
17894
+ opts = { filter: opts }
17896
17895
  }
17897
17896
 
17898
17897
  opts = opts || {}
@@ -17901,21 +17900,18 @@ function copySync (src, dest, opts) {
17901
17900
 
17902
17901
  // Warn about using preserveTimestamps on 32-bit node
17903
17902
  if (opts.preserveTimestamps && process.arch === 'ia32') {
17904
- console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n
17905
- see https://github.com/jprichardson/node-fs-extra/issues/269`)
17903
+ process.emitWarning(
17904
+ 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
17905
+ '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
17906
+ 'Warning', 'fs-extra-WARN0002'
17907
+ )
17906
17908
  }
17907
17909
 
17908
- const destStat = checkPaths(src, dest)
17909
-
17910
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
17911
+ stat.checkParentPathsSync(src, srcStat, dest, 'copy')
17910
17912
  if (opts.filter && !opts.filter(src, dest)) return
17911
-
17912
17913
  const destParent = path.dirname(dest)
17913
- if (!fs.existsSync(destParent)) mkdirpSync(destParent)
17914
- return startCopy(destStat, src, dest, opts)
17915
- }
17916
-
17917
- function startCopy (destStat, src, dest, opts) {
17918
- if (opts.filter && !opts.filter(src, dest)) return
17914
+ if (!fs.existsSync(destParent)) mkdirsSync(destParent)
17919
17915
  return getStats(destStat, src, dest, opts)
17920
17916
  }
17921
17917
 
@@ -17928,10 +17924,13 @@ function getStats (destStat, src, dest, opts) {
17928
17924
  srcStat.isCharacterDevice() ||
17929
17925
  srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
17930
17926
  else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
17927
+ else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
17928
+ else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
17929
+ throw new Error(`Unknown file: ${src}`)
17931
17930
  }
17932
17931
 
17933
17932
  function onFile (srcStat, destStat, src, dest, opts) {
17934
- if (destStat === notExist) return copyFile(srcStat, src, dest, opts)
17933
+ if (!destStat) return copyFile(srcStat, src, dest, opts)
17935
17934
  return mayCopyFile(srcStat, src, dest, opts)
17936
17935
  }
17937
17936
 
@@ -17945,70 +17944,79 @@ function mayCopyFile (srcStat, src, dest, opts) {
17945
17944
  }
17946
17945
 
17947
17946
  function copyFile (srcStat, src, dest, opts) {
17948
- if (typeof fs.copyFileSync === 'function') {
17949
- fs.copyFileSync(src, dest)
17950
- fs.chmodSync(dest, srcStat.mode)
17951
- if (opts.preserveTimestamps) {
17952
- return utimesSync(dest, srcStat.atime, srcStat.mtime)
17953
- }
17954
- return
17955
- }
17956
- return copyFileFallback(srcStat, src, dest, opts)
17947
+ fs.copyFileSync(src, dest)
17948
+ if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
17949
+ return setDestMode(dest, srcStat.mode)
17957
17950
  }
17958
17951
 
17959
- function copyFileFallback (srcStat, src, dest, opts) {
17960
- const BUF_LENGTH = 64 * 1024
17961
- const _buff = __webpack_require__(/*! ../util/buffer */ 985030)(BUF_LENGTH)
17952
+ function handleTimestamps (srcMode, src, dest) {
17953
+ // Make sure the file is writable before setting the timestamp
17954
+ // otherwise open fails with EPERM when invoked with 'r+'
17955
+ // (through utimes call)
17956
+ if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
17957
+ return setDestTimestamps(src, dest)
17958
+ }
17962
17959
 
17963
- const fdr = fs.openSync(src, 'r')
17964
- const fdw = fs.openSync(dest, 'w', srcStat.mode)
17965
- let pos = 0
17960
+ function fileIsNotWritable (srcMode) {
17961
+ return (srcMode & 0o200) === 0
17962
+ }
17966
17963
 
17967
- while (pos < srcStat.size) {
17968
- const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
17969
- fs.writeSync(fdw, _buff, 0, bytesRead)
17970
- pos += bytesRead
17971
- }
17964
+ function makeFileWritable (dest, srcMode) {
17965
+ return setDestMode(dest, srcMode | 0o200)
17966
+ }
17972
17967
 
17973
- if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime)
17968
+ function setDestMode (dest, srcMode) {
17969
+ return fs.chmodSync(dest, srcMode)
17970
+ }
17974
17971
 
17975
- fs.closeSync(fdr)
17976
- fs.closeSync(fdw)
17972
+ function setDestTimestamps (src, dest) {
17973
+ // The initial srcStat.atime cannot be trusted
17974
+ // because it is modified by the read(2) system call
17975
+ // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
17976
+ const updatedSrcStat = fs.statSync(src)
17977
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
17977
17978
  }
17978
17979
 
17979
17980
  function onDir (srcStat, destStat, src, dest, opts) {
17980
- if (destStat === notExist) return mkDirAndCopy(srcStat, src, dest, opts)
17981
- if (destStat && !destStat.isDirectory()) {
17982
- throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
17983
- }
17981
+ if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
17984
17982
  return copyDir(src, dest, opts)
17985
17983
  }
17986
17984
 
17987
- function mkDirAndCopy (srcStat, src, dest, opts) {
17985
+ function mkDirAndCopy (srcMode, src, dest, opts) {
17988
17986
  fs.mkdirSync(dest)
17989
17987
  copyDir(src, dest, opts)
17990
- return fs.chmodSync(dest, srcStat.mode)
17988
+ return setDestMode(dest, srcMode)
17991
17989
  }
17992
17990
 
17993
17991
  function copyDir (src, dest, opts) {
17994
- fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))
17992
+ const dir = fs.opendirSync(src)
17993
+
17994
+ try {
17995
+ let dirent
17996
+
17997
+ while ((dirent = dir.readSync()) !== null) {
17998
+ copyDirItem(dirent.name, src, dest, opts)
17999
+ }
18000
+ } finally {
18001
+ dir.closeSync()
18002
+ }
17995
18003
  }
17996
18004
 
17997
18005
  function copyDirItem (item, src, dest, opts) {
17998
18006
  const srcItem = path.join(src, item)
17999
18007
  const destItem = path.join(dest, item)
18000
- const destStat = checkPaths(srcItem, destItem)
18001
- return startCopy(destStat, srcItem, destItem, opts)
18008
+ if (opts.filter && !opts.filter(srcItem, destItem)) return
18009
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
18010
+ return getStats(destStat, srcItem, destItem, opts)
18002
18011
  }
18003
18012
 
18004
18013
  function onLink (destStat, src, dest, opts) {
18005
18014
  let resolvedSrc = fs.readlinkSync(src)
18006
-
18007
18015
  if (opts.dereference) {
18008
18016
  resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
18009
18017
  }
18010
18018
 
18011
- if (destStat === notExist) {
18019
+ if (!destStat) {
18012
18020
  return fs.symlinkSync(resolvedSrc, dest)
18013
18021
  } else {
18014
18022
  let resolvedDest
@@ -18024,14 +18032,14 @@ function onLink (destStat, src, dest, opts) {
18024
18032
  if (opts.dereference) {
18025
18033
  resolvedDest = path.resolve(process.cwd(), resolvedDest)
18026
18034
  }
18027
- if (isSrcSubdir(resolvedSrc, resolvedDest)) {
18035
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
18028
18036
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
18029
18037
  }
18030
18038
 
18031
18039
  // prevent copy if src is a subdir of dest since unlinking
18032
18040
  // dest in this case would result in removing src contents
18033
18041
  // and therefore a broken symlink would be created.
18034
- if (fs.statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) {
18042
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
18035
18043
  throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
18036
18044
  }
18037
18045
  return copyLink(resolvedSrc, dest)
@@ -18043,307 +18051,197 @@ function copyLink (resolvedSrc, dest) {
18043
18051
  return fs.symlinkSync(resolvedSrc, dest)
18044
18052
  }
18045
18053
 
18046
- // return true if dest is a subdir of src, otherwise false.
18047
- function isSrcSubdir (src, dest) {
18048
- const srcArray = path.resolve(src).split(path.sep)
18049
- const destArray = path.resolve(dest).split(path.sep)
18050
- return srcArray.reduce((acc, current, i) => acc && destArray[i] === current, true)
18051
- }
18052
-
18053
- function checkStats (src, dest) {
18054
- const srcStat = fs.statSync(src)
18055
- let destStat
18056
- try {
18057
- destStat = fs.statSync(dest)
18058
- } catch (err) {
18059
- if (err.code === 'ENOENT') return {srcStat, destStat: notExist}
18060
- throw err
18061
- }
18062
- return {srcStat, destStat}
18063
- }
18064
-
18065
- function checkPaths (src, dest) {
18066
- const {srcStat, destStat} = checkStats(src, dest)
18067
- if (destStat.ino && destStat.ino === srcStat.ino) {
18068
- throw new Error('Source and destination must not be the same.')
18069
- }
18070
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
18071
- throw new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`)
18072
- }
18073
- return destStat
18074
- }
18075
-
18076
18054
  module.exports = copySync
18077
18055
 
18078
18056
 
18079
18057
  /***/ }),
18080
18058
 
18081
- /***/ 683985:
18082
- /*!****************************************************************************************************************!*\
18083
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/copy-sync/index.js ***!
18084
- \****************************************************************************************************************/
18085
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18086
-
18087
- "use strict";
18088
-
18089
-
18090
- module.exports = {
18091
- copySync: __webpack_require__(/*! ./copy-sync */ 873878)
18092
- }
18093
-
18094
-
18095
- /***/ }),
18096
-
18097
- /***/ 628778:
18098
- /*!**********************************************************************************************************!*\
18099
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/copy/copy.js ***!
18100
- \**********************************************************************************************************/
18059
+ /***/ 790341:
18060
+ /*!***********************************************************************************************************!*\
18061
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy.js ***!
18062
+ \***********************************************************************************************************/
18101
18063
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18102
18064
 
18103
18065
  "use strict";
18104
18066
 
18105
18067
 
18106
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
18068
+ const fs = __webpack_require__(/*! ../fs */ 965808)
18107
18069
  const path = __webpack_require__(/*! path */ 16928)
18108
- const mkdirp = (__webpack_require__(/*! ../mkdirs */ 679918).mkdirs)
18109
- const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
18110
- const utimes = (__webpack_require__(/*! ../util/utimes */ 557395).utimesMillis)
18111
-
18112
- const notExist = Symbol('notExist')
18070
+ const { mkdirs } = __webpack_require__(/*! ../mkdirs */ 595531)
18071
+ const { pathExists } = __webpack_require__(/*! ../path-exists */ 576755)
18072
+ const { utimesMillis } = __webpack_require__(/*! ../util/utimes */ 59032)
18073
+ const stat = __webpack_require__(/*! ../util/stat */ 536793)
18113
18074
 
18114
- function copy (src, dest, opts, cb) {
18115
- if (typeof opts === 'function' && !cb) {
18116
- cb = opts
18117
- opts = {}
18118
- } else if (typeof opts === 'function') {
18119
- opts = {filter: opts}
18075
+ async function copy (src, dest, opts = {}) {
18076
+ if (typeof opts === 'function') {
18077
+ opts = { filter: opts }
18120
18078
  }
18121
18079
 
18122
- cb = cb || function () {}
18123
- opts = opts || {}
18124
-
18125
18080
  opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
18126
18081
  opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
18127
18082
 
18128
18083
  // Warn about using preserveTimestamps on 32-bit node
18129
18084
  if (opts.preserveTimestamps && process.arch === 'ia32') {
18130
- console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n
18131
- see https://github.com/jprichardson/node-fs-extra/issues/269`)
18085
+ process.emitWarning(
18086
+ 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
18087
+ '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
18088
+ 'Warning', 'fs-extra-WARN0001'
18089
+ )
18132
18090
  }
18133
18091
 
18134
- checkPaths(src, dest, (err, destStat) => {
18135
- if (err) return cb(err)
18136
- if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)
18137
- return checkParentDir(destStat, src, dest, opts, cb)
18138
- })
18139
- }
18092
+ const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)
18093
+
18094
+ await stat.checkParentPaths(src, srcStat, dest, 'copy')
18140
18095
 
18141
- function checkParentDir (destStat, src, dest, opts, cb) {
18096
+ const include = await runFilter(src, dest, opts)
18097
+
18098
+ if (!include) return
18099
+
18100
+ // check if the parent of dest exists, and create it if it doesn't exist
18142
18101
  const destParent = path.dirname(dest)
18143
- pathExists(destParent, (err, dirExists) => {
18144
- if (err) return cb(err)
18145
- if (dirExists) return startCopy(destStat, src, dest, opts, cb)
18146
- mkdirp(destParent, err => {
18147
- if (err) return cb(err)
18148
- return startCopy(destStat, src, dest, opts, cb)
18149
- })
18150
- })
18151
- }
18102
+ const dirExists = await pathExists(destParent)
18103
+ if (!dirExists) {
18104
+ await mkdirs(destParent)
18105
+ }
18152
18106
 
18153
- function handleFilter (onInclude, destStat, src, dest, opts, cb) {
18154
- Promise.resolve(opts.filter(src, dest)).then(include => {
18155
- if (include) {
18156
- if (destStat) return onInclude(destStat, src, dest, opts, cb)
18157
- return onInclude(src, dest, opts, cb)
18158
- }
18159
- return cb()
18160
- }, error => cb(error))
18107
+ await getStatsAndPerformCopy(destStat, src, dest, opts)
18161
18108
  }
18162
18109
 
18163
- function startCopy (destStat, src, dest, opts, cb) {
18164
- if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)
18165
- return getStats(destStat, src, dest, opts, cb)
18110
+ async function runFilter (src, dest, opts) {
18111
+ if (!opts.filter) return true
18112
+ return opts.filter(src, dest)
18166
18113
  }
18167
18114
 
18168
- function getStats (destStat, src, dest, opts, cb) {
18169
- const stat = opts.dereference ? fs.stat : fs.lstat
18170
- stat(src, (err, srcStat) => {
18171
- if (err) return cb(err)
18115
+ async function getStatsAndPerformCopy (destStat, src, dest, opts) {
18116
+ const statFn = opts.dereference ? fs.stat : fs.lstat
18117
+ const srcStat = await statFn(src)
18172
18118
 
18173
- if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)
18174
- else if (srcStat.isFile() ||
18175
- srcStat.isCharacterDevice() ||
18176
- srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)
18177
- else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)
18178
- })
18179
- }
18119
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
18180
18120
 
18181
- function onFile (srcStat, destStat, src, dest, opts, cb) {
18182
- if (destStat === notExist) return copyFile(srcStat, src, dest, opts, cb)
18183
- return mayCopyFile(srcStat, src, dest, opts, cb)
18184
- }
18121
+ if (
18122
+ srcStat.isFile() ||
18123
+ srcStat.isCharacterDevice() ||
18124
+ srcStat.isBlockDevice()
18125
+ ) return onFile(srcStat, destStat, src, dest, opts)
18185
18126
 
18186
- function mayCopyFile (srcStat, src, dest, opts, cb) {
18187
- if (opts.overwrite) {
18188
- fs.unlink(dest, err => {
18189
- if (err) return cb(err)
18190
- return copyFile(srcStat, src, dest, opts, cb)
18191
- })
18192
- } else if (opts.errorOnExist) {
18193
- return cb(new Error(`'${dest}' already exists`))
18194
- } else return cb()
18127
+ if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
18128
+ if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
18129
+ if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
18130
+ throw new Error(`Unknown file: ${src}`)
18195
18131
  }
18196
18132
 
18197
- function copyFile (srcStat, src, dest, opts, cb) {
18198
- if (typeof fs.copyFile === 'function') {
18199
- return fs.copyFile(src, dest, err => {
18200
- if (err) return cb(err)
18201
- return setDestModeAndTimestamps(srcStat, dest, opts, cb)
18202
- })
18203
- }
18204
- return copyFileFallback(srcStat, src, dest, opts, cb)
18205
- }
18133
+ async function onFile (srcStat, destStat, src, dest, opts) {
18134
+ if (!destStat) return copyFile(srcStat, src, dest, opts)
18206
18135
 
18207
- function copyFileFallback (srcStat, src, dest, opts, cb) {
18208
- const rs = fs.createReadStream(src)
18209
- rs.on('error', err => cb(err)).once('open', () => {
18210
- const ws = fs.createWriteStream(dest, { mode: srcStat.mode })
18211
- ws.on('error', err => cb(err))
18212
- .on('open', () => rs.pipe(ws))
18213
- .once('close', () => setDestModeAndTimestamps(srcStat, dest, opts, cb))
18214
- })
18136
+ if (opts.overwrite) {
18137
+ await fs.unlink(dest)
18138
+ return copyFile(srcStat, src, dest, opts)
18139
+ }
18140
+ if (opts.errorOnExist) {
18141
+ throw new Error(`'${dest}' already exists`)
18142
+ }
18215
18143
  }
18216
18144
 
18217
- function setDestModeAndTimestamps (srcStat, dest, opts, cb) {
18218
- fs.chmod(dest, srcStat.mode, err => {
18219
- if (err) return cb(err)
18220
- if (opts.preserveTimestamps) {
18221
- return utimes(dest, srcStat.atime, srcStat.mtime, cb)
18145
+ async function copyFile (srcStat, src, dest, opts) {
18146
+ await fs.copyFile(src, dest)
18147
+ if (opts.preserveTimestamps) {
18148
+ // Make sure the file is writable before setting the timestamp
18149
+ // otherwise open fails with EPERM when invoked with 'r+'
18150
+ // (through utimes call)
18151
+ if (fileIsNotWritable(srcStat.mode)) {
18152
+ await makeFileWritable(dest, srcStat.mode)
18222
18153
  }
18223
- return cb()
18224
- })
18225
- }
18226
18154
 
18227
- function onDir (srcStat, destStat, src, dest, opts, cb) {
18228
- if (destStat === notExist) return mkDirAndCopy(srcStat, src, dest, opts, cb)
18229
- if (destStat && !destStat.isDirectory()) {
18230
- return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))
18231
- }
18232
- return copyDir(src, dest, opts, cb)
18233
- }
18155
+ // Set timestamps and mode correspondingly
18234
18156
 
18235
- function mkDirAndCopy (srcStat, src, dest, opts, cb) {
18236
- fs.mkdir(dest, err => {
18237
- if (err) return cb(err)
18238
- copyDir(src, dest, opts, err => {
18239
- if (err) return cb(err)
18240
- return fs.chmod(dest, srcStat.mode, cb)
18241
- })
18242
- })
18243
- }
18157
+ // Note that The initial srcStat.atime cannot be trusted
18158
+ // because it is modified by the read(2) system call
18159
+ // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
18160
+ const updatedSrcStat = await fs.stat(src)
18161
+ await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
18162
+ }
18244
18163
 
18245
- function copyDir (src, dest, opts, cb) {
18246
- fs.readdir(src, (err, items) => {
18247
- if (err) return cb(err)
18248
- return copyDirItems(items, src, dest, opts, cb)
18249
- })
18164
+ return fs.chmod(dest, srcStat.mode)
18250
18165
  }
18251
18166
 
18252
- function copyDirItems (items, src, dest, opts, cb) {
18253
- const item = items.pop()
18254
- if (!item) return cb()
18255
- return copyDirItem(items, item, src, dest, opts, cb)
18167
+ function fileIsNotWritable (srcMode) {
18168
+ return (srcMode & 0o200) === 0
18256
18169
  }
18257
18170
 
18258
- function copyDirItem (items, item, src, dest, opts, cb) {
18259
- const srcItem = path.join(src, item)
18260
- const destItem = path.join(dest, item)
18261
- checkPaths(srcItem, destItem, (err, destStat) => {
18262
- if (err) return cb(err)
18263
- startCopy(destStat, srcItem, destItem, opts, err => {
18264
- if (err) return cb(err)
18265
- return copyDirItems(items, src, dest, opts, cb)
18266
- })
18267
- })
18171
+ function makeFileWritable (dest, srcMode) {
18172
+ return fs.chmod(dest, srcMode | 0o200)
18268
18173
  }
18269
18174
 
18270
- function onLink (destStat, src, dest, opts, cb) {
18271
- fs.readlink(src, (err, resolvedSrc) => {
18272
- if (err) return cb(err)
18175
+ async function onDir (srcStat, destStat, src, dest, opts) {
18176
+ // the dest directory might not exist, create it
18177
+ if (!destStat) {
18178
+ await fs.mkdir(dest)
18179
+ }
18273
18180
 
18274
- if (opts.dereference) {
18275
- resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
18276
- }
18181
+ const promises = []
18277
18182
 
18278
- if (destStat === notExist) {
18279
- return fs.symlink(resolvedSrc, dest, cb)
18280
- } else {
18281
- fs.readlink(dest, (err, resolvedDest) => {
18282
- if (err) {
18283
- // dest exists and is a regular file or directory,
18284
- // Windows may throw UNKNOWN error. If dest already exists,
18285
- // fs throws error anyway, so no need to guard against it here.
18286
- if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)
18287
- return cb(err)
18288
- }
18289
- if (opts.dereference) {
18290
- resolvedDest = path.resolve(process.cwd(), resolvedDest)
18291
- }
18292
- if (isSrcSubdir(resolvedSrc, resolvedDest)) {
18293
- return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))
18294
- }
18183
+ // loop through the files in the current directory to copy everything
18184
+ for await (const item of await fs.opendir(src)) {
18185
+ const srcItem = path.join(src, item.name)
18186
+ const destItem = path.join(dest, item.name)
18295
18187
 
18296
- // do not copy if src is a subdir of dest since unlinking
18297
- // dest in this case would result in removing src contents
18298
- // and therefore a broken symlink would be created.
18299
- if (destStat.isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) {
18300
- return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))
18188
+ promises.push(
18189
+ runFilter(srcItem, destItem, opts).then(include => {
18190
+ if (include) {
18191
+ // only copy the item if it matches the filter function
18192
+ return stat.checkPaths(srcItem, destItem, 'copy', opts).then(({ destStat }) => {
18193
+ // If the item is a copyable file, `getStatsAndPerformCopy` will copy it
18194
+ // If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively
18195
+ return getStatsAndPerformCopy(destStat, srcItem, destItem, opts)
18196
+ })
18301
18197
  }
18302
- return copyLink(resolvedSrc, dest, cb)
18303
18198
  })
18304
- }
18305
- })
18306
- }
18199
+ )
18200
+ }
18307
18201
 
18308
- function copyLink (resolvedSrc, dest, cb) {
18309
- fs.unlink(dest, err => {
18310
- if (err) return cb(err)
18311
- return fs.symlink(resolvedSrc, dest, cb)
18312
- })
18313
- }
18202
+ await Promise.all(promises)
18314
18203
 
18315
- // return true if dest is a subdir of src, otherwise false.
18316
- function isSrcSubdir (src, dest) {
18317
- const srcArray = path.resolve(src).split(path.sep)
18318
- const destArray = path.resolve(dest).split(path.sep)
18319
- return srcArray.reduce((acc, current, i) => acc && destArray[i] === current, true)
18204
+ if (!destStat) {
18205
+ await fs.chmod(dest, srcStat.mode)
18206
+ }
18320
18207
  }
18321
18208
 
18322
- function checkStats (src, dest, cb) {
18323
- fs.stat(src, (err, srcStat) => {
18324
- if (err) return cb(err)
18325
- fs.stat(dest, (err, destStat) => {
18326
- if (err) {
18327
- if (err.code === 'ENOENT') return cb(null, {srcStat, destStat: notExist})
18328
- return cb(err)
18329
- }
18330
- return cb(null, {srcStat, destStat})
18331
- })
18332
- })
18333
- }
18209
+ async function onLink (destStat, src, dest, opts) {
18210
+ let resolvedSrc = await fs.readlink(src)
18211
+ if (opts.dereference) {
18212
+ resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
18213
+ }
18214
+ if (!destStat) {
18215
+ return fs.symlink(resolvedSrc, dest)
18216
+ }
18334
18217
 
18335
- function checkPaths (src, dest, cb) {
18336
- checkStats(src, dest, (err, stats) => {
18337
- if (err) return cb(err)
18338
- const {srcStat, destStat} = stats
18339
- if (destStat.ino && destStat.ino === srcStat.ino) {
18340
- return cb(new Error('Source and destination must not be the same.'))
18341
- }
18342
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
18343
- return cb(new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`))
18344
- }
18345
- return cb(null, destStat)
18346
- })
18218
+ let resolvedDest = null
18219
+ try {
18220
+ resolvedDest = await fs.readlink(dest)
18221
+ } catch (e) {
18222
+ // dest exists and is a regular file or directory,
18223
+ // Windows may throw UNKNOWN error. If dest already exists,
18224
+ // fs throws error anyway, so no need to guard against it here.
18225
+ if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)
18226
+ throw e
18227
+ }
18228
+ if (opts.dereference) {
18229
+ resolvedDest = path.resolve(process.cwd(), resolvedDest)
18230
+ }
18231
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
18232
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
18233
+ }
18234
+
18235
+ // do not copy if src is a subdir of dest since unlinking
18236
+ // dest in this case would result in removing src contents
18237
+ // and therefore a broken symlink would be created.
18238
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
18239
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
18240
+ }
18241
+
18242
+ // copy the link
18243
+ await fs.unlink(dest)
18244
+ return fs.symlink(resolvedSrc, dest)
18347
18245
  }
18348
18246
 
18349
18247
  module.exports = copy
@@ -18351,63 +18249,55 @@ module.exports = copy
18351
18249
 
18352
18250
  /***/ }),
18353
18251
 
18354
- /***/ 871151:
18355
- /*!***********************************************************************************************************!*\
18356
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/copy/index.js ***!
18357
- \***********************************************************************************************************/
18252
+ /***/ 944882:
18253
+ /*!************************************************************************************************************!*\
18254
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/index.js ***!
18255
+ \************************************************************************************************************/
18358
18256
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18359
18257
 
18360
18258
  "use strict";
18361
18259
 
18362
18260
 
18363
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
18261
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
18364
18262
  module.exports = {
18365
- copy: u(__webpack_require__(/*! ./copy */ 628778))
18263
+ copy: u(__webpack_require__(/*! ./copy */ 790341)),
18264
+ copySync: __webpack_require__(/*! ./copy-sync */ 159693)
18366
18265
  }
18367
18266
 
18368
18267
 
18369
18268
  /***/ }),
18370
18269
 
18371
- /***/ 714023:
18372
- /*!************************************************************************************************************!*\
18373
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/empty/index.js ***!
18374
- \************************************************************************************************************/
18270
+ /***/ 343604:
18271
+ /*!*************************************************************************************************************!*\
18272
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/empty/index.js ***!
18273
+ \*************************************************************************************************************/
18375
18274
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18376
18275
 
18377
18276
  "use strict";
18378
18277
 
18379
18278
 
18380
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
18381
- const fs = __webpack_require__(/*! fs */ 179896)
18279
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
18280
+ const fs = __webpack_require__(/*! ../fs */ 965808)
18382
18281
  const path = __webpack_require__(/*! path */ 16928)
18383
- const mkdir = __webpack_require__(/*! ../mkdirs */ 679918)
18384
- const remove = __webpack_require__(/*! ../remove */ 119398)
18385
-
18386
- const emptyDir = u(function emptyDir (dir, callback) {
18387
- callback = callback || function () {}
18388
- fs.readdir(dir, (err, items) => {
18389
- if (err) return mkdir.mkdirs(dir, callback)
18390
-
18391
- items = items.map(item => path.join(dir, item))
18282
+ const mkdir = __webpack_require__(/*! ../mkdirs */ 595531)
18283
+ const remove = __webpack_require__(/*! ../remove */ 922127)
18392
18284
 
18393
- deleteItem()
18285
+ const emptyDir = u(async function emptyDir (dir) {
18286
+ let items
18287
+ try {
18288
+ items = await fs.readdir(dir)
18289
+ } catch {
18290
+ return mkdir.mkdirs(dir)
18291
+ }
18394
18292
 
18395
- function deleteItem () {
18396
- const item = items.pop()
18397
- if (!item) return callback()
18398
- remove.remove(item, err => {
18399
- if (err) return callback(err)
18400
- deleteItem()
18401
- })
18402
- }
18403
- })
18293
+ return Promise.all(items.map(item => remove.remove(path.join(dir, item))))
18404
18294
  })
18405
18295
 
18406
18296
  function emptyDirSync (dir) {
18407
18297
  let items
18408
18298
  try {
18409
18299
  items = fs.readdirSync(dir)
18410
- } catch (err) {
18300
+ } catch {
18411
18301
  return mkdir.mkdirsSync(dir)
18412
18302
  }
18413
18303
 
@@ -18427,53 +18317,70 @@ module.exports = {
18427
18317
 
18428
18318
  /***/ }),
18429
18319
 
18430
- /***/ 987528:
18431
- /*!************************************************************************************************************!*\
18432
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/ensure/file.js ***!
18433
- \************************************************************************************************************/
18320
+ /***/ 980119:
18321
+ /*!*************************************************************************************************************!*\
18322
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/file.js ***!
18323
+ \*************************************************************************************************************/
18434
18324
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18435
18325
 
18436
18326
  "use strict";
18437
18327
 
18438
18328
 
18439
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
18329
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
18440
18330
  const path = __webpack_require__(/*! path */ 16928)
18441
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
18442
- const mkdir = __webpack_require__(/*! ../mkdirs */ 679918)
18443
- const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
18444
-
18445
- function createFile (file, callback) {
18446
- function makeFile () {
18447
- fs.writeFile(file, '', err => {
18448
- if (err) return callback(err)
18449
- callback()
18450
- })
18331
+ const fs = __webpack_require__(/*! ../fs */ 965808)
18332
+ const mkdir = __webpack_require__(/*! ../mkdirs */ 595531)
18333
+
18334
+ async function createFile (file) {
18335
+ let stats
18336
+ try {
18337
+ stats = await fs.stat(file)
18338
+ } catch { }
18339
+ if (stats && stats.isFile()) return
18340
+
18341
+ const dir = path.dirname(file)
18342
+
18343
+ let dirStats = null
18344
+ try {
18345
+ dirStats = await fs.stat(dir)
18346
+ } catch (err) {
18347
+ // if the directory doesn't exist, make it
18348
+ if (err.code === 'ENOENT') {
18349
+ await mkdir.mkdirs(dir)
18350
+ await fs.writeFile(file, '')
18351
+ return
18352
+ } else {
18353
+ throw err
18354
+ }
18451
18355
  }
18452
18356
 
18453
- fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
18454
- if (!err && stats.isFile()) return callback()
18455
- const dir = path.dirname(file)
18456
- pathExists(dir, (err, dirExists) => {
18457
- if (err) return callback(err)
18458
- if (dirExists) return makeFile()
18459
- mkdir.mkdirs(dir, err => {
18460
- if (err) return callback(err)
18461
- makeFile()
18462
- })
18463
- })
18464
- })
18357
+ if (dirStats.isDirectory()) {
18358
+ await fs.writeFile(file, '')
18359
+ } else {
18360
+ // parent is not a directory
18361
+ // This is just to cause an internal ENOTDIR error to be thrown
18362
+ await fs.readdir(dir)
18363
+ }
18465
18364
  }
18466
18365
 
18467
18366
  function createFileSync (file) {
18468
18367
  let stats
18469
18368
  try {
18470
18369
  stats = fs.statSync(file)
18471
- } catch (e) {}
18370
+ } catch { }
18472
18371
  if (stats && stats.isFile()) return
18473
18372
 
18474
18373
  const dir = path.dirname(file)
18475
- if (!fs.existsSync(dir)) {
18476
- mkdir.mkdirsSync(dir)
18374
+ try {
18375
+ if (!fs.statSync(dir).isDirectory()) {
18376
+ // parent is not a directory
18377
+ // This is just to cause an internal ENOTDIR error to be thrown
18378
+ fs.readdirSync(dir)
18379
+ }
18380
+ } catch (err) {
18381
+ // If the stat call above failed because the directory doesn't exist, create it
18382
+ if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)
18383
+ else throw err
18477
18384
  }
18478
18385
 
18479
18386
  fs.writeFileSync(file, '')
@@ -18487,91 +18394,94 @@ module.exports = {
18487
18394
 
18488
18395
  /***/ }),
18489
18396
 
18490
- /***/ 472696:
18491
- /*!*************************************************************************************************************!*\
18492
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/ensure/index.js ***!
18493
- \*************************************************************************************************************/
18397
+ /***/ 67469:
18398
+ /*!**************************************************************************************************************!*\
18399
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/index.js ***!
18400
+ \**************************************************************************************************************/
18494
18401
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18495
18402
 
18496
18403
  "use strict";
18497
18404
 
18498
18405
 
18499
- const file = __webpack_require__(/*! ./file */ 987528)
18500
- const link = __webpack_require__(/*! ./link */ 131930)
18501
- const symlink = __webpack_require__(/*! ./symlink */ 250211)
18406
+ const { createFile, createFileSync } = __webpack_require__(/*! ./file */ 980119)
18407
+ const { createLink, createLinkSync } = __webpack_require__(/*! ./link */ 891369)
18408
+ const { createSymlink, createSymlinkSync } = __webpack_require__(/*! ./symlink */ 432122)
18502
18409
 
18503
18410
  module.exports = {
18504
18411
  // file
18505
- createFile: file.createFile,
18506
- createFileSync: file.createFileSync,
18507
- ensureFile: file.createFile,
18508
- ensureFileSync: file.createFileSync,
18412
+ createFile,
18413
+ createFileSync,
18414
+ ensureFile: createFile,
18415
+ ensureFileSync: createFileSync,
18509
18416
  // link
18510
- createLink: link.createLink,
18511
- createLinkSync: link.createLinkSync,
18512
- ensureLink: link.createLink,
18513
- ensureLinkSync: link.createLinkSync,
18417
+ createLink,
18418
+ createLinkSync,
18419
+ ensureLink: createLink,
18420
+ ensureLinkSync: createLinkSync,
18514
18421
  // symlink
18515
- createSymlink: symlink.createSymlink,
18516
- createSymlinkSync: symlink.createSymlinkSync,
18517
- ensureSymlink: symlink.createSymlink,
18518
- ensureSymlinkSync: symlink.createSymlinkSync
18422
+ createSymlink,
18423
+ createSymlinkSync,
18424
+ ensureSymlink: createSymlink,
18425
+ ensureSymlinkSync: createSymlinkSync
18519
18426
  }
18520
18427
 
18521
18428
 
18522
18429
  /***/ }),
18523
18430
 
18524
- /***/ 131930:
18525
- /*!************************************************************************************************************!*\
18526
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/ensure/link.js ***!
18527
- \************************************************************************************************************/
18431
+ /***/ 891369:
18432
+ /*!*************************************************************************************************************!*\
18433
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/link.js ***!
18434
+ \*************************************************************************************************************/
18528
18435
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18529
18436
 
18530
18437
  "use strict";
18531
18438
 
18532
18439
 
18533
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
18440
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
18534
18441
  const path = __webpack_require__(/*! path */ 16928)
18535
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
18536
- const mkdir = __webpack_require__(/*! ../mkdirs */ 679918)
18537
- const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
18538
-
18539
- function createLink (srcpath, dstpath, callback) {
18540
- function makeLink (srcpath, dstpath) {
18541
- fs.link(srcpath, dstpath, err => {
18542
- if (err) return callback(err)
18543
- callback(null)
18544
- })
18442
+ const fs = __webpack_require__(/*! ../fs */ 965808)
18443
+ const mkdir = __webpack_require__(/*! ../mkdirs */ 595531)
18444
+ const { pathExists } = __webpack_require__(/*! ../path-exists */ 576755)
18445
+ const { areIdentical } = __webpack_require__(/*! ../util/stat */ 536793)
18446
+
18447
+ async function createLink (srcpath, dstpath) {
18448
+ let dstStat
18449
+ try {
18450
+ dstStat = await fs.lstat(dstpath)
18451
+ } catch {
18452
+ // ignore error
18545
18453
  }
18546
18454
 
18547
- pathExists(dstpath, (err, destinationExists) => {
18548
- if (err) return callback(err)
18549
- if (destinationExists) return callback(null)
18550
- fs.lstat(srcpath, (err) => {
18551
- if (err) {
18552
- err.message = err.message.replace('lstat', 'ensureLink')
18553
- return callback(err)
18554
- }
18455
+ let srcStat
18456
+ try {
18457
+ srcStat = await fs.lstat(srcpath)
18458
+ } catch (err) {
18459
+ err.message = err.message.replace('lstat', 'ensureLink')
18460
+ throw err
18461
+ }
18555
18462
 
18556
- const dir = path.dirname(dstpath)
18557
- pathExists(dir, (err, dirExists) => {
18558
- if (err) return callback(err)
18559
- if (dirExists) return makeLink(srcpath, dstpath)
18560
- mkdir.mkdirs(dir, err => {
18561
- if (err) return callback(err)
18562
- makeLink(srcpath, dstpath)
18563
- })
18564
- })
18565
- })
18566
- })
18463
+ if (dstStat && areIdentical(srcStat, dstStat)) return
18464
+
18465
+ const dir = path.dirname(dstpath)
18466
+
18467
+ const dirExists = await pathExists(dir)
18468
+
18469
+ if (!dirExists) {
18470
+ await mkdir.mkdirs(dir)
18471
+ }
18472
+
18473
+ await fs.link(srcpath, dstpath)
18567
18474
  }
18568
18475
 
18569
18476
  function createLinkSync (srcpath, dstpath) {
18570
- const destinationExists = fs.existsSync(dstpath)
18571
- if (destinationExists) return undefined
18477
+ let dstStat
18478
+ try {
18479
+ dstStat = fs.lstatSync(dstpath)
18480
+ } catch {}
18572
18481
 
18573
18482
  try {
18574
- fs.lstatSync(srcpath)
18483
+ const srcStat = fs.lstatSync(srcpath)
18484
+ if (dstStat && areIdentical(srcStat, dstStat)) return
18575
18485
  } catch (err) {
18576
18486
  err.message = err.message.replace('lstat', 'ensureLink')
18577
18487
  throw err
@@ -18593,18 +18503,20 @@ module.exports = {
18593
18503
 
18594
18504
  /***/ }),
18595
18505
 
18596
- /***/ 599158:
18597
- /*!*********************************************************************************************************************!*\
18598
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/ensure/symlink-paths.js ***!
18599
- \*********************************************************************************************************************/
18506
+ /***/ 827055:
18507
+ /*!**********************************************************************************************************************!*\
18508
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-paths.js ***!
18509
+ \**********************************************************************************************************************/
18600
18510
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18601
18511
 
18602
18512
  "use strict";
18603
18513
 
18604
18514
 
18605
18515
  const path = __webpack_require__(/*! path */ 16928)
18606
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
18607
- const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
18516
+ const fs = __webpack_require__(/*! ../fs */ 965808)
18517
+ const { pathExists } = __webpack_require__(/*! ../path-exists */ 576755)
18518
+
18519
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
18608
18520
 
18609
18521
  /**
18610
18522
  * Function that returns two types of paths, one relative to symlink, and one
@@ -18628,178 +18540,185 @@ const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
18628
18540
  * the ability to pass in `relative to current working direcotry` paths.
18629
18541
  */
18630
18542
 
18631
- function symlinkPaths (srcpath, dstpath, callback) {
18543
+ async function symlinkPaths (srcpath, dstpath) {
18632
18544
  if (path.isAbsolute(srcpath)) {
18633
- return fs.lstat(srcpath, (err) => {
18634
- if (err) {
18635
- err.message = err.message.replace('lstat', 'ensureSymlink')
18636
- return callback(err)
18637
- }
18638
- return callback(null, {
18639
- 'toCwd': srcpath,
18640
- 'toDst': srcpath
18641
- })
18642
- })
18643
- } else {
18644
- const dstdir = path.dirname(dstpath)
18645
- const relativeToDst = path.join(dstdir, srcpath)
18646
- return pathExists(relativeToDst, (err, exists) => {
18647
- if (err) return callback(err)
18648
- if (exists) {
18649
- return callback(null, {
18650
- 'toCwd': relativeToDst,
18651
- 'toDst': srcpath
18652
- })
18653
- } else {
18654
- return fs.lstat(srcpath, (err) => {
18655
- if (err) {
18656
- err.message = err.message.replace('lstat', 'ensureSymlink')
18657
- return callback(err)
18658
- }
18659
- return callback(null, {
18660
- 'toCwd': srcpath,
18661
- 'toDst': path.relative(dstdir, srcpath)
18662
- })
18663
- })
18664
- }
18665
- })
18545
+ try {
18546
+ await fs.lstat(srcpath)
18547
+ } catch (err) {
18548
+ err.message = err.message.replace('lstat', 'ensureSymlink')
18549
+ throw err
18550
+ }
18551
+
18552
+ return {
18553
+ toCwd: srcpath,
18554
+ toDst: srcpath
18555
+ }
18556
+ }
18557
+
18558
+ const dstdir = path.dirname(dstpath)
18559
+ const relativeToDst = path.join(dstdir, srcpath)
18560
+
18561
+ const exists = await pathExists(relativeToDst)
18562
+ if (exists) {
18563
+ return {
18564
+ toCwd: relativeToDst,
18565
+ toDst: srcpath
18566
+ }
18567
+ }
18568
+
18569
+ try {
18570
+ await fs.lstat(srcpath)
18571
+ } catch (err) {
18572
+ err.message = err.message.replace('lstat', 'ensureSymlink')
18573
+ throw err
18574
+ }
18575
+
18576
+ return {
18577
+ toCwd: srcpath,
18578
+ toDst: path.relative(dstdir, srcpath)
18666
18579
  }
18667
18580
  }
18668
18581
 
18669
18582
  function symlinkPathsSync (srcpath, dstpath) {
18670
- let exists
18671
18583
  if (path.isAbsolute(srcpath)) {
18672
- exists = fs.existsSync(srcpath)
18584
+ const exists = fs.existsSync(srcpath)
18673
18585
  if (!exists) throw new Error('absolute srcpath does not exist')
18674
18586
  return {
18675
- 'toCwd': srcpath,
18676
- 'toDst': srcpath
18587
+ toCwd: srcpath,
18588
+ toDst: srcpath
18677
18589
  }
18678
- } else {
18679
- const dstdir = path.dirname(dstpath)
18680
- const relativeToDst = path.join(dstdir, srcpath)
18681
- exists = fs.existsSync(relativeToDst)
18682
- if (exists) {
18683
- return {
18684
- 'toCwd': relativeToDst,
18685
- 'toDst': srcpath
18686
- }
18687
- } else {
18688
- exists = fs.existsSync(srcpath)
18689
- if (!exists) throw new Error('relative srcpath does not exist')
18690
- return {
18691
- 'toCwd': srcpath,
18692
- 'toDst': path.relative(dstdir, srcpath)
18693
- }
18590
+ }
18591
+
18592
+ const dstdir = path.dirname(dstpath)
18593
+ const relativeToDst = path.join(dstdir, srcpath)
18594
+ const exists = fs.existsSync(relativeToDst)
18595
+ if (exists) {
18596
+ return {
18597
+ toCwd: relativeToDst,
18598
+ toDst: srcpath
18694
18599
  }
18695
18600
  }
18601
+
18602
+ const srcExists = fs.existsSync(srcpath)
18603
+ if (!srcExists) throw new Error('relative srcpath does not exist')
18604
+ return {
18605
+ toCwd: srcpath,
18606
+ toDst: path.relative(dstdir, srcpath)
18607
+ }
18696
18608
  }
18697
18609
 
18698
18610
  module.exports = {
18699
- symlinkPaths,
18611
+ symlinkPaths: u(symlinkPaths),
18700
18612
  symlinkPathsSync
18701
18613
  }
18702
18614
 
18703
18615
 
18704
18616
  /***/ }),
18705
18617
 
18706
- /***/ 275536:
18707
- /*!********************************************************************************************************************!*\
18708
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/ensure/symlink-type.js ***!
18709
- \********************************************************************************************************************/
18618
+ /***/ 181507:
18619
+ /*!*********************************************************************************************************************!*\
18620
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-type.js ***!
18621
+ \*********************************************************************************************************************/
18710
18622
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18711
18623
 
18712
18624
  "use strict";
18713
18625
 
18714
18626
 
18715
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
18627
+ const fs = __webpack_require__(/*! ../fs */ 965808)
18628
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
18716
18629
 
18717
- function symlinkType (srcpath, type, callback) {
18718
- callback = (typeof type === 'function') ? type : callback
18719
- type = (typeof type === 'function') ? false : type
18720
- if (type) return callback(null, type)
18721
- fs.lstat(srcpath, (err, stats) => {
18722
- if (err) return callback(null, 'file')
18723
- type = (stats && stats.isDirectory()) ? 'dir' : 'file'
18724
- callback(null, type)
18725
- })
18726
- }
18630
+ async function symlinkType (srcpath, type) {
18631
+ if (type) return type
18727
18632
 
18728
- function symlinkTypeSync (srcpath, type) {
18729
18633
  let stats
18634
+ try {
18635
+ stats = await fs.lstat(srcpath)
18636
+ } catch {
18637
+ return 'file'
18638
+ }
18639
+
18640
+ return (stats && stats.isDirectory()) ? 'dir' : 'file'
18641
+ }
18730
18642
 
18643
+ function symlinkTypeSync (srcpath, type) {
18731
18644
  if (type) return type
18645
+
18646
+ let stats
18732
18647
  try {
18733
18648
  stats = fs.lstatSync(srcpath)
18734
- } catch (e) {
18649
+ } catch {
18735
18650
  return 'file'
18736
18651
  }
18737
18652
  return (stats && stats.isDirectory()) ? 'dir' : 'file'
18738
18653
  }
18739
18654
 
18740
18655
  module.exports = {
18741
- symlinkType,
18656
+ symlinkType: u(symlinkType),
18742
18657
  symlinkTypeSync
18743
18658
  }
18744
18659
 
18745
18660
 
18746
18661
  /***/ }),
18747
18662
 
18748
- /***/ 250211:
18749
- /*!***************************************************************************************************************!*\
18750
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/ensure/symlink.js ***!
18751
- \***************************************************************************************************************/
18663
+ /***/ 432122:
18664
+ /*!****************************************************************************************************************!*\
18665
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink.js ***!
18666
+ \****************************************************************************************************************/
18752
18667
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18753
18668
 
18754
18669
  "use strict";
18755
18670
 
18756
18671
 
18757
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
18672
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
18758
18673
  const path = __webpack_require__(/*! path */ 16928)
18759
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
18760
- const _mkdirs = __webpack_require__(/*! ../mkdirs */ 679918)
18761
- const mkdirs = _mkdirs.mkdirs
18762
- const mkdirsSync = _mkdirs.mkdirsSync
18763
-
18764
- const _symlinkPaths = __webpack_require__(/*! ./symlink-paths */ 599158)
18765
- const symlinkPaths = _symlinkPaths.symlinkPaths
18766
- const symlinkPathsSync = _symlinkPaths.symlinkPathsSync
18767
-
18768
- const _symlinkType = __webpack_require__(/*! ./symlink-type */ 275536)
18769
- const symlinkType = _symlinkType.symlinkType
18770
- const symlinkTypeSync = _symlinkType.symlinkTypeSync
18771
-
18772
- const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
18773
-
18774
- function createSymlink (srcpath, dstpath, type, callback) {
18775
- callback = (typeof type === 'function') ? type : callback
18776
- type = (typeof type === 'function') ? false : type
18777
-
18778
- pathExists(dstpath, (err, destinationExists) => {
18779
- if (err) return callback(err)
18780
- if (destinationExists) return callback(null)
18781
- symlinkPaths(srcpath, dstpath, (err, relative) => {
18782
- if (err) return callback(err)
18783
- srcpath = relative.toDst
18784
- symlinkType(relative.toCwd, type, (err, type) => {
18785
- if (err) return callback(err)
18786
- const dir = path.dirname(dstpath)
18787
- pathExists(dir, (err, dirExists) => {
18788
- if (err) return callback(err)
18789
- if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)
18790
- mkdirs(dir, err => {
18791
- if (err) return callback(err)
18792
- fs.symlink(srcpath, dstpath, type, callback)
18793
- })
18794
- })
18795
- })
18796
- })
18797
- })
18674
+ const fs = __webpack_require__(/*! ../fs */ 965808)
18675
+
18676
+ const { mkdirs, mkdirsSync } = __webpack_require__(/*! ../mkdirs */ 595531)
18677
+
18678
+ const { symlinkPaths, symlinkPathsSync } = __webpack_require__(/*! ./symlink-paths */ 827055)
18679
+ const { symlinkType, symlinkTypeSync } = __webpack_require__(/*! ./symlink-type */ 181507)
18680
+
18681
+ const { pathExists } = __webpack_require__(/*! ../path-exists */ 576755)
18682
+
18683
+ const { areIdentical } = __webpack_require__(/*! ../util/stat */ 536793)
18684
+
18685
+ async function createSymlink (srcpath, dstpath, type) {
18686
+ let stats
18687
+ try {
18688
+ stats = await fs.lstat(dstpath)
18689
+ } catch { }
18690
+
18691
+ if (stats && stats.isSymbolicLink()) {
18692
+ const [srcStat, dstStat] = await Promise.all([
18693
+ fs.stat(srcpath),
18694
+ fs.stat(dstpath)
18695
+ ])
18696
+
18697
+ if (areIdentical(srcStat, dstStat)) return
18698
+ }
18699
+
18700
+ const relative = await symlinkPaths(srcpath, dstpath)
18701
+ srcpath = relative.toDst
18702
+ const toType = await symlinkType(relative.toCwd, type)
18703
+ const dir = path.dirname(dstpath)
18704
+
18705
+ if (!(await pathExists(dir))) {
18706
+ await mkdirs(dir)
18707
+ }
18708
+
18709
+ return fs.symlink(srcpath, dstpath, toType)
18798
18710
  }
18799
18711
 
18800
18712
  function createSymlinkSync (srcpath, dstpath, type) {
18801
- const destinationExists = fs.existsSync(dstpath)
18802
- if (destinationExists) return undefined
18713
+ let stats
18714
+ try {
18715
+ stats = fs.lstatSync(dstpath)
18716
+ } catch { }
18717
+ if (stats && stats.isSymbolicLink()) {
18718
+ const srcStat = fs.statSync(srcpath)
18719
+ const dstStat = fs.statSync(dstpath)
18720
+ if (areIdentical(srcStat, dstStat)) return
18721
+ }
18803
18722
 
18804
18723
  const relative = symlinkPathsSync(srcpath, dstpath)
18805
18724
  srcpath = relative.toDst
@@ -18819,17 +18738,17 @@ module.exports = {
18819
18738
 
18820
18739
  /***/ }),
18821
18740
 
18822
- /***/ 278425:
18823
- /*!*********************************************************************************************************!*\
18824
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/fs/index.js ***!
18825
- \*********************************************************************************************************/
18741
+ /***/ 965808:
18742
+ /*!**********************************************************************************************************!*\
18743
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/fs/index.js ***!
18744
+ \**********************************************************************************************************/
18826
18745
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
18827
18746
 
18828
18747
  "use strict";
18829
18748
 
18830
18749
  // This is adapted from https://github.com/normalize/mz
18831
18750
  // Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
18832
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
18751
+ const u = (__webpack_require__(/*! universalify */ 458178).fromCallback)
18833
18752
  const fs = __webpack_require__(/*! graceful-fs */ 764420)
18834
18753
 
18835
18754
  const api = [
@@ -18839,6 +18758,7 @@ const api = [
18839
18758
  'chown',
18840
18759
  'close',
18841
18760
  'copyFile',
18761
+ 'cp',
18842
18762
  'fchmod',
18843
18763
  'fchown',
18844
18764
  'fdatasync',
@@ -18846,20 +18766,25 @@ const api = [
18846
18766
  'fsync',
18847
18767
  'ftruncate',
18848
18768
  'futimes',
18849
- 'lchown',
18769
+ 'glob',
18850
18770
  'lchmod',
18771
+ 'lchown',
18772
+ 'lutimes',
18851
18773
  'link',
18852
18774
  'lstat',
18853
18775
  'mkdir',
18854
18776
  'mkdtemp',
18855
18777
  'open',
18856
- 'readFile',
18778
+ 'opendir',
18857
18779
  'readdir',
18780
+ 'readFile',
18858
18781
  'readlink',
18859
18782
  'realpath',
18860
18783
  'rename',
18784
+ 'rm',
18861
18785
  'rmdir',
18862
18786
  'stat',
18787
+ 'statfs',
18863
18788
  'symlink',
18864
18789
  'truncate',
18865
18790
  'unlink',
@@ -18867,21 +18792,15 @@ const api = [
18867
18792
  'writeFile'
18868
18793
  ].filter(key => {
18869
18794
  // Some commands are not available on some systems. Ex:
18870
- // fs.copyFile was added in Node.js v8.5.0
18871
- // fs.mkdtemp was added in Node.js v5.10.0
18795
+ // fs.cp was added in Node.js v16.7.0
18796
+ // fs.statfs was added in Node v19.6.0, v18.15.0
18797
+ // fs.glob was added in Node.js v22.0.0
18872
18798
  // fs.lchown is not available on at least some Linux
18873
18799
  return typeof fs[key] === 'function'
18874
18800
  })
18875
18801
 
18876
- // Export all keys:
18877
- Object.keys(fs).forEach(key => {
18878
- if (key === 'promises') {
18879
- // fs.promises is a getter property that triggers ExperimentalWarning
18880
- // Don't re-export it here, the getter is defined in "lib/index.js"
18881
- return
18882
- }
18883
- exports[key] = fs[key]
18884
- })
18802
+ // Export cloned fs:
18803
+ Object.assign(exports, fs)
18885
18804
 
18886
18805
  // Universalify async methods:
18887
18806
  api.forEach(method => {
@@ -18899,7 +18818,7 @@ exports.exists = function (filename, callback) {
18899
18818
  })
18900
18819
  }
18901
18820
 
18902
- // fs.read() & fs.write need special treatment due to multiple callback args
18821
+ // fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args
18903
18822
 
18904
18823
  exports.read = function (fd, buffer, offset, length, position, callback) {
18905
18824
  if (typeof callback === 'function') {
@@ -18931,62 +18850,92 @@ exports.write = function (fd, buffer, ...args) {
18931
18850
  })
18932
18851
  }
18933
18852
 
18853
+ // Function signature is
18854
+ // s.readv(fd, buffers[, position], callback)
18855
+ // We need to handle the optional arg, so we use ...args
18856
+ exports.readv = function (fd, buffers, ...args) {
18857
+ if (typeof args[args.length - 1] === 'function') {
18858
+ return fs.readv(fd, buffers, ...args)
18859
+ }
18860
+
18861
+ return new Promise((resolve, reject) => {
18862
+ fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
18863
+ if (err) return reject(err)
18864
+ resolve({ bytesRead, buffers })
18865
+ })
18866
+ })
18867
+ }
18868
+
18869
+ // Function signature is
18870
+ // s.writev(fd, buffers[, position], callback)
18871
+ // We need to handle the optional arg, so we use ...args
18872
+ exports.writev = function (fd, buffers, ...args) {
18873
+ if (typeof args[args.length - 1] === 'function') {
18874
+ return fs.writev(fd, buffers, ...args)
18875
+ }
18876
+
18877
+ return new Promise((resolve, reject) => {
18878
+ fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
18879
+ if (err) return reject(err)
18880
+ resolve({ bytesWritten, buffers })
18881
+ })
18882
+ })
18883
+ }
18884
+
18885
+ // fs.realpath.native sometimes not available if fs is monkey-patched
18886
+ if (typeof fs.realpath.native === 'function') {
18887
+ exports.realpath.native = u(fs.realpath.native)
18888
+ } else {
18889
+ process.emitWarning(
18890
+ 'fs.realpath.native is not a function. Is fs being monkey-patched?',
18891
+ 'Warning', 'fs-extra-WARN0003'
18892
+ )
18893
+ }
18894
+
18934
18895
 
18935
18896
  /***/ }),
18936
18897
 
18937
- /***/ 240973:
18938
- /*!******************************************************************************************************!*\
18939
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/index.js ***!
18940
- \******************************************************************************************************/
18898
+ /***/ 665022:
18899
+ /*!*******************************************************************************************************!*\
18900
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/index.js ***!
18901
+ \*******************************************************************************************************/
18941
18902
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18942
18903
 
18943
18904
  "use strict";
18944
18905
 
18945
18906
 
18946
- module.exports = Object.assign(
18947
- {},
18907
+ module.exports = {
18948
18908
  // Export promiseified graceful-fs:
18949
- __webpack_require__(/*! ./fs */ 278425),
18909
+ ...__webpack_require__(/*! ./fs */ 965808),
18950
18910
  // Export extra methods:
18951
- __webpack_require__(/*! ./copy-sync */ 683985),
18952
- __webpack_require__(/*! ./copy */ 871151),
18953
- __webpack_require__(/*! ./empty */ 714023),
18954
- __webpack_require__(/*! ./ensure */ 472696),
18955
- __webpack_require__(/*! ./json */ 108776),
18956
- __webpack_require__(/*! ./mkdirs */ 679918),
18957
- __webpack_require__(/*! ./move-sync */ 650465),
18958
- __webpack_require__(/*! ./move */ 52191),
18959
- __webpack_require__(/*! ./output */ 168123),
18960
- __webpack_require__(/*! ./path-exists */ 8032),
18961
- __webpack_require__(/*! ./remove */ 119398)
18962
- )
18963
-
18964
- // Export fs.promises as a getter property so that we don't trigger
18965
- // ExperimentalWarning before fs.promises is actually accessed.
18966
- const fs = __webpack_require__(/*! fs */ 179896)
18967
- if (Object.getOwnPropertyDescriptor(fs, 'promises')) {
18968
- Object.defineProperty(module.exports, "promises", ({
18969
- get () { return fs.promises }
18970
- }))
18911
+ ...__webpack_require__(/*! ./copy */ 944882),
18912
+ ...__webpack_require__(/*! ./empty */ 343604),
18913
+ ...__webpack_require__(/*! ./ensure */ 67469),
18914
+ ...__webpack_require__(/*! ./json */ 291013),
18915
+ ...__webpack_require__(/*! ./mkdirs */ 595531),
18916
+ ...__webpack_require__(/*! ./move */ 771570),
18917
+ ...__webpack_require__(/*! ./output-file */ 732271),
18918
+ ...__webpack_require__(/*! ./path-exists */ 576755),
18919
+ ...__webpack_require__(/*! ./remove */ 922127)
18971
18920
  }
18972
18921
 
18973
18922
 
18974
18923
  /***/ }),
18975
18924
 
18976
- /***/ 108776:
18977
- /*!***********************************************************************************************************!*\
18978
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/json/index.js ***!
18979
- \***********************************************************************************************************/
18925
+ /***/ 291013:
18926
+ /*!************************************************************************************************************!*\
18927
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/index.js ***!
18928
+ \************************************************************************************************************/
18980
18929
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18981
18930
 
18982
18931
  "use strict";
18983
18932
 
18984
18933
 
18985
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
18986
- const jsonFile = __webpack_require__(/*! ./jsonfile */ 46062)
18934
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
18935
+ const jsonFile = __webpack_require__(/*! ./jsonfile */ 633281)
18987
18936
 
18988
- jsonFile.outputJson = u(__webpack_require__(/*! ./output-json */ 446642))
18989
- jsonFile.outputJsonSync = __webpack_require__(/*! ./output-json-sync */ 118292)
18937
+ jsonFile.outputJson = u(__webpack_require__(/*! ./output-json */ 92799))
18938
+ jsonFile.outputJsonSync = __webpack_require__(/*! ./output-json-sync */ 190839)
18990
18939
  // aliases
18991
18940
  jsonFile.outputJSON = jsonFile.outputJson
18992
18941
  jsonFile.outputJSONSync = jsonFile.outputJsonSync
@@ -19000,51 +18949,44 @@ module.exports = jsonFile
19000
18949
 
19001
18950
  /***/ }),
19002
18951
 
19003
- /***/ 46062:
19004
- /*!**************************************************************************************************************!*\
19005
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/json/jsonfile.js ***!
19006
- \**************************************************************************************************************/
18952
+ /***/ 633281:
18953
+ /*!***************************************************************************************************************!*\
18954
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/jsonfile.js ***!
18955
+ \***************************************************************************************************************/
19007
18956
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19008
18957
 
19009
18958
  "use strict";
19010
18959
 
19011
18960
 
19012
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
19013
- const jsonFile = __webpack_require__(/*! jsonfile */ 187035)
18961
+ const jsonFile = __webpack_require__(/*! jsonfile */ 806498)
19014
18962
 
19015
18963
  module.exports = {
19016
18964
  // jsonfile exports
19017
- readJson: u(jsonFile.readFile),
18965
+ readJson: jsonFile.readFile,
19018
18966
  readJsonSync: jsonFile.readFileSync,
19019
- writeJson: u(jsonFile.writeFile),
18967
+ writeJson: jsonFile.writeFile,
19020
18968
  writeJsonSync: jsonFile.writeFileSync
19021
18969
  }
19022
18970
 
19023
18971
 
19024
18972
  /***/ }),
19025
18973
 
19026
- /***/ 118292:
19027
- /*!**********************************************************************************************************************!*\
19028
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/json/output-json-sync.js ***!
19029
- \**********************************************************************************************************************/
18974
+ /***/ 190839:
18975
+ /*!***********************************************************************************************************************!*\
18976
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/output-json-sync.js ***!
18977
+ \***********************************************************************************************************************/
19030
18978
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19031
18979
 
19032
18980
  "use strict";
19033
18981
 
19034
18982
 
19035
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
19036
- const path = __webpack_require__(/*! path */ 16928)
19037
- const mkdir = __webpack_require__(/*! ../mkdirs */ 679918)
19038
- const jsonFile = __webpack_require__(/*! ./jsonfile */ 46062)
18983
+ const { stringify } = __webpack_require__(/*! jsonfile/utils */ 921731)
18984
+ const { outputFileSync } = __webpack_require__(/*! ../output-file */ 732271)
19039
18985
 
19040
18986
  function outputJsonSync (file, data, options) {
19041
- const dir = path.dirname(file)
18987
+ const str = stringify(data, options)
19042
18988
 
19043
- if (!fs.existsSync(dir)) {
19044
- mkdir.mkdirsSync(dir)
19045
- }
19046
-
19047
- jsonFile.writeJsonSync(file, data, options)
18989
+ outputFileSync(file, str, options)
19048
18990
  }
19049
18991
 
19050
18992
  module.exports = outputJsonSync
@@ -19052,37 +18994,22 @@ module.exports = outputJsonSync
19052
18994
 
19053
18995
  /***/ }),
19054
18996
 
19055
- /***/ 446642:
19056
- /*!*****************************************************************************************************************!*\
19057
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/json/output-json.js ***!
19058
- \*****************************************************************************************************************/
18997
+ /***/ 92799:
18998
+ /*!******************************************************************************************************************!*\
18999
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/output-json.js ***!
19000
+ \******************************************************************************************************************/
19059
19001
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19060
19002
 
19061
19003
  "use strict";
19062
19004
 
19063
19005
 
19064
- const path = __webpack_require__(/*! path */ 16928)
19065
- const mkdir = __webpack_require__(/*! ../mkdirs */ 679918)
19066
- const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
19067
- const jsonFile = __webpack_require__(/*! ./jsonfile */ 46062)
19068
-
19069
- function outputJson (file, data, options, callback) {
19070
- if (typeof options === 'function') {
19071
- callback = options
19072
- options = {}
19073
- }
19074
-
19075
- const dir = path.dirname(file)
19006
+ const { stringify } = __webpack_require__(/*! jsonfile/utils */ 921731)
19007
+ const { outputFile } = __webpack_require__(/*! ../output-file */ 732271)
19076
19008
 
19077
- pathExists(dir, (err, itDoes) => {
19078
- if (err) return callback(err)
19079
- if (itDoes) return jsonFile.writeJson(file, data, options, callback)
19009
+ async function outputJson (file, data, options = {}) {
19010
+ const str = stringify(data, options)
19080
19011
 
19081
- mkdir.mkdirs(dir, err => {
19082
- if (err) return callback(err)
19083
- jsonFile.writeJson(file, data, options, callback)
19084
- })
19085
- })
19012
+ await outputFile(file, str, options)
19086
19013
  }
19087
19014
 
19088
19015
  module.exports = outputJson
@@ -19090,209 +19017,122 @@ module.exports = outputJson
19090
19017
 
19091
19018
  /***/ }),
19092
19019
 
19093
- /***/ 679918:
19094
- /*!*************************************************************************************************************!*\
19095
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/mkdirs/index.js ***!
19096
- \*************************************************************************************************************/
19020
+ /***/ 595531:
19021
+ /*!**************************************************************************************************************!*\
19022
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/index.js ***!
19023
+ \**************************************************************************************************************/
19097
19024
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19098
19025
 
19099
19026
  "use strict";
19100
19027
 
19101
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
19102
- const mkdirs = u(__webpack_require__(/*! ./mkdirs */ 465572))
19103
- const mkdirsSync = __webpack_require__(/*! ./mkdirs-sync */ 782342)
19028
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
19029
+ const { makeDir: _makeDir, makeDirSync } = __webpack_require__(/*! ./make-dir */ 926243)
19030
+ const makeDir = u(_makeDir)
19104
19031
 
19105
19032
  module.exports = {
19106
- mkdirs,
19107
- mkdirsSync,
19033
+ mkdirs: makeDir,
19034
+ mkdirsSync: makeDirSync,
19108
19035
  // alias
19109
- mkdirp: mkdirs,
19110
- mkdirpSync: mkdirsSync,
19111
- ensureDir: mkdirs,
19112
- ensureDirSync: mkdirsSync
19036
+ mkdirp: makeDir,
19037
+ mkdirpSync: makeDirSync,
19038
+ ensureDir: makeDir,
19039
+ ensureDirSync: makeDirSync
19113
19040
  }
19114
19041
 
19115
19042
 
19116
19043
  /***/ }),
19117
19044
 
19118
- /***/ 782342:
19119
- /*!*******************************************************************************************************************!*\
19120
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js ***!
19121
- \*******************************************************************************************************************/
19045
+ /***/ 926243:
19046
+ /*!*****************************************************************************************************************!*\
19047
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/make-dir.js ***!
19048
+ \*****************************************************************************************************************/
19122
19049
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19123
19050
 
19124
19051
  "use strict";
19125
19052
 
19053
+ const fs = __webpack_require__(/*! ../fs */ 965808)
19054
+ const { checkPath } = __webpack_require__(/*! ./utils */ 263158)
19126
19055
 
19127
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
19128
- const path = __webpack_require__(/*! path */ 16928)
19129
- const invalidWin32Path = (__webpack_require__(/*! ./win32 */ 431997).invalidWin32Path)
19130
-
19131
- const o777 = parseInt('0777', 8)
19132
-
19133
- function mkdirsSync (p, opts, made) {
19134
- if (!opts || typeof opts !== 'object') {
19135
- opts = { mode: opts }
19136
- }
19137
-
19138
- let mode = opts.mode
19139
- const xfs = opts.fs || fs
19140
-
19141
- if (process.platform === 'win32' && invalidWin32Path(p)) {
19142
- const errInval = new Error(p + ' contains invalid WIN32 path characters.')
19143
- errInval.code = 'EINVAL'
19144
- throw errInval
19145
- }
19056
+ const getMode = options => {
19057
+ const defaults = { mode: 0o777 }
19058
+ if (typeof options === 'number') return options
19059
+ return ({ ...defaults, ...options }).mode
19060
+ }
19146
19061
 
19147
- if (mode === undefined) {
19148
- mode = o777 & (~process.umask())
19149
- }
19150
- if (!made) made = null
19062
+ module.exports.makeDir = async (dir, options) => {
19063
+ checkPath(dir)
19151
19064
 
19152
- p = path.resolve(p)
19065
+ return fs.mkdir(dir, {
19066
+ mode: getMode(options),
19067
+ recursive: true
19068
+ })
19069
+ }
19153
19070
 
19154
- try {
19155
- xfs.mkdirSync(p, mode)
19156
- made = made || p
19157
- } catch (err0) {
19158
- if (err0.code === 'ENOENT') {
19159
- if (path.dirname(p) === p) throw err0
19160
- made = mkdirsSync(path.dirname(p), opts, made)
19161
- mkdirsSync(p, opts, made)
19162
- } else {
19163
- // In the case of any other error, just see if there's a dir there
19164
- // already. If so, then hooray! If not, then something is borked.
19165
- let stat
19166
- try {
19167
- stat = xfs.statSync(p)
19168
- } catch (err1) {
19169
- throw err0
19170
- }
19171
- if (!stat.isDirectory()) throw err0
19172
- }
19173
- }
19071
+ module.exports.makeDirSync = (dir, options) => {
19072
+ checkPath(dir)
19174
19073
 
19175
- return made
19074
+ return fs.mkdirSync(dir, {
19075
+ mode: getMode(options),
19076
+ recursive: true
19077
+ })
19176
19078
  }
19177
19079
 
19178
- module.exports = mkdirsSync
19179
-
19180
19080
 
19181
19081
  /***/ }),
19182
19082
 
19183
- /***/ 465572:
19083
+ /***/ 263158:
19184
19084
  /*!**************************************************************************************************************!*\
19185
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/mkdirs/mkdirs.js ***!
19085
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/utils.js ***!
19186
19086
  \**************************************************************************************************************/
19187
19087
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19188
19088
 
19189
19089
  "use strict";
19090
+ // Adapted from https://github.com/sindresorhus/make-dir
19091
+ // Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
19092
+ // 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:
19093
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
19094
+ // 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.
19190
19095
 
19191
-
19192
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
19193
19096
  const path = __webpack_require__(/*! path */ 16928)
19194
- const invalidWin32Path = (__webpack_require__(/*! ./win32 */ 431997).invalidWin32Path)
19195
-
19196
- const o777 = parseInt('0777', 8)
19197
-
19198
- function mkdirs (p, opts, callback, made) {
19199
- if (typeof opts === 'function') {
19200
- callback = opts
19201
- opts = {}
19202
- } else if (!opts || typeof opts !== 'object') {
19203
- opts = { mode: opts }
19204
- }
19205
-
19206
- if (process.platform === 'win32' && invalidWin32Path(p)) {
19207
- const errInval = new Error(p + ' contains invalid WIN32 path characters.')
19208
- errInval.code = 'EINVAL'
19209
- return callback(errInval)
19210
- }
19211
-
19212
- let mode = opts.mode
19213
- const xfs = opts.fs || fs
19214
-
19215
- if (mode === undefined) {
19216
- mode = o777 & (~process.umask())
19217
- }
19218
- if (!made) made = null
19219
19097
 
19220
- callback = callback || function () {}
19221
- p = path.resolve(p)
19098
+ // https://github.com/nodejs/node/issues/8987
19099
+ // https://github.com/libuv/libuv/pull/1088
19100
+ module.exports.checkPath = function checkPath (pth) {
19101
+ if (process.platform === 'win32') {
19102
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''))
19222
19103
 
19223
- xfs.mkdir(p, mode, er => {
19224
- if (!er) {
19225
- made = made || p
19226
- return callback(null, made)
19104
+ if (pathHasInvalidWinCharacters) {
19105
+ const error = new Error(`Path contains invalid characters: ${pth}`)
19106
+ error.code = 'EINVAL'
19107
+ throw error
19227
19108
  }
19228
- switch (er.code) {
19229
- case 'ENOENT':
19230
- if (path.dirname(p) === p) return callback(er)
19231
- mkdirs(path.dirname(p), opts, (er, made) => {
19232
- if (er) callback(er, made)
19233
- else mkdirs(p, opts, callback, made)
19234
- })
19235
- break
19236
-
19237
- // In the case of any other error, just see if there's a dir
19238
- // there already. If so, then hooray! If not, then something
19239
- // is borked.
19240
- default:
19241
- xfs.stat(p, (er2, stat) => {
19242
- // if the stat fails, then that's super weird.
19243
- // let the original error be the failure reason.
19244
- if (er2 || !stat.isDirectory()) callback(er, made)
19245
- else callback(null, made)
19246
- })
19247
- break
19248
- }
19249
- })
19109
+ }
19250
19110
  }
19251
19111
 
19252
- module.exports = mkdirs
19253
-
19254
19112
 
19255
19113
  /***/ }),
19256
19114
 
19257
- /***/ 431997:
19258
- /*!*************************************************************************************************************!*\
19259
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/mkdirs/win32.js ***!
19260
- \*************************************************************************************************************/
19115
+ /***/ 771570:
19116
+ /*!************************************************************************************************************!*\
19117
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/index.js ***!
19118
+ \************************************************************************************************************/
19261
19119
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19262
19120
 
19263
19121
  "use strict";
19264
19122
 
19265
19123
 
19266
- const path = __webpack_require__(/*! path */ 16928)
19267
-
19268
- // get drive on windows
19269
- function getRootPath (p) {
19270
- p = path.normalize(path.resolve(p)).split(path.sep)
19271
- if (p.length > 0) return p[0]
19272
- return null
19273
- }
19274
-
19275
- // http://stackoverflow.com/a/62888/10333 contains more accurate
19276
- // TODO: expand to include the rest
19277
- const INVALID_PATH_CHARS = /[<>:"|?*]/
19278
-
19279
- function invalidWin32Path (p) {
19280
- const rp = getRootPath(p)
19281
- p = p.replace(rp, '')
19282
- return INVALID_PATH_CHARS.test(p)
19283
- }
19284
-
19124
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
19285
19125
  module.exports = {
19286
- getRootPath,
19287
- invalidWin32Path
19126
+ move: u(__webpack_require__(/*! ./move */ 270637)),
19127
+ moveSync: __webpack_require__(/*! ./move-sync */ 823925)
19288
19128
  }
19289
19129
 
19290
19130
 
19291
19131
  /***/ }),
19292
19132
 
19293
- /***/ 650465:
19133
+ /***/ 823925:
19294
19134
  /*!****************************************************************************************************************!*\
19295
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/move-sync/index.js ***!
19135
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move-sync.js ***!
19296
19136
  \****************************************************************************************************************/
19297
19137
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19298
19138
 
@@ -19301,256 +19141,162 @@ module.exports = {
19301
19141
 
19302
19142
  const fs = __webpack_require__(/*! graceful-fs */ 764420)
19303
19143
  const path = __webpack_require__(/*! path */ 16928)
19304
- const copySync = (__webpack_require__(/*! ../copy-sync */ 683985).copySync)
19305
- const removeSync = (__webpack_require__(/*! ../remove */ 119398).removeSync)
19306
- const mkdirpSync = (__webpack_require__(/*! ../mkdirs */ 679918).mkdirsSync)
19307
- const buffer = __webpack_require__(/*! ../util/buffer */ 985030)
19308
-
19309
- function moveSync (src, dest, options) {
19310
- options = options || {}
19311
- const overwrite = options.overwrite || options.clobber || false
19144
+ const copySync = (__webpack_require__(/*! ../copy */ 944882).copySync)
19145
+ const removeSync = (__webpack_require__(/*! ../remove */ 922127).removeSync)
19146
+ const mkdirpSync = (__webpack_require__(/*! ../mkdirs */ 595531).mkdirpSync)
19147
+ const stat = __webpack_require__(/*! ../util/stat */ 536793)
19312
19148
 
19313
- src = path.resolve(src)
19314
- dest = path.resolve(dest)
19315
-
19316
- if (src === dest) return fs.accessSync(src)
19317
-
19318
- if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`)
19319
-
19320
- mkdirpSync(path.dirname(dest))
19321
- tryRenameSync()
19322
-
19323
- function tryRenameSync () {
19324
- if (overwrite) {
19325
- try {
19326
- return fs.renameSync(src, dest)
19327
- } catch (err) {
19328
- if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') {
19329
- removeSync(dest)
19330
- options.overwrite = false // just overwriteed it, no need to do it again
19331
- return moveSync(src, dest, options)
19332
- }
19149
+ function moveSync (src, dest, opts) {
19150
+ opts = opts || {}
19151
+ const overwrite = opts.overwrite || opts.clobber || false
19333
19152
 
19334
- if (err.code !== 'EXDEV') throw err
19335
- return moveSyncAcrossDevice(src, dest, overwrite)
19336
- }
19337
- } else {
19338
- try {
19339
- fs.linkSync(src, dest)
19340
- return fs.unlinkSync(src)
19341
- } catch (err) {
19342
- if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') {
19343
- return moveSyncAcrossDevice(src, dest, overwrite)
19344
- }
19345
- throw err
19346
- }
19347
- }
19348
- }
19153
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)
19154
+ stat.checkParentPathsSync(src, srcStat, dest, 'move')
19155
+ if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))
19156
+ return doRename(src, dest, overwrite, isChangingCase)
19349
19157
  }
19350
19158
 
19351
- function moveSyncAcrossDevice (src, dest, overwrite) {
19352
- const stat = fs.statSync(src)
19353
-
19354
- if (stat.isDirectory()) {
19355
- return moveDirSyncAcrossDevice(src, dest, overwrite)
19356
- } else {
19357
- return moveFileSyncAcrossDevice(src, dest, overwrite)
19358
- }
19159
+ function isParentRoot (dest) {
19160
+ const parent = path.dirname(dest)
19161
+ const parsedPath = path.parse(parent)
19162
+ return parsedPath.root === parent
19359
19163
  }
19360
19164
 
19361
- function moveFileSyncAcrossDevice (src, dest, overwrite) {
19362
- const BUF_LENGTH = 64 * 1024
19363
- const _buff = buffer(BUF_LENGTH)
19364
-
19365
- const flags = overwrite ? 'w' : 'wx'
19366
-
19367
- const fdr = fs.openSync(src, 'r')
19368
- const stat = fs.fstatSync(fdr)
19369
- const fdw = fs.openSync(dest, flags, stat.mode)
19370
- let pos = 0
19371
-
19372
- while (pos < stat.size) {
19373
- const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
19374
- fs.writeSync(fdw, _buff, 0, bytesRead)
19375
- pos += bytesRead
19376
- }
19377
-
19378
- fs.closeSync(fdr)
19379
- fs.closeSync(fdw)
19380
- return fs.unlinkSync(src)
19381
- }
19382
-
19383
- function moveDirSyncAcrossDevice (src, dest, overwrite) {
19384
- const options = {
19385
- overwrite: false
19386
- }
19387
-
19165
+ function doRename (src, dest, overwrite, isChangingCase) {
19166
+ if (isChangingCase) return rename(src, dest, overwrite)
19388
19167
  if (overwrite) {
19389
19168
  removeSync(dest)
19390
- tryCopySync()
19391
- } else {
19392
- tryCopySync()
19393
- }
19394
-
19395
- function tryCopySync () {
19396
- copySync(src, dest, options)
19397
- return removeSync(src)
19169
+ return rename(src, dest, overwrite)
19398
19170
  }
19171
+ if (fs.existsSync(dest)) throw new Error('dest already exists.')
19172
+ return rename(src, dest, overwrite)
19399
19173
  }
19400
19174
 
19401
- // return true if dest is a subdir of src, otherwise false.
19402
- // extract dest base dir and check if that is the same as src basename
19403
- function isSrcSubdir (src, dest) {
19175
+ function rename (src, dest, overwrite) {
19404
19176
  try {
19405
- return fs.statSync(src).isDirectory() &&
19406
- src !== dest &&
19407
- dest.indexOf(src) > -1 &&
19408
- dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src)
19409
- } catch (e) {
19410
- return false
19177
+ fs.renameSync(src, dest)
19178
+ } catch (err) {
19179
+ if (err.code !== 'EXDEV') throw err
19180
+ return moveAcrossDevice(src, dest, overwrite)
19411
19181
  }
19412
19182
  }
19413
19183
 
19414
- module.exports = {
19415
- moveSync
19184
+ function moveAcrossDevice (src, dest, overwrite) {
19185
+ const opts = {
19186
+ overwrite,
19187
+ errorOnExist: true,
19188
+ preserveTimestamps: true
19189
+ }
19190
+ copySync(src, dest, opts)
19191
+ return removeSync(src)
19416
19192
  }
19417
19193
 
19194
+ module.exports = moveSync
19195
+
19418
19196
 
19419
19197
  /***/ }),
19420
19198
 
19421
- /***/ 52191:
19199
+ /***/ 270637:
19422
19200
  /*!***********************************************************************************************************!*\
19423
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/move/index.js ***!
19201
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move.js ***!
19424
19202
  \***********************************************************************************************************/
19425
19203
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19426
19204
 
19427
19205
  "use strict";
19428
19206
 
19429
19207
 
19430
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
19431
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
19208
+ const fs = __webpack_require__(/*! ../fs */ 965808)
19432
19209
  const path = __webpack_require__(/*! path */ 16928)
19433
- const copy = (__webpack_require__(/*! ../copy */ 871151).copy)
19434
- const remove = (__webpack_require__(/*! ../remove */ 119398).remove)
19435
- const mkdirp = (__webpack_require__(/*! ../mkdirs */ 679918).mkdirp)
19436
- const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
19437
-
19438
- function move (src, dest, opts, cb) {
19439
- if (typeof opts === 'function') {
19440
- cb = opts
19441
- opts = {}
19442
- }
19210
+ const { copy } = __webpack_require__(/*! ../copy */ 944882)
19211
+ const { remove } = __webpack_require__(/*! ../remove */ 922127)
19212
+ const { mkdirp } = __webpack_require__(/*! ../mkdirs */ 595531)
19213
+ const { pathExists } = __webpack_require__(/*! ../path-exists */ 576755)
19214
+ const stat = __webpack_require__(/*! ../util/stat */ 536793)
19443
19215
 
19216
+ async function move (src, dest, opts = {}) {
19444
19217
  const overwrite = opts.overwrite || opts.clobber || false
19445
19218
 
19446
- src = path.resolve(src)
19447
- dest = path.resolve(dest)
19219
+ const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts)
19448
19220
 
19449
- if (src === dest) return fs.access(src, cb)
19221
+ await stat.checkParentPaths(src, srcStat, dest, 'move')
19450
19222
 
19451
- fs.stat(src, (err, st) => {
19452
- if (err) return cb(err)
19223
+ // If the parent of dest is not root, make sure it exists before proceeding
19224
+ const destParent = path.dirname(dest)
19225
+ const parsedParentPath = path.parse(destParent)
19226
+ if (parsedParentPath.root !== destParent) {
19227
+ await mkdirp(destParent)
19228
+ }
19453
19229
 
19454
- if (st.isDirectory() && isSrcSubdir(src, dest)) {
19455
- return cb(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`))
19456
- }
19457
- mkdirp(path.dirname(dest), err => {
19458
- if (err) return cb(err)
19459
- return doRename(src, dest, overwrite, cb)
19460
- })
19461
- })
19230
+ return doRename(src, dest, overwrite, isChangingCase)
19462
19231
  }
19463
19232
 
19464
- function doRename (src, dest, overwrite, cb) {
19465
- if (overwrite) {
19466
- return remove(dest, err => {
19467
- if (err) return cb(err)
19468
- return rename(src, dest, overwrite, cb)
19469
- })
19233
+ async function doRename (src, dest, overwrite, isChangingCase) {
19234
+ if (!isChangingCase) {
19235
+ if (overwrite) {
19236
+ await remove(dest)
19237
+ } else if (await pathExists(dest)) {
19238
+ throw new Error('dest already exists.')
19239
+ }
19470
19240
  }
19471
- pathExists(dest, (err, destExists) => {
19472
- if (err) return cb(err)
19473
- if (destExists) return cb(new Error('dest already exists.'))
19474
- return rename(src, dest, overwrite, cb)
19475
- })
19476
- }
19477
19241
 
19478
- function rename (src, dest, overwrite, cb) {
19479
- fs.rename(src, dest, err => {
19480
- if (!err) return cb()
19481
- if (err.code !== 'EXDEV') return cb(err)
19482
- return moveAcrossDevice(src, dest, overwrite, cb)
19483
- })
19242
+ try {
19243
+ // Try w/ rename first, and try copy + remove if EXDEV
19244
+ await fs.rename(src, dest)
19245
+ } catch (err) {
19246
+ if (err.code !== 'EXDEV') {
19247
+ throw err
19248
+ }
19249
+ await moveAcrossDevice(src, dest, overwrite)
19250
+ }
19484
19251
  }
19485
19252
 
19486
- function moveAcrossDevice (src, dest, overwrite, cb) {
19253
+ async function moveAcrossDevice (src, dest, overwrite) {
19487
19254
  const opts = {
19488
19255
  overwrite,
19489
- errorOnExist: true
19256
+ errorOnExist: true,
19257
+ preserveTimestamps: true
19490
19258
  }
19491
19259
 
19492
- copy(src, dest, opts, err => {
19493
- if (err) return cb(err)
19494
- return remove(src, cb)
19495
- })
19496
- }
19497
-
19498
- function isSrcSubdir (src, dest) {
19499
- const srcArray = src.split(path.sep)
19500
- const destArray = dest.split(path.sep)
19501
-
19502
- return srcArray.reduce((acc, current, i) => {
19503
- return acc && destArray[i] === current
19504
- }, true)
19260
+ await copy(src, dest, opts)
19261
+ return remove(src)
19505
19262
  }
19506
19263
 
19507
- module.exports = {
19508
- move: u(move)
19509
- }
19264
+ module.exports = move
19510
19265
 
19511
19266
 
19512
19267
  /***/ }),
19513
19268
 
19514
- /***/ 168123:
19515
- /*!*************************************************************************************************************!*\
19516
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/output/index.js ***!
19517
- \*************************************************************************************************************/
19269
+ /***/ 732271:
19270
+ /*!*******************************************************************************************************************!*\
19271
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/output-file/index.js ***!
19272
+ \*******************************************************************************************************************/
19518
19273
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19519
19274
 
19520
19275
  "use strict";
19521
19276
 
19522
19277
 
19523
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
19524
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
19278
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
19279
+ const fs = __webpack_require__(/*! ../fs */ 965808)
19525
19280
  const path = __webpack_require__(/*! path */ 16928)
19526
- const mkdir = __webpack_require__(/*! ../mkdirs */ 679918)
19527
- const pathExists = (__webpack_require__(/*! ../path-exists */ 8032).pathExists)
19528
-
19529
- function outputFile (file, data, encoding, callback) {
19530
- if (typeof encoding === 'function') {
19531
- callback = encoding
19532
- encoding = 'utf8'
19533
- }
19281
+ const mkdir = __webpack_require__(/*! ../mkdirs */ 595531)
19282
+ const pathExists = (__webpack_require__(/*! ../path-exists */ 576755).pathExists)
19534
19283
 
19284
+ async function outputFile (file, data, encoding = 'utf-8') {
19535
19285
  const dir = path.dirname(file)
19536
- pathExists(dir, (err, itDoes) => {
19537
- if (err) return callback(err)
19538
- if (itDoes) return fs.writeFile(file, data, encoding, callback)
19539
19286
 
19540
- mkdir.mkdirs(dir, err => {
19541
- if (err) return callback(err)
19287
+ if (!(await pathExists(dir))) {
19288
+ await mkdir.mkdirs(dir)
19289
+ }
19542
19290
 
19543
- fs.writeFile(file, data, encoding, callback)
19544
- })
19545
- })
19291
+ return fs.writeFile(file, data, encoding)
19546
19292
  }
19547
19293
 
19548
19294
  function outputFileSync (file, ...args) {
19549
19295
  const dir = path.dirname(file)
19550
- if (fs.existsSync(dir)) {
19551
- return fs.writeFileSync(file, ...args)
19296
+ if (!fs.existsSync(dir)) {
19297
+ mkdir.mkdirsSync(dir)
19552
19298
  }
19553
- mkdir.mkdirsSync(dir)
19299
+
19554
19300
  fs.writeFileSync(file, ...args)
19555
19301
  }
19556
19302
 
@@ -19562,16 +19308,16 @@ module.exports = {
19562
19308
 
19563
19309
  /***/ }),
19564
19310
 
19565
- /***/ 8032:
19566
- /*!******************************************************************************************************************!*\
19567
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/path-exists/index.js ***!
19568
- \******************************************************************************************************************/
19311
+ /***/ 576755:
19312
+ /*!*******************************************************************************************************************!*\
19313
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/path-exists/index.js ***!
19314
+ \*******************************************************************************************************************/
19569
19315
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19570
19316
 
19571
19317
  "use strict";
19572
19318
 
19573
- const u = (__webpack_require__(/*! universalify */ 698054).fromPromise)
19574
- const fs = __webpack_require__(/*! ../fs */ 278425)
19319
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
19320
+ const fs = __webpack_require__(/*! ../fs */ 965808)
19575
19321
 
19576
19322
  function pathExists (path) {
19577
19323
  return fs.access(path).then(() => true).catch(() => false)
@@ -19585,445 +19331,234 @@ module.exports = {
19585
19331
 
19586
19332
  /***/ }),
19587
19333
 
19588
- /***/ 119398:
19589
- /*!*************************************************************************************************************!*\
19590
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/remove/index.js ***!
19591
- \*************************************************************************************************************/
19334
+ /***/ 922127:
19335
+ /*!**************************************************************************************************************!*\
19336
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/remove/index.js ***!
19337
+ \**************************************************************************************************************/
19592
19338
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19593
19339
 
19594
19340
  "use strict";
19595
19341
 
19596
19342
 
19597
- const u = (__webpack_require__(/*! universalify */ 698054).fromCallback)
19598
- const rimraf = __webpack_require__(/*! ./rimraf */ 608937)
19343
+ const fs = __webpack_require__(/*! graceful-fs */ 764420)
19344
+ const u = (__webpack_require__(/*! universalify */ 458178).fromCallback)
19345
+
19346
+ function remove (path, callback) {
19347
+ fs.rm(path, { recursive: true, force: true }, callback)
19348
+ }
19349
+
19350
+ function removeSync (path) {
19351
+ fs.rmSync(path, { recursive: true, force: true })
19352
+ }
19599
19353
 
19600
19354
  module.exports = {
19601
- remove: u(rimraf),
19602
- removeSync: rimraf.sync
19355
+ remove: u(remove),
19356
+ removeSync
19603
19357
  }
19604
19358
 
19605
19359
 
19606
19360
  /***/ }),
19607
19361
 
19608
- /***/ 608937:
19609
- /*!**************************************************************************************************************!*\
19610
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/remove/rimraf.js ***!
19611
- \**************************************************************************************************************/
19362
+ /***/ 536793:
19363
+ /*!***********************************************************************************************************!*\
19364
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/stat.js ***!
19365
+ \***********************************************************************************************************/
19612
19366
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19613
19367
 
19614
19368
  "use strict";
19615
19369
 
19616
19370
 
19617
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
19371
+ const fs = __webpack_require__(/*! ../fs */ 965808)
19618
19372
  const path = __webpack_require__(/*! path */ 16928)
19619
- const assert = __webpack_require__(/*! assert */ 442613)
19620
-
19621
- const isWindows = (process.platform === 'win32')
19622
-
19623
- function defaults (options) {
19624
- const methods = [
19625
- 'unlink',
19626
- 'chmod',
19627
- 'stat',
19628
- 'lstat',
19629
- 'rmdir',
19630
- 'readdir'
19631
- ]
19632
- methods.forEach(m => {
19633
- options[m] = options[m] || fs[m]
19634
- m = m + 'Sync'
19635
- options[m] = options[m] || fs[m]
19636
- })
19637
-
19638
- options.maxBusyTries = options.maxBusyTries || 3
19373
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
19374
+
19375
+ function getStats (src, dest, opts) {
19376
+ const statFunc = opts.dereference
19377
+ ? (file) => fs.stat(file, { bigint: true })
19378
+ : (file) => fs.lstat(file, { bigint: true })
19379
+ return Promise.all([
19380
+ statFunc(src),
19381
+ statFunc(dest).catch(err => {
19382
+ if (err.code === 'ENOENT') return null
19383
+ throw err
19384
+ })
19385
+ ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))
19639
19386
  }
19640
19387
 
19641
- function rimraf (p, options, cb) {
19642
- let busyTries = 0
19643
-
19644
- if (typeof options === 'function') {
19645
- cb = options
19646
- options = {}
19388
+ function getStatsSync (src, dest, opts) {
19389
+ let destStat
19390
+ const statFunc = opts.dereference
19391
+ ? (file) => fs.statSync(file, { bigint: true })
19392
+ : (file) => fs.lstatSync(file, { bigint: true })
19393
+ const srcStat = statFunc(src)
19394
+ try {
19395
+ destStat = statFunc(dest)
19396
+ } catch (err) {
19397
+ if (err.code === 'ENOENT') return { srcStat, destStat: null }
19398
+ throw err
19647
19399
  }
19648
-
19649
- assert(p, 'rimraf: missing path')
19650
- assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')
19651
- assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')
19652
- assert(options, 'rimraf: invalid options argument provided')
19653
- assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')
19654
-
19655
- defaults(options)
19656
-
19657
- rimraf_(p, options, function CB (er) {
19658
- if (er) {
19659
- if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&
19660
- busyTries < options.maxBusyTries) {
19661
- busyTries++
19662
- const time = busyTries * 100
19663
- // try again, with the same exact callback as this one.
19664
- return setTimeout(() => rimraf_(p, options, CB), time)
19665
- }
19666
-
19667
- // already gone
19668
- if (er.code === 'ENOENT') er = null
19669
- }
19670
-
19671
- cb(er)
19672
- })
19400
+ return { srcStat, destStat }
19673
19401
  }
19674
19402
 
19675
- // Two possible strategies.
19676
- // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
19677
- // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
19678
- //
19679
- // Both result in an extra syscall when you guess wrong. However, there
19680
- // are likely far more normal files in the world than directories. This
19681
- // is based on the assumption that a the average number of files per
19682
- // directory is >= 1.
19683
- //
19684
- // If anyone ever complains about this, then I guess the strategy could
19685
- // be made configurable somehow. But until then, YAGNI.
19686
- function rimraf_ (p, options, cb) {
19687
- assert(p)
19688
- assert(options)
19689
- assert(typeof cb === 'function')
19690
-
19691
- // sunos lets the root user unlink directories, which is... weird.
19692
- // so we have to lstat here and make sure it's not a dir.
19693
- options.lstat(p, (er, st) => {
19694
- if (er && er.code === 'ENOENT') {
19695
- return cb(null)
19403
+ async function checkPaths (src, dest, funcName, opts) {
19404
+ const { srcStat, destStat } = await getStats(src, dest, opts)
19405
+ if (destStat) {
19406
+ if (areIdentical(srcStat, destStat)) {
19407
+ const srcBaseName = path.basename(src)
19408
+ const destBaseName = path.basename(dest)
19409
+ if (funcName === 'move' &&
19410
+ srcBaseName !== destBaseName &&
19411
+ srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
19412
+ return { srcStat, destStat, isChangingCase: true }
19413
+ }
19414
+ throw new Error('Source and destination must not be the same.')
19696
19415
  }
19697
-
19698
- // Windows can EPERM on stat. Life is suffering.
19699
- if (er && er.code === 'EPERM' && isWindows) {
19700
- return fixWinEPERM(p, options, er, cb)
19416
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
19417
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
19701
19418
  }
19702
-
19703
- if (st && st.isDirectory()) {
19704
- return rmdir(p, options, er, cb)
19419
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
19420
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
19705
19421
  }
19422
+ }
19706
19423
 
19707
- options.unlink(p, er => {
19708
- if (er) {
19709
- if (er.code === 'ENOENT') {
19710
- return cb(null)
19711
- }
19712
- if (er.code === 'EPERM') {
19713
- return (isWindows)
19714
- ? fixWinEPERM(p, options, er, cb)
19715
- : rmdir(p, options, er, cb)
19716
- }
19717
- if (er.code === 'EISDIR') {
19718
- return rmdir(p, options, er, cb)
19719
- }
19720
- }
19721
- return cb(er)
19722
- })
19723
- })
19724
- }
19725
-
19726
- function fixWinEPERM (p, options, er, cb) {
19727
- assert(p)
19728
- assert(options)
19729
- assert(typeof cb === 'function')
19730
- if (er) {
19731
- assert(er instanceof Error)
19424
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
19425
+ throw new Error(errMsg(src, dest, funcName))
19732
19426
  }
19733
19427
 
19734
- options.chmod(p, 0o666, er2 => {
19735
- if (er2) {
19736
- cb(er2.code === 'ENOENT' ? null : er)
19737
- } else {
19738
- options.stat(p, (er3, stats) => {
19739
- if (er3) {
19740
- cb(er3.code === 'ENOENT' ? null : er)
19741
- } else if (stats.isDirectory()) {
19742
- rmdir(p, options, er, cb)
19743
- } else {
19744
- options.unlink(p, cb)
19745
- }
19746
- })
19747
- }
19748
- })
19428
+ return { srcStat, destStat }
19749
19429
  }
19750
19430
 
19751
- function fixWinEPERMSync (p, options, er) {
19752
- let stats
19753
-
19754
- assert(p)
19755
- assert(options)
19756
- if (er) {
19757
- assert(er instanceof Error)
19758
- }
19431
+ function checkPathsSync (src, dest, funcName, opts) {
19432
+ const { srcStat, destStat } = getStatsSync(src, dest, opts)
19759
19433
 
19760
- try {
19761
- options.chmodSync(p, 0o666)
19762
- } catch (er2) {
19763
- if (er2.code === 'ENOENT') {
19764
- return
19765
- } else {
19766
- throw er
19434
+ if (destStat) {
19435
+ if (areIdentical(srcStat, destStat)) {
19436
+ const srcBaseName = path.basename(src)
19437
+ const destBaseName = path.basename(dest)
19438
+ if (funcName === 'move' &&
19439
+ srcBaseName !== destBaseName &&
19440
+ srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
19441
+ return { srcStat, destStat, isChangingCase: true }
19442
+ }
19443
+ throw new Error('Source and destination must not be the same.')
19767
19444
  }
19768
- }
19769
-
19770
- try {
19771
- stats = options.statSync(p)
19772
- } catch (er3) {
19773
- if (er3.code === 'ENOENT') {
19774
- return
19775
- } else {
19776
- throw er
19445
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
19446
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
19447
+ }
19448
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
19449
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
19777
19450
  }
19778
19451
  }
19779
19452
 
19780
- if (stats.isDirectory()) {
19781
- rmdirSync(p, options, er)
19782
- } else {
19783
- options.unlinkSync(p)
19784
- }
19785
- }
19786
-
19787
- function rmdir (p, options, originalEr, cb) {
19788
- assert(p)
19789
- assert(options)
19790
- if (originalEr) {
19791
- assert(originalEr instanceof Error)
19453
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
19454
+ throw new Error(errMsg(src, dest, funcName))
19792
19455
  }
19793
- assert(typeof cb === 'function')
19794
-
19795
- // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
19796
- // if we guessed wrong, and it's not a directory, then
19797
- // raise the original error.
19798
- options.rmdir(p, er => {
19799
- if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {
19800
- rmkids(p, options, cb)
19801
- } else if (er && er.code === 'ENOTDIR') {
19802
- cb(originalEr)
19803
- } else {
19804
- cb(er)
19805
- }
19806
- })
19807
- }
19808
-
19809
- function rmkids (p, options, cb) {
19810
- assert(p)
19811
- assert(options)
19812
- assert(typeof cb === 'function')
19813
-
19814
- options.readdir(p, (er, files) => {
19815
- if (er) return cb(er)
19816
-
19817
- let n = files.length
19818
- let errState
19819
-
19820
- if (n === 0) return options.rmdir(p, cb)
19821
-
19822
- files.forEach(f => {
19823
- rimraf(path.join(p, f), options, er => {
19824
- if (errState) {
19825
- return
19826
- }
19827
- if (er) return cb(errState = er)
19828
- if (--n === 0) {
19829
- options.rmdir(p, cb)
19830
- }
19831
- })
19832
- })
19833
- })
19456
+ return { srcStat, destStat }
19834
19457
  }
19835
19458
 
19836
- // this looks simpler, and is strictly *faster*, but will
19837
- // tie up the JavaScript thread and fail on excessively
19838
- // deep directory trees.
19839
- function rimrafSync (p, options) {
19840
- let st
19841
-
19842
- options = options || {}
19843
- defaults(options)
19844
-
19845
- assert(p, 'rimraf: missing path')
19846
- assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')
19847
- assert(options, 'rimraf: missing options')
19848
- assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')
19459
+ // recursively check if dest parent is a subdirectory of src.
19460
+ // It works for all file types including symlinks since it
19461
+ // checks the src and dest inodes. It starts from the deepest
19462
+ // parent and stops once it reaches the src parent or the root path.
19463
+ async function checkParentPaths (src, srcStat, dest, funcName) {
19464
+ const srcParent = path.resolve(path.dirname(src))
19465
+ const destParent = path.resolve(path.dirname(dest))
19466
+ if (destParent === srcParent || destParent === path.parse(destParent).root) return
19849
19467
 
19468
+ let destStat
19850
19469
  try {
19851
- st = options.lstatSync(p)
19852
- } catch (er) {
19853
- if (er.code === 'ENOENT') {
19854
- return
19855
- }
19856
-
19857
- // Windows can EPERM on stat. Life is suffering.
19858
- if (er.code === 'EPERM' && isWindows) {
19859
- fixWinEPERMSync(p, options, er)
19860
- }
19470
+ destStat = await fs.stat(destParent, { bigint: true })
19471
+ } catch (err) {
19472
+ if (err.code === 'ENOENT') return
19473
+ throw err
19861
19474
  }
19862
19475
 
19863
- try {
19864
- // sunos lets the root user unlink directories, which is... weird.
19865
- if (st && st.isDirectory()) {
19866
- rmdirSync(p, options, null)
19867
- } else {
19868
- options.unlinkSync(p)
19869
- }
19870
- } catch (er) {
19871
- if (er.code === 'ENOENT') {
19872
- return
19873
- } else if (er.code === 'EPERM') {
19874
- return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
19875
- } else if (er.code !== 'EISDIR') {
19876
- throw er
19877
- }
19878
- rmdirSync(p, options, er)
19476
+ if (areIdentical(srcStat, destStat)) {
19477
+ throw new Error(errMsg(src, dest, funcName))
19879
19478
  }
19880
- }
19881
19479
 
19882
- function rmdirSync (p, options, originalEr) {
19883
- assert(p)
19884
- assert(options)
19885
- if (originalEr) {
19886
- assert(originalEr instanceof Error)
19887
- }
19480
+ return checkParentPaths(src, srcStat, destParent, funcName)
19481
+ }
19888
19482
 
19483
+ function checkParentPathsSync (src, srcStat, dest, funcName) {
19484
+ const srcParent = path.resolve(path.dirname(src))
19485
+ const destParent = path.resolve(path.dirname(dest))
19486
+ if (destParent === srcParent || destParent === path.parse(destParent).root) return
19487
+ let destStat
19889
19488
  try {
19890
- options.rmdirSync(p)
19891
- } catch (er) {
19892
- if (er.code === 'ENOTDIR') {
19893
- throw originalEr
19894
- } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {
19895
- rmkidsSync(p, options)
19896
- } else if (er.code !== 'ENOENT') {
19897
- throw er
19898
- }
19489
+ destStat = fs.statSync(destParent, { bigint: true })
19490
+ } catch (err) {
19491
+ if (err.code === 'ENOENT') return
19492
+ throw err
19899
19493
  }
19900
- }
19901
-
19902
- function rmkidsSync (p, options) {
19903
- assert(p)
19904
- assert(options)
19905
- options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))
19906
-
19907
- if (isWindows) {
19908
- // We only end up here once we got ENOTEMPTY at least once, and
19909
- // at this point, we are guaranteed to have removed all the kids.
19910
- // So, we know that it won't be ENOENT or ENOTDIR or anything else.
19911
- // try really hard to delete stuff on windows, because it has a
19912
- // PROFOUNDLY annoying habit of not closing handles promptly when
19913
- // files are deleted, resulting in spurious ENOTEMPTY errors.
19914
- const startTime = Date.now()
19915
- do {
19916
- try {
19917
- const ret = options.rmdirSync(p, options)
19918
- return ret
19919
- } catch (er) { }
19920
- } while (Date.now() - startTime < 500) // give up after 500ms
19921
- } else {
19922
- const ret = options.rmdirSync(p, options)
19923
- return ret
19494
+ if (areIdentical(srcStat, destStat)) {
19495
+ throw new Error(errMsg(src, dest, funcName))
19924
19496
  }
19497
+ return checkParentPathsSync(src, srcStat, destParent, funcName)
19925
19498
  }
19926
19499
 
19927
- module.exports = rimraf
19928
- rimraf.sync = rimrafSync
19929
-
19930
-
19931
- /***/ }),
19500
+ function areIdentical (srcStat, destStat) {
19501
+ return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev
19502
+ }
19932
19503
 
19933
- /***/ 985030:
19934
- /*!************************************************************************************************************!*\
19935
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/util/buffer.js ***!
19936
- \************************************************************************************************************/
19937
- /***/ ((module) => {
19504
+ // return true if dest is a subdir of src, otherwise false.
19505
+ // It only checks the path strings.
19506
+ function isSrcSubdir (src, dest) {
19507
+ const srcArr = path.resolve(src).split(path.sep).filter(i => i)
19508
+ const destArr = path.resolve(dest).split(path.sep).filter(i => i)
19509
+ return srcArr.every((cur, i) => destArr[i] === cur)
19510
+ }
19938
19511
 
19939
- "use strict";
19512
+ function errMsg (src, dest, funcName) {
19513
+ return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`
19514
+ }
19940
19515
 
19941
- /* eslint-disable node/no-deprecated-api */
19942
- module.exports = function (size) {
19943
- if (typeof Buffer.allocUnsafe === 'function') {
19944
- try {
19945
- return Buffer.allocUnsafe(size)
19946
- } catch (e) {
19947
- return new Buffer(size)
19948
- }
19949
- }
19950
- return new Buffer(size)
19516
+ module.exports = {
19517
+ // checkPaths
19518
+ checkPaths: u(checkPaths),
19519
+ checkPathsSync,
19520
+ // checkParent
19521
+ checkParentPaths: u(checkParentPaths),
19522
+ checkParentPathsSync,
19523
+ // Misc
19524
+ isSrcSubdir,
19525
+ areIdentical
19951
19526
  }
19952
19527
 
19953
19528
 
19954
19529
  /***/ }),
19955
19530
 
19956
- /***/ 557395:
19957
- /*!************************************************************************************************************!*\
19958
- !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@7.0.1/node_modules/fs-extra/lib/util/utimes.js ***!
19959
- \************************************************************************************************************/
19531
+ /***/ 59032:
19532
+ /*!*************************************************************************************************************!*\
19533
+ !*** ../../common/temp/default/node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/utimes.js ***!
19534
+ \*************************************************************************************************************/
19960
19535
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19961
19536
 
19962
19537
  "use strict";
19963
19538
 
19964
19539
 
19965
- const fs = __webpack_require__(/*! graceful-fs */ 764420)
19966
- const os = __webpack_require__(/*! os */ 370857)
19967
- const path = __webpack_require__(/*! path */ 16928)
19540
+ const fs = __webpack_require__(/*! ../fs */ 965808)
19541
+ const u = (__webpack_require__(/*! universalify */ 458178).fromPromise)
19968
19542
 
19969
- // HFS, ext{2,3}, FAT do not, Node.js v0.10 does not
19970
- function hasMillisResSync () {
19971
- let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2))
19972
- tmpfile = path.join(os.tmpdir(), tmpfile)
19973
-
19974
- // 550 millis past UNIX epoch
19975
- const d = new Date(1435410243862)
19976
- fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141')
19977
- const fd = fs.openSync(tmpfile, 'r+')
19978
- fs.futimesSync(fd, d, d)
19979
- fs.closeSync(fd)
19980
- return fs.statSync(tmpfile).mtime > 1435410243000
19981
- }
19982
-
19983
- function hasMillisRes (callback) {
19984
- let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2))
19985
- tmpfile = path.join(os.tmpdir(), tmpfile)
19986
-
19987
- // 550 millis past UNIX epoch
19988
- const d = new Date(1435410243862)
19989
- fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => {
19990
- if (err) return callback(err)
19991
- fs.open(tmpfile, 'r+', (err, fd) => {
19992
- if (err) return callback(err)
19993
- fs.futimes(fd, d, d, err => {
19994
- if (err) return callback(err)
19995
- fs.close(fd, err => {
19996
- if (err) return callback(err)
19997
- fs.stat(tmpfile, (err, stats) => {
19998
- if (err) return callback(err)
19999
- callback(null, stats.mtime > 1435410243000)
20000
- })
20001
- })
20002
- })
20003
- })
20004
- })
20005
- }
19543
+ async function utimesMillis (path, atime, mtime) {
19544
+ // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
19545
+ const fd = await fs.open(path, 'r+')
20006
19546
 
20007
- function timeRemoveMillis (timestamp) {
20008
- if (typeof timestamp === 'number') {
20009
- return Math.floor(timestamp / 1000) * 1000
20010
- } else if (timestamp instanceof Date) {
20011
- return new Date(Math.floor(timestamp.getTime() / 1000) * 1000)
20012
- } else {
20013
- throw new Error('fs-extra: timeRemoveMillis() unknown parameter type')
19547
+ let closeErr = null
19548
+
19549
+ try {
19550
+ await fs.futimes(fd, atime, mtime)
19551
+ } finally {
19552
+ try {
19553
+ await fs.close(fd)
19554
+ } catch (e) {
19555
+ closeErr = e
19556
+ }
20014
19557
  }
20015
- }
20016
19558
 
20017
- function utimesMillis (path, atime, mtime, callback) {
20018
- // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
20019
- fs.open(path, 'r+', (err, fd) => {
20020
- if (err) return callback(err)
20021
- fs.futimes(fd, atime, mtime, futimesErr => {
20022
- fs.close(fd, closeErr => {
20023
- if (callback) callback(futimesErr || closeErr)
20024
- })
20025
- })
20026
- })
19559
+ if (closeErr) {
19560
+ throw closeErr
19561
+ }
20027
19562
  }
20028
19563
 
20029
19564
  function utimesMillisSync (path, atime, mtime) {
@@ -20033,10 +19568,7 @@ function utimesMillisSync (path, atime, mtime) {
20033
19568
  }
20034
19569
 
20035
19570
  module.exports = {
20036
- hasMillisRes,
20037
- hasMillisResSync,
20038
- timeRemoveMillis,
20039
- utimesMillis,
19571
+ utimesMillis: u(utimesMillis),
20040
19572
  utimesMillisSync
20041
19573
  }
20042
19574
 
@@ -29698,78 +29230,67 @@ function escapeJsonPtr(str) {
29698
29230
 
29699
29231
  /***/ }),
29700
29232
 
29701
- /***/ 187035:
29233
+ /***/ 806498:
29702
29234
  /*!**************************************************************************************************!*\
29703
- !*** ../../common/temp/default/node_modules/.pnpm/jsonfile@4.0.0/node_modules/jsonfile/index.js ***!
29235
+ !*** ../../common/temp/default/node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js ***!
29704
29236
  \**************************************************************************************************/
29705
29237
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
29706
29238
 
29707
- var _fs
29239
+ let _fs
29708
29240
  try {
29709
29241
  _fs = __webpack_require__(/*! graceful-fs */ 764420)
29710
29242
  } catch (_) {
29711
29243
  _fs = __webpack_require__(/*! fs */ 179896)
29712
29244
  }
29245
+ const universalify = __webpack_require__(/*! universalify */ 458178)
29246
+ const { stringify, stripBom } = __webpack_require__(/*! ./utils */ 921731)
29713
29247
 
29714
- function readFile (file, options, callback) {
29715
- if (callback == null) {
29716
- callback = options
29717
- options = {}
29718
- }
29719
-
29248
+ async function _readFile (file, options = {}) {
29720
29249
  if (typeof options === 'string') {
29721
- options = {encoding: options}
29250
+ options = { encoding: options }
29722
29251
  }
29723
29252
 
29724
- options = options || {}
29725
- var fs = options.fs || _fs
29253
+ const fs = options.fs || _fs
29726
29254
 
29727
- var shouldThrow = true
29728
- if ('throws' in options) {
29729
- shouldThrow = options.throws
29730
- }
29255
+ const shouldThrow = 'throws' in options ? options.throws : true
29731
29256
 
29732
- fs.readFile(file, options, function (err, data) {
29733
- if (err) return callback(err)
29257
+ let data = await universalify.fromCallback(fs.readFile)(file, options)
29734
29258
 
29735
- data = stripBom(data)
29259
+ data = stripBom(data)
29736
29260
 
29737
- var obj
29738
- try {
29739
- obj = JSON.parse(data, options ? options.reviver : null)
29740
- } catch (err2) {
29741
- if (shouldThrow) {
29742
- err2.message = file + ': ' + err2.message
29743
- return callback(err2)
29744
- } else {
29745
- return callback(null, null)
29746
- }
29261
+ let obj
29262
+ try {
29263
+ obj = JSON.parse(data, options ? options.reviver : null)
29264
+ } catch (err) {
29265
+ if (shouldThrow) {
29266
+ err.message = `${file}: ${err.message}`
29267
+ throw err
29268
+ } else {
29269
+ return null
29747
29270
  }
29271
+ }
29748
29272
 
29749
- callback(null, obj)
29750
- })
29273
+ return obj
29751
29274
  }
29752
29275
 
29753
- function readFileSync (file, options) {
29754
- options = options || {}
29276
+ const readFile = universalify.fromPromise(_readFile)
29277
+
29278
+ function readFileSync (file, options = {}) {
29755
29279
  if (typeof options === 'string') {
29756
- options = {encoding: options}
29280
+ options = { encoding: options }
29757
29281
  }
29758
29282
 
29759
- var fs = options.fs || _fs
29283
+ const fs = options.fs || _fs
29760
29284
 
29761
- var shouldThrow = true
29762
- if ('throws' in options) {
29763
- shouldThrow = options.throws
29764
- }
29285
+ const shouldThrow = 'throws' in options ? options.throws : true
29765
29286
 
29766
29287
  try {
29767
- var content = fs.readFileSync(file, options)
29288
+ let content = fs.readFileSync(file, options)
29768
29289
  content = stripBom(content)
29769
29290
  return JSON.parse(content, options.reviver)
29770
29291
  } catch (err) {
29771
29292
  if (shouldThrow) {
29772
- err.message = file + ': ' + err.message
29293
+ err.message = `${file}: ${err.message}`
29773
29294
  throw err
29774
29295
  } else {
29775
29296
  return null
@@ -29777,67 +29298,56 @@ function readFileSync (file, options) {
29777
29298
  }
29778
29299
  }
29779
29300
 
29780
- function stringify (obj, options) {
29781
- var spaces
29782
- var EOL = '\n'
29783
- if (typeof options === 'object' && options !== null) {
29784
- if (options.spaces) {
29785
- spaces = options.spaces
29786
- }
29787
- if (options.EOL) {
29788
- EOL = options.EOL
29789
- }
29790
- }
29301
+ async function _writeFile (file, obj, options = {}) {
29302
+ const fs = options.fs || _fs
29791
29303
 
29792
- var str = JSON.stringify(obj, options ? options.replacer : null, spaces)
29304
+ const str = stringify(obj, options)
29793
29305
 
29794
- return str.replace(/\n/g, EOL) + EOL
29306
+ await universalify.fromCallback(fs.writeFile)(file, str, options)
29795
29307
  }
29796
29308
 
29797
- function writeFile (file, obj, options, callback) {
29798
- if (callback == null) {
29799
- callback = options
29800
- options = {}
29801
- }
29802
- options = options || {}
29803
- var fs = options.fs || _fs
29309
+ const writeFile = universalify.fromPromise(_writeFile)
29804
29310
 
29805
- var str = ''
29806
- try {
29807
- str = stringify(obj, options)
29808
- } catch (err) {
29809
- // Need to return whether a callback was passed or not
29810
- if (callback) callback(err, null)
29811
- return
29812
- }
29311
+ function writeFileSync (file, obj, options = {}) {
29312
+ const fs = options.fs || _fs
29813
29313
 
29814
- fs.writeFile(file, str, options, callback)
29314
+ const str = stringify(obj, options)
29315
+ // not sure if fs.writeFileSync returns anything, but just in case
29316
+ return fs.writeFileSync(file, str, options)
29815
29317
  }
29816
29318
 
29817
- function writeFileSync (file, obj, options) {
29818
- options = options || {}
29819
- var fs = options.fs || _fs
29319
+ const jsonfile = {
29320
+ readFile,
29321
+ readFileSync,
29322
+ writeFile,
29323
+ writeFileSync
29324
+ }
29820
29325
 
29821
- var str = stringify(obj, options)
29822
- // not sure if fs.writeFileSync returns anything, but just in case
29823
- return fs.writeFileSync(file, str, options)
29326
+ module.exports = jsonfile
29327
+
29328
+
29329
+ /***/ }),
29330
+
29331
+ /***/ 921731:
29332
+ /*!**************************************************************************************************!*\
29333
+ !*** ../../common/temp/default/node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js ***!
29334
+ \**************************************************************************************************/
29335
+ /***/ ((module) => {
29336
+
29337
+ function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) {
29338
+ const EOF = finalEOL ? EOL : ''
29339
+ const str = JSON.stringify(obj, replacer, spaces)
29340
+
29341
+ return str.replace(/\n/g, EOL) + EOF
29824
29342
  }
29825
29343
 
29826
29344
  function stripBom (content) {
29827
29345
  // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
29828
29346
  if (Buffer.isBuffer(content)) content = content.toString('utf8')
29829
- content = content.replace(/^\uFEFF/, '')
29830
- return content
29347
+ return content.replace(/^\uFEFF/, '')
29831
29348
  }
29832
29349
 
29833
- var jsonfile = {
29834
- readFile: readFile,
29835
- readFileSync: readFileSync,
29836
- writeFile: writeFile,
29837
- writeFileSync: writeFileSync
29838
- }
29839
-
29840
- module.exports = jsonfile
29350
+ module.exports = { stringify, stripBom }
29841
29351
 
29842
29352
 
29843
29353
  /***/ }),
@@ -55719,9 +55229,9 @@ module.exports = function typedarrayToBuffer (arr) {
55719
55229
 
55720
55230
  /***/ }),
55721
55231
 
55722
- /***/ 698054:
55232
+ /***/ 458178:
55723
55233
  /*!**********************************************************************************************************!*\
55724
- !*** ../../common/temp/default/node_modules/.pnpm/universalify@0.1.2/node_modules/universalify/index.js ***!
55234
+ !*** ../../common/temp/default/node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js ***!
55725
55235
  \**********************************************************************************************************/
55726
55236
  /***/ ((__unused_webpack_module, exports) => {
55727
55237
 
@@ -55729,26 +55239,25 @@ module.exports = function typedarrayToBuffer (arr) {
55729
55239
 
55730
55240
 
55731
55241
  exports.fromCallback = function (fn) {
55732
- return Object.defineProperty(function () {
55733
- if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments)
55242
+ return Object.defineProperty(function (...args) {
55243
+ if (typeof args[args.length - 1] === 'function') fn.apply(this, args)
55734
55244
  else {
55735
55245
  return new Promise((resolve, reject) => {
55736
- arguments[arguments.length] = (err, res) => {
55737
- if (err) return reject(err)
55738
- resolve(res)
55739
- }
55740
- arguments.length++
55741
- fn.apply(this, arguments)
55246
+ args.push((err, res) => (err != null) ? reject(err) : resolve(res))
55247
+ fn.apply(this, args)
55742
55248
  })
55743
55249
  }
55744
55250
  }, 'name', { value: fn.name })
55745
55251
  }
55746
55252
 
55747
55253
  exports.fromPromise = function (fn) {
55748
- return Object.defineProperty(function () {
55749
- const cb = arguments[arguments.length - 1]
55750
- if (typeof cb !== 'function') return fn.apply(this, arguments)
55751
- else fn.apply(this, arguments).then(r => cb(null, r), cb)
55254
+ return Object.defineProperty(function (...args) {
55255
+ const cb = args[args.length - 1]
55256
+ if (typeof cb !== 'function') return fn.apply(this, args)
55257
+ else {
55258
+ args.pop()
55259
+ fn.apply(this, args).then(r => cb(null, r), cb)
55260
+ }
55752
55261
  }, 'name', { value: fn.name })
55753
55262
  }
55754
55263
 
@@ -59547,7 +59056,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
59547
59056
  exports.FileSystem = exports.AlreadyExistsBehavior = void 0;
59548
59057
  const nodeJsPath = __importStar(__webpack_require__(/*! path */ 16928));
59549
59058
  const fs = __importStar(__webpack_require__(/*! fs */ 179896));
59550
- const fsx = __importStar(__webpack_require__(/*! fs-extra */ 240973));
59059
+ const fsx = __importStar(__webpack_require__(/*! fs-extra */ 665022));
59551
59060
  const Text_1 = __webpack_require__(/*! ./Text */ 426989);
59552
59061
  const PosixModeBits_1 = __webpack_require__(/*! ./PosixModeBits */ 332144);
59553
59062
  const LegacyAdapters_1 = __webpack_require__(/*! ./LegacyAdapters */ 906161);