@vercel/build-utils 2.12.3-canary.14 → 2.12.3-canary.18
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.
- package/dist/convert-runtime-to-plugin.d.ts +23 -0
- package/dist/convert-runtime-to-plugin.js +138 -0
- package/dist/fs/glob.js +2 -1
- package/dist/fs/normalize-path.d.ts +4 -0
- package/dist/fs/normalize-path.js +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +894 -827
- package/dist/lambda.d.ts +2 -1
- package/dist/lambda.js +6 -2
- package/dist/types.d.ts +1 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
@@ -8056,147 +8056,6 @@ function sync (path, options) {
|
|
8056
8056
|
}
|
8057
8057
|
|
8058
8058
|
|
8059
|
-
/***/ }),
|
8060
|
-
|
8061
|
-
/***/ 1215:
|
8062
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
8063
|
-
|
8064
|
-
var _fs
|
8065
|
-
try {
|
8066
|
-
_fs = __webpack_require__(552)
|
8067
|
-
} catch (_) {
|
8068
|
-
_fs = __webpack_require__(5747)
|
8069
|
-
}
|
8070
|
-
|
8071
|
-
function readFile (file, options, callback) {
|
8072
|
-
if (callback == null) {
|
8073
|
-
callback = options
|
8074
|
-
options = {}
|
8075
|
-
}
|
8076
|
-
|
8077
|
-
if (typeof options === 'string') {
|
8078
|
-
options = {encoding: options}
|
8079
|
-
}
|
8080
|
-
|
8081
|
-
options = options || {}
|
8082
|
-
var fs = options.fs || _fs
|
8083
|
-
|
8084
|
-
var shouldThrow = true
|
8085
|
-
if ('throws' in options) {
|
8086
|
-
shouldThrow = options.throws
|
8087
|
-
}
|
8088
|
-
|
8089
|
-
fs.readFile(file, options, function (err, data) {
|
8090
|
-
if (err) return callback(err)
|
8091
|
-
|
8092
|
-
data = stripBom(data)
|
8093
|
-
|
8094
|
-
var obj
|
8095
|
-
try {
|
8096
|
-
obj = JSON.parse(data, options ? options.reviver : null)
|
8097
|
-
} catch (err2) {
|
8098
|
-
if (shouldThrow) {
|
8099
|
-
err2.message = file + ': ' + err2.message
|
8100
|
-
return callback(err2)
|
8101
|
-
} else {
|
8102
|
-
return callback(null, null)
|
8103
|
-
}
|
8104
|
-
}
|
8105
|
-
|
8106
|
-
callback(null, obj)
|
8107
|
-
})
|
8108
|
-
}
|
8109
|
-
|
8110
|
-
function readFileSync (file, options) {
|
8111
|
-
options = options || {}
|
8112
|
-
if (typeof options === 'string') {
|
8113
|
-
options = {encoding: options}
|
8114
|
-
}
|
8115
|
-
|
8116
|
-
var fs = options.fs || _fs
|
8117
|
-
|
8118
|
-
var shouldThrow = true
|
8119
|
-
if ('throws' in options) {
|
8120
|
-
shouldThrow = options.throws
|
8121
|
-
}
|
8122
|
-
|
8123
|
-
try {
|
8124
|
-
var content = fs.readFileSync(file, options)
|
8125
|
-
content = stripBom(content)
|
8126
|
-
return JSON.parse(content, options.reviver)
|
8127
|
-
} catch (err) {
|
8128
|
-
if (shouldThrow) {
|
8129
|
-
err.message = file + ': ' + err.message
|
8130
|
-
throw err
|
8131
|
-
} else {
|
8132
|
-
return null
|
8133
|
-
}
|
8134
|
-
}
|
8135
|
-
}
|
8136
|
-
|
8137
|
-
function stringify (obj, options) {
|
8138
|
-
var spaces
|
8139
|
-
var EOL = '\n'
|
8140
|
-
if (typeof options === 'object' && options !== null) {
|
8141
|
-
if (options.spaces) {
|
8142
|
-
spaces = options.spaces
|
8143
|
-
}
|
8144
|
-
if (options.EOL) {
|
8145
|
-
EOL = options.EOL
|
8146
|
-
}
|
8147
|
-
}
|
8148
|
-
|
8149
|
-
var str = JSON.stringify(obj, options ? options.replacer : null, spaces)
|
8150
|
-
|
8151
|
-
return str.replace(/\n/g, EOL) + EOL
|
8152
|
-
}
|
8153
|
-
|
8154
|
-
function writeFile (file, obj, options, callback) {
|
8155
|
-
if (callback == null) {
|
8156
|
-
callback = options
|
8157
|
-
options = {}
|
8158
|
-
}
|
8159
|
-
options = options || {}
|
8160
|
-
var fs = options.fs || _fs
|
8161
|
-
|
8162
|
-
var str = ''
|
8163
|
-
try {
|
8164
|
-
str = stringify(obj, options)
|
8165
|
-
} catch (err) {
|
8166
|
-
// Need to return whether a callback was passed or not
|
8167
|
-
if (callback) callback(err, null)
|
8168
|
-
return
|
8169
|
-
}
|
8170
|
-
|
8171
|
-
fs.writeFile(file, str, options, callback)
|
8172
|
-
}
|
8173
|
-
|
8174
|
-
function writeFileSync (file, obj, options) {
|
8175
|
-
options = options || {}
|
8176
|
-
var fs = options.fs || _fs
|
8177
|
-
|
8178
|
-
var str = stringify(obj, options)
|
8179
|
-
// not sure if fs.writeFileSync returns anything, but just in case
|
8180
|
-
return fs.writeFileSync(file, str, options)
|
8181
|
-
}
|
8182
|
-
|
8183
|
-
function stripBom (content) {
|
8184
|
-
// we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
|
8185
|
-
if (Buffer.isBuffer(content)) content = content.toString('utf8')
|
8186
|
-
content = content.replace(/^\uFEFF/, '')
|
8187
|
-
return content
|
8188
|
-
}
|
8189
|
-
|
8190
|
-
var jsonfile = {
|
8191
|
-
readFile: readFile,
|
8192
|
-
readFileSync: readFileSync,
|
8193
|
-
writeFile: writeFile,
|
8194
|
-
writeFileSync: writeFileSync
|
8195
|
-
}
|
8196
|
-
|
8197
|
-
module.exports = jsonfile
|
8198
|
-
|
8199
|
-
|
8200
8059
|
/***/ }),
|
8201
8060
|
|
8202
8061
|
/***/ 9566:
|
@@ -14012,39 +13871,6 @@ SafeBuffer.allocUnsafeSlow = function (size) {
|
|
14012
13871
|
}
|
14013
13872
|
|
14014
13873
|
|
14015
|
-
/***/ }),
|
14016
|
-
|
14017
|
-
/***/ 2703:
|
14018
|
-
/***/ ((__unused_webpack_module, exports) => {
|
14019
|
-
|
14020
|
-
"use strict";
|
14021
|
-
|
14022
|
-
|
14023
|
-
exports.E = function (fn) {
|
14024
|
-
return Object.defineProperty(function () {
|
14025
|
-
if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments)
|
14026
|
-
else {
|
14027
|
-
return new Promise((resolve, reject) => {
|
14028
|
-
arguments[arguments.length] = (err, res) => {
|
14029
|
-
if (err) return reject(err)
|
14030
|
-
resolve(res)
|
14031
|
-
}
|
14032
|
-
arguments.length++
|
14033
|
-
fn.apply(this, arguments)
|
14034
|
-
})
|
14035
|
-
}
|
14036
|
-
}, 'name', { value: fn.name })
|
14037
|
-
}
|
14038
|
-
|
14039
|
-
exports.p = function (fn) {
|
14040
|
-
return Object.defineProperty(function () {
|
14041
|
-
const cb = arguments[arguments.length - 1]
|
14042
|
-
if (typeof cb !== 'function') return fn.apply(this, arguments)
|
14043
|
-
else fn.apply(this, arguments).then(r => cb(null, r), cb)
|
14044
|
-
}, 'name', { value: fn.name })
|
14045
|
-
}
|
14046
|
-
|
14047
|
-
|
14048
13874
|
/***/ }),
|
14049
13875
|
|
14050
13876
|
/***/ 9209:
|
@@ -16877,14 +16703,13 @@ module.exports = eos;
|
|
16877
16703
|
|
16878
16704
|
const fs = __webpack_require__(552)
|
16879
16705
|
const path = __webpack_require__(5622)
|
16880
|
-
const
|
16881
|
-
const
|
16882
|
-
|
16883
|
-
const notExist = Symbol('notExist')
|
16706
|
+
const mkdirsSync = __webpack_require__(9181).mkdirsSync
|
16707
|
+
const utimesMillisSync = __webpack_require__(8605).utimesMillisSync
|
16708
|
+
const stat = __webpack_require__(9783)
|
16884
16709
|
|
16885
16710
|
function copySync (src, dest, opts) {
|
16886
16711
|
if (typeof opts === 'function') {
|
16887
|
-
opts = {filter: opts}
|
16712
|
+
opts = { filter: opts }
|
16888
16713
|
}
|
16889
16714
|
|
16890
16715
|
opts = opts || {}
|
@@ -16897,13 +16722,16 @@ function copySync (src, dest, opts) {
|
|
16897
16722
|
see https://github.com/jprichardson/node-fs-extra/issues/269`)
|
16898
16723
|
}
|
16899
16724
|
|
16900
|
-
const destStat =
|
16725
|
+
const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
|
16726
|
+
stat.checkParentPathsSync(src, srcStat, dest, 'copy')
|
16727
|
+
return handleFilterAndCopy(destStat, src, dest, opts)
|
16728
|
+
}
|
16901
16729
|
|
16730
|
+
function handleFilterAndCopy (destStat, src, dest, opts) {
|
16902
16731
|
if (opts.filter && !opts.filter(src, dest)) return
|
16903
|
-
|
16904
16732
|
const destParent = path.dirname(dest)
|
16905
|
-
if (!fs.existsSync(destParent))
|
16906
|
-
return
|
16733
|
+
if (!fs.existsSync(destParent)) mkdirsSync(destParent)
|
16734
|
+
return getStats(destStat, src, dest, opts)
|
16907
16735
|
}
|
16908
16736
|
|
16909
16737
|
function startCopy (destStat, src, dest, opts) {
|
@@ -16920,10 +16748,13 @@ function getStats (destStat, src, dest, opts) {
|
|
16920
16748
|
srcStat.isCharacterDevice() ||
|
16921
16749
|
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
|
16922
16750
|
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
16751
|
+
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
|
16752
|
+
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
|
16753
|
+
throw new Error(`Unknown file: ${src}`)
|
16923
16754
|
}
|
16924
16755
|
|
16925
16756
|
function onFile (srcStat, destStat, src, dest, opts) {
|
16926
|
-
if (destStat
|
16757
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts)
|
16927
16758
|
return mayCopyFile(srcStat, src, dest, opts)
|
16928
16759
|
}
|
16929
16760
|
|
@@ -16937,49 +16768,48 @@ function mayCopyFile (srcStat, src, dest, opts) {
|
|
16937
16768
|
}
|
16938
16769
|
|
16939
16770
|
function copyFile (srcStat, src, dest, opts) {
|
16940
|
-
|
16941
|
-
|
16942
|
-
|
16943
|
-
if (opts.preserveTimestamps) {
|
16944
|
-
return utimesSync(dest, srcStat.atime, srcStat.mtime)
|
16945
|
-
}
|
16946
|
-
return
|
16947
|
-
}
|
16948
|
-
return copyFileFallback(srcStat, src, dest, opts)
|
16771
|
+
fs.copyFileSync(src, dest)
|
16772
|
+
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
|
16773
|
+
return setDestMode(dest, srcStat.mode)
|
16949
16774
|
}
|
16950
16775
|
|
16951
|
-
function
|
16952
|
-
|
16953
|
-
|
16776
|
+
function handleTimestamps (srcMode, src, dest) {
|
16777
|
+
// Make sure the file is writable before setting the timestamp
|
16778
|
+
// otherwise open fails with EPERM when invoked with 'r+'
|
16779
|
+
// (through utimes call)
|
16780
|
+
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
|
16781
|
+
return setDestTimestamps(src, dest)
|
16782
|
+
}
|
16954
16783
|
|
16955
|
-
|
16956
|
-
|
16957
|
-
|
16784
|
+
function fileIsNotWritable (srcMode) {
|
16785
|
+
return (srcMode & 0o200) === 0
|
16786
|
+
}
|
16958
16787
|
|
16959
|
-
|
16960
|
-
|
16961
|
-
|
16962
|
-
pos += bytesRead
|
16963
|
-
}
|
16788
|
+
function makeFileWritable (dest, srcMode) {
|
16789
|
+
return setDestMode(dest, srcMode | 0o200)
|
16790
|
+
}
|
16964
16791
|
|
16965
|
-
|
16792
|
+
function setDestMode (dest, srcMode) {
|
16793
|
+
return fs.chmodSync(dest, srcMode)
|
16794
|
+
}
|
16966
16795
|
|
16967
|
-
|
16968
|
-
|
16796
|
+
function setDestTimestamps (src, dest) {
|
16797
|
+
// The initial srcStat.atime cannot be trusted
|
16798
|
+
// because it is modified by the read(2) system call
|
16799
|
+
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
16800
|
+
const updatedSrcStat = fs.statSync(src)
|
16801
|
+
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
|
16969
16802
|
}
|
16970
16803
|
|
16971
16804
|
function onDir (srcStat, destStat, src, dest, opts) {
|
16972
|
-
if (destStat
|
16973
|
-
if (destStat && !destStat.isDirectory()) {
|
16974
|
-
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
|
16975
|
-
}
|
16805
|
+
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
|
16976
16806
|
return copyDir(src, dest, opts)
|
16977
16807
|
}
|
16978
16808
|
|
16979
|
-
function mkDirAndCopy (
|
16809
|
+
function mkDirAndCopy (srcMode, src, dest, opts) {
|
16980
16810
|
fs.mkdirSync(dest)
|
16981
16811
|
copyDir(src, dest, opts)
|
16982
|
-
return
|
16812
|
+
return setDestMode(dest, srcMode)
|
16983
16813
|
}
|
16984
16814
|
|
16985
16815
|
function copyDir (src, dest, opts) {
|
@@ -16989,18 +16819,17 @@ function copyDir (src, dest, opts) {
|
|
16989
16819
|
function copyDirItem (item, src, dest, opts) {
|
16990
16820
|
const srcItem = path.join(src, item)
|
16991
16821
|
const destItem = path.join(dest, item)
|
16992
|
-
const destStat =
|
16822
|
+
const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
|
16993
16823
|
return startCopy(destStat, srcItem, destItem, opts)
|
16994
16824
|
}
|
16995
16825
|
|
16996
16826
|
function onLink (destStat, src, dest, opts) {
|
16997
16827
|
let resolvedSrc = fs.readlinkSync(src)
|
16998
|
-
|
16999
16828
|
if (opts.dereference) {
|
17000
16829
|
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
17001
16830
|
}
|
17002
16831
|
|
17003
|
-
if (destStat
|
16832
|
+
if (!destStat) {
|
17004
16833
|
return fs.symlinkSync(resolvedSrc, dest)
|
17005
16834
|
} else {
|
17006
16835
|
let resolvedDest
|
@@ -17016,14 +16845,14 @@ function onLink (destStat, src, dest, opts) {
|
|
17016
16845
|
if (opts.dereference) {
|
17017
16846
|
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
17018
16847
|
}
|
17019
|
-
if (isSrcSubdir(resolvedSrc, resolvedDest)) {
|
16848
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
17020
16849
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
17021
16850
|
}
|
17022
16851
|
|
17023
16852
|
// prevent copy if src is a subdir of dest since unlinking
|
17024
16853
|
// dest in this case would result in removing src contents
|
17025
16854
|
// and therefore a broken symlink would be created.
|
17026
|
-
if (fs.statSync(dest).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) {
|
16855
|
+
if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
17027
16856
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
17028
16857
|
}
|
17029
16858
|
return copyLink(resolvedSrc, dest)
|
@@ -17035,36 +16864,6 @@ function copyLink (resolvedSrc, dest) {
|
|
17035
16864
|
return fs.symlinkSync(resolvedSrc, dest)
|
17036
16865
|
}
|
17037
16866
|
|
17038
|
-
// return true if dest is a subdir of src, otherwise false.
|
17039
|
-
function isSrcSubdir (src, dest) {
|
17040
|
-
const srcArray = path.resolve(src).split(path.sep)
|
17041
|
-
const destArray = path.resolve(dest).split(path.sep)
|
17042
|
-
return srcArray.reduce((acc, current, i) => acc && destArray[i] === current, true)
|
17043
|
-
}
|
17044
|
-
|
17045
|
-
function checkStats (src, dest) {
|
17046
|
-
const srcStat = fs.statSync(src)
|
17047
|
-
let destStat
|
17048
|
-
try {
|
17049
|
-
destStat = fs.statSync(dest)
|
17050
|
-
} catch (err) {
|
17051
|
-
if (err.code === 'ENOENT') return {srcStat, destStat: notExist}
|
17052
|
-
throw err
|
17053
|
-
}
|
17054
|
-
return {srcStat, destStat}
|
17055
|
-
}
|
17056
|
-
|
17057
|
-
function checkPaths (src, dest) {
|
17058
|
-
const {srcStat, destStat} = checkStats(src, dest)
|
17059
|
-
if (destStat.ino && destStat.ino === srcStat.ino) {
|
17060
|
-
throw new Error('Source and destination must not be the same.')
|
17061
|
-
}
|
17062
|
-
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
17063
|
-
throw new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`)
|
17064
|
-
}
|
17065
|
-
return destStat
|
17066
|
-
}
|
17067
|
-
|
17068
16867
|
module.exports = copySync
|
17069
16868
|
|
17070
16869
|
|
@@ -17091,18 +16890,17 @@ module.exports = {
|
|
17091
16890
|
|
17092
16891
|
const fs = __webpack_require__(552)
|
17093
16892
|
const path = __webpack_require__(5622)
|
17094
|
-
const
|
16893
|
+
const mkdirs = __webpack_require__(9181).mkdirs
|
17095
16894
|
const pathExists = __webpack_require__(5516).pathExists
|
17096
|
-
const
|
17097
|
-
|
17098
|
-
const notExist = Symbol('notExist')
|
16895
|
+
const utimesMillis = __webpack_require__(8605).utimesMillis
|
16896
|
+
const stat = __webpack_require__(9783)
|
17099
16897
|
|
17100
16898
|
function copy (src, dest, opts, cb) {
|
17101
16899
|
if (typeof opts === 'function' && !cb) {
|
17102
16900
|
cb = opts
|
17103
16901
|
opts = {}
|
17104
16902
|
} else if (typeof opts === 'function') {
|
17105
|
-
opts = {filter: opts}
|
16903
|
+
opts = { filter: opts }
|
17106
16904
|
}
|
17107
16905
|
|
17108
16906
|
cb = cb || function () {}
|
@@ -17117,10 +16915,14 @@ function copy (src, dest, opts, cb) {
|
|
17117
16915
|
see https://github.com/jprichardson/node-fs-extra/issues/269`)
|
17118
16916
|
}
|
17119
16917
|
|
17120
|
-
checkPaths(src, dest, (err,
|
16918
|
+
stat.checkPaths(src, dest, 'copy', opts, (err, stats) => {
|
17121
16919
|
if (err) return cb(err)
|
17122
|
-
|
17123
|
-
|
16920
|
+
const { srcStat, destStat } = stats
|
16921
|
+
stat.checkParentPaths(src, srcStat, dest, 'copy', err => {
|
16922
|
+
if (err) return cb(err)
|
16923
|
+
if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)
|
16924
|
+
return checkParentDir(destStat, src, dest, opts, cb)
|
16925
|
+
})
|
17124
16926
|
})
|
17125
16927
|
}
|
17126
16928
|
|
@@ -17128,20 +16930,17 @@ function checkParentDir (destStat, src, dest, opts, cb) {
|
|
17128
16930
|
const destParent = path.dirname(dest)
|
17129
16931
|
pathExists(destParent, (err, dirExists) => {
|
17130
16932
|
if (err) return cb(err)
|
17131
|
-
if (dirExists) return
|
17132
|
-
|
16933
|
+
if (dirExists) return getStats(destStat, src, dest, opts, cb)
|
16934
|
+
mkdirs(destParent, err => {
|
17133
16935
|
if (err) return cb(err)
|
17134
|
-
return
|
16936
|
+
return getStats(destStat, src, dest, opts, cb)
|
17135
16937
|
})
|
17136
16938
|
})
|
17137
16939
|
}
|
17138
16940
|
|
17139
16941
|
function handleFilter (onInclude, destStat, src, dest, opts, cb) {
|
17140
16942
|
Promise.resolve(opts.filter(src, dest)).then(include => {
|
17141
|
-
if (include)
|
17142
|
-
if (destStat) return onInclude(destStat, src, dest, opts, cb)
|
17143
|
-
return onInclude(src, dest, opts, cb)
|
17144
|
-
}
|
16943
|
+
if (include) return onInclude(destStat, src, dest, opts, cb)
|
17145
16944
|
return cb()
|
17146
16945
|
}, error => cb(error))
|
17147
16946
|
}
|
@@ -17161,11 +16960,14 @@ function getStats (destStat, src, dest, opts, cb) {
|
|
17161
16960
|
srcStat.isCharacterDevice() ||
|
17162
16961
|
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)
|
17163
16962
|
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)
|
16963
|
+
else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`))
|
16964
|
+
else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`))
|
16965
|
+
return cb(new Error(`Unknown file: ${src}`))
|
17164
16966
|
})
|
17165
16967
|
}
|
17166
16968
|
|
17167
16969
|
function onFile (srcStat, destStat, src, dest, opts, cb) {
|
17168
|
-
if (destStat
|
16970
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts, cb)
|
17169
16971
|
return mayCopyFile(srcStat, src, dest, opts, cb)
|
17170
16972
|
}
|
17171
16973
|
|
@@ -17181,49 +16983,66 @@ function mayCopyFile (srcStat, src, dest, opts, cb) {
|
|
17181
16983
|
}
|
17182
16984
|
|
17183
16985
|
function copyFile (srcStat, src, dest, opts, cb) {
|
17184
|
-
|
17185
|
-
|
16986
|
+
fs.copyFile(src, dest, err => {
|
16987
|
+
if (err) return cb(err)
|
16988
|
+
if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)
|
16989
|
+
return setDestMode(dest, srcStat.mode, cb)
|
16990
|
+
})
|
16991
|
+
}
|
16992
|
+
|
16993
|
+
function handleTimestampsAndMode (srcMode, src, dest, cb) {
|
16994
|
+
// Make sure the file is writable before setting the timestamp
|
16995
|
+
// otherwise open fails with EPERM when invoked with 'r+'
|
16996
|
+
// (through utimes call)
|
16997
|
+
if (fileIsNotWritable(srcMode)) {
|
16998
|
+
return makeFileWritable(dest, srcMode, err => {
|
17186
16999
|
if (err) return cb(err)
|
17187
|
-
return
|
17000
|
+
return setDestTimestampsAndMode(srcMode, src, dest, cb)
|
17188
17001
|
})
|
17189
17002
|
}
|
17190
|
-
return
|
17003
|
+
return setDestTimestampsAndMode(srcMode, src, dest, cb)
|
17004
|
+
}
|
17005
|
+
|
17006
|
+
function fileIsNotWritable (srcMode) {
|
17007
|
+
return (srcMode & 0o200) === 0
|
17008
|
+
}
|
17009
|
+
|
17010
|
+
function makeFileWritable (dest, srcMode, cb) {
|
17011
|
+
return setDestMode(dest, srcMode | 0o200, cb)
|
17191
17012
|
}
|
17192
17013
|
|
17193
|
-
function
|
17194
|
-
|
17195
|
-
|
17196
|
-
|
17197
|
-
ws.on('error', err => cb(err))
|
17198
|
-
.on('open', () => rs.pipe(ws))
|
17199
|
-
.once('close', () => setDestModeAndTimestamps(srcStat, dest, opts, cb))
|
17014
|
+
function setDestTimestampsAndMode (srcMode, src, dest, cb) {
|
17015
|
+
setDestTimestamps(src, dest, err => {
|
17016
|
+
if (err) return cb(err)
|
17017
|
+
return setDestMode(dest, srcMode, cb)
|
17200
17018
|
})
|
17201
17019
|
}
|
17202
17020
|
|
17203
|
-
function
|
17204
|
-
fs.chmod(dest,
|
17021
|
+
function setDestMode (dest, srcMode, cb) {
|
17022
|
+
return fs.chmod(dest, srcMode, cb)
|
17023
|
+
}
|
17024
|
+
|
17025
|
+
function setDestTimestamps (src, dest, cb) {
|
17026
|
+
// The initial srcStat.atime cannot be trusted
|
17027
|
+
// because it is modified by the read(2) system call
|
17028
|
+
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
17029
|
+
fs.stat(src, (err, updatedSrcStat) => {
|
17205
17030
|
if (err) return cb(err)
|
17206
|
-
|
17207
|
-
return utimes(dest, srcStat.atime, srcStat.mtime, cb)
|
17208
|
-
}
|
17209
|
-
return cb()
|
17031
|
+
return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)
|
17210
17032
|
})
|
17211
17033
|
}
|
17212
17034
|
|
17213
17035
|
function onDir (srcStat, destStat, src, dest, opts, cb) {
|
17214
|
-
if (destStat
|
17215
|
-
if (destStat && !destStat.isDirectory()) {
|
17216
|
-
return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))
|
17217
|
-
}
|
17036
|
+
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)
|
17218
17037
|
return copyDir(src, dest, opts, cb)
|
17219
17038
|
}
|
17220
17039
|
|
17221
|
-
function mkDirAndCopy (
|
17040
|
+
function mkDirAndCopy (srcMode, src, dest, opts, cb) {
|
17222
17041
|
fs.mkdir(dest, err => {
|
17223
17042
|
if (err) return cb(err)
|
17224
17043
|
copyDir(src, dest, opts, err => {
|
17225
17044
|
if (err) return cb(err)
|
17226
|
-
return
|
17045
|
+
return setDestMode(dest, srcMode, cb)
|
17227
17046
|
})
|
17228
17047
|
})
|
17229
17048
|
}
|
@@ -17244,8 +17063,9 @@ function copyDirItems (items, src, dest, opts, cb) {
|
|
17244
17063
|
function copyDirItem (items, item, src, dest, opts, cb) {
|
17245
17064
|
const srcItem = path.join(src, item)
|
17246
17065
|
const destItem = path.join(dest, item)
|
17247
|
-
checkPaths(srcItem, destItem, (err,
|
17066
|
+
stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => {
|
17248
17067
|
if (err) return cb(err)
|
17068
|
+
const { destStat } = stats
|
17249
17069
|
startCopy(destStat, srcItem, destItem, opts, err => {
|
17250
17070
|
if (err) return cb(err)
|
17251
17071
|
return copyDirItems(items, src, dest, opts, cb)
|
@@ -17256,12 +17076,11 @@ function copyDirItem (items, item, src, dest, opts, cb) {
|
|
17256
17076
|
function onLink (destStat, src, dest, opts, cb) {
|
17257
17077
|
fs.readlink(src, (err, resolvedSrc) => {
|
17258
17078
|
if (err) return cb(err)
|
17259
|
-
|
17260
17079
|
if (opts.dereference) {
|
17261
17080
|
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
17262
17081
|
}
|
17263
17082
|
|
17264
|
-
if (destStat
|
17083
|
+
if (!destStat) {
|
17265
17084
|
return fs.symlink(resolvedSrc, dest, cb)
|
17266
17085
|
} else {
|
17267
17086
|
fs.readlink(dest, (err, resolvedDest) => {
|
@@ -17275,14 +17094,14 @@ function onLink (destStat, src, dest, opts, cb) {
|
|
17275
17094
|
if (opts.dereference) {
|
17276
17095
|
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
17277
17096
|
}
|
17278
|
-
if (isSrcSubdir(resolvedSrc, resolvedDest)) {
|
17097
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
17279
17098
|
return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))
|
17280
17099
|
}
|
17281
17100
|
|
17282
17101
|
// do not copy if src is a subdir of dest since unlinking
|
17283
17102
|
// dest in this case would result in removing src contents
|
17284
17103
|
// and therefore a broken symlink would be created.
|
17285
|
-
if (destStat.isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) {
|
17104
|
+
if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
17286
17105
|
return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))
|
17287
17106
|
}
|
17288
17107
|
return copyLink(resolvedSrc, dest, cb)
|
@@ -17298,40 +17117,6 @@ function copyLink (resolvedSrc, dest, cb) {
|
|
17298
17117
|
})
|
17299
17118
|
}
|
17300
17119
|
|
17301
|
-
// return true if dest is a subdir of src, otherwise false.
|
17302
|
-
function isSrcSubdir (src, dest) {
|
17303
|
-
const srcArray = path.resolve(src).split(path.sep)
|
17304
|
-
const destArray = path.resolve(dest).split(path.sep)
|
17305
|
-
return srcArray.reduce((acc, current, i) => acc && destArray[i] === current, true)
|
17306
|
-
}
|
17307
|
-
|
17308
|
-
function checkStats (src, dest, cb) {
|
17309
|
-
fs.stat(src, (err, srcStat) => {
|
17310
|
-
if (err) return cb(err)
|
17311
|
-
fs.stat(dest, (err, destStat) => {
|
17312
|
-
if (err) {
|
17313
|
-
if (err.code === 'ENOENT') return cb(null, {srcStat, destStat: notExist})
|
17314
|
-
return cb(err)
|
17315
|
-
}
|
17316
|
-
return cb(null, {srcStat, destStat})
|
17317
|
-
})
|
17318
|
-
})
|
17319
|
-
}
|
17320
|
-
|
17321
|
-
function checkPaths (src, dest, cb) {
|
17322
|
-
checkStats(src, dest, (err, stats) => {
|
17323
|
-
if (err) return cb(err)
|
17324
|
-
const {srcStat, destStat} = stats
|
17325
|
-
if (destStat.ino && destStat.ino === srcStat.ino) {
|
17326
|
-
return cb(new Error('Source and destination must not be the same.'))
|
17327
|
-
}
|
17328
|
-
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
17329
|
-
return cb(new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`))
|
17330
|
-
}
|
17331
|
-
return cb(null, destStat)
|
17332
|
-
})
|
17333
|
-
}
|
17334
|
-
|
17335
17120
|
module.exports = copy
|
17336
17121
|
|
17337
17122
|
|
@@ -17343,7 +17128,7 @@ module.exports = copy
|
|
17343
17128
|
"use strict";
|
17344
17129
|
|
17345
17130
|
|
17346
|
-
const u = __webpack_require__(
|
17131
|
+
const u = __webpack_require__(7500).fromCallback
|
17347
17132
|
module.exports = {
|
17348
17133
|
copy: u(__webpack_require__(4487))
|
17349
17134
|
}
|
@@ -17357,37 +17142,28 @@ module.exports = {
|
|
17357
17142
|
"use strict";
|
17358
17143
|
|
17359
17144
|
|
17360
|
-
const u = __webpack_require__(
|
17361
|
-
const fs = __webpack_require__(
|
17145
|
+
const u = __webpack_require__(7500).fromPromise
|
17146
|
+
const fs = __webpack_require__(893)
|
17362
17147
|
const path = __webpack_require__(5622)
|
17363
17148
|
const mkdir = __webpack_require__(9181)
|
17364
17149
|
const remove = __webpack_require__(4879)
|
17365
17150
|
|
17366
|
-
const emptyDir = u(function emptyDir (dir
|
17367
|
-
|
17368
|
-
|
17369
|
-
|
17370
|
-
|
17371
|
-
|
17372
|
-
|
17373
|
-
deleteItem()
|
17151
|
+
const emptyDir = u(async function emptyDir (dir) {
|
17152
|
+
let items
|
17153
|
+
try {
|
17154
|
+
items = await fs.readdir(dir)
|
17155
|
+
} catch {
|
17156
|
+
return mkdir.mkdirs(dir)
|
17157
|
+
}
|
17374
17158
|
|
17375
|
-
|
17376
|
-
const item = items.pop()
|
17377
|
-
if (!item) return callback()
|
17378
|
-
remove.remove(item, err => {
|
17379
|
-
if (err) return callback(err)
|
17380
|
-
deleteItem()
|
17381
|
-
})
|
17382
|
-
}
|
17383
|
-
})
|
17159
|
+
return Promise.all(items.map(item => remove.remove(path.join(dir, item))))
|
17384
17160
|
})
|
17385
17161
|
|
17386
17162
|
function emptyDirSync (dir) {
|
17387
17163
|
let items
|
17388
17164
|
try {
|
17389
17165
|
items = fs.readdirSync(dir)
|
17390
|
-
} catch
|
17166
|
+
} catch {
|
17391
17167
|
return mkdir.mkdirsSync(dir)
|
17392
17168
|
}
|
17393
17169
|
|
@@ -17413,11 +17189,10 @@ module.exports = {
|
|
17413
17189
|
"use strict";
|
17414
17190
|
|
17415
17191
|
|
17416
|
-
const u = __webpack_require__(
|
17192
|
+
const u = __webpack_require__(7500).fromCallback
|
17417
17193
|
const path = __webpack_require__(5622)
|
17418
17194
|
const fs = __webpack_require__(552)
|
17419
17195
|
const mkdir = __webpack_require__(9181)
|
17420
|
-
const pathExists = __webpack_require__(5516).pathExists
|
17421
17196
|
|
17422
17197
|
function createFile (file, callback) {
|
17423
17198
|
function makeFile () {
|
@@ -17430,13 +17205,26 @@ function createFile (file, callback) {
|
|
17430
17205
|
fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
|
17431
17206
|
if (!err && stats.isFile()) return callback()
|
17432
17207
|
const dir = path.dirname(file)
|
17433
|
-
|
17434
|
-
if (err)
|
17435
|
-
|
17436
|
-
|
17437
|
-
|
17438
|
-
|
17439
|
-
|
17208
|
+
fs.stat(dir, (err, stats) => {
|
17209
|
+
if (err) {
|
17210
|
+
// if the directory doesn't exist, make it
|
17211
|
+
if (err.code === 'ENOENT') {
|
17212
|
+
return mkdir.mkdirs(dir, err => {
|
17213
|
+
if (err) return callback(err)
|
17214
|
+
makeFile()
|
17215
|
+
})
|
17216
|
+
}
|
17217
|
+
return callback(err)
|
17218
|
+
}
|
17219
|
+
|
17220
|
+
if (stats.isDirectory()) makeFile()
|
17221
|
+
else {
|
17222
|
+
// parent is not a directory
|
17223
|
+
// This is just to cause an internal ENOTDIR error to be thrown
|
17224
|
+
fs.readdir(dir, err => {
|
17225
|
+
if (err) return callback(err)
|
17226
|
+
})
|
17227
|
+
}
|
17440
17228
|
})
|
17441
17229
|
})
|
17442
17230
|
}
|
@@ -17445,12 +17233,20 @@ function createFileSync (file) {
|
|
17445
17233
|
let stats
|
17446
17234
|
try {
|
17447
17235
|
stats = fs.statSync(file)
|
17448
|
-
} catch
|
17236
|
+
} catch {}
|
17449
17237
|
if (stats && stats.isFile()) return
|
17450
17238
|
|
17451
17239
|
const dir = path.dirname(file)
|
17452
|
-
|
17453
|
-
|
17240
|
+
try {
|
17241
|
+
if (!fs.statSync(dir).isDirectory()) {
|
17242
|
+
// parent is not a directory
|
17243
|
+
// This is just to cause an internal ENOTDIR error to be thrown
|
17244
|
+
fs.readdirSync(dir)
|
17245
|
+
}
|
17246
|
+
} catch (err) {
|
17247
|
+
// If the stat call above failed because the directory doesn't exist, create it
|
17248
|
+
if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)
|
17249
|
+
else throw err
|
17454
17250
|
}
|
17455
17251
|
|
17456
17252
|
fs.writeFileSync(file, '')
|
@@ -17501,11 +17297,12 @@ module.exports = {
|
|
17501
17297
|
"use strict";
|
17502
17298
|
|
17503
17299
|
|
17504
|
-
const u = __webpack_require__(
|
17300
|
+
const u = __webpack_require__(7500).fromCallback
|
17505
17301
|
const path = __webpack_require__(5622)
|
17506
17302
|
const fs = __webpack_require__(552)
|
17507
17303
|
const mkdir = __webpack_require__(9181)
|
17508
17304
|
const pathExists = __webpack_require__(5516).pathExists
|
17305
|
+
const { areIdentical } = __webpack_require__(9783)
|
17509
17306
|
|
17510
17307
|
function createLink (srcpath, dstpath, callback) {
|
17511
17308
|
function makeLink (srcpath, dstpath) {
|
@@ -17515,14 +17312,13 @@ function createLink (srcpath, dstpath, callback) {
|
|
17515
17312
|
})
|
17516
17313
|
}
|
17517
17314
|
|
17518
|
-
|
17519
|
-
|
17520
|
-
if (destinationExists) return callback(null)
|
17521
|
-
fs.lstat(srcpath, (err) => {
|
17315
|
+
fs.lstat(dstpath, (_, dstStat) => {
|
17316
|
+
fs.lstat(srcpath, (err, srcStat) => {
|
17522
17317
|
if (err) {
|
17523
17318
|
err.message = err.message.replace('lstat', 'ensureLink')
|
17524
17319
|
return callback(err)
|
17525
17320
|
}
|
17321
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return callback(null)
|
17526
17322
|
|
17527
17323
|
const dir = path.dirname(dstpath)
|
17528
17324
|
pathExists(dir, (err, dirExists) => {
|
@@ -17538,11 +17334,14 @@ function createLink (srcpath, dstpath, callback) {
|
|
17538
17334
|
}
|
17539
17335
|
|
17540
17336
|
function createLinkSync (srcpath, dstpath) {
|
17541
|
-
|
17542
|
-
|
17337
|
+
let dstStat
|
17338
|
+
try {
|
17339
|
+
dstStat = fs.lstatSync(dstpath)
|
17340
|
+
} catch {}
|
17543
17341
|
|
17544
17342
|
try {
|
17545
|
-
fs.lstatSync(srcpath)
|
17343
|
+
const srcStat = fs.lstatSync(srcpath)
|
17344
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return
|
17546
17345
|
} catch (err) {
|
17547
17346
|
err.message = err.message.replace('lstat', 'ensureLink')
|
17548
17347
|
throw err
|
@@ -17604,8 +17403,8 @@ function symlinkPaths (srcpath, dstpath, callback) {
|
|
17604
17403
|
return callback(err)
|
17605
17404
|
}
|
17606
17405
|
return callback(null, {
|
17607
|
-
|
17608
|
-
|
17406
|
+
toCwd: srcpath,
|
17407
|
+
toDst: srcpath
|
17609
17408
|
})
|
17610
17409
|
})
|
17611
17410
|
} else {
|
@@ -17615,8 +17414,8 @@ function symlinkPaths (srcpath, dstpath, callback) {
|
|
17615
17414
|
if (err) return callback(err)
|
17616
17415
|
if (exists) {
|
17617
17416
|
return callback(null, {
|
17618
|
-
|
17619
|
-
|
17417
|
+
toCwd: relativeToDst,
|
17418
|
+
toDst: srcpath
|
17620
17419
|
})
|
17621
17420
|
} else {
|
17622
17421
|
return fs.lstat(srcpath, (err) => {
|
@@ -17625,8 +17424,8 @@ function symlinkPaths (srcpath, dstpath, callback) {
|
|
17625
17424
|
return callback(err)
|
17626
17425
|
}
|
17627
17426
|
return callback(null, {
|
17628
|
-
|
17629
|
-
|
17427
|
+
toCwd: srcpath,
|
17428
|
+
toDst: path.relative(dstdir, srcpath)
|
17630
17429
|
})
|
17631
17430
|
})
|
17632
17431
|
}
|
@@ -17640,8 +17439,8 @@ function symlinkPathsSync (srcpath, dstpath) {
|
|
17640
17439
|
exists = fs.existsSync(srcpath)
|
17641
17440
|
if (!exists) throw new Error('absolute srcpath does not exist')
|
17642
17441
|
return {
|
17643
|
-
|
17644
|
-
|
17442
|
+
toCwd: srcpath,
|
17443
|
+
toDst: srcpath
|
17645
17444
|
}
|
17646
17445
|
} else {
|
17647
17446
|
const dstdir = path.dirname(dstpath)
|
@@ -17649,15 +17448,15 @@ function symlinkPathsSync (srcpath, dstpath) {
|
|
17649
17448
|
exists = fs.existsSync(relativeToDst)
|
17650
17449
|
if (exists) {
|
17651
17450
|
return {
|
17652
|
-
|
17653
|
-
|
17451
|
+
toCwd: relativeToDst,
|
17452
|
+
toDst: srcpath
|
17654
17453
|
}
|
17655
17454
|
} else {
|
17656
17455
|
exists = fs.existsSync(srcpath)
|
17657
17456
|
if (!exists) throw new Error('relative srcpath does not exist')
|
17658
17457
|
return {
|
17659
|
-
|
17660
|
-
|
17458
|
+
toCwd: srcpath,
|
17459
|
+
toDst: path.relative(dstdir, srcpath)
|
17661
17460
|
}
|
17662
17461
|
}
|
17663
17462
|
}
|
@@ -17696,7 +17495,7 @@ function symlinkTypeSync (srcpath, type) {
|
|
17696
17495
|
if (type) return type
|
17697
17496
|
try {
|
17698
17497
|
stats = fs.lstatSync(srcpath)
|
17699
|
-
} catch
|
17498
|
+
} catch {
|
17700
17499
|
return 'file'
|
17701
17500
|
}
|
17702
17501
|
return (stats && stats.isDirectory()) ? 'dir' : 'file'
|
@@ -17716,9 +17515,9 @@ module.exports = {
|
|
17716
17515
|
"use strict";
|
17717
17516
|
|
17718
17517
|
|
17719
|
-
const u = __webpack_require__(
|
17518
|
+
const u = __webpack_require__(7500).fromCallback
|
17720
17519
|
const path = __webpack_require__(5622)
|
17721
|
-
const fs = __webpack_require__(
|
17520
|
+
const fs = __webpack_require__(893)
|
17722
17521
|
const _mkdirs = __webpack_require__(9181)
|
17723
17522
|
const mkdirs = _mkdirs.mkdirs
|
17724
17523
|
const mkdirsSync = _mkdirs.mkdirsSync
|
@@ -17733,26 +17532,38 @@ const symlinkTypeSync = _symlinkType.symlinkTypeSync
|
|
17733
17532
|
|
17734
17533
|
const pathExists = __webpack_require__(5516).pathExists
|
17735
17534
|
|
17535
|
+
const { areIdentical } = __webpack_require__(9783)
|
17536
|
+
|
17736
17537
|
function createSymlink (srcpath, dstpath, type, callback) {
|
17737
17538
|
callback = (typeof type === 'function') ? type : callback
|
17738
17539
|
type = (typeof type === 'function') ? false : type
|
17739
17540
|
|
17740
|
-
|
17541
|
+
fs.lstat(dstpath, (err, stats) => {
|
17542
|
+
if (!err && stats.isSymbolicLink()) {
|
17543
|
+
Promise.all([
|
17544
|
+
fs.stat(srcpath),
|
17545
|
+
fs.stat(dstpath)
|
17546
|
+
]).then(([srcStat, dstStat]) => {
|
17547
|
+
if (areIdentical(srcStat, dstStat)) return callback(null)
|
17548
|
+
_createSymlink(srcpath, dstpath, type, callback)
|
17549
|
+
})
|
17550
|
+
} else _createSymlink(srcpath, dstpath, type, callback)
|
17551
|
+
})
|
17552
|
+
}
|
17553
|
+
|
17554
|
+
function _createSymlink (srcpath, dstpath, type, callback) {
|
17555
|
+
symlinkPaths(srcpath, dstpath, (err, relative) => {
|
17741
17556
|
if (err) return callback(err)
|
17742
|
-
|
17743
|
-
|
17557
|
+
srcpath = relative.toDst
|
17558
|
+
symlinkType(relative.toCwd, type, (err, type) => {
|
17744
17559
|
if (err) return callback(err)
|
17745
|
-
|
17746
|
-
|
17560
|
+
const dir = path.dirname(dstpath)
|
17561
|
+
pathExists(dir, (err, dirExists) => {
|
17747
17562
|
if (err) return callback(err)
|
17748
|
-
|
17749
|
-
|
17563
|
+
if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)
|
17564
|
+
mkdirs(dir, err => {
|
17750
17565
|
if (err) return callback(err)
|
17751
|
-
|
17752
|
-
mkdirs(dir, err => {
|
17753
|
-
if (err) return callback(err)
|
17754
|
-
fs.symlink(srcpath, dstpath, type, callback)
|
17755
|
-
})
|
17566
|
+
fs.symlink(srcpath, dstpath, type, callback)
|
17756
17567
|
})
|
17757
17568
|
})
|
17758
17569
|
})
|
@@ -17760,8 +17571,15 @@ function createSymlink (srcpath, dstpath, type, callback) {
|
|
17760
17571
|
}
|
17761
17572
|
|
17762
17573
|
function createSymlinkSync (srcpath, dstpath, type) {
|
17763
|
-
|
17764
|
-
|
17574
|
+
let stats
|
17575
|
+
try {
|
17576
|
+
stats = fs.lstatSync(dstpath)
|
17577
|
+
} catch {}
|
17578
|
+
if (stats && stats.isSymbolicLink()) {
|
17579
|
+
const srcStat = fs.statSync(srcpath)
|
17580
|
+
const dstStat = fs.statSync(dstpath)
|
17581
|
+
if (areIdentical(srcStat, dstStat)) return
|
17582
|
+
}
|
17765
17583
|
|
17766
17584
|
const relative = symlinkPathsSync(srcpath, dstpath)
|
17767
17585
|
srcpath = relative.toDst
|
@@ -17788,7 +17606,7 @@ module.exports = {
|
|
17788
17606
|
|
17789
17607
|
// This is adapted from https://github.com/normalize/mz
|
17790
17608
|
// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
|
17791
|
-
const u = __webpack_require__(
|
17609
|
+
const u = __webpack_require__(7500).fromCallback
|
17792
17610
|
const fs = __webpack_require__(552)
|
17793
17611
|
|
17794
17612
|
const api = [
|
@@ -17805,18 +17623,20 @@ const api = [
|
|
17805
17623
|
'fsync',
|
17806
17624
|
'ftruncate',
|
17807
17625
|
'futimes',
|
17808
|
-
'lchown',
|
17809
17626
|
'lchmod',
|
17627
|
+
'lchown',
|
17810
17628
|
'link',
|
17811
17629
|
'lstat',
|
17812
17630
|
'mkdir',
|
17813
17631
|
'mkdtemp',
|
17814
17632
|
'open',
|
17815
|
-
'
|
17633
|
+
'opendir',
|
17816
17634
|
'readdir',
|
17635
|
+
'readFile',
|
17817
17636
|
'readlink',
|
17818
17637
|
'realpath',
|
17819
17638
|
'rename',
|
17639
|
+
'rm',
|
17820
17640
|
'rmdir',
|
17821
17641
|
'stat',
|
17822
17642
|
'symlink',
|
@@ -17826,26 +17646,20 @@ const api = [
|
|
17826
17646
|
'writeFile'
|
17827
17647
|
].filter(key => {
|
17828
17648
|
// Some commands are not available on some systems. Ex:
|
17829
|
-
// fs.
|
17830
|
-
// fs.
|
17649
|
+
// fs.opendir was added in Node.js v12.12.0
|
17650
|
+
// fs.rm was added in Node.js v14.14.0
|
17831
17651
|
// fs.lchown is not available on at least some Linux
|
17832
17652
|
return typeof fs[key] === 'function'
|
17833
17653
|
})
|
17834
17654
|
|
17835
|
-
// Export
|
17836
|
-
Object.
|
17837
|
-
if (key === 'promises') {
|
17838
|
-
// fs.promises is a getter property that triggers ExperimentalWarning
|
17839
|
-
// Don't re-export it here, the getter is defined in "lib/index.js"
|
17840
|
-
return
|
17841
|
-
}
|
17842
|
-
exports[key] = fs[key]
|
17843
|
-
})
|
17655
|
+
// Export cloned fs:
|
17656
|
+
Object.assign(exports, fs)
|
17844
17657
|
|
17845
17658
|
// Universalify async methods:
|
17846
17659
|
api.forEach(method => {
|
17847
17660
|
exports[method] = u(fs[method])
|
17848
17661
|
})
|
17662
|
+
exports.realpath.native = u(fs.realpath.native)
|
17849
17663
|
|
17850
17664
|
// We differ from mz/fs in that we still ship the old, broken, fs.exists()
|
17851
17665
|
// since we are a drop-in replacement for the native module
|
@@ -17858,7 +17672,7 @@ exports.exists = function (filename, callback) {
|
|
17858
17672
|
})
|
17859
17673
|
}
|
17860
17674
|
|
17861
|
-
// fs.read() & fs.
|
17675
|
+
// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args
|
17862
17676
|
|
17863
17677
|
exports.read = function (fd, buffer, offset, length, position, callback) {
|
17864
17678
|
if (typeof callback === 'function') {
|
@@ -17890,6 +17704,25 @@ exports.write = function (fd, buffer, ...args) {
|
|
17890
17704
|
})
|
17891
17705
|
}
|
17892
17706
|
|
17707
|
+
// fs.writev only available in Node v12.9.0+
|
17708
|
+
if (typeof fs.writev === 'function') {
|
17709
|
+
// Function signature is
|
17710
|
+
// s.writev(fd, buffers[, position], callback)
|
17711
|
+
// We need to handle the optional arg, so we use ...args
|
17712
|
+
exports.writev = function (fd, buffers, ...args) {
|
17713
|
+
if (typeof args[args.length - 1] === 'function') {
|
17714
|
+
return fs.writev(fd, buffers, ...args)
|
17715
|
+
}
|
17716
|
+
|
17717
|
+
return new Promise((resolve, reject) => {
|
17718
|
+
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
|
17719
|
+
if (err) return reject(err)
|
17720
|
+
resolve({ bytesWritten, buffers })
|
17721
|
+
})
|
17722
|
+
})
|
17723
|
+
}
|
17724
|
+
}
|
17725
|
+
|
17893
17726
|
|
17894
17727
|
/***/ }),
|
17895
17728
|
|
@@ -17899,31 +17732,21 @@ exports.write = function (fd, buffer, ...args) {
|
|
17899
17732
|
"use strict";
|
17900
17733
|
|
17901
17734
|
|
17902
|
-
module.exports =
|
17903
|
-
{},
|
17735
|
+
module.exports = {
|
17904
17736
|
// Export promiseified graceful-fs:
|
17905
|
-
__webpack_require__(893),
|
17737
|
+
...__webpack_require__(893),
|
17906
17738
|
// Export extra methods:
|
17907
|
-
__webpack_require__(9567),
|
17908
|
-
__webpack_require__(8852),
|
17909
|
-
__webpack_require__(2677),
|
17910
|
-
__webpack_require__(6004),
|
17911
|
-
__webpack_require__(3960),
|
17912
|
-
__webpack_require__(9181),
|
17913
|
-
__webpack_require__(4168),
|
17914
|
-
__webpack_require__(7819),
|
17915
|
-
__webpack_require__(3849),
|
17916
|
-
__webpack_require__(5516),
|
17917
|
-
__webpack_require__(4879)
|
17918
|
-
)
|
17919
|
-
|
17920
|
-
// Export fs.promises as a getter property so that we don't trigger
|
17921
|
-
// ExperimentalWarning before fs.promises is actually accessed.
|
17922
|
-
const fs = __webpack_require__(5747)
|
17923
|
-
if (Object.getOwnPropertyDescriptor(fs, 'promises')) {
|
17924
|
-
Object.defineProperty(module.exports, "promises", ({
|
17925
|
-
get () { return fs.promises }
|
17926
|
-
}))
|
17739
|
+
...__webpack_require__(9567),
|
17740
|
+
...__webpack_require__(8852),
|
17741
|
+
...__webpack_require__(2677),
|
17742
|
+
...__webpack_require__(6004),
|
17743
|
+
...__webpack_require__(3960),
|
17744
|
+
...__webpack_require__(9181),
|
17745
|
+
...__webpack_require__(4168),
|
17746
|
+
...__webpack_require__(7819),
|
17747
|
+
...__webpack_require__(3849),
|
17748
|
+
...__webpack_require__(5516),
|
17749
|
+
...__webpack_require__(4879)
|
17927
17750
|
}
|
17928
17751
|
|
17929
17752
|
|
@@ -17935,7 +17758,7 @@ if (Object.getOwnPropertyDescriptor(fs, 'promises')) {
|
|
17935
17758
|
"use strict";
|
17936
17759
|
|
17937
17760
|
|
17938
|
-
const u = __webpack_require__(
|
17761
|
+
const u = __webpack_require__(7500).fromPromise
|
17939
17762
|
const jsonFile = __webpack_require__(4003)
|
17940
17763
|
|
17941
17764
|
jsonFile.outputJson = u(__webpack_require__(7583))
|
@@ -17959,14 +17782,13 @@ module.exports = jsonFile
|
|
17959
17782
|
"use strict";
|
17960
17783
|
|
17961
17784
|
|
17962
|
-
const
|
17963
|
-
const jsonFile = __webpack_require__(1215)
|
17785
|
+
const jsonFile = __webpack_require__(4862)
|
17964
17786
|
|
17965
17787
|
module.exports = {
|
17966
17788
|
// jsonfile exports
|
17967
|
-
readJson:
|
17789
|
+
readJson: jsonFile.readFile,
|
17968
17790
|
readJsonSync: jsonFile.readFileSync,
|
17969
|
-
writeJson:
|
17791
|
+
writeJson: jsonFile.writeFile,
|
17970
17792
|
writeJsonSync: jsonFile.writeFileSync
|
17971
17793
|
}
|
17972
17794
|
|
@@ -17979,19 +17801,13 @@ module.exports = {
|
|
17979
17801
|
"use strict";
|
17980
17802
|
|
17981
17803
|
|
17982
|
-
const
|
17983
|
-
const
|
17984
|
-
const mkdir = __webpack_require__(9181)
|
17985
|
-
const jsonFile = __webpack_require__(4003)
|
17804
|
+
const { stringify } = __webpack_require__(7653)
|
17805
|
+
const { outputFileSync } = __webpack_require__(3849)
|
17986
17806
|
|
17987
17807
|
function outputJsonSync (file, data, options) {
|
17988
|
-
const
|
17808
|
+
const str = stringify(data, options)
|
17989
17809
|
|
17990
|
-
|
17991
|
-
mkdir.mkdirsSync(dir)
|
17992
|
-
}
|
17993
|
-
|
17994
|
-
jsonFile.writeJsonSync(file, data, options)
|
17810
|
+
outputFileSync(file, str, options)
|
17995
17811
|
}
|
17996
17812
|
|
17997
17813
|
module.exports = outputJsonSync
|
@@ -18005,28 +17821,13 @@ module.exports = outputJsonSync
|
|
18005
17821
|
"use strict";
|
18006
17822
|
|
18007
17823
|
|
18008
|
-
const
|
18009
|
-
const
|
18010
|
-
const pathExists = __webpack_require__(5516).pathExists
|
18011
|
-
const jsonFile = __webpack_require__(4003)
|
18012
|
-
|
18013
|
-
function outputJson (file, data, options, callback) {
|
18014
|
-
if (typeof options === 'function') {
|
18015
|
-
callback = options
|
18016
|
-
options = {}
|
18017
|
-
}
|
18018
|
-
|
18019
|
-
const dir = path.dirname(file)
|
17824
|
+
const { stringify } = __webpack_require__(7653)
|
17825
|
+
const { outputFile } = __webpack_require__(3849)
|
18020
17826
|
|
18021
|
-
|
18022
|
-
|
18023
|
-
if (itDoes) return jsonFile.writeJson(file, data, options, callback)
|
17827
|
+
async function outputJson (file, data, options = {}) {
|
17828
|
+
const str = stringify(data, options)
|
18024
17829
|
|
18025
|
-
|
18026
|
-
if (err) return callback(err)
|
18027
|
-
jsonFile.writeJson(file, data, options, callback)
|
18028
|
-
})
|
18029
|
-
})
|
17830
|
+
await outputFile(file, str, options)
|
18030
17831
|
}
|
18031
17832
|
|
18032
17833
|
module.exports = outputJson
|
@@ -18039,190 +17840,101 @@ module.exports = outputJson
|
|
18039
17840
|
|
18040
17841
|
"use strict";
|
18041
17842
|
|
18042
|
-
const u = __webpack_require__(
|
18043
|
-
const
|
18044
|
-
const
|
17843
|
+
const u = __webpack_require__(7500).fromPromise
|
17844
|
+
const { makeDir: _makeDir, makeDirSync } = __webpack_require__(511)
|
17845
|
+
const makeDir = u(_makeDir)
|
18045
17846
|
|
18046
17847
|
module.exports = {
|
18047
|
-
mkdirs,
|
18048
|
-
mkdirsSync,
|
17848
|
+
mkdirs: makeDir,
|
17849
|
+
mkdirsSync: makeDirSync,
|
18049
17850
|
// alias
|
18050
|
-
mkdirp:
|
18051
|
-
mkdirpSync:
|
18052
|
-
ensureDir:
|
18053
|
-
ensureDirSync:
|
17851
|
+
mkdirp: makeDir,
|
17852
|
+
mkdirpSync: makeDirSync,
|
17853
|
+
ensureDir: makeDir,
|
17854
|
+
ensureDirSync: makeDirSync
|
18054
17855
|
}
|
18055
17856
|
|
18056
17857
|
|
18057
17858
|
/***/ }),
|
18058
17859
|
|
18059
|
-
/***/
|
17860
|
+
/***/ 511:
|
18060
17861
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
18061
17862
|
|
18062
17863
|
"use strict";
|
18063
17864
|
|
17865
|
+
const fs = __webpack_require__(893)
|
17866
|
+
const { checkPath } = __webpack_require__(1176)
|
18064
17867
|
|
18065
|
-
const
|
18066
|
-
const
|
18067
|
-
|
18068
|
-
|
18069
|
-
|
18070
|
-
|
18071
|
-
function mkdirsSync (p, opts, made) {
|
18072
|
-
if (!opts || typeof opts !== 'object') {
|
18073
|
-
opts = { mode: opts }
|
18074
|
-
}
|
18075
|
-
|
18076
|
-
let mode = opts.mode
|
18077
|
-
const xfs = opts.fs || fs
|
18078
|
-
|
18079
|
-
if (process.platform === 'win32' && invalidWin32Path(p)) {
|
18080
|
-
const errInval = new Error(p + ' contains invalid WIN32 path characters.')
|
18081
|
-
errInval.code = 'EINVAL'
|
18082
|
-
throw errInval
|
18083
|
-
}
|
17868
|
+
const getMode = options => {
|
17869
|
+
const defaults = { mode: 0o777 }
|
17870
|
+
if (typeof options === 'number') return options
|
17871
|
+
return ({ ...defaults, ...options }).mode
|
17872
|
+
}
|
18084
17873
|
|
18085
|
-
|
18086
|
-
|
18087
|
-
}
|
18088
|
-
if (!made) made = null
|
17874
|
+
module.exports.makeDir = async (dir, options) => {
|
17875
|
+
checkPath(dir)
|
18089
17876
|
|
18090
|
-
|
17877
|
+
return fs.mkdir(dir, {
|
17878
|
+
mode: getMode(options),
|
17879
|
+
recursive: true
|
17880
|
+
})
|
17881
|
+
}
|
18091
17882
|
|
18092
|
-
|
18093
|
-
|
18094
|
-
made = made || p
|
18095
|
-
} catch (err0) {
|
18096
|
-
if (err0.code === 'ENOENT') {
|
18097
|
-
if (path.dirname(p) === p) throw err0
|
18098
|
-
made = mkdirsSync(path.dirname(p), opts, made)
|
18099
|
-
mkdirsSync(p, opts, made)
|
18100
|
-
} else {
|
18101
|
-
// In the case of any other error, just see if there's a dir there
|
18102
|
-
// already. If so, then hooray! If not, then something is borked.
|
18103
|
-
let stat
|
18104
|
-
try {
|
18105
|
-
stat = xfs.statSync(p)
|
18106
|
-
} catch (err1) {
|
18107
|
-
throw err0
|
18108
|
-
}
|
18109
|
-
if (!stat.isDirectory()) throw err0
|
18110
|
-
}
|
18111
|
-
}
|
17883
|
+
module.exports.makeDirSync = (dir, options) => {
|
17884
|
+
checkPath(dir)
|
18112
17885
|
|
18113
|
-
return
|
17886
|
+
return fs.mkdirSync(dir, {
|
17887
|
+
mode: getMode(options),
|
17888
|
+
recursive: true
|
17889
|
+
})
|
18114
17890
|
}
|
18115
17891
|
|
18116
|
-
module.exports = mkdirsSync
|
18117
|
-
|
18118
17892
|
|
18119
17893
|
/***/ }),
|
18120
17894
|
|
18121
|
-
/***/
|
17895
|
+
/***/ 1176:
|
18122
17896
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
18123
17897
|
|
18124
17898
|
"use strict";
|
17899
|
+
// Adapted from https://github.com/sindresorhus/make-dir
|
17900
|
+
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
17901
|
+
// 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:
|
17902
|
+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
17903
|
+
// 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.
|
18125
17904
|
|
18126
|
-
|
18127
|
-
const fs = __webpack_require__(552)
|
18128
17905
|
const path = __webpack_require__(5622)
|
18129
|
-
const invalidWin32Path = __webpack_require__(3727).invalidWin32Path
|
18130
|
-
|
18131
|
-
const o777 = parseInt('0777', 8)
|
18132
|
-
|
18133
|
-
function mkdirs (p, opts, callback, made) {
|
18134
|
-
if (typeof opts === 'function') {
|
18135
|
-
callback = opts
|
18136
|
-
opts = {}
|
18137
|
-
} else if (!opts || typeof opts !== 'object') {
|
18138
|
-
opts = { mode: opts }
|
18139
|
-
}
|
18140
|
-
|
18141
|
-
if (process.platform === 'win32' && invalidWin32Path(p)) {
|
18142
|
-
const errInval = new Error(p + ' contains invalid WIN32 path characters.')
|
18143
|
-
errInval.code = 'EINVAL'
|
18144
|
-
return callback(errInval)
|
18145
|
-
}
|
18146
|
-
|
18147
|
-
let mode = opts.mode
|
18148
|
-
const xfs = opts.fs || fs
|
18149
|
-
|
18150
|
-
if (mode === undefined) {
|
18151
|
-
mode = o777 & (~process.umask())
|
18152
|
-
}
|
18153
|
-
if (!made) made = null
|
18154
17906
|
|
18155
|
-
|
18156
|
-
|
17907
|
+
// https://github.com/nodejs/node/issues/8987
|
17908
|
+
// https://github.com/libuv/libuv/pull/1088
|
17909
|
+
module.exports.checkPath = function checkPath (pth) {
|
17910
|
+
if (process.platform === 'win32') {
|
17911
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''))
|
18157
17912
|
|
18158
|
-
|
18159
|
-
|
18160
|
-
|
18161
|
-
|
17913
|
+
if (pathHasInvalidWinCharacters) {
|
17914
|
+
const error = new Error(`Path contains invalid characters: ${pth}`)
|
17915
|
+
error.code = 'EINVAL'
|
17916
|
+
throw error
|
18162
17917
|
}
|
18163
|
-
|
18164
|
-
case 'ENOENT':
|
18165
|
-
if (path.dirname(p) === p) return callback(er)
|
18166
|
-
mkdirs(path.dirname(p), opts, (er, made) => {
|
18167
|
-
if (er) callback(er, made)
|
18168
|
-
else mkdirs(p, opts, callback, made)
|
18169
|
-
})
|
18170
|
-
break
|
18171
|
-
|
18172
|
-
// In the case of any other error, just see if there's a dir
|
18173
|
-
// there already. If so, then hooray! If not, then something
|
18174
|
-
// is borked.
|
18175
|
-
default:
|
18176
|
-
xfs.stat(p, (er2, stat) => {
|
18177
|
-
// if the stat fails, then that's super weird.
|
18178
|
-
// let the original error be the failure reason.
|
18179
|
-
if (er2 || !stat.isDirectory()) callback(er, made)
|
18180
|
-
else callback(null, made)
|
18181
|
-
})
|
18182
|
-
break
|
18183
|
-
}
|
18184
|
-
})
|
17918
|
+
}
|
18185
17919
|
}
|
18186
17920
|
|
18187
|
-
module.exports = mkdirs
|
18188
|
-
|
18189
17921
|
|
18190
17922
|
/***/ }),
|
18191
17923
|
|
18192
|
-
/***/
|
17924
|
+
/***/ 4168:
|
18193
17925
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
18194
17926
|
|
18195
17927
|
"use strict";
|
18196
17928
|
|
18197
17929
|
|
18198
|
-
const path = __webpack_require__(5622)
|
18199
|
-
|
18200
|
-
// get drive on windows
|
18201
|
-
function getRootPath (p) {
|
18202
|
-
p = path.normalize(path.resolve(p)).split(path.sep)
|
18203
|
-
if (p.length > 0) return p[0]
|
18204
|
-
return null
|
18205
|
-
}
|
18206
|
-
|
18207
|
-
// http://stackoverflow.com/a/62888/10333 contains more accurate
|
18208
|
-
// TODO: expand to include the rest
|
18209
|
-
const INVALID_PATH_CHARS = /[<>:"|?*]/
|
18210
|
-
|
18211
|
-
function invalidWin32Path (p) {
|
18212
|
-
const rp = getRootPath(p)
|
18213
|
-
p = p.replace(rp, '')
|
18214
|
-
return INVALID_PATH_CHARS.test(p)
|
18215
|
-
}
|
18216
|
-
|
18217
17930
|
module.exports = {
|
18218
|
-
|
18219
|
-
invalidWin32Path
|
17931
|
+
moveSync: __webpack_require__(6776)
|
18220
17932
|
}
|
18221
17933
|
|
18222
17934
|
|
18223
17935
|
/***/ }),
|
18224
17936
|
|
18225
|
-
/***/
|
17937
|
+
/***/ 6776:
|
18226
17938
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
18227
17939
|
|
18228
17940
|
"use strict";
|
@@ -18232,134 +17944,85 @@ const fs = __webpack_require__(552)
|
|
18232
17944
|
const path = __webpack_require__(5622)
|
18233
17945
|
const copySync = __webpack_require__(9567).copySync
|
18234
17946
|
const removeSync = __webpack_require__(4879).removeSync
|
18235
|
-
const mkdirpSync = __webpack_require__(9181).
|
18236
|
-
const
|
18237
|
-
|
18238
|
-
function moveSync (src, dest, options) {
|
18239
|
-
options = options || {}
|
18240
|
-
const overwrite = options.overwrite || options.clobber || false
|
18241
|
-
|
18242
|
-
src = path.resolve(src)
|
18243
|
-
dest = path.resolve(dest)
|
18244
|
-
|
18245
|
-
if (src === dest) return fs.accessSync(src)
|
17947
|
+
const mkdirpSync = __webpack_require__(9181).mkdirpSync
|
17948
|
+
const stat = __webpack_require__(9783)
|
18246
17949
|
|
18247
|
-
|
17950
|
+
function moveSync (src, dest, opts) {
|
17951
|
+
opts = opts || {}
|
17952
|
+
const overwrite = opts.overwrite || opts.clobber || false
|
18248
17953
|
|
18249
|
-
|
18250
|
-
|
17954
|
+
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)
|
17955
|
+
stat.checkParentPathsSync(src, srcStat, dest, 'move')
|
17956
|
+
if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))
|
17957
|
+
return doRename(src, dest, overwrite, isChangingCase)
|
17958
|
+
}
|
18251
17959
|
|
18252
|
-
|
18253
|
-
|
18254
|
-
|
18255
|
-
|
18256
|
-
|
18257
|
-
if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') {
|
18258
|
-
removeSync(dest)
|
18259
|
-
options.overwrite = false // just overwriteed it, no need to do it again
|
18260
|
-
return moveSync(src, dest, options)
|
18261
|
-
}
|
17960
|
+
function isParentRoot (dest) {
|
17961
|
+
const parent = path.dirname(dest)
|
17962
|
+
const parsedPath = path.parse(parent)
|
17963
|
+
return parsedPath.root === parent
|
17964
|
+
}
|
18262
17965
|
|
18263
|
-
|
18264
|
-
|
18265
|
-
|
18266
|
-
|
18267
|
-
|
18268
|
-
fs.linkSync(src, dest)
|
18269
|
-
return fs.unlinkSync(src)
|
18270
|
-
} catch (err) {
|
18271
|
-
if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') {
|
18272
|
-
return moveSyncAcrossDevice(src, dest, overwrite)
|
18273
|
-
}
|
18274
|
-
throw err
|
18275
|
-
}
|
18276
|
-
}
|
17966
|
+
function doRename (src, dest, overwrite, isChangingCase) {
|
17967
|
+
if (isChangingCase) return rename(src, dest, overwrite)
|
17968
|
+
if (overwrite) {
|
17969
|
+
removeSync(dest)
|
17970
|
+
return rename(src, dest, overwrite)
|
18277
17971
|
}
|
17972
|
+
if (fs.existsSync(dest)) throw new Error('dest already exists.')
|
17973
|
+
return rename(src, dest, overwrite)
|
18278
17974
|
}
|
18279
17975
|
|
18280
|
-
function
|
18281
|
-
|
18282
|
-
|
18283
|
-
|
18284
|
-
|
18285
|
-
|
18286
|
-
return moveFileSyncAcrossDevice(src, dest, overwrite)
|
17976
|
+
function rename (src, dest, overwrite) {
|
17977
|
+
try {
|
17978
|
+
fs.renameSync(src, dest)
|
17979
|
+
} catch (err) {
|
17980
|
+
if (err.code !== 'EXDEV') throw err
|
17981
|
+
return moveAcrossDevice(src, dest, overwrite)
|
18287
17982
|
}
|
18288
17983
|
}
|
18289
17984
|
|
18290
|
-
function
|
18291
|
-
const
|
18292
|
-
|
18293
|
-
|
18294
|
-
const flags = overwrite ? 'w' : 'wx'
|
18295
|
-
|
18296
|
-
const fdr = fs.openSync(src, 'r')
|
18297
|
-
const stat = fs.fstatSync(fdr)
|
18298
|
-
const fdw = fs.openSync(dest, flags, stat.mode)
|
18299
|
-
let pos = 0
|
18300
|
-
|
18301
|
-
while (pos < stat.size) {
|
18302
|
-
const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
|
18303
|
-
fs.writeSync(fdw, _buff, 0, bytesRead)
|
18304
|
-
pos += bytesRead
|
17985
|
+
function moveAcrossDevice (src, dest, overwrite) {
|
17986
|
+
const opts = {
|
17987
|
+
overwrite,
|
17988
|
+
errorOnExist: true
|
18305
17989
|
}
|
18306
|
-
|
18307
|
-
|
18308
|
-
fs.closeSync(fdw)
|
18309
|
-
return fs.unlinkSync(src)
|
17990
|
+
copySync(src, dest, opts)
|
17991
|
+
return removeSync(src)
|
18310
17992
|
}
|
18311
17993
|
|
18312
|
-
|
18313
|
-
const options = {
|
18314
|
-
overwrite: false
|
18315
|
-
}
|
17994
|
+
module.exports = moveSync
|
18316
17995
|
|
18317
|
-
if (overwrite) {
|
18318
|
-
removeSync(dest)
|
18319
|
-
tryCopySync()
|
18320
|
-
} else {
|
18321
|
-
tryCopySync()
|
18322
|
-
}
|
18323
17996
|
|
18324
|
-
|
18325
|
-
|
18326
|
-
|
18327
|
-
|
18328
|
-
|
17997
|
+
/***/ }),
|
17998
|
+
|
17999
|
+
/***/ 7819:
|
18000
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
18001
|
+
|
18002
|
+
"use strict";
|
18329
18003
|
|
18330
|
-
// return true if dest is a subdir of src, otherwise false.
|
18331
|
-
// extract dest base dir and check if that is the same as src basename
|
18332
|
-
function isSrcSubdir (src, dest) {
|
18333
|
-
try {
|
18334
|
-
return fs.statSync(src).isDirectory() &&
|
18335
|
-
src !== dest &&
|
18336
|
-
dest.indexOf(src) > -1 &&
|
18337
|
-
dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src)
|
18338
|
-
} catch (e) {
|
18339
|
-
return false
|
18340
|
-
}
|
18341
|
-
}
|
18342
18004
|
|
18005
|
+
const u = __webpack_require__(7500).fromCallback
|
18343
18006
|
module.exports = {
|
18344
|
-
|
18007
|
+
move: u(__webpack_require__(4064))
|
18345
18008
|
}
|
18346
18009
|
|
18347
18010
|
|
18348
18011
|
/***/ }),
|
18349
18012
|
|
18350
|
-
/***/
|
18013
|
+
/***/ 4064:
|
18351
18014
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
18352
18015
|
|
18353
18016
|
"use strict";
|
18354
18017
|
|
18355
18018
|
|
18356
|
-
const u = __webpack_require__(2703)/* .fromCallback */ .E
|
18357
18019
|
const fs = __webpack_require__(552)
|
18358
18020
|
const path = __webpack_require__(5622)
|
18359
18021
|
const copy = __webpack_require__(8852).copy
|
18360
18022
|
const remove = __webpack_require__(4879).remove
|
18361
18023
|
const mkdirp = __webpack_require__(9181).mkdirp
|
18362
18024
|
const pathExists = __webpack_require__(5516).pathExists
|
18025
|
+
const stat = __webpack_require__(9783)
|
18363
18026
|
|
18364
18027
|
function move (src, dest, opts, cb) {
|
18365
18028
|
if (typeof opts === 'function') {
|
@@ -18369,25 +18032,28 @@ function move (src, dest, opts, cb) {
|
|
18369
18032
|
|
18370
18033
|
const overwrite = opts.overwrite || opts.clobber || false
|
18371
18034
|
|
18372
|
-
src
|
18373
|
-
dest = path.resolve(dest)
|
18374
|
-
|
18375
|
-
if (src === dest) return fs.access(src, cb)
|
18376
|
-
|
18377
|
-
fs.stat(src, (err, st) => {
|
18035
|
+
stat.checkPaths(src, dest, 'move', opts, (err, stats) => {
|
18378
18036
|
if (err) return cb(err)
|
18379
|
-
|
18380
|
-
|
18381
|
-
return cb(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`))
|
18382
|
-
}
|
18383
|
-
mkdirp(path.dirname(dest), err => {
|
18037
|
+
const { srcStat, isChangingCase = false } = stats
|
18038
|
+
stat.checkParentPaths(src, srcStat, dest, 'move', err => {
|
18384
18039
|
if (err) return cb(err)
|
18385
|
-
return doRename(src, dest, overwrite, cb)
|
18040
|
+
if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb)
|
18041
|
+
mkdirp(path.dirname(dest), err => {
|
18042
|
+
if (err) return cb(err)
|
18043
|
+
return doRename(src, dest, overwrite, isChangingCase, cb)
|
18044
|
+
})
|
18386
18045
|
})
|
18387
18046
|
})
|
18388
18047
|
}
|
18389
18048
|
|
18390
|
-
function
|
18049
|
+
function isParentRoot (dest) {
|
18050
|
+
const parent = path.dirname(dest)
|
18051
|
+
const parsedPath = path.parse(parent)
|
18052
|
+
return parsedPath.root === parent
|
18053
|
+
}
|
18054
|
+
|
18055
|
+
function doRename (src, dest, overwrite, isChangingCase, cb) {
|
18056
|
+
if (isChangingCase) return rename(src, dest, overwrite, cb)
|
18391
18057
|
if (overwrite) {
|
18392
18058
|
return remove(dest, err => {
|
18393
18059
|
if (err) return cb(err)
|
@@ -18414,25 +18080,13 @@ function moveAcrossDevice (src, dest, overwrite, cb) {
|
|
18414
18080
|
overwrite,
|
18415
18081
|
errorOnExist: true
|
18416
18082
|
}
|
18417
|
-
|
18418
18083
|
copy(src, dest, opts, err => {
|
18419
18084
|
if (err) return cb(err)
|
18420
18085
|
return remove(src, cb)
|
18421
18086
|
})
|
18422
18087
|
}
|
18423
18088
|
|
18424
|
-
|
18425
|
-
const srcArray = src.split(path.sep)
|
18426
|
-
const destArray = dest.split(path.sep)
|
18427
|
-
|
18428
|
-
return srcArray.reduce((acc, current, i) => {
|
18429
|
-
return acc && destArray[i] === current
|
18430
|
-
}, true)
|
18431
|
-
}
|
18432
|
-
|
18433
|
-
module.exports = {
|
18434
|
-
move: u(move)
|
18435
|
-
}
|
18089
|
+
module.exports = move
|
18436
18090
|
|
18437
18091
|
|
18438
18092
|
/***/ }),
|
@@ -18443,7 +18097,7 @@ module.exports = {
|
|
18443
18097
|
"use strict";
|
18444
18098
|
|
18445
18099
|
|
18446
|
-
const u = __webpack_require__(
|
18100
|
+
const u = __webpack_require__(7500).fromCallback
|
18447
18101
|
const fs = __webpack_require__(552)
|
18448
18102
|
const path = __webpack_require__(5622)
|
18449
18103
|
const mkdir = __webpack_require__(9181)
|
@@ -18490,7 +18144,7 @@ module.exports = {
|
|
18490
18144
|
|
18491
18145
|
"use strict";
|
18492
18146
|
|
18493
|
-
const u = __webpack_require__(
|
18147
|
+
const u = __webpack_require__(7500).fromPromise
|
18494
18148
|
const fs = __webpack_require__(893)
|
18495
18149
|
|
18496
18150
|
function pathExists (path) {
|
@@ -18511,12 +18165,25 @@ module.exports = {
|
|
18511
18165
|
"use strict";
|
18512
18166
|
|
18513
18167
|
|
18514
|
-
const
|
18168
|
+
const fs = __webpack_require__(552)
|
18169
|
+
const u = __webpack_require__(7500).fromCallback
|
18515
18170
|
const rimraf = __webpack_require__(7137)
|
18516
18171
|
|
18172
|
+
function remove (path, callback) {
|
18173
|
+
// Node 14.14.0+
|
18174
|
+
if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback)
|
18175
|
+
rimraf(path, callback)
|
18176
|
+
}
|
18177
|
+
|
18178
|
+
function removeSync (path) {
|
18179
|
+
// Node 14.14.0+
|
18180
|
+
if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true })
|
18181
|
+
rimraf.sync(path)
|
18182
|
+
}
|
18183
|
+
|
18517
18184
|
module.exports = {
|
18518
|
-
remove: u(
|
18519
|
-
removeSync
|
18185
|
+
remove: u(remove),
|
18186
|
+
removeSync
|
18520
18187
|
}
|
18521
18188
|
|
18522
18189
|
|
@@ -18641,9 +18308,6 @@ function fixWinEPERM (p, options, er, cb) {
|
|
18641
18308
|
assert(p)
|
18642
18309
|
assert(options)
|
18643
18310
|
assert(typeof cb === 'function')
|
18644
|
-
if (er) {
|
18645
|
-
assert(er instanceof Error)
|
18646
|
-
}
|
18647
18311
|
|
18648
18312
|
options.chmod(p, 0o666, er2 => {
|
18649
18313
|
if (er2) {
|
@@ -18667,9 +18331,6 @@ function fixWinEPERMSync (p, options, er) {
|
|
18667
18331
|
|
18668
18332
|
assert(p)
|
18669
18333
|
assert(options)
|
18670
|
-
if (er) {
|
18671
|
-
assert(er instanceof Error)
|
18672
|
-
}
|
18673
18334
|
|
18674
18335
|
try {
|
18675
18336
|
options.chmodSync(p, 0o666)
|
@@ -18701,9 +18362,6 @@ function fixWinEPERMSync (p, options, er) {
|
|
18701
18362
|
function rmdir (p, options, originalEr, cb) {
|
18702
18363
|
assert(p)
|
18703
18364
|
assert(options)
|
18704
|
-
if (originalEr) {
|
18705
|
-
assert(originalEr instanceof Error)
|
18706
|
-
}
|
18707
18365
|
assert(typeof cb === 'function')
|
18708
18366
|
|
18709
18367
|
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
|
@@ -18796,9 +18454,6 @@ function rimrafSync (p, options) {
|
|
18796
18454
|
function rmdirSync (p, options, originalEr) {
|
18797
18455
|
assert(p)
|
18798
18456
|
assert(options)
|
18799
|
-
if (originalEr) {
|
18800
|
-
assert(originalEr instanceof Error)
|
18801
|
-
}
|
18802
18457
|
|
18803
18458
|
try {
|
18804
18459
|
options.rmdirSync(p)
|
@@ -18818,24 +18473,24 @@ function rmkidsSync (p, options) {
|
|
18818
18473
|
assert(options)
|
18819
18474
|
options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))
|
18820
18475
|
|
18821
|
-
|
18822
|
-
|
18823
|
-
|
18824
|
-
|
18825
|
-
|
18826
|
-
|
18827
|
-
|
18828
|
-
|
18829
|
-
|
18830
|
-
|
18831
|
-
|
18832
|
-
|
18833
|
-
|
18834
|
-
|
18835
|
-
|
18836
|
-
|
18837
|
-
|
18838
|
-
}
|
18476
|
+
if (isWindows) {
|
18477
|
+
// We only end up here once we got ENOTEMPTY at least once, and
|
18478
|
+
// at this point, we are guaranteed to have removed all the kids.
|
18479
|
+
// So, we know that it won't be ENOENT or ENOTDIR or anything else.
|
18480
|
+
// try really hard to delete stuff on windows, because it has a
|
18481
|
+
// PROFOUNDLY annoying habit of not closing handles promptly when
|
18482
|
+
// files are deleted, resulting in spurious ENOTEMPTY errors.
|
18483
|
+
const startTime = Date.now()
|
18484
|
+
do {
|
18485
|
+
try {
|
18486
|
+
const ret = options.rmdirSync(p, options)
|
18487
|
+
return ret
|
18488
|
+
} catch {}
|
18489
|
+
} while (Date.now() - startTime < 500) // give up after 500ms
|
18490
|
+
} else {
|
18491
|
+
const ret = options.rmdirSync(p, options)
|
18492
|
+
return ret
|
18493
|
+
}
|
18839
18494
|
}
|
18840
18495
|
|
18841
18496
|
module.exports = rimraf
|
@@ -18844,84 +18499,176 @@ rimraf.sync = rimrafSync
|
|
18844
18499
|
|
18845
18500
|
/***/ }),
|
18846
18501
|
|
18847
|
-
/***/
|
18848
|
-
/***/ ((module) => {
|
18502
|
+
/***/ 9783:
|
18503
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
18849
18504
|
|
18850
18505
|
"use strict";
|
18851
18506
|
|
18852
|
-
|
18853
|
-
|
18854
|
-
|
18855
|
-
|
18856
|
-
|
18857
|
-
|
18858
|
-
|
18859
|
-
}
|
18507
|
+
|
18508
|
+
const fs = __webpack_require__(893)
|
18509
|
+
const path = __webpack_require__(5622)
|
18510
|
+
const util = __webpack_require__(1669)
|
18511
|
+
|
18512
|
+
function getStats (src, dest, opts) {
|
18513
|
+
const statFunc = opts.dereference
|
18514
|
+
? (file) => fs.stat(file, { bigint: true })
|
18515
|
+
: (file) => fs.lstat(file, { bigint: true })
|
18516
|
+
return Promise.all([
|
18517
|
+
statFunc(src),
|
18518
|
+
statFunc(dest).catch(err => {
|
18519
|
+
if (err.code === 'ENOENT') return null
|
18520
|
+
throw err
|
18521
|
+
})
|
18522
|
+
]).then(([srcStat, destStat]) => ({ srcStat, destStat }))
|
18523
|
+
}
|
18524
|
+
|
18525
|
+
function getStatsSync (src, dest, opts) {
|
18526
|
+
let destStat
|
18527
|
+
const statFunc = opts.dereference
|
18528
|
+
? (file) => fs.statSync(file, { bigint: true })
|
18529
|
+
: (file) => fs.lstatSync(file, { bigint: true })
|
18530
|
+
const srcStat = statFunc(src)
|
18531
|
+
try {
|
18532
|
+
destStat = statFunc(dest)
|
18533
|
+
} catch (err) {
|
18534
|
+
if (err.code === 'ENOENT') return { srcStat, destStat: null }
|
18535
|
+
throw err
|
18860
18536
|
}
|
18861
|
-
return
|
18537
|
+
return { srcStat, destStat }
|
18862
18538
|
}
|
18863
18539
|
|
18540
|
+
function checkPaths (src, dest, funcName, opts, cb) {
|
18541
|
+
util.callbackify(getStats)(src, dest, opts, (err, stats) => {
|
18542
|
+
if (err) return cb(err)
|
18543
|
+
const { srcStat, destStat } = stats
|
18864
18544
|
|
18865
|
-
|
18545
|
+
if (destStat) {
|
18546
|
+
if (areIdentical(srcStat, destStat)) {
|
18547
|
+
const srcBaseName = path.basename(src)
|
18548
|
+
const destBaseName = path.basename(dest)
|
18549
|
+
if (funcName === 'move' &&
|
18550
|
+
srcBaseName !== destBaseName &&
|
18551
|
+
srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
18552
|
+
return cb(null, { srcStat, destStat, isChangingCase: true })
|
18553
|
+
}
|
18554
|
+
return cb(new Error('Source and destination must not be the same.'))
|
18555
|
+
}
|
18556
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
18557
|
+
return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))
|
18558
|
+
}
|
18559
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
18560
|
+
return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`))
|
18561
|
+
}
|
18562
|
+
}
|
18866
18563
|
|
18867
|
-
|
18868
|
-
|
18564
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
18565
|
+
return cb(new Error(errMsg(src, dest, funcName)))
|
18566
|
+
}
|
18567
|
+
return cb(null, { srcStat, destStat })
|
18568
|
+
})
|
18569
|
+
}
|
18869
18570
|
|
18870
|
-
|
18571
|
+
function checkPathsSync (src, dest, funcName, opts) {
|
18572
|
+
const { srcStat, destStat } = getStatsSync(src, dest, opts)
|
18573
|
+
|
18574
|
+
if (destStat) {
|
18575
|
+
if (areIdentical(srcStat, destStat)) {
|
18576
|
+
const srcBaseName = path.basename(src)
|
18577
|
+
const destBaseName = path.basename(dest)
|
18578
|
+
if (funcName === 'move' &&
|
18579
|
+
srcBaseName !== destBaseName &&
|
18580
|
+
srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
18581
|
+
return { srcStat, destStat, isChangingCase: true }
|
18582
|
+
}
|
18583
|
+
throw new Error('Source and destination must not be the same.')
|
18584
|
+
}
|
18585
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
18586
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
|
18587
|
+
}
|
18588
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
18589
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
|
18590
|
+
}
|
18591
|
+
}
|
18871
18592
|
|
18593
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
18594
|
+
throw new Error(errMsg(src, dest, funcName))
|
18595
|
+
}
|
18596
|
+
return { srcStat, destStat }
|
18597
|
+
}
|
18872
18598
|
|
18873
|
-
|
18874
|
-
|
18875
|
-
|
18599
|
+
// recursively check if dest parent is a subdirectory of src.
|
18600
|
+
// It works for all file types including symlinks since it
|
18601
|
+
// checks the src and dest inodes. It starts from the deepest
|
18602
|
+
// parent and stops once it reaches the src parent or the root path.
|
18603
|
+
function checkParentPaths (src, srcStat, dest, funcName, cb) {
|
18604
|
+
const srcParent = path.resolve(path.dirname(src))
|
18605
|
+
const destParent = path.resolve(path.dirname(dest))
|
18606
|
+
if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()
|
18607
|
+
fs.stat(destParent, { bigint: true }, (err, destStat) => {
|
18608
|
+
if (err) {
|
18609
|
+
if (err.code === 'ENOENT') return cb()
|
18610
|
+
return cb(err)
|
18611
|
+
}
|
18612
|
+
if (areIdentical(srcStat, destStat)) {
|
18613
|
+
return cb(new Error(errMsg(src, dest, funcName)))
|
18614
|
+
}
|
18615
|
+
return checkParentPaths(src, srcStat, destParent, funcName, cb)
|
18616
|
+
})
|
18617
|
+
}
|
18876
18618
|
|
18877
|
-
|
18878
|
-
|
18879
|
-
|
18880
|
-
|
18619
|
+
function checkParentPathsSync (src, srcStat, dest, funcName) {
|
18620
|
+
const srcParent = path.resolve(path.dirname(src))
|
18621
|
+
const destParent = path.resolve(path.dirname(dest))
|
18622
|
+
if (destParent === srcParent || destParent === path.parse(destParent).root) return
|
18623
|
+
let destStat
|
18624
|
+
try {
|
18625
|
+
destStat = fs.statSync(destParent, { bigint: true })
|
18626
|
+
} catch (err) {
|
18627
|
+
if (err.code === 'ENOENT') return
|
18628
|
+
throw err
|
18629
|
+
}
|
18630
|
+
if (areIdentical(srcStat, destStat)) {
|
18631
|
+
throw new Error(errMsg(src, dest, funcName))
|
18632
|
+
}
|
18633
|
+
return checkParentPathsSync(src, srcStat, destParent, funcName)
|
18634
|
+
}
|
18881
18635
|
|
18882
|
-
|
18883
|
-
|
18884
|
-
fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141')
|
18885
|
-
const fd = fs.openSync(tmpfile, 'r+')
|
18886
|
-
fs.futimesSync(fd, d, d)
|
18887
|
-
fs.closeSync(fd)
|
18888
|
-
return fs.statSync(tmpfile).mtime > 1435410243000
|
18636
|
+
function areIdentical (srcStat, destStat) {
|
18637
|
+
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev
|
18889
18638
|
}
|
18890
18639
|
|
18891
|
-
|
18892
|
-
|
18893
|
-
|
18640
|
+
// return true if dest is a subdir of src, otherwise false.
|
18641
|
+
// It only checks the path strings.
|
18642
|
+
function isSrcSubdir (src, dest) {
|
18643
|
+
const srcArr = path.resolve(src).split(path.sep).filter(i => i)
|
18644
|
+
const destArr = path.resolve(dest).split(path.sep).filter(i => i)
|
18645
|
+
return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true)
|
18646
|
+
}
|
18894
18647
|
|
18895
|
-
|
18896
|
-
|
18897
|
-
fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => {
|
18898
|
-
if (err) return callback(err)
|
18899
|
-
fs.open(tmpfile, 'r+', (err, fd) => {
|
18900
|
-
if (err) return callback(err)
|
18901
|
-
fs.futimes(fd, d, d, err => {
|
18902
|
-
if (err) return callback(err)
|
18903
|
-
fs.close(fd, err => {
|
18904
|
-
if (err) return callback(err)
|
18905
|
-
fs.stat(tmpfile, (err, stats) => {
|
18906
|
-
if (err) return callback(err)
|
18907
|
-
callback(null, stats.mtime > 1435410243000)
|
18908
|
-
})
|
18909
|
-
})
|
18910
|
-
})
|
18911
|
-
})
|
18912
|
-
})
|
18648
|
+
function errMsg (src, dest, funcName) {
|
18649
|
+
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`
|
18913
18650
|
}
|
18914
18651
|
|
18915
|
-
|
18916
|
-
|
18917
|
-
|
18918
|
-
|
18919
|
-
|
18920
|
-
|
18921
|
-
|
18922
|
-
}
|
18652
|
+
module.exports = {
|
18653
|
+
checkPaths,
|
18654
|
+
checkPathsSync,
|
18655
|
+
checkParentPaths,
|
18656
|
+
checkParentPathsSync,
|
18657
|
+
isSrcSubdir,
|
18658
|
+
areIdentical
|
18923
18659
|
}
|
18924
18660
|
|
18661
|
+
|
18662
|
+
/***/ }),
|
18663
|
+
|
18664
|
+
/***/ 8605:
|
18665
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
18666
|
+
|
18667
|
+
"use strict";
|
18668
|
+
|
18669
|
+
|
18670
|
+
const fs = __webpack_require__(552)
|
18671
|
+
|
18925
18672
|
function utimesMillis (path, atime, mtime, callback) {
|
18926
18673
|
// if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
|
18927
18674
|
fs.open(path, 'r+', (err, fd) => {
|
@@ -18941,9 +18688,6 @@ function utimesMillisSync (path, atime, mtime) {
|
|
18941
18688
|
}
|
18942
18689
|
|
18943
18690
|
module.exports = {
|
18944
|
-
hasMillisRes,
|
18945
|
-
hasMillisResSync,
|
18946
|
-
timeRemoveMillis,
|
18947
18691
|
utimesMillis,
|
18948
18692
|
utimesMillisSync
|
18949
18693
|
}
|
@@ -24610,6 +24354,122 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', {
|
|
24610
24354
|
});
|
24611
24355
|
|
24612
24356
|
|
24357
|
+
/***/ }),
|
24358
|
+
|
24359
|
+
/***/ 4862:
|
24360
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
24361
|
+
|
24362
|
+
let _fs
|
24363
|
+
try {
|
24364
|
+
_fs = __webpack_require__(552)
|
24365
|
+
} catch (_) {
|
24366
|
+
_fs = __webpack_require__(5747)
|
24367
|
+
}
|
24368
|
+
const universalify = __webpack_require__(7500)
|
24369
|
+
const { stringify, stripBom } = __webpack_require__(7653)
|
24370
|
+
|
24371
|
+
async function _readFile (file, options = {}) {
|
24372
|
+
if (typeof options === 'string') {
|
24373
|
+
options = { encoding: options }
|
24374
|
+
}
|
24375
|
+
|
24376
|
+
const fs = options.fs || _fs
|
24377
|
+
|
24378
|
+
const shouldThrow = 'throws' in options ? options.throws : true
|
24379
|
+
|
24380
|
+
let data = await universalify.fromCallback(fs.readFile)(file, options)
|
24381
|
+
|
24382
|
+
data = stripBom(data)
|
24383
|
+
|
24384
|
+
let obj
|
24385
|
+
try {
|
24386
|
+
obj = JSON.parse(data, options ? options.reviver : null)
|
24387
|
+
} catch (err) {
|
24388
|
+
if (shouldThrow) {
|
24389
|
+
err.message = `${file}: ${err.message}`
|
24390
|
+
throw err
|
24391
|
+
} else {
|
24392
|
+
return null
|
24393
|
+
}
|
24394
|
+
}
|
24395
|
+
|
24396
|
+
return obj
|
24397
|
+
}
|
24398
|
+
|
24399
|
+
const readFile = universalify.fromPromise(_readFile)
|
24400
|
+
|
24401
|
+
function readFileSync (file, options = {}) {
|
24402
|
+
if (typeof options === 'string') {
|
24403
|
+
options = { encoding: options }
|
24404
|
+
}
|
24405
|
+
|
24406
|
+
const fs = options.fs || _fs
|
24407
|
+
|
24408
|
+
const shouldThrow = 'throws' in options ? options.throws : true
|
24409
|
+
|
24410
|
+
try {
|
24411
|
+
let content = fs.readFileSync(file, options)
|
24412
|
+
content = stripBom(content)
|
24413
|
+
return JSON.parse(content, options.reviver)
|
24414
|
+
} catch (err) {
|
24415
|
+
if (shouldThrow) {
|
24416
|
+
err.message = `${file}: ${err.message}`
|
24417
|
+
throw err
|
24418
|
+
} else {
|
24419
|
+
return null
|
24420
|
+
}
|
24421
|
+
}
|
24422
|
+
}
|
24423
|
+
|
24424
|
+
async function _writeFile (file, obj, options = {}) {
|
24425
|
+
const fs = options.fs || _fs
|
24426
|
+
|
24427
|
+
const str = stringify(obj, options)
|
24428
|
+
|
24429
|
+
await universalify.fromCallback(fs.writeFile)(file, str, options)
|
24430
|
+
}
|
24431
|
+
|
24432
|
+
const writeFile = universalify.fromPromise(_writeFile)
|
24433
|
+
|
24434
|
+
function writeFileSync (file, obj, options = {}) {
|
24435
|
+
const fs = options.fs || _fs
|
24436
|
+
|
24437
|
+
const str = stringify(obj, options)
|
24438
|
+
// not sure if fs.writeFileSync returns anything, but just in case
|
24439
|
+
return fs.writeFileSync(file, str, options)
|
24440
|
+
}
|
24441
|
+
|
24442
|
+
const jsonfile = {
|
24443
|
+
readFile,
|
24444
|
+
readFileSync,
|
24445
|
+
writeFile,
|
24446
|
+
writeFileSync
|
24447
|
+
}
|
24448
|
+
|
24449
|
+
module.exports = jsonfile
|
24450
|
+
|
24451
|
+
|
24452
|
+
/***/ }),
|
24453
|
+
|
24454
|
+
/***/ 7653:
|
24455
|
+
/***/ ((module) => {
|
24456
|
+
|
24457
|
+
function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) {
|
24458
|
+
const EOF = finalEOL ? EOL : ''
|
24459
|
+
const str = JSON.stringify(obj, replacer, spaces)
|
24460
|
+
|
24461
|
+
return str.replace(/\n/g, EOL) + EOF
|
24462
|
+
}
|
24463
|
+
|
24464
|
+
function stripBom (content) {
|
24465
|
+
// we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
|
24466
|
+
if (Buffer.isBuffer(content)) content = content.toString('utf8')
|
24467
|
+
return content.replace(/^\uFEFF/, '')
|
24468
|
+
}
|
24469
|
+
|
24470
|
+
module.exports = { stringify, stripBom }
|
24471
|
+
|
24472
|
+
|
24613
24473
|
/***/ }),
|
24614
24474
|
|
24615
24475
|
/***/ 4725:
|
@@ -26182,6 +26042,38 @@ function coerce (version, options) {
|
|
26182
26042
|
}
|
26183
26043
|
|
26184
26044
|
|
26045
|
+
/***/ }),
|
26046
|
+
|
26047
|
+
/***/ 7500:
|
26048
|
+
/***/ ((__unused_webpack_module, exports) => {
|
26049
|
+
|
26050
|
+
"use strict";
|
26051
|
+
|
26052
|
+
|
26053
|
+
exports.fromCallback = function (fn) {
|
26054
|
+
return Object.defineProperty(function (...args) {
|
26055
|
+
if (typeof args[args.length - 1] === 'function') fn.apply(this, args)
|
26056
|
+
else {
|
26057
|
+
return new Promise((resolve, reject) => {
|
26058
|
+
fn.call(
|
26059
|
+
this,
|
26060
|
+
...args,
|
26061
|
+
(err, res) => (err != null) ? reject(err) : resolve(res)
|
26062
|
+
)
|
26063
|
+
})
|
26064
|
+
}
|
26065
|
+
}, 'name', { value: fn.name })
|
26066
|
+
}
|
26067
|
+
|
26068
|
+
exports.fromPromise = function (fn) {
|
26069
|
+
return Object.defineProperty(function (...args) {
|
26070
|
+
const cb = args[args.length - 1]
|
26071
|
+
if (typeof cb !== 'function') return fn.apply(this, args)
|
26072
|
+
else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)
|
26073
|
+
}, 'name', { value: fn.name })
|
26074
|
+
}
|
26075
|
+
|
26076
|
+
|
26185
26077
|
/***/ }),
|
26186
26078
|
|
26187
26079
|
/***/ 8438:
|
@@ -32343,6 +32235,152 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', {
|
|
32343
32235
|
});
|
32344
32236
|
|
32345
32237
|
|
32238
|
+
/***/ }),
|
32239
|
+
|
32240
|
+
/***/ 7276:
|
32241
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
32242
|
+
|
32243
|
+
"use strict";
|
32244
|
+
|
32245
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
32246
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
32247
|
+
};
|
32248
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
32249
|
+
exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = void 0;
|
32250
|
+
const fs_extra_1 = __importDefault(__webpack_require__(5392));
|
32251
|
+
const path_1 = __webpack_require__(5622);
|
32252
|
+
const glob_1 = __importDefault(__webpack_require__(4240));
|
32253
|
+
const normalize_path_1 = __webpack_require__(6261);
|
32254
|
+
const lambda_1 = __webpack_require__(6721);
|
32255
|
+
const minimatch_1 = __importDefault(__webpack_require__(9566));
|
32256
|
+
/**
|
32257
|
+
* Convert legacy Runtime to a Plugin.
|
32258
|
+
* @param buildRuntime - a legacy build() function from a Runtime
|
32259
|
+
* @param ext - the file extension, for example `.py`
|
32260
|
+
*/
|
32261
|
+
function convertRuntimeToPlugin(buildRuntime, ext) {
|
32262
|
+
return async function build({ workPath }) {
|
32263
|
+
const opts = { cwd: workPath };
|
32264
|
+
const files = await glob_1.default('**', opts);
|
32265
|
+
delete files['vercel.json']; // Builders/Runtimes didn't have vercel.json
|
32266
|
+
const entrypoints = await glob_1.default(`api/**/*${ext}`, opts);
|
32267
|
+
const pages = {};
|
32268
|
+
const { functions = {} } = await readVercelConfig(workPath);
|
32269
|
+
const traceDir = path_1.join(workPath, '.output', 'runtime-traced-files');
|
32270
|
+
await fs_extra_1.default.ensureDir(traceDir);
|
32271
|
+
for (const entrypoint of Object.keys(entrypoints)) {
|
32272
|
+
const key = Object.keys(functions).find(src => src === entrypoint || minimatch_1.default(entrypoint, src)) || '';
|
32273
|
+
const config = functions[key] || {};
|
32274
|
+
const { output } = await buildRuntime({
|
32275
|
+
files,
|
32276
|
+
entrypoint,
|
32277
|
+
workPath,
|
32278
|
+
config: {
|
32279
|
+
zeroConfig: true,
|
32280
|
+
includeFiles: config.includeFiles,
|
32281
|
+
excludeFiles: config.excludeFiles,
|
32282
|
+
},
|
32283
|
+
});
|
32284
|
+
pages[entrypoint] = {
|
32285
|
+
handler: output.handler,
|
32286
|
+
runtime: output.runtime,
|
32287
|
+
memory: output.memory,
|
32288
|
+
maxDuration: output.maxDuration,
|
32289
|
+
environment: output.environment,
|
32290
|
+
allowQuery: output.allowQuery,
|
32291
|
+
regions: output.regions,
|
32292
|
+
};
|
32293
|
+
// @ts-ignore This symbol is a private API
|
32294
|
+
const lambdaFiles = output[lambda_1.FILES_SYMBOL];
|
32295
|
+
const entry = path_1.join(workPath, '.output', 'server', 'pages', entrypoint);
|
32296
|
+
await fs_extra_1.default.ensureDir(path_1.dirname(entry));
|
32297
|
+
await linkOrCopy(files[entrypoint].fsPath, entry);
|
32298
|
+
const tracedFiles = [];
|
32299
|
+
Object.entries(lambdaFiles).forEach(async ([relPath, file]) => {
|
32300
|
+
const newPath = path_1.join(traceDir, relPath);
|
32301
|
+
tracedFiles.push({ absolutePath: newPath, relativePath: relPath });
|
32302
|
+
if (file.fsPath) {
|
32303
|
+
await linkOrCopy(file.fsPath, newPath);
|
32304
|
+
}
|
32305
|
+
else if (file.type === 'FileBlob') {
|
32306
|
+
const { data, mode } = file;
|
32307
|
+
await fs_extra_1.default.writeFile(newPath, data, { mode });
|
32308
|
+
}
|
32309
|
+
else {
|
32310
|
+
throw new Error(`Unknown file type: ${file.type}`);
|
32311
|
+
}
|
32312
|
+
});
|
32313
|
+
const nft = path_1.join(workPath, '.output', 'server', 'pages', `${entrypoint}.nft.json`);
|
32314
|
+
const json = JSON.stringify({
|
32315
|
+
version: 1,
|
32316
|
+
files: tracedFiles.map(f => ({
|
32317
|
+
input: normalize_path_1.normalizePath(path_1.relative(nft, f.absolutePath)),
|
32318
|
+
output: normalize_path_1.normalizePath(f.relativePath),
|
32319
|
+
})),
|
32320
|
+
});
|
32321
|
+
await fs_extra_1.default.ensureDir(path_1.dirname(nft));
|
32322
|
+
await fs_extra_1.default.writeFile(nft, json);
|
32323
|
+
}
|
32324
|
+
await updateFunctionsManifest({ workPath, pages });
|
32325
|
+
};
|
32326
|
+
}
|
32327
|
+
exports.convertRuntimeToPlugin = convertRuntimeToPlugin;
|
32328
|
+
async function linkOrCopy(existingPath, newPath) {
|
32329
|
+
try {
|
32330
|
+
await fs_extra_1.default.createLink(existingPath, newPath);
|
32331
|
+
}
|
32332
|
+
catch (err) {
|
32333
|
+
if (err.code !== 'EEXIST') {
|
32334
|
+
await fs_extra_1.default.copyFile(existingPath, newPath);
|
32335
|
+
}
|
32336
|
+
}
|
32337
|
+
}
|
32338
|
+
async function readJson(filePath) {
|
32339
|
+
try {
|
32340
|
+
const str = await fs_extra_1.default.readFile(filePath, 'utf8');
|
32341
|
+
return JSON.parse(str);
|
32342
|
+
}
|
32343
|
+
catch (err) {
|
32344
|
+
if (err.code === 'ENOENT') {
|
32345
|
+
return {};
|
32346
|
+
}
|
32347
|
+
throw err;
|
32348
|
+
}
|
32349
|
+
}
|
32350
|
+
async function readVercelConfig(workPath) {
|
32351
|
+
const vercelJsonPath = path_1.join(workPath, 'vercel.json');
|
32352
|
+
return readJson(vercelJsonPath);
|
32353
|
+
}
|
32354
|
+
/**
|
32355
|
+
* If `.output/functions-manifest.json` exists, append to the pages
|
32356
|
+
* property. Otherwise write a new file. This will also read `vercel.json`
|
32357
|
+
* and apply relevant `functions` property config.
|
32358
|
+
*/
|
32359
|
+
async function updateFunctionsManifest({ workPath, pages, }) {
|
32360
|
+
const functionsManifestPath = path_1.join(workPath, '.output', 'functions-manifest.json');
|
32361
|
+
const vercelConfig = await readVercelConfig(workPath);
|
32362
|
+
const functionsManifest = await readJson(functionsManifestPath);
|
32363
|
+
if (!functionsManifest.version)
|
32364
|
+
functionsManifest.version = 1;
|
32365
|
+
if (!functionsManifest.pages)
|
32366
|
+
functionsManifest.pages = {};
|
32367
|
+
for (const [pageKey, pageConfig] of Object.entries(pages)) {
|
32368
|
+
const fnConfig = await lambda_1.getLambdaOptionsFromFunction({
|
32369
|
+
sourceFile: pageKey,
|
32370
|
+
config: vercelConfig,
|
32371
|
+
});
|
32372
|
+
functionsManifest.pages[pageKey] = {
|
32373
|
+
...pageConfig,
|
32374
|
+
memory: fnConfig.memory || pageConfig.memory,
|
32375
|
+
maxDuration: fnConfig.maxDuration || pageConfig.maxDuration,
|
32376
|
+
regions: vercelConfig.regions || pageConfig.regions,
|
32377
|
+
};
|
32378
|
+
}
|
32379
|
+
await fs_extra_1.default.writeFile(functionsManifestPath, JSON.stringify(functionsManifest));
|
32380
|
+
}
|
32381
|
+
exports.updateFunctionsManifest = updateFunctionsManifest;
|
32382
|
+
|
32383
|
+
|
32346
32384
|
/***/ }),
|
32347
32385
|
|
32348
32386
|
/***/ 1868:
|
@@ -33701,6 +33739,7 @@ const assert_1 = __importDefault(__webpack_require__(2357));
|
|
33701
33739
|
const glob_1 = __importDefault(__webpack_require__(1104));
|
33702
33740
|
const util_1 = __webpack_require__(1669);
|
33703
33741
|
const fs_extra_1 = __webpack_require__(5392);
|
33742
|
+
const normalize_path_1 = __webpack_require__(6261);
|
33704
33743
|
const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
|
33705
33744
|
const vanillaGlob = util_1.promisify(glob_1.default);
|
33706
33745
|
async function glob(pattern, opts, mountpoint) {
|
@@ -33724,7 +33763,7 @@ async function glob(pattern, opts, mountpoint) {
|
|
33724
33763
|
options.dot = true;
|
33725
33764
|
const files = await vanillaGlob(pattern, options);
|
33726
33765
|
for (const relativePath of files) {
|
33727
|
-
const fsPath = path_1.default.join(options.cwd, relativePath)
|
33766
|
+
const fsPath = normalize_path_1.normalizePath(path_1.default.join(options.cwd, relativePath));
|
33728
33767
|
let stat = options.statCache[fsPath];
|
33729
33768
|
assert_1.default(stat, `statCache does not contain value for ${relativePath} (resolved to ${fsPath})`);
|
33730
33769
|
const isSymlink = options.symlinks[fsPath];
|
@@ -33830,6 +33869,25 @@ function isDiscontinued({ discontinueDate }) {
|
|
33830
33869
|
}
|
33831
33870
|
|
33832
33871
|
|
33872
|
+
/***/ }),
|
33873
|
+
|
33874
|
+
/***/ 6261:
|
33875
|
+
/***/ ((__unused_webpack_module, exports) => {
|
33876
|
+
|
33877
|
+
"use strict";
|
33878
|
+
|
33879
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
33880
|
+
exports.normalizePath = void 0;
|
33881
|
+
const isWin = process.platform === 'win32';
|
33882
|
+
/**
|
33883
|
+
* Convert Windows separators to Unix separators.
|
33884
|
+
*/
|
33885
|
+
function normalizePath(p) {
|
33886
|
+
return isWin ? p.replace(/\\/g, '/') : p;
|
33887
|
+
}
|
33888
|
+
exports.normalizePath = normalizePath;
|
33889
|
+
|
33890
|
+
|
33833
33891
|
/***/ }),
|
33834
33892
|
|
33835
33893
|
/***/ 7792:
|
@@ -34293,7 +34351,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
34293
34351
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
34294
34352
|
};
|
34295
34353
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
34296
|
-
exports.getPlatformEnv = exports.isStaticRuntime = exports.isOfficialRuntime = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.shouldServe = exports.streamToBuffer = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
|
34354
|
+
exports.getPlatformEnv = exports.isStaticRuntime = exports.isOfficialRuntime = exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.shouldServe = exports.streamToBuffer = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
|
34297
34355
|
const file_blob_1 = __importDefault(__webpack_require__(2397));
|
34298
34356
|
exports.FileBlob = file_blob_1.default;
|
34299
34357
|
const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
|
@@ -34353,6 +34411,11 @@ var filesystem_1 = __webpack_require__(461);
|
|
34353
34411
|
Object.defineProperty(exports, "DetectorFilesystem", ({ enumerable: true, get: function () { return filesystem_1.DetectorFilesystem; } }));
|
34354
34412
|
var read_config_file_1 = __webpack_require__(7792);
|
34355
34413
|
Object.defineProperty(exports, "readConfigFile", ({ enumerable: true, get: function () { return read_config_file_1.readConfigFile; } }));
|
34414
|
+
var normalize_path_1 = __webpack_require__(6261);
|
34415
|
+
Object.defineProperty(exports, "normalizePath", ({ enumerable: true, get: function () { return normalize_path_1.normalizePath; } }));
|
34416
|
+
var convert_runtime_to_plugin_1 = __webpack_require__(7276);
|
34417
|
+
Object.defineProperty(exports, "convertRuntimeToPlugin", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1.convertRuntimeToPlugin; } }));
|
34418
|
+
Object.defineProperty(exports, "updateFunctionsManifest", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1.updateFunctionsManifest; } }));
|
34356
34419
|
__exportStar(__webpack_require__(2416), exports);
|
34357
34420
|
__exportStar(__webpack_require__(5748), exports);
|
34358
34421
|
__exportStar(__webpack_require__(3983), exports);
|
@@ -34408,7 +34471,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
34408
34471
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
34409
34472
|
};
|
34410
34473
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
34411
|
-
exports.getLambdaOptionsFromFunction = exports.createZip = exports.createLambda = exports.Lambda = void 0;
|
34474
|
+
exports.getLambdaOptionsFromFunction = exports.createZip = exports.createLambda = exports.Lambda = exports.FILES_SYMBOL = void 0;
|
34412
34475
|
const assert_1 = __importDefault(__webpack_require__(2357));
|
34413
34476
|
const async_sema_1 = __importDefault(__webpack_require__(5758));
|
34414
34477
|
const yazl_1 = __webpack_require__(1223);
|
@@ -34416,6 +34479,7 @@ const minimatch_1 = __importDefault(__webpack_require__(9566));
|
|
34416
34479
|
const fs_extra_1 = __webpack_require__(5392);
|
34417
34480
|
const download_1 = __webpack_require__(1611);
|
34418
34481
|
const stream_to_buffer_1 = __importDefault(__webpack_require__(2560));
|
34482
|
+
exports.FILES_SYMBOL = Symbol('files');
|
34419
34483
|
class Lambda {
|
34420
34484
|
constructor({ zipBuffer, handler, runtime, maxDuration, memory, environment, allowQuery, regions, }) {
|
34421
34485
|
this.type = 'Lambda';
|
@@ -34454,7 +34518,7 @@ async function createLambda({ files, handler, runtime, memory, maxDuration, envi
|
|
34454
34518
|
await sema.acquire();
|
34455
34519
|
try {
|
34456
34520
|
const zipBuffer = await createZip(files);
|
34457
|
-
|
34521
|
+
const lambda = new Lambda({
|
34458
34522
|
zipBuffer,
|
34459
34523
|
handler,
|
34460
34524
|
runtime,
|
@@ -34463,6 +34527,9 @@ async function createLambda({ files, handler, runtime, memory, maxDuration, envi
|
|
34463
34527
|
environment,
|
34464
34528
|
regions,
|
34465
34529
|
});
|
34530
|
+
// @ts-ignore This symbol is a private API
|
34531
|
+
lambda[exports.FILES_SYMBOL] = files;
|
34532
|
+
return lambda;
|
34466
34533
|
}
|
34467
34534
|
finally {
|
34468
34535
|
sema.release();
|