@weapp-tailwindcss/init 0.0.0

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.mjs ADDED
@@ -0,0 +1,2725 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __esm = (fn, res) => function __init() {
14
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
+ };
16
+ var __commonJS = (cb, mod) => function __require2() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
+ // If the importer is in node compatibility mode or this is not an ESM
29
+ // file that has been converted to a CommonJS file using a Babel-
30
+ // compatible transform (i.e. "__esModule" has not been set), then set
31
+ // "default" to the CommonJS "module.exports" for node compatibility.
32
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
+ mod
34
+ ));
35
+
36
+ // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
37
+ var init_esm_shims = __esm({
38
+ "../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
39
+ "use strict";
40
+ }
41
+ });
42
+
43
+ // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
44
+ var require_universalify = __commonJS({
45
+ "../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
46
+ "use strict";
47
+ init_esm_shims();
48
+ exports.fromCallback = function(fn) {
49
+ return Object.defineProperty(function(...args) {
50
+ if (typeof args[args.length - 1] === "function") fn.apply(this, args);
51
+ else {
52
+ return new Promise((resolve2, reject) => {
53
+ args.push((err, res) => err != null ? reject(err) : resolve2(res));
54
+ fn.apply(this, args);
55
+ });
56
+ }
57
+ }, "name", { value: fn.name });
58
+ };
59
+ exports.fromPromise = function(fn) {
60
+ return Object.defineProperty(function(...args) {
61
+ const cb = args[args.length - 1];
62
+ if (typeof cb !== "function") return fn.apply(this, args);
63
+ else {
64
+ args.pop();
65
+ fn.apply(this, args).then((r) => cb(null, r), cb);
66
+ }
67
+ }, "name", { value: fn.name });
68
+ };
69
+ }
70
+ });
71
+
72
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
73
+ var require_polyfills = __commonJS({
74
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
75
+ "use strict";
76
+ init_esm_shims();
77
+ var constants = __require("constants");
78
+ var origCwd = process.cwd;
79
+ var cwd2 = null;
80
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
81
+ process.cwd = function() {
82
+ if (!cwd2)
83
+ cwd2 = origCwd.call(process);
84
+ return cwd2;
85
+ };
86
+ try {
87
+ process.cwd();
88
+ } catch (er) {
89
+ }
90
+ if (typeof process.chdir === "function") {
91
+ chdir = process.chdir;
92
+ process.chdir = function(d) {
93
+ cwd2 = null;
94
+ chdir.call(process, d);
95
+ };
96
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
97
+ }
98
+ var chdir;
99
+ module.exports = patch;
100
+ function patch(fs2) {
101
+ if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
102
+ patchLchmod(fs2);
103
+ }
104
+ if (!fs2.lutimes) {
105
+ patchLutimes(fs2);
106
+ }
107
+ fs2.chown = chownFix(fs2.chown);
108
+ fs2.fchown = chownFix(fs2.fchown);
109
+ fs2.lchown = chownFix(fs2.lchown);
110
+ fs2.chmod = chmodFix(fs2.chmod);
111
+ fs2.fchmod = chmodFix(fs2.fchmod);
112
+ fs2.lchmod = chmodFix(fs2.lchmod);
113
+ fs2.chownSync = chownFixSync(fs2.chownSync);
114
+ fs2.fchownSync = chownFixSync(fs2.fchownSync);
115
+ fs2.lchownSync = chownFixSync(fs2.lchownSync);
116
+ fs2.chmodSync = chmodFixSync(fs2.chmodSync);
117
+ fs2.fchmodSync = chmodFixSync(fs2.fchmodSync);
118
+ fs2.lchmodSync = chmodFixSync(fs2.lchmodSync);
119
+ fs2.stat = statFix(fs2.stat);
120
+ fs2.fstat = statFix(fs2.fstat);
121
+ fs2.lstat = statFix(fs2.lstat);
122
+ fs2.statSync = statFixSync(fs2.statSync);
123
+ fs2.fstatSync = statFixSync(fs2.fstatSync);
124
+ fs2.lstatSync = statFixSync(fs2.lstatSync);
125
+ if (fs2.chmod && !fs2.lchmod) {
126
+ fs2.lchmod = function(path2, mode, cb) {
127
+ if (cb) process.nextTick(cb);
128
+ };
129
+ fs2.lchmodSync = function() {
130
+ };
131
+ }
132
+ if (fs2.chown && !fs2.lchown) {
133
+ fs2.lchown = function(path2, uid, gid, cb) {
134
+ if (cb) process.nextTick(cb);
135
+ };
136
+ fs2.lchownSync = function() {
137
+ };
138
+ }
139
+ if (platform === "win32") {
140
+ fs2.rename = typeof fs2.rename !== "function" ? fs2.rename : function(fs$rename) {
141
+ function rename(from, to, cb) {
142
+ var start = Date.now();
143
+ var backoff = 0;
144
+ fs$rename(from, to, function CB(er) {
145
+ if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
146
+ setTimeout(function() {
147
+ fs2.stat(to, function(stater, st) {
148
+ if (stater && stater.code === "ENOENT")
149
+ fs$rename(from, to, CB);
150
+ else
151
+ cb(er);
152
+ });
153
+ }, backoff);
154
+ if (backoff < 100)
155
+ backoff += 10;
156
+ return;
157
+ }
158
+ if (cb) cb(er);
159
+ });
160
+ }
161
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
162
+ return rename;
163
+ }(fs2.rename);
164
+ }
165
+ fs2.read = typeof fs2.read !== "function" ? fs2.read : function(fs$read) {
166
+ function read(fd, buffer, offset, length, position, callback_) {
167
+ var callback;
168
+ if (callback_ && typeof callback_ === "function") {
169
+ var eagCounter = 0;
170
+ callback = function(er, _, __) {
171
+ if (er && er.code === "EAGAIN" && eagCounter < 10) {
172
+ eagCounter++;
173
+ return fs$read.call(fs2, fd, buffer, offset, length, position, callback);
174
+ }
175
+ callback_.apply(this, arguments);
176
+ };
177
+ }
178
+ return fs$read.call(fs2, fd, buffer, offset, length, position, callback);
179
+ }
180
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
181
+ return read;
182
+ }(fs2.read);
183
+ fs2.readSync = typeof fs2.readSync !== "function" ? fs2.readSync : /* @__PURE__ */ function(fs$readSync) {
184
+ return function(fd, buffer, offset, length, position) {
185
+ var eagCounter = 0;
186
+ while (true) {
187
+ try {
188
+ return fs$readSync.call(fs2, fd, buffer, offset, length, position);
189
+ } catch (er) {
190
+ if (er.code === "EAGAIN" && eagCounter < 10) {
191
+ eagCounter++;
192
+ continue;
193
+ }
194
+ throw er;
195
+ }
196
+ }
197
+ };
198
+ }(fs2.readSync);
199
+ function patchLchmod(fs3) {
200
+ fs3.lchmod = function(path2, mode, callback) {
201
+ fs3.open(
202
+ path2,
203
+ constants.O_WRONLY | constants.O_SYMLINK,
204
+ mode,
205
+ function(err, fd) {
206
+ if (err) {
207
+ if (callback) callback(err);
208
+ return;
209
+ }
210
+ fs3.fchmod(fd, mode, function(err2) {
211
+ fs3.close(fd, function(err22) {
212
+ if (callback) callback(err2 || err22);
213
+ });
214
+ });
215
+ }
216
+ );
217
+ };
218
+ fs3.lchmodSync = function(path2, mode) {
219
+ var fd = fs3.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode);
220
+ var threw = true;
221
+ var ret;
222
+ try {
223
+ ret = fs3.fchmodSync(fd, mode);
224
+ threw = false;
225
+ } finally {
226
+ if (threw) {
227
+ try {
228
+ fs3.closeSync(fd);
229
+ } catch (er) {
230
+ }
231
+ } else {
232
+ fs3.closeSync(fd);
233
+ }
234
+ }
235
+ return ret;
236
+ };
237
+ }
238
+ function patchLutimes(fs3) {
239
+ if (constants.hasOwnProperty("O_SYMLINK") && fs3.futimes) {
240
+ fs3.lutimes = function(path2, at, mt, cb) {
241
+ fs3.open(path2, constants.O_SYMLINK, function(er, fd) {
242
+ if (er) {
243
+ if (cb) cb(er);
244
+ return;
245
+ }
246
+ fs3.futimes(fd, at, mt, function(er2) {
247
+ fs3.close(fd, function(er22) {
248
+ if (cb) cb(er2 || er22);
249
+ });
250
+ });
251
+ });
252
+ };
253
+ fs3.lutimesSync = function(path2, at, mt) {
254
+ var fd = fs3.openSync(path2, constants.O_SYMLINK);
255
+ var ret;
256
+ var threw = true;
257
+ try {
258
+ ret = fs3.futimesSync(fd, at, mt);
259
+ threw = false;
260
+ } finally {
261
+ if (threw) {
262
+ try {
263
+ fs3.closeSync(fd);
264
+ } catch (er) {
265
+ }
266
+ } else {
267
+ fs3.closeSync(fd);
268
+ }
269
+ }
270
+ return ret;
271
+ };
272
+ } else if (fs3.futimes) {
273
+ fs3.lutimes = function(_a, _b, _c, cb) {
274
+ if (cb) process.nextTick(cb);
275
+ };
276
+ fs3.lutimesSync = function() {
277
+ };
278
+ }
279
+ }
280
+ function chmodFix(orig) {
281
+ if (!orig) return orig;
282
+ return function(target, mode, cb) {
283
+ return orig.call(fs2, target, mode, function(er) {
284
+ if (chownErOk(er)) er = null;
285
+ if (cb) cb.apply(this, arguments);
286
+ });
287
+ };
288
+ }
289
+ function chmodFixSync(orig) {
290
+ if (!orig) return orig;
291
+ return function(target, mode) {
292
+ try {
293
+ return orig.call(fs2, target, mode);
294
+ } catch (er) {
295
+ if (!chownErOk(er)) throw er;
296
+ }
297
+ };
298
+ }
299
+ function chownFix(orig) {
300
+ if (!orig) return orig;
301
+ return function(target, uid, gid, cb) {
302
+ return orig.call(fs2, target, uid, gid, function(er) {
303
+ if (chownErOk(er)) er = null;
304
+ if (cb) cb.apply(this, arguments);
305
+ });
306
+ };
307
+ }
308
+ function chownFixSync(orig) {
309
+ if (!orig) return orig;
310
+ return function(target, uid, gid) {
311
+ try {
312
+ return orig.call(fs2, target, uid, gid);
313
+ } catch (er) {
314
+ if (!chownErOk(er)) throw er;
315
+ }
316
+ };
317
+ }
318
+ function statFix(orig) {
319
+ if (!orig) return orig;
320
+ return function(target, options, cb) {
321
+ if (typeof options === "function") {
322
+ cb = options;
323
+ options = null;
324
+ }
325
+ function callback(er, stats) {
326
+ if (stats) {
327
+ if (stats.uid < 0) stats.uid += 4294967296;
328
+ if (stats.gid < 0) stats.gid += 4294967296;
329
+ }
330
+ if (cb) cb.apply(this, arguments);
331
+ }
332
+ return options ? orig.call(fs2, target, options, callback) : orig.call(fs2, target, callback);
333
+ };
334
+ }
335
+ function statFixSync(orig) {
336
+ if (!orig) return orig;
337
+ return function(target, options) {
338
+ var stats = options ? orig.call(fs2, target, options) : orig.call(fs2, target);
339
+ if (stats) {
340
+ if (stats.uid < 0) stats.uid += 4294967296;
341
+ if (stats.gid < 0) stats.gid += 4294967296;
342
+ }
343
+ return stats;
344
+ };
345
+ }
346
+ function chownErOk(er) {
347
+ if (!er)
348
+ return true;
349
+ if (er.code === "ENOSYS")
350
+ return true;
351
+ var nonroot = !process.getuid || process.getuid() !== 0;
352
+ if (nonroot) {
353
+ if (er.code === "EINVAL" || er.code === "EPERM")
354
+ return true;
355
+ }
356
+ return false;
357
+ }
358
+ }
359
+ }
360
+ });
361
+
362
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
363
+ var require_legacy_streams = __commonJS({
364
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
365
+ "use strict";
366
+ init_esm_shims();
367
+ var Stream = __require("stream").Stream;
368
+ module.exports = legacy;
369
+ function legacy(fs2) {
370
+ return {
371
+ ReadStream,
372
+ WriteStream
373
+ };
374
+ function ReadStream(path2, options) {
375
+ if (!(this instanceof ReadStream)) return new ReadStream(path2, options);
376
+ Stream.call(this);
377
+ var self = this;
378
+ this.path = path2;
379
+ this.fd = null;
380
+ this.readable = true;
381
+ this.paused = false;
382
+ this.flags = "r";
383
+ this.mode = 438;
384
+ this.bufferSize = 64 * 1024;
385
+ options = options || {};
386
+ var keys = Object.keys(options);
387
+ for (var index = 0, length = keys.length; index < length; index++) {
388
+ var key = keys[index];
389
+ this[key] = options[key];
390
+ }
391
+ if (this.encoding) this.setEncoding(this.encoding);
392
+ if (this.start !== void 0) {
393
+ if ("number" !== typeof this.start) {
394
+ throw TypeError("start must be a Number");
395
+ }
396
+ if (this.end === void 0) {
397
+ this.end = Infinity;
398
+ } else if ("number" !== typeof this.end) {
399
+ throw TypeError("end must be a Number");
400
+ }
401
+ if (this.start > this.end) {
402
+ throw new Error("start must be <= end");
403
+ }
404
+ this.pos = this.start;
405
+ }
406
+ if (this.fd !== null) {
407
+ process.nextTick(function() {
408
+ self._read();
409
+ });
410
+ return;
411
+ }
412
+ fs2.open(this.path, this.flags, this.mode, function(err, fd) {
413
+ if (err) {
414
+ self.emit("error", err);
415
+ self.readable = false;
416
+ return;
417
+ }
418
+ self.fd = fd;
419
+ self.emit("open", fd);
420
+ self._read();
421
+ });
422
+ }
423
+ function WriteStream(path2, options) {
424
+ if (!(this instanceof WriteStream)) return new WriteStream(path2, options);
425
+ Stream.call(this);
426
+ this.path = path2;
427
+ this.fd = null;
428
+ this.writable = true;
429
+ this.flags = "w";
430
+ this.encoding = "binary";
431
+ this.mode = 438;
432
+ this.bytesWritten = 0;
433
+ options = options || {};
434
+ var keys = Object.keys(options);
435
+ for (var index = 0, length = keys.length; index < length; index++) {
436
+ var key = keys[index];
437
+ this[key] = options[key];
438
+ }
439
+ if (this.start !== void 0) {
440
+ if ("number" !== typeof this.start) {
441
+ throw TypeError("start must be a Number");
442
+ }
443
+ if (this.start < 0) {
444
+ throw new Error("start must be >= zero");
445
+ }
446
+ this.pos = this.start;
447
+ }
448
+ this.busy = false;
449
+ this._queue = [];
450
+ if (this.fd === null) {
451
+ this._open = fs2.open;
452
+ this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
453
+ this.flush();
454
+ }
455
+ }
456
+ }
457
+ }
458
+ });
459
+
460
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
461
+ var require_clone = __commonJS({
462
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
463
+ "use strict";
464
+ init_esm_shims();
465
+ module.exports = clone;
466
+ var getPrototypeOf = Object.getPrototypeOf || function(obj) {
467
+ return obj.__proto__;
468
+ };
469
+ function clone(obj) {
470
+ if (obj === null || typeof obj !== "object")
471
+ return obj;
472
+ if (obj instanceof Object)
473
+ var copy = { __proto__: getPrototypeOf(obj) };
474
+ else
475
+ var copy = /* @__PURE__ */ Object.create(null);
476
+ Object.getOwnPropertyNames(obj).forEach(function(key) {
477
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
478
+ });
479
+ return copy;
480
+ }
481
+ }
482
+ });
483
+
484
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
485
+ var require_graceful_fs = __commonJS({
486
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
487
+ "use strict";
488
+ init_esm_shims();
489
+ var fs2 = __require("fs");
490
+ var polyfills = require_polyfills();
491
+ var legacy = require_legacy_streams();
492
+ var clone = require_clone();
493
+ var util = __require("util");
494
+ var gracefulQueue;
495
+ var previousSymbol;
496
+ if (typeof Symbol === "function" && typeof Symbol.for === "function") {
497
+ gracefulQueue = Symbol.for("graceful-fs.queue");
498
+ previousSymbol = Symbol.for("graceful-fs.previous");
499
+ } else {
500
+ gracefulQueue = "___graceful-fs.queue";
501
+ previousSymbol = "___graceful-fs.previous";
502
+ }
503
+ function noop() {
504
+ }
505
+ function publishQueue(context, queue2) {
506
+ Object.defineProperty(context, gracefulQueue, {
507
+ get: function() {
508
+ return queue2;
509
+ }
510
+ });
511
+ }
512
+ var debug = noop;
513
+ if (util.debuglog)
514
+ debug = util.debuglog("gfs4");
515
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
516
+ debug = function() {
517
+ var m = util.format.apply(util, arguments);
518
+ m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
519
+ console.error(m);
520
+ };
521
+ if (!fs2[gracefulQueue]) {
522
+ queue = global[gracefulQueue] || [];
523
+ publishQueue(fs2, queue);
524
+ fs2.close = function(fs$close) {
525
+ function close(fd, cb) {
526
+ return fs$close.call(fs2, fd, function(err) {
527
+ if (!err) {
528
+ resetQueue();
529
+ }
530
+ if (typeof cb === "function")
531
+ cb.apply(this, arguments);
532
+ });
533
+ }
534
+ Object.defineProperty(close, previousSymbol, {
535
+ value: fs$close
536
+ });
537
+ return close;
538
+ }(fs2.close);
539
+ fs2.closeSync = function(fs$closeSync) {
540
+ function closeSync(fd) {
541
+ fs$closeSync.apply(fs2, arguments);
542
+ resetQueue();
543
+ }
544
+ Object.defineProperty(closeSync, previousSymbol, {
545
+ value: fs$closeSync
546
+ });
547
+ return closeSync;
548
+ }(fs2.closeSync);
549
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
550
+ process.on("exit", function() {
551
+ debug(fs2[gracefulQueue]);
552
+ __require("assert").equal(fs2[gracefulQueue].length, 0);
553
+ });
554
+ }
555
+ }
556
+ var queue;
557
+ if (!global[gracefulQueue]) {
558
+ publishQueue(global, fs2[gracefulQueue]);
559
+ }
560
+ module.exports = patch(clone(fs2));
561
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs2.__patched) {
562
+ module.exports = patch(fs2);
563
+ fs2.__patched = true;
564
+ }
565
+ function patch(fs3) {
566
+ polyfills(fs3);
567
+ fs3.gracefulify = patch;
568
+ fs3.createReadStream = createReadStream;
569
+ fs3.createWriteStream = createWriteStream;
570
+ var fs$readFile = fs3.readFile;
571
+ fs3.readFile = readFile;
572
+ function readFile(path2, options, cb) {
573
+ if (typeof options === "function")
574
+ cb = options, options = null;
575
+ return go$readFile(path2, options, cb);
576
+ function go$readFile(path3, options2, cb2, startTime) {
577
+ return fs$readFile(path3, options2, function(err) {
578
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
579
+ enqueue([go$readFile, [path3, options2, cb2], err, startTime || Date.now(), Date.now()]);
580
+ else {
581
+ if (typeof cb2 === "function")
582
+ cb2.apply(this, arguments);
583
+ }
584
+ });
585
+ }
586
+ }
587
+ var fs$writeFile = fs3.writeFile;
588
+ fs3.writeFile = writeFile;
589
+ function writeFile(path2, data, options, cb) {
590
+ if (typeof options === "function")
591
+ cb = options, options = null;
592
+ return go$writeFile(path2, data, options, cb);
593
+ function go$writeFile(path3, data2, options2, cb2, startTime) {
594
+ return fs$writeFile(path3, data2, options2, function(err) {
595
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
596
+ enqueue([go$writeFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
597
+ else {
598
+ if (typeof cb2 === "function")
599
+ cb2.apply(this, arguments);
600
+ }
601
+ });
602
+ }
603
+ }
604
+ var fs$appendFile = fs3.appendFile;
605
+ if (fs$appendFile)
606
+ fs3.appendFile = appendFile;
607
+ function appendFile(path2, data, options, cb) {
608
+ if (typeof options === "function")
609
+ cb = options, options = null;
610
+ return go$appendFile(path2, data, options, cb);
611
+ function go$appendFile(path3, data2, options2, cb2, startTime) {
612
+ return fs$appendFile(path3, data2, options2, function(err) {
613
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
614
+ enqueue([go$appendFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
615
+ else {
616
+ if (typeof cb2 === "function")
617
+ cb2.apply(this, arguments);
618
+ }
619
+ });
620
+ }
621
+ }
622
+ var fs$copyFile = fs3.copyFile;
623
+ if (fs$copyFile)
624
+ fs3.copyFile = copyFile;
625
+ function copyFile(src, dest, flags, cb) {
626
+ if (typeof flags === "function") {
627
+ cb = flags;
628
+ flags = 0;
629
+ }
630
+ return go$copyFile(src, dest, flags, cb);
631
+ function go$copyFile(src2, dest2, flags2, cb2, startTime) {
632
+ return fs$copyFile(src2, dest2, flags2, function(err) {
633
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
634
+ enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
635
+ else {
636
+ if (typeof cb2 === "function")
637
+ cb2.apply(this, arguments);
638
+ }
639
+ });
640
+ }
641
+ }
642
+ var fs$readdir = fs3.readdir;
643
+ fs3.readdir = readdir;
644
+ var noReaddirOptionVersions = /^v[0-5]\./;
645
+ function readdir(path2, options, cb) {
646
+ if (typeof options === "function")
647
+ cb = options, options = null;
648
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path3, options2, cb2, startTime) {
649
+ return fs$readdir(path3, fs$readdirCallback(
650
+ path3,
651
+ options2,
652
+ cb2,
653
+ startTime
654
+ ));
655
+ } : function go$readdir2(path3, options2, cb2, startTime) {
656
+ return fs$readdir(path3, options2, fs$readdirCallback(
657
+ path3,
658
+ options2,
659
+ cb2,
660
+ startTime
661
+ ));
662
+ };
663
+ return go$readdir(path2, options, cb);
664
+ function fs$readdirCallback(path3, options2, cb2, startTime) {
665
+ return function(err, files) {
666
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
667
+ enqueue([
668
+ go$readdir,
669
+ [path3, options2, cb2],
670
+ err,
671
+ startTime || Date.now(),
672
+ Date.now()
673
+ ]);
674
+ else {
675
+ if (files && files.sort)
676
+ files.sort();
677
+ if (typeof cb2 === "function")
678
+ cb2.call(this, err, files);
679
+ }
680
+ };
681
+ }
682
+ }
683
+ if (process.version.substr(0, 4) === "v0.8") {
684
+ var legStreams = legacy(fs3);
685
+ ReadStream = legStreams.ReadStream;
686
+ WriteStream = legStreams.WriteStream;
687
+ }
688
+ var fs$ReadStream = fs3.ReadStream;
689
+ if (fs$ReadStream) {
690
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype);
691
+ ReadStream.prototype.open = ReadStream$open;
692
+ }
693
+ var fs$WriteStream = fs3.WriteStream;
694
+ if (fs$WriteStream) {
695
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype);
696
+ WriteStream.prototype.open = WriteStream$open;
697
+ }
698
+ Object.defineProperty(fs3, "ReadStream", {
699
+ get: function() {
700
+ return ReadStream;
701
+ },
702
+ set: function(val) {
703
+ ReadStream = val;
704
+ },
705
+ enumerable: true,
706
+ configurable: true
707
+ });
708
+ Object.defineProperty(fs3, "WriteStream", {
709
+ get: function() {
710
+ return WriteStream;
711
+ },
712
+ set: function(val) {
713
+ WriteStream = val;
714
+ },
715
+ enumerable: true,
716
+ configurable: true
717
+ });
718
+ var FileReadStream = ReadStream;
719
+ Object.defineProperty(fs3, "FileReadStream", {
720
+ get: function() {
721
+ return FileReadStream;
722
+ },
723
+ set: function(val) {
724
+ FileReadStream = val;
725
+ },
726
+ enumerable: true,
727
+ configurable: true
728
+ });
729
+ var FileWriteStream = WriteStream;
730
+ Object.defineProperty(fs3, "FileWriteStream", {
731
+ get: function() {
732
+ return FileWriteStream;
733
+ },
734
+ set: function(val) {
735
+ FileWriteStream = val;
736
+ },
737
+ enumerable: true,
738
+ configurable: true
739
+ });
740
+ function ReadStream(path2, options) {
741
+ if (this instanceof ReadStream)
742
+ return fs$ReadStream.apply(this, arguments), this;
743
+ else
744
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
745
+ }
746
+ function ReadStream$open() {
747
+ var that = this;
748
+ open(that.path, that.flags, that.mode, function(err, fd) {
749
+ if (err) {
750
+ if (that.autoClose)
751
+ that.destroy();
752
+ that.emit("error", err);
753
+ } else {
754
+ that.fd = fd;
755
+ that.emit("open", fd);
756
+ that.read();
757
+ }
758
+ });
759
+ }
760
+ function WriteStream(path2, options) {
761
+ if (this instanceof WriteStream)
762
+ return fs$WriteStream.apply(this, arguments), this;
763
+ else
764
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
765
+ }
766
+ function WriteStream$open() {
767
+ var that = this;
768
+ open(that.path, that.flags, that.mode, function(err, fd) {
769
+ if (err) {
770
+ that.destroy();
771
+ that.emit("error", err);
772
+ } else {
773
+ that.fd = fd;
774
+ that.emit("open", fd);
775
+ }
776
+ });
777
+ }
778
+ function createReadStream(path2, options) {
779
+ return new fs3.ReadStream(path2, options);
780
+ }
781
+ function createWriteStream(path2, options) {
782
+ return new fs3.WriteStream(path2, options);
783
+ }
784
+ var fs$open = fs3.open;
785
+ fs3.open = open;
786
+ function open(path2, flags, mode, cb) {
787
+ if (typeof mode === "function")
788
+ cb = mode, mode = null;
789
+ return go$open(path2, flags, mode, cb);
790
+ function go$open(path3, flags2, mode2, cb2, startTime) {
791
+ return fs$open(path3, flags2, mode2, function(err, fd) {
792
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
793
+ enqueue([go$open, [path3, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
794
+ else {
795
+ if (typeof cb2 === "function")
796
+ cb2.apply(this, arguments);
797
+ }
798
+ });
799
+ }
800
+ }
801
+ return fs3;
802
+ }
803
+ function enqueue(elem) {
804
+ debug("ENQUEUE", elem[0].name, elem[1]);
805
+ fs2[gracefulQueue].push(elem);
806
+ retry();
807
+ }
808
+ var retryTimer;
809
+ function resetQueue() {
810
+ var now = Date.now();
811
+ for (var i = 0; i < fs2[gracefulQueue].length; ++i) {
812
+ if (fs2[gracefulQueue][i].length > 2) {
813
+ fs2[gracefulQueue][i][3] = now;
814
+ fs2[gracefulQueue][i][4] = now;
815
+ }
816
+ }
817
+ retry();
818
+ }
819
+ function retry() {
820
+ clearTimeout(retryTimer);
821
+ retryTimer = void 0;
822
+ if (fs2[gracefulQueue].length === 0)
823
+ return;
824
+ var elem = fs2[gracefulQueue].shift();
825
+ var fn = elem[0];
826
+ var args = elem[1];
827
+ var err = elem[2];
828
+ var startTime = elem[3];
829
+ var lastTime = elem[4];
830
+ if (startTime === void 0) {
831
+ debug("RETRY", fn.name, args);
832
+ fn.apply(null, args);
833
+ } else if (Date.now() - startTime >= 6e4) {
834
+ debug("TIMEOUT", fn.name, args);
835
+ var cb = args.pop();
836
+ if (typeof cb === "function")
837
+ cb.call(null, err);
838
+ } else {
839
+ var sinceAttempt = Date.now() - lastTime;
840
+ var sinceStart = Math.max(lastTime - startTime, 1);
841
+ var desiredDelay = Math.min(sinceStart * 1.2, 100);
842
+ if (sinceAttempt >= desiredDelay) {
843
+ debug("RETRY", fn.name, args);
844
+ fn.apply(null, args.concat([startTime]));
845
+ } else {
846
+ fs2[gracefulQueue].push(elem);
847
+ }
848
+ }
849
+ if (retryTimer === void 0) {
850
+ retryTimer = setTimeout(retry, 0);
851
+ }
852
+ }
853
+ }
854
+ });
855
+
856
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js
857
+ var require_fs = __commonJS({
858
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
859
+ "use strict";
860
+ init_esm_shims();
861
+ var u = require_universalify().fromCallback;
862
+ var fs2 = require_graceful_fs();
863
+ var api = [
864
+ "access",
865
+ "appendFile",
866
+ "chmod",
867
+ "chown",
868
+ "close",
869
+ "copyFile",
870
+ "fchmod",
871
+ "fchown",
872
+ "fdatasync",
873
+ "fstat",
874
+ "fsync",
875
+ "ftruncate",
876
+ "futimes",
877
+ "lchmod",
878
+ "lchown",
879
+ "link",
880
+ "lstat",
881
+ "mkdir",
882
+ "mkdtemp",
883
+ "open",
884
+ "opendir",
885
+ "readdir",
886
+ "readFile",
887
+ "readlink",
888
+ "realpath",
889
+ "rename",
890
+ "rm",
891
+ "rmdir",
892
+ "stat",
893
+ "symlink",
894
+ "truncate",
895
+ "unlink",
896
+ "utimes",
897
+ "writeFile"
898
+ ].filter((key) => {
899
+ return typeof fs2[key] === "function";
900
+ });
901
+ Object.assign(exports, fs2);
902
+ api.forEach((method) => {
903
+ exports[method] = u(fs2[method]);
904
+ });
905
+ exports.exists = function(filename, callback) {
906
+ if (typeof callback === "function") {
907
+ return fs2.exists(filename, callback);
908
+ }
909
+ return new Promise((resolve2) => {
910
+ return fs2.exists(filename, resolve2);
911
+ });
912
+ };
913
+ exports.read = function(fd, buffer, offset, length, position, callback) {
914
+ if (typeof callback === "function") {
915
+ return fs2.read(fd, buffer, offset, length, position, callback);
916
+ }
917
+ return new Promise((resolve2, reject) => {
918
+ fs2.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
919
+ if (err) return reject(err);
920
+ resolve2({ bytesRead, buffer: buffer2 });
921
+ });
922
+ });
923
+ };
924
+ exports.write = function(fd, buffer, ...args) {
925
+ if (typeof args[args.length - 1] === "function") {
926
+ return fs2.write(fd, buffer, ...args);
927
+ }
928
+ return new Promise((resolve2, reject) => {
929
+ fs2.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
930
+ if (err) return reject(err);
931
+ resolve2({ bytesWritten, buffer: buffer2 });
932
+ });
933
+ });
934
+ };
935
+ exports.readv = function(fd, buffers, ...args) {
936
+ if (typeof args[args.length - 1] === "function") {
937
+ return fs2.readv(fd, buffers, ...args);
938
+ }
939
+ return new Promise((resolve2, reject) => {
940
+ fs2.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
941
+ if (err) return reject(err);
942
+ resolve2({ bytesRead, buffers: buffers2 });
943
+ });
944
+ });
945
+ };
946
+ exports.writev = function(fd, buffers, ...args) {
947
+ if (typeof args[args.length - 1] === "function") {
948
+ return fs2.writev(fd, buffers, ...args);
949
+ }
950
+ return new Promise((resolve2, reject) => {
951
+ fs2.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
952
+ if (err) return reject(err);
953
+ resolve2({ bytesWritten, buffers: buffers2 });
954
+ });
955
+ });
956
+ };
957
+ if (typeof fs2.realpath.native === "function") {
958
+ exports.realpath.native = u(fs2.realpath.native);
959
+ } else {
960
+ process.emitWarning(
961
+ "fs.realpath.native is not a function. Is fs being monkey-patched?",
962
+ "Warning",
963
+ "fs-extra-WARN0003"
964
+ );
965
+ }
966
+ }
967
+ });
968
+
969
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js
970
+ var require_utils = __commonJS({
971
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
972
+ "use strict";
973
+ init_esm_shims();
974
+ var path2 = __require("path");
975
+ module.exports.checkPath = function checkPath(pth) {
976
+ if (process.platform === "win32") {
977
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path2.parse(pth).root, ""));
978
+ if (pathHasInvalidWinCharacters) {
979
+ const error = new Error(`Path contains invalid characters: ${pth}`);
980
+ error.code = "EINVAL";
981
+ throw error;
982
+ }
983
+ }
984
+ };
985
+ }
986
+ });
987
+
988
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js
989
+ var require_make_dir = __commonJS({
990
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
991
+ "use strict";
992
+ init_esm_shims();
993
+ var fs2 = require_fs();
994
+ var { checkPath } = require_utils();
995
+ var getMode = (options) => {
996
+ const defaults = { mode: 511 };
997
+ if (typeof options === "number") return options;
998
+ return { ...defaults, ...options }.mode;
999
+ };
1000
+ module.exports.makeDir = async (dir, options) => {
1001
+ checkPath(dir);
1002
+ return fs2.mkdir(dir, {
1003
+ mode: getMode(options),
1004
+ recursive: true
1005
+ });
1006
+ };
1007
+ module.exports.makeDirSync = (dir, options) => {
1008
+ checkPath(dir);
1009
+ return fs2.mkdirSync(dir, {
1010
+ mode: getMode(options),
1011
+ recursive: true
1012
+ });
1013
+ };
1014
+ }
1015
+ });
1016
+
1017
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js
1018
+ var require_mkdirs = __commonJS({
1019
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
1020
+ "use strict";
1021
+ init_esm_shims();
1022
+ var u = require_universalify().fromPromise;
1023
+ var { makeDir: _makeDir, makeDirSync } = require_make_dir();
1024
+ var makeDir = u(_makeDir);
1025
+ module.exports = {
1026
+ mkdirs: makeDir,
1027
+ mkdirsSync: makeDirSync,
1028
+ // alias
1029
+ mkdirp: makeDir,
1030
+ mkdirpSync: makeDirSync,
1031
+ ensureDir: makeDir,
1032
+ ensureDirSync: makeDirSync
1033
+ };
1034
+ }
1035
+ });
1036
+
1037
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js
1038
+ var require_path_exists = __commonJS({
1039
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
1040
+ "use strict";
1041
+ init_esm_shims();
1042
+ var u = require_universalify().fromPromise;
1043
+ var fs2 = require_fs();
1044
+ function pathExists(path2) {
1045
+ return fs2.access(path2).then(() => true).catch(() => false);
1046
+ }
1047
+ module.exports = {
1048
+ pathExists: u(pathExists),
1049
+ pathExistsSync: fs2.existsSync
1050
+ };
1051
+ }
1052
+ });
1053
+
1054
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js
1055
+ var require_utimes = __commonJS({
1056
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
1057
+ "use strict";
1058
+ init_esm_shims();
1059
+ var fs2 = require_fs();
1060
+ var u = require_universalify().fromPromise;
1061
+ async function utimesMillis(path2, atime, mtime) {
1062
+ const fd = await fs2.open(path2, "r+");
1063
+ let closeErr = null;
1064
+ try {
1065
+ await fs2.futimes(fd, atime, mtime);
1066
+ } finally {
1067
+ try {
1068
+ await fs2.close(fd);
1069
+ } catch (e) {
1070
+ closeErr = e;
1071
+ }
1072
+ }
1073
+ if (closeErr) {
1074
+ throw closeErr;
1075
+ }
1076
+ }
1077
+ function utimesMillisSync(path2, atime, mtime) {
1078
+ const fd = fs2.openSync(path2, "r+");
1079
+ fs2.futimesSync(fd, atime, mtime);
1080
+ return fs2.closeSync(fd);
1081
+ }
1082
+ module.exports = {
1083
+ utimesMillis: u(utimesMillis),
1084
+ utimesMillisSync
1085
+ };
1086
+ }
1087
+ });
1088
+
1089
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js
1090
+ var require_stat = __commonJS({
1091
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
1092
+ "use strict";
1093
+ init_esm_shims();
1094
+ var fs2 = require_fs();
1095
+ var path2 = __require("path");
1096
+ var u = require_universalify().fromPromise;
1097
+ function getStats(src, dest, opts) {
1098
+ const statFunc = opts.dereference ? (file) => fs2.stat(file, { bigint: true }) : (file) => fs2.lstat(file, { bigint: true });
1099
+ return Promise.all([
1100
+ statFunc(src),
1101
+ statFunc(dest).catch((err) => {
1102
+ if (err.code === "ENOENT") return null;
1103
+ throw err;
1104
+ })
1105
+ ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
1106
+ }
1107
+ function getStatsSync(src, dest, opts) {
1108
+ let destStat;
1109
+ const statFunc = opts.dereference ? (file) => fs2.statSync(file, { bigint: true }) : (file) => fs2.lstatSync(file, { bigint: true });
1110
+ const srcStat = statFunc(src);
1111
+ try {
1112
+ destStat = statFunc(dest);
1113
+ } catch (err) {
1114
+ if (err.code === "ENOENT") return { srcStat, destStat: null };
1115
+ throw err;
1116
+ }
1117
+ return { srcStat, destStat };
1118
+ }
1119
+ async function checkPaths(src, dest, funcName, opts) {
1120
+ const { srcStat, destStat } = await getStats(src, dest, opts);
1121
+ if (destStat) {
1122
+ if (areIdentical(srcStat, destStat)) {
1123
+ const srcBaseName = path2.basename(src);
1124
+ const destBaseName = path2.basename(dest);
1125
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1126
+ return { srcStat, destStat, isChangingCase: true };
1127
+ }
1128
+ throw new Error("Source and destination must not be the same.");
1129
+ }
1130
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1131
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1132
+ }
1133
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1134
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1135
+ }
1136
+ }
1137
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1138
+ throw new Error(errMsg(src, dest, funcName));
1139
+ }
1140
+ return { srcStat, destStat };
1141
+ }
1142
+ function checkPathsSync(src, dest, funcName, opts) {
1143
+ const { srcStat, destStat } = getStatsSync(src, dest, opts);
1144
+ if (destStat) {
1145
+ if (areIdentical(srcStat, destStat)) {
1146
+ const srcBaseName = path2.basename(src);
1147
+ const destBaseName = path2.basename(dest);
1148
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1149
+ return { srcStat, destStat, isChangingCase: true };
1150
+ }
1151
+ throw new Error("Source and destination must not be the same.");
1152
+ }
1153
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1154
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1155
+ }
1156
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1157
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1158
+ }
1159
+ }
1160
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1161
+ throw new Error(errMsg(src, dest, funcName));
1162
+ }
1163
+ return { srcStat, destStat };
1164
+ }
1165
+ async function checkParentPaths(src, srcStat, dest, funcName) {
1166
+ const srcParent = path2.resolve(path2.dirname(src));
1167
+ const destParent = path2.resolve(path2.dirname(dest));
1168
+ if (destParent === srcParent || destParent === path2.parse(destParent).root) return;
1169
+ let destStat;
1170
+ try {
1171
+ destStat = await fs2.stat(destParent, { bigint: true });
1172
+ } catch (err) {
1173
+ if (err.code === "ENOENT") return;
1174
+ throw err;
1175
+ }
1176
+ if (areIdentical(srcStat, destStat)) {
1177
+ throw new Error(errMsg(src, dest, funcName));
1178
+ }
1179
+ return checkParentPaths(src, srcStat, destParent, funcName);
1180
+ }
1181
+ function checkParentPathsSync(src, srcStat, dest, funcName) {
1182
+ const srcParent = path2.resolve(path2.dirname(src));
1183
+ const destParent = path2.resolve(path2.dirname(dest));
1184
+ if (destParent === srcParent || destParent === path2.parse(destParent).root) return;
1185
+ let destStat;
1186
+ try {
1187
+ destStat = fs2.statSync(destParent, { bigint: true });
1188
+ } catch (err) {
1189
+ if (err.code === "ENOENT") return;
1190
+ throw err;
1191
+ }
1192
+ if (areIdentical(srcStat, destStat)) {
1193
+ throw new Error(errMsg(src, dest, funcName));
1194
+ }
1195
+ return checkParentPathsSync(src, srcStat, destParent, funcName);
1196
+ }
1197
+ function areIdentical(srcStat, destStat) {
1198
+ return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1199
+ }
1200
+ function isSrcSubdir(src, dest) {
1201
+ const srcArr = path2.resolve(src).split(path2.sep).filter((i) => i);
1202
+ const destArr = path2.resolve(dest).split(path2.sep).filter((i) => i);
1203
+ return srcArr.every((cur, i) => destArr[i] === cur);
1204
+ }
1205
+ function errMsg(src, dest, funcName) {
1206
+ return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
1207
+ }
1208
+ module.exports = {
1209
+ // checkPaths
1210
+ checkPaths: u(checkPaths),
1211
+ checkPathsSync,
1212
+ // checkParent
1213
+ checkParentPaths: u(checkParentPaths),
1214
+ checkParentPathsSync,
1215
+ // Misc
1216
+ isSrcSubdir,
1217
+ areIdentical
1218
+ };
1219
+ }
1220
+ });
1221
+
1222
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js
1223
+ var require_copy = __commonJS({
1224
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
1225
+ "use strict";
1226
+ init_esm_shims();
1227
+ var fs2 = require_fs();
1228
+ var path2 = __require("path");
1229
+ var { mkdirs } = require_mkdirs();
1230
+ var { pathExists } = require_path_exists();
1231
+ var { utimesMillis } = require_utimes();
1232
+ var stat = require_stat();
1233
+ async function copy(src, dest, opts = {}) {
1234
+ if (typeof opts === "function") {
1235
+ opts = { filter: opts };
1236
+ }
1237
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1238
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1239
+ if (opts.preserveTimestamps && process.arch === "ia32") {
1240
+ process.emitWarning(
1241
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1242
+ "Warning",
1243
+ "fs-extra-WARN0001"
1244
+ );
1245
+ }
1246
+ const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
1247
+ await stat.checkParentPaths(src, srcStat, dest, "copy");
1248
+ const include = await runFilter(src, dest, opts);
1249
+ if (!include) return;
1250
+ const destParent = path2.dirname(dest);
1251
+ const dirExists = await pathExists(destParent);
1252
+ if (!dirExists) {
1253
+ await mkdirs(destParent);
1254
+ }
1255
+ await getStatsAndPerformCopy(destStat, src, dest, opts);
1256
+ }
1257
+ async function runFilter(src, dest, opts) {
1258
+ if (!opts.filter) return true;
1259
+ return opts.filter(src, dest);
1260
+ }
1261
+ async function getStatsAndPerformCopy(destStat, src, dest, opts) {
1262
+ const statFn = opts.dereference ? fs2.stat : fs2.lstat;
1263
+ const srcStat = await statFn(src);
1264
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1265
+ if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
1266
+ if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
1267
+ if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
1268
+ if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1269
+ throw new Error(`Unknown file: ${src}`);
1270
+ }
1271
+ async function onFile(srcStat, destStat, src, dest, opts) {
1272
+ if (!destStat) return copyFile(srcStat, src, dest, opts);
1273
+ if (opts.overwrite) {
1274
+ await fs2.unlink(dest);
1275
+ return copyFile(srcStat, src, dest, opts);
1276
+ }
1277
+ if (opts.errorOnExist) {
1278
+ throw new Error(`'${dest}' already exists`);
1279
+ }
1280
+ }
1281
+ async function copyFile(srcStat, src, dest, opts) {
1282
+ await fs2.copyFile(src, dest);
1283
+ if (opts.preserveTimestamps) {
1284
+ if (fileIsNotWritable(srcStat.mode)) {
1285
+ await makeFileWritable(dest, srcStat.mode);
1286
+ }
1287
+ const updatedSrcStat = await fs2.stat(src);
1288
+ await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1289
+ }
1290
+ return fs2.chmod(dest, srcStat.mode);
1291
+ }
1292
+ function fileIsNotWritable(srcMode) {
1293
+ return (srcMode & 128) === 0;
1294
+ }
1295
+ function makeFileWritable(dest, srcMode) {
1296
+ return fs2.chmod(dest, srcMode | 128);
1297
+ }
1298
+ async function onDir(srcStat, destStat, src, dest, opts) {
1299
+ if (!destStat) {
1300
+ await fs2.mkdir(dest);
1301
+ }
1302
+ const items = await fs2.readdir(src);
1303
+ await Promise.all(items.map(async (item) => {
1304
+ const srcItem = path2.join(src, item);
1305
+ const destItem = path2.join(dest, item);
1306
+ const include = await runFilter(srcItem, destItem, opts);
1307
+ if (!include) return;
1308
+ const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
1309
+ return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
1310
+ }));
1311
+ if (!destStat) {
1312
+ await fs2.chmod(dest, srcStat.mode);
1313
+ }
1314
+ }
1315
+ async function onLink(destStat, src, dest, opts) {
1316
+ let resolvedSrc = await fs2.readlink(src);
1317
+ if (opts.dereference) {
1318
+ resolvedSrc = path2.resolve(process.cwd(), resolvedSrc);
1319
+ }
1320
+ if (!destStat) {
1321
+ return fs2.symlink(resolvedSrc, dest);
1322
+ }
1323
+ let resolvedDest = null;
1324
+ try {
1325
+ resolvedDest = await fs2.readlink(dest);
1326
+ } catch (e) {
1327
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs2.symlink(resolvedSrc, dest);
1328
+ throw e;
1329
+ }
1330
+ if (opts.dereference) {
1331
+ resolvedDest = path2.resolve(process.cwd(), resolvedDest);
1332
+ }
1333
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1334
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1335
+ }
1336
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1337
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1338
+ }
1339
+ await fs2.unlink(dest);
1340
+ return fs2.symlink(resolvedSrc, dest);
1341
+ }
1342
+ module.exports = copy;
1343
+ }
1344
+ });
1345
+
1346
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js
1347
+ var require_copy_sync = __commonJS({
1348
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
1349
+ "use strict";
1350
+ init_esm_shims();
1351
+ var fs2 = require_graceful_fs();
1352
+ var path2 = __require("path");
1353
+ var mkdirsSync = require_mkdirs().mkdirsSync;
1354
+ var utimesMillisSync = require_utimes().utimesMillisSync;
1355
+ var stat = require_stat();
1356
+ function copySync(src, dest, opts) {
1357
+ if (typeof opts === "function") {
1358
+ opts = { filter: opts };
1359
+ }
1360
+ opts = opts || {};
1361
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1362
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1363
+ if (opts.preserveTimestamps && process.arch === "ia32") {
1364
+ process.emitWarning(
1365
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1366
+ "Warning",
1367
+ "fs-extra-WARN0002"
1368
+ );
1369
+ }
1370
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1371
+ stat.checkParentPathsSync(src, srcStat, dest, "copy");
1372
+ if (opts.filter && !opts.filter(src, dest)) return;
1373
+ const destParent = path2.dirname(dest);
1374
+ if (!fs2.existsSync(destParent)) mkdirsSync(destParent);
1375
+ return getStats(destStat, src, dest, opts);
1376
+ }
1377
+ function getStats(destStat, src, dest, opts) {
1378
+ const statSync = opts.dereference ? fs2.statSync : fs2.lstatSync;
1379
+ const srcStat = statSync(src);
1380
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1381
+ else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
1382
+ else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
1383
+ else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
1384
+ else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1385
+ throw new Error(`Unknown file: ${src}`);
1386
+ }
1387
+ function onFile(srcStat, destStat, src, dest, opts) {
1388
+ if (!destStat) return copyFile(srcStat, src, dest, opts);
1389
+ return mayCopyFile(srcStat, src, dest, opts);
1390
+ }
1391
+ function mayCopyFile(srcStat, src, dest, opts) {
1392
+ if (opts.overwrite) {
1393
+ fs2.unlinkSync(dest);
1394
+ return copyFile(srcStat, src, dest, opts);
1395
+ } else if (opts.errorOnExist) {
1396
+ throw new Error(`'${dest}' already exists`);
1397
+ }
1398
+ }
1399
+ function copyFile(srcStat, src, dest, opts) {
1400
+ fs2.copyFileSync(src, dest);
1401
+ if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
1402
+ return setDestMode(dest, srcStat.mode);
1403
+ }
1404
+ function handleTimestamps(srcMode, src, dest) {
1405
+ if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
1406
+ return setDestTimestamps(src, dest);
1407
+ }
1408
+ function fileIsNotWritable(srcMode) {
1409
+ return (srcMode & 128) === 0;
1410
+ }
1411
+ function makeFileWritable(dest, srcMode) {
1412
+ return setDestMode(dest, srcMode | 128);
1413
+ }
1414
+ function setDestMode(dest, srcMode) {
1415
+ return fs2.chmodSync(dest, srcMode);
1416
+ }
1417
+ function setDestTimestamps(src, dest) {
1418
+ const updatedSrcStat = fs2.statSync(src);
1419
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1420
+ }
1421
+ function onDir(srcStat, destStat, src, dest, opts) {
1422
+ if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
1423
+ return copyDir(src, dest, opts);
1424
+ }
1425
+ function mkDirAndCopy(srcMode, src, dest, opts) {
1426
+ fs2.mkdirSync(dest);
1427
+ copyDir(src, dest, opts);
1428
+ return setDestMode(dest, srcMode);
1429
+ }
1430
+ function copyDir(src, dest, opts) {
1431
+ fs2.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
1432
+ }
1433
+ function copyDirItem(item, src, dest, opts) {
1434
+ const srcItem = path2.join(src, item);
1435
+ const destItem = path2.join(dest, item);
1436
+ if (opts.filter && !opts.filter(srcItem, destItem)) return;
1437
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1438
+ return getStats(destStat, srcItem, destItem, opts);
1439
+ }
1440
+ function onLink(destStat, src, dest, opts) {
1441
+ let resolvedSrc = fs2.readlinkSync(src);
1442
+ if (opts.dereference) {
1443
+ resolvedSrc = path2.resolve(process.cwd(), resolvedSrc);
1444
+ }
1445
+ if (!destStat) {
1446
+ return fs2.symlinkSync(resolvedSrc, dest);
1447
+ } else {
1448
+ let resolvedDest;
1449
+ try {
1450
+ resolvedDest = fs2.readlinkSync(dest);
1451
+ } catch (err) {
1452
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs2.symlinkSync(resolvedSrc, dest);
1453
+ throw err;
1454
+ }
1455
+ if (opts.dereference) {
1456
+ resolvedDest = path2.resolve(process.cwd(), resolvedDest);
1457
+ }
1458
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1459
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1460
+ }
1461
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1462
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1463
+ }
1464
+ return copyLink(resolvedSrc, dest);
1465
+ }
1466
+ }
1467
+ function copyLink(resolvedSrc, dest) {
1468
+ fs2.unlinkSync(dest);
1469
+ return fs2.symlinkSync(resolvedSrc, dest);
1470
+ }
1471
+ module.exports = copySync;
1472
+ }
1473
+ });
1474
+
1475
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js
1476
+ var require_copy2 = __commonJS({
1477
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
1478
+ "use strict";
1479
+ init_esm_shims();
1480
+ var u = require_universalify().fromPromise;
1481
+ module.exports = {
1482
+ copy: u(require_copy()),
1483
+ copySync: require_copy_sync()
1484
+ };
1485
+ }
1486
+ });
1487
+
1488
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js
1489
+ var require_remove = __commonJS({
1490
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
1491
+ "use strict";
1492
+ init_esm_shims();
1493
+ var fs2 = require_graceful_fs();
1494
+ var u = require_universalify().fromCallback;
1495
+ function remove(path2, callback) {
1496
+ fs2.rm(path2, { recursive: true, force: true }, callback);
1497
+ }
1498
+ function removeSync(path2) {
1499
+ fs2.rmSync(path2, { recursive: true, force: true });
1500
+ }
1501
+ module.exports = {
1502
+ remove: u(remove),
1503
+ removeSync
1504
+ };
1505
+ }
1506
+ });
1507
+
1508
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js
1509
+ var require_empty = __commonJS({
1510
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
1511
+ "use strict";
1512
+ init_esm_shims();
1513
+ var u = require_universalify().fromPromise;
1514
+ var fs2 = require_fs();
1515
+ var path2 = __require("path");
1516
+ var mkdir = require_mkdirs();
1517
+ var remove = require_remove();
1518
+ var emptyDir = u(async function emptyDir2(dir) {
1519
+ let items;
1520
+ try {
1521
+ items = await fs2.readdir(dir);
1522
+ } catch {
1523
+ return mkdir.mkdirs(dir);
1524
+ }
1525
+ return Promise.all(items.map((item) => remove.remove(path2.join(dir, item))));
1526
+ });
1527
+ function emptyDirSync(dir) {
1528
+ let items;
1529
+ try {
1530
+ items = fs2.readdirSync(dir);
1531
+ } catch {
1532
+ return mkdir.mkdirsSync(dir);
1533
+ }
1534
+ items.forEach((item) => {
1535
+ item = path2.join(dir, item);
1536
+ remove.removeSync(item);
1537
+ });
1538
+ }
1539
+ module.exports = {
1540
+ emptyDirSync,
1541
+ emptydirSync: emptyDirSync,
1542
+ emptyDir,
1543
+ emptydir: emptyDir
1544
+ };
1545
+ }
1546
+ });
1547
+
1548
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js
1549
+ var require_file = __commonJS({
1550
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
1551
+ "use strict";
1552
+ init_esm_shims();
1553
+ var u = require_universalify().fromPromise;
1554
+ var path2 = __require("path");
1555
+ var fs2 = require_fs();
1556
+ var mkdir = require_mkdirs();
1557
+ async function createFile(file) {
1558
+ let stats;
1559
+ try {
1560
+ stats = await fs2.stat(file);
1561
+ } catch {
1562
+ }
1563
+ if (stats && stats.isFile()) return;
1564
+ const dir = path2.dirname(file);
1565
+ let dirStats = null;
1566
+ try {
1567
+ dirStats = await fs2.stat(dir);
1568
+ } catch (err) {
1569
+ if (err.code === "ENOENT") {
1570
+ await mkdir.mkdirs(dir);
1571
+ await fs2.writeFile(file, "");
1572
+ return;
1573
+ } else {
1574
+ throw err;
1575
+ }
1576
+ }
1577
+ if (dirStats.isDirectory()) {
1578
+ await fs2.writeFile(file, "");
1579
+ } else {
1580
+ await fs2.readdir(dir);
1581
+ }
1582
+ }
1583
+ function createFileSync(file) {
1584
+ let stats;
1585
+ try {
1586
+ stats = fs2.statSync(file);
1587
+ } catch {
1588
+ }
1589
+ if (stats && stats.isFile()) return;
1590
+ const dir = path2.dirname(file);
1591
+ try {
1592
+ if (!fs2.statSync(dir).isDirectory()) {
1593
+ fs2.readdirSync(dir);
1594
+ }
1595
+ } catch (err) {
1596
+ if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
1597
+ else throw err;
1598
+ }
1599
+ fs2.writeFileSync(file, "");
1600
+ }
1601
+ module.exports = {
1602
+ createFile: u(createFile),
1603
+ createFileSync
1604
+ };
1605
+ }
1606
+ });
1607
+
1608
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js
1609
+ var require_link = __commonJS({
1610
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
1611
+ "use strict";
1612
+ init_esm_shims();
1613
+ var u = require_universalify().fromPromise;
1614
+ var path2 = __require("path");
1615
+ var fs2 = require_fs();
1616
+ var mkdir = require_mkdirs();
1617
+ var { pathExists } = require_path_exists();
1618
+ var { areIdentical } = require_stat();
1619
+ async function createLink(srcpath, dstpath) {
1620
+ let dstStat;
1621
+ try {
1622
+ dstStat = await fs2.lstat(dstpath);
1623
+ } catch {
1624
+ }
1625
+ let srcStat;
1626
+ try {
1627
+ srcStat = await fs2.lstat(srcpath);
1628
+ } catch (err) {
1629
+ err.message = err.message.replace("lstat", "ensureLink");
1630
+ throw err;
1631
+ }
1632
+ if (dstStat && areIdentical(srcStat, dstStat)) return;
1633
+ const dir = path2.dirname(dstpath);
1634
+ const dirExists = await pathExists(dir);
1635
+ if (!dirExists) {
1636
+ await mkdir.mkdirs(dir);
1637
+ }
1638
+ await fs2.link(srcpath, dstpath);
1639
+ }
1640
+ function createLinkSync(srcpath, dstpath) {
1641
+ let dstStat;
1642
+ try {
1643
+ dstStat = fs2.lstatSync(dstpath);
1644
+ } catch {
1645
+ }
1646
+ try {
1647
+ const srcStat = fs2.lstatSync(srcpath);
1648
+ if (dstStat && areIdentical(srcStat, dstStat)) return;
1649
+ } catch (err) {
1650
+ err.message = err.message.replace("lstat", "ensureLink");
1651
+ throw err;
1652
+ }
1653
+ const dir = path2.dirname(dstpath);
1654
+ const dirExists = fs2.existsSync(dir);
1655
+ if (dirExists) return fs2.linkSync(srcpath, dstpath);
1656
+ mkdir.mkdirsSync(dir);
1657
+ return fs2.linkSync(srcpath, dstpath);
1658
+ }
1659
+ module.exports = {
1660
+ createLink: u(createLink),
1661
+ createLinkSync
1662
+ };
1663
+ }
1664
+ });
1665
+
1666
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js
1667
+ var require_symlink_paths = __commonJS({
1668
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
1669
+ "use strict";
1670
+ init_esm_shims();
1671
+ var path2 = __require("path");
1672
+ var fs2 = require_fs();
1673
+ var { pathExists } = require_path_exists();
1674
+ var u = require_universalify().fromPromise;
1675
+ async function symlinkPaths(srcpath, dstpath) {
1676
+ if (path2.isAbsolute(srcpath)) {
1677
+ try {
1678
+ await fs2.lstat(srcpath);
1679
+ } catch (err) {
1680
+ err.message = err.message.replace("lstat", "ensureSymlink");
1681
+ throw err;
1682
+ }
1683
+ return {
1684
+ toCwd: srcpath,
1685
+ toDst: srcpath
1686
+ };
1687
+ }
1688
+ const dstdir = path2.dirname(dstpath);
1689
+ const relativeToDst = path2.join(dstdir, srcpath);
1690
+ const exists = await pathExists(relativeToDst);
1691
+ if (exists) {
1692
+ return {
1693
+ toCwd: relativeToDst,
1694
+ toDst: srcpath
1695
+ };
1696
+ }
1697
+ try {
1698
+ await fs2.lstat(srcpath);
1699
+ } catch (err) {
1700
+ err.message = err.message.replace("lstat", "ensureSymlink");
1701
+ throw err;
1702
+ }
1703
+ return {
1704
+ toCwd: srcpath,
1705
+ toDst: path2.relative(dstdir, srcpath)
1706
+ };
1707
+ }
1708
+ function symlinkPathsSync(srcpath, dstpath) {
1709
+ if (path2.isAbsolute(srcpath)) {
1710
+ const exists2 = fs2.existsSync(srcpath);
1711
+ if (!exists2) throw new Error("absolute srcpath does not exist");
1712
+ return {
1713
+ toCwd: srcpath,
1714
+ toDst: srcpath
1715
+ };
1716
+ }
1717
+ const dstdir = path2.dirname(dstpath);
1718
+ const relativeToDst = path2.join(dstdir, srcpath);
1719
+ const exists = fs2.existsSync(relativeToDst);
1720
+ if (exists) {
1721
+ return {
1722
+ toCwd: relativeToDst,
1723
+ toDst: srcpath
1724
+ };
1725
+ }
1726
+ const srcExists = fs2.existsSync(srcpath);
1727
+ if (!srcExists) throw new Error("relative srcpath does not exist");
1728
+ return {
1729
+ toCwd: srcpath,
1730
+ toDst: path2.relative(dstdir, srcpath)
1731
+ };
1732
+ }
1733
+ module.exports = {
1734
+ symlinkPaths: u(symlinkPaths),
1735
+ symlinkPathsSync
1736
+ };
1737
+ }
1738
+ });
1739
+
1740
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js
1741
+ var require_symlink_type = __commonJS({
1742
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
1743
+ "use strict";
1744
+ init_esm_shims();
1745
+ var fs2 = require_fs();
1746
+ var u = require_universalify().fromPromise;
1747
+ async function symlinkType(srcpath, type) {
1748
+ if (type) return type;
1749
+ let stats;
1750
+ try {
1751
+ stats = await fs2.lstat(srcpath);
1752
+ } catch {
1753
+ return "file";
1754
+ }
1755
+ return stats && stats.isDirectory() ? "dir" : "file";
1756
+ }
1757
+ function symlinkTypeSync(srcpath, type) {
1758
+ if (type) return type;
1759
+ let stats;
1760
+ try {
1761
+ stats = fs2.lstatSync(srcpath);
1762
+ } catch {
1763
+ return "file";
1764
+ }
1765
+ return stats && stats.isDirectory() ? "dir" : "file";
1766
+ }
1767
+ module.exports = {
1768
+ symlinkType: u(symlinkType),
1769
+ symlinkTypeSync
1770
+ };
1771
+ }
1772
+ });
1773
+
1774
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js
1775
+ var require_symlink = __commonJS({
1776
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
1777
+ "use strict";
1778
+ init_esm_shims();
1779
+ var u = require_universalify().fromPromise;
1780
+ var path2 = __require("path");
1781
+ var fs2 = require_fs();
1782
+ var { mkdirs, mkdirsSync } = require_mkdirs();
1783
+ var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
1784
+ var { symlinkType, symlinkTypeSync } = require_symlink_type();
1785
+ var { pathExists } = require_path_exists();
1786
+ var { areIdentical } = require_stat();
1787
+ async function createSymlink(srcpath, dstpath, type) {
1788
+ let stats;
1789
+ try {
1790
+ stats = await fs2.lstat(dstpath);
1791
+ } catch {
1792
+ }
1793
+ if (stats && stats.isSymbolicLink()) {
1794
+ const [srcStat, dstStat] = await Promise.all([
1795
+ fs2.stat(srcpath),
1796
+ fs2.stat(dstpath)
1797
+ ]);
1798
+ if (areIdentical(srcStat, dstStat)) return;
1799
+ }
1800
+ const relative2 = await symlinkPaths(srcpath, dstpath);
1801
+ srcpath = relative2.toDst;
1802
+ const toType = await symlinkType(relative2.toCwd, type);
1803
+ const dir = path2.dirname(dstpath);
1804
+ if (!await pathExists(dir)) {
1805
+ await mkdirs(dir);
1806
+ }
1807
+ return fs2.symlink(srcpath, dstpath, toType);
1808
+ }
1809
+ function createSymlinkSync(srcpath, dstpath, type) {
1810
+ let stats;
1811
+ try {
1812
+ stats = fs2.lstatSync(dstpath);
1813
+ } catch {
1814
+ }
1815
+ if (stats && stats.isSymbolicLink()) {
1816
+ const srcStat = fs2.statSync(srcpath);
1817
+ const dstStat = fs2.statSync(dstpath);
1818
+ if (areIdentical(srcStat, dstStat)) return;
1819
+ }
1820
+ const relative2 = symlinkPathsSync(srcpath, dstpath);
1821
+ srcpath = relative2.toDst;
1822
+ type = symlinkTypeSync(relative2.toCwd, type);
1823
+ const dir = path2.dirname(dstpath);
1824
+ const exists = fs2.existsSync(dir);
1825
+ if (exists) return fs2.symlinkSync(srcpath, dstpath, type);
1826
+ mkdirsSync(dir);
1827
+ return fs2.symlinkSync(srcpath, dstpath, type);
1828
+ }
1829
+ module.exports = {
1830
+ createSymlink: u(createSymlink),
1831
+ createSymlinkSync
1832
+ };
1833
+ }
1834
+ });
1835
+
1836
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js
1837
+ var require_ensure = __commonJS({
1838
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
1839
+ "use strict";
1840
+ init_esm_shims();
1841
+ var { createFile, createFileSync } = require_file();
1842
+ var { createLink, createLinkSync } = require_link();
1843
+ var { createSymlink, createSymlinkSync } = require_symlink();
1844
+ module.exports = {
1845
+ // file
1846
+ createFile,
1847
+ createFileSync,
1848
+ ensureFile: createFile,
1849
+ ensureFileSync: createFileSync,
1850
+ // link
1851
+ createLink,
1852
+ createLinkSync,
1853
+ ensureLink: createLink,
1854
+ ensureLinkSync: createLinkSync,
1855
+ // symlink
1856
+ createSymlink,
1857
+ createSymlinkSync,
1858
+ ensureSymlink: createSymlink,
1859
+ ensureSymlinkSync: createSymlinkSync
1860
+ };
1861
+ }
1862
+ });
1863
+
1864
+ // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
1865
+ var require_utils2 = __commonJS({
1866
+ "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
1867
+ "use strict";
1868
+ init_esm_shims();
1869
+ function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
1870
+ const EOF = finalEOL ? EOL : "";
1871
+ const str = JSON.stringify(obj, replacer, spaces);
1872
+ return str.replace(/\n/g, EOL) + EOF;
1873
+ }
1874
+ function stripBom(content) {
1875
+ if (Buffer.isBuffer(content)) content = content.toString("utf8");
1876
+ return content.replace(/^\uFEFF/, "");
1877
+ }
1878
+ module.exports = { stringify, stripBom };
1879
+ }
1880
+ });
1881
+
1882
+ // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
1883
+ var require_jsonfile = __commonJS({
1884
+ "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module) {
1885
+ "use strict";
1886
+ init_esm_shims();
1887
+ var _fs;
1888
+ try {
1889
+ _fs = require_graceful_fs();
1890
+ } catch (_) {
1891
+ _fs = __require("fs");
1892
+ }
1893
+ var universalify = require_universalify();
1894
+ var { stringify, stripBom } = require_utils2();
1895
+ async function _readFile(file, options = {}) {
1896
+ if (typeof options === "string") {
1897
+ options = { encoding: options };
1898
+ }
1899
+ const fs2 = options.fs || _fs;
1900
+ const shouldThrow = "throws" in options ? options.throws : true;
1901
+ let data = await universalify.fromCallback(fs2.readFile)(file, options);
1902
+ data = stripBom(data);
1903
+ let obj;
1904
+ try {
1905
+ obj = JSON.parse(data, options ? options.reviver : null);
1906
+ } catch (err) {
1907
+ if (shouldThrow) {
1908
+ err.message = `${file}: ${err.message}`;
1909
+ throw err;
1910
+ } else {
1911
+ return null;
1912
+ }
1913
+ }
1914
+ return obj;
1915
+ }
1916
+ var readFile = universalify.fromPromise(_readFile);
1917
+ function readFileSync(file, options = {}) {
1918
+ if (typeof options === "string") {
1919
+ options = { encoding: options };
1920
+ }
1921
+ const fs2 = options.fs || _fs;
1922
+ const shouldThrow = "throws" in options ? options.throws : true;
1923
+ try {
1924
+ let content = fs2.readFileSync(file, options);
1925
+ content = stripBom(content);
1926
+ return JSON.parse(content, options.reviver);
1927
+ } catch (err) {
1928
+ if (shouldThrow) {
1929
+ err.message = `${file}: ${err.message}`;
1930
+ throw err;
1931
+ } else {
1932
+ return null;
1933
+ }
1934
+ }
1935
+ }
1936
+ async function _writeFile(file, obj, options = {}) {
1937
+ const fs2 = options.fs || _fs;
1938
+ const str = stringify(obj, options);
1939
+ await universalify.fromCallback(fs2.writeFile)(file, str, options);
1940
+ }
1941
+ var writeFile = universalify.fromPromise(_writeFile);
1942
+ function writeFileSync(file, obj, options = {}) {
1943
+ const fs2 = options.fs || _fs;
1944
+ const str = stringify(obj, options);
1945
+ return fs2.writeFileSync(file, str, options);
1946
+ }
1947
+ var jsonfile = {
1948
+ readFile,
1949
+ readFileSync,
1950
+ writeFile,
1951
+ writeFileSync
1952
+ };
1953
+ module.exports = jsonfile;
1954
+ }
1955
+ });
1956
+
1957
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js
1958
+ var require_jsonfile2 = __commonJS({
1959
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
1960
+ "use strict";
1961
+ init_esm_shims();
1962
+ var jsonFile = require_jsonfile();
1963
+ module.exports = {
1964
+ // jsonfile exports
1965
+ readJson: jsonFile.readFile,
1966
+ readJsonSync: jsonFile.readFileSync,
1967
+ writeJson: jsonFile.writeFile,
1968
+ writeJsonSync: jsonFile.writeFileSync
1969
+ };
1970
+ }
1971
+ });
1972
+
1973
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js
1974
+ var require_output_file = __commonJS({
1975
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
1976
+ "use strict";
1977
+ init_esm_shims();
1978
+ var u = require_universalify().fromPromise;
1979
+ var fs2 = require_fs();
1980
+ var path2 = __require("path");
1981
+ var mkdir = require_mkdirs();
1982
+ var pathExists = require_path_exists().pathExists;
1983
+ async function outputFile(file, data, encoding = "utf-8") {
1984
+ const dir = path2.dirname(file);
1985
+ if (!await pathExists(dir)) {
1986
+ await mkdir.mkdirs(dir);
1987
+ }
1988
+ return fs2.writeFile(file, data, encoding);
1989
+ }
1990
+ function outputFileSync(file, ...args) {
1991
+ const dir = path2.dirname(file);
1992
+ if (!fs2.existsSync(dir)) {
1993
+ mkdir.mkdirsSync(dir);
1994
+ }
1995
+ fs2.writeFileSync(file, ...args);
1996
+ }
1997
+ module.exports = {
1998
+ outputFile: u(outputFile),
1999
+ outputFileSync
2000
+ };
2001
+ }
2002
+ });
2003
+
2004
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js
2005
+ var require_output_json = __commonJS({
2006
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
2007
+ "use strict";
2008
+ init_esm_shims();
2009
+ var { stringify } = require_utils2();
2010
+ var { outputFile } = require_output_file();
2011
+ async function outputJson(file, data, options = {}) {
2012
+ const str = stringify(data, options);
2013
+ await outputFile(file, str, options);
2014
+ }
2015
+ module.exports = outputJson;
2016
+ }
2017
+ });
2018
+
2019
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js
2020
+ var require_output_json_sync = __commonJS({
2021
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
2022
+ "use strict";
2023
+ init_esm_shims();
2024
+ var { stringify } = require_utils2();
2025
+ var { outputFileSync } = require_output_file();
2026
+ function outputJsonSync(file, data, options) {
2027
+ const str = stringify(data, options);
2028
+ outputFileSync(file, str, options);
2029
+ }
2030
+ module.exports = outputJsonSync;
2031
+ }
2032
+ });
2033
+
2034
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js
2035
+ var require_json = __commonJS({
2036
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js"(exports, module) {
2037
+ "use strict";
2038
+ init_esm_shims();
2039
+ var u = require_universalify().fromPromise;
2040
+ var jsonFile = require_jsonfile2();
2041
+ jsonFile.outputJson = u(require_output_json());
2042
+ jsonFile.outputJsonSync = require_output_json_sync();
2043
+ jsonFile.outputJSON = jsonFile.outputJson;
2044
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync;
2045
+ jsonFile.writeJSON = jsonFile.writeJson;
2046
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync;
2047
+ jsonFile.readJSON = jsonFile.readJson;
2048
+ jsonFile.readJSONSync = jsonFile.readJsonSync;
2049
+ module.exports = jsonFile;
2050
+ }
2051
+ });
2052
+
2053
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js
2054
+ var require_move = __commonJS({
2055
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module) {
2056
+ "use strict";
2057
+ init_esm_shims();
2058
+ var fs2 = require_fs();
2059
+ var path2 = __require("path");
2060
+ var { copy } = require_copy2();
2061
+ var { remove } = require_remove();
2062
+ var { mkdirp } = require_mkdirs();
2063
+ var { pathExists } = require_path_exists();
2064
+ var stat = require_stat();
2065
+ async function move(src, dest, opts = {}) {
2066
+ const overwrite = opts.overwrite || opts.clobber || false;
2067
+ const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2068
+ await stat.checkParentPaths(src, srcStat, dest, "move");
2069
+ const destParent = path2.dirname(dest);
2070
+ const parsedParentPath = path2.parse(destParent);
2071
+ if (parsedParentPath.root !== destParent) {
2072
+ await mkdirp(destParent);
2073
+ }
2074
+ return doRename(src, dest, overwrite, isChangingCase);
2075
+ }
2076
+ async function doRename(src, dest, overwrite, isChangingCase) {
2077
+ if (!isChangingCase) {
2078
+ if (overwrite) {
2079
+ await remove(dest);
2080
+ } else if (await pathExists(dest)) {
2081
+ throw new Error("dest already exists.");
2082
+ }
2083
+ }
2084
+ try {
2085
+ await fs2.rename(src, dest);
2086
+ } catch (err) {
2087
+ if (err.code !== "EXDEV") {
2088
+ throw err;
2089
+ }
2090
+ await moveAcrossDevice(src, dest, overwrite);
2091
+ }
2092
+ }
2093
+ async function moveAcrossDevice(src, dest, overwrite) {
2094
+ const opts = {
2095
+ overwrite,
2096
+ errorOnExist: true,
2097
+ preserveTimestamps: true
2098
+ };
2099
+ await copy(src, dest, opts);
2100
+ return remove(src);
2101
+ }
2102
+ module.exports = move;
2103
+ }
2104
+ });
2105
+
2106
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js
2107
+ var require_move_sync = __commonJS({
2108
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
2109
+ "use strict";
2110
+ init_esm_shims();
2111
+ var fs2 = require_graceful_fs();
2112
+ var path2 = __require("path");
2113
+ var copySync = require_copy2().copySync;
2114
+ var removeSync = require_remove().removeSync;
2115
+ var mkdirpSync = require_mkdirs().mkdirpSync;
2116
+ var stat = require_stat();
2117
+ function moveSync(src, dest, opts) {
2118
+ opts = opts || {};
2119
+ const overwrite = opts.overwrite || opts.clobber || false;
2120
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2121
+ stat.checkParentPathsSync(src, srcStat, dest, "move");
2122
+ if (!isParentRoot(dest)) mkdirpSync(path2.dirname(dest));
2123
+ return doRename(src, dest, overwrite, isChangingCase);
2124
+ }
2125
+ function isParentRoot(dest) {
2126
+ const parent = path2.dirname(dest);
2127
+ const parsedPath = path2.parse(parent);
2128
+ return parsedPath.root === parent;
2129
+ }
2130
+ function doRename(src, dest, overwrite, isChangingCase) {
2131
+ if (isChangingCase) return rename(src, dest, overwrite);
2132
+ if (overwrite) {
2133
+ removeSync(dest);
2134
+ return rename(src, dest, overwrite);
2135
+ }
2136
+ if (fs2.existsSync(dest)) throw new Error("dest already exists.");
2137
+ return rename(src, dest, overwrite);
2138
+ }
2139
+ function rename(src, dest, overwrite) {
2140
+ try {
2141
+ fs2.renameSync(src, dest);
2142
+ } catch (err) {
2143
+ if (err.code !== "EXDEV") throw err;
2144
+ return moveAcrossDevice(src, dest, overwrite);
2145
+ }
2146
+ }
2147
+ function moveAcrossDevice(src, dest, overwrite) {
2148
+ const opts = {
2149
+ overwrite,
2150
+ errorOnExist: true,
2151
+ preserveTimestamps: true
2152
+ };
2153
+ copySync(src, dest, opts);
2154
+ return removeSync(src);
2155
+ }
2156
+ module.exports = moveSync;
2157
+ }
2158
+ });
2159
+
2160
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js
2161
+ var require_move2 = __commonJS({
2162
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js"(exports, module) {
2163
+ "use strict";
2164
+ init_esm_shims();
2165
+ var u = require_universalify().fromPromise;
2166
+ module.exports = {
2167
+ move: u(require_move()),
2168
+ moveSync: require_move_sync()
2169
+ };
2170
+ }
2171
+ });
2172
+
2173
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js
2174
+ var require_lib = __commonJS({
2175
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js"(exports, module) {
2176
+ "use strict";
2177
+ init_esm_shims();
2178
+ module.exports = {
2179
+ // Export promiseified graceful-fs:
2180
+ ...require_fs(),
2181
+ // Export extra methods:
2182
+ ...require_copy2(),
2183
+ ...require_empty(),
2184
+ ...require_ensure(),
2185
+ ...require_json(),
2186
+ ...require_mkdirs(),
2187
+ ...require_move2(),
2188
+ ...require_output_file(),
2189
+ ...require_path_exists(),
2190
+ ...require_remove()
2191
+ };
2192
+ }
2193
+ });
2194
+
2195
+ // src/index.ts
2196
+ init_esm_shims();
2197
+ var import_fs_extra = __toESM(require_lib());
2198
+ import process2 from "node:process";
2199
+ import { logger } from "@weapp-tailwindcss/logger";
2200
+ import { defu as defu2, setValue } from "@weapp-tailwindcss/shared";
2201
+
2202
+ // ../../node_modules/.pnpm/pathe@2.0.0/node_modules/pathe/dist/index.mjs
2203
+ init_esm_shims();
2204
+
2205
+ // ../../node_modules/.pnpm/pathe@2.0.0/node_modules/pathe/dist/shared/pathe.DTxyUWQ9.mjs
2206
+ init_esm_shims();
2207
+ var _lazyMatch = () => {
2208
+ var __lib__ = (() => {
2209
+ var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
2210
+ for (var n in e) m(r, n, { get: e[n], enumerable: true });
2211
+ }, H = (r, e, n, t) => {
2212
+ if (typeof e == "object" || typeof e == "function") for (let a of G(e)) !T.call(r, a) && a !== n && m(r, a, { get: () => e[a], enumerable: !(t = V(e, a)) || t.enumerable });
2213
+ return r;
2214
+ }, J = (r) => H(m({}, "__esModule", { value: true }), r), w = {};
2215
+ q(w, { zeptomatch: () => re });
2216
+ var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
2217
+ const e = /* @__PURE__ */ new Map();
2218
+ return (n) => {
2219
+ const t = e.get(n);
2220
+ if (t) return t;
2221
+ const a = r(n);
2222
+ return e.set(n, a), a;
2223
+ };
2224
+ }, rr = (r, e, n = {}) => {
2225
+ const t = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
2226
+ if (v(e)(t) && t.index === r.length) return t.output;
2227
+ throw new Error(`Failed to parse at index ${t.indexMax}`);
2228
+ }, i = (r, e) => A(r) ? er(r, e) : b(r) ? tr(r, e) : nr(r, e), er = (r, e) => {
2229
+ const n = {};
2230
+ for (const t of r) {
2231
+ if (t.length !== 1) throw new Error(`Invalid character: "${t}"`);
2232
+ const a = t.charCodeAt(0);
2233
+ n[a] = true;
2234
+ }
2235
+ return (t) => {
2236
+ const a = t.index, o = t.input;
2237
+ for (; t.index < o.length && o.charCodeAt(t.index) in n; ) t.index += 1;
2238
+ const u = t.index;
2239
+ if (u > a) {
2240
+ if (!h(e) && !t.options.silent) {
2241
+ const s = t.input.slice(a, u), c = d(e) ? e(s, o, String(a)) : e;
2242
+ h(c) || t.output.push(c);
2243
+ }
2244
+ t.indexMax = Math.max(t.indexMax, t.index);
2245
+ }
2246
+ return true;
2247
+ };
2248
+ }, nr = (r, e) => {
2249
+ const n = r.source, t = r.flags.replace(/y|$/, "y"), a = new RegExp(n, t);
2250
+ return g((o) => {
2251
+ a.lastIndex = o.index;
2252
+ const u = a.exec(o.input);
2253
+ if (u) {
2254
+ if (!h(e) && !o.options.silent) {
2255
+ const s = d(e) ? e(...u, o.input, String(o.index)) : e;
2256
+ h(s) || o.output.push(s);
2257
+ }
2258
+ return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
2259
+ } else return false;
2260
+ });
2261
+ }, tr = (r, e) => (n) => {
2262
+ if (n.input.startsWith(r, n.index)) {
2263
+ if (!h(e) && !n.options.silent) {
2264
+ const a = d(e) ? e(r, n.input, String(n.index)) : e;
2265
+ h(a) || n.output.push(a);
2266
+ }
2267
+ return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
2268
+ } else return false;
2269
+ }, C = (r, e, n, t) => {
2270
+ const a = v(r);
2271
+ return g(_(M((o) => {
2272
+ let u = 0;
2273
+ for (; u < n; ) {
2274
+ const s = o.index;
2275
+ if (!a(o) || (u += 1, o.index === s)) break;
2276
+ }
2277
+ return u >= e;
2278
+ })));
2279
+ }, ar = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
2280
+ const n = r.map(v);
2281
+ return g(_(M((t) => {
2282
+ for (let a = 0, o = n.length; a < o; a++) if (!n[a](t)) return false;
2283
+ return true;
2284
+ })));
2285
+ }, l = (r, e) => {
2286
+ const n = r.map(v);
2287
+ return g(_((t) => {
2288
+ for (let a = 0, o = n.length; a < o; a++) if (n[a](t)) return true;
2289
+ return false;
2290
+ }));
2291
+ }, M = (r, e = false) => {
2292
+ const n = v(r);
2293
+ return (t) => {
2294
+ const a = t.index, o = t.output.length, u = n(t);
2295
+ return (!u || e) && (t.index = a, t.output.length !== o && (t.output.length = o)), u;
2296
+ };
2297
+ }, _ = (r, e) => {
2298
+ const n = v(r);
2299
+ return n;
2300
+ }, g = /* @__PURE__ */ (() => {
2301
+ let r = 0;
2302
+ return (e) => {
2303
+ const n = v(e), t = r += 1;
2304
+ return (a) => {
2305
+ var o;
2306
+ if (a.options.memoization === false) return n(a);
2307
+ const u = a.index, s = (o = a.cache)[t] || (o[t] = /* @__PURE__ */ new Map()), c = s.get(u);
2308
+ if (c === false) return false;
2309
+ if (W(c)) return a.index = c, true;
2310
+ if (c) return a.index = c.index, c.output?.length && a.output.push(...c.output), true;
2311
+ {
2312
+ const Z = a.output.length;
2313
+ if (n(a)) {
2314
+ const D = a.index, U = a.output.length;
2315
+ if (U > Z) {
2316
+ const ee = a.output.slice(Z, U);
2317
+ s.set(u, { index: D, output: ee });
2318
+ } else s.set(u, D);
2319
+ return true;
2320
+ } else return s.set(u, false), false;
2321
+ }
2322
+ };
2323
+ };
2324
+ })(), E = (r) => {
2325
+ let e;
2326
+ return (n) => (e || (e = v(r())), e(n));
2327
+ }, v = Y((r) => {
2328
+ if (d(r)) return Q(r) ? E(r) : r;
2329
+ if (b(r) || X(r)) return i(r);
2330
+ if (A(r)) return x(r);
2331
+ if (K(r)) return l(Object.values(r));
2332
+ throw new Error("Invalid rule");
2333
+ }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
2334
+ let e = "";
2335
+ for (; r > 0; ) {
2336
+ const n = (r - 1) % 26;
2337
+ e = P[n] + e, r = Math.floor((r - 1) / 26);
2338
+ }
2339
+ return e;
2340
+ }, z = (r) => {
2341
+ let e = 0;
2342
+ for (let n = 0, t = r.length; n < t; n++) e = e * 26 + P.indexOf(r[n]) + 1;
2343
+ return e;
2344
+ }, S = (r, e) => {
2345
+ if (e < r) return S(e, r);
2346
+ const n = [];
2347
+ for (; r <= e; ) n.push(r++);
2348
+ return n;
2349
+ }, or = (r, e, n) => S(r, e).map((t) => String(t).padStart(n, "0")), O = (r, e) => S(z(r), z(e)).map(ir), p = (r) => r, R = (r) => ur((e) => rr(e, r, { memoization: false }).join("")), ur = (r) => {
2350
+ const e = {};
2351
+ return (n) => e[n] ?? (e[n] = r(n));
2352
+ }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, t) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${t.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, ar(Ar), f(Er), wr]), Pr = i("{", "(?:"), zr = i("}", ")"), Or = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), Rr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => O(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => O(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Or, Rr, jr]), I = x([Pr, Nr, zr]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = R(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = R(Kr), Yr = Xr, $ = (r, e) => {
2353
+ const n = Array.isArray(r) ? r : [r];
2354
+ if (!n.length) return false;
2355
+ const t = n.map($.compile), a = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, a ? "/" : "");
2356
+ return t.some((s) => s.test(o));
2357
+ };
2358
+ $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
2359
+ var re = $;
2360
+ return J(w);
2361
+ })();
2362
+ return __lib__.default || __lib__;
2363
+ };
2364
+ var _match;
2365
+ var zeptomatch = (path2, pattern) => {
2366
+ if (!_match) {
2367
+ _match = _lazyMatch();
2368
+ _lazyMatch = null;
2369
+ }
2370
+ return _match(path2, pattern);
2371
+ };
2372
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
2373
+ function normalizeWindowsPath(input = "") {
2374
+ if (!input) {
2375
+ return input;
2376
+ }
2377
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
2378
+ }
2379
+ var _UNC_REGEX = /^[/\\]{2}/;
2380
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
2381
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
2382
+ var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
2383
+ var _EXTNAME_RE = /.(\.[^./]+)$/;
2384
+ var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
2385
+ var sep = "/";
2386
+ var delimiter = globalThis.process?.platform === "win32" ? ";" : ":";
2387
+ var normalize = function(path2) {
2388
+ if (path2.length === 0) {
2389
+ return ".";
2390
+ }
2391
+ path2 = normalizeWindowsPath(path2);
2392
+ const isUNCPath = path2.match(_UNC_REGEX);
2393
+ const isPathAbsolute = isAbsolute(path2);
2394
+ const trailingSeparator = path2[path2.length - 1] === "/";
2395
+ path2 = normalizeString(path2, !isPathAbsolute);
2396
+ if (path2.length === 0) {
2397
+ if (isPathAbsolute) {
2398
+ return "/";
2399
+ }
2400
+ return trailingSeparator ? "./" : ".";
2401
+ }
2402
+ if (trailingSeparator) {
2403
+ path2 += "/";
2404
+ }
2405
+ if (_DRIVE_LETTER_RE.test(path2)) {
2406
+ path2 += "/";
2407
+ }
2408
+ if (isUNCPath) {
2409
+ if (!isPathAbsolute) {
2410
+ return `//./${path2}`;
2411
+ }
2412
+ return `//${path2}`;
2413
+ }
2414
+ return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
2415
+ };
2416
+ var join = function(...segments) {
2417
+ let path2 = "";
2418
+ for (const seg of segments) {
2419
+ if (!seg) {
2420
+ continue;
2421
+ }
2422
+ if (path2.length > 0) {
2423
+ const pathTrailing = path2[path2.length - 1] === "/";
2424
+ const segLeading = seg[0] === "/";
2425
+ const both = pathTrailing && segLeading;
2426
+ if (both) {
2427
+ path2 += seg.slice(1);
2428
+ } else {
2429
+ path2 += pathTrailing || segLeading ? seg : `/${seg}`;
2430
+ }
2431
+ } else {
2432
+ path2 += seg;
2433
+ }
2434
+ }
2435
+ return normalize(path2);
2436
+ };
2437
+ function cwd() {
2438
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
2439
+ return process.cwd().replace(/\\/g, "/");
2440
+ }
2441
+ return "/";
2442
+ }
2443
+ var resolve = function(...arguments_) {
2444
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
2445
+ let resolvedPath = "";
2446
+ let resolvedAbsolute = false;
2447
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
2448
+ const path2 = index >= 0 ? arguments_[index] : cwd();
2449
+ if (!path2 || path2.length === 0) {
2450
+ continue;
2451
+ }
2452
+ resolvedPath = `${path2}/${resolvedPath}`;
2453
+ resolvedAbsolute = isAbsolute(path2);
2454
+ }
2455
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
2456
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
2457
+ return `/${resolvedPath}`;
2458
+ }
2459
+ return resolvedPath.length > 0 ? resolvedPath : ".";
2460
+ };
2461
+ function normalizeString(path2, allowAboveRoot) {
2462
+ let res = "";
2463
+ let lastSegmentLength = 0;
2464
+ let lastSlash = -1;
2465
+ let dots = 0;
2466
+ let char = null;
2467
+ for (let index = 0; index <= path2.length; ++index) {
2468
+ if (index < path2.length) {
2469
+ char = path2[index];
2470
+ } else if (char === "/") {
2471
+ break;
2472
+ } else {
2473
+ char = "/";
2474
+ }
2475
+ if (char === "/") {
2476
+ if (lastSlash === index - 1 || dots === 1) ;
2477
+ else if (dots === 2) {
2478
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
2479
+ if (res.length > 2) {
2480
+ const lastSlashIndex = res.lastIndexOf("/");
2481
+ if (lastSlashIndex === -1) {
2482
+ res = "";
2483
+ lastSegmentLength = 0;
2484
+ } else {
2485
+ res = res.slice(0, lastSlashIndex);
2486
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
2487
+ }
2488
+ lastSlash = index;
2489
+ dots = 0;
2490
+ continue;
2491
+ } else if (res.length > 0) {
2492
+ res = "";
2493
+ lastSegmentLength = 0;
2494
+ lastSlash = index;
2495
+ dots = 0;
2496
+ continue;
2497
+ }
2498
+ }
2499
+ if (allowAboveRoot) {
2500
+ res += res.length > 0 ? "/.." : "..";
2501
+ lastSegmentLength = 2;
2502
+ }
2503
+ } else {
2504
+ if (res.length > 0) {
2505
+ res += `/${path2.slice(lastSlash + 1, index)}`;
2506
+ } else {
2507
+ res = path2.slice(lastSlash + 1, index);
2508
+ }
2509
+ lastSegmentLength = index - lastSlash - 1;
2510
+ }
2511
+ lastSlash = index;
2512
+ dots = 0;
2513
+ } else if (char === "." && dots !== -1) {
2514
+ ++dots;
2515
+ } else {
2516
+ dots = -1;
2517
+ }
2518
+ }
2519
+ return res;
2520
+ }
2521
+ var isAbsolute = function(p) {
2522
+ return _IS_ABSOLUTE_RE.test(p);
2523
+ };
2524
+ var toNamespacedPath = function(p) {
2525
+ return normalizeWindowsPath(p);
2526
+ };
2527
+ var extname = function(p) {
2528
+ const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
2529
+ return match && match[1] || "";
2530
+ };
2531
+ var relative = function(from, to) {
2532
+ const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
2533
+ const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
2534
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
2535
+ return _to.join("/");
2536
+ }
2537
+ const _fromCopy = [..._from];
2538
+ for (const segment of _fromCopy) {
2539
+ if (_to[0] !== segment) {
2540
+ break;
2541
+ }
2542
+ _from.shift();
2543
+ _to.shift();
2544
+ }
2545
+ return [..._from.map(() => ".."), ..._to].join("/");
2546
+ };
2547
+ var dirname = function(p) {
2548
+ const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
2549
+ if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
2550
+ segments[0] += "/";
2551
+ }
2552
+ return segments.join("/") || (isAbsolute(p) ? "/" : ".");
2553
+ };
2554
+ var format = function(p) {
2555
+ const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
2556
+ return normalizeWindowsPath(
2557
+ p.root ? resolve(...segments) : segments.join("/")
2558
+ );
2559
+ };
2560
+ var basename = function(p, extension) {
2561
+ const segments = normalizeWindowsPath(p).split("/");
2562
+ let lastSegment = "";
2563
+ for (let i = segments.length - 1; i >= 0; i--) {
2564
+ const val = segments[i];
2565
+ if (val) {
2566
+ lastSegment = val;
2567
+ break;
2568
+ }
2569
+ }
2570
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
2571
+ };
2572
+ var parse = function(p) {
2573
+ const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
2574
+ const base = basename(p);
2575
+ const extension = extname(base);
2576
+ return {
2577
+ root,
2578
+ dir: dirname(p),
2579
+ base,
2580
+ ext: extension,
2581
+ name: base.slice(0, base.length - extension.length)
2582
+ };
2583
+ };
2584
+ var matchesGlob = (path2, pattern) => {
2585
+ return zeptomatch(pattern, normalize(path2));
2586
+ };
2587
+ var path = {
2588
+ __proto__: null,
2589
+ basename,
2590
+ delimiter,
2591
+ dirname,
2592
+ extname,
2593
+ format,
2594
+ isAbsolute,
2595
+ join,
2596
+ matchesGlob,
2597
+ normalize,
2598
+ normalizeString,
2599
+ parse,
2600
+ relative,
2601
+ resolve,
2602
+ sep,
2603
+ toNamespacedPath
2604
+ };
2605
+
2606
+ // src/npm.ts
2607
+ init_esm_shims();
2608
+ import { defu } from "@weapp-tailwindcss/shared";
2609
+ function fetchPackage(packageName, options) {
2610
+ const opts = defu(options, {
2611
+ // 默认使用国内镜像地址
2612
+ registry: "https://registry.npmmirror.com"
2613
+ });
2614
+ return import("npm-registry-fetch").then(({ json }) => {
2615
+ return json(`/${packageName}`, opts);
2616
+ });
2617
+ }
2618
+ async function getLatestVersionInRange(packageName, versionRange, options) {
2619
+ const response = await fetchPackage(packageName, options);
2620
+ const versions = Object.keys(response.versions);
2621
+ const filteredVersions = versions.filter((version) => version.startsWith(versionRange));
2622
+ return filteredVersions[filteredVersions.length - 1];
2623
+ }
2624
+ var defaultDevDeps = {
2625
+ "tailwindcss": "3",
2626
+ "postcss": "8",
2627
+ "autoprefixer": "10",
2628
+ "weapp-tailwindcss": "3"
2629
+ };
2630
+ async function getDevDepsVersions(options) {
2631
+ return Object.fromEntries(await Promise.all(
2632
+ Object.entries(defaultDevDeps).map(
2633
+ async (x) => {
2634
+ return [x[0], `^${await getLatestVersionInRange(...x, options)}`];
2635
+ }
2636
+ )
2637
+ ));
2638
+ }
2639
+
2640
+ // src/index.ts
2641
+ async function createContext(options) {
2642
+ const { cwd: cwd2, pkgJsonBasename, postcssConfigBasename, tailwindConfigBasename, fetchOptions } = options;
2643
+ const pkgJsonPath = path.resolve(cwd2, pkgJsonBasename);
2644
+ if (await import_fs_extra.default.exists(pkgJsonPath)) {
2645
+ const pkgJson = await import_fs_extra.default.readJson(pkgJsonPath);
2646
+ const versions = await getDevDepsVersions(fetchOptions);
2647
+ return {
2648
+ pkgJson,
2649
+ pkgJsonPath,
2650
+ cwd: cwd2,
2651
+ versions,
2652
+ postcssConfigBasename,
2653
+ tailwindConfigBasename,
2654
+ get type() {
2655
+ return pkgJson.type;
2656
+ }
2657
+ };
2658
+ } else {
2659
+ logger.warn("\u5F53\u524D\u76EE\u5F55\u4E0B\u4E0D\u5B58\u5728 `package.json` \u6587\u4EF6\uFF0C\u521D\u59CB\u5316\u811A\u672C\u5C06\u88AB\u8DF3\u8FC7\uFF0C\u8BF7\u6267\u884C `npm init` \u6216\u624B\u52A8\u521B\u5EFA `package.json` \u540E\u91CD\u8BD5 ");
2660
+ }
2661
+ }
2662
+ async function updatePackageJson(ctx) {
2663
+ setValue(ctx.pkgJson, "scripts.postinstall", "weapp-tw patch");
2664
+ for (const [key, value] of Object.entries(ctx.versions)) {
2665
+ setValue(ctx.pkgJson, `devDependencies.${key}`, value);
2666
+ }
2667
+ await import_fs_extra.default.writeJSON(ctx.pkgJsonPath, ctx.pkgJson, { spaces: 2 });
2668
+ }
2669
+ async function touchPostcssConfig(ctx) {
2670
+ const data = `${ctx.type === "module" ? "export default " : "module.exports = "}{
2671
+ plugins: {
2672
+ tailwindcss: {},
2673
+ // \u5047\u5982\u6846\u67B6\u5DF2\u7ECF\u5185\u7F6E\u4E86 \`autoprefixer\`\uFF0C\u53EF\u4EE5\u53BB\u9664\u4E0B\u4E00\u884C
2674
+ autoprefixer: {},
2675
+ },
2676
+ }
2677
+ `;
2678
+ await import_fs_extra.default.writeFile(path.resolve(ctx.cwd, ctx.postcssConfigBasename), data);
2679
+ }
2680
+ async function touchTailwindConfig(ctx) {
2681
+ const data = `/** @type {import('tailwindcss').Config} */
2682
+ ${ctx.type === "module" ? "export default " : "module.exports = "}{
2683
+ // \u8FD9\u91CC\u7ED9\u51FA\u4E86\u4E00\u4EFD uni-app /taro \u901A\u7528\u793A\u4F8B\uFF0C\u5177\u4F53\u8981\u6839\u636E\u4F60\u81EA\u5DF1\u9879\u76EE\u7684\u76EE\u5F55\u7ED3\u6784\u8FDB\u884C\u914D\u7F6E
2684
+ // \u4E0D\u5728 content \u5305\u62EC\u7684\u6587\u4EF6\u5185\uFF0C\u4F60\u7F16\u5199\u7684 class\uFF0C\u662F\u4E0D\u4F1A\u751F\u6210\u5BF9\u5E94\u7684css\u5DE5\u5177\u7C7B\u7684
2685
+ content: ['./public/index.html', './src/**/*.{wxml,html,js,ts,jsx,tsx,vue}'],
2686
+ // \u5176\u4ED6\u914D\u7F6E\u9879
2687
+ // ...
2688
+ corePlugins: {
2689
+ // \u5C0F\u7A0B\u5E8F\u4E0D\u9700\u8981 preflight \u548C container\uFF0C\u56E0\u4E3A\u8FD9\u4E3B\u8981\u662F\u7ED9 h5 \u7684\uFF0C\u5982\u679C\u4F60\u8981\u540C\u65F6\u5F00\u53D1\u5C0F\u7A0B\u5E8F\u548C h5 \u7AEF\uFF0C\u4F60\u5E94\u8BE5\u4F7F\u7528\u73AF\u5883\u53D8\u91CF\u6765\u63A7\u5236\u5B83
2690
+ preflight: false,
2691
+ container: false,
2692
+ },
2693
+ }
2694
+ `;
2695
+ await import_fs_extra.default.writeFile(path.resolve(ctx.cwd, ctx.tailwindConfigBasename), data);
2696
+ }
2697
+ function getInitDefaults() {
2698
+ return {
2699
+ cwd: process2.cwd(),
2700
+ postcssConfigBasename: "postcss.config.js",
2701
+ tailwindConfigBasename: "tailwind.config.js",
2702
+ pkgJsonBasename: "package.json"
2703
+ };
2704
+ }
2705
+ async function init(options) {
2706
+ const opts = defu2(options, getInitDefaults());
2707
+ const ctx = await createContext(opts);
2708
+ if (ctx) {
2709
+ await updatePackageJson(ctx);
2710
+ logger.success("`package.json` \u6587\u4EF6\u4FEE\u6539\u5B8C\u6210\uFF01");
2711
+ await touchPostcssConfig(ctx);
2712
+ logger.success("`postcss.config.js` \u6587\u4EF6\u521B\u5EFA\u5B8C\u6210\uFF01");
2713
+ await touchTailwindConfig(ctx);
2714
+ logger.success("`tailwind.config.js` \u6587\u4EF6\u521B\u5EFA\u5B8C\u6210\uFF01");
2715
+ logger.success("`weapp-tailwindcss` \u521D\u59CB\u5316\u5B8C\u6210\uFF01\u8BF7\u6839\u636E\u4F60\u81EA\u5B9A\u4E49\u7684\u9700\u6C42\uFF0C\u66F4\u6539\u5BF9\u5E94\u7684\u914D\u7F6E\u6587\u4EF6(\u6BD4\u5982 `tailwind.config.js` \u4E2D\u7684 `content` \u914D\u7F6E)");
2716
+ }
2717
+ }
2718
+ export {
2719
+ createContext,
2720
+ getInitDefaults,
2721
+ init,
2722
+ touchPostcssConfig,
2723
+ touchTailwindConfig,
2724
+ updatePackageJson
2725
+ };