@rsdoctor/sdk 1.2.3 → 1.2.4-beta.1

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.
Files changed (148) hide show
  1. package/compiled/cors/index.d.ts +56 -0
  2. package/compiled/cors/index.js +550 -0
  3. package/compiled/cors/license +22 -0
  4. package/compiled/cors/package.json +1 -0
  5. package/compiled/dayjs/index.d.ts +428 -0
  6. package/compiled/dayjs/index.js +57 -0
  7. package/compiled/dayjs/license +21 -0
  8. package/compiled/dayjs/package.json +1 -0
  9. package/compiled/fs-extra/index.d.ts +1064 -0
  10. package/compiled/fs-extra/index.js +2839 -0
  11. package/compiled/fs-extra/license +15 -0
  12. package/compiled/fs-extra/package.json +1 -0
  13. package/dist/336.cjs +351 -0
  14. package/dist/795.js +357 -0
  15. package/dist/index.cjs +7241 -0
  16. package/dist/index.cjs.LICENSE.txt +111 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +7124 -0
  19. package/dist/index.js.LICENSE.txt +111 -0
  20. package/dist/{type/sdk → sdk}/index.d.ts +0 -1
  21. package/dist/{type/sdk → sdk}/multiple/controller.d.ts +0 -1
  22. package/dist/{type/sdk → sdk}/multiple/index.d.ts +0 -1
  23. package/dist/{type/sdk → sdk}/multiple/primary.d.ts +1 -2
  24. package/dist/{type/sdk → sdk}/multiple/server.d.ts +0 -1
  25. package/dist/{type/sdk → sdk}/sdk/core.d.ts +1 -2
  26. package/dist/{type/sdk → sdk}/sdk/index.d.ts +1 -2
  27. package/dist/{type/sdk → sdk}/sdk/types.d.ts +0 -1
  28. package/dist/{type/sdk → sdk}/server/apis/alerts.d.ts +0 -1
  29. package/dist/{type/sdk → sdk}/server/apis/base.d.ts +0 -1
  30. package/dist/{type/sdk → sdk}/server/apis/bundle-diff.d.ts +0 -1
  31. package/dist/{type/sdk → sdk}/server/apis/data.d.ts +0 -1
  32. package/dist/{type/sdk → sdk}/server/apis/fs.d.ts +0 -1
  33. package/dist/{type/sdk → sdk}/server/apis/graph.d.ts +0 -1
  34. package/dist/{type/sdk → sdk}/server/apis/index.d.ts +0 -1
  35. package/dist/{type/sdk → sdk}/server/apis/loader.d.ts +0 -1
  36. package/dist/{type/sdk → sdk}/server/apis/plugin.d.ts +0 -1
  37. package/dist/{type/sdk → sdk}/server/apis/project.d.ts +0 -1
  38. package/dist/{type/sdk → sdk}/server/apis/renderer.d.ts +0 -1
  39. package/dist/{type/sdk → sdk}/server/apis/resolver.d.ts +0 -1
  40. package/dist/{type/sdk → sdk}/server/fakeServer.d.ts +0 -1
  41. package/dist/{type/sdk → sdk}/server/index.d.ts +0 -1
  42. package/dist/{type/sdk → sdk}/server/router.d.ts +0 -1
  43. package/dist/{type/sdk → sdk}/server/socket/api.d.ts +1 -2
  44. package/dist/{type/sdk → sdk}/server/socket/index.d.ts +0 -1
  45. package/dist/{type/sdk → sdk}/server/utils.d.ts +0 -1
  46. package/dist/{type/sdk → sdk}/utils/base.d.ts +0 -1
  47. package/dist/{type/sdk → sdk}/utils/constant.d.ts +0 -1
  48. package/dist/{type/sdk → sdk}/utils/index.d.ts +0 -1
  49. package/dist/{type/sdk → sdk}/utils/openBrowser.d.ts +0 -1
  50. package/dist/{type/sdk → sdk}/utils/upload.d.ts +0 -1
  51. package/package.json +34 -23
  52. package/dist/cjs/index.js +0 -60
  53. package/dist/cjs/sdk/index.js +0 -69
  54. package/dist/cjs/sdk/multiple/controller.js +0 -75
  55. package/dist/cjs/sdk/multiple/index.js +0 -69
  56. package/dist/cjs/sdk/multiple/primary.js +0 -107
  57. package/dist/cjs/sdk/multiple/server.js +0 -47
  58. package/dist/cjs/sdk/sdk/core.js +0 -220
  59. package/dist/cjs/sdk/sdk/index.js +0 -510
  60. package/dist/cjs/sdk/sdk/types.js +0 -18
  61. package/dist/cjs/sdk/server/apis/alerts.js +0 -63
  62. package/dist/cjs/sdk/server/apis/base.js +0 -55
  63. package/dist/cjs/sdk/server/apis/bundle-diff.js +0 -87
  64. package/dist/cjs/sdk/server/apis/data.js +0 -77
  65. package/dist/cjs/sdk/server/apis/fs.js +0 -61
  66. package/dist/cjs/sdk/server/apis/graph.js +0 -149
  67. package/dist/cjs/sdk/server/apis/index.js +0 -132
  68. package/dist/cjs/sdk/server/apis/loader.js +0 -153
  69. package/dist/cjs/sdk/server/apis/plugin.js +0 -72
  70. package/dist/cjs/sdk/server/apis/project.js +0 -92
  71. package/dist/cjs/sdk/server/apis/renderer.js +0 -64
  72. package/dist/cjs/sdk/server/apis/resolver.js +0 -71
  73. package/dist/cjs/sdk/server/fakeServer.js +0 -44
  74. package/dist/cjs/sdk/server/index.js +0 -283
  75. package/dist/cjs/sdk/server/router.js +0 -114
  76. package/dist/cjs/sdk/server/socket/api.js +0 -55
  77. package/dist/cjs/sdk/server/socket/index.js +0 -105
  78. package/dist/cjs/sdk/server/utils.js +0 -65
  79. package/dist/cjs/sdk/utils/base.js +0 -66
  80. package/dist/cjs/sdk/utils/constant.js +0 -47
  81. package/dist/cjs/sdk/utils/index.js +0 -78
  82. package/dist/cjs/sdk/utils/openBrowser.js +0 -102
  83. package/dist/cjs/sdk/utils/upload.js +0 -39
  84. package/dist/esm/index.mjs +0 -1
  85. package/dist/esm/sdk/index.mjs +0 -2
  86. package/dist/esm/sdk/multiple/controller.mjs +0 -41
  87. package/dist/esm/sdk/multiple/index.mjs +0 -2
  88. package/dist/esm/sdk/multiple/primary.mjs +0 -63
  89. package/dist/esm/sdk/multiple/server.mjs +0 -13
  90. package/dist/esm/sdk/sdk/core.mjs +0 -175
  91. package/dist/esm/sdk/sdk/index.mjs +0 -460
  92. package/dist/esm/sdk/sdk/types.mjs +0 -0
  93. package/dist/esm/sdk/server/apis/alerts.mjs +0 -29
  94. package/dist/esm/sdk/server/apis/base.mjs +0 -21
  95. package/dist/esm/sdk/server/apis/bundle-diff.mjs +0 -53
  96. package/dist/esm/sdk/server/apis/data.mjs +0 -43
  97. package/dist/esm/sdk/server/apis/fs.mjs +0 -27
  98. package/dist/esm/sdk/server/apis/graph.mjs +0 -115
  99. package/dist/esm/sdk/server/apis/index.mjs +0 -9
  100. package/dist/esm/sdk/server/apis/loader.mjs +0 -119
  101. package/dist/esm/sdk/server/apis/plugin.mjs +0 -38
  102. package/dist/esm/sdk/server/apis/project.mjs +0 -58
  103. package/dist/esm/sdk/server/apis/renderer.mjs +0 -30
  104. package/dist/esm/sdk/server/apis/resolver.mjs +0 -37
  105. package/dist/esm/sdk/server/fakeServer.mjs +0 -10
  106. package/dist/esm/sdk/server/index.mjs +0 -170
  107. package/dist/esm/sdk/server/router.mjs +0 -80
  108. package/dist/esm/sdk/server/socket/api.mjs +0 -21
  109. package/dist/esm/sdk/server/socket/index.mjs +0 -71
  110. package/dist/esm/sdk/server/utils.mjs +0 -18
  111. package/dist/esm/sdk/utils/base.mjs +0 -21
  112. package/dist/esm/sdk/utils/constant.mjs +0 -3
  113. package/dist/esm/sdk/utils/index.mjs +0 -3
  114. package/dist/esm/sdk/utils/openBrowser.mjs +0 -50
  115. package/dist/esm/sdk/utils/upload.mjs +0 -5
  116. package/dist/type/index.d.ts +0 -2
  117. package/dist/type/index.d.ts.map +0 -1
  118. package/dist/type/sdk/index.d.ts.map +0 -1
  119. package/dist/type/sdk/multiple/controller.d.ts.map +0 -1
  120. package/dist/type/sdk/multiple/index.d.ts.map +0 -1
  121. package/dist/type/sdk/multiple/primary.d.ts.map +0 -1
  122. package/dist/type/sdk/multiple/server.d.ts.map +0 -1
  123. package/dist/type/sdk/sdk/core.d.ts.map +0 -1
  124. package/dist/type/sdk/sdk/index.d.ts.map +0 -1
  125. package/dist/type/sdk/sdk/types.d.ts.map +0 -1
  126. package/dist/type/sdk/server/apis/alerts.d.ts.map +0 -1
  127. package/dist/type/sdk/server/apis/base.d.ts.map +0 -1
  128. package/dist/type/sdk/server/apis/bundle-diff.d.ts.map +0 -1
  129. package/dist/type/sdk/server/apis/data.d.ts.map +0 -1
  130. package/dist/type/sdk/server/apis/fs.d.ts.map +0 -1
  131. package/dist/type/sdk/server/apis/graph.d.ts.map +0 -1
  132. package/dist/type/sdk/server/apis/index.d.ts.map +0 -1
  133. package/dist/type/sdk/server/apis/loader.d.ts.map +0 -1
  134. package/dist/type/sdk/server/apis/plugin.d.ts.map +0 -1
  135. package/dist/type/sdk/server/apis/project.d.ts.map +0 -1
  136. package/dist/type/sdk/server/apis/renderer.d.ts.map +0 -1
  137. package/dist/type/sdk/server/apis/resolver.d.ts.map +0 -1
  138. package/dist/type/sdk/server/fakeServer.d.ts.map +0 -1
  139. package/dist/type/sdk/server/index.d.ts.map +0 -1
  140. package/dist/type/sdk/server/router.d.ts.map +0 -1
  141. package/dist/type/sdk/server/socket/api.d.ts.map +0 -1
  142. package/dist/type/sdk/server/socket/index.d.ts.map +0 -1
  143. package/dist/type/sdk/server/utils.d.ts.map +0 -1
  144. package/dist/type/sdk/utils/base.d.ts.map +0 -1
  145. package/dist/type/sdk/utils/constant.d.ts.map +0 -1
  146. package/dist/type/sdk/utils/index.d.ts.map +0 -1
  147. package/dist/type/sdk/utils/openBrowser.d.ts.map +0 -1
  148. package/dist/type/sdk/utils/upload.d.ts.map +0 -1
