monorepotime 1.2.0 → 1.2.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.
- package/dist/index.js +963 -716
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -89,54 +89,54 @@ var require_polyfills = __commonJS({
|
|
|
89
89
|
}
|
|
90
90
|
var chdir;
|
|
91
91
|
module2.exports = patch;
|
|
92
|
-
function patch(
|
|
92
|
+
function patch(fs35) {
|
|
93
93
|
if (constants4.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
94
|
-
patchLchmod(
|
|
95
|
-
}
|
|
96
|
-
if (!
|
|
97
|
-
patchLutimes(
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (
|
|
118
|
-
|
|
94
|
+
patchLchmod(fs35);
|
|
95
|
+
}
|
|
96
|
+
if (!fs35.lutimes) {
|
|
97
|
+
patchLutimes(fs35);
|
|
98
|
+
}
|
|
99
|
+
fs35.chown = chownFix(fs35.chown);
|
|
100
|
+
fs35.fchown = chownFix(fs35.fchown);
|
|
101
|
+
fs35.lchown = chownFix(fs35.lchown);
|
|
102
|
+
fs35.chmod = chmodFix(fs35.chmod);
|
|
103
|
+
fs35.fchmod = chmodFix(fs35.fchmod);
|
|
104
|
+
fs35.lchmod = chmodFix(fs35.lchmod);
|
|
105
|
+
fs35.chownSync = chownFixSync(fs35.chownSync);
|
|
106
|
+
fs35.fchownSync = chownFixSync(fs35.fchownSync);
|
|
107
|
+
fs35.lchownSync = chownFixSync(fs35.lchownSync);
|
|
108
|
+
fs35.chmodSync = chmodFixSync(fs35.chmodSync);
|
|
109
|
+
fs35.fchmodSync = chmodFixSync(fs35.fchmodSync);
|
|
110
|
+
fs35.lchmodSync = chmodFixSync(fs35.lchmodSync);
|
|
111
|
+
fs35.stat = statFix(fs35.stat);
|
|
112
|
+
fs35.fstat = statFix(fs35.fstat);
|
|
113
|
+
fs35.lstat = statFix(fs35.lstat);
|
|
114
|
+
fs35.statSync = statFixSync(fs35.statSync);
|
|
115
|
+
fs35.fstatSync = statFixSync(fs35.fstatSync);
|
|
116
|
+
fs35.lstatSync = statFixSync(fs35.lstatSync);
|
|
117
|
+
if (fs35.chmod && !fs35.lchmod) {
|
|
118
|
+
fs35.lchmod = function(path40, mode, cb) {
|
|
119
119
|
if (cb) process.nextTick(cb);
|
|
120
120
|
};
|
|
121
|
-
|
|
121
|
+
fs35.lchmodSync = function() {
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
|
|
124
|
+
if (fs35.chown && !fs35.lchown) {
|
|
125
|
+
fs35.lchown = function(path40, uid, gid, cb) {
|
|
126
126
|
if (cb) process.nextTick(cb);
|
|
127
127
|
};
|
|
128
|
-
|
|
128
|
+
fs35.lchownSync = function() {
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
if (platform3 === "win32") {
|
|
132
|
-
|
|
132
|
+
fs35.rename = typeof fs35.rename !== "function" ? fs35.rename : (function(fs$rename) {
|
|
133
133
|
function rename(from, to, cb) {
|
|
134
134
|
var start = Date.now();
|
|
135
135
|
var backoff = 0;
|
|
136
136
|
fs$rename(from, to, function CB(er) {
|
|
137
137
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
138
138
|
setTimeout(function() {
|
|
139
|
-
|
|
139
|
+
fs35.stat(to, function(stater, st) {
|
|
140
140
|
if (stater && stater.code === "ENOENT")
|
|
141
141
|
fs$rename(from, to, CB);
|
|
142
142
|
else
|
|
@@ -152,9 +152,9 @@ var require_polyfills = __commonJS({
|
|
|
152
152
|
}
|
|
153
153
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
154
154
|
return rename;
|
|
155
|
-
})(
|
|
155
|
+
})(fs35.rename);
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
fs35.read = typeof fs35.read !== "function" ? fs35.read : (function(fs$read) {
|
|
158
158
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
159
159
|
var callback;
|
|
160
160
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -162,22 +162,22 @@ var require_polyfills = __commonJS({
|
|
|
162
162
|
callback = function(er, _, __) {
|
|
163
163
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
164
164
|
eagCounter++;
|
|
165
|
-
return fs$read.call(
|
|
165
|
+
return fs$read.call(fs35, fd, buffer, offset, length, position, callback);
|
|
166
166
|
}
|
|
167
167
|
callback_.apply(this, arguments);
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
return fs$read.call(
|
|
170
|
+
return fs$read.call(fs35, fd, buffer, offset, length, position, callback);
|
|
171
171
|
}
|
|
172
172
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
173
173
|
return read;
|
|
174
|
-
})(
|
|
175
|
-
|
|
174
|
+
})(fs35.read);
|
|
175
|
+
fs35.readSync = typeof fs35.readSync !== "function" ? fs35.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
176
176
|
return function(fd, buffer, offset, length, position) {
|
|
177
177
|
var eagCounter = 0;
|
|
178
178
|
while (true) {
|
|
179
179
|
try {
|
|
180
|
-
return fs$readSync.call(
|
|
180
|
+
return fs$readSync.call(fs35, fd, buffer, offset, length, position);
|
|
181
181
|
} catch (er) {
|
|
182
182
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
183
183
|
eagCounter++;
|
|
@@ -187,11 +187,11 @@ var require_polyfills = __commonJS({
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
})(
|
|
191
|
-
function patchLchmod(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
})(fs35.readSync);
|
|
191
|
+
function patchLchmod(fs36) {
|
|
192
|
+
fs36.lchmod = function(path40, mode, callback) {
|
|
193
|
+
fs36.open(
|
|
194
|
+
path40,
|
|
195
195
|
constants4.O_WRONLY | constants4.O_SYMLINK,
|
|
196
196
|
mode,
|
|
197
197
|
function(err, fd) {
|
|
@@ -199,80 +199,80 @@ var require_polyfills = __commonJS({
|
|
|
199
199
|
if (callback) callback(err);
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
fs36.fchmod(fd, mode, function(err2) {
|
|
203
|
+
fs36.close(fd, function(err22) {
|
|
204
204
|
if (callback) callback(err2 || err22);
|
|
205
205
|
});
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
);
|
|
209
209
|
};
|
|
210
|
-
|
|
211
|
-
var fd =
|
|
210
|
+
fs36.lchmodSync = function(path40, mode) {
|
|
211
|
+
var fd = fs36.openSync(path40, constants4.O_WRONLY | constants4.O_SYMLINK, mode);
|
|
212
212
|
var threw = true;
|
|
213
213
|
var ret;
|
|
214
214
|
try {
|
|
215
|
-
ret =
|
|
215
|
+
ret = fs36.fchmodSync(fd, mode);
|
|
216
216
|
threw = false;
|
|
217
217
|
} finally {
|
|
218
218
|
if (threw) {
|
|
219
219
|
try {
|
|
220
|
-
|
|
220
|
+
fs36.closeSync(fd);
|
|
221
221
|
} catch (er) {
|
|
222
222
|
}
|
|
223
223
|
} else {
|
|
224
|
-
|
|
224
|
+
fs36.closeSync(fd);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
return ret;
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
function patchLutimes(
|
|
231
|
-
if (constants4.hasOwnProperty("O_SYMLINK") &&
|
|
232
|
-
|
|
233
|
-
|
|
230
|
+
function patchLutimes(fs36) {
|
|
231
|
+
if (constants4.hasOwnProperty("O_SYMLINK") && fs36.futimes) {
|
|
232
|
+
fs36.lutimes = function(path40, at, mt, cb) {
|
|
233
|
+
fs36.open(path40, constants4.O_SYMLINK, function(er, fd) {
|
|
234
234
|
if (er) {
|
|
235
235
|
if (cb) cb(er);
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
fs36.futimes(fd, at, mt, function(er2) {
|
|
239
|
+
fs36.close(fd, function(er22) {
|
|
240
240
|
if (cb) cb(er2 || er22);
|
|
241
241
|
});
|
|
242
242
|
});
|
|
243
243
|
});
|
|
244
244
|
};
|
|
245
|
-
|
|
246
|
-
var fd =
|
|
245
|
+
fs36.lutimesSync = function(path40, at, mt) {
|
|
246
|
+
var fd = fs36.openSync(path40, constants4.O_SYMLINK);
|
|
247
247
|
var ret;
|
|
248
248
|
var threw = true;
|
|
249
249
|
try {
|
|
250
|
-
ret =
|
|
250
|
+
ret = fs36.futimesSync(fd, at, mt);
|
|
251
251
|
threw = false;
|
|
252
252
|
} finally {
|
|
253
253
|
if (threw) {
|
|
254
254
|
try {
|
|
255
|
-
|
|
255
|
+
fs36.closeSync(fd);
|
|
256
256
|
} catch (er) {
|
|
257
257
|
}
|
|
258
258
|
} else {
|
|
259
|
-
|
|
259
|
+
fs36.closeSync(fd);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
return ret;
|
|
263
263
|
};
|
|
264
|
-
} else if (
|
|
265
|
-
|
|
264
|
+
} else if (fs36.futimes) {
|
|
265
|
+
fs36.lutimes = function(_a2, _b2, _c2, cb) {
|
|
266
266
|
if (cb) process.nextTick(cb);
|
|
267
267
|
};
|
|
268
|
-
|
|
268
|
+
fs36.lutimesSync = function() {
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
function chmodFix(orig) {
|
|
273
273
|
if (!orig) return orig;
|
|
274
274
|
return function(target, mode, cb) {
|
|
275
|
-
return orig.call(
|
|
275
|
+
return orig.call(fs35, target, mode, function(er) {
|
|
276
276
|
if (chownErOk(er)) er = null;
|
|
277
277
|
if (cb) cb.apply(this, arguments);
|
|
278
278
|
});
|
|
@@ -282,7 +282,7 @@ var require_polyfills = __commonJS({
|
|
|
282
282
|
if (!orig) return orig;
|
|
283
283
|
return function(target, mode) {
|
|
284
284
|
try {
|
|
285
|
-
return orig.call(
|
|
285
|
+
return orig.call(fs35, target, mode);
|
|
286
286
|
} catch (er) {
|
|
287
287
|
if (!chownErOk(er)) throw er;
|
|
288
288
|
}
|
|
@@ -291,7 +291,7 @@ var require_polyfills = __commonJS({
|
|
|
291
291
|
function chownFix(orig) {
|
|
292
292
|
if (!orig) return orig;
|
|
293
293
|
return function(target, uid, gid, cb) {
|
|
294
|
-
return orig.call(
|
|
294
|
+
return orig.call(fs35, target, uid, gid, function(er) {
|
|
295
295
|
if (chownErOk(er)) er = null;
|
|
296
296
|
if (cb) cb.apply(this, arguments);
|
|
297
297
|
});
|
|
@@ -301,7 +301,7 @@ var require_polyfills = __commonJS({
|
|
|
301
301
|
if (!orig) return orig;
|
|
302
302
|
return function(target, uid, gid) {
|
|
303
303
|
try {
|
|
304
|
-
return orig.call(
|
|
304
|
+
return orig.call(fs35, target, uid, gid);
|
|
305
305
|
} catch (er) {
|
|
306
306
|
if (!chownErOk(er)) throw er;
|
|
307
307
|
}
|
|
@@ -321,13 +321,13 @@ var require_polyfills = __commonJS({
|
|
|
321
321
|
}
|
|
322
322
|
if (cb) cb.apply(this, arguments);
|
|
323
323
|
}
|
|
324
|
-
return options ? orig.call(
|
|
324
|
+
return options ? orig.call(fs35, target, options, callback) : orig.call(fs35, target, callback);
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
327
|
function statFixSync(orig) {
|
|
328
328
|
if (!orig) return orig;
|
|
329
329
|
return function(target, options) {
|
|
330
|
-
var stats = options ? orig.call(
|
|
330
|
+
var stats = options ? orig.call(fs35, target, options) : orig.call(fs35, target);
|
|
331
331
|
if (stats) {
|
|
332
332
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
333
333
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -357,16 +357,16 @@ var require_legacy_streams = __commonJS({
|
|
|
357
357
|
"use strict";
|
|
358
358
|
var Stream = require("stream").Stream;
|
|
359
359
|
module2.exports = legacy;
|
|
360
|
-
function legacy(
|
|
360
|
+
function legacy(fs35) {
|
|
361
361
|
return {
|
|
362
362
|
ReadStream,
|
|
363
363
|
WriteStream
|
|
364
364
|
};
|
|
365
|
-
function ReadStream(
|
|
366
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
365
|
+
function ReadStream(path40, options) {
|
|
366
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path40, options);
|
|
367
367
|
Stream.call(this);
|
|
368
368
|
var self = this;
|
|
369
|
-
this.path =
|
|
369
|
+
this.path = path40;
|
|
370
370
|
this.fd = null;
|
|
371
371
|
this.readable = true;
|
|
372
372
|
this.paused = false;
|
|
@@ -400,7 +400,7 @@ var require_legacy_streams = __commonJS({
|
|
|
400
400
|
});
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
|
-
|
|
403
|
+
fs35.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
404
404
|
if (err) {
|
|
405
405
|
self.emit("error", err);
|
|
406
406
|
self.readable = false;
|
|
@@ -411,10 +411,10 @@ var require_legacy_streams = __commonJS({
|
|
|
411
411
|
self._read();
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
-
function WriteStream(
|
|
415
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
414
|
+
function WriteStream(path40, options) {
|
|
415
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path40, options);
|
|
416
416
|
Stream.call(this);
|
|
417
|
-
this.path =
|
|
417
|
+
this.path = path40;
|
|
418
418
|
this.fd = null;
|
|
419
419
|
this.writable = true;
|
|
420
420
|
this.flags = "w";
|
|
@@ -439,7 +439,7 @@ var require_legacy_streams = __commonJS({
|
|
|
439
439
|
this.busy = false;
|
|
440
440
|
this._queue = [];
|
|
441
441
|
if (this.fd === null) {
|
|
442
|
-
this._open =
|
|
442
|
+
this._open = fs35.open;
|
|
443
443
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
444
444
|
this.flush();
|
|
445
445
|
}
|
|
@@ -475,7 +475,7 @@ var require_clone = __commonJS({
|
|
|
475
475
|
var require_graceful_fs = __commonJS({
|
|
476
476
|
"../../node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
477
477
|
"use strict";
|
|
478
|
-
var
|
|
478
|
+
var fs35 = require("fs");
|
|
479
479
|
var polyfills = require_polyfills();
|
|
480
480
|
var legacy = require_legacy_streams();
|
|
481
481
|
var clone = require_clone();
|
|
@@ -507,12 +507,12 @@ var require_graceful_fs = __commonJS({
|
|
|
507
507
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
508
508
|
console.error(m);
|
|
509
509
|
};
|
|
510
|
-
if (!
|
|
510
|
+
if (!fs35[gracefulQueue]) {
|
|
511
511
|
queue = global[gracefulQueue] || [];
|
|
512
|
-
publishQueue(
|
|
513
|
-
|
|
512
|
+
publishQueue(fs35, queue);
|
|
513
|
+
fs35.close = (function(fs$close) {
|
|
514
514
|
function close(fd, cb) {
|
|
515
|
-
return fs$close.call(
|
|
515
|
+
return fs$close.call(fs35, fd, function(err) {
|
|
516
516
|
if (!err) {
|
|
517
517
|
resetQueue();
|
|
518
518
|
}
|
|
@@ -524,48 +524,48 @@ var require_graceful_fs = __commonJS({
|
|
|
524
524
|
value: fs$close
|
|
525
525
|
});
|
|
526
526
|
return close;
|
|
527
|
-
})(
|
|
528
|
-
|
|
527
|
+
})(fs35.close);
|
|
528
|
+
fs35.closeSync = (function(fs$closeSync) {
|
|
529
529
|
function closeSync(fd) {
|
|
530
|
-
fs$closeSync.apply(
|
|
530
|
+
fs$closeSync.apply(fs35, arguments);
|
|
531
531
|
resetQueue();
|
|
532
532
|
}
|
|
533
533
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
534
534
|
value: fs$closeSync
|
|
535
535
|
});
|
|
536
536
|
return closeSync;
|
|
537
|
-
})(
|
|
537
|
+
})(fs35.closeSync);
|
|
538
538
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
539
539
|
process.on("exit", function() {
|
|
540
|
-
debug(
|
|
541
|
-
require("assert").equal(
|
|
540
|
+
debug(fs35[gracefulQueue]);
|
|
541
|
+
require("assert").equal(fs35[gracefulQueue].length, 0);
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
var queue;
|
|
546
546
|
if (!global[gracefulQueue]) {
|
|
547
|
-
publishQueue(global,
|
|
548
|
-
}
|
|
549
|
-
module2.exports = patch(clone(
|
|
550
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
551
|
-
module2.exports = patch(
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
function patch(
|
|
555
|
-
polyfills(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
var fs$readFile =
|
|
560
|
-
|
|
561
|
-
function readFile(
|
|
547
|
+
publishQueue(global, fs35[gracefulQueue]);
|
|
548
|
+
}
|
|
549
|
+
module2.exports = patch(clone(fs35));
|
|
550
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs35.__patched) {
|
|
551
|
+
module2.exports = patch(fs35);
|
|
552
|
+
fs35.__patched = true;
|
|
553
|
+
}
|
|
554
|
+
function patch(fs36) {
|
|
555
|
+
polyfills(fs36);
|
|
556
|
+
fs36.gracefulify = patch;
|
|
557
|
+
fs36.createReadStream = createReadStream2;
|
|
558
|
+
fs36.createWriteStream = createWriteStream2;
|
|
559
|
+
var fs$readFile = fs36.readFile;
|
|
560
|
+
fs36.readFile = readFile;
|
|
561
|
+
function readFile(path40, options, cb) {
|
|
562
562
|
if (typeof options === "function")
|
|
563
563
|
cb = options, options = null;
|
|
564
|
-
return go$readFile(
|
|
565
|
-
function go$readFile(
|
|
566
|
-
return fs$readFile(
|
|
564
|
+
return go$readFile(path40, options, cb);
|
|
565
|
+
function go$readFile(path41, options2, cb2, startTime) {
|
|
566
|
+
return fs$readFile(path41, options2, function(err) {
|
|
567
567
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
568
|
-
enqueue([go$readFile, [
|
|
568
|
+
enqueue([go$readFile, [path41, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
569
569
|
else {
|
|
570
570
|
if (typeof cb2 === "function")
|
|
571
571
|
cb2.apply(this, arguments);
|
|
@@ -573,16 +573,16 @@ var require_graceful_fs = __commonJS({
|
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
var fs$writeFile =
|
|
577
|
-
|
|
578
|
-
function writeFile2(
|
|
576
|
+
var fs$writeFile = fs36.writeFile;
|
|
577
|
+
fs36.writeFile = writeFile2;
|
|
578
|
+
function writeFile2(path40, data, options, cb) {
|
|
579
579
|
if (typeof options === "function")
|
|
580
580
|
cb = options, options = null;
|
|
581
|
-
return go$writeFile(
|
|
582
|
-
function go$writeFile(
|
|
583
|
-
return fs$writeFile(
|
|
581
|
+
return go$writeFile(path40, data, options, cb);
|
|
582
|
+
function go$writeFile(path41, data2, options2, cb2, startTime) {
|
|
583
|
+
return fs$writeFile(path41, data2, options2, function(err) {
|
|
584
584
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
585
|
-
enqueue([go$writeFile, [
|
|
585
|
+
enqueue([go$writeFile, [path41, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
586
586
|
else {
|
|
587
587
|
if (typeof cb2 === "function")
|
|
588
588
|
cb2.apply(this, arguments);
|
|
@@ -590,17 +590,17 @@ var require_graceful_fs = __commonJS({
|
|
|
590
590
|
});
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
|
-
var fs$appendFile =
|
|
593
|
+
var fs$appendFile = fs36.appendFile;
|
|
594
594
|
if (fs$appendFile)
|
|
595
|
-
|
|
596
|
-
function appendFile(
|
|
595
|
+
fs36.appendFile = appendFile;
|
|
596
|
+
function appendFile(path40, data, options, cb) {
|
|
597
597
|
if (typeof options === "function")
|
|
598
598
|
cb = options, options = null;
|
|
599
|
-
return go$appendFile(
|
|
600
|
-
function go$appendFile(
|
|
601
|
-
return fs$appendFile(
|
|
599
|
+
return go$appendFile(path40, data, options, cb);
|
|
600
|
+
function go$appendFile(path41, data2, options2, cb2, startTime) {
|
|
601
|
+
return fs$appendFile(path41, data2, options2, function(err) {
|
|
602
602
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
603
|
-
enqueue([go$appendFile, [
|
|
603
|
+
enqueue([go$appendFile, [path41, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
604
604
|
else {
|
|
605
605
|
if (typeof cb2 === "function")
|
|
606
606
|
cb2.apply(this, arguments);
|
|
@@ -608,9 +608,9 @@ var require_graceful_fs = __commonJS({
|
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
var fs$copyFile =
|
|
611
|
+
var fs$copyFile = fs36.copyFile;
|
|
612
612
|
if (fs$copyFile)
|
|
613
|
-
|
|
613
|
+
fs36.copyFile = copyFile;
|
|
614
614
|
function copyFile(src, dest, flags, cb) {
|
|
615
615
|
if (typeof flags === "function") {
|
|
616
616
|
cb = flags;
|
|
@@ -628,34 +628,34 @@ var require_graceful_fs = __commonJS({
|
|
|
628
628
|
});
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
var fs$readdir =
|
|
632
|
-
|
|
631
|
+
var fs$readdir = fs36.readdir;
|
|
632
|
+
fs36.readdir = readdir;
|
|
633
633
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
634
|
-
function readdir(
|
|
634
|
+
function readdir(path40, options, cb) {
|
|
635
635
|
if (typeof options === "function")
|
|
636
636
|
cb = options, options = null;
|
|
637
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
638
|
-
return fs$readdir(
|
|
639
|
-
|
|
637
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path41, options2, cb2, startTime) {
|
|
638
|
+
return fs$readdir(path41, fs$readdirCallback(
|
|
639
|
+
path41,
|
|
640
640
|
options2,
|
|
641
641
|
cb2,
|
|
642
642
|
startTime
|
|
643
643
|
));
|
|
644
|
-
} : function go$readdir2(
|
|
645
|
-
return fs$readdir(
|
|
646
|
-
|
|
644
|
+
} : function go$readdir2(path41, options2, cb2, startTime) {
|
|
645
|
+
return fs$readdir(path41, options2, fs$readdirCallback(
|
|
646
|
+
path41,
|
|
647
647
|
options2,
|
|
648
648
|
cb2,
|
|
649
649
|
startTime
|
|
650
650
|
));
|
|
651
651
|
};
|
|
652
|
-
return go$readdir(
|
|
653
|
-
function fs$readdirCallback(
|
|
652
|
+
return go$readdir(path40, options, cb);
|
|
653
|
+
function fs$readdirCallback(path41, options2, cb2, startTime) {
|
|
654
654
|
return function(err, files3) {
|
|
655
655
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
656
656
|
enqueue([
|
|
657
657
|
go$readdir,
|
|
658
|
-
[
|
|
658
|
+
[path41, options2, cb2],
|
|
659
659
|
err,
|
|
660
660
|
startTime || Date.now(),
|
|
661
661
|
Date.now()
|
|
@@ -670,21 +670,21 @@ var require_graceful_fs = __commonJS({
|
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
673
|
-
var legStreams = legacy(
|
|
673
|
+
var legStreams = legacy(fs36);
|
|
674
674
|
ReadStream = legStreams.ReadStream;
|
|
675
675
|
WriteStream = legStreams.WriteStream;
|
|
676
676
|
}
|
|
677
|
-
var fs$ReadStream =
|
|
677
|
+
var fs$ReadStream = fs36.ReadStream;
|
|
678
678
|
if (fs$ReadStream) {
|
|
679
679
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
680
680
|
ReadStream.prototype.open = ReadStream$open;
|
|
681
681
|
}
|
|
682
|
-
var fs$WriteStream =
|
|
682
|
+
var fs$WriteStream = fs36.WriteStream;
|
|
683
683
|
if (fs$WriteStream) {
|
|
684
684
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
685
685
|
WriteStream.prototype.open = WriteStream$open;
|
|
686
686
|
}
|
|
687
|
-
Object.defineProperty(
|
|
687
|
+
Object.defineProperty(fs36, "ReadStream", {
|
|
688
688
|
get: function() {
|
|
689
689
|
return ReadStream;
|
|
690
690
|
},
|
|
@@ -694,7 +694,7 @@ var require_graceful_fs = __commonJS({
|
|
|
694
694
|
enumerable: true,
|
|
695
695
|
configurable: true
|
|
696
696
|
});
|
|
697
|
-
Object.defineProperty(
|
|
697
|
+
Object.defineProperty(fs36, "WriteStream", {
|
|
698
698
|
get: function() {
|
|
699
699
|
return WriteStream;
|
|
700
700
|
},
|
|
@@ -705,7 +705,7 @@ var require_graceful_fs = __commonJS({
|
|
|
705
705
|
configurable: true
|
|
706
706
|
});
|
|
707
707
|
var FileReadStream = ReadStream;
|
|
708
|
-
Object.defineProperty(
|
|
708
|
+
Object.defineProperty(fs36, "FileReadStream", {
|
|
709
709
|
get: function() {
|
|
710
710
|
return FileReadStream;
|
|
711
711
|
},
|
|
@@ -716,7 +716,7 @@ var require_graceful_fs = __commonJS({
|
|
|
716
716
|
configurable: true
|
|
717
717
|
});
|
|
718
718
|
var FileWriteStream = WriteStream;
|
|
719
|
-
Object.defineProperty(
|
|
719
|
+
Object.defineProperty(fs36, "FileWriteStream", {
|
|
720
720
|
get: function() {
|
|
721
721
|
return FileWriteStream;
|
|
722
722
|
},
|
|
@@ -726,7 +726,7 @@ var require_graceful_fs = __commonJS({
|
|
|
726
726
|
enumerable: true,
|
|
727
727
|
configurable: true
|
|
728
728
|
});
|
|
729
|
-
function ReadStream(
|
|
729
|
+
function ReadStream(path40, options) {
|
|
730
730
|
if (this instanceof ReadStream)
|
|
731
731
|
return fs$ReadStream.apply(this, arguments), this;
|
|
732
732
|
else
|
|
@@ -746,7 +746,7 @@ var require_graceful_fs = __commonJS({
|
|
|
746
746
|
}
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
|
-
function WriteStream(
|
|
749
|
+
function WriteStream(path40, options) {
|
|
750
750
|
if (this instanceof WriteStream)
|
|
751
751
|
return fs$WriteStream.apply(this, arguments), this;
|
|
752
752
|
else
|
|
@@ -764,22 +764,22 @@ var require_graceful_fs = __commonJS({
|
|
|
764
764
|
}
|
|
765
765
|
});
|
|
766
766
|
}
|
|
767
|
-
function createReadStream2(
|
|
768
|
-
return new
|
|
767
|
+
function createReadStream2(path40, options) {
|
|
768
|
+
return new fs36.ReadStream(path40, options);
|
|
769
769
|
}
|
|
770
|
-
function createWriteStream2(
|
|
771
|
-
return new
|
|
770
|
+
function createWriteStream2(path40, options) {
|
|
771
|
+
return new fs36.WriteStream(path40, options);
|
|
772
772
|
}
|
|
773
|
-
var fs$open =
|
|
774
|
-
|
|
775
|
-
function open2(
|
|
773
|
+
var fs$open = fs36.open;
|
|
774
|
+
fs36.open = open2;
|
|
775
|
+
function open2(path40, flags, mode, cb) {
|
|
776
776
|
if (typeof mode === "function")
|
|
777
777
|
cb = mode, mode = null;
|
|
778
|
-
return go$open(
|
|
779
|
-
function go$open(
|
|
780
|
-
return fs$open(
|
|
778
|
+
return go$open(path40, flags, mode, cb);
|
|
779
|
+
function go$open(path41, flags2, mode2, cb2, startTime) {
|
|
780
|
+
return fs$open(path41, flags2, mode2, function(err, fd) {
|
|
781
781
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
782
|
-
enqueue([go$open, [
|
|
782
|
+
enqueue([go$open, [path41, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
783
783
|
else {
|
|
784
784
|
if (typeof cb2 === "function")
|
|
785
785
|
cb2.apply(this, arguments);
|
|
@@ -787,20 +787,20 @@ var require_graceful_fs = __commonJS({
|
|
|
787
787
|
});
|
|
788
788
|
}
|
|
789
789
|
}
|
|
790
|
-
return
|
|
790
|
+
return fs36;
|
|
791
791
|
}
|
|
792
792
|
function enqueue(elem) {
|
|
793
793
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
794
|
-
|
|
794
|
+
fs35[gracefulQueue].push(elem);
|
|
795
795
|
retry();
|
|
796
796
|
}
|
|
797
797
|
var retryTimer;
|
|
798
798
|
function resetQueue() {
|
|
799
799
|
var now = Date.now();
|
|
800
|
-
for (var i2 = 0; i2 <
|
|
801
|
-
if (
|
|
802
|
-
|
|
803
|
-
|
|
800
|
+
for (var i2 = 0; i2 < fs35[gracefulQueue].length; ++i2) {
|
|
801
|
+
if (fs35[gracefulQueue][i2].length > 2) {
|
|
802
|
+
fs35[gracefulQueue][i2][3] = now;
|
|
803
|
+
fs35[gracefulQueue][i2][4] = now;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
806
|
retry();
|
|
@@ -808,9 +808,9 @@ var require_graceful_fs = __commonJS({
|
|
|
808
808
|
function retry() {
|
|
809
809
|
clearTimeout(retryTimer);
|
|
810
810
|
retryTimer = void 0;
|
|
811
|
-
if (
|
|
811
|
+
if (fs35[gracefulQueue].length === 0)
|
|
812
812
|
return;
|
|
813
|
-
var elem =
|
|
813
|
+
var elem = fs35[gracefulQueue].shift();
|
|
814
814
|
var fn = elem[0];
|
|
815
815
|
var args2 = elem[1];
|
|
816
816
|
var err = elem[2];
|
|
@@ -832,7 +832,7 @@ var require_graceful_fs = __commonJS({
|
|
|
832
832
|
debug("RETRY", fn.name, args2);
|
|
833
833
|
fn.apply(null, args2.concat([startTime]));
|
|
834
834
|
} else {
|
|
835
|
-
|
|
835
|
+
fs35[gracefulQueue].push(elem);
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
if (retryTimer === void 0) {
|
|
@@ -847,7 +847,7 @@ var require_fs = __commonJS({
|
|
|
847
847
|
"../../node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
848
848
|
"use strict";
|
|
849
849
|
var u2 = require_universalify().fromCallback;
|
|
850
|
-
var
|
|
850
|
+
var fs35 = require_graceful_fs();
|
|
851
851
|
var api = [
|
|
852
852
|
"access",
|
|
853
853
|
"appendFile",
|
|
@@ -888,26 +888,26 @@ var require_fs = __commonJS({
|
|
|
888
888
|
"utimes",
|
|
889
889
|
"writeFile"
|
|
890
890
|
].filter((key) => {
|
|
891
|
-
return typeof
|
|
891
|
+
return typeof fs35[key] === "function";
|
|
892
892
|
});
|
|
893
|
-
Object.assign(exports2,
|
|
893
|
+
Object.assign(exports2, fs35);
|
|
894
894
|
api.forEach((method) => {
|
|
895
|
-
exports2[method] = u2(
|
|
895
|
+
exports2[method] = u2(fs35[method]);
|
|
896
896
|
});
|
|
897
897
|
exports2.exists = function(filename, callback) {
|
|
898
898
|
if (typeof callback === "function") {
|
|
899
|
-
return
|
|
899
|
+
return fs35.exists(filename, callback);
|
|
900
900
|
}
|
|
901
901
|
return new Promise((resolve) => {
|
|
902
|
-
return
|
|
902
|
+
return fs35.exists(filename, resolve);
|
|
903
903
|
});
|
|
904
904
|
};
|
|
905
905
|
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
906
906
|
if (typeof callback === "function") {
|
|
907
|
-
return
|
|
907
|
+
return fs35.read(fd, buffer, offset, length, position, callback);
|
|
908
908
|
}
|
|
909
909
|
return new Promise((resolve, reject) => {
|
|
910
|
-
|
|
910
|
+
fs35.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
911
911
|
if (err) return reject(err);
|
|
912
912
|
resolve({ bytesRead, buffer: buffer2 });
|
|
913
913
|
});
|
|
@@ -915,10 +915,10 @@ var require_fs = __commonJS({
|
|
|
915
915
|
};
|
|
916
916
|
exports2.write = function(fd, buffer, ...args2) {
|
|
917
917
|
if (typeof args2[args2.length - 1] === "function") {
|
|
918
|
-
return
|
|
918
|
+
return fs35.write(fd, buffer, ...args2);
|
|
919
919
|
}
|
|
920
920
|
return new Promise((resolve, reject) => {
|
|
921
|
-
|
|
921
|
+
fs35.write(fd, buffer, ...args2, (err, bytesWritten, buffer2) => {
|
|
922
922
|
if (err) return reject(err);
|
|
923
923
|
resolve({ bytesWritten, buffer: buffer2 });
|
|
924
924
|
});
|
|
@@ -926,10 +926,10 @@ var require_fs = __commonJS({
|
|
|
926
926
|
};
|
|
927
927
|
exports2.readv = function(fd, buffers, ...args2) {
|
|
928
928
|
if (typeof args2[args2.length - 1] === "function") {
|
|
929
|
-
return
|
|
929
|
+
return fs35.readv(fd, buffers, ...args2);
|
|
930
930
|
}
|
|
931
931
|
return new Promise((resolve, reject) => {
|
|
932
|
-
|
|
932
|
+
fs35.readv(fd, buffers, ...args2, (err, bytesRead, buffers2) => {
|
|
933
933
|
if (err) return reject(err);
|
|
934
934
|
resolve({ bytesRead, buffers: buffers2 });
|
|
935
935
|
});
|
|
@@ -937,17 +937,17 @@ var require_fs = __commonJS({
|
|
|
937
937
|
};
|
|
938
938
|
exports2.writev = function(fd, buffers, ...args2) {
|
|
939
939
|
if (typeof args2[args2.length - 1] === "function") {
|
|
940
|
-
return
|
|
940
|
+
return fs35.writev(fd, buffers, ...args2);
|
|
941
941
|
}
|
|
942
942
|
return new Promise((resolve, reject) => {
|
|
943
|
-
|
|
943
|
+
fs35.writev(fd, buffers, ...args2, (err, bytesWritten, buffers2) => {
|
|
944
944
|
if (err) return reject(err);
|
|
945
945
|
resolve({ bytesWritten, buffers: buffers2 });
|
|
946
946
|
});
|
|
947
947
|
});
|
|
948
948
|
};
|
|
949
|
-
if (typeof
|
|
950
|
-
exports2.realpath.native = u2(
|
|
949
|
+
if (typeof fs35.realpath.native === "function") {
|
|
950
|
+
exports2.realpath.native = u2(fs35.realpath.native);
|
|
951
951
|
} else {
|
|
952
952
|
process.emitWarning(
|
|
953
953
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -962,10 +962,10 @@ var require_fs = __commonJS({
|
|
|
962
962
|
var require_utils = __commonJS({
|
|
963
963
|
"../../node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
964
964
|
"use strict";
|
|
965
|
-
var
|
|
965
|
+
var path40 = require("path");
|
|
966
966
|
module2.exports.checkPath = function checkPath(pth) {
|
|
967
967
|
if (process.platform === "win32") {
|
|
968
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
968
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path40.parse(pth).root, ""));
|
|
969
969
|
if (pathHasInvalidWinCharacters) {
|
|
970
970
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
971
971
|
error.code = "EINVAL";
|
|
@@ -980,7 +980,7 @@ var require_utils = __commonJS({
|
|
|
980
980
|
var require_make_dir = __commonJS({
|
|
981
981
|
"../../node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
982
982
|
"use strict";
|
|
983
|
-
var
|
|
983
|
+
var fs35 = require_fs();
|
|
984
984
|
var { checkPath } = require_utils();
|
|
985
985
|
var getMode = (options) => {
|
|
986
986
|
const defaults = { mode: 511 };
|
|
@@ -989,14 +989,14 @@ var require_make_dir = __commonJS({
|
|
|
989
989
|
};
|
|
990
990
|
module2.exports.makeDir = async (dir, options) => {
|
|
991
991
|
checkPath(dir);
|
|
992
|
-
return
|
|
992
|
+
return fs35.mkdir(dir, {
|
|
993
993
|
mode: getMode(options),
|
|
994
994
|
recursive: true
|
|
995
995
|
});
|
|
996
996
|
};
|
|
997
997
|
module2.exports.makeDirSync = (dir, options) => {
|
|
998
998
|
checkPath(dir);
|
|
999
|
-
return
|
|
999
|
+
return fs35.mkdirSync(dir, {
|
|
1000
1000
|
mode: getMode(options),
|
|
1001
1001
|
recursive: true
|
|
1002
1002
|
});
|
|
@@ -1028,13 +1028,13 @@ var require_path_exists = __commonJS({
|
|
|
1028
1028
|
"../../node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
1029
1029
|
"use strict";
|
|
1030
1030
|
var u2 = require_universalify().fromPromise;
|
|
1031
|
-
var
|
|
1032
|
-
function pathExists(
|
|
1033
|
-
return
|
|
1031
|
+
var fs35 = require_fs();
|
|
1032
|
+
function pathExists(path40) {
|
|
1033
|
+
return fs35.access(path40).then(() => true).catch(() => false);
|
|
1034
1034
|
}
|
|
1035
1035
|
module2.exports = {
|
|
1036
1036
|
pathExists: u2(pathExists),
|
|
1037
|
-
pathExistsSync:
|
|
1037
|
+
pathExistsSync: fs35.existsSync
|
|
1038
1038
|
};
|
|
1039
1039
|
}
|
|
1040
1040
|
});
|
|
@@ -1043,16 +1043,16 @@ var require_path_exists = __commonJS({
|
|
|
1043
1043
|
var require_utimes = __commonJS({
|
|
1044
1044
|
"../../node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
1045
1045
|
"use strict";
|
|
1046
|
-
var
|
|
1046
|
+
var fs35 = require_fs();
|
|
1047
1047
|
var u2 = require_universalify().fromPromise;
|
|
1048
|
-
async function utimesMillis(
|
|
1049
|
-
const fd = await
|
|
1048
|
+
async function utimesMillis(path40, atime, mtime) {
|
|
1049
|
+
const fd = await fs35.open(path40, "r+");
|
|
1050
1050
|
let closeErr = null;
|
|
1051
1051
|
try {
|
|
1052
|
-
await
|
|
1052
|
+
await fs35.futimes(fd, atime, mtime);
|
|
1053
1053
|
} finally {
|
|
1054
1054
|
try {
|
|
1055
|
-
await
|
|
1055
|
+
await fs35.close(fd);
|
|
1056
1056
|
} catch (e) {
|
|
1057
1057
|
closeErr = e;
|
|
1058
1058
|
}
|
|
@@ -1061,10 +1061,10 @@ var require_utimes = __commonJS({
|
|
|
1061
1061
|
throw closeErr;
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
function utimesMillisSync(
|
|
1065
|
-
const fd =
|
|
1066
|
-
|
|
1067
|
-
return
|
|
1064
|
+
function utimesMillisSync(path40, atime, mtime) {
|
|
1065
|
+
const fd = fs35.openSync(path40, "r+");
|
|
1066
|
+
fs35.futimesSync(fd, atime, mtime);
|
|
1067
|
+
return fs35.closeSync(fd);
|
|
1068
1068
|
}
|
|
1069
1069
|
module2.exports = {
|
|
1070
1070
|
utimesMillis: u2(utimesMillis),
|
|
@@ -1077,11 +1077,11 @@ var require_utimes = __commonJS({
|
|
|
1077
1077
|
var require_stat = __commonJS({
|
|
1078
1078
|
"../../node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
1079
1079
|
"use strict";
|
|
1080
|
-
var
|
|
1081
|
-
var
|
|
1080
|
+
var fs35 = require_fs();
|
|
1081
|
+
var path40 = require("path");
|
|
1082
1082
|
var u2 = require_universalify().fromPromise;
|
|
1083
1083
|
function getStats2(src, dest, opts) {
|
|
1084
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
1084
|
+
const statFunc = opts.dereference ? (file2) => fs35.stat(file2, { bigint: true }) : (file2) => fs35.lstat(file2, { bigint: true });
|
|
1085
1085
|
return Promise.all([
|
|
1086
1086
|
statFunc(src),
|
|
1087
1087
|
statFunc(dest).catch((err) => {
|
|
@@ -1092,7 +1092,7 @@ var require_stat = __commonJS({
|
|
|
1092
1092
|
}
|
|
1093
1093
|
function getStatsSync(src, dest, opts) {
|
|
1094
1094
|
let destStat;
|
|
1095
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
1095
|
+
const statFunc = opts.dereference ? (file2) => fs35.statSync(file2, { bigint: true }) : (file2) => fs35.lstatSync(file2, { bigint: true });
|
|
1096
1096
|
const srcStat = statFunc(src);
|
|
1097
1097
|
try {
|
|
1098
1098
|
destStat = statFunc(dest);
|
|
@@ -1106,8 +1106,8 @@ var require_stat = __commonJS({
|
|
|
1106
1106
|
const { srcStat, destStat } = await getStats2(src, dest, opts);
|
|
1107
1107
|
if (destStat) {
|
|
1108
1108
|
if (areIdentical(srcStat, destStat)) {
|
|
1109
|
-
const srcBaseName =
|
|
1110
|
-
const destBaseName =
|
|
1109
|
+
const srcBaseName = path40.basename(src);
|
|
1110
|
+
const destBaseName = path40.basename(dest);
|
|
1111
1111
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1112
1112
|
return { srcStat, destStat, isChangingCase: true };
|
|
1113
1113
|
}
|
|
@@ -1129,8 +1129,8 @@ var require_stat = __commonJS({
|
|
|
1129
1129
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1130
1130
|
if (destStat) {
|
|
1131
1131
|
if (areIdentical(srcStat, destStat)) {
|
|
1132
|
-
const srcBaseName =
|
|
1133
|
-
const destBaseName =
|
|
1132
|
+
const srcBaseName = path40.basename(src);
|
|
1133
|
+
const destBaseName = path40.basename(dest);
|
|
1134
1134
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1135
1135
|
return { srcStat, destStat, isChangingCase: true };
|
|
1136
1136
|
}
|
|
@@ -1149,12 +1149,12 @@ var require_stat = __commonJS({
|
|
|
1149
1149
|
return { srcStat, destStat };
|
|
1150
1150
|
}
|
|
1151
1151
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1152
|
-
const srcParent =
|
|
1153
|
-
const destParent =
|
|
1154
|
-
if (destParent === srcParent || destParent ===
|
|
1152
|
+
const srcParent = path40.resolve(path40.dirname(src));
|
|
1153
|
+
const destParent = path40.resolve(path40.dirname(dest));
|
|
1154
|
+
if (destParent === srcParent || destParent === path40.parse(destParent).root) return;
|
|
1155
1155
|
let destStat;
|
|
1156
1156
|
try {
|
|
1157
|
-
destStat = await
|
|
1157
|
+
destStat = await fs35.stat(destParent, { bigint: true });
|
|
1158
1158
|
} catch (err) {
|
|
1159
1159
|
if (err.code === "ENOENT") return;
|
|
1160
1160
|
throw err;
|
|
@@ -1165,12 +1165,12 @@ var require_stat = __commonJS({
|
|
|
1165
1165
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
1166
1166
|
}
|
|
1167
1167
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1168
|
-
const srcParent =
|
|
1169
|
-
const destParent =
|
|
1170
|
-
if (destParent === srcParent || destParent ===
|
|
1168
|
+
const srcParent = path40.resolve(path40.dirname(src));
|
|
1169
|
+
const destParent = path40.resolve(path40.dirname(dest));
|
|
1170
|
+
if (destParent === srcParent || destParent === path40.parse(destParent).root) return;
|
|
1171
1171
|
let destStat;
|
|
1172
1172
|
try {
|
|
1173
|
-
destStat =
|
|
1173
|
+
destStat = fs35.statSync(destParent, { bigint: true });
|
|
1174
1174
|
} catch (err) {
|
|
1175
1175
|
if (err.code === "ENOENT") return;
|
|
1176
1176
|
throw err;
|
|
@@ -1184,8 +1184,8 @@ var require_stat = __commonJS({
|
|
|
1184
1184
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1185
1185
|
}
|
|
1186
1186
|
function isSrcSubdir(src, dest) {
|
|
1187
|
-
const srcArr =
|
|
1188
|
-
const destArr =
|
|
1187
|
+
const srcArr = path40.resolve(src).split(path40.sep).filter((i2) => i2);
|
|
1188
|
+
const destArr = path40.resolve(dest).split(path40.sep).filter((i2) => i2);
|
|
1189
1189
|
return srcArr.every((cur, i2) => destArr[i2] === cur);
|
|
1190
1190
|
}
|
|
1191
1191
|
function errMsg(src, dest, funcName) {
|
|
@@ -1237,8 +1237,8 @@ var require_async = __commonJS({
|
|
|
1237
1237
|
var require_copy = __commonJS({
|
|
1238
1238
|
"../../node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
1239
1239
|
"use strict";
|
|
1240
|
-
var
|
|
1241
|
-
var
|
|
1240
|
+
var fs35 = require_fs();
|
|
1241
|
+
var path40 = require("path");
|
|
1242
1242
|
var { mkdirs } = require_mkdirs();
|
|
1243
1243
|
var { pathExists } = require_path_exists();
|
|
1244
1244
|
var { utimesMillis } = require_utimes();
|
|
@@ -1261,7 +1261,7 @@ var require_copy = __commonJS({
|
|
|
1261
1261
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1262
1262
|
const include = await runFilter(src, dest, opts);
|
|
1263
1263
|
if (!include) return;
|
|
1264
|
-
const destParent =
|
|
1264
|
+
const destParent = path40.dirname(dest);
|
|
1265
1265
|
const dirExists = await pathExists(destParent);
|
|
1266
1266
|
if (!dirExists) {
|
|
1267
1267
|
await mkdirs(destParent);
|
|
@@ -1273,7 +1273,7 @@ var require_copy = __commonJS({
|
|
|
1273
1273
|
return opts.filter(src, dest);
|
|
1274
1274
|
}
|
|
1275
1275
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
1276
|
-
const statFn = opts.dereference ?
|
|
1276
|
+
const statFn = opts.dereference ? fs35.stat : fs35.lstat;
|
|
1277
1277
|
const srcStat = await statFn(src);
|
|
1278
1278
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1279
1279
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -1285,7 +1285,7 @@ var require_copy = __commonJS({
|
|
|
1285
1285
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
1286
1286
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
1287
1287
|
if (opts.overwrite) {
|
|
1288
|
-
await
|
|
1288
|
+
await fs35.unlink(dest);
|
|
1289
1289
|
return copyFile(srcStat, src, dest, opts);
|
|
1290
1290
|
}
|
|
1291
1291
|
if (opts.errorOnExist) {
|
|
@@ -1293,29 +1293,29 @@ var require_copy = __commonJS({
|
|
|
1293
1293
|
}
|
|
1294
1294
|
}
|
|
1295
1295
|
async function copyFile(srcStat, src, dest, opts) {
|
|
1296
|
-
await
|
|
1296
|
+
await fs35.copyFile(src, dest);
|
|
1297
1297
|
if (opts.preserveTimestamps) {
|
|
1298
1298
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
1299
1299
|
await makeFileWritable(dest, srcStat.mode);
|
|
1300
1300
|
}
|
|
1301
|
-
const updatedSrcStat = await
|
|
1301
|
+
const updatedSrcStat = await fs35.stat(src);
|
|
1302
1302
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1303
1303
|
}
|
|
1304
|
-
return
|
|
1304
|
+
return fs35.chmod(dest, srcStat.mode);
|
|
1305
1305
|
}
|
|
1306
1306
|
function fileIsNotWritable(srcMode) {
|
|
1307
1307
|
return (srcMode & 128) === 0;
|
|
1308
1308
|
}
|
|
1309
1309
|
function makeFileWritable(dest, srcMode) {
|
|
1310
|
-
return
|
|
1310
|
+
return fs35.chmod(dest, srcMode | 128);
|
|
1311
1311
|
}
|
|
1312
1312
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
1313
1313
|
if (!destStat) {
|
|
1314
|
-
await
|
|
1314
|
+
await fs35.mkdir(dest);
|
|
1315
1315
|
}
|
|
1316
|
-
await asyncIteratorConcurrentProcess(await
|
|
1317
|
-
const srcItem =
|
|
1318
|
-
const destItem =
|
|
1316
|
+
await asyncIteratorConcurrentProcess(await fs35.opendir(src), async (item) => {
|
|
1317
|
+
const srcItem = path40.join(src, item.name);
|
|
1318
|
+
const destItem = path40.join(dest, item.name);
|
|
1319
1319
|
const include = await runFilter(srcItem, destItem, opts);
|
|
1320
1320
|
if (include) {
|
|
1321
1321
|
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -1323,26 +1323,26 @@ var require_copy = __commonJS({
|
|
|
1323
1323
|
}
|
|
1324
1324
|
});
|
|
1325
1325
|
if (!destStat) {
|
|
1326
|
-
await
|
|
1326
|
+
await fs35.chmod(dest, srcStat.mode);
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
1329
|
async function onLink(destStat, src, dest, opts) {
|
|
1330
|
-
let resolvedSrc = await
|
|
1330
|
+
let resolvedSrc = await fs35.readlink(src);
|
|
1331
1331
|
if (opts.dereference) {
|
|
1332
|
-
resolvedSrc =
|
|
1332
|
+
resolvedSrc = path40.resolve(process.cwd(), resolvedSrc);
|
|
1333
1333
|
}
|
|
1334
1334
|
if (!destStat) {
|
|
1335
|
-
return
|
|
1335
|
+
return fs35.symlink(resolvedSrc, dest);
|
|
1336
1336
|
}
|
|
1337
1337
|
let resolvedDest = null;
|
|
1338
1338
|
try {
|
|
1339
|
-
resolvedDest = await
|
|
1339
|
+
resolvedDest = await fs35.readlink(dest);
|
|
1340
1340
|
} catch (e) {
|
|
1341
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
1341
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs35.symlink(resolvedSrc, dest);
|
|
1342
1342
|
throw e;
|
|
1343
1343
|
}
|
|
1344
1344
|
if (opts.dereference) {
|
|
1345
|
-
resolvedDest =
|
|
1345
|
+
resolvedDest = path40.resolve(process.cwd(), resolvedDest);
|
|
1346
1346
|
}
|
|
1347
1347
|
if (resolvedSrc !== resolvedDest) {
|
|
1348
1348
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -1352,8 +1352,8 @@ var require_copy = __commonJS({
|
|
|
1352
1352
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
|
-
await
|
|
1356
|
-
return
|
|
1355
|
+
await fs35.unlink(dest);
|
|
1356
|
+
return fs35.symlink(resolvedSrc, dest);
|
|
1357
1357
|
}
|
|
1358
1358
|
module2.exports = copy;
|
|
1359
1359
|
}
|
|
@@ -1363,8 +1363,8 @@ var require_copy = __commonJS({
|
|
|
1363
1363
|
var require_copy_sync = __commonJS({
|
|
1364
1364
|
"../../node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
1365
1365
|
"use strict";
|
|
1366
|
-
var
|
|
1367
|
-
var
|
|
1366
|
+
var fs35 = require_graceful_fs();
|
|
1367
|
+
var path40 = require("path");
|
|
1368
1368
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1369
1369
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1370
1370
|
var stat = require_stat();
|
|
@@ -1385,12 +1385,12 @@ var require_copy_sync = __commonJS({
|
|
|
1385
1385
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1386
1386
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1387
1387
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1388
|
-
const destParent =
|
|
1389
|
-
if (!
|
|
1388
|
+
const destParent = path40.dirname(dest);
|
|
1389
|
+
if (!fs35.existsSync(destParent)) mkdirsSync(destParent);
|
|
1390
1390
|
return getStats2(destStat, src, dest, opts);
|
|
1391
1391
|
}
|
|
1392
1392
|
function getStats2(destStat, src, dest, opts) {
|
|
1393
|
-
const statSync2 = opts.dereference ?
|
|
1393
|
+
const statSync2 = opts.dereference ? fs35.statSync : fs35.lstatSync;
|
|
1394
1394
|
const srcStat = statSync2(src);
|
|
1395
1395
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1396
1396
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -1405,14 +1405,14 @@ var require_copy_sync = __commonJS({
|
|
|
1405
1405
|
}
|
|
1406
1406
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
1407
1407
|
if (opts.overwrite) {
|
|
1408
|
-
|
|
1408
|
+
fs35.unlinkSync(dest);
|
|
1409
1409
|
return copyFile(srcStat, src, dest, opts);
|
|
1410
1410
|
} else if (opts.errorOnExist) {
|
|
1411
1411
|
throw new Error(`'${dest}' already exists`);
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
1414
|
function copyFile(srcStat, src, dest, opts) {
|
|
1415
|
-
|
|
1415
|
+
fs35.copyFileSync(src, dest);
|
|
1416
1416
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
1417
1417
|
return setDestMode(dest, srcStat.mode);
|
|
1418
1418
|
}
|
|
@@ -1427,10 +1427,10 @@ var require_copy_sync = __commonJS({
|
|
|
1427
1427
|
return setDestMode(dest, srcMode | 128);
|
|
1428
1428
|
}
|
|
1429
1429
|
function setDestMode(dest, srcMode) {
|
|
1430
|
-
return
|
|
1430
|
+
return fs35.chmodSync(dest, srcMode);
|
|
1431
1431
|
}
|
|
1432
1432
|
function setDestTimestamps(src, dest) {
|
|
1433
|
-
const updatedSrcStat =
|
|
1433
|
+
const updatedSrcStat = fs35.statSync(src);
|
|
1434
1434
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1435
1435
|
}
|
|
1436
1436
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -1438,12 +1438,12 @@ var require_copy_sync = __commonJS({
|
|
|
1438
1438
|
return copyDir(src, dest, opts);
|
|
1439
1439
|
}
|
|
1440
1440
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
1441
|
-
|
|
1441
|
+
fs35.mkdirSync(dest);
|
|
1442
1442
|
copyDir(src, dest, opts);
|
|
1443
1443
|
return setDestMode(dest, srcMode);
|
|
1444
1444
|
}
|
|
1445
1445
|
function copyDir(src, dest, opts) {
|
|
1446
|
-
const dir =
|
|
1446
|
+
const dir = fs35.opendirSync(src);
|
|
1447
1447
|
try {
|
|
1448
1448
|
let dirent;
|
|
1449
1449
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -1454,29 +1454,29 @@ var require_copy_sync = __commonJS({
|
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
1456
|
function copyDirItem(item, src, dest, opts) {
|
|
1457
|
-
const srcItem =
|
|
1458
|
-
const destItem =
|
|
1457
|
+
const srcItem = path40.join(src, item);
|
|
1458
|
+
const destItem = path40.join(dest, item);
|
|
1459
1459
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
1460
1460
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1461
1461
|
return getStats2(destStat, srcItem, destItem, opts);
|
|
1462
1462
|
}
|
|
1463
1463
|
function onLink(destStat, src, dest, opts) {
|
|
1464
|
-
let resolvedSrc =
|
|
1464
|
+
let resolvedSrc = fs35.readlinkSync(src);
|
|
1465
1465
|
if (opts.dereference) {
|
|
1466
|
-
resolvedSrc =
|
|
1466
|
+
resolvedSrc = path40.resolve(process.cwd(), resolvedSrc);
|
|
1467
1467
|
}
|
|
1468
1468
|
if (!destStat) {
|
|
1469
|
-
return
|
|
1469
|
+
return fs35.symlinkSync(resolvedSrc, dest);
|
|
1470
1470
|
} else {
|
|
1471
1471
|
let resolvedDest;
|
|
1472
1472
|
try {
|
|
1473
|
-
resolvedDest =
|
|
1473
|
+
resolvedDest = fs35.readlinkSync(dest);
|
|
1474
1474
|
} catch (err) {
|
|
1475
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
1475
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs35.symlinkSync(resolvedSrc, dest);
|
|
1476
1476
|
throw err;
|
|
1477
1477
|
}
|
|
1478
1478
|
if (opts.dereference) {
|
|
1479
|
-
resolvedDest =
|
|
1479
|
+
resolvedDest = path40.resolve(process.cwd(), resolvedDest);
|
|
1480
1480
|
}
|
|
1481
1481
|
if (resolvedSrc !== resolvedDest) {
|
|
1482
1482
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -1490,8 +1490,8 @@ var require_copy_sync = __commonJS({
|
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
1492
|
function copyLink(resolvedSrc, dest) {
|
|
1493
|
-
|
|
1494
|
-
return
|
|
1493
|
+
fs35.unlinkSync(dest);
|
|
1494
|
+
return fs35.symlinkSync(resolvedSrc, dest);
|
|
1495
1495
|
}
|
|
1496
1496
|
module2.exports = copySync;
|
|
1497
1497
|
}
|
|
@@ -1513,13 +1513,13 @@ var require_copy2 = __commonJS({
|
|
|
1513
1513
|
var require_remove = __commonJS({
|
|
1514
1514
|
"../../node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
1515
1515
|
"use strict";
|
|
1516
|
-
var
|
|
1516
|
+
var fs35 = require_graceful_fs();
|
|
1517
1517
|
var u2 = require_universalify().fromCallback;
|
|
1518
|
-
function remove(
|
|
1519
|
-
|
|
1518
|
+
function remove(path40, callback) {
|
|
1519
|
+
fs35.rm(path40, { recursive: true, force: true }, callback);
|
|
1520
1520
|
}
|
|
1521
|
-
function removeSync(
|
|
1522
|
-
|
|
1521
|
+
function removeSync(path40) {
|
|
1522
|
+
fs35.rmSync(path40, { recursive: true, force: true });
|
|
1523
1523
|
}
|
|
1524
1524
|
module2.exports = {
|
|
1525
1525
|
remove: u2(remove),
|
|
@@ -1533,28 +1533,28 @@ var require_empty = __commonJS({
|
|
|
1533
1533
|
"../../node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
1534
1534
|
"use strict";
|
|
1535
1535
|
var u2 = require_universalify().fromPromise;
|
|
1536
|
-
var
|
|
1537
|
-
var
|
|
1536
|
+
var fs35 = require_fs();
|
|
1537
|
+
var path40 = require("path");
|
|
1538
1538
|
var mkdir = require_mkdirs();
|
|
1539
1539
|
var remove = require_remove();
|
|
1540
1540
|
var emptyDir = u2(async function emptyDir2(dir) {
|
|
1541
1541
|
let items;
|
|
1542
1542
|
try {
|
|
1543
|
-
items = await
|
|
1543
|
+
items = await fs35.readdir(dir);
|
|
1544
1544
|
} catch {
|
|
1545
1545
|
return mkdir.mkdirs(dir);
|
|
1546
1546
|
}
|
|
1547
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
1547
|
+
return Promise.all(items.map((item) => remove.remove(path40.join(dir, item))));
|
|
1548
1548
|
});
|
|
1549
1549
|
function emptyDirSync(dir) {
|
|
1550
1550
|
let items;
|
|
1551
1551
|
try {
|
|
1552
|
-
items =
|
|
1552
|
+
items = fs35.readdirSync(dir);
|
|
1553
1553
|
} catch {
|
|
1554
1554
|
return mkdir.mkdirsSync(dir);
|
|
1555
1555
|
}
|
|
1556
1556
|
items.forEach((item) => {
|
|
1557
|
-
item =
|
|
1557
|
+
item = path40.join(dir, item);
|
|
1558
1558
|
remove.removeSync(item);
|
|
1559
1559
|
});
|
|
1560
1560
|
}
|
|
@@ -1572,52 +1572,52 @@ var require_file = __commonJS({
|
|
|
1572
1572
|
"../../node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
1573
1573
|
"use strict";
|
|
1574
1574
|
var u2 = require_universalify().fromPromise;
|
|
1575
|
-
var
|
|
1576
|
-
var
|
|
1575
|
+
var path40 = require("path");
|
|
1576
|
+
var fs35 = require_fs();
|
|
1577
1577
|
var mkdir = require_mkdirs();
|
|
1578
1578
|
async function createFile(file2) {
|
|
1579
1579
|
let stats;
|
|
1580
1580
|
try {
|
|
1581
|
-
stats = await
|
|
1581
|
+
stats = await fs35.stat(file2);
|
|
1582
1582
|
} catch {
|
|
1583
1583
|
}
|
|
1584
1584
|
if (stats && stats.isFile()) return;
|
|
1585
|
-
const dir =
|
|
1585
|
+
const dir = path40.dirname(file2);
|
|
1586
1586
|
let dirStats = null;
|
|
1587
1587
|
try {
|
|
1588
|
-
dirStats = await
|
|
1588
|
+
dirStats = await fs35.stat(dir);
|
|
1589
1589
|
} catch (err) {
|
|
1590
1590
|
if (err.code === "ENOENT") {
|
|
1591
1591
|
await mkdir.mkdirs(dir);
|
|
1592
|
-
await
|
|
1592
|
+
await fs35.writeFile(file2, "");
|
|
1593
1593
|
return;
|
|
1594
1594
|
} else {
|
|
1595
1595
|
throw err;
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
1598
|
if (dirStats.isDirectory()) {
|
|
1599
|
-
await
|
|
1599
|
+
await fs35.writeFile(file2, "");
|
|
1600
1600
|
} else {
|
|
1601
|
-
await
|
|
1601
|
+
await fs35.readdir(dir);
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
1604
1604
|
function createFileSync(file2) {
|
|
1605
1605
|
let stats;
|
|
1606
1606
|
try {
|
|
1607
|
-
stats =
|
|
1607
|
+
stats = fs35.statSync(file2);
|
|
1608
1608
|
} catch {
|
|
1609
1609
|
}
|
|
1610
1610
|
if (stats && stats.isFile()) return;
|
|
1611
|
-
const dir =
|
|
1611
|
+
const dir = path40.dirname(file2);
|
|
1612
1612
|
try {
|
|
1613
|
-
if (!
|
|
1614
|
-
|
|
1613
|
+
if (!fs35.statSync(dir).isDirectory()) {
|
|
1614
|
+
fs35.readdirSync(dir);
|
|
1615
1615
|
}
|
|
1616
1616
|
} catch (err) {
|
|
1617
1617
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
1618
1618
|
else throw err;
|
|
1619
1619
|
}
|
|
1620
|
-
|
|
1620
|
+
fs35.writeFileSync(file2, "");
|
|
1621
1621
|
}
|
|
1622
1622
|
module2.exports = {
|
|
1623
1623
|
createFile: u2(createFile),
|
|
@@ -1631,50 +1631,50 @@ var require_link = __commonJS({
|
|
|
1631
1631
|
"../../node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
1632
1632
|
"use strict";
|
|
1633
1633
|
var u2 = require_universalify().fromPromise;
|
|
1634
|
-
var
|
|
1635
|
-
var
|
|
1634
|
+
var path40 = require("path");
|
|
1635
|
+
var fs35 = require_fs();
|
|
1636
1636
|
var mkdir = require_mkdirs();
|
|
1637
1637
|
var { pathExists } = require_path_exists();
|
|
1638
1638
|
var { areIdentical } = require_stat();
|
|
1639
1639
|
async function createLink(srcpath, dstpath) {
|
|
1640
1640
|
let dstStat;
|
|
1641
1641
|
try {
|
|
1642
|
-
dstStat = await
|
|
1642
|
+
dstStat = await fs35.lstat(dstpath);
|
|
1643
1643
|
} catch {
|
|
1644
1644
|
}
|
|
1645
1645
|
let srcStat;
|
|
1646
1646
|
try {
|
|
1647
|
-
srcStat = await
|
|
1647
|
+
srcStat = await fs35.lstat(srcpath);
|
|
1648
1648
|
} catch (err) {
|
|
1649
1649
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1650
1650
|
throw err;
|
|
1651
1651
|
}
|
|
1652
1652
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1653
|
-
const dir =
|
|
1653
|
+
const dir = path40.dirname(dstpath);
|
|
1654
1654
|
const dirExists = await pathExists(dir);
|
|
1655
1655
|
if (!dirExists) {
|
|
1656
1656
|
await mkdir.mkdirs(dir);
|
|
1657
1657
|
}
|
|
1658
|
-
await
|
|
1658
|
+
await fs35.link(srcpath, dstpath);
|
|
1659
1659
|
}
|
|
1660
1660
|
function createLinkSync(srcpath, dstpath) {
|
|
1661
1661
|
let dstStat;
|
|
1662
1662
|
try {
|
|
1663
|
-
dstStat =
|
|
1663
|
+
dstStat = fs35.lstatSync(dstpath);
|
|
1664
1664
|
} catch {
|
|
1665
1665
|
}
|
|
1666
1666
|
try {
|
|
1667
|
-
const srcStat =
|
|
1667
|
+
const srcStat = fs35.lstatSync(srcpath);
|
|
1668
1668
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1669
1669
|
} catch (err) {
|
|
1670
1670
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1671
1671
|
throw err;
|
|
1672
1672
|
}
|
|
1673
|
-
const dir =
|
|
1674
|
-
const dirExists =
|
|
1675
|
-
if (dirExists) return
|
|
1673
|
+
const dir = path40.dirname(dstpath);
|
|
1674
|
+
const dirExists = fs35.existsSync(dir);
|
|
1675
|
+
if (dirExists) return fs35.linkSync(srcpath, dstpath);
|
|
1676
1676
|
mkdir.mkdirsSync(dir);
|
|
1677
|
-
return
|
|
1677
|
+
return fs35.linkSync(srcpath, dstpath);
|
|
1678
1678
|
}
|
|
1679
1679
|
module2.exports = {
|
|
1680
1680
|
createLink: u2(createLink),
|
|
@@ -1687,14 +1687,14 @@ var require_link = __commonJS({
|
|
|
1687
1687
|
var require_symlink_paths = __commonJS({
|
|
1688
1688
|
"../../node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
1689
1689
|
"use strict";
|
|
1690
|
-
var
|
|
1691
|
-
var
|
|
1690
|
+
var path40 = require("path");
|
|
1691
|
+
var fs35 = require_fs();
|
|
1692
1692
|
var { pathExists } = require_path_exists();
|
|
1693
1693
|
var u2 = require_universalify().fromPromise;
|
|
1694
1694
|
async function symlinkPaths(srcpath, dstpath) {
|
|
1695
|
-
if (
|
|
1695
|
+
if (path40.isAbsolute(srcpath)) {
|
|
1696
1696
|
try {
|
|
1697
|
-
await
|
|
1697
|
+
await fs35.lstat(srcpath);
|
|
1698
1698
|
} catch (err) {
|
|
1699
1699
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1700
1700
|
throw err;
|
|
@@ -1704,8 +1704,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1704
1704
|
toDst: srcpath
|
|
1705
1705
|
};
|
|
1706
1706
|
}
|
|
1707
|
-
const dstdir =
|
|
1708
|
-
const relativeToDst =
|
|
1707
|
+
const dstdir = path40.dirname(dstpath);
|
|
1708
|
+
const relativeToDst = path40.join(dstdir, srcpath);
|
|
1709
1709
|
const exists = await pathExists(relativeToDst);
|
|
1710
1710
|
if (exists) {
|
|
1711
1711
|
return {
|
|
@@ -1714,39 +1714,39 @@ var require_symlink_paths = __commonJS({
|
|
|
1714
1714
|
};
|
|
1715
1715
|
}
|
|
1716
1716
|
try {
|
|
1717
|
-
await
|
|
1717
|
+
await fs35.lstat(srcpath);
|
|
1718
1718
|
} catch (err) {
|
|
1719
1719
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1720
1720
|
throw err;
|
|
1721
1721
|
}
|
|
1722
1722
|
return {
|
|
1723
1723
|
toCwd: srcpath,
|
|
1724
|
-
toDst:
|
|
1724
|
+
toDst: path40.relative(dstdir, srcpath)
|
|
1725
1725
|
};
|
|
1726
1726
|
}
|
|
1727
1727
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1728
|
-
if (
|
|
1729
|
-
const exists2 =
|
|
1728
|
+
if (path40.isAbsolute(srcpath)) {
|
|
1729
|
+
const exists2 = fs35.existsSync(srcpath);
|
|
1730
1730
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
1731
1731
|
return {
|
|
1732
1732
|
toCwd: srcpath,
|
|
1733
1733
|
toDst: srcpath
|
|
1734
1734
|
};
|
|
1735
1735
|
}
|
|
1736
|
-
const dstdir =
|
|
1737
|
-
const relativeToDst =
|
|
1738
|
-
const exists =
|
|
1736
|
+
const dstdir = path40.dirname(dstpath);
|
|
1737
|
+
const relativeToDst = path40.join(dstdir, srcpath);
|
|
1738
|
+
const exists = fs35.existsSync(relativeToDst);
|
|
1739
1739
|
if (exists) {
|
|
1740
1740
|
return {
|
|
1741
1741
|
toCwd: relativeToDst,
|
|
1742
1742
|
toDst: srcpath
|
|
1743
1743
|
};
|
|
1744
1744
|
}
|
|
1745
|
-
const srcExists =
|
|
1745
|
+
const srcExists = fs35.existsSync(srcpath);
|
|
1746
1746
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
1747
1747
|
return {
|
|
1748
1748
|
toCwd: srcpath,
|
|
1749
|
-
toDst:
|
|
1749
|
+
toDst: path40.relative(dstdir, srcpath)
|
|
1750
1750
|
};
|
|
1751
1751
|
}
|
|
1752
1752
|
module2.exports = {
|
|
@@ -1760,13 +1760,13 @@ var require_symlink_paths = __commonJS({
|
|
|
1760
1760
|
var require_symlink_type = __commonJS({
|
|
1761
1761
|
"../../node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
1762
1762
|
"use strict";
|
|
1763
|
-
var
|
|
1763
|
+
var fs35 = require_fs();
|
|
1764
1764
|
var u2 = require_universalify().fromPromise;
|
|
1765
1765
|
async function symlinkType(srcpath, type) {
|
|
1766
1766
|
if (type) return type;
|
|
1767
1767
|
let stats;
|
|
1768
1768
|
try {
|
|
1769
|
-
stats = await
|
|
1769
|
+
stats = await fs35.lstat(srcpath);
|
|
1770
1770
|
} catch {
|
|
1771
1771
|
return "file";
|
|
1772
1772
|
}
|
|
@@ -1776,7 +1776,7 @@ var require_symlink_type = __commonJS({
|
|
|
1776
1776
|
if (type) return type;
|
|
1777
1777
|
let stats;
|
|
1778
1778
|
try {
|
|
1779
|
-
stats =
|
|
1779
|
+
stats = fs35.lstatSync(srcpath);
|
|
1780
1780
|
} catch {
|
|
1781
1781
|
return "file";
|
|
1782
1782
|
}
|
|
@@ -1794,8 +1794,8 @@ var require_symlink = __commonJS({
|
|
|
1794
1794
|
"../../node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
1795
1795
|
"use strict";
|
|
1796
1796
|
var u2 = require_universalify().fromPromise;
|
|
1797
|
-
var
|
|
1798
|
-
var
|
|
1797
|
+
var path40 = require("path");
|
|
1798
|
+
var fs35 = require_fs();
|
|
1799
1799
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1800
1800
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
1801
1801
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -1804,44 +1804,44 @@ var require_symlink = __commonJS({
|
|
|
1804
1804
|
async function createSymlink(srcpath, dstpath, type) {
|
|
1805
1805
|
let stats;
|
|
1806
1806
|
try {
|
|
1807
|
-
stats = await
|
|
1807
|
+
stats = await fs35.lstat(dstpath);
|
|
1808
1808
|
} catch {
|
|
1809
1809
|
}
|
|
1810
1810
|
if (stats && stats.isSymbolicLink()) {
|
|
1811
1811
|
const [srcStat, dstStat] = await Promise.all([
|
|
1812
|
-
|
|
1813
|
-
|
|
1812
|
+
fs35.stat(srcpath),
|
|
1813
|
+
fs35.stat(dstpath)
|
|
1814
1814
|
]);
|
|
1815
1815
|
if (areIdentical(srcStat, dstStat)) return;
|
|
1816
1816
|
}
|
|
1817
1817
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
1818
1818
|
srcpath = relative.toDst;
|
|
1819
1819
|
const toType = await symlinkType(relative.toCwd, type);
|
|
1820
|
-
const dir =
|
|
1820
|
+
const dir = path40.dirname(dstpath);
|
|
1821
1821
|
if (!await pathExists(dir)) {
|
|
1822
1822
|
await mkdirs(dir);
|
|
1823
1823
|
}
|
|
1824
|
-
return
|
|
1824
|
+
return fs35.symlink(srcpath, dstpath, toType);
|
|
1825
1825
|
}
|
|
1826
1826
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
1827
1827
|
let stats;
|
|
1828
1828
|
try {
|
|
1829
|
-
stats =
|
|
1829
|
+
stats = fs35.lstatSync(dstpath);
|
|
1830
1830
|
} catch {
|
|
1831
1831
|
}
|
|
1832
1832
|
if (stats && stats.isSymbolicLink()) {
|
|
1833
|
-
const srcStat =
|
|
1834
|
-
const dstStat =
|
|
1833
|
+
const srcStat = fs35.statSync(srcpath);
|
|
1834
|
+
const dstStat = fs35.statSync(dstpath);
|
|
1835
1835
|
if (areIdentical(srcStat, dstStat)) return;
|
|
1836
1836
|
}
|
|
1837
1837
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1838
1838
|
srcpath = relative.toDst;
|
|
1839
1839
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
1840
|
-
const dir =
|
|
1841
|
-
const exists =
|
|
1842
|
-
if (exists) return
|
|
1840
|
+
const dir = path40.dirname(dstpath);
|
|
1841
|
+
const exists = fs35.existsSync(dir);
|
|
1842
|
+
if (exists) return fs35.symlinkSync(srcpath, dstpath, type);
|
|
1843
1843
|
mkdirsSync(dir);
|
|
1844
|
-
return
|
|
1844
|
+
return fs35.symlinkSync(srcpath, dstpath, type);
|
|
1845
1845
|
}
|
|
1846
1846
|
module2.exports = {
|
|
1847
1847
|
createSymlink: u2(createSymlink),
|
|
@@ -1910,9 +1910,9 @@ var require_jsonfile = __commonJS({
|
|
|
1910
1910
|
if (typeof options === "string") {
|
|
1911
1911
|
options = { encoding: options };
|
|
1912
1912
|
}
|
|
1913
|
-
const
|
|
1913
|
+
const fs35 = options.fs || _fs;
|
|
1914
1914
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1915
|
-
let data = await universalify.fromCallback(
|
|
1915
|
+
let data = await universalify.fromCallback(fs35.readFile)(file2, options);
|
|
1916
1916
|
data = stripBom(data);
|
|
1917
1917
|
let obj;
|
|
1918
1918
|
try {
|
|
@@ -1932,10 +1932,10 @@ var require_jsonfile = __commonJS({
|
|
|
1932
1932
|
if (typeof options === "string") {
|
|
1933
1933
|
options = { encoding: options };
|
|
1934
1934
|
}
|
|
1935
|
-
const
|
|
1935
|
+
const fs35 = options.fs || _fs;
|
|
1936
1936
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1937
1937
|
try {
|
|
1938
|
-
let content =
|
|
1938
|
+
let content = fs35.readFileSync(file2, options);
|
|
1939
1939
|
content = stripBom(content);
|
|
1940
1940
|
return JSON.parse(content, options.reviver);
|
|
1941
1941
|
} catch (err) {
|
|
@@ -1948,15 +1948,15 @@ var require_jsonfile = __commonJS({
|
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
1950
|
async function _writeFile(file2, obj, options = {}) {
|
|
1951
|
-
const
|
|
1951
|
+
const fs35 = options.fs || _fs;
|
|
1952
1952
|
const str = stringify(obj, options);
|
|
1953
|
-
await universalify.fromCallback(
|
|
1953
|
+
await universalify.fromCallback(fs35.writeFile)(file2, str, options);
|
|
1954
1954
|
}
|
|
1955
1955
|
var writeFile2 = universalify.fromPromise(_writeFile);
|
|
1956
1956
|
function writeFileSync2(file2, obj, options = {}) {
|
|
1957
|
-
const
|
|
1957
|
+
const fs35 = options.fs || _fs;
|
|
1958
1958
|
const str = stringify(obj, options);
|
|
1959
|
-
return
|
|
1959
|
+
return fs35.writeFileSync(file2, str, options);
|
|
1960
1960
|
}
|
|
1961
1961
|
module2.exports = {
|
|
1962
1962
|
readFile,
|
|
@@ -1987,23 +1987,23 @@ var require_output_file = __commonJS({
|
|
|
1987
1987
|
"../../node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
1988
1988
|
"use strict";
|
|
1989
1989
|
var u2 = require_universalify().fromPromise;
|
|
1990
|
-
var
|
|
1991
|
-
var
|
|
1990
|
+
var fs35 = require_fs();
|
|
1991
|
+
var path40 = require("path");
|
|
1992
1992
|
var mkdir = require_mkdirs();
|
|
1993
1993
|
var pathExists = require_path_exists().pathExists;
|
|
1994
1994
|
async function outputFile(file2, data, encoding = "utf-8") {
|
|
1995
|
-
const dir =
|
|
1995
|
+
const dir = path40.dirname(file2);
|
|
1996
1996
|
if (!await pathExists(dir)) {
|
|
1997
1997
|
await mkdir.mkdirs(dir);
|
|
1998
1998
|
}
|
|
1999
|
-
return
|
|
1999
|
+
return fs35.writeFile(file2, data, encoding);
|
|
2000
2000
|
}
|
|
2001
2001
|
function outputFileSync(file2, ...args2) {
|
|
2002
|
-
const dir =
|
|
2003
|
-
if (!
|
|
2002
|
+
const dir = path40.dirname(file2);
|
|
2003
|
+
if (!fs35.existsSync(dir)) {
|
|
2004
2004
|
mkdir.mkdirsSync(dir);
|
|
2005
2005
|
}
|
|
2006
|
-
|
|
2006
|
+
fs35.writeFileSync(file2, ...args2);
|
|
2007
2007
|
}
|
|
2008
2008
|
module2.exports = {
|
|
2009
2009
|
outputFile: u2(outputFile),
|
|
@@ -2062,8 +2062,8 @@ var require_json = __commonJS({
|
|
|
2062
2062
|
var require_move = __commonJS({
|
|
2063
2063
|
"../../node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
2064
2064
|
"use strict";
|
|
2065
|
-
var
|
|
2066
|
-
var
|
|
2065
|
+
var fs35 = require_fs();
|
|
2066
|
+
var path40 = require("path");
|
|
2067
2067
|
var { copy } = require_copy2();
|
|
2068
2068
|
var { remove } = require_remove();
|
|
2069
2069
|
var { mkdirp } = require_mkdirs();
|
|
@@ -2073,8 +2073,8 @@ var require_move = __commonJS({
|
|
|
2073
2073
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2074
2074
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
2075
2075
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2076
|
-
const destParent =
|
|
2077
|
-
const parsedParentPath =
|
|
2076
|
+
const destParent = path40.dirname(dest);
|
|
2077
|
+
const parsedParentPath = path40.parse(destParent);
|
|
2078
2078
|
if (parsedParentPath.root !== destParent) {
|
|
2079
2079
|
await mkdirp(destParent);
|
|
2080
2080
|
}
|
|
@@ -2089,7 +2089,7 @@ var require_move = __commonJS({
|
|
|
2089
2089
|
}
|
|
2090
2090
|
}
|
|
2091
2091
|
try {
|
|
2092
|
-
await
|
|
2092
|
+
await fs35.rename(src, dest);
|
|
2093
2093
|
} catch (err) {
|
|
2094
2094
|
if (err.code !== "EXDEV") {
|
|
2095
2095
|
throw err;
|
|
@@ -2114,8 +2114,8 @@ var require_move = __commonJS({
|
|
|
2114
2114
|
var require_move_sync = __commonJS({
|
|
2115
2115
|
"../../node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
2116
2116
|
"use strict";
|
|
2117
|
-
var
|
|
2118
|
-
var
|
|
2117
|
+
var fs35 = require_graceful_fs();
|
|
2118
|
+
var path40 = require("path");
|
|
2119
2119
|
var copySync = require_copy2().copySync;
|
|
2120
2120
|
var removeSync = require_remove().removeSync;
|
|
2121
2121
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -2125,12 +2125,12 @@ var require_move_sync = __commonJS({
|
|
|
2125
2125
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2126
2126
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2127
2127
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2128
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
2128
|
+
if (!isParentRoot(dest)) mkdirpSync(path40.dirname(dest));
|
|
2129
2129
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
2130
2130
|
}
|
|
2131
2131
|
function isParentRoot(dest) {
|
|
2132
|
-
const parent =
|
|
2133
|
-
const parsedPath =
|
|
2132
|
+
const parent = path40.dirname(dest);
|
|
2133
|
+
const parsedPath = path40.parse(parent);
|
|
2134
2134
|
return parsedPath.root === parent;
|
|
2135
2135
|
}
|
|
2136
2136
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -2139,12 +2139,12 @@ var require_move_sync = __commonJS({
|
|
|
2139
2139
|
removeSync(dest);
|
|
2140
2140
|
return rename(src, dest, overwrite);
|
|
2141
2141
|
}
|
|
2142
|
-
if (
|
|
2142
|
+
if (fs35.existsSync(dest)) throw new Error("dest already exists.");
|
|
2143
2143
|
return rename(src, dest, overwrite);
|
|
2144
2144
|
}
|
|
2145
2145
|
function rename(src, dest, overwrite) {
|
|
2146
2146
|
try {
|
|
2147
|
-
|
|
2147
|
+
fs35.renameSync(src, dest);
|
|
2148
2148
|
} catch (err) {
|
|
2149
2149
|
if (err.code !== "EXDEV") throw err;
|
|
2150
2150
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -3068,15 +3068,15 @@ var require_route = __commonJS({
|
|
|
3068
3068
|
};
|
|
3069
3069
|
}
|
|
3070
3070
|
function wrapConversion(toModel, graph) {
|
|
3071
|
-
const
|
|
3071
|
+
const path40 = [graph[toModel].parent, toModel];
|
|
3072
3072
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
3073
3073
|
let cur = graph[toModel].parent;
|
|
3074
3074
|
while (graph[cur].parent) {
|
|
3075
|
-
|
|
3075
|
+
path40.unshift(graph[cur].parent);
|
|
3076
3076
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
3077
3077
|
cur = graph[cur].parent;
|
|
3078
3078
|
}
|
|
3079
|
-
fn.conversion =
|
|
3079
|
+
fn.conversion = path40;
|
|
3080
3080
|
return fn;
|
|
3081
3081
|
}
|
|
3082
3082
|
module2.exports = function(fromModel) {
|
|
@@ -4730,8 +4730,8 @@ var require_windows = __commonJS({
|
|
|
4730
4730
|
"use strict";
|
|
4731
4731
|
module2.exports = isexe;
|
|
4732
4732
|
isexe.sync = sync;
|
|
4733
|
-
var
|
|
4734
|
-
function checkPathExt(
|
|
4733
|
+
var fs35 = require("fs");
|
|
4734
|
+
function checkPathExt(path40, options) {
|
|
4735
4735
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
4736
4736
|
if (!pathext) {
|
|
4737
4737
|
return true;
|
|
@@ -4742,25 +4742,25 @@ var require_windows = __commonJS({
|
|
|
4742
4742
|
}
|
|
4743
4743
|
for (var i2 = 0; i2 < pathext.length; i2++) {
|
|
4744
4744
|
var p = pathext[i2].toLowerCase();
|
|
4745
|
-
if (p &&
|
|
4745
|
+
if (p && path40.substr(-p.length).toLowerCase() === p) {
|
|
4746
4746
|
return true;
|
|
4747
4747
|
}
|
|
4748
4748
|
}
|
|
4749
4749
|
return false;
|
|
4750
4750
|
}
|
|
4751
|
-
function checkStat(stat,
|
|
4751
|
+
function checkStat(stat, path40, options) {
|
|
4752
4752
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
4753
4753
|
return false;
|
|
4754
4754
|
}
|
|
4755
|
-
return checkPathExt(
|
|
4755
|
+
return checkPathExt(path40, options);
|
|
4756
4756
|
}
|
|
4757
|
-
function isexe(
|
|
4758
|
-
|
|
4759
|
-
cb(er, er ? false : checkStat(stat,
|
|
4757
|
+
function isexe(path40, options, cb) {
|
|
4758
|
+
fs35.stat(path40, function(er, stat) {
|
|
4759
|
+
cb(er, er ? false : checkStat(stat, path40, options));
|
|
4760
4760
|
});
|
|
4761
4761
|
}
|
|
4762
|
-
function sync(
|
|
4763
|
-
return checkStat(
|
|
4762
|
+
function sync(path40, options) {
|
|
4763
|
+
return checkStat(fs35.statSync(path40), path40, options);
|
|
4764
4764
|
}
|
|
4765
4765
|
}
|
|
4766
4766
|
});
|
|
@@ -4771,14 +4771,14 @@ var require_mode = __commonJS({
|
|
|
4771
4771
|
"use strict";
|
|
4772
4772
|
module2.exports = isexe;
|
|
4773
4773
|
isexe.sync = sync;
|
|
4774
|
-
var
|
|
4775
|
-
function isexe(
|
|
4776
|
-
|
|
4774
|
+
var fs35 = require("fs");
|
|
4775
|
+
function isexe(path40, options, cb) {
|
|
4776
|
+
fs35.stat(path40, function(er, stat) {
|
|
4777
4777
|
cb(er, er ? false : checkStat(stat, options));
|
|
4778
4778
|
});
|
|
4779
4779
|
}
|
|
4780
|
-
function sync(
|
|
4781
|
-
return checkStat(
|
|
4780
|
+
function sync(path40, options) {
|
|
4781
|
+
return checkStat(fs35.statSync(path40), options);
|
|
4782
4782
|
}
|
|
4783
4783
|
function checkStat(stat, options) {
|
|
4784
4784
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -4803,7 +4803,7 @@ var require_mode = __commonJS({
|
|
|
4803
4803
|
var require_isexe = __commonJS({
|
|
4804
4804
|
"../../node_modules/isexe/index.js"(exports2, module2) {
|
|
4805
4805
|
"use strict";
|
|
4806
|
-
var
|
|
4806
|
+
var fs35 = require("fs");
|
|
4807
4807
|
var core;
|
|
4808
4808
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
4809
4809
|
core = require_windows();
|
|
@@ -4812,7 +4812,7 @@ var require_isexe = __commonJS({
|
|
|
4812
4812
|
}
|
|
4813
4813
|
module2.exports = isexe;
|
|
4814
4814
|
isexe.sync = sync;
|
|
4815
|
-
function isexe(
|
|
4815
|
+
function isexe(path40, options, cb) {
|
|
4816
4816
|
if (typeof options === "function") {
|
|
4817
4817
|
cb = options;
|
|
4818
4818
|
options = {};
|
|
@@ -4822,7 +4822,7 @@ var require_isexe = __commonJS({
|
|
|
4822
4822
|
throw new TypeError("callback not provided");
|
|
4823
4823
|
}
|
|
4824
4824
|
return new Promise(function(resolve, reject) {
|
|
4825
|
-
isexe(
|
|
4825
|
+
isexe(path40, options || {}, function(er, is) {
|
|
4826
4826
|
if (er) {
|
|
4827
4827
|
reject(er);
|
|
4828
4828
|
} else {
|
|
@@ -4831,7 +4831,7 @@ var require_isexe = __commonJS({
|
|
|
4831
4831
|
});
|
|
4832
4832
|
});
|
|
4833
4833
|
}
|
|
4834
|
-
core(
|
|
4834
|
+
core(path40, options || {}, function(er, is) {
|
|
4835
4835
|
if (er) {
|
|
4836
4836
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
4837
4837
|
er = null;
|
|
@@ -4841,9 +4841,9 @@ var require_isexe = __commonJS({
|
|
|
4841
4841
|
cb(er, is);
|
|
4842
4842
|
});
|
|
4843
4843
|
}
|
|
4844
|
-
function sync(
|
|
4844
|
+
function sync(path40, options) {
|
|
4845
4845
|
try {
|
|
4846
|
-
return core.sync(
|
|
4846
|
+
return core.sync(path40, options || {});
|
|
4847
4847
|
} catch (er) {
|
|
4848
4848
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
4849
4849
|
return false;
|
|
@@ -4860,7 +4860,7 @@ var require_which = __commonJS({
|
|
|
4860
4860
|
"../../node_modules/which/which.js"(exports2, module2) {
|
|
4861
4861
|
"use strict";
|
|
4862
4862
|
var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
4863
|
-
var
|
|
4863
|
+
var path40 = require("path");
|
|
4864
4864
|
var COLON = isWindows2 ? ";" : ":";
|
|
4865
4865
|
var isexe = require_isexe();
|
|
4866
4866
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -4898,7 +4898,7 @@ var require_which = __commonJS({
|
|
|
4898
4898
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
4899
4899
|
const ppRaw = pathEnv[i2];
|
|
4900
4900
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
4901
|
-
const pCmd =
|
|
4901
|
+
const pCmd = path40.join(pathPart, cmd);
|
|
4902
4902
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
4903
4903
|
resolve(subStep(p, i2, 0));
|
|
4904
4904
|
});
|
|
@@ -4925,7 +4925,7 @@ var require_which = __commonJS({
|
|
|
4925
4925
|
for (let i2 = 0; i2 < pathEnv.length; i2++) {
|
|
4926
4926
|
const ppRaw = pathEnv[i2];
|
|
4927
4927
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
4928
|
-
const pCmd =
|
|
4928
|
+
const pCmd = path40.join(pathPart, cmd);
|
|
4929
4929
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
4930
4930
|
for (let j = 0; j < pathExt.length; j++) {
|
|
4931
4931
|
const cur = p + pathExt[j];
|
|
@@ -4973,7 +4973,7 @@ var require_path_key = __commonJS({
|
|
|
4973
4973
|
var require_resolveCommand = __commonJS({
|
|
4974
4974
|
"../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
4975
4975
|
"use strict";
|
|
4976
|
-
var
|
|
4976
|
+
var path40 = require("path");
|
|
4977
4977
|
var which = require_which();
|
|
4978
4978
|
var getPathKey = require_path_key();
|
|
4979
4979
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -4991,7 +4991,7 @@ var require_resolveCommand = __commonJS({
|
|
|
4991
4991
|
try {
|
|
4992
4992
|
resolved = which.sync(parsed.command, {
|
|
4993
4993
|
path: env[getPathKey({ env })],
|
|
4994
|
-
pathExt: withoutPathExt ?
|
|
4994
|
+
pathExt: withoutPathExt ? path40.delimiter : void 0
|
|
4995
4995
|
});
|
|
4996
4996
|
} catch (e) {
|
|
4997
4997
|
} finally {
|
|
@@ -5000,7 +5000,7 @@ var require_resolveCommand = __commonJS({
|
|
|
5000
5000
|
}
|
|
5001
5001
|
}
|
|
5002
5002
|
if (resolved) {
|
|
5003
|
-
resolved =
|
|
5003
|
+
resolved = path40.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
5004
5004
|
}
|
|
5005
5005
|
return resolved;
|
|
5006
5006
|
}
|
|
@@ -5054,8 +5054,8 @@ var require_shebang_command = __commonJS({
|
|
|
5054
5054
|
if (!match) {
|
|
5055
5055
|
return null;
|
|
5056
5056
|
}
|
|
5057
|
-
const [
|
|
5058
|
-
const binary =
|
|
5057
|
+
const [path40, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
5058
|
+
const binary = path40.split("/").pop();
|
|
5059
5059
|
if (binary === "env") {
|
|
5060
5060
|
return argument;
|
|
5061
5061
|
}
|
|
@@ -5068,16 +5068,16 @@ var require_shebang_command = __commonJS({
|
|
|
5068
5068
|
var require_readShebang = __commonJS({
|
|
5069
5069
|
"../../node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
|
|
5070
5070
|
"use strict";
|
|
5071
|
-
var
|
|
5071
|
+
var fs35 = require("fs");
|
|
5072
5072
|
var shebangCommand = require_shebang_command();
|
|
5073
5073
|
function readShebang(command2) {
|
|
5074
5074
|
const size = 150;
|
|
5075
5075
|
const buffer = Buffer.alloc(size);
|
|
5076
5076
|
let fd;
|
|
5077
5077
|
try {
|
|
5078
|
-
fd =
|
|
5079
|
-
|
|
5080
|
-
|
|
5078
|
+
fd = fs35.openSync(command2, "r");
|
|
5079
|
+
fs35.readSync(fd, buffer, 0, size, 0);
|
|
5080
|
+
fs35.closeSync(fd);
|
|
5081
5081
|
} catch (e) {
|
|
5082
5082
|
}
|
|
5083
5083
|
return shebangCommand(buffer.toString());
|
|
@@ -5090,7 +5090,7 @@ var require_readShebang = __commonJS({
|
|
|
5090
5090
|
var require_parse = __commonJS({
|
|
5091
5091
|
"../../node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
5092
5092
|
"use strict";
|
|
5093
|
-
var
|
|
5093
|
+
var path40 = require("path");
|
|
5094
5094
|
var resolveCommand = require_resolveCommand();
|
|
5095
5095
|
var escape2 = require_escape();
|
|
5096
5096
|
var readShebang = require_readShebang();
|
|
@@ -5115,7 +5115,7 @@ var require_parse = __commonJS({
|
|
|
5115
5115
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
5116
5116
|
if (parsed.options.forceShell || needsShell) {
|
|
5117
5117
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
5118
|
-
parsed.command =
|
|
5118
|
+
parsed.command = path40.normalize(parsed.command);
|
|
5119
5119
|
parsed.command = escape2.command(parsed.command);
|
|
5120
5120
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
5121
5121
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -9326,13 +9326,13 @@ var init_output_sync = __esm({
|
|
|
9326
9326
|
}
|
|
9327
9327
|
};
|
|
9328
9328
|
writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
9329
|
-
for (const { path:
|
|
9330
|
-
const pathString = typeof
|
|
9329
|
+
for (const { path: path40, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
9330
|
+
const pathString = typeof path40 === "string" ? path40 : path40.toString();
|
|
9331
9331
|
if (append || outputFiles.has(pathString)) {
|
|
9332
|
-
(0, import_node_fs4.appendFileSync)(
|
|
9332
|
+
(0, import_node_fs4.appendFileSync)(path40, serializedResult);
|
|
9333
9333
|
} else {
|
|
9334
9334
|
outputFiles.add(pathString);
|
|
9335
|
-
(0, import_node_fs4.writeFileSync)(
|
|
9335
|
+
(0, import_node_fs4.writeFileSync)(path40, serializedResult);
|
|
9336
9336
|
}
|
|
9337
9337
|
}
|
|
9338
9338
|
};
|
|
@@ -27306,11 +27306,11 @@ var require_mime_types = __commonJS({
|
|
|
27306
27306
|
}
|
|
27307
27307
|
return exts[0];
|
|
27308
27308
|
}
|
|
27309
|
-
function lookup(
|
|
27310
|
-
if (!
|
|
27309
|
+
function lookup(path40) {
|
|
27310
|
+
if (!path40 || typeof path40 !== "string") {
|
|
27311
27311
|
return false;
|
|
27312
27312
|
}
|
|
27313
|
-
var extension2 = extname("x." +
|
|
27313
|
+
var extension2 = extname("x." + path40).toLowerCase().slice(1);
|
|
27314
27314
|
if (!extension2) {
|
|
27315
27315
|
return false;
|
|
27316
27316
|
}
|
|
@@ -30751,13 +30751,13 @@ var require_view = __commonJS({
|
|
|
30751
30751
|
"../../node_modules/express/lib/view.js"(exports2, module2) {
|
|
30752
30752
|
"use strict";
|
|
30753
30753
|
var debug = require_src()("express:view");
|
|
30754
|
-
var
|
|
30755
|
-
var
|
|
30756
|
-
var dirname =
|
|
30757
|
-
var basename =
|
|
30758
|
-
var extname =
|
|
30759
|
-
var join =
|
|
30760
|
-
var resolve =
|
|
30754
|
+
var path40 = require("path");
|
|
30755
|
+
var fs35 = require("fs");
|
|
30756
|
+
var dirname = path40.dirname;
|
|
30757
|
+
var basename = path40.basename;
|
|
30758
|
+
var extname = path40.extname;
|
|
30759
|
+
var join = path40.join;
|
|
30760
|
+
var resolve = path40.resolve;
|
|
30761
30761
|
module2.exports = View;
|
|
30762
30762
|
function View(name, options) {
|
|
30763
30763
|
var opts = options || {};
|
|
@@ -30786,17 +30786,17 @@ var require_view = __commonJS({
|
|
|
30786
30786
|
this.path = this.lookup(fileName);
|
|
30787
30787
|
}
|
|
30788
30788
|
View.prototype.lookup = function lookup(name) {
|
|
30789
|
-
var
|
|
30789
|
+
var path41;
|
|
30790
30790
|
var roots = [].concat(this.root);
|
|
30791
30791
|
debug('lookup "%s"', name);
|
|
30792
|
-
for (var i2 = 0; i2 < roots.length && !
|
|
30792
|
+
for (var i2 = 0; i2 < roots.length && !path41; i2++) {
|
|
30793
30793
|
var root = roots[i2];
|
|
30794
30794
|
var loc = resolve(root, name);
|
|
30795
30795
|
var dir = dirname(loc);
|
|
30796
30796
|
var file2 = basename(loc);
|
|
30797
|
-
|
|
30797
|
+
path41 = this.resolve(dir, file2);
|
|
30798
30798
|
}
|
|
30799
|
-
return
|
|
30799
|
+
return path41;
|
|
30800
30800
|
};
|
|
30801
30801
|
View.prototype.render = function render(options, callback) {
|
|
30802
30802
|
var sync = true;
|
|
@@ -30818,21 +30818,21 @@ var require_view = __commonJS({
|
|
|
30818
30818
|
};
|
|
30819
30819
|
View.prototype.resolve = function resolve2(dir, file2) {
|
|
30820
30820
|
var ext = this.ext;
|
|
30821
|
-
var
|
|
30822
|
-
var stat = tryStat(
|
|
30821
|
+
var path41 = join(dir, file2);
|
|
30822
|
+
var stat = tryStat(path41);
|
|
30823
30823
|
if (stat && stat.isFile()) {
|
|
30824
|
-
return
|
|
30824
|
+
return path41;
|
|
30825
30825
|
}
|
|
30826
|
-
|
|
30827
|
-
stat = tryStat(
|
|
30826
|
+
path41 = join(dir, basename(file2, ext), "index" + ext);
|
|
30827
|
+
stat = tryStat(path41);
|
|
30828
30828
|
if (stat && stat.isFile()) {
|
|
30829
|
-
return
|
|
30829
|
+
return path41;
|
|
30830
30830
|
}
|
|
30831
30831
|
};
|
|
30832
|
-
function tryStat(
|
|
30833
|
-
debug('stat "%s"',
|
|
30832
|
+
function tryStat(path41) {
|
|
30833
|
+
debug('stat "%s"', path41);
|
|
30834
30834
|
try {
|
|
30835
|
-
return
|
|
30835
|
+
return fs35.statSync(path41);
|
|
30836
30836
|
} catch (e) {
|
|
30837
30837
|
return void 0;
|
|
30838
30838
|
}
|
|
@@ -40340,11 +40340,11 @@ var require_mime_types2 = __commonJS({
|
|
|
40340
40340
|
}
|
|
40341
40341
|
return exts[0];
|
|
40342
40342
|
}
|
|
40343
|
-
function lookup(
|
|
40344
|
-
if (!
|
|
40343
|
+
function lookup(path40) {
|
|
40344
|
+
if (!path40 || typeof path40 !== "string") {
|
|
40345
40345
|
return false;
|
|
40346
40346
|
}
|
|
40347
|
-
var extension2 = extname("x." +
|
|
40347
|
+
var extension2 = extname("x." + path40).toLowerCase().slice(1);
|
|
40348
40348
|
if (!extension2) {
|
|
40349
40349
|
return false;
|
|
40350
40350
|
}
|
|
@@ -41542,15 +41542,15 @@ var require_dist = __commonJS({
|
|
|
41542
41542
|
if (token.type === endType)
|
|
41543
41543
|
break;
|
|
41544
41544
|
if (token.type === "char" || token.type === "escape") {
|
|
41545
|
-
let
|
|
41545
|
+
let path40 = token.value;
|
|
41546
41546
|
let cur = tokens[pos];
|
|
41547
41547
|
while (cur.type === "char" || cur.type === "escape") {
|
|
41548
|
-
|
|
41548
|
+
path40 += cur.value;
|
|
41549
41549
|
cur = tokens[++pos];
|
|
41550
41550
|
}
|
|
41551
41551
|
output.push({
|
|
41552
41552
|
type: "text",
|
|
41553
|
-
value: encodePath(
|
|
41553
|
+
value: encodePath(path40)
|
|
41554
41554
|
});
|
|
41555
41555
|
continue;
|
|
41556
41556
|
}
|
|
@@ -41574,16 +41574,16 @@ var require_dist = __commonJS({
|
|
|
41574
41574
|
}
|
|
41575
41575
|
return new TokenData(consumeUntil("end"), str);
|
|
41576
41576
|
}
|
|
41577
|
-
function compile(
|
|
41577
|
+
function compile(path40, options = {}) {
|
|
41578
41578
|
const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
41579
|
-
const data = typeof
|
|
41579
|
+
const data = typeof path40 === "object" ? path40 : parse(path40, options);
|
|
41580
41580
|
const fn = tokensToFunction(data.tokens, delimiter, encode);
|
|
41581
|
-
return function
|
|
41582
|
-
const [
|
|
41581
|
+
return function path41(params = {}) {
|
|
41582
|
+
const [path42, ...missing] = fn(params);
|
|
41583
41583
|
if (missing.length) {
|
|
41584
41584
|
throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
|
|
41585
41585
|
}
|
|
41586
|
-
return
|
|
41586
|
+
return path42;
|
|
41587
41587
|
};
|
|
41588
41588
|
}
|
|
41589
41589
|
function tokensToFunction(tokens, delimiter, encode) {
|
|
@@ -41639,9 +41639,9 @@ var require_dist = __commonJS({
|
|
|
41639
41639
|
return [encodeValue(value)];
|
|
41640
41640
|
};
|
|
41641
41641
|
}
|
|
41642
|
-
function match(
|
|
41642
|
+
function match(path40, options = {}) {
|
|
41643
41643
|
const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
41644
|
-
const { regexp, keys } = pathToRegexp(
|
|
41644
|
+
const { regexp, keys } = pathToRegexp(path40, options);
|
|
41645
41645
|
const decoders = keys.map((key) => {
|
|
41646
41646
|
if (decode === false)
|
|
41647
41647
|
return NOOP_VALUE;
|
|
@@ -41653,7 +41653,7 @@ var require_dist = __commonJS({
|
|
|
41653
41653
|
const m = regexp.exec(input);
|
|
41654
41654
|
if (!m)
|
|
41655
41655
|
return false;
|
|
41656
|
-
const
|
|
41656
|
+
const path41 = m[0];
|
|
41657
41657
|
const params = /* @__PURE__ */ Object.create(null);
|
|
41658
41658
|
for (let i2 = 1; i2 < m.length; i2++) {
|
|
41659
41659
|
if (m[i2] === void 0)
|
|
@@ -41662,15 +41662,15 @@ var require_dist = __commonJS({
|
|
|
41662
41662
|
const decoder = decoders[i2 - 1];
|
|
41663
41663
|
params[key.name] = decoder(m[i2]);
|
|
41664
41664
|
}
|
|
41665
|
-
return { path:
|
|
41665
|
+
return { path: path41, params };
|
|
41666
41666
|
};
|
|
41667
41667
|
}
|
|
41668
|
-
function pathToRegexp(
|
|
41668
|
+
function pathToRegexp(path40, options = {}) {
|
|
41669
41669
|
const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true } = options;
|
|
41670
41670
|
const keys = [];
|
|
41671
41671
|
const flags = sensitive ? "" : "i";
|
|
41672
41672
|
const sources = [];
|
|
41673
|
-
for (const input of pathsToArray(
|
|
41673
|
+
for (const input of pathsToArray(path40, [])) {
|
|
41674
41674
|
const data = typeof input === "object" ? input : parse(input, options);
|
|
41675
41675
|
for (const tokens of flatten(data.tokens, 0, [])) {
|
|
41676
41676
|
sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));
|
|
@@ -41800,18 +41800,18 @@ var require_layer = __commonJS({
|
|
|
41800
41800
|
var TRAILING_SLASH_REGEXP = /\/+$/;
|
|
41801
41801
|
var MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g;
|
|
41802
41802
|
module2.exports = Layer;
|
|
41803
|
-
function Layer(
|
|
41803
|
+
function Layer(path40, options, fn) {
|
|
41804
41804
|
if (!(this instanceof Layer)) {
|
|
41805
|
-
return new Layer(
|
|
41805
|
+
return new Layer(path40, options, fn);
|
|
41806
41806
|
}
|
|
41807
|
-
debug("new %o",
|
|
41807
|
+
debug("new %o", path40);
|
|
41808
41808
|
const opts = options || {};
|
|
41809
41809
|
this.handle = fn;
|
|
41810
41810
|
this.keys = [];
|
|
41811
41811
|
this.name = fn.name || "<anonymous>";
|
|
41812
41812
|
this.params = void 0;
|
|
41813
41813
|
this.path = void 0;
|
|
41814
|
-
this.slash =
|
|
41814
|
+
this.slash = path40 === "/" && opts.end === false;
|
|
41815
41815
|
function matcher(_path) {
|
|
41816
41816
|
if (_path instanceof RegExp) {
|
|
41817
41817
|
const keys = [];
|
|
@@ -41850,7 +41850,7 @@ var require_layer = __commonJS({
|
|
|
41850
41850
|
decode: decodeParam
|
|
41851
41851
|
});
|
|
41852
41852
|
}
|
|
41853
|
-
this.matchers = Array.isArray(
|
|
41853
|
+
this.matchers = Array.isArray(path40) ? path40.map(matcher) : [matcher(path40)];
|
|
41854
41854
|
}
|
|
41855
41855
|
Layer.prototype.handleError = function handleError(error, req, res, next) {
|
|
41856
41856
|
const fn = this.handle;
|
|
@@ -41890,9 +41890,9 @@ var require_layer = __commonJS({
|
|
|
41890
41890
|
next(err);
|
|
41891
41891
|
}
|
|
41892
41892
|
};
|
|
41893
|
-
Layer.prototype.match = function match(
|
|
41893
|
+
Layer.prototype.match = function match(path40) {
|
|
41894
41894
|
let match2;
|
|
41895
|
-
if (
|
|
41895
|
+
if (path40 != null) {
|
|
41896
41896
|
if (this.slash) {
|
|
41897
41897
|
this.params = {};
|
|
41898
41898
|
this.path = "";
|
|
@@ -41900,7 +41900,7 @@ var require_layer = __commonJS({
|
|
|
41900
41900
|
}
|
|
41901
41901
|
let i2 = 0;
|
|
41902
41902
|
while (!match2 && i2 < this.matchers.length) {
|
|
41903
|
-
match2 = this.matchers[i2](
|
|
41903
|
+
match2 = this.matchers[i2](path40);
|
|
41904
41904
|
i2++;
|
|
41905
41905
|
}
|
|
41906
41906
|
}
|
|
@@ -41928,13 +41928,13 @@ var require_layer = __commonJS({
|
|
|
41928
41928
|
throw err;
|
|
41929
41929
|
}
|
|
41930
41930
|
}
|
|
41931
|
-
function loosen(
|
|
41932
|
-
if (
|
|
41933
|
-
return
|
|
41931
|
+
function loosen(path40) {
|
|
41932
|
+
if (path40 instanceof RegExp || path40 === "/") {
|
|
41933
|
+
return path40;
|
|
41934
41934
|
}
|
|
41935
|
-
return Array.isArray(
|
|
41935
|
+
return Array.isArray(path40) ? path40.map(function(p) {
|
|
41936
41936
|
return loosen(p);
|
|
41937
|
-
}) : String(
|
|
41937
|
+
}) : String(path40).replace(TRAILING_SLASH_REGEXP, "");
|
|
41938
41938
|
}
|
|
41939
41939
|
}
|
|
41940
41940
|
});
|
|
@@ -41950,9 +41950,9 @@ var require_route2 = __commonJS({
|
|
|
41950
41950
|
var flatten = Array.prototype.flat;
|
|
41951
41951
|
var methods = METHODS.map((method) => method.toLowerCase());
|
|
41952
41952
|
module2.exports = Route;
|
|
41953
|
-
function Route(
|
|
41954
|
-
debug("new %o",
|
|
41955
|
-
this.path =
|
|
41953
|
+
function Route(path40) {
|
|
41954
|
+
debug("new %o", path40);
|
|
41955
|
+
this.path = path40;
|
|
41956
41956
|
this.stack = [];
|
|
41957
41957
|
this.methods = /* @__PURE__ */ Object.create(null);
|
|
41958
41958
|
}
|
|
@@ -42160,8 +42160,8 @@ var require_router = __commonJS({
|
|
|
42160
42160
|
if (++sync > 100) {
|
|
42161
42161
|
return setImmediate(next, err);
|
|
42162
42162
|
}
|
|
42163
|
-
const
|
|
42164
|
-
if (
|
|
42163
|
+
const path40 = getPathname(req);
|
|
42164
|
+
if (path40 == null) {
|
|
42165
42165
|
return done(layerError);
|
|
42166
42166
|
}
|
|
42167
42167
|
let layer;
|
|
@@ -42169,7 +42169,7 @@ var require_router = __commonJS({
|
|
|
42169
42169
|
let route3;
|
|
42170
42170
|
while (match !== true && idx < stack.length) {
|
|
42171
42171
|
layer = stack[idx++];
|
|
42172
|
-
match = matchLayer(layer,
|
|
42172
|
+
match = matchLayer(layer, path40);
|
|
42173
42173
|
route3 = layer.route;
|
|
42174
42174
|
if (typeof match !== "boolean") {
|
|
42175
42175
|
layerError = layerError || match;
|
|
@@ -42207,18 +42207,18 @@ var require_router = __commonJS({
|
|
|
42207
42207
|
} else if (route3) {
|
|
42208
42208
|
layer.handleRequest(req, res, next);
|
|
42209
42209
|
} else {
|
|
42210
|
-
trimPrefix(layer, layerError, layerPath,
|
|
42210
|
+
trimPrefix(layer, layerError, layerPath, path40);
|
|
42211
42211
|
}
|
|
42212
42212
|
sync = 0;
|
|
42213
42213
|
});
|
|
42214
42214
|
}
|
|
42215
|
-
function trimPrefix(layer, layerError, layerPath,
|
|
42215
|
+
function trimPrefix(layer, layerError, layerPath, path40) {
|
|
42216
42216
|
if (layerPath.length !== 0) {
|
|
42217
|
-
if (layerPath !==
|
|
42217
|
+
if (layerPath !== path40.substring(0, layerPath.length)) {
|
|
42218
42218
|
next(layerError);
|
|
42219
42219
|
return;
|
|
42220
42220
|
}
|
|
42221
|
-
const c3 =
|
|
42221
|
+
const c3 = path40[layerPath.length];
|
|
42222
42222
|
if (c3 && c3 !== "/") {
|
|
42223
42223
|
next(layerError);
|
|
42224
42224
|
return;
|
|
@@ -42242,7 +42242,7 @@ var require_router = __commonJS({
|
|
|
42242
42242
|
};
|
|
42243
42243
|
Router28.prototype.use = function use(handler) {
|
|
42244
42244
|
let offset = 0;
|
|
42245
|
-
let
|
|
42245
|
+
let path40 = "/";
|
|
42246
42246
|
if (typeof handler !== "function") {
|
|
42247
42247
|
let arg = handler;
|
|
42248
42248
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -42250,7 +42250,7 @@ var require_router = __commonJS({
|
|
|
42250
42250
|
}
|
|
42251
42251
|
if (typeof arg !== "function") {
|
|
42252
42252
|
offset = 1;
|
|
42253
|
-
|
|
42253
|
+
path40 = handler;
|
|
42254
42254
|
}
|
|
42255
42255
|
}
|
|
42256
42256
|
const callbacks = flatten.call(slice.call(arguments, offset), Infinity);
|
|
@@ -42262,8 +42262,8 @@ var require_router = __commonJS({
|
|
|
42262
42262
|
if (typeof fn !== "function") {
|
|
42263
42263
|
throw new TypeError("argument handler must be a function");
|
|
42264
42264
|
}
|
|
42265
|
-
debug("use %o %s",
|
|
42266
|
-
const layer = new Layer(
|
|
42265
|
+
debug("use %o %s", path40, fn.name || "<anonymous>");
|
|
42266
|
+
const layer = new Layer(path40, {
|
|
42267
42267
|
sensitive: this.caseSensitive,
|
|
42268
42268
|
strict: false,
|
|
42269
42269
|
end: false
|
|
@@ -42273,9 +42273,9 @@ var require_router = __commonJS({
|
|
|
42273
42273
|
}
|
|
42274
42274
|
return this;
|
|
42275
42275
|
};
|
|
42276
|
-
Router28.prototype.route = function route3(
|
|
42277
|
-
const route4 = new Route(
|
|
42278
|
-
const layer = new Layer(
|
|
42276
|
+
Router28.prototype.route = function route3(path40) {
|
|
42277
|
+
const route4 = new Route(path40);
|
|
42278
|
+
const layer = new Layer(path40, {
|
|
42279
42279
|
sensitive: this.caseSensitive,
|
|
42280
42280
|
strict: this.strict,
|
|
42281
42281
|
end: true
|
|
@@ -42288,8 +42288,8 @@ var require_router = __commonJS({
|
|
|
42288
42288
|
return route4;
|
|
42289
42289
|
};
|
|
42290
42290
|
methods.concat("all").forEach(function(method) {
|
|
42291
|
-
Router28.prototype[method] = function(
|
|
42292
|
-
const route3 = this.route(
|
|
42291
|
+
Router28.prototype[method] = function(path40) {
|
|
42292
|
+
const route3 = this.route(path40);
|
|
42293
42293
|
route3[method].apply(route3, slice.call(arguments, 1));
|
|
42294
42294
|
return this;
|
|
42295
42295
|
};
|
|
@@ -42318,9 +42318,9 @@ var require_router = __commonJS({
|
|
|
42318
42318
|
const fqdnIndex = url.substring(0, pathLength).indexOf("://");
|
|
42319
42319
|
return fqdnIndex !== -1 ? url.substring(0, url.indexOf("/", 3 + fqdnIndex)) : void 0;
|
|
42320
42320
|
}
|
|
42321
|
-
function matchLayer(layer,
|
|
42321
|
+
function matchLayer(layer, path40) {
|
|
42322
42322
|
try {
|
|
42323
|
-
return layer.match(
|
|
42323
|
+
return layer.match(path40);
|
|
42324
42324
|
} catch (err) {
|
|
42325
42325
|
return err;
|
|
42326
42326
|
}
|
|
@@ -42548,7 +42548,7 @@ var require_application = __commonJS({
|
|
|
42548
42548
|
};
|
|
42549
42549
|
app3.use = function use(fn) {
|
|
42550
42550
|
var offset = 0;
|
|
42551
|
-
var
|
|
42551
|
+
var path40 = "/";
|
|
42552
42552
|
if (typeof fn !== "function") {
|
|
42553
42553
|
var arg = fn;
|
|
42554
42554
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -42556,7 +42556,7 @@ var require_application = __commonJS({
|
|
|
42556
42556
|
}
|
|
42557
42557
|
if (typeof arg !== "function") {
|
|
42558
42558
|
offset = 1;
|
|
42559
|
-
|
|
42559
|
+
path40 = fn;
|
|
42560
42560
|
}
|
|
42561
42561
|
}
|
|
42562
42562
|
var fns = flatten.call(slice.call(arguments, offset), Infinity);
|
|
@@ -42566,12 +42566,12 @@ var require_application = __commonJS({
|
|
|
42566
42566
|
var router28 = this.router;
|
|
42567
42567
|
fns.forEach(function(fn2) {
|
|
42568
42568
|
if (!fn2 || !fn2.handle || !fn2.set) {
|
|
42569
|
-
return router28.use(
|
|
42569
|
+
return router28.use(path40, fn2);
|
|
42570
42570
|
}
|
|
42571
|
-
debug(".use app under %s",
|
|
42572
|
-
fn2.mountpath =
|
|
42571
|
+
debug(".use app under %s", path40);
|
|
42572
|
+
fn2.mountpath = path40;
|
|
42573
42573
|
fn2.parent = this;
|
|
42574
|
-
router28.use(
|
|
42574
|
+
router28.use(path40, function mounted_app(req, res, next) {
|
|
42575
42575
|
var orig = req.app;
|
|
42576
42576
|
fn2.handle(req, res, function(err) {
|
|
42577
42577
|
Object.setPrototypeOf(req, orig.request);
|
|
@@ -42583,8 +42583,8 @@ var require_application = __commonJS({
|
|
|
42583
42583
|
}, this);
|
|
42584
42584
|
return this;
|
|
42585
42585
|
};
|
|
42586
|
-
app3.route = function route3(
|
|
42587
|
-
return this.router.route(
|
|
42586
|
+
app3.route = function route3(path40) {
|
|
42587
|
+
return this.router.route(path40);
|
|
42588
42588
|
};
|
|
42589
42589
|
app3.engine = function engine(ext, fn) {
|
|
42590
42590
|
if (typeof fn !== "function") {
|
|
@@ -42627,7 +42627,7 @@ var require_application = __commonJS({
|
|
|
42627
42627
|
}
|
|
42628
42628
|
return this;
|
|
42629
42629
|
};
|
|
42630
|
-
app3.path = function
|
|
42630
|
+
app3.path = function path40() {
|
|
42631
42631
|
return this.parent ? this.parent.path() + this.mountpath : "";
|
|
42632
42632
|
};
|
|
42633
42633
|
app3.enabled = function enabled(setting) {
|
|
@@ -42643,17 +42643,17 @@ var require_application = __commonJS({
|
|
|
42643
42643
|
return this.set(setting, false);
|
|
42644
42644
|
};
|
|
42645
42645
|
methods.forEach(function(method) {
|
|
42646
|
-
app3[method] = function(
|
|
42646
|
+
app3[method] = function(path40) {
|
|
42647
42647
|
if (method === "get" && arguments.length === 1) {
|
|
42648
|
-
return this.set(
|
|
42648
|
+
return this.set(path40);
|
|
42649
42649
|
}
|
|
42650
|
-
var route3 = this.route(
|
|
42650
|
+
var route3 = this.route(path40);
|
|
42651
42651
|
route3[method].apply(route3, slice.call(arguments, 1));
|
|
42652
42652
|
return this;
|
|
42653
42653
|
};
|
|
42654
42654
|
});
|
|
42655
|
-
app3.all = function all(
|
|
42656
|
-
var route3 = this.route(
|
|
42655
|
+
app3.all = function all(path40) {
|
|
42656
|
+
var route3 = this.route(path40);
|
|
42657
42657
|
var args2 = slice.call(arguments, 1);
|
|
42658
42658
|
for (var i2 = 0; i2 < methods.length; i2++) {
|
|
42659
42659
|
route3[methods[i2]].apply(route3, args2);
|
|
@@ -43563,7 +43563,7 @@ var require_request = __commonJS({
|
|
|
43563
43563
|
var subdomains2 = !isIP(hostname) ? hostname.split(".").reverse() : [hostname];
|
|
43564
43564
|
return subdomains2.slice(offset);
|
|
43565
43565
|
});
|
|
43566
|
-
defineGetter(req, "path", function
|
|
43566
|
+
defineGetter(req, "path", function path40() {
|
|
43567
43567
|
return parse(this).pathname;
|
|
43568
43568
|
});
|
|
43569
43569
|
defineGetter(req, "host", function host() {
|
|
@@ -53419,11 +53419,11 @@ var require_mime_types3 = __commonJS({
|
|
|
53419
53419
|
}
|
|
53420
53420
|
return exts[0];
|
|
53421
53421
|
}
|
|
53422
|
-
function lookup(
|
|
53423
|
-
if (!
|
|
53422
|
+
function lookup(path40) {
|
|
53423
|
+
if (!path40 || typeof path40 !== "string") {
|
|
53424
53424
|
return false;
|
|
53425
53425
|
}
|
|
53426
|
-
var extension2 = extname("x." +
|
|
53426
|
+
var extension2 = extname("x." + path40).toLowerCase().slice(1);
|
|
53427
53427
|
if (!extension2) {
|
|
53428
53428
|
return false;
|
|
53429
53429
|
}
|
|
@@ -53479,32 +53479,32 @@ var require_send = __commonJS({
|
|
|
53479
53479
|
var escapeHtml = require_escape_html();
|
|
53480
53480
|
var etag = require_etag();
|
|
53481
53481
|
var fresh = require_fresh();
|
|
53482
|
-
var
|
|
53482
|
+
var fs35 = require("fs");
|
|
53483
53483
|
var mime = require_mime_types3();
|
|
53484
53484
|
var ms = require_ms();
|
|
53485
53485
|
var onFinished = require_on_finished();
|
|
53486
53486
|
var parseRange = require_range_parser();
|
|
53487
|
-
var
|
|
53487
|
+
var path40 = require("path");
|
|
53488
53488
|
var statuses = require_statuses();
|
|
53489
53489
|
var Stream = require("stream");
|
|
53490
53490
|
var util = require("util");
|
|
53491
|
-
var extname =
|
|
53492
|
-
var join =
|
|
53493
|
-
var normalize =
|
|
53494
|
-
var resolve =
|
|
53495
|
-
var sep =
|
|
53491
|
+
var extname = path40.extname;
|
|
53492
|
+
var join = path40.join;
|
|
53493
|
+
var normalize = path40.normalize;
|
|
53494
|
+
var resolve = path40.resolve;
|
|
53495
|
+
var sep = path40.sep;
|
|
53496
53496
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
53497
53497
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
53498
53498
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
53499
53499
|
module2.exports = send;
|
|
53500
|
-
function send(req,
|
|
53501
|
-
return new SendStream(req,
|
|
53500
|
+
function send(req, path41, options) {
|
|
53501
|
+
return new SendStream(req, path41, options);
|
|
53502
53502
|
}
|
|
53503
|
-
function SendStream(req,
|
|
53503
|
+
function SendStream(req, path41, options) {
|
|
53504
53504
|
Stream.call(this);
|
|
53505
53505
|
var opts = options || {};
|
|
53506
53506
|
this.options = opts;
|
|
53507
|
-
this.path =
|
|
53507
|
+
this.path = path41;
|
|
53508
53508
|
this.req = req;
|
|
53509
53509
|
this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
|
|
53510
53510
|
this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
|
|
@@ -53618,10 +53618,10 @@ var require_send = __commonJS({
|
|
|
53618
53618
|
var lastModified = this.res.getHeader("Last-Modified");
|
|
53619
53619
|
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
53620
53620
|
};
|
|
53621
|
-
SendStream.prototype.redirect = function redirect(
|
|
53621
|
+
SendStream.prototype.redirect = function redirect(path41) {
|
|
53622
53622
|
var res = this.res;
|
|
53623
53623
|
if (hasListeners(this, "directory")) {
|
|
53624
|
-
this.emit("directory", res,
|
|
53624
|
+
this.emit("directory", res, path41);
|
|
53625
53625
|
return;
|
|
53626
53626
|
}
|
|
53627
53627
|
if (this.hasTrailingSlash()) {
|
|
@@ -53641,38 +53641,38 @@ var require_send = __commonJS({
|
|
|
53641
53641
|
SendStream.prototype.pipe = function pipe(res) {
|
|
53642
53642
|
var root = this._root;
|
|
53643
53643
|
this.res = res;
|
|
53644
|
-
var
|
|
53645
|
-
if (
|
|
53644
|
+
var path41 = decode(this.path);
|
|
53645
|
+
if (path41 === -1) {
|
|
53646
53646
|
this.error(400);
|
|
53647
53647
|
return res;
|
|
53648
53648
|
}
|
|
53649
|
-
if (~
|
|
53649
|
+
if (~path41.indexOf("\0")) {
|
|
53650
53650
|
this.error(400);
|
|
53651
53651
|
return res;
|
|
53652
53652
|
}
|
|
53653
53653
|
var parts;
|
|
53654
53654
|
if (root !== null) {
|
|
53655
|
-
if (
|
|
53656
|
-
|
|
53655
|
+
if (path41) {
|
|
53656
|
+
path41 = normalize("." + sep + path41);
|
|
53657
53657
|
}
|
|
53658
|
-
if (UP_PATH_REGEXP.test(
|
|
53659
|
-
debug('malicious path "%s"',
|
|
53658
|
+
if (UP_PATH_REGEXP.test(path41)) {
|
|
53659
|
+
debug('malicious path "%s"', path41);
|
|
53660
53660
|
this.error(403);
|
|
53661
53661
|
return res;
|
|
53662
53662
|
}
|
|
53663
|
-
parts =
|
|
53664
|
-
|
|
53663
|
+
parts = path41.split(sep);
|
|
53664
|
+
path41 = normalize(join(root, path41));
|
|
53665
53665
|
} else {
|
|
53666
|
-
if (UP_PATH_REGEXP.test(
|
|
53667
|
-
debug('malicious path "%s"',
|
|
53666
|
+
if (UP_PATH_REGEXP.test(path41)) {
|
|
53667
|
+
debug('malicious path "%s"', path41);
|
|
53668
53668
|
this.error(403);
|
|
53669
53669
|
return res;
|
|
53670
53670
|
}
|
|
53671
|
-
parts = normalize(
|
|
53672
|
-
|
|
53671
|
+
parts = normalize(path41).split(sep);
|
|
53672
|
+
path41 = resolve(path41);
|
|
53673
53673
|
}
|
|
53674
53674
|
if (containsDotFile(parts)) {
|
|
53675
|
-
debug('%s dotfile "%s"', this._dotfiles,
|
|
53675
|
+
debug('%s dotfile "%s"', this._dotfiles, path41);
|
|
53676
53676
|
switch (this._dotfiles) {
|
|
53677
53677
|
case "allow":
|
|
53678
53678
|
break;
|
|
@@ -53686,13 +53686,13 @@ var require_send = __commonJS({
|
|
|
53686
53686
|
}
|
|
53687
53687
|
}
|
|
53688
53688
|
if (this._index.length && this.hasTrailingSlash()) {
|
|
53689
|
-
this.sendIndex(
|
|
53689
|
+
this.sendIndex(path41);
|
|
53690
53690
|
return res;
|
|
53691
53691
|
}
|
|
53692
|
-
this.sendFile(
|
|
53692
|
+
this.sendFile(path41);
|
|
53693
53693
|
return res;
|
|
53694
53694
|
};
|
|
53695
|
-
SendStream.prototype.send = function send2(
|
|
53695
|
+
SendStream.prototype.send = function send2(path41, stat) {
|
|
53696
53696
|
var len = stat.size;
|
|
53697
53697
|
var options = this.options;
|
|
53698
53698
|
var opts = {};
|
|
@@ -53704,9 +53704,9 @@ var require_send = __commonJS({
|
|
|
53704
53704
|
this.headersAlreadySent();
|
|
53705
53705
|
return;
|
|
53706
53706
|
}
|
|
53707
|
-
debug('pipe "%s"',
|
|
53708
|
-
this.setHeader(
|
|
53709
|
-
this.type(
|
|
53707
|
+
debug('pipe "%s"', path41);
|
|
53708
|
+
this.setHeader(path41, stat);
|
|
53709
|
+
this.type(path41);
|
|
53710
53710
|
if (this.isConditionalGET()) {
|
|
53711
53711
|
if (this.isPreconditionFailure()) {
|
|
53712
53712
|
this.error(412);
|
|
@@ -53755,30 +53755,30 @@ var require_send = __commonJS({
|
|
|
53755
53755
|
res.end();
|
|
53756
53756
|
return;
|
|
53757
53757
|
}
|
|
53758
|
-
this.stream(
|
|
53758
|
+
this.stream(path41, opts);
|
|
53759
53759
|
};
|
|
53760
|
-
SendStream.prototype.sendFile = function sendFile(
|
|
53760
|
+
SendStream.prototype.sendFile = function sendFile(path41) {
|
|
53761
53761
|
var i2 = 0;
|
|
53762
53762
|
var self = this;
|
|
53763
|
-
debug('stat "%s"',
|
|
53764
|
-
|
|
53765
|
-
var pathEndsWithSep =
|
|
53766
|
-
if (err && err.code === "ENOENT" && !extname(
|
|
53763
|
+
debug('stat "%s"', path41);
|
|
53764
|
+
fs35.stat(path41, function onstat(err, stat) {
|
|
53765
|
+
var pathEndsWithSep = path41[path41.length - 1] === sep;
|
|
53766
|
+
if (err && err.code === "ENOENT" && !extname(path41) && !pathEndsWithSep) {
|
|
53767
53767
|
return next(err);
|
|
53768
53768
|
}
|
|
53769
53769
|
if (err) return self.onStatError(err);
|
|
53770
|
-
if (stat.isDirectory()) return self.redirect(
|
|
53770
|
+
if (stat.isDirectory()) return self.redirect(path41);
|
|
53771
53771
|
if (pathEndsWithSep) return self.error(404);
|
|
53772
|
-
self.emit("file",
|
|
53773
|
-
self.send(
|
|
53772
|
+
self.emit("file", path41, stat);
|
|
53773
|
+
self.send(path41, stat);
|
|
53774
53774
|
});
|
|
53775
53775
|
function next(err) {
|
|
53776
53776
|
if (self._extensions.length <= i2) {
|
|
53777
53777
|
return err ? self.onStatError(err) : self.error(404);
|
|
53778
53778
|
}
|
|
53779
|
-
var p =
|
|
53779
|
+
var p = path41 + "." + self._extensions[i2++];
|
|
53780
53780
|
debug('stat "%s"', p);
|
|
53781
|
-
|
|
53781
|
+
fs35.stat(p, function(err2, stat) {
|
|
53782
53782
|
if (err2) return next(err2);
|
|
53783
53783
|
if (stat.isDirectory()) return next();
|
|
53784
53784
|
self.emit("file", p, stat);
|
|
@@ -53786,7 +53786,7 @@ var require_send = __commonJS({
|
|
|
53786
53786
|
});
|
|
53787
53787
|
}
|
|
53788
53788
|
};
|
|
53789
|
-
SendStream.prototype.sendIndex = function sendIndex(
|
|
53789
|
+
SendStream.prototype.sendIndex = function sendIndex(path41) {
|
|
53790
53790
|
var i2 = -1;
|
|
53791
53791
|
var self = this;
|
|
53792
53792
|
function next(err) {
|
|
@@ -53794,9 +53794,9 @@ var require_send = __commonJS({
|
|
|
53794
53794
|
if (err) return self.onStatError(err);
|
|
53795
53795
|
return self.error(404);
|
|
53796
53796
|
}
|
|
53797
|
-
var p = join(
|
|
53797
|
+
var p = join(path41, self._index[i2]);
|
|
53798
53798
|
debug('stat "%s"', p);
|
|
53799
|
-
|
|
53799
|
+
fs35.stat(p, function(err2, stat) {
|
|
53800
53800
|
if (err2) return next(err2);
|
|
53801
53801
|
if (stat.isDirectory()) return next();
|
|
53802
53802
|
self.emit("file", p, stat);
|
|
@@ -53805,10 +53805,10 @@ var require_send = __commonJS({
|
|
|
53805
53805
|
}
|
|
53806
53806
|
next();
|
|
53807
53807
|
};
|
|
53808
|
-
SendStream.prototype.stream = function stream(
|
|
53808
|
+
SendStream.prototype.stream = function stream(path41, options) {
|
|
53809
53809
|
var self = this;
|
|
53810
53810
|
var res = this.res;
|
|
53811
|
-
var stream2 =
|
|
53811
|
+
var stream2 = fs35.createReadStream(path41, options);
|
|
53812
53812
|
this.emit("stream", stream2);
|
|
53813
53813
|
stream2.pipe(res);
|
|
53814
53814
|
function cleanup() {
|
|
@@ -53823,17 +53823,17 @@ var require_send = __commonJS({
|
|
|
53823
53823
|
self.emit("end");
|
|
53824
53824
|
});
|
|
53825
53825
|
};
|
|
53826
|
-
SendStream.prototype.type = function type(
|
|
53826
|
+
SendStream.prototype.type = function type(path41) {
|
|
53827
53827
|
var res = this.res;
|
|
53828
53828
|
if (res.getHeader("Content-Type")) return;
|
|
53829
|
-
var ext = extname(
|
|
53829
|
+
var ext = extname(path41);
|
|
53830
53830
|
var type2 = mime.contentType(ext) || "application/octet-stream";
|
|
53831
53831
|
debug("content-type %s", type2);
|
|
53832
53832
|
res.setHeader("Content-Type", type2);
|
|
53833
53833
|
};
|
|
53834
|
-
SendStream.prototype.setHeader = function setHeader(
|
|
53834
|
+
SendStream.prototype.setHeader = function setHeader(path41, stat) {
|
|
53835
53835
|
var res = this.res;
|
|
53836
|
-
this.emit("headers", res,
|
|
53836
|
+
this.emit("headers", res, path41, stat);
|
|
53837
53837
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
53838
53838
|
debug("accept ranges");
|
|
53839
53839
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -53891,9 +53891,9 @@ var require_send = __commonJS({
|
|
|
53891
53891
|
}
|
|
53892
53892
|
return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
|
|
53893
53893
|
}
|
|
53894
|
-
function decode(
|
|
53894
|
+
function decode(path41) {
|
|
53895
53895
|
try {
|
|
53896
|
-
return decodeURIComponent(
|
|
53896
|
+
return decodeURIComponent(path41);
|
|
53897
53897
|
} catch (err) {
|
|
53898
53898
|
return -1;
|
|
53899
53899
|
}
|
|
@@ -54037,7 +54037,7 @@ var require_response = __commonJS({
|
|
|
54037
54037
|
var http = require("http");
|
|
54038
54038
|
var onFinished = require_on_finished();
|
|
54039
54039
|
var mime = require_mime_types2();
|
|
54040
|
-
var
|
|
54040
|
+
var path40 = require("path");
|
|
54041
54041
|
var pathIsAbsolute = require("path").isAbsolute;
|
|
54042
54042
|
var statuses = require_statuses();
|
|
54043
54043
|
var sign = require_cookie_signature().sign;
|
|
@@ -54046,8 +54046,8 @@ var require_response = __commonJS({
|
|
|
54046
54046
|
var setCharset = require_utils5().setCharset;
|
|
54047
54047
|
var cookie = require_cookie();
|
|
54048
54048
|
var send = require_send();
|
|
54049
|
-
var extname =
|
|
54050
|
-
var resolve =
|
|
54049
|
+
var extname = path40.extname;
|
|
54050
|
+
var resolve = path40.resolve;
|
|
54051
54051
|
var vary = require_vary();
|
|
54052
54052
|
var { Buffer: Buffer6 } = require("buffer");
|
|
54053
54053
|
var res = Object.create(http.ServerResponse.prototype);
|
|
@@ -54193,26 +54193,26 @@ var require_response = __commonJS({
|
|
|
54193
54193
|
this.type("txt");
|
|
54194
54194
|
return this.send(body);
|
|
54195
54195
|
};
|
|
54196
|
-
res.sendFile = function sendFile(
|
|
54196
|
+
res.sendFile = function sendFile(path41, options, callback) {
|
|
54197
54197
|
var done = callback;
|
|
54198
54198
|
var req = this.req;
|
|
54199
54199
|
var res2 = this;
|
|
54200
54200
|
var next = req.next;
|
|
54201
54201
|
var opts = options || {};
|
|
54202
|
-
if (!
|
|
54202
|
+
if (!path41) {
|
|
54203
54203
|
throw new TypeError("path argument is required to res.sendFile");
|
|
54204
54204
|
}
|
|
54205
|
-
if (typeof
|
|
54205
|
+
if (typeof path41 !== "string") {
|
|
54206
54206
|
throw new TypeError("path must be a string to res.sendFile");
|
|
54207
54207
|
}
|
|
54208
54208
|
if (typeof options === "function") {
|
|
54209
54209
|
done = options;
|
|
54210
54210
|
opts = {};
|
|
54211
54211
|
}
|
|
54212
|
-
if (!opts.root && !pathIsAbsolute(
|
|
54212
|
+
if (!opts.root && !pathIsAbsolute(path41)) {
|
|
54213
54213
|
throw new TypeError("path must be absolute or specify root to res.sendFile");
|
|
54214
54214
|
}
|
|
54215
|
-
var pathname = encodeURI(
|
|
54215
|
+
var pathname = encodeURI(path41);
|
|
54216
54216
|
opts.etag = this.app.enabled("etag");
|
|
54217
54217
|
var file2 = send(req, pathname, opts);
|
|
54218
54218
|
sendfile(res2, file2, opts, function(err) {
|
|
@@ -54223,7 +54223,7 @@ var require_response = __commonJS({
|
|
|
54223
54223
|
}
|
|
54224
54224
|
});
|
|
54225
54225
|
};
|
|
54226
|
-
res.download = function download(
|
|
54226
|
+
res.download = function download(path41, filename, options, callback) {
|
|
54227
54227
|
var done = callback;
|
|
54228
54228
|
var name = filename;
|
|
54229
54229
|
var opts = options || null;
|
|
@@ -54240,7 +54240,7 @@ var require_response = __commonJS({
|
|
|
54240
54240
|
opts = filename;
|
|
54241
54241
|
}
|
|
54242
54242
|
var headers = {
|
|
54243
|
-
"Content-Disposition": contentDisposition(name ||
|
|
54243
|
+
"Content-Disposition": contentDisposition(name || path41)
|
|
54244
54244
|
};
|
|
54245
54245
|
if (opts && opts.headers) {
|
|
54246
54246
|
var keys = Object.keys(opts.headers);
|
|
@@ -54253,7 +54253,7 @@ var require_response = __commonJS({
|
|
|
54253
54253
|
}
|
|
54254
54254
|
opts = Object.create(opts);
|
|
54255
54255
|
opts.headers = headers;
|
|
54256
|
-
var fullPath = !opts.root ? resolve(
|
|
54256
|
+
var fullPath = !opts.root ? resolve(path41) : path41;
|
|
54257
54257
|
return this.sendFile(fullPath, opts, done);
|
|
54258
54258
|
};
|
|
54259
54259
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -54536,11 +54536,11 @@ var require_serve_static = __commonJS({
|
|
|
54536
54536
|
}
|
|
54537
54537
|
var forwardError = !fallthrough;
|
|
54538
54538
|
var originalUrl = parseUrl.original(req);
|
|
54539
|
-
var
|
|
54540
|
-
if (
|
|
54541
|
-
|
|
54539
|
+
var path40 = parseUrl(req).pathname;
|
|
54540
|
+
if (path40 === "/" && originalUrl.pathname.substr(-1) !== "/") {
|
|
54541
|
+
path40 = "";
|
|
54542
54542
|
}
|
|
54543
|
-
var stream = send(req,
|
|
54543
|
+
var stream = send(req, path40, opts);
|
|
54544
54544
|
stream.on("directory", onDirectory);
|
|
54545
54545
|
if (setHeaders) {
|
|
54546
54546
|
stream.on("headers", setHeaders);
|
|
@@ -64011,11 +64011,11 @@ var require_mime_types4 = __commonJS({
|
|
|
64011
64011
|
}
|
|
64012
64012
|
return exts[0];
|
|
64013
64013
|
}
|
|
64014
|
-
function lookup(
|
|
64015
|
-
if (!
|
|
64014
|
+
function lookup(path40) {
|
|
64015
|
+
if (!path40 || typeof path40 !== "string") {
|
|
64016
64016
|
return false;
|
|
64017
64017
|
}
|
|
64018
|
-
var extension2 = extname("x." +
|
|
64018
|
+
var extension2 = extname("x." + path40).toLowerCase().substr(1);
|
|
64019
64019
|
if (!extension2) {
|
|
64020
64020
|
return false;
|
|
64021
64021
|
}
|
|
@@ -69715,11 +69715,11 @@ var require_server = __commonJS({
|
|
|
69715
69715
|
* @protected
|
|
69716
69716
|
*/
|
|
69717
69717
|
_computePath(options) {
|
|
69718
|
-
let
|
|
69718
|
+
let path40 = (options.path || "/engine.io").replace(/\/$/, "");
|
|
69719
69719
|
if (options.addTrailingSlash !== false) {
|
|
69720
|
-
|
|
69720
|
+
path40 += "/";
|
|
69721
69721
|
}
|
|
69722
|
-
return
|
|
69722
|
+
return path40;
|
|
69723
69723
|
}
|
|
69724
69724
|
/**
|
|
69725
69725
|
* Returns a list of available transports for upgrade given a certain transport.
|
|
@@ -70218,10 +70218,10 @@ var require_server = __commonJS({
|
|
|
70218
70218
|
* @param {Object} options
|
|
70219
70219
|
*/
|
|
70220
70220
|
attach(server, options = {}) {
|
|
70221
|
-
const
|
|
70221
|
+
const path40 = this._computePath(options);
|
|
70222
70222
|
const destroyUpgradeTimeout = options.destroyUpgradeTimeout || 1e3;
|
|
70223
70223
|
function check(req) {
|
|
70224
|
-
return
|
|
70224
|
+
return path40 === req.url.slice(0, path40.length);
|
|
70225
70225
|
}
|
|
70226
70226
|
const listeners = server.listeners("request").slice(0);
|
|
70227
70227
|
server.removeAllListeners("request");
|
|
@@ -70229,7 +70229,7 @@ var require_server = __commonJS({
|
|
|
70229
70229
|
server.on("listening", this.init.bind(this));
|
|
70230
70230
|
server.on("request", (req, res) => {
|
|
70231
70231
|
if (check(req)) {
|
|
70232
|
-
debug('intercepting request for path "%s"',
|
|
70232
|
+
debug('intercepting request for path "%s"', path40);
|
|
70233
70233
|
this.handleRequest(req, res);
|
|
70234
70234
|
} else {
|
|
70235
70235
|
let i2 = 0;
|
|
@@ -71068,8 +71068,8 @@ var require_userver = __commonJS({
|
|
|
71068
71068
|
* @param options
|
|
71069
71069
|
*/
|
|
71070
71070
|
attach(app3, options = {}) {
|
|
71071
|
-
const
|
|
71072
|
-
app3.any(
|
|
71071
|
+
const path40 = this._computePath(options);
|
|
71072
|
+
app3.any(path40, this.handleRequest.bind(this)).ws(path40, {
|
|
71073
71073
|
compression: options.compression,
|
|
71074
71074
|
idleTimeout: options.idleTimeout,
|
|
71075
71075
|
maxBackpressure: options.maxBackpressure,
|
|
@@ -75482,7 +75482,7 @@ var require_dist3 = __commonJS({
|
|
|
75482
75482
|
var zlib_1 = require("zlib");
|
|
75483
75483
|
var accepts = require_accepts2();
|
|
75484
75484
|
var stream_1 = require("stream");
|
|
75485
|
-
var
|
|
75485
|
+
var path40 = require("path");
|
|
75486
75486
|
var engine_io_1 = require_engine_io();
|
|
75487
75487
|
var client_1 = require_client();
|
|
75488
75488
|
var events_1 = require("events");
|
|
@@ -75677,7 +75677,7 @@ var require_dist3 = __commonJS({
|
|
|
75677
75677
|
res.writeHeader("cache-control", "public, max-age=0");
|
|
75678
75678
|
res.writeHeader("content-type", "application/" + (isMap ? "json" : "javascript") + "; charset=utf-8");
|
|
75679
75679
|
res.writeHeader("etag", expectedEtag);
|
|
75680
|
-
const filepath =
|
|
75680
|
+
const filepath = path40.join(__dirname, "../client-dist/", filename);
|
|
75681
75681
|
(0, uws_1.serveFile)(res, filepath);
|
|
75682
75682
|
});
|
|
75683
75683
|
}
|
|
@@ -75759,7 +75759,7 @@ var require_dist3 = __commonJS({
|
|
|
75759
75759
|
* @private
|
|
75760
75760
|
*/
|
|
75761
75761
|
static sendFile(filename, req, res) {
|
|
75762
|
-
const readStream = (0, fs_1.createReadStream)(
|
|
75762
|
+
const readStream = (0, fs_1.createReadStream)(path40.join(__dirname, "../client-dist/", filename));
|
|
75763
75763
|
const encoding = accepts(req).encodings(["br", "gzip", "deflate"]);
|
|
75764
75764
|
const onError = (err) => {
|
|
75765
75765
|
if (err) {
|
|
@@ -76265,7 +76265,7 @@ var require_path = __commonJS({
|
|
|
76265
76265
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
76266
76266
|
exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
|
|
76267
76267
|
var os3 = require("os");
|
|
76268
|
-
var
|
|
76268
|
+
var path40 = require("path");
|
|
76269
76269
|
var IS_WINDOWS_PLATFORM = os3.platform() === "win32";
|
|
76270
76270
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
76271
76271
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
@@ -76277,7 +76277,7 @@ var require_path = __commonJS({
|
|
|
76277
76277
|
}
|
|
76278
76278
|
exports2.unixify = unixify;
|
|
76279
76279
|
function makeAbsolute(cwd, filepath) {
|
|
76280
|
-
return
|
|
76280
|
+
return path40.resolve(cwd, filepath);
|
|
76281
76281
|
}
|
|
76282
76282
|
exports2.makeAbsolute = makeAbsolute;
|
|
76283
76283
|
function removeLeadingDotSegment(entry) {
|
|
@@ -77576,7 +77576,7 @@ var require_braces = __commonJS({
|
|
|
77576
77576
|
var require_constants3 = __commonJS({
|
|
77577
77577
|
"../../node_modules/micromatch/node_modules/picomatch/lib/constants.js"(exports2, module2) {
|
|
77578
77578
|
"use strict";
|
|
77579
|
-
var
|
|
77579
|
+
var path40 = require("path");
|
|
77580
77580
|
var WIN_SLASH = "\\\\/";
|
|
77581
77581
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
77582
77582
|
var DOT_LITERAL = "\\.";
|
|
@@ -77746,7 +77746,7 @@ var require_constants3 = __commonJS({
|
|
|
77746
77746
|
/* | */
|
|
77747
77747
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
77748
77748
|
/* \uFEFF */
|
|
77749
|
-
SEP:
|
|
77749
|
+
SEP: path40.sep,
|
|
77750
77750
|
/**
|
|
77751
77751
|
* Create EXTGLOB_CHARS
|
|
77752
77752
|
*/
|
|
@@ -77773,7 +77773,7 @@ var require_constants3 = __commonJS({
|
|
|
77773
77773
|
var require_utils7 = __commonJS({
|
|
77774
77774
|
"../../node_modules/micromatch/node_modules/picomatch/lib/utils.js"(exports2) {
|
|
77775
77775
|
"use strict";
|
|
77776
|
-
var
|
|
77776
|
+
var path40 = require("path");
|
|
77777
77777
|
var win32 = process.platform === "win32";
|
|
77778
77778
|
var {
|
|
77779
77779
|
REGEX_BACKSLASH,
|
|
@@ -77802,7 +77802,7 @@ var require_utils7 = __commonJS({
|
|
|
77802
77802
|
if (options && typeof options.windows === "boolean") {
|
|
77803
77803
|
return options.windows;
|
|
77804
77804
|
}
|
|
77805
|
-
return win32 === true ||
|
|
77805
|
+
return win32 === true || path40.sep === "\\";
|
|
77806
77806
|
};
|
|
77807
77807
|
exports2.escapeLast = (input, char, lastIdx) => {
|
|
77808
77808
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -78937,7 +78937,7 @@ var require_parse4 = __commonJS({
|
|
|
78937
78937
|
var require_picomatch = __commonJS({
|
|
78938
78938
|
"../../node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
|
|
78939
78939
|
"use strict";
|
|
78940
|
-
var
|
|
78940
|
+
var path40 = require("path");
|
|
78941
78941
|
var scan = require_scan();
|
|
78942
78942
|
var parse = require_parse4();
|
|
78943
78943
|
var utils = require_utils7();
|
|
@@ -79022,7 +79022,7 @@ var require_picomatch = __commonJS({
|
|
|
79022
79022
|
};
|
|
79023
79023
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
79024
79024
|
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
79025
|
-
return regex.test(
|
|
79025
|
+
return regex.test(path40.basename(input));
|
|
79026
79026
|
};
|
|
79027
79027
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
79028
79028
|
picomatch.parse = (pattern, options) => {
|
|
@@ -79249,7 +79249,7 @@ var require_pattern = __commonJS({
|
|
|
79249
79249
|
"use strict";
|
|
79250
79250
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
79251
79251
|
exports2.isAbsolute = exports2.partitionAbsoluteAndRelative = exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
|
|
79252
|
-
var
|
|
79252
|
+
var path40 = require("path");
|
|
79253
79253
|
var globParent = require_glob_parent();
|
|
79254
79254
|
var micromatch = require_micromatch();
|
|
79255
79255
|
var GLOBSTAR = "**";
|
|
@@ -79344,7 +79344,7 @@ var require_pattern = __commonJS({
|
|
|
79344
79344
|
}
|
|
79345
79345
|
exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
79346
79346
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
79347
|
-
const basename =
|
|
79347
|
+
const basename = path40.basename(pattern);
|
|
79348
79348
|
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
79349
79349
|
}
|
|
79350
79350
|
exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
@@ -79402,7 +79402,7 @@ var require_pattern = __commonJS({
|
|
|
79402
79402
|
}
|
|
79403
79403
|
exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
79404
79404
|
function isAbsolute(pattern) {
|
|
79405
|
-
return
|
|
79405
|
+
return path40.isAbsolute(pattern);
|
|
79406
79406
|
}
|
|
79407
79407
|
exports2.isAbsolute = isAbsolute;
|
|
79408
79408
|
}
|
|
@@ -79577,10 +79577,10 @@ var require_utils8 = __commonJS({
|
|
|
79577
79577
|
exports2.array = array;
|
|
79578
79578
|
var errno = require_errno();
|
|
79579
79579
|
exports2.errno = errno;
|
|
79580
|
-
var
|
|
79581
|
-
exports2.fs =
|
|
79582
|
-
var
|
|
79583
|
-
exports2.path =
|
|
79580
|
+
var fs35 = require_fs2();
|
|
79581
|
+
exports2.fs = fs35;
|
|
79582
|
+
var path40 = require_path();
|
|
79583
|
+
exports2.path = path40;
|
|
79584
79584
|
var pattern = require_pattern();
|
|
79585
79585
|
exports2.pattern = pattern;
|
|
79586
79586
|
var stream = require_stream2();
|
|
@@ -79692,8 +79692,8 @@ var require_async2 = __commonJS({
|
|
|
79692
79692
|
"use strict";
|
|
79693
79693
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
79694
79694
|
exports2.read = void 0;
|
|
79695
|
-
function read(
|
|
79696
|
-
settings.fs.lstat(
|
|
79695
|
+
function read(path40, settings, callback) {
|
|
79696
|
+
settings.fs.lstat(path40, (lstatError, lstat) => {
|
|
79697
79697
|
if (lstatError !== null) {
|
|
79698
79698
|
callFailureCallback(callback, lstatError);
|
|
79699
79699
|
return;
|
|
@@ -79702,7 +79702,7 @@ var require_async2 = __commonJS({
|
|
|
79702
79702
|
callSuccessCallback(callback, lstat);
|
|
79703
79703
|
return;
|
|
79704
79704
|
}
|
|
79705
|
-
settings.fs.stat(
|
|
79705
|
+
settings.fs.stat(path40, (statError, stat) => {
|
|
79706
79706
|
if (statError !== null) {
|
|
79707
79707
|
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
79708
79708
|
callFailureCallback(callback, statError);
|
|
@@ -79734,13 +79734,13 @@ var require_sync = __commonJS({
|
|
|
79734
79734
|
"use strict";
|
|
79735
79735
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
79736
79736
|
exports2.read = void 0;
|
|
79737
|
-
function read(
|
|
79738
|
-
const lstat = settings.fs.lstatSync(
|
|
79737
|
+
function read(path40, settings) {
|
|
79738
|
+
const lstat = settings.fs.lstatSync(path40);
|
|
79739
79739
|
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
|
79740
79740
|
return lstat;
|
|
79741
79741
|
}
|
|
79742
79742
|
try {
|
|
79743
|
-
const stat = settings.fs.statSync(
|
|
79743
|
+
const stat = settings.fs.statSync(path40);
|
|
79744
79744
|
if (settings.markSymbolicLink) {
|
|
79745
79745
|
stat.isSymbolicLink = () => true;
|
|
79746
79746
|
}
|
|
@@ -79762,12 +79762,12 @@ var require_fs3 = __commonJS({
|
|
|
79762
79762
|
"use strict";
|
|
79763
79763
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
79764
79764
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
79765
|
-
var
|
|
79765
|
+
var fs35 = require("fs");
|
|
79766
79766
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
79767
|
-
lstat:
|
|
79768
|
-
stat:
|
|
79769
|
-
lstatSync:
|
|
79770
|
-
statSync:
|
|
79767
|
+
lstat: fs35.lstat,
|
|
79768
|
+
stat: fs35.stat,
|
|
79769
|
+
lstatSync: fs35.lstatSync,
|
|
79770
|
+
statSync: fs35.statSync
|
|
79771
79771
|
};
|
|
79772
79772
|
function createFileSystemAdapter(fsMethods) {
|
|
79773
79773
|
if (fsMethods === void 0) {
|
|
@@ -79784,12 +79784,12 @@ var require_settings = __commonJS({
|
|
|
79784
79784
|
"../../node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
|
|
79785
79785
|
"use strict";
|
|
79786
79786
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
79787
|
-
var
|
|
79787
|
+
var fs35 = require_fs3();
|
|
79788
79788
|
var Settings = class {
|
|
79789
79789
|
constructor(_options = {}) {
|
|
79790
79790
|
this._options = _options;
|
|
79791
79791
|
this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
|
79792
|
-
this.fs =
|
|
79792
|
+
this.fs = fs35.createFileSystemAdapter(this._options.fs);
|
|
79793
79793
|
this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
|
79794
79794
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
79795
79795
|
}
|
|
@@ -79811,17 +79811,17 @@ var require_out = __commonJS({
|
|
|
79811
79811
|
var sync = require_sync();
|
|
79812
79812
|
var settings_1 = require_settings();
|
|
79813
79813
|
exports2.Settings = settings_1.default;
|
|
79814
|
-
function stat(
|
|
79814
|
+
function stat(path40, optionsOrSettingsOrCallback, callback) {
|
|
79815
79815
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
79816
|
-
async.read(
|
|
79816
|
+
async.read(path40, getSettings(), optionsOrSettingsOrCallback);
|
|
79817
79817
|
return;
|
|
79818
79818
|
}
|
|
79819
|
-
async.read(
|
|
79819
|
+
async.read(path40, getSettings(optionsOrSettingsOrCallback), callback);
|
|
79820
79820
|
}
|
|
79821
79821
|
exports2.stat = stat;
|
|
79822
|
-
function statSync2(
|
|
79822
|
+
function statSync2(path40, optionsOrSettings) {
|
|
79823
79823
|
const settings = getSettings(optionsOrSettings);
|
|
79824
|
-
return sync.read(
|
|
79824
|
+
return sync.read(path40, settings);
|
|
79825
79825
|
}
|
|
79826
79826
|
exports2.statSync = statSync2;
|
|
79827
79827
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -79946,8 +79946,8 @@ var require_utils9 = __commonJS({
|
|
|
79946
79946
|
"use strict";
|
|
79947
79947
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
79948
79948
|
exports2.fs = void 0;
|
|
79949
|
-
var
|
|
79950
|
-
exports2.fs =
|
|
79949
|
+
var fs35 = require_fs4();
|
|
79950
|
+
exports2.fs = fs35;
|
|
79951
79951
|
}
|
|
79952
79952
|
});
|
|
79953
79953
|
|
|
@@ -80039,16 +80039,16 @@ var require_async3 = __commonJS({
|
|
|
80039
80039
|
return;
|
|
80040
80040
|
}
|
|
80041
80041
|
const tasks = names.map((name) => {
|
|
80042
|
-
const
|
|
80042
|
+
const path40 = common2.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
80043
80043
|
return (done) => {
|
|
80044
|
-
fsStat.stat(
|
|
80044
|
+
fsStat.stat(path40, settings.fsStatSettings, (error, stats) => {
|
|
80045
80045
|
if (error !== null) {
|
|
80046
80046
|
done(error);
|
|
80047
80047
|
return;
|
|
80048
80048
|
}
|
|
80049
80049
|
const entry = {
|
|
80050
80050
|
name,
|
|
80051
|
-
path:
|
|
80051
|
+
path: path40,
|
|
80052
80052
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
80053
80053
|
};
|
|
80054
80054
|
if (settings.stats) {
|
|
@@ -80142,14 +80142,14 @@ var require_fs5 = __commonJS({
|
|
|
80142
80142
|
"use strict";
|
|
80143
80143
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
80144
80144
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
80145
|
-
var
|
|
80145
|
+
var fs35 = require("fs");
|
|
80146
80146
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
80147
|
-
lstat:
|
|
80148
|
-
stat:
|
|
80149
|
-
lstatSync:
|
|
80150
|
-
statSync:
|
|
80151
|
-
readdir:
|
|
80152
|
-
readdirSync:
|
|
80147
|
+
lstat: fs35.lstat,
|
|
80148
|
+
stat: fs35.stat,
|
|
80149
|
+
lstatSync: fs35.lstatSync,
|
|
80150
|
+
statSync: fs35.statSync,
|
|
80151
|
+
readdir: fs35.readdir,
|
|
80152
|
+
readdirSync: fs35.readdirSync
|
|
80153
80153
|
};
|
|
80154
80154
|
function createFileSystemAdapter(fsMethods) {
|
|
80155
80155
|
if (fsMethods === void 0) {
|
|
@@ -80166,15 +80166,15 @@ var require_settings2 = __commonJS({
|
|
|
80166
80166
|
"../../node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
|
|
80167
80167
|
"use strict";
|
|
80168
80168
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
80169
|
-
var
|
|
80169
|
+
var path40 = require("path");
|
|
80170
80170
|
var fsStat = require_out();
|
|
80171
|
-
var
|
|
80171
|
+
var fs35 = require_fs5();
|
|
80172
80172
|
var Settings = class {
|
|
80173
80173
|
constructor(_options = {}) {
|
|
80174
80174
|
this._options = _options;
|
|
80175
80175
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
|
80176
|
-
this.fs =
|
|
80177
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
80176
|
+
this.fs = fs35.createFileSystemAdapter(this._options.fs);
|
|
80177
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path40.sep);
|
|
80178
80178
|
this.stats = this._getValue(this._options.stats, false);
|
|
80179
80179
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
80180
80180
|
this.fsStatSettings = new fsStat.Settings({
|
|
@@ -80201,17 +80201,17 @@ var require_out2 = __commonJS({
|
|
|
80201
80201
|
var sync = require_sync2();
|
|
80202
80202
|
var settings_1 = require_settings2();
|
|
80203
80203
|
exports2.Settings = settings_1.default;
|
|
80204
|
-
function scandir(
|
|
80204
|
+
function scandir(path40, optionsOrSettingsOrCallback, callback) {
|
|
80205
80205
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
80206
|
-
async.read(
|
|
80206
|
+
async.read(path40, getSettings(), optionsOrSettingsOrCallback);
|
|
80207
80207
|
return;
|
|
80208
80208
|
}
|
|
80209
|
-
async.read(
|
|
80209
|
+
async.read(path40, getSettings(optionsOrSettingsOrCallback), callback);
|
|
80210
80210
|
}
|
|
80211
80211
|
exports2.scandir = scandir;
|
|
80212
|
-
function scandirSync(
|
|
80212
|
+
function scandirSync(path40, optionsOrSettings) {
|
|
80213
80213
|
const settings = getSettings(optionsOrSettings);
|
|
80214
|
-
return sync.read(
|
|
80214
|
+
return sync.read(path40, settings);
|
|
80215
80215
|
}
|
|
80216
80216
|
exports2.scandirSync = scandirSync;
|
|
80217
80217
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -80858,7 +80858,7 @@ var require_settings3 = __commonJS({
|
|
|
80858
80858
|
"../../node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
|
|
80859
80859
|
"use strict";
|
|
80860
80860
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
80861
|
-
var
|
|
80861
|
+
var path40 = require("path");
|
|
80862
80862
|
var fsScandir = require_out2();
|
|
80863
80863
|
var Settings = class {
|
|
80864
80864
|
constructor(_options = {}) {
|
|
@@ -80868,7 +80868,7 @@ var require_settings3 = __commonJS({
|
|
|
80868
80868
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
|
80869
80869
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
|
80870
80870
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
|
80871
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
80871
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path40.sep);
|
|
80872
80872
|
this.fsScandirSettings = new fsScandir.Settings({
|
|
80873
80873
|
followSymbolicLinks: this._options.followSymbolicLinks,
|
|
80874
80874
|
fs: this._options.fs,
|
|
@@ -80930,7 +80930,7 @@ var require_reader2 = __commonJS({
|
|
|
80930
80930
|
"../../node_modules/fast-glob/out/readers/reader.js"(exports2) {
|
|
80931
80931
|
"use strict";
|
|
80932
80932
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
80933
|
-
var
|
|
80933
|
+
var path40 = require("path");
|
|
80934
80934
|
var fsStat = require_out();
|
|
80935
80935
|
var utils = require_utils8();
|
|
80936
80936
|
var Reader = class {
|
|
@@ -80943,7 +80943,7 @@ var require_reader2 = __commonJS({
|
|
|
80943
80943
|
});
|
|
80944
80944
|
}
|
|
80945
80945
|
_getFullEntryPath(filepath) {
|
|
80946
|
-
return
|
|
80946
|
+
return path40.resolve(this._settings.cwd, filepath);
|
|
80947
80947
|
}
|
|
80948
80948
|
_makeEntry(stats, pattern) {
|
|
80949
80949
|
const entry = {
|
|
@@ -81359,7 +81359,7 @@ var require_provider = __commonJS({
|
|
|
81359
81359
|
"../../node_modules/fast-glob/out/providers/provider.js"(exports2) {
|
|
81360
81360
|
"use strict";
|
|
81361
81361
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81362
|
-
var
|
|
81362
|
+
var path40 = require("path");
|
|
81363
81363
|
var deep_1 = require_deep();
|
|
81364
81364
|
var entry_1 = require_entry();
|
|
81365
81365
|
var error_1 = require_error();
|
|
@@ -81373,7 +81373,7 @@ var require_provider = __commonJS({
|
|
|
81373
81373
|
this.entryTransformer = new entry_2.default(this._settings);
|
|
81374
81374
|
}
|
|
81375
81375
|
_getRootDirectory(task) {
|
|
81376
|
-
return
|
|
81376
|
+
return path40.resolve(this._settings.cwd, task.base);
|
|
81377
81377
|
}
|
|
81378
81378
|
_getReaderOptions(task) {
|
|
81379
81379
|
const basePath = task.base === "." ? "" : task.base;
|
|
@@ -81554,16 +81554,16 @@ var require_settings4 = __commonJS({
|
|
|
81554
81554
|
"use strict";
|
|
81555
81555
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81556
81556
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
81557
|
-
var
|
|
81557
|
+
var fs35 = require("fs");
|
|
81558
81558
|
var os3 = require("os");
|
|
81559
81559
|
var CPU_COUNT = Math.max(os3.cpus().length, 1);
|
|
81560
81560
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
81561
|
-
lstat:
|
|
81562
|
-
lstatSync:
|
|
81563
|
-
stat:
|
|
81564
|
-
statSync:
|
|
81565
|
-
readdir:
|
|
81566
|
-
readdirSync:
|
|
81561
|
+
lstat: fs35.lstat,
|
|
81562
|
+
lstatSync: fs35.lstatSync,
|
|
81563
|
+
stat: fs35.stat,
|
|
81564
|
+
statSync: fs35.statSync,
|
|
81565
|
+
readdir: fs35.readdir,
|
|
81566
|
+
readdirSync: fs35.readdirSync
|
|
81567
81567
|
};
|
|
81568
81568
|
var Settings = class {
|
|
81569
81569
|
constructor(_options = {}) {
|
|
@@ -81968,7 +81968,7 @@ var require_cpu = __commonJS({
|
|
|
81968
81968
|
"../../node_modules/pidusage/lib/helpers/cpu.js"(exports2, module2) {
|
|
81969
81969
|
"use strict";
|
|
81970
81970
|
var os3 = require("os");
|
|
81971
|
-
var
|
|
81971
|
+
var fs35 = require("fs");
|
|
81972
81972
|
var exec6 = require("child_process").exec;
|
|
81973
81973
|
var parallel = require_parallel();
|
|
81974
81974
|
function updateCpu(cpu, next) {
|
|
@@ -81995,7 +81995,7 @@ var require_cpu = __commonJS({
|
|
|
81995
81995
|
}
|
|
81996
81996
|
module2.exports = updateCpu;
|
|
81997
81997
|
function getRealUptime(next) {
|
|
81998
|
-
|
|
81998
|
+
fs35.readFile("/proc/uptime", "utf8", function(err, uptime) {
|
|
81999
81999
|
if (err || uptime === void 0) {
|
|
82000
82000
|
if (!process.env.PIDUSAGE_SILENT) {
|
|
82001
82001
|
console.warn("[pidusage] We couldn't find uptime from /proc/uptime, using os.uptime() value");
|
|
@@ -82103,8 +82103,8 @@ var require_safe_buffer = __commonJS({
|
|
|
82103
82103
|
var require_procfile = __commonJS({
|
|
82104
82104
|
"../../node_modules/pidusage/lib/procfile.js"(exports2, module2) {
|
|
82105
82105
|
"use strict";
|
|
82106
|
-
var
|
|
82107
|
-
var
|
|
82106
|
+
var fs35 = require("fs");
|
|
82107
|
+
var path40 = require("path");
|
|
82108
82108
|
var updateCpu = require_cpu();
|
|
82109
82109
|
var parallel = require_parallel();
|
|
82110
82110
|
var history = require_history();
|
|
@@ -82113,15 +82113,15 @@ var require_procfile = __commonJS({
|
|
|
82113
82113
|
var SIZE = 1024;
|
|
82114
82114
|
function noop3() {
|
|
82115
82115
|
}
|
|
82116
|
-
function open2(
|
|
82116
|
+
function open2(path41, history2, cb) {
|
|
82117
82117
|
if (history2.fd) {
|
|
82118
82118
|
return cb(null, history2.fd);
|
|
82119
82119
|
}
|
|
82120
|
-
|
|
82120
|
+
fs35.open(path41, "r", cb);
|
|
82121
82121
|
}
|
|
82122
82122
|
function close(history2) {
|
|
82123
82123
|
if (history2.fd) {
|
|
82124
|
-
|
|
82124
|
+
fs35.close(history2.fd, noop3);
|
|
82125
82125
|
}
|
|
82126
82126
|
}
|
|
82127
82127
|
function readUntilEnd(fd, buf, cb) {
|
|
@@ -82131,7 +82131,7 @@ var require_procfile = __commonJS({
|
|
|
82131
82131
|
buf = Buffer6.alloc(SIZE);
|
|
82132
82132
|
firstRead = true;
|
|
82133
82133
|
}
|
|
82134
|
-
|
|
82134
|
+
fs35.read(fd, buf, 0, SIZE, 0, function(err, bytesRead, buffer) {
|
|
82135
82135
|
if (err) {
|
|
82136
82136
|
cb(err);
|
|
82137
82137
|
return;
|
|
@@ -82151,7 +82151,7 @@ var require_procfile = __commonJS({
|
|
|
82151
82151
|
again = true;
|
|
82152
82152
|
hst = {};
|
|
82153
82153
|
}
|
|
82154
|
-
open2(
|
|
82154
|
+
open2(path40.join("/proc", "" + pid, "stat"), hst, function(err, fd) {
|
|
82155
82155
|
if (err) {
|
|
82156
82156
|
if (err.code === "ENOENT") {
|
|
82157
82157
|
err.message = "No matching pid found";
|
|
@@ -82414,7 +82414,7 @@ var require_gwmi = __commonJS({
|
|
|
82414
82414
|
var require_stats = __commonJS({
|
|
82415
82415
|
"../../node_modules/pidusage/lib/stats.js"(exports2, module2) {
|
|
82416
82416
|
"use strict";
|
|
82417
|
-
var
|
|
82417
|
+
var fs35 = require("fs");
|
|
82418
82418
|
var os3 = require("os");
|
|
82419
82419
|
var spawn2 = require("child_process").spawn;
|
|
82420
82420
|
var requireMap = {
|
|
@@ -82438,7 +82438,7 @@ var require_stats = __commonJS({
|
|
|
82438
82438
|
win: "wmic"
|
|
82439
82439
|
};
|
|
82440
82440
|
var platform3 = os3.platform();
|
|
82441
|
-
if (
|
|
82441
|
+
if (fs35.existsSync("/etc/alpine-release")) {
|
|
82442
82442
|
platform3 = "alpine";
|
|
82443
82443
|
}
|
|
82444
82444
|
if (platform3.match(/^win/)) {
|
|
@@ -82873,7 +82873,7 @@ Examples:
|
|
|
82873
82873
|
|
|
82874
82874
|
// src/index.ts
|
|
82875
82875
|
var import_express33 = __toESM(require_express2());
|
|
82876
|
-
var
|
|
82876
|
+
var import_path33 = __toESM(require("path"));
|
|
82877
82877
|
var import_cors = __toESM(require_lib4());
|
|
82878
82878
|
|
|
82879
82879
|
// ../../packages/config/index.ts
|
|
@@ -83071,15 +83071,15 @@ var wslDefaultBrowser = async () => {
|
|
|
83071
83071
|
const { stdout } = await executePowerShell(command2, { powerShellPath: psPath });
|
|
83072
83072
|
return stdout.trim();
|
|
83073
83073
|
};
|
|
83074
|
-
var convertWslPathToWindows = async (
|
|
83075
|
-
if (/^[a-z]+:\/\//i.test(
|
|
83076
|
-
return
|
|
83074
|
+
var convertWslPathToWindows = async (path40) => {
|
|
83075
|
+
if (/^[a-z]+:\/\//i.test(path40)) {
|
|
83076
|
+
return path40;
|
|
83077
83077
|
}
|
|
83078
83078
|
try {
|
|
83079
|
-
const { stdout } = await execFile2("wslpath", ["-aw",
|
|
83079
|
+
const { stdout } = await execFile2("wslpath", ["-aw", path40], { encoding: "utf8" });
|
|
83080
83080
|
return stdout.trim();
|
|
83081
83081
|
} catch {
|
|
83082
|
-
return
|
|
83082
|
+
return path40;
|
|
83083
83083
|
}
|
|
83084
83084
|
};
|
|
83085
83085
|
|
|
@@ -83513,7 +83513,7 @@ var { Server, Namespace, Socket } = import_dist.default;
|
|
|
83513
83513
|
var import_net2 = __toESM(require("net"));
|
|
83514
83514
|
|
|
83515
83515
|
// src/routes/index.ts
|
|
83516
|
-
var
|
|
83516
|
+
var import_path32 = __toESM(require("path"));
|
|
83517
83517
|
|
|
83518
83518
|
// ../../packages/api/index.ts
|
|
83519
83519
|
var apiRoute = {
|
|
@@ -84172,7 +84172,7 @@ function interactiveTerminalSocket(io3) {
|
|
|
84172
84172
|
io3.on("connection", (socket) => {
|
|
84173
84173
|
socket.on("terminal:start", (data) => {
|
|
84174
84174
|
var _a2, _b2;
|
|
84175
|
-
const { path:
|
|
84175
|
+
const { path: path40, command: command2, workspaceName } = data;
|
|
84176
84176
|
stopTerminalProcess(socket.id);
|
|
84177
84177
|
try {
|
|
84178
84178
|
const env = { ...process.env };
|
|
@@ -84186,7 +84186,7 @@ function interactiveTerminalSocket(io3) {
|
|
|
84186
84186
|
const baseCMD = command2.split(" ")[0];
|
|
84187
84187
|
const args2 = command2.split(" ").slice(1);
|
|
84188
84188
|
child = execa(baseCMD, args2, {
|
|
84189
|
-
cwd:
|
|
84189
|
+
cwd: path40,
|
|
84190
84190
|
env,
|
|
84191
84191
|
shell: true,
|
|
84192
84192
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -84216,7 +84216,7 @@ except Exception as e:
|
|
|
84216
84216
|
sys.exit(1)
|
|
84217
84217
|
`;
|
|
84218
84218
|
child = execa("python3", ["-u", "-c", pythonScript], {
|
|
84219
|
-
cwd:
|
|
84219
|
+
cwd: path40,
|
|
84220
84220
|
env,
|
|
84221
84221
|
stdio: ["pipe", "pipe", "pipe"],
|
|
84222
84222
|
buffer: false,
|
|
@@ -95523,10 +95523,257 @@ node_modules
|
|
|
95523
95523
|
ollama_data/
|
|
95524
95524
|
`;
|
|
95525
95525
|
|
|
95526
|
+
// ../../packages/template/services/ollama/index_html.ts
|
|
95527
|
+
var indexHtmlContent = `<!DOCTYPE html>
|
|
95528
|
+
<html lang="en">
|
|
95529
|
+
<head>
|
|
95530
|
+
<meta charset="UTF-8">
|
|
95531
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
95532
|
+
<title>Local Ollama Chat</title>
|
|
95533
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
95534
|
+
<style>
|
|
95535
|
+
/* Custom scrollbar for Webkit browsers */
|
|
95536
|
+
::-webkit-scrollbar {
|
|
95537
|
+
width: 8px;
|
|
95538
|
+
}
|
|
95539
|
+
::-webkit-scrollbar-track {
|
|
95540
|
+
background: #1f2937;
|
|
95541
|
+
}
|
|
95542
|
+
::-webkit-scrollbar-thumb {
|
|
95543
|
+
background: #4b5563;
|
|
95544
|
+
border-radius: 4px;
|
|
95545
|
+
}
|
|
95546
|
+
::-webkit-scrollbar-thumb:hover {
|
|
95547
|
+
background: #6b7280;
|
|
95548
|
+
}
|
|
95549
|
+
</style>
|
|
95550
|
+
</head>
|
|
95551
|
+
<body class="bg-gray-900 text-gray-100 h-screen flex flex-col font-sans">
|
|
95552
|
+
|
|
95553
|
+
<!-- Header -->
|
|
95554
|
+
<header class="bg-gray-800 border-b border-gray-700 p-4 shadow-md z-10">
|
|
95555
|
+
<div class="max-w-4xl mx-auto flex items-center justify-between">
|
|
95556
|
+
<h1 class="text-xl font-bold flex items-center gap-2">
|
|
95557
|
+
<span class="w-3 h-3 bg-green-500 rounded-full animate-pulse"></span>
|
|
95558
|
+
Local AI Chat
|
|
95559
|
+
</h1>
|
|
95560
|
+
<div class="text-sm text-gray-400">
|
|
95561
|
+
Model: <span class="font-mono text-blue-400">qwen2.5:7b</span>
|
|
95562
|
+
</div>
|
|
95563
|
+
</div>
|
|
95564
|
+
</header>
|
|
95565
|
+
|
|
95566
|
+
<!-- Chat Container -->
|
|
95567
|
+
<main class="flex-1 overflow-hidden relative flex flex-col">
|
|
95568
|
+
<div id="messagesContainer" class="flex-1 overflow-y-auto p-4 space-y-4 max-w-4xl mx-auto w-full scroll-smooth">
|
|
95569
|
+
<!-- Welcome Message -->
|
|
95570
|
+
<div class="flex justify-start">
|
|
95571
|
+
<div class="max-w-[80%] rounded-2xl p-4 bg-gray-800 border border-gray-700 shadow-sm">
|
|
95572
|
+
<p class="text-gray-200">Note: It can takes about a minute to respond the first time</p>
|
|
95573
|
+
</div>
|
|
95574
|
+
</div>
|
|
95575
|
+
</div>
|
|
95576
|
+
</main>
|
|
95577
|
+
|
|
95578
|
+
<!-- Input Area -->
|
|
95579
|
+
<footer class="bg-gray-800 border-t border-gray-700 p-4">
|
|
95580
|
+
<div class="max-w-4xl mx-auto mb-2 flex gap-2">
|
|
95581
|
+
<button id="quickActionButton" class="bg-gray-700 hover:bg-gray-600 text-xs text-blue-300 px-3 py-1.5 rounded-lg border border-gray-600 transition-colors flex items-center gap-1">
|
|
95582
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
95583
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
|
|
95584
|
+
</svg>
|
|
95585
|
+
Example Prompt 1
|
|
95586
|
+
</button>
|
|
95587
|
+
</div>
|
|
95588
|
+
<div class="max-w-4xl mx-auto flex gap-4">
|
|
95589
|
+
<input
|
|
95590
|
+
type="text"
|
|
95591
|
+
id="userInput"
|
|
95592
|
+
class="flex-1 bg-gray-700 border border-gray-600 text-white rounded-xl px-4 py-3 focus:outline-none focus:ring-2 focus:ring-blue-500 placeholder-gray-400 transition-all shadow-inner"
|
|
95593
|
+
placeholder="Type your message here..."
|
|
95594
|
+
autocomplete="off"
|
|
95595
|
+
>
|
|
95596
|
+
<button
|
|
95597
|
+
id="sendButton"
|
|
95598
|
+
class="bg-blue-600 hover:bg-blue-500 text-white font-medium py-2 px-6 rounded-xl transition-all shadow-lg active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"
|
|
95599
|
+
>
|
|
95600
|
+
<span>Send</span>
|
|
95601
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 transform rotate-90" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
95602
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
|
|
95603
|
+
</svg>
|
|
95604
|
+
</button>
|
|
95605
|
+
</div>
|
|
95606
|
+
<div class="max-w-4xl mx-auto mt-2 text-center text-xs text-gray-500">
|
|
95607
|
+
Powered by Ollama \u2022 Running Locally
|
|
95608
|
+
</div>
|
|
95609
|
+
</footer>
|
|
95610
|
+
|
|
95611
|
+
<script>
|
|
95612
|
+
const messagesContainer = document.getElementById('messagesContainer');
|
|
95613
|
+
const userInput = document.getElementById('userInput');
|
|
95614
|
+
const sendButton = document.getElementById('sendButton');
|
|
95615
|
+
|
|
95616
|
+
let chatHistory = [];
|
|
95617
|
+
let isGenerating = false;
|
|
95618
|
+
|
|
95619
|
+
// Auto-focus input on load
|
|
95620
|
+
userInput.focus();
|
|
95621
|
+
|
|
95622
|
+
sendButton.addEventListener('click', handleSend);
|
|
95623
|
+
|
|
95624
|
+
document.getElementById('quickActionButton').addEventListener('click', () => {
|
|
95625
|
+
userInput.value = "Check the current price of Bitcoin and then calculate how much 0.5 BTC is worth in USD.";
|
|
95626
|
+
userInput.focus();
|
|
95627
|
+
});
|
|
95628
|
+
|
|
95629
|
+
// Optional: Allow Enter key? User said "manually click send".
|
|
95630
|
+
// I will strictly follow "manually click send" but commonly users expect Enter.
|
|
95631
|
+
// The prompt "make sure that no use of form, user has to manually click send"
|
|
95632
|
+
// could imply disabling implicit submission, or strictly forcing a click.
|
|
95633
|
+
// I'll stick to click only to be safe, but typically Enter key binding is JS, not Form.
|
|
95634
|
+
// Let's strictly follow "manually click send".
|
|
95635
|
+
|
|
95636
|
+
async function handleSend() {
|
|
95637
|
+
const text = userInput.value.trim();
|
|
95638
|
+
if (!text || isGenerating) return;
|
|
95639
|
+
|
|
95640
|
+
// Clear input
|
|
95641
|
+
userInput.value = '';
|
|
95642
|
+
|
|
95643
|
+
// Add User Message
|
|
95644
|
+
appendMessage('user', text);
|
|
95645
|
+
chatHistory.push({ role: 'user', content: text });
|
|
95646
|
+
|
|
95647
|
+
// Prepare Assistant Message Placeholder
|
|
95648
|
+
isGenerating = true;
|
|
95649
|
+
sendButton.disabled = true;
|
|
95650
|
+
sendButton.classList.add('opacity-50');
|
|
95651
|
+
|
|
95652
|
+
const assistantMessageDiv = appendMessage('assistant', '');
|
|
95653
|
+
const contentSpan = assistantMessageDiv.querySelector('.message-content');
|
|
95654
|
+
const loadingIndicator = document.createElement('span');
|
|
95655
|
+
loadingIndicator.className = 'inline-block w-2 h-4 bg-blue-400 animate-pulse ml-1 align-middle';
|
|
95656
|
+
contentSpan.appendChild(loadingIndicator);
|
|
95657
|
+
|
|
95658
|
+
let fullResponse = '';
|
|
95659
|
+
|
|
95660
|
+
try {
|
|
95661
|
+
const response = await fetch('http://localhost:11434/api/chat', {
|
|
95662
|
+
method: 'POST',
|
|
95663
|
+
headers: {
|
|
95664
|
+
'Content-Type': 'application/json',
|
|
95665
|
+
},
|
|
95666
|
+
body: JSON.stringify({
|
|
95667
|
+
model: 'qwen2.5:7b',
|
|
95668
|
+
messages: chatHistory,
|
|
95669
|
+
stream: true
|
|
95670
|
+
})
|
|
95671
|
+
});
|
|
95672
|
+
|
|
95673
|
+
if (!response.ok) throw new Error('Failed to connect to Ollama');
|
|
95674
|
+
|
|
95675
|
+
const reader = response.body.getReader();
|
|
95676
|
+
const decoder = new TextDecoder();
|
|
95677
|
+
|
|
95678
|
+
let buffer = '';
|
|
95679
|
+
|
|
95680
|
+
// Remove loading indicator once we start receiving data
|
|
95681
|
+
let firstChunk = true;
|
|
95682
|
+
|
|
95683
|
+
while (true) {
|
|
95684
|
+
const { done, value } = await reader.read();
|
|
95685
|
+
if (done) break;
|
|
95686
|
+
|
|
95687
|
+
buffer += decoder.decode(value, { stream: true });
|
|
95688
|
+
const lines = buffer.split('\\n');
|
|
95689
|
+
buffer = lines.pop(); // Keep the last incomplete part
|
|
95690
|
+
|
|
95691
|
+
for (const line of lines) {
|
|
95692
|
+
if (!line.trim()) continue;
|
|
95693
|
+
try {
|
|
95694
|
+
const json = JSON.parse(line);
|
|
95695
|
+
if (json.message && json.message.content) {
|
|
95696
|
+
if (firstChunk) {
|
|
95697
|
+
if (contentSpan.contains(loadingIndicator)) {
|
|
95698
|
+
contentSpan.removeChild(loadingIndicator);
|
|
95699
|
+
}
|
|
95700
|
+
firstChunk = false;
|
|
95701
|
+
}
|
|
95702
|
+
const content = json.message.content;
|
|
95703
|
+
fullResponse += content;
|
|
95704
|
+
contentSpan.textContent = fullResponse;
|
|
95705
|
+
scrollToBottom();
|
|
95706
|
+
}
|
|
95707
|
+
if (json.done) {
|
|
95708
|
+
isGenerating = false; // Mark as done here
|
|
95709
|
+
chatHistory.push({ role: 'assistant', content: fullResponse });
|
|
95710
|
+
}
|
|
95711
|
+
} catch (e) {
|
|
95712
|
+
console.error('Error parsing JSON chunk', e);
|
|
95713
|
+
}
|
|
95714
|
+
}
|
|
95715
|
+
}
|
|
95716
|
+
|
|
95717
|
+
} catch (error) {
|
|
95718
|
+
console.error('Error:', error);
|
|
95719
|
+
contentSpan.textContent = 'Error: Could not connect to local Ollama instance. Make sure it is running on port 11434.';
|
|
95720
|
+
contentSpan.classList.add('text-red-400');
|
|
95721
|
+
} finally {
|
|
95722
|
+
isGenerating = false;
|
|
95723
|
+
sendButton.disabled = false;
|
|
95724
|
+
sendButton.classList.remove('opacity-50');
|
|
95725
|
+
if (contentSpan.contains(loadingIndicator)) {
|
|
95726
|
+
contentSpan.removeChild(loadingIndicator);
|
|
95727
|
+
}
|
|
95728
|
+
userInput.focus();
|
|
95729
|
+
}
|
|
95730
|
+
}
|
|
95731
|
+
|
|
95732
|
+
function appendMessage(role, text) {
|
|
95733
|
+
const div = document.createElement('div');
|
|
95734
|
+
div.className = \`flex \${role === 'user' ? 'justify-end' : 'justify-start'} animate-fade-in-up\`;
|
|
95735
|
+
|
|
95736
|
+
const bubble = document.createElement('div');
|
|
95737
|
+
bubble.className = \`max-w-[80%] rounded-2xl p-4 shadow-sm \${
|
|
95738
|
+
role === 'user'
|
|
95739
|
+
? 'bg-blue-600 text-white rounded-br-none'
|
|
95740
|
+
: 'bg-gray-800 border border-gray-700 text-gray-200 rounded-bl-none'
|
|
95741
|
+
}\`;
|
|
95742
|
+
|
|
95743
|
+
const content = document.createElement('div');
|
|
95744
|
+
content.className = 'message-content whitespace-pre-wrap leading-relaxed';
|
|
95745
|
+
content.textContent = text;
|
|
95746
|
+
|
|
95747
|
+
bubble.appendChild(content);
|
|
95748
|
+
div.appendChild(bubble);
|
|
95749
|
+
messagesContainer.appendChild(div);
|
|
95750
|
+
scrollToBottom();
|
|
95751
|
+
|
|
95752
|
+
return bubble; // Return the bubble so we can update it
|
|
95753
|
+
}
|
|
95754
|
+
|
|
95755
|
+
function scrollToBottom() {
|
|
95756
|
+
messagesContainer.scrollTop = messagesContainer.scrollHeight;
|
|
95757
|
+
}
|
|
95758
|
+
|
|
95759
|
+
// Add some simple animation keyframes
|
|
95760
|
+
const style = document.createElement('style');
|
|
95761
|
+
style.innerHTML = \`
|
|
95762
|
+
@keyframes fadeInUp {
|
|
95763
|
+
from { opacity: 0; transform: translateY(10px); }
|
|
95764
|
+
to { opacity: 1; transform: translateY(0); }
|
|
95765
|
+
}
|
|
95766
|
+
.animate-fade-in-up {
|
|
95767
|
+
animation: fadeInUp 0.3s ease-out forwards;
|
|
95768
|
+
}
|
|
95769
|
+
\`;
|
|
95770
|
+
document.head.appendChild(style);
|
|
95771
|
+
|
|
95772
|
+
</script>
|
|
95773
|
+
</body>
|
|
95774
|
+
</html>`;
|
|
95775
|
+
|
|
95526
95776
|
// ../../packages/template/services/ollama.ts
|
|
95527
|
-
var import_fs5 = __toESM(require("fs"));
|
|
95528
|
-
var import_path23 = __toESM(require("path"));
|
|
95529
|
-
var indexHtmlContent = import_fs5.default.readFileSync(import_path23.default.join(__dirname, "ollama", "index.html"), "utf-8");
|
|
95530
95777
|
var dockerComposeContent = `
|
|
95531
95778
|
services:
|
|
95532
95779
|
ollama:
|
|
@@ -96672,14 +96919,14 @@ var availabletemplates_default = router18;
|
|
|
96672
96919
|
var import_express23 = __toESM(require_express2());
|
|
96673
96920
|
|
|
96674
96921
|
// src/routes/workspace/setworkspace/template.ts
|
|
96675
|
-
var
|
|
96922
|
+
var import_path25 = __toESM(require("path"));
|
|
96676
96923
|
|
|
96677
96924
|
// src/routes/workspace/setworkspace/utils.ts
|
|
96678
|
-
var
|
|
96679
|
-
var
|
|
96925
|
+
var import_fs5 = require("fs");
|
|
96926
|
+
var import_path23 = __toESM(require("path"));
|
|
96680
96927
|
async function ensureDirectory(dirPath) {
|
|
96681
96928
|
try {
|
|
96682
|
-
await
|
|
96929
|
+
await import_fs5.promises.mkdir(dirPath, { recursive: true });
|
|
96683
96930
|
} catch (err) {
|
|
96684
96931
|
if (err.code !== "EEXIST") {
|
|
96685
96932
|
throw err;
|
|
@@ -96687,9 +96934,9 @@ async function ensureDirectory(dirPath) {
|
|
|
96687
96934
|
}
|
|
96688
96935
|
}
|
|
96689
96936
|
async function writeFile(filePath, content) {
|
|
96690
|
-
const dirName =
|
|
96937
|
+
const dirName = import_path23.default.dirname(filePath);
|
|
96691
96938
|
await ensureDirectory(dirName);
|
|
96692
|
-
await
|
|
96939
|
+
await import_fs5.promises.writeFile(filePath, content, { encoding: "utf8" });
|
|
96693
96940
|
}
|
|
96694
96941
|
var isWindows = process.platform === "win32";
|
|
96695
96942
|
async function findMonorepoRoot4(startDir) {
|
|
@@ -96698,21 +96945,21 @@ async function findMonorepoRoot4(startDir) {
|
|
|
96698
96945
|
const markers = ["pnpm-workspace.yaml", "turbo.json", "lerna.json", ".git"];
|
|
96699
96946
|
for (const marker of markers) {
|
|
96700
96947
|
try {
|
|
96701
|
-
await
|
|
96948
|
+
await import_fs5.promises.stat(import_path23.default.join(currentDir, marker));
|
|
96702
96949
|
return currentDir;
|
|
96703
96950
|
} catch {
|
|
96704
96951
|
}
|
|
96705
96952
|
}
|
|
96706
96953
|
try {
|
|
96707
|
-
const pkgPath =
|
|
96708
|
-
const content = await
|
|
96954
|
+
const pkgPath = import_path23.default.join(currentDir, "package.json");
|
|
96955
|
+
const content = await import_fs5.promises.readFile(pkgPath, "utf8");
|
|
96709
96956
|
const pkg = JSON.parse(content);
|
|
96710
96957
|
if (pkg.workspaces) {
|
|
96711
96958
|
return currentDir;
|
|
96712
96959
|
}
|
|
96713
96960
|
} catch {
|
|
96714
96961
|
}
|
|
96715
|
-
const parentDir =
|
|
96962
|
+
const parentDir = import_path23.default.dirname(currentDir);
|
|
96716
96963
|
if (parentDir === currentDir) {
|
|
96717
96964
|
return startDir;
|
|
96718
96965
|
}
|
|
@@ -96721,12 +96968,12 @@ async function findMonorepoRoot4(startDir) {
|
|
|
96721
96968
|
}
|
|
96722
96969
|
|
|
96723
96970
|
// src/routes/workspace/setworkspace/command.ts
|
|
96724
|
-
var
|
|
96971
|
+
var import_path24 = __toESM(require("path"));
|
|
96725
96972
|
init_execa();
|
|
96726
96973
|
function preprocessCommand(command2, cwd) {
|
|
96727
96974
|
let processedCommand = command2;
|
|
96728
96975
|
if (processedCommand.includes("$(basename $PWD)")) {
|
|
96729
|
-
const dirName =
|
|
96976
|
+
const dirName = import_path24.default.basename(cwd);
|
|
96730
96977
|
processedCommand = processedCommand.replace(/\$\(basename \$PWD\)/g, `"${dirName}"`);
|
|
96731
96978
|
}
|
|
96732
96979
|
if (processedCommand.match(/rm\s+-rf\s+\.\/\*\s+\.\/\.\[!\.\]\*.*$/)) {
|
|
@@ -96830,7 +97077,7 @@ async function executeTemplate(template, workspacePath, onProgress) {
|
|
|
96830
97077
|
if (step.action === "root-command") {
|
|
96831
97078
|
cwd = await findMonorepoRoot4(workspacePath);
|
|
96832
97079
|
}
|
|
96833
|
-
let relativePath =
|
|
97080
|
+
let relativePath = import_path25.default.relative(cwd, workspacePath);
|
|
96834
97081
|
if (relativePath === "") relativePath = ".";
|
|
96835
97082
|
const rawFullCmd = args2.length > 0 ? `${cmd} ${args2.join(" ")}` : cmd;
|
|
96836
97083
|
const processedCmd = preprocessCommand(rawFullCmd, cwd);
|
|
@@ -96843,7 +97090,7 @@ async function executeTemplate(template, workspacePath, onProgress) {
|
|
|
96843
97090
|
useShell = true;
|
|
96844
97091
|
finalCmd = finalCmd.replace(/\{\{RELATIVE_PATH\}\}/g, relativePath);
|
|
96845
97092
|
} else {
|
|
96846
|
-
const dirName =
|
|
97093
|
+
const dirName = import_path25.default.basename(cwd);
|
|
96847
97094
|
finalArgs = finalArgs.map(
|
|
96848
97095
|
(arg) => arg.replace(/\$\(basename \$PWD\)/g, dirName).replace(/\{\{RELATIVE_PATH\}\}/g, relativePath)
|
|
96849
97096
|
);
|
|
@@ -96863,15 +97110,15 @@ ${cmdErr.message}`);
|
|
|
96863
97110
|
}
|
|
96864
97111
|
} else if (step.action === "file" && step.file && step.filecontent !== void 0) {
|
|
96865
97112
|
progress(`Creating file: ${step.file}`);
|
|
96866
|
-
const filePath =
|
|
97113
|
+
const filePath = import_path25.default.join(workspacePath, step.file);
|
|
96867
97114
|
await writeFile(filePath, step.filecontent);
|
|
96868
97115
|
}
|
|
96869
97116
|
}
|
|
96870
97117
|
}
|
|
96871
97118
|
|
|
96872
97119
|
// src/routes/workspace/setworkspace/index.ts
|
|
96873
|
-
var
|
|
96874
|
-
var
|
|
97120
|
+
var import_path26 = __toESM(require("path"));
|
|
97121
|
+
var import_fs6 = require("fs");
|
|
96875
97122
|
var router19 = import_express23.default.Router();
|
|
96876
97123
|
router19.post("/", async (req, res) => {
|
|
96877
97124
|
res.status(400).json({ error: "This endpoint is deprecated. Please use the socket endpoint." });
|
|
@@ -96894,26 +97141,26 @@ function setWorkspaceTemplateSocket(io3) {
|
|
|
96894
97141
|
if (template.type === "tool" || template.type === "opensource-app") {
|
|
96895
97142
|
const root = await findMonorepoRoot4(workspacePath);
|
|
96896
97143
|
const toolFolderName = template.name.toLowerCase().replace(/[^a-z0-9-]/g, "-");
|
|
96897
|
-
workspacePath =
|
|
97144
|
+
workspacePath = import_path26.default.join(root, "opensource", toolFolderName);
|
|
96898
97145
|
try {
|
|
96899
|
-
await
|
|
97146
|
+
await import_fs6.promises.access(workspacePath);
|
|
96900
97147
|
socket.emit("template:error", {
|
|
96901
97148
|
error: `Tool '${template.name}' is already installed at ${workspacePath}.`
|
|
96902
97149
|
});
|
|
96903
97150
|
return;
|
|
96904
97151
|
} catch {
|
|
96905
97152
|
}
|
|
96906
|
-
await
|
|
97153
|
+
await import_fs6.promises.mkdir(workspacePath, { recursive: true });
|
|
96907
97154
|
const toolName = template.name.toLowerCase().replace(/[^a-z0-9-]/g, "-");
|
|
96908
|
-
const pkgPath =
|
|
97155
|
+
const pkgPath = import_path26.default.join(workspacePath, "package.json");
|
|
96909
97156
|
let pkgData = { name: toolName, version: "0.0.0", private: true };
|
|
96910
97157
|
try {
|
|
96911
|
-
const currentFile = await
|
|
97158
|
+
const currentFile = await import_fs6.promises.readFile(pkgPath, "utf-8");
|
|
96912
97159
|
const parsed = JSON.parse(currentFile);
|
|
96913
97160
|
pkgData = { ...parsed, name: toolName };
|
|
96914
97161
|
} catch {
|
|
96915
97162
|
}
|
|
96916
|
-
await
|
|
97163
|
+
await import_fs6.promises.writeFile(pkgPath, JSON.stringify(pkgData, null, 2));
|
|
96917
97164
|
socket.emit("template:progress", { message: "Configured package.json" });
|
|
96918
97165
|
}
|
|
96919
97166
|
socket.emit("template:progress", { message: `Starting template '${templatename}'...` });
|
|
@@ -96936,7 +97183,7 @@ function setWorkspaceTemplateSocket(io3) {
|
|
|
96936
97183
|
// src/routes/terminal/stopTerminalWorkspace.ts
|
|
96937
97184
|
var import_express24 = __toESM(require_express2());
|
|
96938
97185
|
var import_fs_extra19 = __toESM(require_lib());
|
|
96939
|
-
var
|
|
97186
|
+
var import_path27 = __toESM(require("path"));
|
|
96940
97187
|
init_execa();
|
|
96941
97188
|
var import_tree_kill = __toESM(require_tree_kill());
|
|
96942
97189
|
var router20 = (0, import_express24.Router)();
|
|
@@ -97028,10 +97275,10 @@ router20.post("/", async (req, res) => {
|
|
|
97028
97275
|
if (activeSession) {
|
|
97029
97276
|
log("Stopping workspace resources...");
|
|
97030
97277
|
}
|
|
97031
|
-
if (workspacePath && await import_fs_extra19.default.pathExists(
|
|
97278
|
+
if (workspacePath && await import_fs_extra19.default.pathExists(import_path27.default.join(workspacePath, ".runtime.json"))) {
|
|
97032
97279
|
try {
|
|
97033
97280
|
log("Checking/Stopping Docker containers...");
|
|
97034
|
-
const runtimeConfig = await import_fs_extra19.default.readJSON(
|
|
97281
|
+
const runtimeConfig = await import_fs_extra19.default.readJSON(import_path27.default.join(workspacePath, ".runtime.json"));
|
|
97035
97282
|
if (runtimeConfig && runtimeConfig.containerIds && Array.isArray(runtimeConfig.containerIds)) {
|
|
97036
97283
|
log(`Stopping ${runtimeConfig.containerIds.length} Docker containers...`);
|
|
97037
97284
|
await stopDockerContainers(runtimeConfig.containerIds);
|
|
@@ -97128,15 +97375,15 @@ var deleteWorkspace_default = router21;
|
|
|
97128
97375
|
// src/routes/textEditor/projectBrowser.ts
|
|
97129
97376
|
var import_express26 = __toESM(require_express2());
|
|
97130
97377
|
var import_fs_extra21 = __toESM(require_lib());
|
|
97131
|
-
var
|
|
97378
|
+
var import_path28 = __toESM(require("path"));
|
|
97132
97379
|
var import_fast_glob2 = __toESM(require_out4());
|
|
97133
97380
|
init_execa();
|
|
97134
97381
|
var router22 = (0, import_express26.Router)();
|
|
97135
97382
|
var ROOT4 = process.cwd();
|
|
97136
97383
|
function findMonorepoRoot5(startDir) {
|
|
97137
97384
|
let dir = startDir;
|
|
97138
|
-
while (dir !==
|
|
97139
|
-
const pkgPath =
|
|
97385
|
+
while (dir !== import_path28.default.dirname(dir)) {
|
|
97386
|
+
const pkgPath = import_path28.default.join(dir, "package.json");
|
|
97140
97387
|
if (import_fs_extra21.default.existsSync(pkgPath)) {
|
|
97141
97388
|
try {
|
|
97142
97389
|
const pkg = import_fs_extra21.default.readJsonSync(pkgPath);
|
|
@@ -97146,16 +97393,16 @@ function findMonorepoRoot5(startDir) {
|
|
|
97146
97393
|
} catch (e) {
|
|
97147
97394
|
}
|
|
97148
97395
|
}
|
|
97149
|
-
if (import_fs_extra21.default.existsSync(
|
|
97396
|
+
if (import_fs_extra21.default.existsSync(import_path28.default.join(dir, ".vscode"))) {
|
|
97150
97397
|
return dir;
|
|
97151
97398
|
}
|
|
97152
|
-
dir =
|
|
97399
|
+
dir = import_path28.default.dirname(dir);
|
|
97153
97400
|
}
|
|
97154
97401
|
return startDir;
|
|
97155
97402
|
}
|
|
97156
97403
|
var MONOREPO_ROOT = findMonorepoRoot5(ROOT4);
|
|
97157
97404
|
var getSettingsPath2 = () => {
|
|
97158
|
-
return
|
|
97405
|
+
return import_path28.default.join(MONOREPO_ROOT, ".vscode/settings.json");
|
|
97159
97406
|
};
|
|
97160
97407
|
var DEFAULT_IGNORES = [
|
|
97161
97408
|
"**/node_modules",
|
|
@@ -97176,7 +97423,7 @@ router22.get("/", async (req, res) => {
|
|
|
97176
97423
|
const excludes = settings["files.exclude"] || {};
|
|
97177
97424
|
const vscodeIgnores = Object.keys(excludes).filter((k) => excludes[k] === true);
|
|
97178
97425
|
let gitIgnores = [];
|
|
97179
|
-
const gitignorePath =
|
|
97426
|
+
const gitignorePath = import_path28.default.join(MONOREPO_ROOT, ".gitignore");
|
|
97180
97427
|
if (await import_fs_extra21.default.pathExists(gitignorePath)) {
|
|
97181
97428
|
const content = await import_fs_extra21.default.readFile(gitignorePath, "utf-8");
|
|
97182
97429
|
gitIgnores = content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#")).map((line) => {
|
|
@@ -97326,7 +97573,7 @@ var projectBrowser_default = router22;
|
|
|
97326
97573
|
// src/routes/textEditor/textEditor.ts
|
|
97327
97574
|
var import_express27 = __toESM(require_express2());
|
|
97328
97575
|
var import_fs_extra22 = __toESM(require_lib());
|
|
97329
|
-
var
|
|
97576
|
+
var import_path29 = __toESM(require("path"));
|
|
97330
97577
|
init_execa();
|
|
97331
97578
|
var router23 = (0, import_express27.Router)();
|
|
97332
97579
|
function resolvePath(itemPath) {
|
|
@@ -97334,7 +97581,7 @@ function resolvePath(itemPath) {
|
|
|
97334
97581
|
return itemPath;
|
|
97335
97582
|
}
|
|
97336
97583
|
const relativePath = itemPath.replace(/^\/+/, "");
|
|
97337
|
-
return
|
|
97584
|
+
return import_path29.default.join(ROOT3, relativePath);
|
|
97338
97585
|
}
|
|
97339
97586
|
router23.post("/get", async (req, res) => {
|
|
97340
97587
|
try {
|
|
@@ -97395,14 +97642,14 @@ router23.post("/edit", async (req, res) => {
|
|
|
97395
97642
|
res.status(404).json({ error: "Path not found" });
|
|
97396
97643
|
return;
|
|
97397
97644
|
}
|
|
97398
|
-
const originalName =
|
|
97399
|
-
const originalExt =
|
|
97645
|
+
const originalName = import_path29.default.basename(itemPath);
|
|
97646
|
+
const originalExt = import_path29.default.extname(originalName);
|
|
97400
97647
|
const isFile = originalExt !== "";
|
|
97401
97648
|
if (isFile && !newname.includes(".")) {
|
|
97402
97649
|
newname = newname + originalExt;
|
|
97403
97650
|
}
|
|
97404
|
-
const dir =
|
|
97405
|
-
const newPath =
|
|
97651
|
+
const dir = import_path29.default.dirname(itemPath);
|
|
97652
|
+
const newPath = import_path29.default.join(dir, newname);
|
|
97406
97653
|
if (await import_fs_extra22.default.pathExists(newPath)) {
|
|
97407
97654
|
res.status(400).json({ error: "A file or folder with that name already exists" });
|
|
97408
97655
|
return;
|
|
@@ -97491,7 +97738,7 @@ router23.post("/diff", async (req, res) => {
|
|
|
97491
97738
|
res.status(404).json({ error: "File not found" });
|
|
97492
97739
|
return;
|
|
97493
97740
|
}
|
|
97494
|
-
const relativePath =
|
|
97741
|
+
const relativePath = import_path29.default.relative(ROOT3, filePath);
|
|
97495
97742
|
const added = [];
|
|
97496
97743
|
const modified = [];
|
|
97497
97744
|
let isUntracked = false;
|
|
@@ -97552,8 +97799,8 @@ var textEditor_default = router23;
|
|
|
97552
97799
|
// src/routes/utils/gitStashHelper.ts
|
|
97553
97800
|
var import_express28 = __toESM(require_express2());
|
|
97554
97801
|
init_execa();
|
|
97555
|
-
var
|
|
97556
|
-
var
|
|
97802
|
+
var import_fs7 = __toESM(require("fs"));
|
|
97803
|
+
var import_path30 = __toESM(require("path"));
|
|
97557
97804
|
var router24 = (0, import_express28.Router)();
|
|
97558
97805
|
async function runGit2(args2) {
|
|
97559
97806
|
const { stdout } = await execa("git", args2, { cwd: ROOT3 });
|
|
@@ -97561,16 +97808,16 @@ async function runGit2(args2) {
|
|
|
97561
97808
|
}
|
|
97562
97809
|
async function cleanStaleLocks2() {
|
|
97563
97810
|
const lockFiles = [
|
|
97564
|
-
|
|
97565
|
-
|
|
97811
|
+
import_path30.default.join(ROOT3, ".git", "index.lock"),
|
|
97812
|
+
import_path30.default.join(ROOT3, ".git", "refs", "stash.lock")
|
|
97566
97813
|
];
|
|
97567
97814
|
for (const lockFile of lockFiles) {
|
|
97568
|
-
if (
|
|
97815
|
+
if (import_fs7.default.existsSync(lockFile)) {
|
|
97569
97816
|
try {
|
|
97570
97817
|
await execa("pgrep", ["-x", "git"]);
|
|
97571
97818
|
} catch {
|
|
97572
97819
|
try {
|
|
97573
|
-
|
|
97820
|
+
import_fs7.default.unlinkSync(lockFile);
|
|
97574
97821
|
} catch (e) {
|
|
97575
97822
|
}
|
|
97576
97823
|
}
|
|
@@ -97698,7 +97945,7 @@ var gitStashHelper_default = router24;
|
|
|
97698
97945
|
|
|
97699
97946
|
// src/routes/opencode/createInstance.ts
|
|
97700
97947
|
var import_express29 = __toESM(require_express2());
|
|
97701
|
-
var
|
|
97948
|
+
var import_path31 = __toESM(require("path"));
|
|
97702
97949
|
init_helper();
|
|
97703
97950
|
init_core2();
|
|
97704
97951
|
var opencodeSdkPromise = new Function("specifier", "return import(specifier)")("@opencode-ai/sdk");
|
|
@@ -97733,7 +97980,7 @@ router25.post("/", async (req, res) => {
|
|
|
97733
97980
|
}
|
|
97734
97981
|
try {
|
|
97735
97982
|
const port3 = await findAvailablePort(4096);
|
|
97736
|
-
const projectRoot =
|
|
97983
|
+
const projectRoot = import_path31.default.resolve(process.cwd(), "../../");
|
|
97737
97984
|
const originalCwd = process.cwd();
|
|
97738
97985
|
console.log(`Starting Opencode in root: ${projectRoot}`);
|
|
97739
97986
|
process.chdir(projectRoot);
|
|
@@ -97886,7 +98133,7 @@ function SETROUTES(app3, frontendPath2) {
|
|
|
97886
98133
|
app3.use("/" + api_default.textEditor, textEditor_default);
|
|
97887
98134
|
app3.use(import_express32.default.static(frontendPath2));
|
|
97888
98135
|
app3.get(/(.*)/, (req, res) => {
|
|
97889
|
-
res.sendFile(
|
|
98136
|
+
res.sendFile(import_path32.default.join(frontendPath2, "index.html"));
|
|
97890
98137
|
});
|
|
97891
98138
|
}
|
|
97892
98139
|
|
|
@@ -97936,7 +98183,7 @@ app2.use((0, import_cors.default)({
|
|
|
97936
98183
|
credentials: true
|
|
97937
98184
|
}));
|
|
97938
98185
|
app2.use(import_express33.default.json());
|
|
97939
|
-
var frontendPath =
|
|
98186
|
+
var frontendPath = import_path33.default.join(__dirname, "../public");
|
|
97940
98187
|
SETROUTES(app2, frontendPath);
|
|
97941
98188
|
var httpServer = (0, import_http.createServer)(app2);
|
|
97942
98189
|
var io2 = new Server(httpServer, {
|