@rspack-canary/core 1.6.0-canary-c1ffd5c5-20251016085846 → 1.6.0-canary-2ccce257-20251016173648

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.
@@ -136,6 +136,979 @@ module.exports = function (glob, opts) {
136
136
  };
137
137
 
138
138
 
139
+ /***/ }),
140
+
141
+ /***/ 767:
142
+ /***/ ((module) => {
143
+
144
+ "use strict";
145
+
146
+
147
+ module.exports = clone
148
+
149
+ var getPrototypeOf = Object.getPrototypeOf || function (obj) {
150
+ return obj.__proto__
151
+ }
152
+
153
+ function clone (obj) {
154
+ if (obj === null || typeof obj !== 'object')
155
+ return obj
156
+
157
+ if (obj instanceof Object)
158
+ var copy = { __proto__: getPrototypeOf(obj) }
159
+ else
160
+ var copy = Object.create(null)
161
+
162
+ Object.getOwnPropertyNames(obj).forEach(function (key) {
163
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
164
+ })
165
+
166
+ return copy
167
+ }
168
+
169
+
170
+ /***/ }),
171
+
172
+ /***/ 219:
173
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
174
+
175
+ var fs = __nccwpck_require__(896)
176
+ var polyfills = __nccwpck_require__(190)
177
+ var legacy = __nccwpck_require__(383)
178
+ var clone = __nccwpck_require__(767)
179
+
180
+ var util = __nccwpck_require__(23)
181
+
182
+ /* istanbul ignore next - node 0.x polyfill */
183
+ var gracefulQueue
184
+ var previousSymbol
185
+
186
+ /* istanbul ignore else - node 0.x polyfill */
187
+ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
188
+ gracefulQueue = Symbol.for('graceful-fs.queue')
189
+ // This is used in testing by future versions
190
+ previousSymbol = Symbol.for('graceful-fs.previous')
191
+ } else {
192
+ gracefulQueue = '___graceful-fs.queue'
193
+ previousSymbol = '___graceful-fs.previous'
194
+ }
195
+
196
+ function noop () {}
197
+
198
+ function publishQueue(context, queue) {
199
+ Object.defineProperty(context, gracefulQueue, {
200
+ get: function() {
201
+ return queue
202
+ }
203
+ })
204
+ }
205
+
206
+ var debug = noop
207
+ if (util.debuglog)
208
+ debug = util.debuglog('gfs4')
209
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
210
+ debug = function() {
211
+ var m = util.format.apply(util, arguments)
212
+ m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
213
+ console.error(m)
214
+ }
215
+
216
+ // Once time initialization
217
+ if (!fs[gracefulQueue]) {
218
+ // This queue can be shared by multiple loaded instances
219
+ var queue = global[gracefulQueue] || []
220
+ publishQueue(fs, queue)
221
+
222
+ // Patch fs.close/closeSync to shared queue version, because we need
223
+ // to retry() whenever a close happens *anywhere* in the program.
224
+ // This is essential when multiple graceful-fs instances are
225
+ // in play at the same time.
226
+ fs.close = (function (fs$close) {
227
+ function close (fd, cb) {
228
+ return fs$close.call(fs, fd, function (err) {
229
+ // This function uses the graceful-fs shared queue
230
+ if (!err) {
231
+ resetQueue()
232
+ }
233
+
234
+ if (typeof cb === 'function')
235
+ cb.apply(this, arguments)
236
+ })
237
+ }
238
+
239
+ Object.defineProperty(close, previousSymbol, {
240
+ value: fs$close
241
+ })
242
+ return close
243
+ })(fs.close)
244
+
245
+ fs.closeSync = (function (fs$closeSync) {
246
+ function closeSync (fd) {
247
+ // This function uses the graceful-fs shared queue
248
+ fs$closeSync.apply(fs, arguments)
249
+ resetQueue()
250
+ }
251
+
252
+ Object.defineProperty(closeSync, previousSymbol, {
253
+ value: fs$closeSync
254
+ })
255
+ return closeSync
256
+ })(fs.closeSync)
257
+
258
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
259
+ process.on('exit', function() {
260
+ debug(fs[gracefulQueue])
261
+ __nccwpck_require__(613).equal(fs[gracefulQueue].length, 0)
262
+ })
263
+ }
264
+ }
265
+
266
+ if (!global[gracefulQueue]) {
267
+ publishQueue(global, fs[gracefulQueue]);
268
+ }
269
+
270
+ module.exports = patch(clone(fs))
271
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
272
+ module.exports = patch(fs)
273
+ fs.__patched = true;
274
+ }
275
+
276
+ function patch (fs) {
277
+ // Everything that references the open() function needs to be in here
278
+ polyfills(fs)
279
+ fs.gracefulify = patch
280
+
281
+ fs.createReadStream = createReadStream
282
+ fs.createWriteStream = createWriteStream
283
+ var fs$readFile = fs.readFile
284
+ fs.readFile = readFile
285
+ function readFile (path, options, cb) {
286
+ if (typeof options === 'function')
287
+ cb = options, options = null
288
+
289
+ return go$readFile(path, options, cb)
290
+
291
+ function go$readFile (path, options, cb, startTime) {
292
+ return fs$readFile(path, options, function (err) {
293
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
294
+ enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])
295
+ else {
296
+ if (typeof cb === 'function')
297
+ cb.apply(this, arguments)
298
+ }
299
+ })
300
+ }
301
+ }
302
+
303
+ var fs$writeFile = fs.writeFile
304
+ fs.writeFile = writeFile
305
+ function writeFile (path, data, options, cb) {
306
+ if (typeof options === 'function')
307
+ cb = options, options = null
308
+
309
+ return go$writeFile(path, data, options, cb)
310
+
311
+ function go$writeFile (path, data, options, cb, startTime) {
312
+ return fs$writeFile(path, data, options, function (err) {
313
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
314
+ enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
315
+ else {
316
+ if (typeof cb === 'function')
317
+ cb.apply(this, arguments)
318
+ }
319
+ })
320
+ }
321
+ }
322
+
323
+ var fs$appendFile = fs.appendFile
324
+ if (fs$appendFile)
325
+ fs.appendFile = appendFile
326
+ function appendFile (path, data, options, cb) {
327
+ if (typeof options === 'function')
328
+ cb = options, options = null
329
+
330
+ return go$appendFile(path, data, options, cb)
331
+
332
+ function go$appendFile (path, data, options, cb, startTime) {
333
+ return fs$appendFile(path, data, options, function (err) {
334
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
335
+ enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
336
+ else {
337
+ if (typeof cb === 'function')
338
+ cb.apply(this, arguments)
339
+ }
340
+ })
341
+ }
342
+ }
343
+
344
+ var fs$copyFile = fs.copyFile
345
+ if (fs$copyFile)
346
+ fs.copyFile = copyFile
347
+ function copyFile (src, dest, flags, cb) {
348
+ if (typeof flags === 'function') {
349
+ cb = flags
350
+ flags = 0
351
+ }
352
+ return go$copyFile(src, dest, flags, cb)
353
+
354
+ function go$copyFile (src, dest, flags, cb, startTime) {
355
+ return fs$copyFile(src, dest, flags, function (err) {
356
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
357
+ enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
358
+ else {
359
+ if (typeof cb === 'function')
360
+ cb.apply(this, arguments)
361
+ }
362
+ })
363
+ }
364
+ }
365
+
366
+ var fs$readdir = fs.readdir
367
+ fs.readdir = readdir
368
+ var noReaddirOptionVersions = /^v[0-5]\./
369
+ function readdir (path, options, cb) {
370
+ if (typeof options === 'function')
371
+ cb = options, options = null
372
+
373
+ var go$readdir = noReaddirOptionVersions.test(process.version)
374
+ ? function go$readdir (path, options, cb, startTime) {
375
+ return fs$readdir(path, fs$readdirCallback(
376
+ path, options, cb, startTime
377
+ ))
378
+ }
379
+ : function go$readdir (path, options, cb, startTime) {
380
+ return fs$readdir(path, options, fs$readdirCallback(
381
+ path, options, cb, startTime
382
+ ))
383
+ }
384
+
385
+ return go$readdir(path, options, cb)
386
+
387
+ function fs$readdirCallback (path, options, cb, startTime) {
388
+ return function (err, files) {
389
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
390
+ enqueue([
391
+ go$readdir,
392
+ [path, options, cb],
393
+ err,
394
+ startTime || Date.now(),
395
+ Date.now()
396
+ ])
397
+ else {
398
+ if (files && files.sort)
399
+ files.sort()
400
+
401
+ if (typeof cb === 'function')
402
+ cb.call(this, err, files)
403
+ }
404
+ }
405
+ }
406
+ }
407
+
408
+ if (process.version.substr(0, 4) === 'v0.8') {
409
+ var legStreams = legacy(fs)
410
+ ReadStream = legStreams.ReadStream
411
+ WriteStream = legStreams.WriteStream
412
+ }
413
+
414
+ var fs$ReadStream = fs.ReadStream
415
+ if (fs$ReadStream) {
416
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype)
417
+ ReadStream.prototype.open = ReadStream$open
418
+ }
419
+
420
+ var fs$WriteStream = fs.WriteStream
421
+ if (fs$WriteStream) {
422
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype)
423
+ WriteStream.prototype.open = WriteStream$open
424
+ }
425
+
426
+ Object.defineProperty(fs, 'ReadStream', {
427
+ get: function () {
428
+ return ReadStream
429
+ },
430
+ set: function (val) {
431
+ ReadStream = val
432
+ },
433
+ enumerable: true,
434
+ configurable: true
435
+ })
436
+ Object.defineProperty(fs, 'WriteStream', {
437
+ get: function () {
438
+ return WriteStream
439
+ },
440
+ set: function (val) {
441
+ WriteStream = val
442
+ },
443
+ enumerable: true,
444
+ configurable: true
445
+ })
446
+
447
+ // legacy names
448
+ var FileReadStream = ReadStream
449
+ Object.defineProperty(fs, 'FileReadStream', {
450
+ get: function () {
451
+ return FileReadStream
452
+ },
453
+ set: function (val) {
454
+ FileReadStream = val
455
+ },
456
+ enumerable: true,
457
+ configurable: true
458
+ })
459
+ var FileWriteStream = WriteStream
460
+ Object.defineProperty(fs, 'FileWriteStream', {
461
+ get: function () {
462
+ return FileWriteStream
463
+ },
464
+ set: function (val) {
465
+ FileWriteStream = val
466
+ },
467
+ enumerable: true,
468
+ configurable: true
469
+ })
470
+
471
+ function ReadStream (path, options) {
472
+ if (this instanceof ReadStream)
473
+ return fs$ReadStream.apply(this, arguments), this
474
+ else
475
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
476
+ }
477
+
478
+ function ReadStream$open () {
479
+ var that = this
480
+ open(that.path, that.flags, that.mode, function (err, fd) {
481
+ if (err) {
482
+ if (that.autoClose)
483
+ that.destroy()
484
+
485
+ that.emit('error', err)
486
+ } else {
487
+ that.fd = fd
488
+ that.emit('open', fd)
489
+ that.read()
490
+ }
491
+ })
492
+ }
493
+
494
+ function WriteStream (path, options) {
495
+ if (this instanceof WriteStream)
496
+ return fs$WriteStream.apply(this, arguments), this
497
+ else
498
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
499
+ }
500
+
501
+ function WriteStream$open () {
502
+ var that = this
503
+ open(that.path, that.flags, that.mode, function (err, fd) {
504
+ if (err) {
505
+ that.destroy()
506
+ that.emit('error', err)
507
+ } else {
508
+ that.fd = fd
509
+ that.emit('open', fd)
510
+ }
511
+ })
512
+ }
513
+
514
+ function createReadStream (path, options) {
515
+ return new fs.ReadStream(path, options)
516
+ }
517
+
518
+ function createWriteStream (path, options) {
519
+ return new fs.WriteStream(path, options)
520
+ }
521
+
522
+ var fs$open = fs.open
523
+ fs.open = open
524
+ function open (path, flags, mode, cb) {
525
+ if (typeof mode === 'function')
526
+ cb = mode, mode = null
527
+
528
+ return go$open(path, flags, mode, cb)
529
+
530
+ function go$open (path, flags, mode, cb, startTime) {
531
+ return fs$open(path, flags, mode, function (err, fd) {
532
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
533
+ enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])
534
+ else {
535
+ if (typeof cb === 'function')
536
+ cb.apply(this, arguments)
537
+ }
538
+ })
539
+ }
540
+ }
541
+
542
+ return fs
543
+ }
544
+
545
+ function enqueue (elem) {
546
+ debug('ENQUEUE', elem[0].name, elem[1])
547
+ fs[gracefulQueue].push(elem)
548
+ retry()
549
+ }
550
+
551
+ // keep track of the timeout between retry() calls
552
+ var retryTimer
553
+
554
+ // reset the startTime and lastTime to now
555
+ // this resets the start of the 60 second overall timeout as well as the
556
+ // delay between attempts so that we'll retry these jobs sooner
557
+ function resetQueue () {
558
+ var now = Date.now()
559
+ for (var i = 0; i < fs[gracefulQueue].length; ++i) {
560
+ // entries that are only a length of 2 are from an older version, don't
561
+ // bother modifying those since they'll be retried anyway.
562
+ if (fs[gracefulQueue][i].length > 2) {
563
+ fs[gracefulQueue][i][3] = now // startTime
564
+ fs[gracefulQueue][i][4] = now // lastTime
565
+ }
566
+ }
567
+ // call retry to make sure we're actively processing the queue
568
+ retry()
569
+ }
570
+
571
+ function retry () {
572
+ // clear the timer and remove it to help prevent unintended concurrency
573
+ clearTimeout(retryTimer)
574
+ retryTimer = undefined
575
+
576
+ if (fs[gracefulQueue].length === 0)
577
+ return
578
+
579
+ var elem = fs[gracefulQueue].shift()
580
+ var fn = elem[0]
581
+ var args = elem[1]
582
+ // these items may be unset if they were added by an older graceful-fs
583
+ var err = elem[2]
584
+ var startTime = elem[3]
585
+ var lastTime = elem[4]
586
+
587
+ // if we don't have a startTime we have no way of knowing if we've waited
588
+ // long enough, so go ahead and retry this item now
589
+ if (startTime === undefined) {
590
+ debug('RETRY', fn.name, args)
591
+ fn.apply(null, args)
592
+ } else if (Date.now() - startTime >= 60000) {
593
+ // it's been more than 60 seconds total, bail now
594
+ debug('TIMEOUT', fn.name, args)
595
+ var cb = args.pop()
596
+ if (typeof cb === 'function')
597
+ cb.call(null, err)
598
+ } else {
599
+ // the amount of time between the last attempt and right now
600
+ var sinceAttempt = Date.now() - lastTime
601
+ // the amount of time between when we first tried, and when we last tried
602
+ // rounded up to at least 1
603
+ var sinceStart = Math.max(lastTime - startTime, 1)
604
+ // backoff. wait longer than the total time we've been retrying, but only
605
+ // up to a maximum of 100ms
606
+ var desiredDelay = Math.min(sinceStart * 1.2, 100)
607
+ // it's been long enough since the last retry, do it again
608
+ if (sinceAttempt >= desiredDelay) {
609
+ debug('RETRY', fn.name, args)
610
+ fn.apply(null, args.concat([startTime]))
611
+ } else {
612
+ // if we can't do this job yet, push it to the end of the queue
613
+ // and let the next iteration check again
614
+ fs[gracefulQueue].push(elem)
615
+ }
616
+ }
617
+
618
+ // schedule our next run if one isn't already scheduled
619
+ if (retryTimer === undefined) {
620
+ retryTimer = setTimeout(retry, 0)
621
+ }
622
+ }
623
+
624
+
625
+ /***/ }),
626
+
627
+ /***/ 383:
628
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
629
+
630
+ var Stream = (__nccwpck_require__(203).Stream)
631
+
632
+ module.exports = legacy
633
+
634
+ function legacy (fs) {
635
+ return {
636
+ ReadStream: ReadStream,
637
+ WriteStream: WriteStream
638
+ }
639
+
640
+ function ReadStream (path, options) {
641
+ if (!(this instanceof ReadStream)) return new ReadStream(path, options);
642
+
643
+ Stream.call(this);
644
+
645
+ var self = this;
646
+
647
+ this.path = path;
648
+ this.fd = null;
649
+ this.readable = true;
650
+ this.paused = false;
651
+
652
+ this.flags = 'r';
653
+ this.mode = 438; /*=0666*/
654
+ this.bufferSize = 64 * 1024;
655
+
656
+ options = options || {};
657
+
658
+ // Mixin options into this
659
+ var keys = Object.keys(options);
660
+ for (var index = 0, length = keys.length; index < length; index++) {
661
+ var key = keys[index];
662
+ this[key] = options[key];
663
+ }
664
+
665
+ if (this.encoding) this.setEncoding(this.encoding);
666
+
667
+ if (this.start !== undefined) {
668
+ if ('number' !== typeof this.start) {
669
+ throw TypeError('start must be a Number');
670
+ }
671
+ if (this.end === undefined) {
672
+ this.end = Infinity;
673
+ } else if ('number' !== typeof this.end) {
674
+ throw TypeError('end must be a Number');
675
+ }
676
+
677
+ if (this.start > this.end) {
678
+ throw new Error('start must be <= end');
679
+ }
680
+
681
+ this.pos = this.start;
682
+ }
683
+
684
+ if (this.fd !== null) {
685
+ process.nextTick(function() {
686
+ self._read();
687
+ });
688
+ return;
689
+ }
690
+
691
+ fs.open(this.path, this.flags, this.mode, function (err, fd) {
692
+ if (err) {
693
+ self.emit('error', err);
694
+ self.readable = false;
695
+ return;
696
+ }
697
+
698
+ self.fd = fd;
699
+ self.emit('open', fd);
700
+ self._read();
701
+ })
702
+ }
703
+
704
+ function WriteStream (path, options) {
705
+ if (!(this instanceof WriteStream)) return new WriteStream(path, options);
706
+
707
+ Stream.call(this);
708
+
709
+ this.path = path;
710
+ this.fd = null;
711
+ this.writable = true;
712
+
713
+ this.flags = 'w';
714
+ this.encoding = 'binary';
715
+ this.mode = 438; /*=0666*/
716
+ this.bytesWritten = 0;
717
+
718
+ options = options || {};
719
+
720
+ // Mixin options into this
721
+ var keys = Object.keys(options);
722
+ for (var index = 0, length = keys.length; index < length; index++) {
723
+ var key = keys[index];
724
+ this[key] = options[key];
725
+ }
726
+
727
+ if (this.start !== undefined) {
728
+ if ('number' !== typeof this.start) {
729
+ throw TypeError('start must be a Number');
730
+ }
731
+ if (this.start < 0) {
732
+ throw new Error('start must be >= zero');
733
+ }
734
+
735
+ this.pos = this.start;
736
+ }
737
+
738
+ this.busy = false;
739
+ this._queue = [];
740
+
741
+ if (this.fd === null) {
742
+ this._open = fs.open;
743
+ this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
744
+ this.flush();
745
+ }
746
+ }
747
+ }
748
+
749
+
750
+ /***/ }),
751
+
752
+ /***/ 190:
753
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
754
+
755
+ var constants = __nccwpck_require__(140)
756
+
757
+ var origCwd = process.cwd
758
+ var cwd = null
759
+
760
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
761
+
762
+ process.cwd = function() {
763
+ if (!cwd)
764
+ cwd = origCwd.call(process)
765
+ return cwd
766
+ }
767
+ try {
768
+ process.cwd()
769
+ } catch (er) {}
770
+
771
+ // This check is needed until node.js 12 is required
772
+ if (typeof process.chdir === 'function') {
773
+ var chdir = process.chdir
774
+ process.chdir = function (d) {
775
+ cwd = null
776
+ chdir.call(process, d)
777
+ }
778
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)
779
+ }
780
+
781
+ module.exports = patch
782
+
783
+ function patch (fs) {
784
+ // (re-)implement some things that are known busted or missing.
785
+
786
+ // lchmod, broken prior to 0.6.2
787
+ // back-port the fix here.
788
+ if (constants.hasOwnProperty('O_SYMLINK') &&
789
+ process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
790
+ patchLchmod(fs)
791
+ }
792
+
793
+ // lutimes implementation, or no-op
794
+ if (!fs.lutimes) {
795
+ patchLutimes(fs)
796
+ }
797
+
798
+ // https://github.com/isaacs/node-graceful-fs/issues/4
799
+ // Chown should not fail on einval or eperm if non-root.
800
+ // It should not fail on enosys ever, as this just indicates
801
+ // that a fs doesn't support the intended operation.
802
+
803
+ fs.chown = chownFix(fs.chown)
804
+ fs.fchown = chownFix(fs.fchown)
805
+ fs.lchown = chownFix(fs.lchown)
806
+
807
+ fs.chmod = chmodFix(fs.chmod)
808
+ fs.fchmod = chmodFix(fs.fchmod)
809
+ fs.lchmod = chmodFix(fs.lchmod)
810
+
811
+ fs.chownSync = chownFixSync(fs.chownSync)
812
+ fs.fchownSync = chownFixSync(fs.fchownSync)
813
+ fs.lchownSync = chownFixSync(fs.lchownSync)
814
+
815
+ fs.chmodSync = chmodFixSync(fs.chmodSync)
816
+ fs.fchmodSync = chmodFixSync(fs.fchmodSync)
817
+ fs.lchmodSync = chmodFixSync(fs.lchmodSync)
818
+
819
+ fs.stat = statFix(fs.stat)
820
+ fs.fstat = statFix(fs.fstat)
821
+ fs.lstat = statFix(fs.lstat)
822
+
823
+ fs.statSync = statFixSync(fs.statSync)
824
+ fs.fstatSync = statFixSync(fs.fstatSync)
825
+ fs.lstatSync = statFixSync(fs.lstatSync)
826
+
827
+ // if lchmod/lchown do not exist, then make them no-ops
828
+ if (fs.chmod && !fs.lchmod) {
829
+ fs.lchmod = function (path, mode, cb) {
830
+ if (cb) process.nextTick(cb)
831
+ }
832
+ fs.lchmodSync = function () {}
833
+ }
834
+ if (fs.chown && !fs.lchown) {
835
+ fs.lchown = function (path, uid, gid, cb) {
836
+ if (cb) process.nextTick(cb)
837
+ }
838
+ fs.lchownSync = function () {}
839
+ }
840
+
841
+ // on Windows, A/V software can lock the directory, causing this
842
+ // to fail with an EACCES or EPERM if the directory contains newly
843
+ // created files. Try again on failure, for up to 60 seconds.
844
+
845
+ // Set the timeout this long because some Windows Anti-Virus, such as Parity
846
+ // bit9, may lock files for up to a minute, causing npm package install
847
+ // failures. Also, take care to yield the scheduler. Windows scheduling gives
848
+ // CPU to a busy looping process, which can cause the program causing the lock
849
+ // contention to be starved of CPU by node, so the contention doesn't resolve.
850
+ if (platform === "win32") {
851
+ fs.rename = typeof fs.rename !== 'function' ? fs.rename
852
+ : (function (fs$rename) {
853
+ function rename (from, to, cb) {
854
+ var start = Date.now()
855
+ var backoff = 0;
856
+ fs$rename(from, to, function CB (er) {
857
+ if (er
858
+ && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
859
+ && Date.now() - start < 60000) {
860
+ setTimeout(function() {
861
+ fs.stat(to, function (stater, st) {
862
+ if (stater && stater.code === "ENOENT")
863
+ fs$rename(from, to, CB);
864
+ else
865
+ cb(er)
866
+ })
867
+ }, backoff)
868
+ if (backoff < 100)
869
+ backoff += 10;
870
+ return;
871
+ }
872
+ if (cb) cb(er)
873
+ })
874
+ }
875
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
876
+ return rename
877
+ })(fs.rename)
878
+ }
879
+
880
+ // if read() returns EAGAIN, then just try it again.
881
+ fs.read = typeof fs.read !== 'function' ? fs.read
882
+ : (function (fs$read) {
883
+ function read (fd, buffer, offset, length, position, callback_) {
884
+ var callback
885
+ if (callback_ && typeof callback_ === 'function') {
886
+ var eagCounter = 0
887
+ callback = function (er, _, __) {
888
+ if (er && er.code === 'EAGAIN' && eagCounter < 10) {
889
+ eagCounter ++
890
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
891
+ }
892
+ callback_.apply(this, arguments)
893
+ }
894
+ }
895
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
896
+ }
897
+
898
+ // This ensures `util.promisify` works as it does for native `fs.read`.
899
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
900
+ return read
901
+ })(fs.read)
902
+
903
+ fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
904
+ : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
905
+ var eagCounter = 0
906
+ while (true) {
907
+ try {
908
+ return fs$readSync.call(fs, fd, buffer, offset, length, position)
909
+ } catch (er) {
910
+ if (er.code === 'EAGAIN' && eagCounter < 10) {
911
+ eagCounter ++
912
+ continue
913
+ }
914
+ throw er
915
+ }
916
+ }
917
+ }})(fs.readSync)
918
+
919
+ function patchLchmod (fs) {
920
+ fs.lchmod = function (path, mode, callback) {
921
+ fs.open( path
922
+ , constants.O_WRONLY | constants.O_SYMLINK
923
+ , mode
924
+ , function (err, fd) {
925
+ if (err) {
926
+ if (callback) callback(err)
927
+ return
928
+ }
929
+ // prefer to return the chmod error, if one occurs,
930
+ // but still try to close, and report closing errors if they occur.
931
+ fs.fchmod(fd, mode, function (err) {
932
+ fs.close(fd, function(err2) {
933
+ if (callback) callback(err || err2)
934
+ })
935
+ })
936
+ })
937
+ }
938
+
939
+ fs.lchmodSync = function (path, mode) {
940
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
941
+
942
+ // prefer to return the chmod error, if one occurs,
943
+ // but still try to close, and report closing errors if they occur.
944
+ var threw = true
945
+ var ret
946
+ try {
947
+ ret = fs.fchmodSync(fd, mode)
948
+ threw = false
949
+ } finally {
950
+ if (threw) {
951
+ try {
952
+ fs.closeSync(fd)
953
+ } catch (er) {}
954
+ } else {
955
+ fs.closeSync(fd)
956
+ }
957
+ }
958
+ return ret
959
+ }
960
+ }
961
+
962
+ function patchLutimes (fs) {
963
+ if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
964
+ fs.lutimes = function (path, at, mt, cb) {
965
+ fs.open(path, constants.O_SYMLINK, function (er, fd) {
966
+ if (er) {
967
+ if (cb) cb(er)
968
+ return
969
+ }
970
+ fs.futimes(fd, at, mt, function (er) {
971
+ fs.close(fd, function (er2) {
972
+ if (cb) cb(er || er2)
973
+ })
974
+ })
975
+ })
976
+ }
977
+
978
+ fs.lutimesSync = function (path, at, mt) {
979
+ var fd = fs.openSync(path, constants.O_SYMLINK)
980
+ var ret
981
+ var threw = true
982
+ try {
983
+ ret = fs.futimesSync(fd, at, mt)
984
+ threw = false
985
+ } finally {
986
+ if (threw) {
987
+ try {
988
+ fs.closeSync(fd)
989
+ } catch (er) {}
990
+ } else {
991
+ fs.closeSync(fd)
992
+ }
993
+ }
994
+ return ret
995
+ }
996
+
997
+ } else if (fs.futimes) {
998
+ fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
999
+ fs.lutimesSync = function () {}
1000
+ }
1001
+ }
1002
+
1003
+ function chmodFix (orig) {
1004
+ if (!orig) return orig
1005
+ return function (target, mode, cb) {
1006
+ return orig.call(fs, target, mode, function (er) {
1007
+ if (chownErOk(er)) er = null
1008
+ if (cb) cb.apply(this, arguments)
1009
+ })
1010
+ }
1011
+ }
1012
+
1013
+ function chmodFixSync (orig) {
1014
+ if (!orig) return orig
1015
+ return function (target, mode) {
1016
+ try {
1017
+ return orig.call(fs, target, mode)
1018
+ } catch (er) {
1019
+ if (!chownErOk(er)) throw er
1020
+ }
1021
+ }
1022
+ }
1023
+
1024
+
1025
+ function chownFix (orig) {
1026
+ if (!orig) return orig
1027
+ return function (target, uid, gid, cb) {
1028
+ return orig.call(fs, target, uid, gid, function (er) {
1029
+ if (chownErOk(er)) er = null
1030
+ if (cb) cb.apply(this, arguments)
1031
+ })
1032
+ }
1033
+ }
1034
+
1035
+ function chownFixSync (orig) {
1036
+ if (!orig) return orig
1037
+ return function (target, uid, gid) {
1038
+ try {
1039
+ return orig.call(fs, target, uid, gid)
1040
+ } catch (er) {
1041
+ if (!chownErOk(er)) throw er
1042
+ }
1043
+ }
1044
+ }
1045
+
1046
+ function statFix (orig) {
1047
+ if (!orig) return orig
1048
+ // Older versions of Node erroneously returned signed integers for
1049
+ // uid + gid.
1050
+ return function (target, options, cb) {
1051
+ if (typeof options === 'function') {
1052
+ cb = options
1053
+ options = null
1054
+ }
1055
+ function callback (er, stats) {
1056
+ if (stats) {
1057
+ if (stats.uid < 0) stats.uid += 0x100000000
1058
+ if (stats.gid < 0) stats.gid += 0x100000000
1059
+ }
1060
+ if (cb) cb.apply(this, arguments)
1061
+ }
1062
+ return options ? orig.call(fs, target, options, callback)
1063
+ : orig.call(fs, target, callback)
1064
+ }
1065
+ }
1066
+
1067
+ function statFixSync (orig) {
1068
+ if (!orig) return orig
1069
+ // Older versions of Node erroneously returned signed integers for
1070
+ // uid + gid.
1071
+ return function (target, options) {
1072
+ var stats = options ? orig.call(fs, target, options)
1073
+ : orig.call(fs, target)
1074
+ if (stats) {
1075
+ if (stats.uid < 0) stats.uid += 0x100000000
1076
+ if (stats.gid < 0) stats.gid += 0x100000000
1077
+ }
1078
+ return stats;
1079
+ }
1080
+ }
1081
+
1082
+ // ENOSYS means that the fs doesn't support the op. Just ignore
1083
+ // that, because it doesn't matter.
1084
+ //
1085
+ // if there's no getuid, or if getuid() is something other
1086
+ // than 0, and the error is EINVAL or EPERM, then just ignore
1087
+ // it.
1088
+ //
1089
+ // This specific case is a silent failure in cp, install, tar,
1090
+ // and most other unix tools that manage permissions.
1091
+ //
1092
+ // When running as root, or if other types of errors are
1093
+ // encountered, then it's strict.
1094
+ function chownErOk (er) {
1095
+ if (!er)
1096
+ return true
1097
+
1098
+ if (er.code === "ENOSYS")
1099
+ return true
1100
+
1101
+ var nonroot = !process.getuid || process.getuid() !== 0
1102
+ if (nonroot) {
1103
+ if (er.code === "EINVAL" || er.code === "EPERM")
1104
+ return true
1105
+ }
1106
+
1107
+ return false
1108
+ }
1109
+ }
1110
+
1111
+
139
1112
  /***/ }),