@@ -0,0 +1,2839 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 724:
5
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
6
+
7
+ "use strict";
8
+
9
+
10
+ const fs = __nccwpck_require__(219)
11
+ const path = __nccwpck_require__(928)
12
+ const mkdirsSync = (__nccwpck_require__(382).mkdirsSync)
13
+ const utimesMillisSync = (__nccwpck_require__(235).utimesMillisSync)
14
+ const stat = __nccwpck_require__(742)
15
+
16
+ function copySync (src, dest, opts) {
17
+ if (typeof opts === 'function') {
18
+ opts = { filter: opts }
19
+ }
20
+
21
+ opts = opts || {}
22
+ opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
23
+ opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
24
+
25
+ // Warn about using preserveTimestamps on 32-bit node
26
+ if (opts.preserveTimestamps && process.arch === 'ia32') {
27
+ process.emitWarning(
28
+ 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
29
+ '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
30
+ 'Warning', 'fs-extra-WARN0002'
31
+ )
32
+ }
33
+
34
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
35
+ stat.checkParentPathsSync(src, srcStat, dest, 'copy')
36
+ if (opts.filter && !opts.filter(src, dest)) return
37
+ const destParent = path.dirname(dest)
38
+ if (!fs.existsSync(destParent)) mkdirsSync(destParent)
39
+ return getStats(destStat, src, dest, opts)
40
+ }
41
+
42
+ function getStats (destStat, src, dest, opts) {
43
+ const statSync = opts.dereference ? fs.statSync : fs.lstatSync
44
+ const srcStat = statSync(src)
45
+
46
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
47
+ else if (srcStat.isFile() ||
48
+ srcStat.isCharacterDevice() ||
49
+ srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
50
+ else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
51
+ else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
52
+ else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
53
+ throw new Error(`Unknown file: ${src}`)
54
+ }
55
+
56
+ function onFile (srcStat, destStat, src, dest, opts) {
57
+ if (!destStat) return copyFile(srcStat, src, dest, opts)
58
+ return mayCopyFile(srcStat, src, dest, opts)
59
+ }
60
+
61
+ function mayCopyFile (srcStat, src, dest, opts) {
62
+ if (opts.overwrite) {
63
+ fs.unlinkSync(dest)
64
+ return copyFile(srcStat, src, dest, opts)
65
+ } else if (opts.errorOnExist) {
66
+ throw new Error(`'${dest}' already exists`)
67
+ }
68
+ }
69
+
70
+ function copyFile (srcStat, src, dest, opts) {
71
+ fs.copyFileSync(src, dest)
72
+ if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
73
+ return setDestMode(dest, srcStat.mode)
74
+ }
75
+
76
+ function handleTimestamps (srcMode, src, dest) {
77
+ // Make sure the file is writable before setting the timestamp
78
+ // otherwise open fails with EPERM when invoked with 'r+'
79
+ // (through utimes call)
80
+ if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
81
+ return setDestTimestamps(src, dest)
82
+ }
83
+
84
+ function fileIsNotWritable (srcMode) {
85
+ return (srcMode & 0o200) === 0
86
+ }
87
+
88
+ function makeFileWritable (dest, srcMode) {
89
+ return setDestMode(dest, srcMode | 0o200)
90
+ }
91
+
92
+ function setDestMode (dest, srcMode) {
93
+ return fs.chmodSync(dest, srcMode)
94
+ }
95
+
96
+ function setDestTimestamps (src, dest) {
97
+ // The initial srcStat.atime cannot be trusted
98
+ // because it is modified by the read(2) system call
99
+ // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
100
+ const updatedSrcStat = fs.statSync(src)
101
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
102
+ }
103
+
104
+ function onDir (srcStat, destStat, src, dest, opts) {
105
+ if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
106
+ return copyDir(src, dest, opts)
107
+ }
108
+
109
+ function mkDirAndCopy (srcMode, src, dest, opts) {
110
+ fs.mkdirSync(dest)
111
+ copyDir(src, dest, opts)
112
+ return setDestMode(dest, srcMode)
113
+ }
114
+
115
+ function copyDir (src, dest, opts) {
116
+ const dir = fs.opendirSync(src)
117
+
118
+ try {
119
+ let dirent
120
+
121
+ while ((dirent = dir.readSync()) !== null) {
122
+ copyDirItem(dirent.name, src, dest, opts)
123
+ }
124
+ } finally {
125
+ dir.closeSync()
126
+ }
127
+ }
128
+
129
+ function copyDirItem (item, src, dest, opts) {
130
+ const srcItem = path.join(src, item)
131
+ const destItem = path.join(dest, item)
132
+ if (opts.filter && !opts.filter(srcItem, destItem)) return
133
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
134
+ return getStats(destStat, srcItem, destItem, opts)
135
+ }
136
+
137
+ function onLink (destStat, src, dest, opts) {
138
+ let resolvedSrc = fs.readlinkSync(src)
139
+ if (opts.dereference) {
140
+ resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
141
+ }
142
+
143
+ if (!destStat) {
144
+ return fs.symlinkSync(resolvedSrc, dest)
145
+ } else {
146
+ let resolvedDest
147
+ try {
148
+ resolvedDest = fs.readlinkSync(dest)
149
+ } catch (err) {
150
+ // dest exists and is a regular file or directory,
151
+ // Windows may throw UNKNOWN error. If dest already exists,
152
+ // fs throws error anyway, so no need to guard against it here.
153
+ if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
154
+ throw err
155
+ }
156
+ if (opts.dereference) {
157
+ resolvedDest = path.resolve(process.cwd(), resolvedDest)
158
+ }
159
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
160
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
161
+ }
162
+
163
+ // prevent copy if src is a subdir of dest since unlinking
164
+ // dest in this case would result in removing src contents
165
+ // and therefore a broken symlink would be created.
166
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
167
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
168
+ }
169
+ return copyLink(resolvedSrc, dest)
170
+ }
171
+ }
172
+
173
+ function copyLink (resolvedSrc, dest) {
174
+ fs.unlinkSync(dest)
175
+ return fs.symlinkSync(resolvedSrc, dest)
176
+ }
177
+
178
+ module.exports = copySync
179
+
180
+
181
+ /***/ }),
182
+
183
+ /***/ 170:
184
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
185
+
186
+ "use strict";
187
+
188
+
189
+ const fs = __nccwpck_require__(489)
190
+ const path = __nccwpck_require__(928)
191
+ const { mkdirs } = __nccwpck_require__(382)
192
+ const { pathExists } = __nccwpck_require__(432)
193
+ const { utimesMillis } = __nccwpck_require__(235)
194
+ const stat = __nccwpck_require__(742)
195
+
196
+ async function copy (src, dest, opts = {}) {
197
+ if (typeof opts === 'function') {
198
+ opts = { filter: opts }
199
+ }
200
+
201
+ opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
202
+ opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
203
+
204
+ // Warn about using preserveTimestamps on 32-bit node
205
+ if (opts.preserveTimestamps && process.arch === 'ia32') {
206
+ process.emitWarning(
207
+ 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
208
+ '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
209
+ 'Warning', 'fs-extra-WARN0001'
210
+ )
211
+ }
212
+
213
+ const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)
214
+
215
+ await stat.checkParentPaths(src, srcStat, dest, 'copy')
216
+
217
+ const include = await runFilter(src, dest, opts)
218
+
219
+ if (!include) return
220
+
221
+ // check if the parent of dest exists, and create it if it doesn't exist
222
+ const destParent = path.dirname(dest)
223
+ const dirExists = await pathExists(destParent)
224
+ if (!dirExists) {
225
+ await mkdirs(destParent)
226
+ }
227
+
228
+ await getStatsAndPerformCopy(destStat, src, dest, opts)
229
+ }
230
+
231
+ async function runFilter (src, dest, opts) {
232
+ if (!opts.filter) return true
233
+ return opts.filter(src, dest)
234
+ }
235
+
236
+ async function getStatsAndPerformCopy (destStat, src, dest, opts) {
237
+ const statFn = opts.dereference ? fs.stat : fs.lstat
238
+ const srcStat = await statFn(src)
239
+
240
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
241
+
242
+ if (
243
+ srcStat.isFile() ||
244
+ srcStat.isCharacterDevice() ||
245
+ srcStat.isBlockDevice()
246
+ ) return onFile(srcStat, destStat, src, dest, opts)
247
+
248
+ if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
249
+ if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
250
+ if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
251
+ throw new Error(`Unknown file: ${src}`)
252
+ }
253
+
254
+ async function onFile (srcStat, destStat, src, dest, opts) {
255
+ if (!destStat) return copyFile(srcStat, src, dest, opts)
256
+
257
+ if (opts.overwrite) {
258
+ await fs.unlink(dest)
259
+ return copyFile(srcStat, src, dest, opts)
260
+ }
261
+ if (opts.errorOnExist) {
262
+ throw new Error(`'${dest}' already exists`)
263
+ }
264
+ }
265
+
266
+ async function copyFile (srcStat, src, dest, opts) {
267
+ await fs.copyFile(src, dest)
268
+ if (opts.preserveTimestamps) {
269
+ // Make sure the file is writable before setting the timestamp
270
+ // otherwise open fails with EPERM when invoked with 'r+'
271
+ // (through utimes call)
272
+ if (fileIsNotWritable(srcStat.mode)) {
273
+ await makeFileWritable(dest, srcStat.mode)
274
+ }
275
+
276
+ // Set timestamps and mode correspondingly
277
+
278
+ // Note that The initial srcStat.atime cannot be trusted
279
+ // because it is modified by the read(2) system call
280
+ // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
281
+ const updatedSrcStat = await fs.stat(src)
282
+ await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
283
+ }
284
+
285
+ return fs.chmod(dest, srcStat.mode)
286
+ }
287
+
288
+ function fileIsNotWritable (srcMode) {
289
+ return (srcMode & 0o200) === 0
290
+ }
291
+
292
+ function makeFileWritable (dest, srcMode) {
293
+ return fs.chmod(dest, srcMode | 0o200)
294
+ }
295
+
296
+ async function onDir (srcStat, destStat, src, dest, opts) {
297
+ // the dest directory might not exist, create it
298
+ if (!destStat) {
299
+ await fs.mkdir(dest)
300
+ }
301
+
302
+ const promises = []
303
+
304
+ // loop through the files in the current directory to copy everything
305
+ for await (const item of await fs.opendir(src)) {
306
+ const srcItem = path.join(src, item.name)
307
+ const destItem = path.join(dest, item.name)
308
+
309
+ promises.push(
310
+ runFilter(srcItem, destItem, opts).then(include => {
311
+ if (include) {
312
+ // only copy the item if it matches the filter function
313
+ return stat.checkPaths(srcItem, destItem, 'copy', opts).then(({ destStat }) => {
314
+ // If the item is a copyable file, `getStatsAndPerformCopy` will copy it
315
+ // If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively
316
+ return getStatsAndPerformCopy(destStat, srcItem, destItem, opts)
317
+ })
318
+ }
319
+ })
320
+ )
321
+ }
322
+
323
+ await Promise.all(promises)
324
+
325
+ if (!destStat) {
326
+ await fs.chmod(dest, srcStat.mode)
327
+ }
328
+ }
329
+
330
+ async function onLink (destStat, src, dest, opts) {
331
+ let resolvedSrc = await fs.readlink(src)
332
+ if (opts.dereference) {
333
+ resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
334
+ }
335
+ if (!destStat) {
336
+ return fs.symlink(resolvedSrc, dest)
337
+ }
338
+
339
+ let resolvedDest = null
340
+ try {
341
+ resolvedDest = await fs.readlink(dest)
342
+ } catch (e) {
343
+ // dest exists and is a regular file or directory,
344
+ // Windows may throw UNKNOWN error. If dest already exists,
345
+ // fs throws error anyway, so no need to guard against it here.
346
+ if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)
347
+ throw e
348
+ }
349
+ if (opts.dereference) {
350
+ resolvedDest = path.resolve(process.cwd(), resolvedDest)
351
+ }
352
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
353
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
354
+ }
355
+
356
+ // do not copy if src is a subdir of dest since unlinking
357
+ // dest in this case would result in removing src contents
358
+ // and therefore a broken symlink would be created.
359
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
360
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
361
+ }
362
+
363
+ // copy the link
364
+ await fs.unlink(dest)
365
+ return fs.symlink(resolvedSrc, dest)
366
+ }
367
+
368
+ module.exports = copy
369
+
370
+
371
+ /***/ }),
372
+
373
+ /***/ 967:
374
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
375
+
376
+ "use strict";
377
+
378
+
379
+ const u = (__nccwpck_require__(979).fromPromise)
380
+ module.exports = {
381
+ copy: u(__nccwpck_require__(170)),
382
+ copySync: __nccwpck_require__(724)
383
+ }
384
+
385
+
386
+ /***/ }),
387
+
388
+ /***/ 999:
389
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
390
+
391
+ "use strict";
392
+
393
+
394
+ const u = (__nccwpck_require__(979).fromPromise)
395
+ const fs = __nccwpck_require__(489)
396
+ const path = __nccwpck_require__(928)
397
+ const mkdir = __nccwpck_require__(382)
398
+ const remove = __nccwpck_require__(654)
399
+
400
+ const emptyDir = u(async function emptyDir (dir) {
401
+ let items
402
+ try {
403
+ items = await fs.readdir(dir)
404
+ } catch {
405
+ return mkdir.mkdirs(dir)
406
+ }
407
+
408
+ return Promise.all(items.map(item => remove.remove(path.join(dir, item))))
409
+ })
410
+
411
+ function emptyDirSync (dir) {
412
+ let items
413
+ try {
414
+ items = fs.readdirSync(dir)
415
+ } catch {
416
+ return mkdir.mkdirsSync(dir)
417
+ }
418
+
419
+ items.forEach(item => {
420
+ item = path.join(dir, item)
421
+ remove.removeSync(item)
422
+ })
423
+ }
424
+
425
+ module.exports = {
426
+ emptyDirSync,
427
+ emptydirSync: emptyDirSync,
428
+ emptyDir,
429
+ emptydir: emptyDir
430
+ }
431
+
432
+
433
+ /***/ }),
434
+
435
+ /***/ 992:
436
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
437
+
438
+ "use strict";
439
+
440
+
441
+ const u = (__nccwpck_require__(979).fromPromise)
442
+ const path = __nccwpck_require__(928)
443
+ const fs = __nccwpck_require__(489)
444
+ const mkdir = __nccwpck_require__(382)
445
+
446
+ async function createFile (file) {
447
+ let stats
448
+ try {
449
+ stats = await fs.stat(file)
450
+ } catch { }
451
+ if (stats && stats.isFile()) return
452
+
453
+ const dir = path.dirname(file)
454
+
455
+ let dirStats = null
456
+ try {
457
+ dirStats = await fs.stat(dir)
458
+ } catch (err) {
459
+ // if the directory doesn't exist, make it
460
+ if (err.code === 'ENOENT') {
461
+ await mkdir.mkdirs(dir)
462
+ await fs.writeFile(file, '')
463
+ return
464
+ } else {
465
+ throw err
466
+ }
467
+ }
468
+
469
+ if (dirStats.isDirectory()) {
470
+ await fs.writeFile(file, '')
471
+ } else {
472
+ // parent is not a directory
473
+ // This is just to cause an internal ENOTDIR error to be thrown
474
+ await fs.readdir(dir)
475
+ }
476
+ }
477
+
478
+ function createFileSync (file) {
479
+ let stats
480
+ try {
481
+ stats = fs.statSync(file)
482
+ } catch { }
483
+ if (stats && stats.isFile()) return
484
+
485
+ const dir = path.dirname(file)
486
+ try {
487
+ if (!fs.statSync(dir).isDirectory()) {
488
+ // parent is not a directory
489
+ // This is just to cause an internal ENOTDIR error to be thrown
490
+ fs.readdirSync(dir)
491
+ }
492
+ } catch (err) {
493
+ // If the stat call above failed because the directory doesn't exist, create it
494
+ if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)
495
+ else throw err
496
+ }
497
+
498
+ fs.writeFileSync(file, '')
499
+ }
500
+
501
+ module.exports = {
502
+ createFile: u(createFile),
503
+ createFileSync
504
+ }
505
+
506
+
507
+ /***/ }),
508
+
509
+ /***/ 488:
510
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
511
+
512
+ "use strict";
513
+
514
+
515
+ const { createFile, createFileSync } = __nccwpck_require__(992)
516
+ const { createLink, createLinkSync } = __nccwpck_require__(298)
517
+ const { createSymlink, createSymlinkSync } = __nccwpck_require__(19)
518
+
519
+ module.exports = {
520
+ // file
521
+ createFile,
522
+ createFileSync,
523
+ ensureFile: createFile,
524
+ ensureFileSync: createFileSync,
525
+ // link
526
+ createLink,
527
+ createLinkSync,
528
+ ensureLink: createLink,
529
+ ensureLinkSync: createLinkSync,
530
+ // symlink
531
+ createSymlink,
532
+ createSymlinkSync,
533
+ ensureSymlink: createSymlink,
534
+ ensureSymlinkSync: createSymlinkSync
535
+ }
536
+
537
+
538
+ /***/ }),
539
+
540
+ /***/ 298:
541
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
542
+
543
+ "use strict";
544
+
545
+
546
+ const u = (__nccwpck_require__(979).fromPromise)
547
+ const path = __nccwpck_require__(928)
548
+ const fs = __nccwpck_require__(489)
549
+ const mkdir = __nccwpck_require__(382)
550
+ const { pathExists } = __nccwpck_require__(432)
551
+ const { areIdentical } = __nccwpck_require__(742)
552
+
553
+ async function createLink (srcpath, dstpath) {
554
+ let dstStat
555
+ try {
556
+ dstStat = await fs.lstat(dstpath)
557
+ } catch {
558
+ // ignore error
559
+ }
560
+
561
+ let srcStat
562
+ try {
563
+ srcStat = await fs.lstat(srcpath)
564
+ } catch (err) {
565
+ err.message = err.message.replace('lstat', 'ensureLink')
566
+ throw err
567
+ }
568
+
569
+ if (dstStat && areIdentical(srcStat, dstStat)) return
570
+
571
+ const dir = path.dirname(dstpath)
572
+
573
+ const dirExists = await pathExists(dir)
574
+
575
+ if (!dirExists) {
576
+ await mkdir.mkdirs(dir)
577
+ }
578
+
579
+ await fs.link(srcpath, dstpath)
580
+ }
581
+
582
+ function createLinkSync (srcpath, dstpath) {
583
+ let dstStat
584
+ try {
585
+ dstStat = fs.lstatSync(dstpath)
586
+ } catch {}
587
+
588
+ try {
589
+ const srcStat = fs.lstatSync(srcpath)
590
+ if (dstStat && areIdentical(srcStat, dstStat)) return
591
+ } catch (err) {
592
+ err.message = err.message.replace('lstat', 'ensureLink')
593
+ throw err
594
+ }
595
+
596
+ const dir = path.dirname(dstpath)
597
+ const dirExists = fs.existsSync(dir)
598
+ if (dirExists) return fs.linkSync(srcpath, dstpath)
599
+ mkdir.mkdirsSync(dir)
600
+
601
+ return fs.linkSync(srcpath, dstpath)
602
+ }
603
+
604
+ module.exports = {
605
+ createLink: u(createLink),
606
+ createLinkSync
607
+ }
608
+
609
+
610
+ /***/ }),
611
+
612
+ /***/ 462:
613
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
614
+
615
+ "use strict";
616
+
617
+
618
+ const path = __nccwpck_require__(928)
619
+ const fs = __nccwpck_require__(489)
620
+ const { pathExists } = __nccwpck_require__(432)
621
+
622
+ const u = (__nccwpck_require__(979).fromPromise)
623
+
624
+ /**
625
+ * Function that returns two types of paths, one relative to symlink, and one
626
+ * relative to the current working directory. Checks if path is absolute or
627
+ * relative. If the path is relative, this function checks if the path is
628
+ * relative to symlink or relative to current working directory. This is an
629
+ * initiative to find a smarter `srcpath` to supply when building symlinks.
630
+ * This allows you to determine which path to use out of one of three possible
631
+ * types of source paths. The first is an absolute path. This is detected by
632
+ * `path.isAbsolute()`. When an absolute path is provided, it is checked to
633
+ * see if it exists. If it does it's used, if not an error is returned
634
+ * (callback)/ thrown (sync). The other two options for `srcpath` are a
635
+ * relative url. By default Node's `fs.symlink` works by creating a symlink
636
+ * using `dstpath` and expects the `srcpath` to be relative to the newly
637
+ * created symlink. If you provide a `srcpath` that does not exist on the file
638
+ * system it results in a broken symlink. To minimize this, the function
639
+ * checks to see if the 'relative to symlink' source file exists, and if it
640
+ * does it will use it. If it does not, it checks if there's a file that
641
+ * exists that is relative to the current working directory, if does its used.
642
+ * This preserves the expectations of the original fs.symlink spec and adds
643
+ * the ability to pass in `relative to current working direcotry` paths.
644
+ */
645
+
646
+ async function symlinkPaths (srcpath, dstpath) {
647
+ if (path.isAbsolute(srcpath)) {
648
+ try {
649
+ await fs.lstat(srcpath)
650
+ } catch (err) {
651
+ err.message = err.message.replace('lstat', 'ensureSymlink')
652
+ throw err
653
+ }
654
+
655
+ return {
656
+ toCwd: srcpath,
657
+ toDst: srcpath
658
+ }
659
+ }
660
+
661
+ const dstdir = path.dirname(dstpath)
662
+ const relativeToDst = path.join(dstdir, srcpath)
663
+
664
+ const exists = await pathExists(relativeToDst)
665
+ if (exists) {
666
+ return {
667
+ toCwd: relativeToDst,
668
+ toDst: srcpath
669
+ }
670
+ }
671
+
672
+ try {
673
+ await fs.lstat(srcpath)
674
+ } catch (err) {
675
+ err.message = err.message.replace('lstat', 'ensureSymlink')
676
+ throw err
677
+ }
678
+
679
+ return {
680
+ toCwd: srcpath,
681
+ toDst: path.relative(dstdir, srcpath)
682
+ }
683
+ }
684
+
685
+ function symlinkPathsSync (srcpath, dstpath) {
686
+ if (path.isAbsolute(srcpath)) {
687
+ const exists = fs.existsSync(srcpath)
688
+ if (!exists) throw new Error('absolute srcpath does not exist')
689
+ return {
690
+ toCwd: srcpath,
691
+ toDst: srcpath
692
+ }
693
+ }
694
+
695
+ const dstdir = path.dirname(dstpath)
696
+ const relativeToDst = path.join(dstdir, srcpath)
697
+ const exists = fs.existsSync(relativeToDst)
698
+ if (exists) {
699
+ return {
700
+ toCwd: relativeToDst,
701
+ toDst: srcpath
702
+ }
703
+ }
704
+
705
+ const srcExists = fs.existsSync(srcpath)
706
+ if (!srcExists) throw new Error('relative srcpath does not exist')
707
+ return {
708
+ toCwd: srcpath,
709
+ toDst: path.relative(dstdir, srcpath)
710
+ }
711
+ }
712
+
713
+ module.exports = {
714
+ symlinkPaths: u(symlinkPaths),
715
+ symlinkPathsSync
716
+ }
717
+
718
+
719
+ /***/ }),
720
+
721
+ /***/ 984:
722
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
723
+
724
+ "use strict";
725
+
726
+
727
+ const fs = __nccwpck_require__(489)
728
+ const u = (__nccwpck_require__(979).fromPromise)
729
+
730
+ async function symlinkType (srcpath, type) {
731
+ if (type) return type
732
+
733
+ let stats
734
+ try {
735
+ stats = await fs.lstat(srcpath)
736
+ } catch {
737
+ return 'file'
738
+ }
739
+
740
+ return (stats && stats.isDirectory()) ? 'dir' : 'file'
741
+ }
742
+
743
+ function symlinkTypeSync (srcpath, type) {
744
+ if (type) return type
745
+
746
+ let stats
747
+ try {
748
+ stats = fs.lstatSync(srcpath)
749
+ } catch {
750
+ return 'file'
751
+ }
752
+ return (stats && stats.isDirectory()) ? 'dir' : 'file'
753
+ }
754
+
755
+ module.exports = {
756
+ symlinkType: u(symlinkType),
757
+ symlinkTypeSync
758
+ }
759
+
760
+
761
+ /***/ }),
762
+
763
+ /***/ 19:
764
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
765
+
766
+ "use strict";
767
+
768
+
769
+ const u = (__nccwpck_require__(979).fromPromise)
770
+ const path = __nccwpck_require__(928)
771
+ const fs = __nccwpck_require__(489)
772
+
773
+ const { mkdirs, mkdirsSync } = __nccwpck_require__(382)
774
+
775
+ const { symlinkPaths, symlinkPathsSync } = __nccwpck_require__(462)
776
+ const { symlinkType, symlinkTypeSync } = __nccwpck_require__(984)
777
+
778
+ const { pathExists } = __nccwpck_require__(432)
779
+
780
+ const { areIdentical } = __nccwpck_require__(742)
781
+
782
+ async function createSymlink (srcpath, dstpath, type) {
783
+ let stats
784
+ try {
785
+ stats = await fs.lstat(dstpath)
786
+ } catch { }
787
+
788
+ if (stats && stats.isSymbolicLink()) {
789
+ const [srcStat, dstStat] = await Promise.all([
790
+ fs.stat(srcpath),
791
+ fs.stat(dstpath)
792
+ ])
793
+
794
+ if (areIdentical(srcStat, dstStat)) return
795
+ }
796
+
797
+ const relative = await symlinkPaths(srcpath, dstpath)
798
+ srcpath = relative.toDst
799
+ const toType = await symlinkType(relative.toCwd, type)
800
+ const dir = path.dirname(dstpath)
801
+
802
+ if (!(await pathExists(dir))) {
803
+ await mkdirs(dir)
804
+ }
805
+
806
+ return fs.symlink(srcpath, dstpath, toType)
807
+ }
808
+
809
+ function createSymlinkSync (srcpath, dstpath, type) {
810
+ let stats
811
+ try {
812
+ stats = fs.lstatSync(dstpath)
813
+ } catch { }
814
+ if (stats && stats.isSymbolicLink()) {
815
+ const srcStat = fs.statSync(srcpath)
816
+ const dstStat = fs.statSync(dstpath)
817
+ if (areIdentical(srcStat, dstStat)) return
818
+ }
819
+
820
+ const relative = symlinkPathsSync(srcpath, dstpath)
821
+ srcpath = relative.toDst
822
+ type = symlinkTypeSync(relative.toCwd, type)
823
+ const dir = path.dirname(dstpath)
824
+ const exists = fs.existsSync(dir)
825
+ if (exists) return fs.symlinkSync(srcpath, dstpath, type)
826
+ mkdirsSync(dir)
827
+ return fs.symlinkSync(srcpath, dstpath, type)
828
+ }
829
+
830
+ module.exports = {
831
+ createSymlink: u(createSymlink),
832
+ createSymlinkSync
833
+ }
834
+
835
+
836
+ /***/ }),
837
+
838
+ /***/ 489:
839
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
840
+
841
+ "use strict";
842
+
843
+ // This is adapted from https://github.com/normalize/mz
844
+ // Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
845
+ const u = (__nccwpck_require__(979).fromCallback)
846
+ const fs = __nccwpck_require__(219)
847
+
848
+ const api = [
849
+ 'access',
850
+ 'appendFile',
851
+ 'chmod',
852
+ 'chown',
853
+ 'close',
854
+ 'copyFile',
855
+ 'cp',
856
+ 'fchmod',
857
+ 'fchown',
858
+ 'fdatasync',
859
+ 'fstat',
860
+ 'fsync',
861
+ 'ftruncate',
862
+ 'futimes',
863
+ 'glob',
864
+ 'lchmod',
865
+ 'lchown',
866
+ 'lutimes',
867
+ 'link',
868
+ 'lstat',
869
+ 'mkdir',
870
+ 'mkdtemp',
871
+ 'open',
872
+ 'opendir',
873
+ 'readdir',
874
+ 'readFile',
875
+ 'readlink',
876
+ 'realpath',
877
+ 'rename',
878
+ 'rm',
879
+ 'rmdir',
880
+ 'stat',
881
+ 'statfs',
882
+ 'symlink',
883
+ 'truncate',
884
+ 'unlink',
885
+ 'utimes',
886
+ 'writeFile'
887
+ ].filter(key => {
888
+ // Some commands are not available on some systems. Ex:
889
+ // fs.cp was added in Node.js v16.7.0
890
+ // fs.statfs was added in Node v19.6.0, v18.15.0
891
+ // fs.glob was added in Node.js v22.0.0
892
+ // fs.lchown is not available on at least some Linux
893
+ return typeof fs[key] === 'function'
894
+ })
895
+
896
+ // Export cloned fs:
897
+ Object.assign(exports, fs)
898
+
899
+ // Universalify async methods:
900
+ api.forEach(method => {
901
+ exports[method] = u(fs[method])
902
+ })
903
+
904
+ // We differ from mz/fs in that we still ship the old, broken, fs.exists()
905
+ // since we are a drop-in replacement for the native module
906
+ exports.exists = function (filename, callback) {
907
+ if (typeof callback === 'function') {
908
+ return fs.exists(filename, callback)
909
+ }
910
+ return new Promise(resolve => {
911
+ return fs.exists(filename, resolve)
912
+ })
913
+ }
914
+
915
+ // fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args
916
+
917
+ exports.read = function (fd, buffer, offset, length, position, callback) {
918
+ if (typeof callback === 'function') {
919
+ return fs.read(fd, buffer, offset, length, position, callback)
920
+ }
921
+ return new Promise((resolve, reject) => {
922
+ fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
923
+ if (err) return reject(err)
924
+ resolve({ bytesRead, buffer })
925
+ })
926
+ })
927
+ }
928
+
929
+ // Function signature can be
930
+ // fs.write(fd, buffer[, offset[, length[, position]]], callback)
931
+ // OR
932
+ // fs.write(fd, string[, position[, encoding]], callback)
933
+ // We need to handle both cases, so we use ...args
934
+ exports.write = function (fd, buffer, ...args) {
935
+ if (typeof args[args.length - 1] === 'function') {
936
+ return fs.write(fd, buffer, ...args)
937
+ }
938
+
939
+ return new Promise((resolve, reject) => {
940
+ fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {
941
+ if (err) return reject(err)
942
+ resolve({ bytesWritten, buffer })
943
+ })
944
+ })
945
+ }
946
+
947
+ // Function signature is
948
+ // s.readv(fd, buffers[, position], callback)
949
+ // We need to handle the optional arg, so we use ...args
950
+ exports.readv = function (fd, buffers, ...args) {
951
+ if (typeof args[args.length - 1] === 'function') {
952
+ return fs.readv(fd, buffers, ...args)
953
+ }
954
+
955
+ return new Promise((resolve, reject) => {
956
+ fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
957
+ if (err) return reject(err)
958
+ resolve({ bytesRead, buffers })
959
+ })
960
+ })
961
+ }
962
+
963
+ // Function signature is
964
+ // s.writev(fd, buffers[, position], callback)
965
+ // We need to handle the optional arg, so we use ...args
966
+ exports.writev = function (fd, buffers, ...args) {
967
+ if (typeof args[args.length - 1] === 'function') {
968
+ return fs.writev(fd, buffers, ...args)
969
+ }
970
+
971
+ return new Promise((resolve, reject) => {
972
+ fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
973
+ if (err) return reject(err)
974
+ resolve({ bytesWritten, buffers })
975
+ })
976
+ })
977
+ }
978
+
979
+ // fs.realpath.native sometimes not available if fs is monkey-patched
980
+ if (typeof fs.realpath.native === 'function') {
981
+ exports.realpath.native = u(fs.realpath.native)
982
+ } else {
983
+ process.emitWarning(
984
+ 'fs.realpath.native is not a function. Is fs being monkey-patched?',
985
+ 'Warning', 'fs-extra-WARN0003'
986
+ )
987
+ }
988
+
989
+
990
+ /***/ }),
991
+
992
+ /***/ 829:
993
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
994
+
995
+ "use strict";
996
+
997
+
998
+ module.exports = {
999
+ // Export promiseified graceful-fs:
1000
+ ...__nccwpck_require__(489),
1001
+ // Export extra methods:
1002
+ ...__nccwpck_require__(967),
1003
+ ...__nccwpck_require__(999),
1004
+ ...__nccwpck_require__(488),
1005
+ ...__nccwpck_require__(272),
1006
+ ...__nccwpck_require__(382),
1007
+ ...__nccwpck_require__(535),
1008
+ ...__nccwpck_require__(656),
1009
+ ...__nccwpck_require__(432),
1010
+ ...__nccwpck_require__(654)
1011
+ }
1012
+
1013
+
1014
+ /***/ }),
1015
+
1016
+ /***/ 272:
1017
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1018
+
1019
+ "use strict";
1020
+
1021
+
1022
+ const u = (__nccwpck_require__(979).fromPromise)
1023
+ const jsonFile = __nccwpck_require__(198)
1024
+
1025
+ jsonFile.outputJson = u(__nccwpck_require__(386))
1026
+ jsonFile.outputJsonSync = __nccwpck_require__(836)
1027
+ // aliases
1028
+ jsonFile.outputJSON = jsonFile.outputJson
1029
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync
1030
+ jsonFile.writeJSON = jsonFile.writeJson
1031
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync
1032
+ jsonFile.readJSON = jsonFile.readJson
1033
+ jsonFile.readJSONSync = jsonFile.readJsonSync
1034
+
1035
+ module.exports = jsonFile
1036
+
1037
+
1038
+ /***/ }),
1039
+
1040
+ /***/ 198:
1041
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1042
+
1043
+ "use strict";
1044
+
1045
+
1046
+ const jsonFile = __nccwpck_require__(779)
1047
+
1048
+ module.exports = {
1049
+ // jsonfile exports
1050
+ readJson: jsonFile.readFile,
1051
+ readJsonSync: jsonFile.readFileSync,
1052
+ writeJson: jsonFile.writeFile,
1053
+ writeJsonSync: jsonFile.writeFileSync
1054
+ }
1055
+
1056
+
1057
+ /***/ }),
1058
+
1059
+ /***/ 836:
1060
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1061
+
1062
+ "use strict";
1063
+
1064
+
1065
+ const { stringify } = __nccwpck_require__(830)
1066
+ const { outputFileSync } = __nccwpck_require__(656)
1067
+
1068
+ function outputJsonSync (file, data, options) {
1069
+ const str = stringify(data, options)
1070
+
1071
+ outputFileSync(file, str, options)
1072
+ }
1073
+
1074
+ module.exports = outputJsonSync
1075
+
1076
+
1077
+ /***/ }),
1078
+
1079
+ /***/ 386:
1080
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1081
+
1082
+ "use strict";
1083
+
1084
+
1085
+ const { stringify } = __nccwpck_require__(830)
1086
+ const { outputFile } = __nccwpck_require__(656)
1087
+
1088
+ async function outputJson (file, data, options = {}) {
1089
+ const str = stringify(data, options)
1090
+
1091
+ await outputFile(file, str, options)
1092
+ }
1093
+
1094
+ module.exports = outputJson
1095
+
1096
+
1097
+ /***/ }),
1098
+
1099
+ /***/ 382:
1100
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1101
+
1102
+ "use strict";
1103
+
1104
+ const u = (__nccwpck_require__(979).fromPromise)
1105
+ const { makeDir: _makeDir, makeDirSync } = __nccwpck_require__(892)
1106
+ const makeDir = u(_makeDir)
1107
+
1108
+ module.exports = {
1109
+ mkdirs: makeDir,
1110
+ mkdirsSync: makeDirSync,
1111
+ // alias
1112
+ mkdirp: makeDir,
1113
+ mkdirpSync: makeDirSync,
1114
+ ensureDir: makeDir,
1115
+ ensureDirSync: makeDirSync
1116
+ }
1117
+
1118
+
1119
+ /***/ }),
1120
+
1121
+ /***/ 892:
1122
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1123
+
1124
+ "use strict";
1125
+
1126
+ const fs = __nccwpck_require__(489)
1127
+ const { checkPath } = __nccwpck_require__(751)
1128
+
1129
+ const getMode = options => {
1130
+ const defaults = { mode: 0o777 }
1131
+ if (typeof options === 'number') return options
1132
+ return ({ ...defaults, ...options }).mode
1133
+ }
1134
+
1135
+ module.exports.makeDir = async (dir, options) => {
1136
+ checkPath(dir)
1137
+
1138
+ return fs.mkdir(dir, {
1139
+ mode: getMode(options),
1140
+ recursive: true
1141
+ })
1142
+ }
1143
+
1144
+ module.exports.makeDirSync = (dir, options) => {
1145
+ checkPath(dir)
1146
+
1147
+ return fs.mkdirSync(dir, {
1148
+ mode: getMode(options),
1149
+ recursive: true
1150
+ })
1151
+ }
1152
+
1153
+
1154
+ /***/ }),
1155
+
1156
+ /***/ 751:
1157
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1158
+
1159
+ "use strict";
1160
+ // Adapted from https://github.com/sindresorhus/make-dir
1161
+ // Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
1162
+ // 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:
1163
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1164
+ // 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.
1165
+
1166
+ const path = __nccwpck_require__(928)
1167
+
1168
+ // https://github.com/nodejs/node/issues/8987
1169
+ // https://github.com/libuv/libuv/pull/1088
1170
+ module.exports.checkPath = function checkPath (pth) {
1171
+ if (process.platform === 'win32') {
1172
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''))
1173
+
1174
+ if (pathHasInvalidWinCharacters) {
1175
+ const error = new Error(`Path contains invalid characters: ${pth}`)
1176
+ error.code = 'EINVAL'
1177
+ throw error
1178
+ }
1179
+ }
1180
+ }
1181
+
1182
+
1183
+ /***/ }),
1184
+
1185
+ /***/ 535:
1186
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1187
+
1188
+ "use strict";
1189
+
1190
+
1191
+ const u = (__nccwpck_require__(979).fromPromise)
1192
+ module.exports = {
1193
+ move: u(__nccwpck_require__(706)),
1194
+ moveSync: __nccwpck_require__(404)
1195
+ }
1196
+
1197
+
1198
+ /***/ }),
1199
+
1200
+ /***/ 404:
1201
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1202
+
1203
+ "use strict";
1204
+
1205
+
1206
+ const fs = __nccwpck_require__(219)
1207
+ const path = __nccwpck_require__(928)
1208
+ const copySync = (__nccwpck_require__(967).copySync)
1209
+ const removeSync = (__nccwpck_require__(654).removeSync)
1210
+ const mkdirpSync = (__nccwpck_require__(382).mkdirpSync)
1211
+ const stat = __nccwpck_require__(742)
1212
+
1213
+ function moveSync (src, dest, opts) {
1214
+ opts = opts || {}
1215
+ const overwrite = opts.overwrite || opts.clobber || false
1216
+
1217
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)
1218
+ stat.checkParentPathsSync(src, srcStat, dest, 'move')
1219
+ if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))
1220
+ return doRename(src, dest, overwrite, isChangingCase)
1221
+ }
1222
+
1223
+ function isParentRoot (dest) {
1224
+ const parent = path.dirname(dest)
1225
+ const parsedPath = path.parse(parent)
1226
+ return parsedPath.root === parent
1227
+ }
1228
+
1229
+ function doRename (src, dest, overwrite, isChangingCase) {
1230
+ if (isChangingCase) return rename(src, dest, overwrite)
1231
+ if (overwrite) {
1232
+ removeSync(dest)
1233
+ return rename(src, dest, overwrite)
1234
+ }
1235
+ if (fs.existsSync(dest)) throw new Error('dest already exists.')
1236
+ return rename(src, dest, overwrite)
1237
+ }
1238
+
1239
+ function rename (src, dest, overwrite) {
1240
+ try {
1241
+ fs.renameSync(src, dest)
1242
+ } catch (err) {
1243
+ if (err.code !== 'EXDEV') throw err
1244
+ return moveAcrossDevice(src, dest, overwrite)
1245
+ }
1246
+ }
1247
+
1248
+ function moveAcrossDevice (src, dest, overwrite) {
1249
+ const opts = {
1250
+ overwrite,
1251
+ errorOnExist: true,
1252
+ preserveTimestamps: true
1253
+ }
1254
+ copySync(src, dest, opts)
1255
+ return removeSync(src)
1256
+ }
1257
+
1258
+ module.exports = moveSync
1259
+
1260
+
1261
+ /***/ }),
1262
+
1263
+ /***/ 706:
1264
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1265
+
1266
+ "use strict";
1267
+
1268
+
1269
+ const fs = __nccwpck_require__(489)
1270
+ const path = __nccwpck_require__(928)
1271
+ const { copy } = __nccwpck_require__(967)
1272
+ const { remove } = __nccwpck_require__(654)
1273
+ const { mkdirp } = __nccwpck_require__(382)
1274
+ const { pathExists } = __nccwpck_require__(432)
1275
+ const stat = __nccwpck_require__(742)
1276
+
1277
+ async function move (src, dest, opts = {}) {
1278
+ const overwrite = opts.overwrite || opts.clobber || false
1279
+
1280
+ const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts)
1281
+
1282
+ await stat.checkParentPaths(src, srcStat, dest, 'move')
1283
+
1284
+ // If the parent of dest is not root, make sure it exists before proceeding
1285
+ const destParent = path.dirname(dest)
1286
+ const parsedParentPath = path.parse(destParent)
1287
+ if (parsedParentPath.root !== destParent) {
1288
+ await mkdirp(destParent)
1289
+ }
1290
+
1291
+ return doRename(src, dest, overwrite, isChangingCase)
1292
+ }
1293
+
1294
+ async function doRename (src, dest, overwrite, isChangingCase) {
1295
+ if (!isChangingCase) {
1296
+ if (overwrite) {
1297
+ await remove(dest)
1298
+ } else if (await pathExists(dest)) {
1299
+ throw new Error('dest already exists.')
1300
+ }
1301
+ }
1302
+
1303
+ try {
1304
+ // Try w/ rename first, and try copy + remove if EXDEV
1305
+ await fs.rename(src, dest)
1306
+ } catch (err) {
1307
+ if (err.code !== 'EXDEV') {
1308
+ throw err
1309
+ }
1310
+ await moveAcrossDevice(src, dest, overwrite)
1311
+ }
1312
+ }
1313
+
1314
+ async function moveAcrossDevice (src, dest, overwrite) {
1315
+ const opts = {
1316
+ overwrite,
1317
+ errorOnExist: true,
1318
+ preserveTimestamps: true
1319
+ }
1320
+
1321
+ await copy(src, dest, opts)
1322
+ return remove(src)
1323
+ }
1324
+
1325
+ module.exports = move
1326
+
1327
+
1328
+ /***/ }),
1329
+
1330
+ /***/ 656:
1331
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1332
+
1333
+ "use strict";
1334
+
1335
+
1336
+ const u = (__nccwpck_require__(979).fromPromise)
1337
+ const fs = __nccwpck_require__(489)
1338
+ const path = __nccwpck_require__(928)
1339
+ const mkdir = __nccwpck_require__(382)
1340
+ const pathExists = (__nccwpck_require__(432).pathExists)
1341
+
1342
+ async function outputFile (file, data, encoding = 'utf-8') {
1343
+ const dir = path.dirname(file)
1344
+
1345
+ if (!(await pathExists(dir))) {
1346
+ await mkdir.mkdirs(dir)
1347
+ }
1348
+
1349
+ return fs.writeFile(file, data, encoding)
1350
+ }
1351
+
1352
+ function outputFileSync (file, ...args) {
1353
+ const dir = path.dirname(file)
1354
+ if (!fs.existsSync(dir)) {
1355
+ mkdir.mkdirsSync(dir)
1356
+ }
1357
+
1358
+ fs.writeFileSync(file, ...args)
1359
+ }
1360
+
1361
+ module.exports = {
1362
+ outputFile: u(outputFile),
1363
+ outputFileSync
1364
+ }
1365
+
1366
+
1367
+ /***/ }),
1368
+
1369
+ /***/ 432:
1370
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1371
+
1372
+ "use strict";
1373
+
1374
+ const u = (__nccwpck_require__(979).fromPromise)
1375
+ const fs = __nccwpck_require__(489)
1376
+
1377
+ function pathExists (path) {
1378
+ return fs.access(path).then(() => true).catch(() => false)
1379
+ }
1380
+
1381
+ module.exports = {
1382
+ pathExists: u(pathExists),
1383
+ pathExistsSync: fs.existsSync
1384
+ }
1385
+
1386
+
1387
+ /***/ }),
1388
+
1389
+ /***/ 654:
1390
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1391
+
1392
+ "use strict";
1393
+
1394
+
1395
+ const fs = __nccwpck_require__(219)
1396
+ const u = (__nccwpck_require__(979).fromCallback)
1397
+
1398
+ function remove (path, callback) {
1399
+ fs.rm(path, { recursive: true, force: true }, callback)
1400
+ }
1401
+
1402
+ function removeSync (path) {
1403
+ fs.rmSync(path, { recursive: true, force: true })
1404
+ }
1405
+
1406
+ module.exports = {
1407
+ remove: u(remove),
1408
+ removeSync
1409
+ }
1410
+
1411
+
1412
+ /***/ }),
1413
+
1414
+ /***/ 742:
1415
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1416
+
1417
+ "use strict";
1418
+
1419
+
1420
+ const fs = __nccwpck_require__(489)
1421
+ const path = __nccwpck_require__(928)
1422
+ const u = (__nccwpck_require__(979).fromPromise)
1423
+
1424
+ function getStats (src, dest, opts) {
1425
+ const statFunc = opts.dereference
1426
+ ? (file) => fs.stat(file, { bigint: true })
1427
+ : (file) => fs.lstat(file, { bigint: true })
1428
+ return Promise.all([
1429
+ statFunc(src),
1430
+ statFunc(dest).catch(err => {
1431
+ if (err.code === 'ENOENT') return null
1432
+ throw err
1433
+ })
1434
+ ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))
1435
+ }
1436
+
1437
+ function getStatsSync (src, dest, opts) {
1438
+ let destStat
1439
+ const statFunc = opts.dereference
1440
+ ? (file) => fs.statSync(file, { bigint: true })
1441
+ : (file) => fs.lstatSync(file, { bigint: true })
1442
+ const srcStat = statFunc(src)
1443
+ try {
1444
+ destStat = statFunc(dest)
1445
+ } catch (err) {
1446
+ if (err.code === 'ENOENT') return { srcStat, destStat: null }
1447
+ throw err
1448
+ }
1449
+ return { srcStat, destStat }
1450
+ }
1451
+
1452
+ async function checkPaths (src, dest, funcName, opts) {
1453
+ const { srcStat, destStat } = await getStats(src, dest, opts)
1454
+ if (destStat) {
1455
+ if (areIdentical(srcStat, destStat)) {
1456
+ const srcBaseName = path.basename(src)
1457
+ const destBaseName = path.basename(dest)
1458
+ if (funcName === 'move' &&
1459
+ srcBaseName !== destBaseName &&
1460
+ srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1461
+ return { srcStat, destStat, isChangingCase: true }
1462
+ }
1463
+ throw new Error('Source and destination must not be the same.')
1464
+ }
1465
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1466
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
1467
+ }
1468
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1469
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
1470
+ }
1471
+ }
1472
+
1473
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1474
+ throw new Error(errMsg(src, dest, funcName))
1475
+ }
1476
+
1477
+ return { srcStat, destStat }
1478
+ }
1479
+
1480
+ function checkPathsSync (src, dest, funcName, opts) {
1481
+ const { srcStat, destStat } = getStatsSync(src, dest, opts)
1482
+
1483
+ if (destStat) {
1484
+ if (areIdentical(srcStat, destStat)) {
1485
+ const srcBaseName = path.basename(src)
1486
+ const destBaseName = path.basename(dest)
1487
+ if (funcName === 'move' &&
1488
+ srcBaseName !== destBaseName &&
1489
+ srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1490
+ return { srcStat, destStat, isChangingCase: true }
1491
+ }
1492
+ throw new Error('Source and destination must not be the same.')
1493
+ }
1494
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1495
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
1496
+ }
1497
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1498
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
1499
+ }
1500
+ }
1501
+
1502
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1503
+ throw new Error(errMsg(src, dest, funcName))
1504
+ }
1505
+ return { srcStat, destStat }
1506
+ }
1507
+
1508
+ // recursively check if dest parent is a subdirectory of src.
1509
+ // It works for all file types including symlinks since it
1510
+ // checks the src and dest inodes. It starts from the deepest
1511
+ // parent and stops once it reaches the src parent or the root path.
1512
+ async function checkParentPaths (src, srcStat, dest, funcName) {
1513
+ const srcParent = path.resolve(path.dirname(src))
1514
+ const destParent = path.resolve(path.dirname(dest))
1515
+ if (destParent === srcParent || destParent === path.parse(destParent).root) return
1516
+
1517
+ let destStat
1518
+ try {
1519
+ destStat = await fs.stat(destParent, { bigint: true })
1520
+ } catch (err) {
1521
+ if (err.code === 'ENOENT') return
1522
+ throw err
1523
+ }
1524
+
1525
+ if (areIdentical(srcStat, destStat)) {
1526
+ throw new Error(errMsg(src, dest, funcName))
1527
+ }
1528
+
1529
+ return checkParentPaths(src, srcStat, destParent, funcName)
1530
+ }
1531
+
1532
+ function checkParentPathsSync (src, srcStat, dest, funcName) {
1533
+ const srcParent = path.resolve(path.dirname(src))
1534
+ const destParent = path.resolve(path.dirname(dest))
1535
+ if (destParent === srcParent || destParent === path.parse(destParent).root) return
1536
+ let destStat
1537
+ try {
1538
+ destStat = fs.statSync(destParent, { bigint: true })
1539
+ } catch (err) {
1540
+ if (err.code === 'ENOENT') return
1541
+ throw err
1542
+ }
1543
+ if (areIdentical(srcStat, destStat)) {
1544
+ throw new Error(errMsg(src, dest, funcName))
1545
+ }
1546
+ return checkParentPathsSync(src, srcStat, destParent, funcName)
1547
+ }
1548
+
1549
+ function areIdentical (srcStat, destStat) {
1550
+ return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev
1551
+ }
1552
+
1553
+ // return true if dest is a subdir of src, otherwise false.
1554
+ // It only checks the path strings.
1555
+ function isSrcSubdir (src, dest) {
1556
+ const srcArr = path.resolve(src).split(path.sep).filter(i => i)
1557
+ const destArr = path.resolve(dest).split(path.sep).filter(i => i)
1558
+ return srcArr.every((cur, i) => destArr[i] === cur)
1559
+ }
1560
+
1561
+ function errMsg (src, dest, funcName) {
1562
+ return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`
1563
+ }
1564
+
1565
+ module.exports = {
1566
+ // checkPaths
1567
+ checkPaths: u(checkPaths),
1568
+ checkPathsSync,
1569
+ // checkParent
1570
+ checkParentPaths: u(checkParentPaths),
1571
+ checkParentPathsSync,
1572
+ // Misc
1573
+ isSrcSubdir,
1574
+ areIdentical
1575
+ }
1576
+
1577
+
1578
+ /***/ }),
1579
+
1580
+ /***/ 235:
1581
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1582
+
1583
+ "use strict";
1584
+
1585
+
1586
+ const fs = __nccwpck_require__(489)
1587
+ const u = (__nccwpck_require__(979).fromPromise)
1588
+
1589
+ async function utimesMillis (path, atime, mtime) {
1590
+ // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
1591
+ const fd = await fs.open(path, 'r+')
1592
+
1593
+ let closeErr = null
1594
+
1595
+ try {
1596
+ await fs.futimes(fd, atime, mtime)
1597
+ } finally {
1598
+ try {
1599
+ await fs.close(fd)
1600
+ } catch (e) {
1601
+ closeErr = e
1602
+ }
1603
+ }
1604
+
1605
+ if (closeErr) {
1606
+ throw closeErr
1607
+ }
1608
+ }
1609
+
1610
+ function utimesMillisSync (path, atime, mtime) {
1611
+ const fd = fs.openSync(path, 'r+')
1612
+ fs.futimesSync(fd, atime, mtime)
1613
+ return fs.closeSync(fd)
1614
+ }
1615
+
1616
+ module.exports = {
1617
+ utimesMillis: u(utimesMillis),
1618
+ utimesMillisSync
1619
+ }
1620
+
1621
+
1622
+ /***/ }),
1623
+
1624
+ /***/ 767:
1625
+ /***/ ((module) => {
1626
+
1627
+ "use strict";
1628
+
1629
+
1630
+ module.exports = clone
1631
+
1632
+ var getPrototypeOf = Object.getPrototypeOf || function (obj) {
1633
+ return obj.__proto__
1634
+ }
1635
+
1636
+ function clone (obj) {
1637
+ if (obj === null || typeof obj !== 'object')
1638
+ return obj
1639
+
1640
+ if (obj instanceof Object)
1641
+ var copy = { __proto__: getPrototypeOf(obj) }
1642
+ else
1643
+ var copy = Object.create(null)
1644
+
1645
+ Object.getOwnPropertyNames(obj).forEach(function (key) {
1646
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
1647
+ })
1648
+
1649
+ return copy
1650
+ }
1651
+
1652
+
1653
+ /***/ }),
1654
+
1655
+ /***/ 219:
1656
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1657
+
1658
+ var fs = __nccwpck_require__(896)
1659
+ var polyfills = __nccwpck_require__(190)
1660
+ var legacy = __nccwpck_require__(383)
1661
+ var clone = __nccwpck_require__(767)
1662
+
1663
+ var util = __nccwpck_require__(23)
1664
+
1665
+ /* istanbul ignore next - node 0.x polyfill */
1666
+ var gracefulQueue
1667
+ var previousSymbol
1668
+
1669
+ /* istanbul ignore else - node 0.x polyfill */
1670
+ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
1671
+ gracefulQueue = Symbol.for('graceful-fs.queue')
1672
+ // This is used in testing by future versions
1673
+ previousSymbol = Symbol.for('graceful-fs.previous')
1674
+ } else {
1675
+ gracefulQueue = '___graceful-fs.queue'
1676
+ previousSymbol = '___graceful-fs.previous'
1677
+ }
1678
+
1679
+ function noop () {}
1680
+
1681
+ function publishQueue(context, queue) {
1682
+ Object.defineProperty(context, gracefulQueue, {
1683
+ get: function() {
1684
+ return queue
1685
+ }
1686
+ })
1687
+ }
1688
+
1689
+ var debug = noop
1690
+ if (util.debuglog)
1691
+ debug = util.debuglog('gfs4')
1692
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
1693
+ debug = function() {
1694
+ var m = util.format.apply(util, arguments)
1695
+ m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
1696
+ console.error(m)
1697
+ }
1698
+
1699
+ // Once time initialization
1700
+ if (!fs[gracefulQueue]) {
1701
+ // This queue can be shared by multiple loaded instances
1702
+ var queue = global[gracefulQueue] || []
1703
+ publishQueue(fs, queue)
1704
+
1705
+ // Patch fs.close/closeSync to shared queue version, because we need
1706
+ // to retry() whenever a close happens *anywhere* in the program.
1707
+ // This is essential when multiple graceful-fs instances are
1708
+ // in play at the same time.
1709
+ fs.close = (function (fs$close) {
1710
+ function close (fd, cb) {
1711
+ return fs$close.call(fs, fd, function (err) {
1712
+ // This function uses the graceful-fs shared queue
1713
+ if (!err) {
1714
+ resetQueue()
1715
+ }
1716
+
1717
+ if (typeof cb === 'function')
1718
+ cb.apply(this, arguments)
1719
+ })
1720
+ }
1721
+
1722
+ Object.defineProperty(close, previousSymbol, {
1723
+ value: fs$close
1724
+ })
1725
+ return close
1726
+ })(fs.close)
1727
+
1728
+ fs.closeSync = (function (fs$closeSync) {
1729
+ function closeSync (fd) {
1730
+ // This function uses the graceful-fs shared queue
1731
+ fs$closeSync.apply(fs, arguments)
1732
+ resetQueue()
1733
+ }
1734
+
1735
+ Object.defineProperty(closeSync, previousSymbol, {
1736
+ value: fs$closeSync
1737
+ })
1738
+ return closeSync
1739
+ })(fs.closeSync)
1740
+
1741
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
1742
+ process.on('exit', function() {
1743
+ debug(fs[gracefulQueue])
1744
+ __nccwpck_require__(613).equal(fs[gracefulQueue].length, 0)
1745
+ })
1746
+ }
1747
+ }
1748
+
1749
+ if (!global[gracefulQueue]) {
1750
+ publishQueue(global, fs[gracefulQueue]);
1751
+ }
1752
+
1753
+ module.exports = patch(clone(fs))
1754
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
1755
+ module.exports = patch(fs)
1756
+ fs.__patched = true;
1757
+ }
1758
+
1759
+ function patch (fs) {
1760
+ // Everything that references the open() function needs to be in here
1761
+ polyfills(fs)
1762
+ fs.gracefulify = patch
1763
+
1764
+ fs.createReadStream = createReadStream
1765
+ fs.createWriteStream = createWriteStream
1766
+ var fs$readFile = fs.readFile
1767
+ fs.readFile = readFile
1768
+ function readFile (path, options, cb) {
1769
+ if (typeof options === 'function')
1770
+ cb = options, options = null
1771
+
1772
+ return go$readFile(path, options, cb)
1773
+
1774
+ function go$readFile (path, options, cb, startTime) {
1775
+ return fs$readFile(path, options, function (err) {
1776
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
1777
+ enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])
1778
+ else {
1779
+ if (typeof cb === 'function')
1780
+ cb.apply(this, arguments)
1781
+ }
1782
+ })
1783
+ }
1784
+ }
1785
+
1786
+ var fs$writeFile = fs.writeFile
1787
+ fs.writeFile = writeFile
1788
+ function writeFile (path, data, options, cb) {
1789
+ if (typeof options === 'function')
1790
+ cb = options, options = null
1791
+
1792
+ return go$writeFile(path, data, options, cb)
1793
+
1794
+ function go$writeFile (path, data, options, cb, startTime) {
1795
+ return fs$writeFile(path, data, options, function (err) {
1796
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
1797
+ enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
1798
+ else {
1799
+ if (typeof cb === 'function')
1800
+ cb.apply(this, arguments)
1801
+ }
1802
+ })
1803
+ }
1804
+ }
1805
+
1806
+ var fs$appendFile = fs.appendFile
1807
+ if (fs$appendFile)
1808
+ fs.appendFile = appendFile
1809
+ function appendFile (path, data, options, cb) {
1810
+ if (typeof options === 'function')
1811
+ cb = options, options = null
1812
+
1813
+ return go$appendFile(path, data, options, cb)
1814
+
1815
+ function go$appendFile (path, data, options, cb, startTime) {
1816
+ return fs$appendFile(path, data, options, function (err) {
1817
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
1818
+ enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
1819
+ else {
1820
+ if (typeof cb === 'function')
1821
+ cb.apply(this, arguments)
1822
+ }
1823
+ })
1824
+ }
1825
+ }
1826
+
1827
+ var fs$copyFile = fs.copyFile
1828
+ if (fs$copyFile)
1829
+ fs.copyFile = copyFile
1830
+ function copyFile (src, dest, flags, cb) {
1831
+ if (typeof flags === 'function') {
1832
+ cb = flags
1833
+ flags = 0
1834
+ }
1835
+ return go$copyFile(src, dest, flags, cb)
1836
+
1837
+ function go$copyFile (src, dest, flags, cb, startTime) {
1838
+ return fs$copyFile(src, dest, flags, function (err) {
1839
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
1840
+ enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
1841
+ else {
1842
+ if (typeof cb === 'function')
1843
+ cb.apply(this, arguments)
1844
+ }
1845
+ })
1846
+ }
1847
+ }
1848
+
1849
+ var fs$readdir = fs.readdir
1850
+ fs.readdir = readdir
1851
+ var noReaddirOptionVersions = /^v[0-5]\./
1852
+ function readdir (path, options, cb) {
1853
+ if (typeof options === 'function')
1854
+ cb = options, options = null
1855
+
1856
+ var go$readdir = noReaddirOptionVersions.test(process.version)
1857
+ ? function go$readdir (path, options, cb, startTime) {
1858
+ return fs$readdir(path, fs$readdirCallback(
1859
+ path, options, cb, startTime
1860
+ ))
1861
+ }
1862
+ : function go$readdir (path, options, cb, startTime) {
1863
+ return fs$readdir(path, options, fs$readdirCallback(
1864
+ path, options, cb, startTime
1865
+ ))
1866
+ }
1867
+
1868
+ return go$readdir(path, options, cb)
1869
+
1870
+ function fs$readdirCallback (path, options, cb, startTime) {
1871
+ return function (err, files) {
1872
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
1873
+ enqueue([
1874
+ go$readdir,
1875
+ [path, options, cb],
1876
+ err,
1877
+ startTime || Date.now(),
1878
+ Date.now()
1879
+ ])
1880
+ else {
1881
+ if (files && files.sort)
1882
+ files.sort()
1883
+
1884
+ if (typeof cb === 'function')
1885
+ cb.call(this, err, files)
1886
+ }
1887
+ }
1888
+ }
1889
+ }
1890
+
1891
+ if (process.version.substr(0, 4) === 'v0.8') {
1892
+ var legStreams = legacy(fs)
1893
+ ReadStream = legStreams.ReadStream
1894
+ WriteStream = legStreams.WriteStream
1895
+ }
1896
+
1897
+ var fs$ReadStream = fs.ReadStream
1898
+ if (fs$ReadStream) {
1899
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype)
1900
+ ReadStream.prototype.open = ReadStream$open
1901
+ }
1902
+
1903
+ var fs$WriteStream = fs.WriteStream
1904
+ if (fs$WriteStream) {
1905
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype)
1906
+ WriteStream.prototype.open = WriteStream$open
1907
+ }
1908
+
1909
+ Object.defineProperty(fs, 'ReadStream', {
1910
+ get: function () {
1911
+ return ReadStream
1912
+ },
1913
+ set: function (val) {
1914
+ ReadStream = val
1915
+ },
1916
+ enumerable: true,
1917
+ configurable: true
1918
+ })
1919
+ Object.defineProperty(fs, 'WriteStream', {
1920
+ get: function () {
1921
+ return WriteStream
1922
+ },
1923
+ set: function (val) {
1924
+ WriteStream = val
1925
+ },
1926
+ enumerable: true,
1927
+ configurable: true
1928
+ })
1929
+
1930
+ // legacy names
1931
+ var FileReadStream = ReadStream
1932
+ Object.defineProperty(fs, 'FileReadStream', {
1933
+ get: function () {
1934
+ return FileReadStream
1935
+ },
1936
+ set: function (val) {
1937
+ FileReadStream = val
1938
+ },
1939
+ enumerable: true,
1940
+ configurable: true
1941
+ })
1942
+ var FileWriteStream = WriteStream
1943
+ Object.defineProperty(fs, 'FileWriteStream', {
1944
+ get: function () {
1945
+ return FileWriteStream
1946
+ },
1947
+ set: function (val) {
1948
+ FileWriteStream = val
1949
+ },
1950
+ enumerable: true,
1951
+ configurable: true
1952
+ })
1953
+
1954
+ function ReadStream (path, options) {
1955
+ if (this instanceof ReadStream)
1956
+ return fs$ReadStream.apply(this, arguments), this
1957
+ else
1958
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
1959
+ }
1960
+
1961
+ function ReadStream$open () {
1962
+ var that = this
1963
+ open(that.path, that.flags, that.mode, function (err, fd) {
1964
+ if (err) {
1965
+ if (that.autoClose)
1966
+ that.destroy()
1967
+
1968
+ that.emit('error', err)
1969
+ } else {
1970
+ that.fd = fd
1971
+ that.emit('open', fd)
1972
+ that.read()
1973
+ }
1974
+ })
1975
+ }
1976
+
1977
+ function WriteStream (path, options) {
1978
+ if (this instanceof WriteStream)
1979
+ return fs$WriteStream.apply(this, arguments), this
1980
+ else
1981
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
1982
+ }
1983
+
1984
+ function WriteStream$open () {
1985
+ var that = this
1986
+ open(that.path, that.flags, that.mode, function (err, fd) {
1987
+ if (err) {
1988
+ that.destroy()
1989
+ that.emit('error', err)
1990
+ } else {
1991
+ that.fd = fd
1992
+ that.emit('open', fd)
1993
+ }
1994
+ })
1995
+ }
1996
+
1997
+ function createReadStream (path, options) {
1998
+ return new fs.ReadStream(path, options)
1999
+ }
2000
+
2001
+ function createWriteStream (path, options) {
2002
+ return new fs.WriteStream(path, options)
2003
+ }
2004
+
2005
+ var fs$open = fs.open
2006
+ fs.open = open
2007
+ function open (path, flags, mode, cb) {
2008
+ if (typeof mode === 'function')
2009
+ cb = mode, mode = null
2010
+
2011
+ return go$open(path, flags, mode, cb)
2012
+
2013
+ function go$open (path, flags, mode, cb, startTime) {
2014
+ return fs$open(path, flags, mode, function (err, fd) {
2015
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
2016
+ enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])
2017
+ else {
2018
+ if (typeof cb === 'function')
2019
+ cb.apply(this, arguments)
2020
+ }
2021
+ })
2022
+ }
2023
+ }
2024
+
2025
+ return fs
2026
+ }
2027
+
2028
+ function enqueue (elem) {
2029
+ debug('ENQUEUE', elem[0].name, elem[1])
2030
+ fs[gracefulQueue].push(elem)
2031
+ retry()
2032
+ }
2033
+
2034
+ // keep track of the timeout between retry() calls
2035
+ var retryTimer
2036
+
2037
+ // reset the startTime and lastTime to now
2038
+ // this resets the start of the 60 second overall timeout as well as the
2039
+ // delay between attempts so that we'll retry these jobs sooner
2040
+ function resetQueue () {
2041
+ var now = Date.now()
2042
+ for (var i = 0; i < fs[gracefulQueue].length; ++i) {
2043
+ // entries that are only a length of 2 are from an older version, don't
2044
+ // bother modifying those since they'll be retried anyway.
2045
+ if (fs[gracefulQueue][i].length > 2) {
2046
+ fs[gracefulQueue][i][3] = now // startTime
2047
+ fs[gracefulQueue][i][4] = now // lastTime
2048
+ }
2049
+ }
2050
+ // call retry to make sure we're actively processing the queue
2051
+ retry()
2052
+ }
2053
+
2054
+ function retry () {
2055
+ // clear the timer and remove it to help prevent unintended concurrency
2056
+ clearTimeout(retryTimer)
2057
+ retryTimer = undefined
2058
+
2059
+ if (fs[gracefulQueue].length === 0)
2060
+ return
2061
+
2062
+ var elem = fs[gracefulQueue].shift()
2063
+ var fn = elem[0]
2064
+ var args = elem[1]
2065
+ // these items may be unset if they were added by an older graceful-fs
2066
+ var err = elem[2]
2067
+ var startTime = elem[3]
2068
+ var lastTime = elem[4]
2069
+
2070
+ // if we don't have a startTime we have no way of knowing if we've waited
2071
+ // long enough, so go ahead and retry this item now
2072
+ if (startTime === undefined) {
2073
+ debug('RETRY', fn.name, args)
2074
+ fn.apply(null, args)
2075
+ } else if (Date.now() - startTime >= 60000) {
2076
+ // it's been more than 60 seconds total, bail now
2077
+ debug('TIMEOUT', fn.name, args)
2078
+ var cb = args.pop()
2079
+ if (typeof cb === 'function')
2080
+ cb.call(null, err)
2081
+ } else {
2082
+ // the amount of time between the last attempt and right now
2083
+ var sinceAttempt = Date.now() - lastTime
2084
+ // the amount of time between when we first tried, and when we last tried
2085
+ // rounded up to at least 1
2086
+ var sinceStart = Math.max(lastTime - startTime, 1)
2087
+ // backoff. wait longer than the total time we've been retrying, but only
2088
+ // up to a maximum of 100ms
2089
+ var desiredDelay = Math.min(sinceStart * 1.2, 100)
2090
+ // it's been long enough since the last retry, do it again
2091
+ if (sinceAttempt >= desiredDelay) {
2092
+ debug('RETRY', fn.name, args)
2093
+ fn.apply(null, args.concat([startTime]))
2094
+ } else {
2095
+ // if we can't do this job yet, push it to the end of the queue
2096
+ // and let the next iteration check again
2097
+ fs[gracefulQueue].push(elem)
2098
+ }
2099
+ }
2100
+
2101
+ // schedule our next run if one isn't already scheduled
2102
+ if (retryTimer === undefined) {
2103
+ retryTimer = setTimeout(retry, 0)
2104
+ }
2105
+ }
2106
+
2107
+
2108
+ /***/ }),
2109
+
2110
+ /***/ 383:
2111
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2112
+
2113
+ var Stream = (__nccwpck_require__(203).Stream)
2114
+
2115
+ module.exports = legacy
2116
+
2117
+ function legacy (fs) {
2118
+ return {
2119
+ ReadStream: ReadStream,
2120
+ WriteStream: WriteStream
2121
+ }
2122
+
2123
+ function ReadStream (path, options) {
2124
+ if (!(this instanceof ReadStream)) return new ReadStream(path, options);
2125
+
2126
+ Stream.call(this);
2127
+
2128
+ var self = this;
2129
+
2130
+ this.path = path;
2131
+ this.fd = null;
2132
+ this.readable = true;
2133
+ this.paused = false;
2134
+
2135
+ this.flags = 'r';
2136
+ this.mode = 438; /*=0666*/
2137
+ this.bufferSize = 64 * 1024;
2138
+
2139
+ options = options || {};
2140
+
2141
+ // Mixin options into this
2142
+ var keys = Object.keys(options);
2143
+ for (var index = 0, length = keys.length; index < length; index++) {
2144
+ var key = keys[index];
2145
+ this[key] = options[key];
2146
+ }
2147
+
2148
+ if (this.encoding) this.setEncoding(this.encoding);
2149
+
2150
+ if (this.start !== undefined) {
2151
+ if ('number' !== typeof this.start) {
2152
+ throw TypeError('start must be a Number');
2153
+ }
2154
+ if (this.end === undefined) {
2155
+ this.end = Infinity;
2156
+ } else if ('number' !== typeof this.end) {
2157
+ throw TypeError('end must be a Number');
2158
+ }
2159
+
2160
+ if (this.start > this.end) {
2161
+ throw new Error('start must be <= end');
2162
+ }
2163
+
2164
+ this.pos = this.start;
2165
+ }
2166
+
2167
+ if (this.fd !== null) {
2168
+ process.nextTick(function() {
2169
+ self._read();
2170
+ });
2171
+ return;
2172
+ }
2173
+
2174
+ fs.open(this.path, this.flags, this.mode, function (err, fd) {
2175
+ if (err) {
2176
+ self.emit('error', err);
2177
+ self.readable = false;
2178
+ return;
2179
+ }
2180
+
2181
+ self.fd = fd;
2182
+ self.emit('open', fd);
2183
+ self._read();
2184
+ })
2185
+ }
2186
+
2187
+ function WriteStream (path, options) {
2188
+ if (!(this instanceof WriteStream)) return new WriteStream(path, options);
2189
+
2190
+ Stream.call(this);
2191
+
2192
+ this.path = path;
2193
+ this.fd = null;
2194
+ this.writable = true;
2195
+
2196
+ this.flags = 'w';
2197
+ this.encoding = 'binary';
2198
+ this.mode = 438; /*=0666*/
2199
+ this.bytesWritten = 0;
2200
+
2201
+ options = options || {};
2202
+
2203
+ // Mixin options into this
2204
+ var keys = Object.keys(options);
2205
+ for (var index = 0, length = keys.length; index < length; index++) {
2206
+ var key = keys[index];
2207
+ this[key] = options[key];
2208
+ }
2209
+
2210
+ if (this.start !== undefined) {
2211
+ if ('number' !== typeof this.start) {
2212
+ throw TypeError('start must be a Number');
2213
+ }
2214
+ if (this.start < 0) {
2215
+ throw new Error('start must be >= zero');
2216
+ }
2217
+
2218
+ this.pos = this.start;
2219
+ }
2220
+
2221
+ this.busy = false;
2222
+ this._queue = [];
2223
+
2224
+ if (this.fd === null) {
2225
+ this._open = fs.open;
2226
+ this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
2227
+ this.flush();
2228
+ }
2229
+ }
2230
+ }
2231
+
2232
+
2233
+ /***/ }),
2234
+
2235
+ /***/ 190:
2236
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2237
+
2238
+ var constants = __nccwpck_require__(140)
2239
+
2240
+ var origCwd = process.cwd
2241
+ var cwd = null
2242
+
2243
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
2244
+
2245
+ process.cwd = function() {
2246
+ if (!cwd)
2247
+ cwd = origCwd.call(process)
2248
+ return cwd
2249
+ }
2250
+ try {
2251
+ process.cwd()
2252
+ } catch (er) {}
2253
+
2254
+ // This check is needed until node.js 12 is required
2255
+ if (typeof process.chdir === 'function') {
2256
+ var chdir = process.chdir
2257
+ process.chdir = function (d) {
2258
+ cwd = null
2259
+ chdir.call(process, d)
2260
+ }
2261
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)
2262
+ }
2263
+
2264
+ module.exports = patch
2265
+
2266
+ function patch (fs) {
2267
+ // (re-)implement some things that are known busted or missing.
2268
+
2269
+ // lchmod, broken prior to 0.6.2
2270
+ // back-port the fix here.
2271
+ if (constants.hasOwnProperty('O_SYMLINK') &&
2272
+ process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
2273
+ patchLchmod(fs)
2274
+ }
2275
+
2276
+ // lutimes implementation, or no-op
2277
+ if (!fs.lutimes) {
2278
+ patchLutimes(fs)
2279
+ }
2280
+
2281
+ // https://github.com/isaacs/node-graceful-fs/issues/4
2282
+ // Chown should not fail on einval or eperm if non-root.
2283
+ // It should not fail on enosys ever, as this just indicates
2284
+ // that a fs doesn't support the intended operation.
2285
+
2286
+ fs.chown = chownFix(fs.chown)
2287
+ fs.fchown = chownFix(fs.fchown)
2288
+ fs.lchown = chownFix(fs.lchown)
2289
+
2290
+ fs.chmod = chmodFix(fs.chmod)
2291
+ fs.fchmod = chmodFix(fs.fchmod)
2292
+ fs.lchmod = chmodFix(fs.lchmod)
2293
+
2294
+ fs.chownSync = chownFixSync(fs.chownSync)
2295
+ fs.fchownSync = chownFixSync(fs.fchownSync)
2296
+ fs.lchownSync = chownFixSync(fs.lchownSync)
2297
+
2298
+ fs.chmodSync = chmodFixSync(fs.chmodSync)
2299
+ fs.fchmodSync = chmodFixSync(fs.fchmodSync)
2300
+ fs.lchmodSync = chmodFixSync(fs.lchmodSync)
2301
+
2302
+ fs.stat = statFix(fs.stat)
2303
+ fs.fstat = statFix(fs.fstat)
2304
+ fs.lstat = statFix(fs.lstat)
2305
+
2306
+ fs.statSync = statFixSync(fs.statSync)
2307
+ fs.fstatSync = statFixSync(fs.fstatSync)
2308
+ fs.lstatSync = statFixSync(fs.lstatSync)
2309
+
2310
+ // if lchmod/lchown do not exist, then make them no-ops
2311
+ if (fs.chmod && !fs.lchmod) {
2312
+ fs.lchmod = function (path, mode, cb) {
2313
+ if (cb) process.nextTick(cb)
2314
+ }
2315
+ fs.lchmodSync = function () {}
2316
+ }
2317
+ if (fs.chown && !fs.lchown) {
2318
+ fs.lchown = function (path, uid, gid, cb) {
2319
+ if (cb) process.nextTick(cb)
2320
+ }
2321
+ fs.lchownSync = function () {}
2322
+ }
2323
+
2324
+ // on Windows, A/V software can lock the directory, causing this
2325
+ // to fail with an EACCES or EPERM if the directory contains newly
2326
+ // created files. Try again on failure, for up to 60 seconds.
2327
+
2328
+ // Set the timeout this long because some Windows Anti-Virus, such as Parity
2329
+ // bit9, may lock files for up to a minute, causing npm package install
2330
+ // failures. Also, take care to yield the scheduler. Windows scheduling gives
2331
+ // CPU to a busy looping process, which can cause the program causing the lock
2332
+ // contention to be starved of CPU by node, so the contention doesn't resolve.
2333
+ if (platform === "win32") {
2334
+ fs.rename = typeof fs.rename !== 'function' ? fs.rename
2335
+ : (function (fs$rename) {
2336
+ function rename (from, to, cb) {
2337
+ var start = Date.now()
2338
+ var backoff = 0;
2339
+ fs$rename(from, to, function CB (er) {
2340
+ if (er
2341
+ && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
2342
+ && Date.now() - start < 60000) {
2343
+ setTimeout(function() {
2344
+ fs.stat(to, function (stater, st) {
2345
+ if (stater && stater.code === "ENOENT")
2346
+ fs$rename(from, to, CB);
2347
+ else
2348
+ cb(er)
2349
+ })
2350
+ }, backoff)
2351
+ if (backoff < 100)
2352
+ backoff += 10;
2353
+ return;
2354
+ }
2355
+ if (cb) cb(er)
2356
+ })
2357
+ }
2358
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
2359
+ return rename
2360
+ })(fs.rename)
2361
+ }
2362
+
2363
+ // if read() returns EAGAIN, then just try it again.
2364
+ fs.read = typeof fs.read !== 'function' ? fs.read
2365
+ : (function (fs$read) {
2366
+ function read (fd, buffer, offset, length, position, callback_) {
2367
+ var callback
2368
+ if (callback_ && typeof callback_ === 'function') {
2369
+ var eagCounter = 0
2370
+ callback = function (er, _, __) {
2371
+ if (er && er.code === 'EAGAIN' && eagCounter < 10) {
2372
+ eagCounter ++
2373
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
2374
+ }
2375
+ callback_.apply(this, arguments)
2376
+ }
2377
+ }
2378
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
2379
+ }
2380
+
2381
+ // This ensures `util.promisify` works as it does for native `fs.read`.
2382
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
2383
+ return read
2384
+ })(fs.read)
2385
+
2386
+ fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
2387
+ : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
2388
+ var eagCounter = 0
2389
+ while (true) {
2390
+ try {
2391
+ return fs$readSync.call(fs, fd, buffer, offset, length, position)
2392
+ } catch (er) {
2393
+ if (er.code === 'EAGAIN' && eagCounter < 10) {
2394
+ eagCounter ++
2395
+ continue
2396
+ }
2397
+ throw er
2398
+ }
2399
+ }
2400
+ }})(fs.readSync)
2401
+
2402
+ function patchLchmod (fs) {
2403
+ fs.lchmod = function (path, mode, callback) {
2404
+ fs.open( path
2405
+ , constants.O_WRONLY | constants.O_SYMLINK
2406
+ , mode
2407
+ , function (err, fd) {
2408
+ if (err) {
2409
+ if (callback) callback(err)
2410
+ return
2411
+ }
2412
+ // prefer to return the chmod error, if one occurs,
2413
+ // but still try to close, and report closing errors if they occur.
2414
+ fs.fchmod(fd, mode, function (err) {
2415
+ fs.close(fd, function(err2) {
2416
+ if (callback) callback(err || err2)
2417
+ })
2418
+ })
2419
+ })
2420
+ }
2421
+
2422
+ fs.lchmodSync = function (path, mode) {
2423
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
2424
+
2425
+ // prefer to return the chmod error, if one occurs,
2426
+ // but still try to close, and report closing errors if they occur.
2427
+ var threw = true
2428
+ var ret
2429
+ try {
2430
+ ret = fs.fchmodSync(fd, mode)
2431
+ threw = false
2432
+ } finally {
2433
+ if (threw) {
2434
+ try {
2435
+ fs.closeSync(fd)
2436
+ } catch (er) {}
2437
+ } else {
2438
+ fs.closeSync(fd)
2439
+ }
2440
+ }
2441
+ return ret
2442
+ }
2443
+ }
2444
+
2445
+ function patchLutimes (fs) {
2446
+ if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
2447
+ fs.lutimes = function (path, at, mt, cb) {
2448
+ fs.open(path, constants.O_SYMLINK, function (er, fd) {
2449
+ if (er) {
2450
+ if (cb) cb(er)
2451
+ return
2452
+ }
2453
+ fs.futimes(fd, at, mt, function (er) {
2454
+ fs.close(fd, function (er2) {
2455
+ if (cb) cb(er || er2)
2456
+ })
2457
+ })
2458
+ })
2459
+ }
2460
+
2461
+ fs.lutimesSync = function (path, at, mt) {
2462
+ var fd = fs.openSync(path, constants.O_SYMLINK)
2463
+ var ret
2464
+ var threw = true
2465
+ try {
2466
+ ret = fs.futimesSync(fd, at, mt)
2467
+ threw = false
2468
+ } finally {
2469
+ if (threw) {
2470
+ try {
2471
+ fs.closeSync(fd)
2472
+ } catch (er) {}
2473
+ } else {
2474
+ fs.closeSync(fd)
2475
+ }
2476
+ }
2477
+ return ret
2478
+ }
2479
+
2480
+ } else if (fs.futimes) {
2481
+ fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
2482
+ fs.lutimesSync = function () {}
2483
+ }
2484
+ }
2485
+
2486
+ function chmodFix (orig) {
2487
+ if (!orig) return orig
2488
+ return function (target, mode, cb) {
2489
+ return orig.call(fs, target, mode, function (er) {
2490
+ if (chownErOk(er)) er = null
2491
+ if (cb) cb.apply(this, arguments)
2492
+ })
2493
+ }
2494
+ }
2495
+
2496
+ function chmodFixSync (orig) {
2497
+ if (!orig) return orig
2498
+ return function (target, mode) {
2499
+ try {
2500
+ return orig.call(fs, target, mode)
2501
+ } catch (er) {
2502
+ if (!chownErOk(er)) throw er
2503
+ }
2504
+ }
2505
+ }
2506
+
2507
+
2508
+ function chownFix (orig) {
2509
+ if (!orig) return orig
2510
+ return function (target, uid, gid, cb) {
2511
+ return orig.call(fs, target, uid, gid, function (er) {
2512
+ if (chownErOk(er)) er = null
2513
+ if (cb) cb.apply(this, arguments)
2514
+ })
2515
+ }
2516
+ }
2517
+
2518
+ function chownFixSync (orig) {
2519
+ if (!orig) return orig
2520
+ return function (target, uid, gid) {
2521
+ try {
2522
+ return orig.call(fs, target, uid, gid)
2523
+ } catch (er) {
2524
+ if (!chownErOk(er)) throw er
2525
+ }
2526
+ }
2527
+ }
2528
+
2529
+ function statFix (orig) {
2530
+ if (!orig) return orig
2531
+ // Older versions of Node erroneously returned signed integers for
2532
+ // uid + gid.
2533
+ return function (target, options, cb) {
2534
+ if (typeof options === 'function') {
2535
+ cb = options
2536
+ options = null
2537
+ }
2538
+ function callback (er, stats) {
2539
+ if (stats) {
2540
+ if (stats.uid < 0) stats.uid += 0x100000000
2541
+ if (stats.gid < 0) stats.gid += 0x100000000
2542
+ }
2543
+ if (cb) cb.apply(this, arguments)
2544
+ }
2545
+ return options ? orig.call(fs, target, options, callback)
2546
+ : orig.call(fs, target, callback)
2547
+ }
2548
+ }
2549
+
2550
+ function statFixSync (orig) {
2551
+ if (!orig) return orig
2552
+ // Older versions of Node erroneously returned signed integers for
2553
+ // uid + gid.
2554
+ return function (target, options) {
2555
+ var stats = options ? orig.call(fs, target, options)
2556
+ : orig.call(fs, target)
2557
+ if (stats) {
2558
+ if (stats.uid < 0) stats.uid += 0x100000000
2559
+ if (stats.gid < 0) stats.gid += 0x100000000
2560
+ }
2561
+ return stats;
2562
+ }
2563
+ }
2564
+
2565
+ // ENOSYS means that the fs doesn't support the op. Just ignore
2566
+ // that, because it doesn't matter.
2567
+ //
2568
+ // if there's no getuid, or if getuid() is something other
2569
+ // than 0, and the error is EINVAL or EPERM, then just ignore
2570
+ // it.
2571
+ //
2572
+ // This specific case is a silent failure in cp, install, tar,
2573
+ // and most other unix tools that manage permissions.
2574
+ //
2575
+ // When running as root, or if other types of errors are
2576
+ // encountered, then it's strict.
2577
+ function chownErOk (er) {
2578
+ if (!er)
2579
+ return true
2580
+
2581
+ if (er.code === "ENOSYS")
2582
+ return true
2583
+
2584
+ var nonroot = !process.getuid || process.getuid() !== 0
2585
+ if (nonroot) {
2586
+ if (er.code === "EINVAL" || er.code === "EPERM")
2587
+ return true
2588
+ }
2589
+
2590
+ return false
2591
+ }
2592
+ }
2593
+
2594
+
2595
+ /***/ }),
2596
+
2597
+ /***/ 779:
2598
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2599
+
2600
+ let _fs
2601
+ try {
2602
+ _fs = __nccwpck_require__(219)
2603
+ } catch (_) {
2604
+ _fs = __nccwpck_require__(896)
2605
+ }
2606
+ const universalify = __nccwpck_require__(979)
2607
+ const { stringify, stripBom } = __nccwpck_require__(830)
2608
+
2609
+ async function _readFile (file, options = {}) {
2610
+ if (typeof options === 'string') {
2611
+ options = { encoding: options }
2612
+ }
2613
+
2614
+ const fs = options.fs || _fs
2615
+
2616
+ const shouldThrow = 'throws' in options ? options.throws : true
2617
+
2618
+ let data = await universalify.fromCallback(fs.readFile)(file, options)
2619
+
2620
+ data = stripBom(data)
2621
+
2622
+ let obj
2623
+ try {
2624
+ obj = JSON.parse(data, options ? options.reviver : null)
2625
+ } catch (err) {
2626
+ if (shouldThrow) {
2627
+ err.message = `${file}: ${err.message}`
2628
+ throw err
2629
+ } else {
2630
+ return null
2631
+ }
2632
+ }
2633
+
2634
+ return obj
2635
+ }
2636
+
2637
+ const readFile = universalify.fromPromise(_readFile)
2638
+
2639
+ function readFileSync (file, options = {}) {
2640
+ if (typeof options === 'string') {
2641
+ options = { encoding: options }
2642
+ }
2643
+
2644
+ const fs = options.fs || _fs
2645
+
2646
+ const shouldThrow = 'throws' in options ? options.throws : true
2647
+
2648
+ try {
2649
+ let content = fs.readFileSync(file, options)
2650
+ content = stripBom(content)
2651
+ return JSON.parse(content, options.reviver)
2652
+ } catch (err) {
2653
+ if (shouldThrow) {
2654
+ err.message = `${file}: ${err.message}`
2655
+ throw err
2656
+ } else {
2657
+ return null
2658
+ }
2659
+ }
2660
+ }
2661
+
2662
+ async function _writeFile (file, obj, options = {}) {
2663
+ const fs = options.fs || _fs
2664
+
2665
+ const str = stringify(obj, options)
2666
+
2667
+ await universalify.fromCallback(fs.writeFile)(file, str, options)
2668
+ }
2669
+
2670
+ const writeFile = universalify.fromPromise(_writeFile)
2671
+
2672
+ function writeFileSync (file, obj, options = {}) {
2673
+ const fs = options.fs || _fs
2674
+
2675
+ const str = stringify(obj, options)
2676
+ // not sure if fs.writeFileSync returns anything, but just in case
2677
+ return fs.writeFileSync(file, str, options)
2678
+ }
2679
+
2680
+ const jsonfile = {
2681
+ readFile,
2682
+ readFileSync,
2683
+ writeFile,
2684
+ writeFileSync
2685
+ }
2686
+
2687
+ module.exports = jsonfile
2688
+
2689
+
2690
+ /***/ }),
2691
+
2692
+ /***/ 830:
2693
+ /***/ ((module) => {
2694
+
2695
+ function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) {
2696
+ const EOF = finalEOL ? EOL : ''
2697
+ const str = JSON.stringify(obj, replacer, spaces)
2698
+
2699
+ return str.replace(/\n/g, EOL) + EOF
2700
+ }
2701
+
2702
+ function stripBom (content) {
2703
+ // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
2704
+ if (Buffer.isBuffer(content)) content = content.toString('utf8')
2705
+ return content.replace(/^\uFEFF/, '')
2706
+ }
2707
+
2708
+ module.exports = { stringify, stripBom }
2709
+
2710
+
2711
+ /***/ }),
2712
+
2713
+ /***/ 979:
2714
+ /***/ ((__unused_webpack_module, exports) => {
2715
+
2716
+ "use strict";
2717
+
2718
+
2719
+ exports.fromCallback = function (fn) {
2720
+ return Object.defineProperty(function (...args) {
2721
+ if (typeof args[args.length - 1] === 'function') fn.apply(this, args)
2722
+ else {
2723
+ return new Promise((resolve, reject) => {
2724
+ args.push((err, res) => (err != null) ? reject(err) : resolve(res))
2725
+ fn.apply(this, args)
2726
+ })
2727
+ }
2728
+ }, 'name', { value: fn.name })
2729
+ }
2730
+
2731
+ exports.fromPromise = function (fn) {
2732
+ return Object.defineProperty(function (...args) {
2733
+ const cb = args[args.length - 1]
2734
+ if (typeof cb !== 'function') return fn.apply(this, args)
2735
+ else {
2736
+ args.pop()
2737
+ fn.apply(this, args).then(r => cb(null, r), cb)
2738
+ }
2739
+ }, 'name', { value: fn.name })
2740
+ }
2741
+
2742
+
2743
+ /***/ }),
2744
+
2745
+ /***/ 613:
2746
+ /***/ ((module) => {
2747
+
2748
+ "use strict";
2749
+ module.exports = require("assert");
2750
+
2751
+ /***/ }),
2752
+
2753
+ /***/ 140:
2754
+ /***/ ((module) => {
2755
+
2756
+ "use strict";
2757
+ module.exports = require("constants");
2758
+
2759
+ /***/ }),
2760
+
2761
+ /***/ 896:
2762
+ /***/ ((module) => {
2763
+
2764
+ "use strict";
2765
+ module.exports = require("fs");
2766
+
2767
+ /***/ }),
2768
+
2769
+ /***/ 928:
2770
+ /***/ ((module) => {
2771
+
2772
+ "use strict";
2773
+ module.exports = require("path");
2774
+
2775
+ /***/ }),
2776
+
2777
+ /***/ 203:
2778
+ /***/ ((module) => {
2779
+
2780
+ "use strict";
2781
+ module.exports = require("stream");
2782
+
2783
+ /***/ }),
2784
+
2785
+ /***/ 23:
2786
+ /***/ ((module) => {
2787
+
2788
+ "use strict";
2789
+ module.exports = require("util");
2790
+
2791
+ /***/ })
2792
+
2793
+ /******/ });
2794
+ /************************************************************************/
2795
+ /******/ // The module cache
2796
+ /******/ var __webpack_module_cache__ = {};
2797
+ /******/
2798
+ /******/ // The require function
2799
+ /******/ function __nccwpck_require__(moduleId) {
2800
+ /******/ // Check if module is in cache
2801
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
2802
+ /******/ if (cachedModule !== undefined) {
2803
+ /******/ return cachedModule.exports;
2804
+ /******/ }
2805
+ /******/ // Create a new module (and put it into the cache)
2806
+ /******/ var module = __webpack_module_cache__[moduleId] = {
2807
+ /******/ // no module.id needed
2808
+ /******/ // no module.loaded needed
2809
+ /******/ exports: {}
2810
+ /******/ };
2811
+ /******/
2812
+ /******/ // Execute the module function
2813
+ /******/ var threw = true;
2814
+ /******/ try {
2815
+ /******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
2816
+ /******/ threw = false;
2817
+ /******/ } finally {
2818
+ /******/ if(threw) delete __webpack_module_cache__[moduleId];
2819
+ /******/ }
2820
+ /******/
2821
+ /******/ // Return the exports of the module
2822
+ /******/ return module.exports;
2823
+ /******/ }
2824
+ /******/
2825
+ /************************************************************************/
2826
+ /******/ /* webpack/runtime/compat */
2827
+ /******/
2828
+ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
2829
+ /******/
2830
+ /************************************************************************/
2831
+ /******/
2832
+ /******/ // startup
2833
+ /******/ // Load entry module and return exports
2834
+ /******/ // This entry module is referenced by other modules so it can't be inlined
2835
+ /******/ var __webpack_exports__ = __nccwpck_require__(829);
2836
+ /******/ module.exports = __webpack_exports__;
2837
+ /******/
2838
+ /******/ })()
2839
+ ;