@h3ravel/database 11.2.0 → 11.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +285 -225
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +164 -106
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { __commonJS, __require, __toESM } from "./chunk-qJlxXUkR.js";
|
|
2
|
+
import { access } from "fs/promises";
|
|
3
|
+
import path, { dirname, resolve } from "path";
|
|
4
|
+
import { readdirSync, statSync } from "fs";
|
|
2
5
|
import process$1 from "node:process";
|
|
3
6
|
import os from "node:os";
|
|
4
7
|
import tty from "node:tty";
|
|
5
|
-
import "path";
|
|
6
8
|
import { Migrate, MigrationCreator } from "@h3ravel/arquebus/migrations";
|
|
7
9
|
import { ConsoleCommand, ServiceProvider } from "@h3ravel/core";
|
|
8
|
-
import
|
|
9
|
-
import path from "node:path";
|
|
10
|
+
import path$1 from "node:path";
|
|
10
11
|
import { Model as Model$1, arquebus } from "@h3ravel/arquebus";
|
|
11
12
|
|
|
13
|
+
//#region ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs
|
|
14
|
+
function sync_default(start, callback) {
|
|
15
|
+
let dir = resolve(".", start);
|
|
16
|
+
let tmp;
|
|
17
|
+
if (!statSync(dir).isDirectory()) dir = dirname(dir);
|
|
18
|
+
while (true) {
|
|
19
|
+
tmp = callback(dir, readdirSync(dir));
|
|
20
|
+
if (tmp) return resolve(dir, tmp);
|
|
21
|
+
dir = dirname(tmp = dir);
|
|
22
|
+
if (tmp === dir) break;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
12
27
|
//#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
13
28
|
const ANSI_BACKGROUND_OFFSET = 10;
|
|
14
29
|
const wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
|
|
@@ -421,8 +436,8 @@ var source_default = chalk;
|
|
|
421
436
|
//#endregion
|
|
422
437
|
//#region ../../node_modules/.pnpm/p-try@2.2.0/node_modules/p-try/index.js
|
|
423
438
|
var require_p_try = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/p-try@2.2.0/node_modules/p-try/index.js": ((exports, module) => {
|
|
424
|
-
const pTry$1 = (fn, ...arguments_) => new Promise((resolve) => {
|
|
425
|
-
resolve(fn(...arguments_));
|
|
439
|
+
const pTry$1 = (fn, ...arguments_) => new Promise((resolve$1) => {
|
|
440
|
+
resolve$1(fn(...arguments_));
|
|
426
441
|
});
|
|
427
442
|
module.exports = pTry$1;
|
|
428
443
|
module.exports.default = pTry$1;
|
|
@@ -440,17 +455,17 @@ var require_p_limit = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/p-l
|
|
|
440
455
|
activeCount--;
|
|
441
456
|
if (queue$1.length > 0) queue$1.shift()();
|
|
442
457
|
};
|
|
443
|
-
const run = (fn, resolve, ...args) => {
|
|
458
|
+
const run = (fn, resolve$1, ...args) => {
|
|
444
459
|
activeCount++;
|
|
445
460
|
const result = pTry(fn, ...args);
|
|
446
|
-
resolve(result);
|
|
461
|
+
resolve$1(result);
|
|
447
462
|
result.then(next, next);
|
|
448
463
|
};
|
|
449
|
-
const enqueue$1 = (fn, resolve, ...args) => {
|
|
450
|
-
if (activeCount < concurrency) run(fn, resolve, ...args);
|
|
451
|
-
else queue$1.push(run.bind(null, fn, resolve, ...args));
|
|
464
|
+
const enqueue$1 = (fn, resolve$1, ...args) => {
|
|
465
|
+
if (activeCount < concurrency) run(fn, resolve$1, ...args);
|
|
466
|
+
else queue$1.push(run.bind(null, fn, resolve$1, ...args));
|
|
452
467
|
};
|
|
453
|
-
const generator = (fn, ...args) => new Promise((resolve) => enqueue$1(fn, resolve, ...args));
|
|
468
|
+
const generator = (fn, ...args) => new Promise((resolve$1) => enqueue$1(fn, resolve$1, ...args));
|
|
454
469
|
Object.defineProperties(generator, {
|
|
455
470
|
activeCount: { get: () => activeCount },
|
|
456
471
|
pendingCount: { get: () => queue$1.length },
|
|
@@ -503,7 +518,7 @@ var require_p_locate = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/p-
|
|
|
503
518
|
//#endregion
|
|
504
519
|
//#region ../../node_modules/.pnpm/locate-path@5.0.0/node_modules/locate-path/index.js
|
|
505
520
|
var require_locate_path = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/locate-path@5.0.0/node_modules/locate-path/index.js": ((exports, module) => {
|
|
506
|
-
const path$
|
|
521
|
+
const path$9 = __require("path");
|
|
507
522
|
const fs$5 = __require("fs");
|
|
508
523
|
const { promisify: promisify$1 } = __require("util");
|
|
509
524
|
const pLocate = require_p_locate();
|
|
@@ -529,7 +544,7 @@ var require_locate_path = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
529
544
|
const statFn = options.allowSymlinks ? fsStat : fsLStat;
|
|
530
545
|
return pLocate(paths, async (path_) => {
|
|
531
546
|
try {
|
|
532
|
-
const stat = await statFn(path$
|
|
547
|
+
const stat = await statFn(path$9.resolve(options.cwd, path_));
|
|
533
548
|
return matchType(options.type, stat);
|
|
534
549
|
} catch (_) {
|
|
535
550
|
return false;
|
|
@@ -546,7 +561,7 @@ var require_locate_path = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
546
561
|
checkType(options);
|
|
547
562
|
const statFn = options.allowSymlinks ? fs$5.statSync : fs$5.lstatSync;
|
|
548
563
|
for (const path_ of paths) try {
|
|
549
|
-
const stat = statFn(path$
|
|
564
|
+
const stat = statFn(path$9.resolve(options.cwd, path_));
|
|
550
565
|
if (matchType(options.type, stat)) return path_;
|
|
551
566
|
} catch (_) {}
|
|
552
567
|
};
|
|
@@ -558,17 +573,17 @@ var require_path_exists = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
558
573
|
const fs$4 = __require("fs");
|
|
559
574
|
const { promisify } = __require("util");
|
|
560
575
|
const pAccess = promisify(fs$4.access);
|
|
561
|
-
module.exports = async (path$
|
|
576
|
+
module.exports = async (path$10) => {
|
|
562
577
|
try {
|
|
563
|
-
await pAccess(path$
|
|
578
|
+
await pAccess(path$10);
|
|
564
579
|
return true;
|
|
565
580
|
} catch (_) {
|
|
566
581
|
return false;
|
|
567
582
|
}
|
|
568
583
|
};
|
|
569
|
-
module.exports.sync = (path$
|
|
584
|
+
module.exports.sync = (path$10) => {
|
|
570
585
|
try {
|
|
571
|
-
fs$4.accessSync(path$
|
|
586
|
+
fs$4.accessSync(path$10);
|
|
572
587
|
return true;
|
|
573
588
|
} catch (_) {
|
|
574
589
|
return false;
|
|
@@ -579,13 +594,13 @@ var require_path_exists = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
579
594
|
//#endregion
|
|
580
595
|
//#region ../../node_modules/.pnpm/find-up@4.1.0/node_modules/find-up/index.js
|
|
581
596
|
var require_find_up = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/find-up@4.1.0/node_modules/find-up/index.js": ((exports, module) => {
|
|
582
|
-
const path$
|
|
597
|
+
const path$8 = __require("path");
|
|
583
598
|
const locatePath = require_locate_path();
|
|
584
599
|
const pathExists = require_path_exists();
|
|
585
600
|
const stop = Symbol("findUp.stop");
|
|
586
601
|
module.exports = async (name, options = {}) => {
|
|
587
|
-
let directory = path$
|
|
588
|
-
const { root } = path$
|
|
602
|
+
let directory = path$8.resolve(options.cwd || "");
|
|
603
|
+
const { root } = path$8.parse(directory);
|
|
589
604
|
const paths = [].concat(name);
|
|
590
605
|
const runMatcher = async (locateOptions) => {
|
|
591
606
|
if (typeof name !== "function") return locatePath(paths, locateOptions);
|
|
@@ -599,14 +614,14 @@ var require_find_up = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fin
|
|
|
599
614
|
cwd: directory
|
|
600
615
|
});
|
|
601
616
|
if (foundPath === stop) return;
|
|
602
|
-
if (foundPath) return path$
|
|
617
|
+
if (foundPath) return path$8.resolve(directory, foundPath);
|
|
603
618
|
if (directory === root) return;
|
|
604
|
-
directory = path$
|
|
619
|
+
directory = path$8.dirname(directory);
|
|
605
620
|
}
|
|
606
621
|
};
|
|
607
622
|
module.exports.sync = (name, options = {}) => {
|
|
608
|
-
let directory = path$
|
|
609
|
-
const { root } = path$
|
|
623
|
+
let directory = path$8.resolve(options.cwd || "");
|
|
624
|
+
const { root } = path$8.parse(directory);
|
|
610
625
|
const paths = [].concat(name);
|
|
611
626
|
const runMatcher = (locateOptions) => {
|
|
612
627
|
if (typeof name !== "function") return locatePath.sync(paths, locateOptions);
|
|
@@ -620,9 +635,9 @@ var require_find_up = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fin
|
|
|
620
635
|
cwd: directory
|
|
621
636
|
});
|
|
622
637
|
if (foundPath === stop) return;
|
|
623
|
-
if (foundPath) return path$
|
|
638
|
+
if (foundPath) return path$8.resolve(directory, foundPath);
|
|
624
639
|
if (directory === root) return;
|
|
625
|
-
directory = path$
|
|
640
|
+
directory = path$8.dirname(directory);
|
|
626
641
|
}
|
|
627
642
|
};
|
|
628
643
|
module.exports.exists = pathExists;
|
|
@@ -633,17 +648,17 @@ var require_find_up = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fin
|
|
|
633
648
|
//#endregion
|
|
634
649
|
//#region ../../node_modules/.pnpm/pkg-dir@4.2.0/node_modules/pkg-dir/index.js
|
|
635
650
|
var require_pkg_dir = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/pkg-dir@4.2.0/node_modules/pkg-dir/index.js": ((exports, module) => {
|
|
636
|
-
const path$
|
|
651
|
+
const path$7 = __require("path");
|
|
637
652
|
const findUp = require_find_up();
|
|
638
653
|
const pkgDir = async (cwd$1) => {
|
|
639
654
|
const filePath = await findUp("package.json", { cwd: cwd$1 });
|
|
640
|
-
return filePath && path$
|
|
655
|
+
return filePath && path$7.dirname(filePath);
|
|
641
656
|
};
|
|
642
657
|
module.exports = pkgDir;
|
|
643
658
|
module.exports.default = pkgDir;
|
|
644
659
|
module.exports.sync = (cwd$1) => {
|
|
645
660
|
const filePath = findUp.sync("package.json", { cwd: cwd$1 });
|
|
646
|
-
return filePath && path$
|
|
661
|
+
return filePath && path$7.dirname(filePath);
|
|
647
662
|
};
|
|
648
663
|
}) });
|
|
649
664
|
|
|
@@ -1718,7 +1733,7 @@ var require_braces = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/brac
|
|
|
1718
1733
|
//#endregion
|
|
1719
1734
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
|
|
1720
1735
|
var require_constants = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js": ((exports, module) => {
|
|
1721
|
-
const path$
|
|
1736
|
+
const path$6 = __require("path");
|
|
1722
1737
|
const WIN_SLASH = "\\\\/";
|
|
1723
1738
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1724
1739
|
/**
|
|
@@ -1849,7 +1864,7 @@ var require_constants = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/p
|
|
|
1849
1864
|
CHAR_UNDERSCORE: 95,
|
|
1850
1865
|
CHAR_VERTICAL_LINE: 124,
|
|
1851
1866
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
1852
|
-
SEP: path$
|
|
1867
|
+
SEP: path$6.sep,
|
|
1853
1868
|
extglobChars(chars) {
|
|
1854
1869
|
return {
|
|
1855
1870
|
"!": {
|
|
@@ -1888,7 +1903,7 @@ var require_constants = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/p
|
|
|
1888
1903
|
//#endregion
|
|
1889
1904
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
|
|
1890
1905
|
var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js": ((exports) => {
|
|
1891
|
-
const path$
|
|
1906
|
+
const path$5 = __require("path");
|
|
1892
1907
|
const win32 = process.platform === "win32";
|
|
1893
1908
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
1894
1909
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
@@ -1908,7 +1923,7 @@ var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picom
|
|
|
1908
1923
|
};
|
|
1909
1924
|
exports.isWindows = (options) => {
|
|
1910
1925
|
if (options && typeof options.windows === "boolean") return options.windows;
|
|
1911
|
-
return win32 === true || path$
|
|
1926
|
+
return win32 === true || path$5.sep === "\\";
|
|
1912
1927
|
};
|
|
1913
1928
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
1914
1929
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -3088,7 +3103,7 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picom
|
|
|
3088
3103
|
//#endregion
|
|
3089
3104
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
|
|
3090
3105
|
var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js": ((exports, module) => {
|
|
3091
|
-
const path$
|
|
3106
|
+
const path$4 = __require("path");
|
|
3092
3107
|
const scan = require_scan();
|
|
3093
3108
|
const parse$1 = require_parse();
|
|
3094
3109
|
const utils$1 = require_utils();
|
|
@@ -3227,7 +3242,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3227
3242
|
* @api public
|
|
3228
3243
|
*/
|
|
3229
3244
|
picomatch$1.matchBase = (input, glob, options, posix = utils$1.isWindows(options)) => {
|
|
3230
|
-
return (glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options)).test(path$
|
|
3245
|
+
return (glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options)).test(path$4.basename(input));
|
|
3231
3246
|
};
|
|
3232
3247
|
/**
|
|
3233
3248
|
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
@@ -3909,13 +3924,13 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
3909
3924
|
fs$6.fstatSync = statFixSync(fs$6.fstatSync);
|
|
3910
3925
|
fs$6.lstatSync = statFixSync(fs$6.lstatSync);
|
|
3911
3926
|
if (fs$6.chmod && !fs$6.lchmod) {
|
|
3912
|
-
fs$6.lchmod = function(path$
|
|
3927
|
+
fs$6.lchmod = function(path$10, mode, cb) {
|
|
3913
3928
|
if (cb) process.nextTick(cb);
|
|
3914
3929
|
};
|
|
3915
3930
|
fs$6.lchmodSync = function() {};
|
|
3916
3931
|
}
|
|
3917
3932
|
if (fs$6.chown && !fs$6.lchown) {
|
|
3918
|
-
fs$6.lchown = function(path$
|
|
3933
|
+
fs$6.lchown = function(path$10, uid, gid, cb) {
|
|
3919
3934
|
if (cb) process.nextTick(cb);
|
|
3920
3935
|
};
|
|
3921
3936
|
fs$6.lchownSync = function() {};
|
|
@@ -3974,8 +3989,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
3974
3989
|
};
|
|
3975
3990
|
})(fs$6.readSync);
|
|
3976
3991
|
function patchLchmod(fs$7) {
|
|
3977
|
-
fs$7.lchmod = function(path$
|
|
3978
|
-
fs$7.open(path$
|
|
3992
|
+
fs$7.lchmod = function(path$10, mode, callback) {
|
|
3993
|
+
fs$7.open(path$10, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
|
|
3979
3994
|
if (err) {
|
|
3980
3995
|
if (callback) callback(err);
|
|
3981
3996
|
return;
|
|
@@ -3987,8 +4002,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
3987
4002
|
});
|
|
3988
4003
|
});
|
|
3989
4004
|
};
|
|
3990
|
-
fs$7.lchmodSync = function(path$
|
|
3991
|
-
var fd = fs$7.openSync(path$
|
|
4005
|
+
fs$7.lchmodSync = function(path$10, mode) {
|
|
4006
|
+
var fd = fs$7.openSync(path$10, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
3992
4007
|
var threw = true;
|
|
3993
4008
|
var ret;
|
|
3994
4009
|
try {
|
|
@@ -4005,8 +4020,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
4005
4020
|
}
|
|
4006
4021
|
function patchLutimes(fs$7) {
|
|
4007
4022
|
if (constants.hasOwnProperty("O_SYMLINK") && fs$7.futimes) {
|
|
4008
|
-
fs$7.lutimes = function(path$
|
|
4009
|
-
fs$7.open(path$
|
|
4023
|
+
fs$7.lutimes = function(path$10, at, mt, cb) {
|
|
4024
|
+
fs$7.open(path$10, constants.O_SYMLINK, function(er, fd) {
|
|
4010
4025
|
if (er) {
|
|
4011
4026
|
if (cb) cb(er);
|
|
4012
4027
|
return;
|
|
@@ -4018,8 +4033,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
4018
4033
|
});
|
|
4019
4034
|
});
|
|
4020
4035
|
};
|
|
4021
|
-
fs$7.lutimesSync = function(path$
|
|
4022
|
-
var fd = fs$7.openSync(path$
|
|
4036
|
+
fs$7.lutimesSync = function(path$10, at, mt) {
|
|
4037
|
+
var fd = fs$7.openSync(path$10, constants.O_SYMLINK);
|
|
4023
4038
|
var ret;
|
|
4024
4039
|
var threw = true;
|
|
4025
4040
|
try {
|
|
@@ -4127,11 +4142,11 @@ var require_legacy_streams = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
4127
4142
|
ReadStream,
|
|
4128
4143
|
WriteStream
|
|
4129
4144
|
};
|
|
4130
|
-
function ReadStream(path$
|
|
4131
|
-
if (!(this instanceof ReadStream)) return new ReadStream(path$
|
|
4145
|
+
function ReadStream(path$10, options) {
|
|
4146
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path$10, options);
|
|
4132
4147
|
Stream.call(this);
|
|
4133
4148
|
var self = this;
|
|
4134
|
-
this.path = path$
|
|
4149
|
+
this.path = path$10;
|
|
4135
4150
|
this.fd = null;
|
|
4136
4151
|
this.readable = true;
|
|
4137
4152
|
this.paused = false;
|
|
@@ -4169,10 +4184,10 @@ var require_legacy_streams = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
4169
4184
|
self._read();
|
|
4170
4185
|
});
|
|
4171
4186
|
}
|
|
4172
|
-
function WriteStream(path$
|
|
4173
|
-
if (!(this instanceof WriteStream)) return new WriteStream(path$
|
|
4187
|
+
function WriteStream(path$10, options) {
|
|
4188
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path$10, options);
|
|
4174
4189
|
Stream.call(this);
|
|
4175
|
-
this.path = path$
|
|
4190
|
+
this.path = path$10;
|
|
4176
4191
|
this.fd = null;
|
|
4177
4192
|
this.writable = true;
|
|
4178
4193
|
this.flags = "w";
|
|
@@ -4296,15 +4311,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
4296
4311
|
fs$6.createWriteStream = createWriteStream;
|
|
4297
4312
|
var fs$readFile = fs$6.readFile;
|
|
4298
4313
|
fs$6.readFile = readFile;
|
|
4299
|
-
function readFile(path$
|
|
4314
|
+
function readFile(path$10, options, cb) {
|
|
4300
4315
|
if (typeof options === "function") cb = options, options = null;
|
|
4301
|
-
return go$readFile(path$
|
|
4302
|
-
function go$readFile(path$
|
|
4303
|
-
return fs$readFile(path$
|
|
4316
|
+
return go$readFile(path$10, options, cb);
|
|
4317
|
+
function go$readFile(path$11, options$1, cb$1, startTime) {
|
|
4318
|
+
return fs$readFile(path$11, options$1, function(err) {
|
|
4304
4319
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
4305
4320
|
go$readFile,
|
|
4306
4321
|
[
|
|
4307
|
-
path$
|
|
4322
|
+
path$11,
|
|
4308
4323
|
options$1,
|
|
4309
4324
|
cb$1
|
|
4310
4325
|
],
|
|
@@ -4318,15 +4333,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
4318
4333
|
}
|
|
4319
4334
|
var fs$writeFile = fs$6.writeFile;
|
|
4320
4335
|
fs$6.writeFile = writeFile;
|
|
4321
|
-
function writeFile(path$
|
|
4336
|
+
function writeFile(path$10, data, options, cb) {
|
|
4322
4337
|
if (typeof options === "function") cb = options, options = null;
|
|
4323
|
-
return go$writeFile(path$
|
|
4324
|
-
function go$writeFile(path$
|
|
4325
|
-
return fs$writeFile(path$
|
|
4338
|
+
return go$writeFile(path$10, data, options, cb);
|
|
4339
|
+
function go$writeFile(path$11, data$1, options$1, cb$1, startTime) {
|
|
4340
|
+
return fs$writeFile(path$11, data$1, options$1, function(err) {
|
|
4326
4341
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
4327
4342
|
go$writeFile,
|
|
4328
4343
|
[
|
|
4329
|
-
path$
|
|
4344
|
+
path$11,
|
|
4330
4345
|
data$1,
|
|
4331
4346
|
options$1,
|
|
4332
4347
|
cb$1
|
|
@@ -4341,15 +4356,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
4341
4356
|
}
|
|
4342
4357
|
var fs$appendFile = fs$6.appendFile;
|
|
4343
4358
|
if (fs$appendFile) fs$6.appendFile = appendFile;
|
|
4344
|
-
function appendFile(path$
|
|
4359
|
+
function appendFile(path$10, data, options, cb) {
|
|
4345
4360
|
if (typeof options === "function") cb = options, options = null;
|
|
4346
|
-
return go$appendFile(path$
|
|
4347
|
-
function go$appendFile(path$
|
|
4348
|
-
return fs$appendFile(path$
|
|
4361
|
+
return go$appendFile(path$10, data, options, cb);
|
|
4362
|
+
function go$appendFile(path$11, data$1, options$1, cb$1, startTime) {
|
|
4363
|
+
return fs$appendFile(path$11, data$1, options$1, function(err) {
|
|
4349
4364
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
4350
4365
|
go$appendFile,
|
|
4351
4366
|
[
|
|
4352
|
-
path$
|
|
4367
|
+
path$11,
|
|
4353
4368
|
data$1,
|
|
4354
4369
|
options$1,
|
|
4355
4370
|
cb$1
|
|
@@ -4391,20 +4406,20 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
4391
4406
|
var fs$readdir = fs$6.readdir;
|
|
4392
4407
|
fs$6.readdir = readdir;
|
|
4393
4408
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
4394
|
-
function readdir(path$
|
|
4409
|
+
function readdir(path$10, options, cb) {
|
|
4395
4410
|
if (typeof options === "function") cb = options, options = null;
|
|
4396
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir$1(path$
|
|
4397
|
-
return fs$readdir(path$
|
|
4398
|
-
} : function go$readdir$1(path$
|
|
4399
|
-
return fs$readdir(path$
|
|
4411
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir$1(path$11, options$1, cb$1, startTime) {
|
|
4412
|
+
return fs$readdir(path$11, fs$readdirCallback(path$11, options$1, cb$1, startTime));
|
|
4413
|
+
} : function go$readdir$1(path$11, options$1, cb$1, startTime) {
|
|
4414
|
+
return fs$readdir(path$11, options$1, fs$readdirCallback(path$11, options$1, cb$1, startTime));
|
|
4400
4415
|
};
|
|
4401
|
-
return go$readdir(path$
|
|
4402
|
-
function fs$readdirCallback(path$
|
|
4416
|
+
return go$readdir(path$10, options, cb);
|
|
4417
|
+
function fs$readdirCallback(path$11, options$1, cb$1, startTime) {
|
|
4403
4418
|
return function(err, files) {
|
|
4404
4419
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
4405
4420
|
go$readdir,
|
|
4406
4421
|
[
|
|
4407
|
-
path$
|
|
4422
|
+
path$11,
|
|
4408
4423
|
options$1,
|
|
4409
4424
|
cb$1
|
|
4410
4425
|
],
|
|
@@ -4476,7 +4491,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
4476
4491
|
enumerable: true,
|
|
4477
4492
|
configurable: true
|
|
4478
4493
|
});
|
|
4479
|
-
function ReadStream(path$
|
|
4494
|
+
function ReadStream(path$10, options) {
|
|
4480
4495
|
if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this;
|
|
4481
4496
|
else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
4482
4497
|
}
|
|
@@ -4493,7 +4508,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
4493
4508
|
}
|
|
4494
4509
|
});
|
|
4495
4510
|
}
|
|
4496
|
-
function WriteStream(path$
|
|
4511
|
+
function WriteStream(path$10, options) {
|
|
4497
4512
|
if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this;
|
|
4498
4513
|
else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
4499
4514
|
}
|
|
@@ -4509,23 +4524,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
4509
4524
|
}
|
|
4510
4525
|
});
|
|
4511
4526
|
}
|
|
4512
|
-
function createReadStream(path$
|
|
4513
|
-
return new fs$6.ReadStream(path$
|
|
4527
|
+
function createReadStream(path$10, options) {
|
|
4528
|
+
return new fs$6.ReadStream(path$10, options);
|
|
4514
4529
|
}
|
|
4515
|
-
function createWriteStream(path$
|
|
4516
|
-
return new fs$6.WriteStream(path$
|
|
4530
|
+
function createWriteStream(path$10, options) {
|
|
4531
|
+
return new fs$6.WriteStream(path$10, options);
|
|
4517
4532
|
}
|
|
4518
4533
|
var fs$open = fs$6.open;
|
|
4519
4534
|
fs$6.open = open;
|
|
4520
|
-
function open(path$
|
|
4535
|
+
function open(path$10, flags, mode, cb) {
|
|
4521
4536
|
if (typeof mode === "function") cb = mode, mode = null;
|
|
4522
|
-
return go$open(path$
|
|
4523
|
-
function go$open(path$
|
|
4524
|
-
return fs$open(path$
|
|
4537
|
+
return go$open(path$10, flags, mode, cb);
|
|
4538
|
+
function go$open(path$11, flags$1, mode$1, cb$1, startTime) {
|
|
4539
|
+
return fs$open(path$11, flags$1, mode$1, function(err, fd) {
|
|
4525
4540
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
4526
4541
|
go$open,
|
|
4527
4542
|
[
|
|
4528
|
-
path$
|
|
4543
|
+
path$11,
|
|
4529
4544
|
flags$1,
|
|
4530
4545
|
mode$1,
|
|
4531
4546
|
cb$1
|
|
@@ -4589,20 +4604,20 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
4589
4604
|
var require_pify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/pify@4.0.1/node_modules/pify/index.js": ((exports, module) => {
|
|
4590
4605
|
const processFn = (fn, options) => function(...args) {
|
|
4591
4606
|
const P = options.promiseModule;
|
|
4592
|
-
return new P((resolve, reject) => {
|
|
4607
|
+
return new P((resolve$1, reject) => {
|
|
4593
4608
|
if (options.multiArgs) args.push((...result) => {
|
|
4594
4609
|
if (options.errorFirst) if (result[0]) reject(result);
|
|
4595
4610
|
else {
|
|
4596
4611
|
result.shift();
|
|
4597
|
-
resolve(result);
|
|
4612
|
+
resolve$1(result);
|
|
4598
4613
|
}
|
|
4599
|
-
else resolve(result);
|
|
4614
|
+
else resolve$1(result);
|
|
4600
4615
|
});
|
|
4601
4616
|
else if (options.errorFirst) args.push((error, result) => {
|
|
4602
4617
|
if (error) reject(error);
|
|
4603
|
-
else resolve(result);
|
|
4618
|
+
else resolve$1(result);
|
|
4604
4619
|
});
|
|
4605
|
-
else args.push(resolve);
|
|
4620
|
+
else args.push(resolve$1);
|
|
4606
4621
|
fn.apply(this, args);
|
|
4607
4622
|
});
|
|
4608
4623
|
};
|
|
@@ -12211,19 +12226,19 @@ var require_load_yaml_file = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
12211
12226
|
//#endregion
|
|
12212
12227
|
//#region ../../node_modules/.pnpm/which-pm@3.0.1/node_modules/which-pm/index.js
|
|
12213
12228
|
var require_which_pm = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which-pm@3.0.1/node_modules/which-pm/index.js": ((exports, module) => {
|
|
12214
|
-
const path$
|
|
12229
|
+
const path$3 = __require("path");
|
|
12215
12230
|
const fs$1 = __require("fs");
|
|
12216
12231
|
const loadYamlFile = require_load_yaml_file();
|
|
12217
12232
|
module.exports = async function(pkgPath) {
|
|
12218
|
-
const modulesPath = path$
|
|
12219
|
-
if (fs$1.existsSync(path$
|
|
12233
|
+
const modulesPath = path$3.join(pkgPath, "node_modules");
|
|
12234
|
+
if (fs$1.existsSync(path$3.join(modulesPath, ".yarn-integrity"))) return { name: "yarn" };
|
|
12220
12235
|
try {
|
|
12221
|
-
const modules = await loadYamlFile(path$
|
|
12236
|
+
const modules = await loadYamlFile(path$3.join(modulesPath, ".modules.yaml"));
|
|
12222
12237
|
return toNameAndVersion(modules.packageManager);
|
|
12223
12238
|
} catch (err) {
|
|
12224
12239
|
if (err.code !== "ENOENT") throw err;
|
|
12225
12240
|
}
|
|
12226
|
-
if (fs$1.existsSync(path$
|
|
12241
|
+
if (fs$1.existsSync(path$3.join(pkgPath, "bun.lockb"))) return { name: "bun" };
|
|
12227
12242
|
return fs$1.existsSync(modulesPath) ? { name: "npm" } : null;
|
|
12228
12243
|
};
|
|
12229
12244
|
function toNameAndVersion(pkgSpec) {
|
|
@@ -12247,27 +12262,27 @@ var require_which_pm = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/wh
|
|
|
12247
12262
|
var require_preferred_pm = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/preferred-pm@4.1.1/node_modules/preferred-pm/index.js": ((exports, module) => {
|
|
12248
12263
|
const findYarnWorkspaceRoot = require_find_yarn_workspace_root2();
|
|
12249
12264
|
const fs = __require("fs");
|
|
12250
|
-
const path$
|
|
12265
|
+
const path$2 = __require("path");
|
|
12251
12266
|
const whichPM = require_which_pm();
|
|
12252
12267
|
module.exports = async function preferredPM$1(pkgPath) {
|
|
12253
12268
|
if (typeof pkgPath !== "string") throw new TypeError(`pkgPath should be a string, got ${typeof pkgPath}`);
|
|
12254
|
-
if (fs.existsSync(path$
|
|
12269
|
+
if (fs.existsSync(path$2.join(pkgPath, "package-lock.json"))) return {
|
|
12255
12270
|
name: "npm",
|
|
12256
12271
|
version: ">=5"
|
|
12257
12272
|
};
|
|
12258
|
-
if (fs.existsSync(path$
|
|
12273
|
+
if (fs.existsSync(path$2.join(pkgPath, "yarn.lock"))) return {
|
|
12259
12274
|
name: "yarn",
|
|
12260
12275
|
version: "*"
|
|
12261
12276
|
};
|
|
12262
|
-
if (fs.existsSync(path$
|
|
12277
|
+
if (fs.existsSync(path$2.join(pkgPath, "pnpm-lock.yaml"))) return {
|
|
12263
12278
|
name: "pnpm",
|
|
12264
12279
|
version: ">=3"
|
|
12265
12280
|
};
|
|
12266
|
-
if (fs.existsSync(path$
|
|
12281
|
+
if (fs.existsSync(path$2.join(pkgPath, "shrinkwrap.yaml"))) return {
|
|
12267
12282
|
name: "pnpm",
|
|
12268
12283
|
version: "1 || 2"
|
|
12269
12284
|
};
|
|
12270
|
-
if (fs.existsSync(path$
|
|
12285
|
+
if (fs.existsSync(path$2.join(pkgPath, "bun.lockb")) || fs.existsSync(path$2.join(pkgPath, "bun.lock"))) return {
|
|
12271
12286
|
name: "bun",
|
|
12272
12287
|
version: "*"
|
|
12273
12288
|
};
|
|
@@ -12279,7 +12294,7 @@ var require_preferred_pm = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
12279
12294
|
try {
|
|
12280
12295
|
const workspaceRoot = findYarnWorkspaceRoot(pkgPath);
|
|
12281
12296
|
if (typeof workspaceRoot === "string") {
|
|
12282
|
-
if (fs.existsSync(path$
|
|
12297
|
+
if (fs.existsSync(path$2.join(workspaceRoot, "package-lock.json"))) return {
|
|
12283
12298
|
name: "npm",
|
|
12284
12299
|
version: ">=7"
|
|
12285
12300
|
};
|
|
@@ -12300,6 +12315,49 @@ var require_preferred_pm = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
12300
12315
|
//#endregion
|
|
12301
12316
|
//#region ../shared/dist/index.js
|
|
12302
12317
|
var import_preferred_pm = /* @__PURE__ */ __toESM(require_preferred_pm(), 1);
|
|
12318
|
+
var FileSystem = class {
|
|
12319
|
+
static findModulePkg(moduleId, cwd$1) {
|
|
12320
|
+
const parts = moduleId.replace(/\\/g, "/").split("/");
|
|
12321
|
+
let packageName = "";
|
|
12322
|
+
if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
|
|
12323
|
+
packageName += parts.shift();
|
|
12324
|
+
const packageJson = path.join(cwd$1 ?? process.cwd(), "node_modules", packageName);
|
|
12325
|
+
const resolved = this.findUpConfig(packageJson, "package", ["json"]);
|
|
12326
|
+
if (!resolved) return;
|
|
12327
|
+
return path.join(path.dirname(resolved), parts.join("/"));
|
|
12328
|
+
}
|
|
12329
|
+
/**
|
|
12330
|
+
* Check if file exists
|
|
12331
|
+
*
|
|
12332
|
+
* @param path
|
|
12333
|
+
* @returns
|
|
12334
|
+
*/
|
|
12335
|
+
static async fileExists(path$1$1) {
|
|
12336
|
+
try {
|
|
12337
|
+
await access(path$1$1);
|
|
12338
|
+
return true;
|
|
12339
|
+
} catch {
|
|
12340
|
+
return false;
|
|
12341
|
+
}
|
|
12342
|
+
}
|
|
12343
|
+
/**
|
|
12344
|
+
* Recursively find files
|
|
12345
|
+
*
|
|
12346
|
+
* @param cwd
|
|
12347
|
+
* @param name
|
|
12348
|
+
* @param extensions
|
|
12349
|
+
* @returns
|
|
12350
|
+
*/
|
|
12351
|
+
static findUpConfig(cwd$1, name, extensions) {
|
|
12352
|
+
return sync_default(cwd$1, (_dir, names) => {
|
|
12353
|
+
for (const ext of extensions) {
|
|
12354
|
+
const filename = `${name}.${ext}`;
|
|
12355
|
+
if (names.includes(filename)) return filename;
|
|
12356
|
+
}
|
|
12357
|
+
return false;
|
|
12358
|
+
});
|
|
12359
|
+
}
|
|
12360
|
+
};
|
|
12303
12361
|
var Logger = class Logger$1 {
|
|
12304
12362
|
static twoColumnLog(name, value, log = true, spacer = ".") {
|
|
12305
12363
|
const regex = /\x1b\[\d+m/g;
|
|
@@ -12577,11 +12635,11 @@ var MigrateCommand = class extends ConsoleCommand {
|
|
|
12577
12635
|
const name = this.argument("package");
|
|
12578
12636
|
try {
|
|
12579
12637
|
/** Find the requested package */
|
|
12580
|
-
const packagePath =
|
|
12638
|
+
const packagePath = FileSystem.findModulePkg(name) ?? null;
|
|
12581
12639
|
if (!packagePath) throw new Error("Package not found");
|
|
12582
12640
|
/** Get the package,json and instanciate the migration creator */
|
|
12583
|
-
const pkgJson = await import(path.join(packagePath, "package.json"));
|
|
12584
|
-
const creator = new MigrationCreator(path.join(packagePath, pkgJson.migrations ?? "migrations"));
|
|
12641
|
+
const pkgJson = await import(path$1.join(packagePath, "package.json"));
|
|
12642
|
+
const creator = new MigrationCreator(path$1.join(packagePath, pkgJson.migrations ?? "migrations"));
|
|
12585
12643
|
const info = Logger.parse([[" Publishing migrations from", "white"], [`${pkgJson.name}@${pkgJson.version}`, ["italic", "gray"]]], " ", false);
|
|
12586
12644
|
Logger.info(`INFO: ${info}`);
|
|
12587
12645
|
try {
|