140
1113
 
141
1114
  /***/ 799:
@@ -149,7 +1122,7 @@ module.exports = function (glob, opts) {
149
1122
 
150
1123
 
151
1124
  const EventEmitter = (__nccwpck_require__(434).EventEmitter);
152
- const fs = __nccwpck_require__(923);
1125
+ const fs = __nccwpck_require__(219);
153
1126
  const path = __nccwpck_require__(928);
154
1127
 
155
1128
  const watchEventSource = __nccwpck_require__(214);
@@ -2038,11 +3011,19 @@ module.exports = Watchpack;
2038
3011
 
2039
3012
  /***/ }),
2040
3013
 
2041
- /***/ 923:
3014
+ /***/ 613:
3015
+ /***/ ((module) => {
3016
+
3017
+ "use strict";
3018
+ module.exports = require("assert");
3019
+
3020
+ /***/ }),
3021
+
3022
+ /***/ 140:
2042
3023
  /***/ ((module) => {
2043
3024
 
2044
3025
  "use strict";
2045
- module.exports = require("../graceful-fs/index.js");
3026
+ module.exports = require("constants");
2046
3027
 
2047
3028
  /***/ }),
2048
3029
 
@@ -2076,6 +3057,22 @@ module.exports = require("os");
2076
3057
  "use strict";
2077
3058
  module.exports = require("path");
2078
3059
 
3060
+ /***/ }),
3061
+
3062
+ /***/ 203:
3063
+ /***/ ((module) => {
3064
+
3065
+ "use strict";
3066
+ module.exports = require("stream");
3067
+
3068
+ /***/ }),
3069
+
3070
+ /***/ 23:
3071
+ /***/ ((module) => {
3072
+
3073
+ "use strict";
3074
+ module.exports = require("util");
3075
+
2079
3076
  /***/ })
2080
3077
 
2081
3078
  /******/ });