drizzle-kit 0.17.4 → 0.17.5-e5944eb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/{index.js → index.mjs} +6386 -22063
  2. package/package.json +5 -7
  3. package/readme.md +22 -14
  4. package/utils.js +2573 -130
package/utils.js CHANGED
@@ -1,9 +1,13 @@
1
+ #!/usr/bin/env -S node --loader @esbuild-kit/esm-loader --no-warnings
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
7
11
  var __commonJS = (cb, mod) => function __require() {
8
12
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
13
  };
@@ -524,7 +528,7 @@ var require_hanji = __commonJS({
524
528
  }
525
529
  };
526
530
  exports.TaskTerminal = TaskTerminal;
527
- function render2(view) {
531
+ function render3(view) {
528
532
  const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
529
533
  if (view instanceof Prompt2) {
530
534
  const terminal = new Terminal(view, stdin, stdout, closable);
@@ -536,7 +540,7 @@ var require_hanji = __commonJS({
536
540
  closable.close();
537
541
  return;
538
542
  }
539
- exports.render = render2;
543
+ exports.render = render3;
540
544
  function renderWithTask(view, task) {
541
545
  return __awaiter(this, void 0, void 0, function* () {
542
546
  const terminal = new TaskTerminal(view, process.stdout);
@@ -6659,6 +6663,2345 @@ var require_lib = __commonJS({
6659
6663
  }
6660
6664
  });
6661
6665
 
6666
+ // node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js
6667
+ var require_old = __commonJS({
6668
+ "node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js"(exports) {
6669
+ var pathModule = require("path");
6670
+ var isWindows = process.platform === "win32";
6671
+ var fs = require("fs");
6672
+ var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
6673
+ function rethrow() {
6674
+ var callback;
6675
+ if (DEBUG) {
6676
+ var backtrace = new Error();
6677
+ callback = debugCallback;
6678
+ } else
6679
+ callback = missingCallback;
6680
+ return callback;
6681
+ function debugCallback(err) {
6682
+ if (err) {
6683
+ backtrace.message = err.message;
6684
+ err = backtrace;
6685
+ missingCallback(err);
6686
+ }
6687
+ }
6688
+ function missingCallback(err) {
6689
+ if (err) {
6690
+ if (process.throwDeprecation)
6691
+ throw err;
6692
+ else if (!process.noDeprecation) {
6693
+ var msg = "fs: missing callback " + (err.stack || err.message);
6694
+ if (process.traceDeprecation)
6695
+ console.trace(msg);
6696
+ else
6697
+ console.error(msg);
6698
+ }
6699
+ }
6700
+ }
6701
+ }
6702
+ function maybeCallback(cb) {
6703
+ return typeof cb === "function" ? cb : rethrow();
6704
+ }
6705
+ var normalize = pathModule.normalize;
6706
+ if (isWindows) {
6707
+ nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
6708
+ } else {
6709
+ nextPartRe = /(.*?)(?:[\/]+|$)/g;
6710
+ }
6711
+ var nextPartRe;
6712
+ if (isWindows) {
6713
+ splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
6714
+ } else {
6715
+ splitRootRe = /^[\/]*/;
6716
+ }
6717
+ var splitRootRe;
6718
+ exports.realpathSync = function realpathSync(p, cache) {
6719
+ p = pathModule.resolve(p);
6720
+ if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
6721
+ return cache[p];
6722
+ }
6723
+ var original = p, seenLinks = {}, knownHard = {};
6724
+ var pos;
6725
+ var current;
6726
+ var base;
6727
+ var previous;
6728
+ start();
6729
+ function start() {
6730
+ var m = splitRootRe.exec(p);
6731
+ pos = m[0].length;
6732
+ current = m[0];
6733
+ base = m[0];
6734
+ previous = "";
6735
+ if (isWindows && !knownHard[base]) {
6736
+ fs.lstatSync(base);
6737
+ knownHard[base] = true;
6738
+ }
6739
+ }
6740
+ while (pos < p.length) {
6741
+ nextPartRe.lastIndex = pos;
6742
+ var result = nextPartRe.exec(p);
6743
+ previous = current;
6744
+ current += result[0];
6745
+ base = previous + result[1];
6746
+ pos = nextPartRe.lastIndex;
6747
+ if (knownHard[base] || cache && cache[base] === base) {
6748
+ continue;
6749
+ }
6750
+ var resolvedLink;
6751
+ if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
6752
+ resolvedLink = cache[base];
6753
+ } else {
6754
+ var stat = fs.lstatSync(base);
6755
+ if (!stat.isSymbolicLink()) {
6756
+ knownHard[base] = true;
6757
+ if (cache)
6758
+ cache[base] = base;
6759
+ continue;
6760
+ }
6761
+ var linkTarget = null;
6762
+ if (!isWindows) {
6763
+ var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
6764
+ if (seenLinks.hasOwnProperty(id)) {
6765
+ linkTarget = seenLinks[id];
6766
+ }
6767
+ }
6768
+ if (linkTarget === null) {
6769
+ fs.statSync(base);
6770
+ linkTarget = fs.readlinkSync(base);
6771
+ }
6772
+ resolvedLink = pathModule.resolve(previous, linkTarget);
6773
+ if (cache)
6774
+ cache[base] = resolvedLink;
6775
+ if (!isWindows)
6776
+ seenLinks[id] = linkTarget;
6777
+ }
6778
+ p = pathModule.resolve(resolvedLink, p.slice(pos));
6779
+ start();
6780
+ }
6781
+ if (cache)
6782
+ cache[original] = p;
6783
+ return p;
6784
+ };
6785
+ exports.realpath = function realpath(p, cache, cb) {
6786
+ if (typeof cb !== "function") {
6787
+ cb = maybeCallback(cache);
6788
+ cache = null;
6789
+ }
6790
+ p = pathModule.resolve(p);
6791
+ if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
6792
+ return process.nextTick(cb.bind(null, null, cache[p]));
6793
+ }
6794
+ var original = p, seenLinks = {}, knownHard = {};
6795
+ var pos;
6796
+ var current;
6797
+ var base;
6798
+ var previous;
6799
+ start();
6800
+ function start() {
6801
+ var m = splitRootRe.exec(p);
6802
+ pos = m[0].length;
6803
+ current = m[0];
6804
+ base = m[0];
6805
+ previous = "";
6806
+ if (isWindows && !knownHard[base]) {
6807
+ fs.lstat(base, function(err) {
6808
+ if (err)
6809
+ return cb(err);
6810
+ knownHard[base] = true;
6811
+ LOOP();
6812
+ });
6813
+ } else {
6814
+ process.nextTick(LOOP);
6815
+ }
6816
+ }
6817
+ function LOOP() {
6818
+ if (pos >= p.length) {
6819
+ if (cache)
6820
+ cache[original] = p;
6821
+ return cb(null, p);
6822
+ }
6823
+ nextPartRe.lastIndex = pos;
6824
+ var result = nextPartRe.exec(p);
6825
+ previous = current;
6826
+ current += result[0];
6827
+ base = previous + result[1];
6828
+ pos = nextPartRe.lastIndex;
6829
+ if (knownHard[base] || cache && cache[base] === base) {
6830
+ return process.nextTick(LOOP);
6831
+ }
6832
+ if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
6833
+ return gotResolvedLink(cache[base]);
6834
+ }
6835
+ return fs.lstat(base, gotStat);
6836
+ }
6837
+ function gotStat(err, stat) {
6838
+ if (err)
6839
+ return cb(err);
6840
+ if (!stat.isSymbolicLink()) {
6841
+ knownHard[base] = true;
6842
+ if (cache)
6843
+ cache[base] = base;
6844
+ return process.nextTick(LOOP);
6845
+ }
6846
+ if (!isWindows) {
6847
+ var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
6848
+ if (seenLinks.hasOwnProperty(id)) {
6849
+ return gotTarget(null, seenLinks[id], base);
6850
+ }
6851
+ }
6852
+ fs.stat(base, function(err2) {
6853
+ if (err2)
6854
+ return cb(err2);
6855
+ fs.readlink(base, function(err3, target) {
6856
+ if (!isWindows)
6857
+ seenLinks[id] = target;
6858
+ gotTarget(err3, target);
6859
+ });
6860
+ });
6861
+ }
6862
+ function gotTarget(err, target, base2) {
6863
+ if (err)
6864
+ return cb(err);
6865
+ var resolvedLink = pathModule.resolve(previous, target);
6866
+ if (cache)
6867
+ cache[base2] = resolvedLink;
6868
+ gotResolvedLink(resolvedLink);
6869
+ }
6870
+ function gotResolvedLink(resolvedLink) {
6871
+ p = pathModule.resolve(resolvedLink, p.slice(pos));
6872
+ start();
6873
+ }
6874
+ };
6875
+ }
6876
+ });
6877
+
6878
+ // node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/index.js
6879
+ var require_fs = __commonJS({
6880
+ "node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/index.js"(exports, module2) {
6881
+ module2.exports = realpath;
6882
+ realpath.realpath = realpath;
6883
+ realpath.sync = realpathSync;
6884
+ realpath.realpathSync = realpathSync;
6885
+ realpath.monkeypatch = monkeypatch;
6886
+ realpath.unmonkeypatch = unmonkeypatch;
6887
+ var fs = require("fs");
6888
+ var origRealpath = fs.realpath;
6889
+ var origRealpathSync = fs.realpathSync;
6890
+ var version = process.version;
6891
+ var ok = /^v[0-5]\./.test(version);
6892
+ var old = require_old();
6893
+ function newError(er) {
6894
+ return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
6895
+ }
6896
+ function realpath(p, cache, cb) {
6897
+ if (ok) {
6898
+ return origRealpath(p, cache, cb);
6899
+ }
6900
+ if (typeof cache === "function") {
6901
+ cb = cache;
6902
+ cache = null;
6903
+ }
6904
+ origRealpath(p, cache, function(er, result) {
6905
+ if (newError(er)) {
6906
+ old.realpath(p, cache, cb);
6907
+ } else {
6908
+ cb(er, result);
6909
+ }
6910
+ });
6911
+ }
6912
+ function realpathSync(p, cache) {
6913
+ if (ok) {
6914
+ return origRealpathSync(p, cache);
6915
+ }
6916
+ try {
6917
+ return origRealpathSync(p, cache);
6918
+ } catch (er) {
6919
+ if (newError(er)) {
6920
+ return old.realpathSync(p, cache);
6921
+ } else {
6922
+ throw er;
6923
+ }
6924
+ }
6925
+ }
6926
+ function monkeypatch() {
6927
+ fs.realpath = realpath;
6928
+ fs.realpathSync = realpathSync;
6929
+ }
6930
+ function unmonkeypatch() {
6931
+ fs.realpath = origRealpath;
6932
+ fs.realpathSync = origRealpathSync;
6933
+ }
6934
+ }
6935
+ });
6936
+
6937
+ // node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js
6938
+ var require_path = __commonJS({
6939
+ "node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js"(exports, module2) {
6940
+ var isWindows = typeof process === "object" && process && process.platform === "win32";
6941
+ module2.exports = isWindows ? { sep: "\\" } : { sep: "/" };
6942
+ }
6943
+ });
6944
+
6945
+ // node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
6946
+ var require_balanced_match = __commonJS({
6947
+ "node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports, module2) {
6948
+ "use strict";
6949
+ module2.exports = balanced;
6950
+ function balanced(a, b, str) {
6951
+ if (a instanceof RegExp)
6952
+ a = maybeMatch(a, str);
6953
+ if (b instanceof RegExp)
6954
+ b = maybeMatch(b, str);
6955
+ var r = range(a, b, str);
6956
+ return r && {
6957
+ start: r[0],
6958
+ end: r[1],
6959
+ pre: str.slice(0, r[0]),
6960
+ body: str.slice(r[0] + a.length, r[1]),
6961
+ post: str.slice(r[1] + b.length)
6962
+ };
6963
+ }
6964
+ function maybeMatch(reg, str) {
6965
+ var m = str.match(reg);
6966
+ return m ? m[0] : null;
6967
+ }
6968
+ balanced.range = range;
6969
+ function range(a, b, str) {
6970
+ var begs, beg, left, right, result;
6971
+ var ai = str.indexOf(a);
6972
+ var bi = str.indexOf(b, ai + 1);
6973
+ var i = ai;
6974
+ if (ai >= 0 && bi > 0) {
6975
+ if (a === b) {
6976
+ return [ai, bi];
6977
+ }
6978
+ begs = [];
6979
+ left = str.length;
6980
+ while (i >= 0 && !result) {
6981
+ if (i == ai) {
6982
+ begs.push(i);
6983
+ ai = str.indexOf(a, i + 1);
6984
+ } else if (begs.length == 1) {
6985
+ result = [begs.pop(), bi];
6986
+ } else {
6987
+ beg = begs.pop();
6988
+ if (beg < left) {
6989
+ left = beg;
6990
+ right = bi;
6991
+ }
6992
+ bi = str.indexOf(b, i + 1);
6993
+ }
6994
+ i = ai < bi && ai >= 0 ? ai : bi;
6995
+ }
6996
+ if (begs.length) {
6997
+ result = [left, right];
6998
+ }
6999
+ }
7000
+ return result;
7001
+ }
7002
+ }
7003
+ });
7004
+
7005
+ // node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
7006
+ var require_brace_expansion = __commonJS({
7007
+ "node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
7008
+ var balanced = require_balanced_match();
7009
+ module2.exports = expandTop;
7010
+ var escSlash = "\0SLASH" + Math.random() + "\0";
7011
+ var escOpen = "\0OPEN" + Math.random() + "\0";
7012
+ var escClose = "\0CLOSE" + Math.random() + "\0";
7013
+ var escComma = "\0COMMA" + Math.random() + "\0";
7014
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
7015
+ function numeric(str) {
7016
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
7017
+ }
7018
+ function escapeBraces(str) {
7019
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
7020
+ }
7021
+ function unescapeBraces(str) {
7022
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
7023
+ }
7024
+ function parseCommaParts(str) {
7025
+ if (!str)
7026
+ return [""];
7027
+ var parts = [];
7028
+ var m = balanced("{", "}", str);
7029
+ if (!m)
7030
+ return str.split(",");
7031
+ var pre = m.pre;
7032
+ var body = m.body;
7033
+ var post = m.post;
7034
+ var p = pre.split(",");
7035
+ p[p.length - 1] += "{" + body + "}";
7036
+ var postParts = parseCommaParts(post);
7037
+ if (post.length) {
7038
+ p[p.length - 1] += postParts.shift();
7039
+ p.push.apply(p, postParts);
7040
+ }
7041
+ parts.push.apply(parts, p);
7042
+ return parts;
7043
+ }
7044
+ function expandTop(str) {
7045
+ if (!str)
7046
+ return [];
7047
+ if (str.substr(0, 2) === "{}") {
7048
+ str = "\\{\\}" + str.substr(2);
7049
+ }
7050
+ return expand(escapeBraces(str), true).map(unescapeBraces);
7051
+ }
7052
+ function embrace(str) {
7053
+ return "{" + str + "}";
7054
+ }
7055
+ function isPadded(el) {
7056
+ return /^-?0\d/.test(el);
7057
+ }
7058
+ function lte(i, y) {
7059
+ return i <= y;
7060
+ }
7061
+ function gte(i, y) {
7062
+ return i >= y;
7063
+ }
7064
+ function expand(str, isTop) {
7065
+ var expansions = [];
7066
+ var m = balanced("{", "}", str);
7067
+ if (!m)
7068
+ return [str];
7069
+ var pre = m.pre;
7070
+ var post = m.post.length ? expand(m.post, false) : [""];
7071
+ if (/\$$/.test(m.pre)) {
7072
+ for (var k = 0; k < post.length; k++) {
7073
+ var expansion = pre + "{" + m.body + "}" + post[k];
7074
+ expansions.push(expansion);
7075
+ }
7076
+ } else {
7077
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
7078
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
7079
+ var isSequence = isNumericSequence || isAlphaSequence;
7080
+ var isOptions = m.body.indexOf(",") >= 0;
7081
+ if (!isSequence && !isOptions) {
7082
+ if (m.post.match(/,.*\}/)) {
7083
+ str = m.pre + "{" + m.body + escClose + m.post;
7084
+ return expand(str);
7085
+ }
7086
+ return [str];
7087
+ }
7088
+ var n;
7089
+ if (isSequence) {
7090
+ n = m.body.split(/\.\./);
7091
+ } else {
7092
+ n = parseCommaParts(m.body);
7093
+ if (n.length === 1) {
7094
+ n = expand(n[0], false).map(embrace);
7095
+ if (n.length === 1) {
7096
+ return post.map(function(p) {
7097
+ return m.pre + n[0] + p;
7098
+ });
7099
+ }
7100
+ }
7101
+ }
7102
+ var N;
7103
+ if (isSequence) {
7104
+ var x = numeric(n[0]);
7105
+ var y = numeric(n[1]);
7106
+ var width = Math.max(n[0].length, n[1].length);
7107
+ var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
7108
+ var test = lte;
7109
+ var reverse = y < x;
7110
+ if (reverse) {
7111
+ incr *= -1;
7112
+ test = gte;
7113
+ }
7114
+ var pad = n.some(isPadded);
7115
+ N = [];
7116
+ for (var i = x; test(i, y); i += incr) {
7117
+ var c;
7118
+ if (isAlphaSequence) {
7119
+ c = String.fromCharCode(i);
7120
+ if (c === "\\")
7121
+ c = "";
7122
+ } else {
7123
+ c = String(i);
7124
+ if (pad) {
7125
+ var need = width - c.length;
7126
+ if (need > 0) {
7127
+ var z2 = new Array(need + 1).join("0");
7128
+ if (i < 0)
7129
+ c = "-" + z2 + c.slice(1);
7130
+ else
7131
+ c = z2 + c;
7132
+ }
7133
+ }
7134
+ }
7135
+ N.push(c);
7136
+ }
7137
+ } else {
7138
+ N = [];
7139
+ for (var j = 0; j < n.length; j++) {
7140
+ N.push.apply(N, expand(n[j], false));
7141
+ }
7142
+ }
7143
+ for (var j = 0; j < N.length; j++) {
7144
+ for (var k = 0; k < post.length; k++) {
7145
+ var expansion = pre + N[j] + post[k];
7146
+ if (!isTop || isSequence || expansion)
7147
+ expansions.push(expansion);
7148
+ }
7149
+ }
7150
+ }
7151
+ return expansions;
7152
+ }
7153
+ }
7154
+ });
7155
+
7156
+ // node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js
7157
+ var require_minimatch = __commonJS({
7158
+ "node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js"(exports, module2) {
7159
+ var minimatch = module2.exports = (p, pattern, options = {}) => {
7160
+ assertValidPattern(pattern);
7161
+ if (!options.nocomment && pattern.charAt(0) === "#") {
7162
+ return false;
7163
+ }
7164
+ return new Minimatch(pattern, options).match(p);
7165
+ };
7166
+ module2.exports = minimatch;
7167
+ var path = require_path();
7168
+ minimatch.sep = path.sep;
7169
+ var GLOBSTAR = Symbol("globstar **");
7170
+ minimatch.GLOBSTAR = GLOBSTAR;
7171
+ var expand = require_brace_expansion();
7172
+ var plTypes = {
7173
+ "!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
7174
+ "?": { open: "(?:", close: ")?" },
7175
+ "+": { open: "(?:", close: ")+" },
7176
+ "*": { open: "(?:", close: ")*" },
7177
+ "@": { open: "(?:", close: ")" }
7178
+ };
7179
+ var qmark = "[^/]";
7180
+ var star = qmark + "*?";
7181
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
7182
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
7183
+ var charSet = (s) => s.split("").reduce((set, c) => {
7184
+ set[c] = true;
7185
+ return set;
7186
+ }, {});
7187
+ var reSpecials = charSet("().*{}+?[]^$\\!");
7188
+ var addPatternStartSet = charSet("[.(");
7189
+ var slashSplit = /\/+/;
7190
+ minimatch.filter = (pattern, options = {}) => (p, i, list) => minimatch(p, pattern, options);
7191
+ var ext = (a, b = {}) => {
7192
+ const t = {};
7193
+ Object.keys(a).forEach((k) => t[k] = a[k]);
7194
+ Object.keys(b).forEach((k) => t[k] = b[k]);
7195
+ return t;
7196
+ };
7197
+ minimatch.defaults = (def) => {
7198
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
7199
+ return minimatch;
7200
+ }
7201
+ const orig = minimatch;
7202
+ const m = (p, pattern, options) => orig(p, pattern, ext(def, options));
7203
+ m.Minimatch = class Minimatch extends orig.Minimatch {
7204
+ constructor(pattern, options) {
7205
+ super(pattern, ext(def, options));
7206
+ }
7207
+ };
7208
+ m.Minimatch.defaults = (options) => orig.defaults(ext(def, options)).Minimatch;
7209
+ m.filter = (pattern, options) => orig.filter(pattern, ext(def, options));
7210
+ m.defaults = (options) => orig.defaults(ext(def, options));
7211
+ m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options));
7212
+ m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options));
7213
+ m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options));
7214
+ return m;
7215
+ };
7216
+ minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options);
7217
+ var braceExpand = (pattern, options = {}) => {
7218
+ assertValidPattern(pattern);
7219
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
7220
+ return [pattern];
7221
+ }
7222
+ return expand(pattern);
7223
+ };
7224
+ var MAX_PATTERN_LENGTH = 1024 * 64;
7225
+ var assertValidPattern = (pattern) => {
7226
+ if (typeof pattern !== "string") {
7227
+ throw new TypeError("invalid pattern");
7228
+ }
7229
+ if (pattern.length > MAX_PATTERN_LENGTH) {
7230
+ throw new TypeError("pattern is too long");
7231
+ }
7232
+ };
7233
+ var SUBPARSE = Symbol("subparse");
7234
+ minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe();
7235
+ minimatch.match = (list, pattern, options = {}) => {
7236
+ const mm = new Minimatch(pattern, options);
7237
+ list = list.filter((f) => mm.match(f));
7238
+ if (mm.options.nonull && !list.length) {
7239
+ list.push(pattern);
7240
+ }
7241
+ return list;
7242
+ };
7243
+ var globUnescape = (s) => s.replace(/\\(.)/g, "$1");
7244
+ var charUnescape = (s) => s.replace(/\\([^-\]])/g, "$1");
7245
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
7246
+ var braExpEscape = (s) => s.replace(/[[\]\\]/g, "\\$&");
7247
+ var Minimatch = class {
7248
+ constructor(pattern, options) {
7249
+ assertValidPattern(pattern);
7250
+ if (!options)
7251
+ options = {};
7252
+ this.options = options;
7253
+ this.set = [];
7254
+ this.pattern = pattern;
7255
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
7256
+ if (this.windowsPathsNoEscape) {
7257
+ this.pattern = this.pattern.replace(/\\/g, "/");
7258
+ }
7259
+ this.regexp = null;
7260
+ this.negate = false;
7261
+ this.comment = false;
7262
+ this.empty = false;
7263
+ this.partial = !!options.partial;
7264
+ this.make();
7265
+ }
7266
+ debug() {
7267
+ }
7268
+ make() {
7269
+ const pattern = this.pattern;
7270
+ const options = this.options;
7271
+ if (!options.nocomment && pattern.charAt(0) === "#") {
7272
+ this.comment = true;
7273
+ return;
7274
+ }
7275
+ if (!pattern) {
7276
+ this.empty = true;
7277
+ return;
7278
+ }
7279
+ this.parseNegate();
7280
+ let set = this.globSet = this.braceExpand();
7281
+ if (options.debug)
7282
+ this.debug = (...args) => console.error(...args);
7283
+ this.debug(this.pattern, set);
7284
+ set = this.globParts = set.map((s) => s.split(slashSplit));
7285
+ this.debug(this.pattern, set);
7286
+ set = set.map((s, si, set2) => s.map(this.parse, this));
7287
+ this.debug(this.pattern, set);
7288
+ set = set.filter((s) => s.indexOf(false) === -1);
7289
+ this.debug(this.pattern, set);
7290
+ this.set = set;
7291
+ }
7292
+ parseNegate() {
7293
+ if (this.options.nonegate)
7294
+ return;
7295
+ const pattern = this.pattern;
7296
+ let negate = false;
7297
+ let negateOffset = 0;
7298
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
7299
+ negate = !negate;
7300
+ negateOffset++;
7301
+ }
7302
+ if (negateOffset)
7303
+ this.pattern = pattern.slice(negateOffset);
7304
+ this.negate = negate;
7305
+ }
7306
+ matchOne(file, pattern, partial) {
7307
+ var options = this.options;
7308
+ this.debug(
7309
+ "matchOne",
7310
+ { "this": this, file, pattern }
7311
+ );
7312
+ this.debug("matchOne", file.length, pattern.length);
7313
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
7314
+ this.debug("matchOne loop");
7315
+ var p = pattern[pi];
7316
+ var f = file[fi];
7317
+ this.debug(pattern, p, f);
7318
+ if (p === false)
7319
+ return false;
7320
+ if (p === GLOBSTAR) {
7321
+ this.debug("GLOBSTAR", [pattern, p, f]);
7322
+ var fr = fi;
7323
+ var pr = pi + 1;
7324
+ if (pr === pl) {
7325
+ this.debug("** at the end");
7326
+ for (; fi < fl; fi++) {
7327
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
7328
+ return false;
7329
+ }
7330
+ return true;
7331
+ }
7332
+ while (fr < fl) {
7333
+ var swallowee = file[fr];
7334
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
7335
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
7336
+ this.debug("globstar found match!", fr, fl, swallowee);
7337
+ return true;
7338
+ } else {
7339
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
7340
+ this.debug("dot detected!", file, fr, pattern, pr);
7341
+ break;
7342
+ }
7343
+ this.debug("globstar swallow a segment, and continue");
7344
+ fr++;
7345
+ }
7346
+ }
7347
+ if (partial) {
7348
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
7349
+ if (fr === fl)
7350
+ return true;
7351
+ }
7352
+ return false;
7353
+ }
7354
+ var hit;
7355
+ if (typeof p === "string") {
7356
+ hit = f === p;
7357
+ this.debug("string match", p, f, hit);
7358
+ } else {
7359
+ hit = f.match(p);
7360
+ this.debug("pattern match", p, f, hit);
7361
+ }
7362
+ if (!hit)
7363
+ return false;
7364
+ }
7365
+ if (fi === fl && pi === pl) {
7366
+ return true;
7367
+ } else if (fi === fl) {
7368
+ return partial;
7369
+ } else if (pi === pl) {
7370
+ return fi === fl - 1 && file[fi] === "";
7371
+ }
7372
+ throw new Error("wtf?");
7373
+ }
7374
+ braceExpand() {
7375
+ return braceExpand(this.pattern, this.options);
7376
+ }
7377
+ parse(pattern, isSub) {
7378
+ assertValidPattern(pattern);
7379
+ const options = this.options;
7380
+ if (pattern === "**") {
7381
+ if (!options.noglobstar)
7382
+ return GLOBSTAR;
7383
+ else
7384
+ pattern = "*";
7385
+ }
7386
+ if (pattern === "")
7387
+ return "";
7388
+ let re = "";
7389
+ let hasMagic = false;
7390
+ let escaping = false;
7391
+ const patternListStack = [];
7392
+ const negativeLists = [];
7393
+ let stateChar;
7394
+ let inClass = false;
7395
+ let reClassStart = -1;
7396
+ let classStart = -1;
7397
+ let cs;
7398
+ let pl;
7399
+ let sp;
7400
+ let dotTravAllowed = pattern.charAt(0) === ".";
7401
+ let dotFileAllowed = options.dot || dotTravAllowed;
7402
+ const patternStart = () => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
7403
+ const subPatternStart = (p) => p.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
7404
+ const clearStateChar = () => {
7405
+ if (stateChar) {
7406
+ switch (stateChar) {
7407
+ case "*":
7408
+ re += star;
7409
+ hasMagic = true;
7410
+ break;
7411
+ case "?":
7412
+ re += qmark;
7413
+ hasMagic = true;
7414
+ break;
7415
+ default:
7416
+ re += "\\" + stateChar;
7417
+ break;
7418
+ }
7419
+ this.debug("clearStateChar %j %j", stateChar, re);
7420
+ stateChar = false;
7421
+ }
7422
+ };
7423
+ for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) {
7424
+ this.debug("%s %s %s %j", pattern, i, re, c);
7425
+ if (escaping) {
7426
+ if (c === "/") {
7427
+ return false;
7428
+ }
7429
+ if (reSpecials[c]) {
7430
+ re += "\\";
7431
+ }
7432
+ re += c;
7433
+ escaping = false;
7434
+ continue;
7435
+ }
7436
+ switch (c) {
7437
+ case "/": {
7438
+ return false;
7439
+ }
7440
+ case "\\":
7441
+ if (inClass && pattern.charAt(i + 1) === "-") {
7442
+ re += c;
7443
+ continue;
7444
+ }
7445
+ clearStateChar();
7446
+ escaping = true;
7447
+ continue;
7448
+ case "?":
7449
+ case "*":
7450
+ case "+":
7451
+ case "@":
7452
+ case "!":
7453
+ this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
7454
+ if (inClass) {
7455
+ this.debug(" in class");
7456
+ if (c === "!" && i === classStart + 1)
7457
+ c = "^";
7458
+ re += c;
7459
+ continue;
7460
+ }
7461
+ this.debug("call clearStateChar %j", stateChar);
7462
+ clearStateChar();
7463
+ stateChar = c;
7464
+ if (options.noext)
7465
+ clearStateChar();
7466
+ continue;
7467
+ case "(": {
7468
+ if (inClass) {
7469
+ re += "(";
7470
+ continue;
7471
+ }
7472
+ if (!stateChar) {
7473
+ re += "\\(";
7474
+ continue;
7475
+ }
7476
+ const plEntry = {
7477
+ type: stateChar,
7478
+ start: i - 1,
7479
+ reStart: re.length,
7480
+ open: plTypes[stateChar].open,
7481
+ close: plTypes[stateChar].close
7482
+ };
7483
+ this.debug(this.pattern, " ", plEntry);
7484
+ patternListStack.push(plEntry);
7485
+ re += plEntry.open;
7486
+ if (plEntry.start === 0 && plEntry.type !== "!") {
7487
+ dotTravAllowed = true;
7488
+ re += subPatternStart(pattern.slice(i + 1));
7489
+ }
7490
+ this.debug("plType %j %j", stateChar, re);
7491
+ stateChar = false;
7492
+ continue;
7493
+ }
7494
+ case ")": {
7495
+ const plEntry = patternListStack[patternListStack.length - 1];
7496
+ if (inClass || !plEntry) {
7497
+ re += "\\)";
7498
+ continue;
7499
+ }
7500
+ patternListStack.pop();
7501
+ clearStateChar();
7502
+ hasMagic = true;
7503
+ pl = plEntry;
7504
+ re += pl.close;
7505
+ if (pl.type === "!") {
7506
+ negativeLists.push(Object.assign(pl, { reEnd: re.length }));
7507
+ }
7508
+ continue;
7509
+ }
7510
+ case "|": {
7511
+ const plEntry = patternListStack[patternListStack.length - 1];
7512
+ if (inClass || !plEntry) {
7513
+ re += "\\|";
7514
+ continue;
7515
+ }
7516
+ clearStateChar();
7517
+ re += "|";
7518
+ if (plEntry.start === 0 && plEntry.type !== "!") {
7519
+ dotTravAllowed = true;
7520
+ re += subPatternStart(pattern.slice(i + 1));
7521
+ }
7522
+ continue;
7523
+ }
7524
+ case "[":
7525
+ clearStateChar();
7526
+ if (inClass) {
7527
+ re += "\\" + c;
7528
+ continue;
7529
+ }
7530
+ inClass = true;
7531
+ classStart = i;
7532
+ reClassStart = re.length;
7533
+ re += c;
7534
+ continue;
7535
+ case "]":
7536
+ if (i === classStart + 1 || !inClass) {
7537
+ re += "\\" + c;
7538
+ continue;
7539
+ }
7540
+ cs = pattern.substring(classStart + 1, i);
7541
+ try {
7542
+ RegExp("[" + braExpEscape(charUnescape(cs)) + "]");
7543
+ re += c;
7544
+ } catch (er) {
7545
+ re = re.substring(0, reClassStart) + "(?:$.)";
7546
+ }
7547
+ hasMagic = true;
7548
+ inClass = false;
7549
+ continue;
7550
+ default:
7551
+ clearStateChar();
7552
+ if (reSpecials[c] && !(c === "^" && inClass)) {
7553
+ re += "\\";
7554
+ }
7555
+ re += c;
7556
+ break;
7557
+ }
7558
+ }
7559
+ if (inClass) {
7560
+ cs = pattern.slice(classStart + 1);
7561
+ sp = this.parse(cs, SUBPARSE);
7562
+ re = re.substring(0, reClassStart) + "\\[" + sp[0];
7563
+ hasMagic = hasMagic || sp[1];
7564
+ }
7565
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
7566
+ let tail;
7567
+ tail = re.slice(pl.reStart + pl.open.length);
7568
+ this.debug("setting tail", re, pl);
7569
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
7570
+ if (!$2) {
7571
+ $2 = "\\";
7572
+ }
7573
+ return $1 + $1 + $2 + "|";
7574
+ });
7575
+ this.debug("tail=%j\n %s", tail, tail, pl, re);
7576
+ const t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
7577
+ hasMagic = true;
7578
+ re = re.slice(0, pl.reStart) + t + "\\(" + tail;
7579
+ }
7580
+ clearStateChar();
7581
+ if (escaping) {
7582
+ re += "\\\\";
7583
+ }
7584
+ const addPatternStart = addPatternStartSet[re.charAt(0)];
7585
+ for (let n = negativeLists.length - 1; n > -1; n--) {
7586
+ const nl = negativeLists[n];
7587
+ const nlBefore = re.slice(0, nl.reStart);
7588
+ const nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
7589
+ let nlAfter = re.slice(nl.reEnd);
7590
+ const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;
7591
+ const closeParensBefore = nlBefore.split(")").length;
7592
+ const openParensBefore = nlBefore.split("(").length - closeParensBefore;
7593
+ let cleanAfter = nlAfter;
7594
+ for (let i = 0; i < openParensBefore; i++) {
7595
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
7596
+ }
7597
+ nlAfter = cleanAfter;
7598
+ const dollar = nlAfter === "" && isSub !== SUBPARSE ? "(?:$|\\/)" : "";
7599
+ re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
7600
+ }
7601
+ if (re !== "" && hasMagic) {
7602
+ re = "(?=.)" + re;
7603
+ }
7604
+ if (addPatternStart) {
7605
+ re = patternStart() + re;
7606
+ }
7607
+ if (isSub === SUBPARSE) {
7608
+ return [re, hasMagic];
7609
+ }
7610
+ if (options.nocase && !hasMagic) {
7611
+ hasMagic = pattern.toUpperCase() !== pattern.toLowerCase();
7612
+ }
7613
+ if (!hasMagic) {
7614
+ return globUnescape(pattern);
7615
+ }
7616
+ const flags = options.nocase ? "i" : "";
7617
+ try {
7618
+ return Object.assign(new RegExp("^" + re + "$", flags), {
7619
+ _glob: pattern,
7620
+ _src: re
7621
+ });
7622
+ } catch (er) {
7623
+ return new RegExp("$.");
7624
+ }
7625
+ }
7626
+ makeRe() {
7627
+ if (this.regexp || this.regexp === false)
7628
+ return this.regexp;
7629
+ const set = this.set;
7630
+ if (!set.length) {
7631
+ this.regexp = false;
7632
+ return this.regexp;
7633
+ }
7634
+ const options = this.options;
7635
+ const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
7636
+ const flags = options.nocase ? "i" : "";
7637
+ let re = set.map((pattern) => {
7638
+ pattern = pattern.map(
7639
+ (p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src
7640
+ ).reduce((set2, p) => {
7641
+ if (!(set2[set2.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
7642
+ set2.push(p);
7643
+ }
7644
+ return set2;
7645
+ }, []);
7646
+ pattern.forEach((p, i) => {
7647
+ if (p !== GLOBSTAR || pattern[i - 1] === GLOBSTAR) {
7648
+ return;
7649
+ }
7650
+ if (i === 0) {
7651
+ if (pattern.length > 1) {
7652
+ pattern[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i + 1];
7653
+ } else {
7654
+ pattern[i] = twoStar;
7655
+ }
7656
+ } else if (i === pattern.length - 1) {
7657
+ pattern[i - 1] += "(?:\\/|" + twoStar + ")?";
7658
+ } else {
7659
+ pattern[i - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i + 1];
7660
+ pattern[i + 1] = GLOBSTAR;
7661
+ }
7662
+ });
7663
+ return pattern.filter((p) => p !== GLOBSTAR).join("/");
7664
+ }).join("|");
7665
+ re = "^(?:" + re + ")$";
7666
+ if (this.negate)
7667
+ re = "^(?!" + re + ").*$";
7668
+ try {
7669
+ this.regexp = new RegExp(re, flags);
7670
+ } catch (ex) {
7671
+ this.regexp = false;
7672
+ }
7673
+ return this.regexp;
7674
+ }
7675
+ match(f, partial = this.partial) {
7676
+ this.debug("match", f, this.pattern);
7677
+ if (this.comment)
7678
+ return false;
7679
+ if (this.empty)
7680
+ return f === "";
7681
+ if (f === "/" && partial)
7682
+ return true;
7683
+ const options = this.options;
7684
+ if (path.sep !== "/") {
7685
+ f = f.split(path.sep).join("/");
7686
+ }
7687
+ f = f.split(slashSplit);
7688
+ this.debug(this.pattern, "split", f);
7689
+ const set = this.set;
7690
+ this.debug(this.pattern, "set", set);
7691
+ let filename;
7692
+ for (let i = f.length - 1; i >= 0; i--) {
7693
+ filename = f[i];
7694
+ if (filename)
7695
+ break;
7696
+ }
7697
+ for (let i = 0; i < set.length; i++) {
7698
+ const pattern = set[i];
7699
+ let file = f;
7700
+ if (options.matchBase && pattern.length === 1) {
7701
+ file = [filename];
7702
+ }
7703
+ const hit = this.matchOne(file, pattern, partial);
7704
+ if (hit) {
7705
+ if (options.flipNegate)
7706
+ return true;
7707
+ return !this.negate;
7708
+ }
7709
+ }
7710
+ if (options.flipNegate)
7711
+ return false;
7712
+ return this.negate;
7713
+ }
7714
+ static defaults(def) {
7715
+ return minimatch.defaults(def).Minimatch;
7716
+ }
7717
+ };
7718
+ minimatch.Minimatch = Minimatch;
7719
+ }
7720
+ });
7721
+
7722
+ // node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js
7723
+ var require_inherits_browser = __commonJS({
7724
+ "node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports, module2) {
7725
+ if (typeof Object.create === "function") {
7726
+ module2.exports = function inherits(ctor, superCtor) {
7727
+ if (superCtor) {
7728
+ ctor.super_ = superCtor;
7729
+ ctor.prototype = Object.create(superCtor.prototype, {
7730
+ constructor: {
7731
+ value: ctor,
7732
+ enumerable: false,
7733
+ writable: true,
7734
+ configurable: true
7735
+ }
7736
+ });
7737
+ }
7738
+ };
7739
+ } else {
7740
+ module2.exports = function inherits(ctor, superCtor) {
7741
+ if (superCtor) {
7742
+ ctor.super_ = superCtor;
7743
+ var TempCtor = function() {
7744
+ };
7745
+ TempCtor.prototype = superCtor.prototype;
7746
+ ctor.prototype = new TempCtor();
7747
+ ctor.prototype.constructor = ctor;
7748
+ }
7749
+ };
7750
+ }
7751
+ }
7752
+ });
7753
+
7754
+ // node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js
7755
+ var require_inherits = __commonJS({
7756
+ "node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports, module2) {
7757
+ try {
7758
+ util2 = require("util");
7759
+ if (typeof util2.inherits !== "function")
7760
+ throw "";
7761
+ module2.exports = util2.inherits;
7762
+ } catch (e) {
7763
+ module2.exports = require_inherits_browser();
7764
+ }
7765
+ var util2;
7766
+ }
7767
+ });
7768
+
7769
+ // node_modules/.pnpm/glob@8.1.0/node_modules/glob/common.js
7770
+ var require_common = __commonJS({
7771
+ "node_modules/.pnpm/glob@8.1.0/node_modules/glob/common.js"(exports) {
7772
+ exports.setopts = setopts;
7773
+ exports.ownProp = ownProp;
7774
+ exports.makeAbs = makeAbs;
7775
+ exports.finish = finish;
7776
+ exports.mark = mark;
7777
+ exports.isIgnored = isIgnored;
7778
+ exports.childrenIgnored = childrenIgnored;
7779
+ function ownProp(obj, field) {
7780
+ return Object.prototype.hasOwnProperty.call(obj, field);
7781
+ }
7782
+ var fs = require("fs");
7783
+ var path = require("path");
7784
+ var minimatch = require_minimatch();
7785
+ var isAbsolute = require("path").isAbsolute;
7786
+ var Minimatch = minimatch.Minimatch;
7787
+ function alphasort(a, b) {
7788
+ return a.localeCompare(b, "en");
7789
+ }
7790
+ function setupIgnores(self2, options) {
7791
+ self2.ignore = options.ignore || [];
7792
+ if (!Array.isArray(self2.ignore))
7793
+ self2.ignore = [self2.ignore];
7794
+ if (self2.ignore.length) {
7795
+ self2.ignore = self2.ignore.map(ignoreMap);
7796
+ }
7797
+ }
7798
+ function ignoreMap(pattern) {
7799
+ var gmatcher = null;
7800
+ if (pattern.slice(-3) === "/**") {
7801
+ var gpattern = pattern.replace(/(\/\*\*)+$/, "");
7802
+ gmatcher = new Minimatch(gpattern, { dot: true });
7803
+ }
7804
+ return {
7805
+ matcher: new Minimatch(pattern, { dot: true }),
7806
+ gmatcher
7807
+ };
7808
+ }
7809
+ function setopts(self2, pattern, options) {
7810
+ if (!options)
7811
+ options = {};
7812
+ if (options.matchBase && -1 === pattern.indexOf("/")) {
7813
+ if (options.noglobstar) {
7814
+ throw new Error("base matching requires globstar");
7815
+ }
7816
+ pattern = "**/" + pattern;
7817
+ }
7818
+ self2.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
7819
+ if (self2.windowsPathsNoEscape) {
7820
+ pattern = pattern.replace(/\\/g, "/");
7821
+ }
7822
+ self2.silent = !!options.silent;
7823
+ self2.pattern = pattern;
7824
+ self2.strict = options.strict !== false;
7825
+ self2.realpath = !!options.realpath;
7826
+ self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null);
7827
+ self2.follow = !!options.follow;
7828
+ self2.dot = !!options.dot;
7829
+ self2.mark = !!options.mark;
7830
+ self2.nodir = !!options.nodir;
7831
+ if (self2.nodir)
7832
+ self2.mark = true;
7833
+ self2.sync = !!options.sync;
7834
+ self2.nounique = !!options.nounique;
7835
+ self2.nonull = !!options.nonull;
7836
+ self2.nosort = !!options.nosort;
7837
+ self2.nocase = !!options.nocase;
7838
+ self2.stat = !!options.stat;
7839
+ self2.noprocess = !!options.noprocess;
7840
+ self2.absolute = !!options.absolute;
7841
+ self2.fs = options.fs || fs;
7842
+ self2.maxLength = options.maxLength || Infinity;
7843
+ self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
7844
+ self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
7845
+ self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
7846
+ setupIgnores(self2, options);
7847
+ self2.changedCwd = false;
7848
+ var cwd = process.cwd();
7849
+ if (!ownProp(options, "cwd"))
7850
+ self2.cwd = path.resolve(cwd);
7851
+ else {
7852
+ self2.cwd = path.resolve(options.cwd);
7853
+ self2.changedCwd = self2.cwd !== cwd;
7854
+ }
7855
+ self2.root = options.root || path.resolve(self2.cwd, "/");
7856
+ self2.root = path.resolve(self2.root);
7857
+ self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
7858
+ self2.nomount = !!options.nomount;
7859
+ if (process.platform === "win32") {
7860
+ self2.root = self2.root.replace(/\\/g, "/");
7861
+ self2.cwd = self2.cwd.replace(/\\/g, "/");
7862
+ self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
7863
+ }
7864
+ options.nonegate = true;
7865
+ options.nocomment = true;
7866
+ self2.minimatch = new Minimatch(pattern, options);
7867
+ self2.options = self2.minimatch.options;
7868
+ }
7869
+ function finish(self2) {
7870
+ var nou = self2.nounique;
7871
+ var all = nou ? [] : /* @__PURE__ */ Object.create(null);
7872
+ for (var i = 0, l = self2.matches.length; i < l; i++) {
7873
+ var matches = self2.matches[i];
7874
+ if (!matches || Object.keys(matches).length === 0) {
7875
+ if (self2.nonull) {
7876
+ var literal = self2.minimatch.globSet[i];
7877
+ if (nou)
7878
+ all.push(literal);
7879
+ else
7880
+ all[literal] = true;
7881
+ }
7882
+ } else {
7883
+ var m = Object.keys(matches);
7884
+ if (nou)
7885
+ all.push.apply(all, m);
7886
+ else
7887
+ m.forEach(function(m2) {
7888
+ all[m2] = true;
7889
+ });
7890
+ }
7891
+ }
7892
+ if (!nou)
7893
+ all = Object.keys(all);
7894
+ if (!self2.nosort)
7895
+ all = all.sort(alphasort);
7896
+ if (self2.mark) {
7897
+ for (var i = 0; i < all.length; i++) {
7898
+ all[i] = self2._mark(all[i]);
7899
+ }
7900
+ if (self2.nodir) {
7901
+ all = all.filter(function(e) {
7902
+ var notDir = !/\/$/.test(e);
7903
+ var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
7904
+ if (notDir && c)
7905
+ notDir = c !== "DIR" && !Array.isArray(c);
7906
+ return notDir;
7907
+ });
7908
+ }
7909
+ }
7910
+ if (self2.ignore.length)
7911
+ all = all.filter(function(m2) {
7912
+ return !isIgnored(self2, m2);
7913
+ });
7914
+ self2.found = all;
7915
+ }
7916
+ function mark(self2, p) {
7917
+ var abs = makeAbs(self2, p);
7918
+ var c = self2.cache[abs];
7919
+ var m = p;
7920
+ if (c) {
7921
+ var isDir = c === "DIR" || Array.isArray(c);
7922
+ var slash = p.slice(-1) === "/";
7923
+ if (isDir && !slash)
7924
+ m += "/";
7925
+ else if (!isDir && slash)
7926
+ m = m.slice(0, -1);
7927
+ if (m !== p) {
7928
+ var mabs = makeAbs(self2, m);
7929
+ self2.statCache[mabs] = self2.statCache[abs];
7930
+ self2.cache[mabs] = self2.cache[abs];
7931
+ }
7932
+ }
7933
+ return m;
7934
+ }
7935
+ function makeAbs(self2, f) {
7936
+ var abs = f;
7937
+ if (f.charAt(0) === "/") {
7938
+ abs = path.join(self2.root, f);
7939
+ } else if (isAbsolute(f) || f === "") {
7940
+ abs = f;
7941
+ } else if (self2.changedCwd) {
7942
+ abs = path.resolve(self2.cwd, f);
7943
+ } else {
7944
+ abs = path.resolve(f);
7945
+ }
7946
+ if (process.platform === "win32")
7947
+ abs = abs.replace(/\\/g, "/");
7948
+ return abs;
7949
+ }
7950
+ function isIgnored(self2, path2) {
7951
+ if (!self2.ignore.length)
7952
+ return false;
7953
+ return self2.ignore.some(function(item) {
7954
+ return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2));
7955
+ });
7956
+ }
7957
+ function childrenIgnored(self2, path2) {
7958
+ if (!self2.ignore.length)
7959
+ return false;
7960
+ return self2.ignore.some(function(item) {
7961
+ return !!(item.gmatcher && item.gmatcher.match(path2));
7962
+ });
7963
+ }
7964
+ }
7965
+ });
7966
+
7967
+ // node_modules/.pnpm/glob@8.1.0/node_modules/glob/sync.js
7968
+ var require_sync = __commonJS({
7969
+ "node_modules/.pnpm/glob@8.1.0/node_modules/glob/sync.js"(exports, module2) {
7970
+ module2.exports = globSync;
7971
+ globSync.GlobSync = GlobSync;
7972
+ var rp = require_fs();
7973
+ var minimatch = require_minimatch();
7974
+ var Minimatch = minimatch.Minimatch;
7975
+ var Glob = require_glob().Glob;
7976
+ var util2 = require("util");
7977
+ var path = require("path");
7978
+ var assert = require("assert");
7979
+ var isAbsolute = require("path").isAbsolute;
7980
+ var common = require_common();
7981
+ var setopts = common.setopts;
7982
+ var ownProp = common.ownProp;
7983
+ var childrenIgnored = common.childrenIgnored;
7984
+ var isIgnored = common.isIgnored;
7985
+ function globSync(pattern, options) {
7986
+ if (typeof options === "function" || arguments.length === 3)
7987
+ throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
7988
+ return new GlobSync(pattern, options).found;
7989
+ }
7990
+ function GlobSync(pattern, options) {
7991
+ if (!pattern)
7992
+ throw new Error("must provide pattern");
7993
+ if (typeof options === "function" || arguments.length === 3)
7994
+ throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
7995
+ if (!(this instanceof GlobSync))
7996
+ return new GlobSync(pattern, options);
7997
+ setopts(this, pattern, options);
7998
+ if (this.noprocess)
7999
+ return this;
8000
+ var n = this.minimatch.set.length;
8001
+ this.matches = new Array(n);
8002
+ for (var i = 0; i < n; i++) {
8003
+ this._process(this.minimatch.set[i], i, false);
8004
+ }
8005
+ this._finish();
8006
+ }
8007
+ GlobSync.prototype._finish = function() {
8008
+ assert.ok(this instanceof GlobSync);
8009
+ if (this.realpath) {
8010
+ var self2 = this;
8011
+ this.matches.forEach(function(matchset, index4) {
8012
+ var set = self2.matches[index4] = /* @__PURE__ */ Object.create(null);
8013
+ for (var p in matchset) {
8014
+ try {
8015
+ p = self2._makeAbs(p);
8016
+ var real = rp.realpathSync(p, self2.realpathCache);
8017
+ set[real] = true;
8018
+ } catch (er) {
8019
+ if (er.syscall === "stat")
8020
+ set[self2._makeAbs(p)] = true;
8021
+ else
8022
+ throw er;
8023
+ }
8024
+ }
8025
+ });
8026
+ }
8027
+ common.finish(this);
8028
+ };
8029
+ GlobSync.prototype._process = function(pattern, index4, inGlobStar) {
8030
+ assert.ok(this instanceof GlobSync);
8031
+ var n = 0;
8032
+ while (typeof pattern[n] === "string") {
8033
+ n++;
8034
+ }
8035
+ var prefix;
8036
+ switch (n) {
8037
+ case pattern.length:
8038
+ this._processSimple(pattern.join("/"), index4);
8039
+ return;
8040
+ case 0:
8041
+ prefix = null;
8042
+ break;
8043
+ default:
8044
+ prefix = pattern.slice(0, n).join("/");
8045
+ break;
8046
+ }
8047
+ var remain = pattern.slice(n);
8048
+ var read;
8049
+ if (prefix === null)
8050
+ read = ".";
8051
+ else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
8052
+ return typeof p === "string" ? p : "[*]";
8053
+ }).join("/"))) {
8054
+ if (!prefix || !isAbsolute(prefix))
8055
+ prefix = "/" + prefix;
8056
+ read = prefix;
8057
+ } else
8058
+ read = prefix;
8059
+ var abs = this._makeAbs(read);
8060
+ if (childrenIgnored(this, read))
8061
+ return;
8062
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR;
8063
+ if (isGlobStar)
8064
+ this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar);
8065
+ else
8066
+ this._processReaddir(prefix, read, abs, remain, index4, inGlobStar);
8067
+ };
8068
+ GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar) {
8069
+ var entries = this._readdir(abs, inGlobStar);
8070
+ if (!entries)
8071
+ return;
8072
+ var pn = remain[0];
8073
+ var negate = !!this.minimatch.negate;
8074
+ var rawGlob = pn._glob;
8075
+ var dotOk = this.dot || rawGlob.charAt(0) === ".";
8076
+ var matchedEntries = [];
8077
+ for (var i = 0; i < entries.length; i++) {
8078
+ var e = entries[i];
8079
+ if (e.charAt(0) !== "." || dotOk) {
8080
+ var m;
8081
+ if (negate && !prefix) {
8082
+ m = !e.match(pn);
8083
+ } else {
8084
+ m = e.match(pn);
8085
+ }
8086
+ if (m)
8087
+ matchedEntries.push(e);
8088
+ }
8089
+ }
8090
+ var len = matchedEntries.length;
8091
+ if (len === 0)
8092
+ return;
8093
+ if (remain.length === 1 && !this.mark && !this.stat) {
8094
+ if (!this.matches[index4])
8095
+ this.matches[index4] = /* @__PURE__ */ Object.create(null);
8096
+ for (var i = 0; i < len; i++) {
8097
+ var e = matchedEntries[i];
8098
+ if (prefix) {
8099
+ if (prefix.slice(-1) !== "/")
8100
+ e = prefix + "/" + e;
8101
+ else
8102
+ e = prefix + e;
8103
+ }
8104
+ if (e.charAt(0) === "/" && !this.nomount) {
8105
+ e = path.join(this.root, e);
8106
+ }
8107
+ this._emitMatch(index4, e);
8108
+ }
8109
+ return;
8110
+ }
8111
+ remain.shift();
8112
+ for (var i = 0; i < len; i++) {
8113
+ var e = matchedEntries[i];
8114
+ var newPattern;
8115
+ if (prefix)
8116
+ newPattern = [prefix, e];
8117
+ else
8118
+ newPattern = [e];
8119
+ this._process(newPattern.concat(remain), index4, inGlobStar);
8120
+ }
8121
+ };
8122
+ GlobSync.prototype._emitMatch = function(index4, e) {
8123
+ if (isIgnored(this, e))
8124
+ return;
8125
+ var abs = this._makeAbs(e);
8126
+ if (this.mark)
8127
+ e = this._mark(e);
8128
+ if (this.absolute) {
8129
+ e = abs;
8130
+ }
8131
+ if (this.matches[index4][e])
8132
+ return;
8133
+ if (this.nodir) {
8134
+ var c = this.cache[abs];
8135
+ if (c === "DIR" || Array.isArray(c))
8136
+ return;
8137
+ }
8138
+ this.matches[index4][e] = true;
8139
+ if (this.stat)
8140
+ this._stat(e);
8141
+ };
8142
+ GlobSync.prototype._readdirInGlobStar = function(abs) {
8143
+ if (this.follow)
8144
+ return this._readdir(abs, false);
8145
+ var entries;
8146
+ var lstat;
8147
+ var stat;
8148
+ try {
8149
+ lstat = this.fs.lstatSync(abs);
8150
+ } catch (er) {
8151
+ if (er.code === "ENOENT") {
8152
+ return null;
8153
+ }
8154
+ }
8155
+ var isSym = lstat && lstat.isSymbolicLink();
8156
+ this.symlinks[abs] = isSym;
8157
+ if (!isSym && lstat && !lstat.isDirectory())
8158
+ this.cache[abs] = "FILE";
8159
+ else
8160
+ entries = this._readdir(abs, false);
8161
+ return entries;
8162
+ };
8163
+ GlobSync.prototype._readdir = function(abs, inGlobStar) {
8164
+ var entries;
8165
+ if (inGlobStar && !ownProp(this.symlinks, abs))
8166
+ return this._readdirInGlobStar(abs);
8167
+ if (ownProp(this.cache, abs)) {
8168
+ var c = this.cache[abs];
8169
+ if (!c || c === "FILE")
8170
+ return null;
8171
+ if (Array.isArray(c))
8172
+ return c;
8173
+ }
8174
+ try {
8175
+ return this._readdirEntries(abs, this.fs.readdirSync(abs));
8176
+ } catch (er) {
8177
+ this._readdirError(abs, er);
8178
+ return null;
8179
+ }
8180
+ };
8181
+ GlobSync.prototype._readdirEntries = function(abs, entries) {
8182
+ if (!this.mark && !this.stat) {
8183
+ for (var i = 0; i < entries.length; i++) {
8184
+ var e = entries[i];
8185
+ if (abs === "/")
8186
+ e = abs + e;
8187
+ else
8188
+ e = abs + "/" + e;
8189
+ this.cache[e] = true;
8190
+ }
8191
+ }
8192
+ this.cache[abs] = entries;
8193
+ return entries;
8194
+ };
8195
+ GlobSync.prototype._readdirError = function(f, er) {
8196
+ switch (er.code) {
8197
+ case "ENOTSUP":
8198
+ case "ENOTDIR":
8199
+ var abs = this._makeAbs(f);
8200
+ this.cache[abs] = "FILE";
8201
+ if (abs === this.cwdAbs) {
8202
+ var error = new Error(er.code + " invalid cwd " + this.cwd);
8203
+ error.path = this.cwd;
8204
+ error.code = er.code;
8205
+ throw error;
8206
+ }
8207
+ break;
8208
+ case "ENOENT":
8209
+ case "ELOOP":
8210
+ case "ENAMETOOLONG":
8211
+ case "UNKNOWN":
8212
+ this.cache[this._makeAbs(f)] = false;
8213
+ break;
8214
+ default:
8215
+ this.cache[this._makeAbs(f)] = false;
8216
+ if (this.strict)
8217
+ throw er;
8218
+ if (!this.silent)
8219
+ console.error("glob error", er);
8220
+ break;
8221
+ }
8222
+ };
8223
+ GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar) {
8224
+ var entries = this._readdir(abs, inGlobStar);
8225
+ if (!entries)
8226
+ return;
8227
+ var remainWithoutGlobStar = remain.slice(1);
8228
+ var gspref = prefix ? [prefix] : [];
8229
+ var noGlobStar = gspref.concat(remainWithoutGlobStar);
8230
+ this._process(noGlobStar, index4, false);
8231
+ var len = entries.length;
8232
+ var isSym = this.symlinks[abs];
8233
+ if (isSym && inGlobStar)
8234
+ return;
8235
+ for (var i = 0; i < len; i++) {
8236
+ var e = entries[i];
8237
+ if (e.charAt(0) === "." && !this.dot)
8238
+ continue;
8239
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar);
8240
+ this._process(instead, index4, true);
8241
+ var below = gspref.concat(entries[i], remain);
8242
+ this._process(below, index4, true);
8243
+ }
8244
+ };
8245
+ GlobSync.prototype._processSimple = function(prefix, index4) {
8246
+ var exists = this._stat(prefix);
8247
+ if (!this.matches[index4])
8248
+ this.matches[index4] = /* @__PURE__ */ Object.create(null);
8249
+ if (!exists)
8250
+ return;
8251
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
8252
+ var trail = /[\/\\]$/.test(prefix);
8253
+ if (prefix.charAt(0) === "/") {
8254
+ prefix = path.join(this.root, prefix);
8255
+ } else {
8256
+ prefix = path.resolve(this.root, prefix);
8257
+ if (trail)
8258
+ prefix += "/";
8259
+ }
8260
+ }
8261
+ if (process.platform === "win32")
8262
+ prefix = prefix.replace(/\\/g, "/");
8263
+ this._emitMatch(index4, prefix);
8264
+ };
8265
+ GlobSync.prototype._stat = function(f) {
8266
+ var abs = this._makeAbs(f);
8267
+ var needDir = f.slice(-1) === "/";
8268
+ if (f.length > this.maxLength)
8269
+ return false;
8270
+ if (!this.stat && ownProp(this.cache, abs)) {
8271
+ var c = this.cache[abs];
8272
+ if (Array.isArray(c))
8273
+ c = "DIR";
8274
+ if (!needDir || c === "DIR")
8275
+ return c;
8276
+ if (needDir && c === "FILE")
8277
+ return false;
8278
+ }
8279
+ var exists;
8280
+ var stat = this.statCache[abs];
8281
+ if (!stat) {
8282
+ var lstat;
8283
+ try {
8284
+ lstat = this.fs.lstatSync(abs);
8285
+ } catch (er) {
8286
+ if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
8287
+ this.statCache[abs] = false;
8288
+ return false;
8289
+ }
8290
+ }
8291
+ if (lstat && lstat.isSymbolicLink()) {
8292
+ try {
8293
+ stat = this.fs.statSync(abs);
8294
+ } catch (er) {
8295
+ stat = lstat;
8296
+ }
8297
+ } else {
8298
+ stat = lstat;
8299
+ }
8300
+ }
8301
+ this.statCache[abs] = stat;
8302
+ var c = true;
8303
+ if (stat)
8304
+ c = stat.isDirectory() ? "DIR" : "FILE";
8305
+ this.cache[abs] = this.cache[abs] || c;
8306
+ if (needDir && c === "FILE")
8307
+ return false;
8308
+ return c;
8309
+ };
8310
+ GlobSync.prototype._mark = function(p) {
8311
+ return common.mark(this, p);
8312
+ };
8313
+ GlobSync.prototype._makeAbs = function(f) {
8314
+ return common.makeAbs(this, f);
8315
+ };
8316
+ }
8317
+ });
8318
+
8319
+ // node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
8320
+ var require_wrappy = __commonJS({
8321
+ "node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module2) {
8322
+ module2.exports = wrappy;
8323
+ function wrappy(fn, cb) {
8324
+ if (fn && cb)
8325
+ return wrappy(fn)(cb);
8326
+ if (typeof fn !== "function")
8327
+ throw new TypeError("need wrapper function");
8328
+ Object.keys(fn).forEach(function(k) {
8329
+ wrapper[k] = fn[k];
8330
+ });
8331
+ return wrapper;
8332
+ function wrapper() {
8333
+ var args = new Array(arguments.length);
8334
+ for (var i = 0; i < args.length; i++) {
8335
+ args[i] = arguments[i];
8336
+ }
8337
+ var ret = fn.apply(this, args);
8338
+ var cb2 = args[args.length - 1];
8339
+ if (typeof ret === "function" && ret !== cb2) {
8340
+ Object.keys(cb2).forEach(function(k) {
8341
+ ret[k] = cb2[k];
8342
+ });
8343
+ }
8344
+ return ret;
8345
+ }
8346
+ }
8347
+ }
8348
+ });
8349
+
8350
+ // node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
8351
+ var require_once = __commonJS({
8352
+ "node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module2) {
8353
+ var wrappy = require_wrappy();
8354
+ module2.exports = wrappy(once);
8355
+ module2.exports.strict = wrappy(onceStrict);
8356
+ once.proto = once(function() {
8357
+ Object.defineProperty(Function.prototype, "once", {
8358
+ value: function() {
8359
+ return once(this);
8360
+ },
8361
+ configurable: true
8362
+ });
8363
+ Object.defineProperty(Function.prototype, "onceStrict", {
8364
+ value: function() {
8365
+ return onceStrict(this);
8366
+ },
8367
+ configurable: true
8368
+ });
8369
+ });
8370
+ function once(fn) {
8371
+ var f = function() {
8372
+ if (f.called)
8373
+ return f.value;
8374
+ f.called = true;
8375
+ return f.value = fn.apply(this, arguments);
8376
+ };
8377
+ f.called = false;
8378
+ return f;
8379
+ }
8380
+ function onceStrict(fn) {
8381
+ var f = function() {
8382
+ if (f.called)
8383
+ throw new Error(f.onceError);
8384
+ f.called = true;
8385
+ return f.value = fn.apply(this, arguments);
8386
+ };
8387
+ var name = fn.name || "Function wrapped with `once`";
8388
+ f.onceError = name + " shouldn't be called more than once";
8389
+ f.called = false;
8390
+ return f;
8391
+ }
8392
+ }
8393
+ });
8394
+
8395
+ // node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js
8396
+ var require_inflight = __commonJS({
8397
+ "node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js"(exports, module2) {
8398
+ var wrappy = require_wrappy();
8399
+ var reqs = /* @__PURE__ */ Object.create(null);
8400
+ var once = require_once();
8401
+ module2.exports = wrappy(inflight);
8402
+ function inflight(key, cb) {
8403
+ if (reqs[key]) {
8404
+ reqs[key].push(cb);
8405
+ return null;
8406
+ } else {
8407
+ reqs[key] = [cb];
8408
+ return makeres(key);
8409
+ }
8410
+ }
8411
+ function makeres(key) {
8412
+ return once(function RES() {
8413
+ var cbs = reqs[key];
8414
+ var len = cbs.length;
8415
+ var args = slice(arguments);
8416
+ try {
8417
+ for (var i = 0; i < len; i++) {
8418
+ cbs[i].apply(null, args);
8419
+ }
8420
+ } finally {
8421
+ if (cbs.length > len) {
8422
+ cbs.splice(0, len);
8423
+ process.nextTick(function() {
8424
+ RES.apply(null, args);
8425
+ });
8426
+ } else {
8427
+ delete reqs[key];
8428
+ }
8429
+ }
8430
+ });
8431
+ }
8432
+ function slice(args) {
8433
+ var length = args.length;
8434
+ var array = [];
8435
+ for (var i = 0; i < length; i++)
8436
+ array[i] = args[i];
8437
+ return array;
8438
+ }
8439
+ }
8440
+ });
8441
+
8442
+ // node_modules/.pnpm/glob@8.1.0/node_modules/glob/glob.js
8443
+ var require_glob = __commonJS({
8444
+ "node_modules/.pnpm/glob@8.1.0/node_modules/glob/glob.js"(exports, module2) {
8445
+ module2.exports = glob2;
8446
+ var rp = require_fs();
8447
+ var minimatch = require_minimatch();
8448
+ var Minimatch = minimatch.Minimatch;
8449
+ var inherits = require_inherits();
8450
+ var EE = require("events").EventEmitter;
8451
+ var path = require("path");
8452
+ var assert = require("assert");
8453
+ var isAbsolute = require("path").isAbsolute;
8454
+ var globSync = require_sync();
8455
+ var common = require_common();
8456
+ var setopts = common.setopts;
8457
+ var ownProp = common.ownProp;
8458
+ var inflight = require_inflight();
8459
+ var util2 = require("util");
8460
+ var childrenIgnored = common.childrenIgnored;
8461
+ var isIgnored = common.isIgnored;
8462
+ var once = require_once();
8463
+ function glob2(pattern, options, cb) {
8464
+ if (typeof options === "function")
8465
+ cb = options, options = {};
8466
+ if (!options)
8467
+ options = {};
8468
+ if (options.sync) {
8469
+ if (cb)
8470
+ throw new TypeError("callback provided to sync glob");
8471
+ return globSync(pattern, options);
8472
+ }
8473
+ return new Glob(pattern, options, cb);
8474
+ }
8475
+ glob2.sync = globSync;
8476
+ var GlobSync = glob2.GlobSync = globSync.GlobSync;
8477
+ glob2.glob = glob2;
8478
+ function extend(origin, add) {
8479
+ if (add === null || typeof add !== "object") {
8480
+ return origin;
8481
+ }
8482
+ var keys = Object.keys(add);
8483
+ var i = keys.length;
8484
+ while (i--) {
8485
+ origin[keys[i]] = add[keys[i]];
8486
+ }
8487
+ return origin;
8488
+ }
8489
+ glob2.hasMagic = function(pattern, options_) {
8490
+ var options = extend({}, options_);
8491
+ options.noprocess = true;
8492
+ var g = new Glob(pattern, options);
8493
+ var set = g.minimatch.set;
8494
+ if (!pattern)
8495
+ return false;
8496
+ if (set.length > 1)
8497
+ return true;
8498
+ for (var j = 0; j < set[0].length; j++) {
8499
+ if (typeof set[0][j] !== "string")
8500
+ return true;
8501
+ }
8502
+ return false;
8503
+ };
8504
+ glob2.Glob = Glob;
8505
+ inherits(Glob, EE);
8506
+ function Glob(pattern, options, cb) {
8507
+ if (typeof options === "function") {
8508
+ cb = options;
8509
+ options = null;
8510
+ }
8511
+ if (options && options.sync) {
8512
+ if (cb)
8513
+ throw new TypeError("callback provided to sync glob");
8514
+ return new GlobSync(pattern, options);
8515
+ }
8516
+ if (!(this instanceof Glob))
8517
+ return new Glob(pattern, options, cb);
8518
+ setopts(this, pattern, options);
8519
+ this._didRealPath = false;
8520
+ var n = this.minimatch.set.length;
8521
+ this.matches = new Array(n);
8522
+ if (typeof cb === "function") {
8523
+ cb = once(cb);
8524
+ this.on("error", cb);
8525
+ this.on("end", function(matches) {
8526
+ cb(null, matches);
8527
+ });
8528
+ }
8529
+ var self2 = this;
8530
+ this._processing = 0;
8531
+ this._emitQueue = [];
8532
+ this._processQueue = [];
8533
+ this.paused = false;
8534
+ if (this.noprocess)
8535
+ return this;
8536
+ if (n === 0)
8537
+ return done();
8538
+ var sync = true;
8539
+ for (var i = 0; i < n; i++) {
8540
+ this._process(this.minimatch.set[i], i, false, done);
8541
+ }
8542
+ sync = false;
8543
+ function done() {
8544
+ --self2._processing;
8545
+ if (self2._processing <= 0) {
8546
+ if (sync) {
8547
+ process.nextTick(function() {
8548
+ self2._finish();
8549
+ });
8550
+ } else {
8551
+ self2._finish();
8552
+ }
8553
+ }
8554
+ }
8555
+ }
8556
+ Glob.prototype._finish = function() {
8557
+ assert(this instanceof Glob);
8558
+ if (this.aborted)
8559
+ return;
8560
+ if (this.realpath && !this._didRealpath)
8561
+ return this._realpath();
8562
+ common.finish(this);
8563
+ this.emit("end", this.found);
8564
+ };
8565
+ Glob.prototype._realpath = function() {
8566
+ if (this._didRealpath)
8567
+ return;
8568
+ this._didRealpath = true;
8569
+ var n = this.matches.length;
8570
+ if (n === 0)
8571
+ return this._finish();
8572
+ var self2 = this;
8573
+ for (var i = 0; i < this.matches.length; i++)
8574
+ this._realpathSet(i, next);
8575
+ function next() {
8576
+ if (--n === 0)
8577
+ self2._finish();
8578
+ }
8579
+ };
8580
+ Glob.prototype._realpathSet = function(index4, cb) {
8581
+ var matchset = this.matches[index4];
8582
+ if (!matchset)
8583
+ return cb();
8584
+ var found = Object.keys(matchset);
8585
+ var self2 = this;
8586
+ var n = found.length;
8587
+ if (n === 0)
8588
+ return cb();
8589
+ var set = this.matches[index4] = /* @__PURE__ */ Object.create(null);
8590
+ found.forEach(function(p, i) {
8591
+ p = self2._makeAbs(p);
8592
+ rp.realpath(p, self2.realpathCache, function(er, real) {
8593
+ if (!er)
8594
+ set[real] = true;
8595
+ else if (er.syscall === "stat")
8596
+ set[p] = true;
8597
+ else
8598
+ self2.emit("error", er);
8599
+ if (--n === 0) {
8600
+ self2.matches[index4] = set;
8601
+ cb();
8602
+ }
8603
+ });
8604
+ });
8605
+ };
8606
+ Glob.prototype._mark = function(p) {
8607
+ return common.mark(this, p);
8608
+ };
8609
+ Glob.prototype._makeAbs = function(f) {
8610
+ return common.makeAbs(this, f);
8611
+ };
8612
+ Glob.prototype.abort = function() {
8613
+ this.aborted = true;
8614
+ this.emit("abort");
8615
+ };
8616
+ Glob.prototype.pause = function() {
8617
+ if (!this.paused) {
8618
+ this.paused = true;
8619
+ this.emit("pause");
8620
+ }
8621
+ };
8622
+ Glob.prototype.resume = function() {
8623
+ if (this.paused) {
8624
+ this.emit("resume");
8625
+ this.paused = false;
8626
+ if (this._emitQueue.length) {
8627
+ var eq = this._emitQueue.slice(0);
8628
+ this._emitQueue.length = 0;
8629
+ for (var i = 0; i < eq.length; i++) {
8630
+ var e = eq[i];
8631
+ this._emitMatch(e[0], e[1]);
8632
+ }
8633
+ }
8634
+ if (this._processQueue.length) {
8635
+ var pq = this._processQueue.slice(0);
8636
+ this._processQueue.length = 0;
8637
+ for (var i = 0; i < pq.length; i++) {
8638
+ var p = pq[i];
8639
+ this._processing--;
8640
+ this._process(p[0], p[1], p[2], p[3]);
8641
+ }
8642
+ }
8643
+ }
8644
+ };
8645
+ Glob.prototype._process = function(pattern, index4, inGlobStar, cb) {
8646
+ assert(this instanceof Glob);
8647
+ assert(typeof cb === "function");
8648
+ if (this.aborted)
8649
+ return;
8650
+ this._processing++;
8651
+ if (this.paused) {
8652
+ this._processQueue.push([pattern, index4, inGlobStar, cb]);
8653
+ return;
8654
+ }
8655
+ var n = 0;
8656
+ while (typeof pattern[n] === "string") {
8657
+ n++;
8658
+ }
8659
+ var prefix;
8660
+ switch (n) {
8661
+ case pattern.length:
8662
+ this._processSimple(pattern.join("/"), index4, cb);
8663
+ return;
8664
+ case 0:
8665
+ prefix = null;
8666
+ break;
8667
+ default:
8668
+ prefix = pattern.slice(0, n).join("/");
8669
+ break;
8670
+ }
8671
+ var remain = pattern.slice(n);
8672
+ var read;
8673
+ if (prefix === null)
8674
+ read = ".";
8675
+ else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
8676
+ return typeof p === "string" ? p : "[*]";
8677
+ }).join("/"))) {
8678
+ if (!prefix || !isAbsolute(prefix))
8679
+ prefix = "/" + prefix;
8680
+ read = prefix;
8681
+ } else
8682
+ read = prefix;
8683
+ var abs = this._makeAbs(read);
8684
+ if (childrenIgnored(this, read))
8685
+ return cb();
8686
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR;
8687
+ if (isGlobStar)
8688
+ this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar, cb);
8689
+ else
8690
+ this._processReaddir(prefix, read, abs, remain, index4, inGlobStar, cb);
8691
+ };
8692
+ Glob.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
8693
+ var self2 = this;
8694
+ this._readdir(abs, inGlobStar, function(er, entries) {
8695
+ return self2._processReaddir2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
8696
+ });
8697
+ };
8698
+ Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
8699
+ if (!entries)
8700
+ return cb();
8701
+ var pn = remain[0];
8702
+ var negate = !!this.minimatch.negate;
8703
+ var rawGlob = pn._glob;
8704
+ var dotOk = this.dot || rawGlob.charAt(0) === ".";
8705
+ var matchedEntries = [];
8706
+ for (var i = 0; i < entries.length; i++) {
8707
+ var e = entries[i];
8708
+ if (e.charAt(0) !== "." || dotOk) {
8709
+ var m;
8710
+ if (negate && !prefix) {
8711
+ m = !e.match(pn);
8712
+ } else {
8713
+ m = e.match(pn);
8714
+ }
8715
+ if (m)
8716
+ matchedEntries.push(e);
8717
+ }
8718
+ }
8719
+ var len = matchedEntries.length;
8720
+ if (len === 0)
8721
+ return cb();
8722
+ if (remain.length === 1 && !this.mark && !this.stat) {
8723
+ if (!this.matches[index4])
8724
+ this.matches[index4] = /* @__PURE__ */ Object.create(null);
8725
+ for (var i = 0; i < len; i++) {
8726
+ var e = matchedEntries[i];
8727
+ if (prefix) {
8728
+ if (prefix !== "/")
8729
+ e = prefix + "/" + e;
8730
+ else
8731
+ e = prefix + e;
8732
+ }
8733
+ if (e.charAt(0) === "/" && !this.nomount) {
8734
+ e = path.join(this.root, e);
8735
+ }
8736
+ this._emitMatch(index4, e);
8737
+ }
8738
+ return cb();
8739
+ }
8740
+ remain.shift();
8741
+ for (var i = 0; i < len; i++) {
8742
+ var e = matchedEntries[i];
8743
+ var newPattern;
8744
+ if (prefix) {
8745
+ if (prefix !== "/")
8746
+ e = prefix + "/" + e;
8747
+ else
8748
+ e = prefix + e;
8749
+ }
8750
+ this._process([e].concat(remain), index4, inGlobStar, cb);
8751
+ }
8752
+ cb();
8753
+ };
8754
+ Glob.prototype._emitMatch = function(index4, e) {
8755
+ if (this.aborted)
8756
+ return;
8757
+ if (isIgnored(this, e))
8758
+ return;
8759
+ if (this.paused) {
8760
+ this._emitQueue.push([index4, e]);
8761
+ return;
8762
+ }
8763
+ var abs = isAbsolute(e) ? e : this._makeAbs(e);
8764
+ if (this.mark)
8765
+ e = this._mark(e);
8766
+ if (this.absolute)
8767
+ e = abs;
8768
+ if (this.matches[index4][e])
8769
+ return;
8770
+ if (this.nodir) {
8771
+ var c = this.cache[abs];
8772
+ if (c === "DIR" || Array.isArray(c))
8773
+ return;
8774
+ }
8775
+ this.matches[index4][e] = true;
8776
+ var st = this.statCache[abs];
8777
+ if (st)
8778
+ this.emit("stat", e, st);
8779
+ this.emit("match", e);
8780
+ };
8781
+ Glob.prototype._readdirInGlobStar = function(abs, cb) {
8782
+ if (this.aborted)
8783
+ return;
8784
+ if (this.follow)
8785
+ return this._readdir(abs, false, cb);
8786
+ var lstatkey = "lstat\0" + abs;
8787
+ var self2 = this;
8788
+ var lstatcb = inflight(lstatkey, lstatcb_);
8789
+ if (lstatcb)
8790
+ self2.fs.lstat(abs, lstatcb);
8791
+ function lstatcb_(er, lstat) {
8792
+ if (er && er.code === "ENOENT")
8793
+ return cb();
8794
+ var isSym = lstat && lstat.isSymbolicLink();
8795
+ self2.symlinks[abs] = isSym;
8796
+ if (!isSym && lstat && !lstat.isDirectory()) {
8797
+ self2.cache[abs] = "FILE";
8798
+ cb();
8799
+ } else
8800
+ self2._readdir(abs, false, cb);
8801
+ }
8802
+ };
8803
+ Glob.prototype._readdir = function(abs, inGlobStar, cb) {
8804
+ if (this.aborted)
8805
+ return;
8806
+ cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
8807
+ if (!cb)
8808
+ return;
8809
+ if (inGlobStar && !ownProp(this.symlinks, abs))
8810
+ return this._readdirInGlobStar(abs, cb);
8811
+ if (ownProp(this.cache, abs)) {
8812
+ var c = this.cache[abs];
8813
+ if (!c || c === "FILE")
8814
+ return cb();
8815
+ if (Array.isArray(c))
8816
+ return cb(null, c);
8817
+ }
8818
+ var self2 = this;
8819
+ self2.fs.readdir(abs, readdirCb(this, abs, cb));
8820
+ };
8821
+ function readdirCb(self2, abs, cb) {
8822
+ return function(er, entries) {
8823
+ if (er)
8824
+ self2._readdirError(abs, er, cb);
8825
+ else
8826
+ self2._readdirEntries(abs, entries, cb);
8827
+ };
8828
+ }
8829
+ Glob.prototype._readdirEntries = function(abs, entries, cb) {
8830
+ if (this.aborted)
8831
+ return;
8832
+ if (!this.mark && !this.stat) {
8833
+ for (var i = 0; i < entries.length; i++) {
8834
+ var e = entries[i];
8835
+ if (abs === "/")
8836
+ e = abs + e;
8837
+ else
8838
+ e = abs + "/" + e;
8839
+ this.cache[e] = true;
8840
+ }
8841
+ }
8842
+ this.cache[abs] = entries;
8843
+ return cb(null, entries);
8844
+ };
8845
+ Glob.prototype._readdirError = function(f, er, cb) {
8846
+ if (this.aborted)
8847
+ return;
8848
+ switch (er.code) {
8849
+ case "ENOTSUP":
8850
+ case "ENOTDIR":
8851
+ var abs = this._makeAbs(f);
8852
+ this.cache[abs] = "FILE";
8853
+ if (abs === this.cwdAbs) {
8854
+ var error = new Error(er.code + " invalid cwd " + this.cwd);
8855
+ error.path = this.cwd;
8856
+ error.code = er.code;
8857
+ this.emit("error", error);
8858
+ this.abort();
8859
+ }
8860
+ break;
8861
+ case "ENOENT":
8862
+ case "ELOOP":
8863
+ case "ENAMETOOLONG":
8864
+ case "UNKNOWN":
8865
+ this.cache[this._makeAbs(f)] = false;
8866
+ break;
8867
+ default:
8868
+ this.cache[this._makeAbs(f)] = false;
8869
+ if (this.strict) {
8870
+ this.emit("error", er);
8871
+ this.abort();
8872
+ }
8873
+ if (!this.silent)
8874
+ console.error("glob error", er);
8875
+ break;
8876
+ }
8877
+ return cb();
8878
+ };
8879
+ Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
8880
+ var self2 = this;
8881
+ this._readdir(abs, inGlobStar, function(er, entries) {
8882
+ self2._processGlobStar2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
8883
+ });
8884
+ };
8885
+ Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
8886
+ if (!entries)
8887
+ return cb();
8888
+ var remainWithoutGlobStar = remain.slice(1);
8889
+ var gspref = prefix ? [prefix] : [];
8890
+ var noGlobStar = gspref.concat(remainWithoutGlobStar);
8891
+ this._process(noGlobStar, index4, false, cb);
8892
+ var isSym = this.symlinks[abs];
8893
+ var len = entries.length;
8894
+ if (isSym && inGlobStar)
8895
+ return cb();
8896
+ for (var i = 0; i < len; i++) {
8897
+ var e = entries[i];
8898
+ if (e.charAt(0) === "." && !this.dot)
8899
+ continue;
8900
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar);
8901
+ this._process(instead, index4, true, cb);
8902
+ var below = gspref.concat(entries[i], remain);
8903
+ this._process(below, index4, true, cb);
8904
+ }
8905
+ cb();
8906
+ };
8907
+ Glob.prototype._processSimple = function(prefix, index4, cb) {
8908
+ var self2 = this;
8909
+ this._stat(prefix, function(er, exists) {
8910
+ self2._processSimple2(prefix, index4, er, exists, cb);
8911
+ });
8912
+ };
8913
+ Glob.prototype._processSimple2 = function(prefix, index4, er, exists, cb) {
8914
+ if (!this.matches[index4])
8915
+ this.matches[index4] = /* @__PURE__ */ Object.create(null);
8916
+ if (!exists)
8917
+ return cb();
8918
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
8919
+ var trail = /[\/\\]$/.test(prefix);
8920
+ if (prefix.charAt(0) === "/") {
8921
+ prefix = path.join(this.root, prefix);
8922
+ } else {
8923
+ prefix = path.resolve(this.root, prefix);
8924
+ if (trail)
8925
+ prefix += "/";
8926
+ }
8927
+ }
8928
+ if (process.platform === "win32")
8929
+ prefix = prefix.replace(/\\/g, "/");
8930
+ this._emitMatch(index4, prefix);
8931
+ cb();
8932
+ };
8933
+ Glob.prototype._stat = function(f, cb) {
8934
+ var abs = this._makeAbs(f);
8935
+ var needDir = f.slice(-1) === "/";
8936
+ if (f.length > this.maxLength)
8937
+ return cb();
8938
+ if (!this.stat && ownProp(this.cache, abs)) {
8939
+ var c = this.cache[abs];
8940
+ if (Array.isArray(c))
8941
+ c = "DIR";
8942
+ if (!needDir || c === "DIR")
8943
+ return cb(null, c);
8944
+ if (needDir && c === "FILE")
8945
+ return cb();
8946
+ }
8947
+ var exists;
8948
+ var stat = this.statCache[abs];
8949
+ if (stat !== void 0) {
8950
+ if (stat === false)
8951
+ return cb(null, stat);
8952
+ else {
8953
+ var type = stat.isDirectory() ? "DIR" : "FILE";
8954
+ if (needDir && type === "FILE")
8955
+ return cb();
8956
+ else
8957
+ return cb(null, type, stat);
8958
+ }
8959
+ }
8960
+ var self2 = this;
8961
+ var statcb = inflight("stat\0" + abs, lstatcb_);
8962
+ if (statcb)
8963
+ self2.fs.lstat(abs, statcb);
8964
+ function lstatcb_(er, lstat) {
8965
+ if (lstat && lstat.isSymbolicLink()) {
8966
+ return self2.fs.stat(abs, function(er2, stat2) {
8967
+ if (er2)
8968
+ self2._stat2(f, abs, null, lstat, cb);
8969
+ else
8970
+ self2._stat2(f, abs, er2, stat2, cb);
8971
+ });
8972
+ } else {
8973
+ self2._stat2(f, abs, er, lstat, cb);
8974
+ }
8975
+ }
8976
+ };
8977
+ Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
8978
+ if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
8979
+ this.statCache[abs] = false;
8980
+ return cb();
8981
+ }
8982
+ var needDir = f.slice(-1) === "/";
8983
+ this.statCache[abs] = stat;
8984
+ if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
8985
+ return cb(null, false, stat);
8986
+ var c = true;
8987
+ if (stat)
8988
+ c = stat.isDirectory() ? "DIR" : "FILE";
8989
+ this.cache[abs] = this.cache[abs] || c;
8990
+ if (needDir && c === "FILE")
8991
+ return cb();
8992
+ return cb(null, c, stat);
8993
+ };
8994
+ }
8995
+ });
8996
+
8997
+ // src/serializer/index.ts
8998
+ var import_glob;
8999
+ var init_serializer = __esm({
9000
+ "src/serializer/index.ts"() {
9001
+ import_glob = __toESM(require_glob());
9002
+ }
9003
+ });
9004
+
6662
9005
  // src/utils.ts
6663
9006
  var utils_exports = {};
6664
9007
  __export(utils_exports, {
@@ -8785,9 +11128,9 @@ var ZodArray = class extends ZodType {
8785
11128
  return this.min(1, message);
8786
11129
  }
8787
11130
  };
8788
- ZodArray.create = (schema3, params) => {
11131
+ ZodArray.create = (schema4, params) => {
8789
11132
  return new ZodArray({
8790
- type: schema3,
11133
+ type: schema4,
8791
11134
  minLength: null,
8792
11135
  maxLength: null,
8793
11136
  exactLength: null,
@@ -8813,27 +11156,27 @@ var AugmentFactory = (def) => (augmentation) => {
8813
11156
  })
8814
11157
  });
8815
11158
  };
8816
- function deepPartialify(schema3) {
8817
- if (schema3 instanceof ZodObject) {
11159
+ function deepPartialify(schema4) {
11160
+ if (schema4 instanceof ZodObject) {
8818
11161
  const newShape = {};
8819
- for (const key in schema3.shape) {
8820
- const fieldSchema = schema3.shape[key];
11162
+ for (const key in schema4.shape) {
11163
+ const fieldSchema = schema4.shape[key];
8821
11164
  newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
8822
11165
  }
8823
11166
  return new ZodObject({
8824
- ...schema3._def,
11167
+ ...schema4._def,
8825
11168
  shape: () => newShape
8826
11169
  });
8827
- } else if (schema3 instanceof ZodArray) {
8828
- return ZodArray.create(deepPartialify(schema3.element));
8829
- } else if (schema3 instanceof ZodOptional) {
8830
- return ZodOptional.create(deepPartialify(schema3.unwrap()));
8831
- } else if (schema3 instanceof ZodNullable) {
8832
- return ZodNullable.create(deepPartialify(schema3.unwrap()));
8833
- } else if (schema3 instanceof ZodTuple) {
8834
- return ZodTuple.create(schema3.items.map((item) => deepPartialify(item)));
11170
+ } else if (schema4 instanceof ZodArray) {
11171
+ return ZodArray.create(deepPartialify(schema4.element));
11172
+ } else if (schema4 instanceof ZodOptional) {
11173
+ return ZodOptional.create(deepPartialify(schema4.unwrap()));
11174
+ } else if (schema4 instanceof ZodNullable) {
11175
+ return ZodNullable.create(deepPartialify(schema4.unwrap()));
11176
+ } else if (schema4 instanceof ZodTuple) {
11177
+ return ZodTuple.create(schema4.items.map((item) => deepPartialify(item)));
8835
11178
  } else {
8836
- return schema3;
11179
+ return schema4;
8837
11180
  }
8838
11181
  }
8839
11182
  var ZodObject = class extends ZodType {
@@ -8971,8 +11314,8 @@ var ZodObject = class extends ZodType {
8971
11314
  unknownKeys: "passthrough"
8972
11315
  });
8973
11316
  }
8974
- setKey(key, schema3) {
8975
- return this.augment({ [key]: schema3 });
11317
+ setKey(key, schema4) {
11318
+ return this.augment({ [key]: schema4 });
8976
11319
  }
8977
11320
  merge(merging) {
8978
11321
  const merged = new ZodObject({
@@ -9405,10 +11748,10 @@ var ZodTuple = class extends ZodType {
9405
11748
  status.dirty();
9406
11749
  }
9407
11750
  const items = ctx.data.map((item, itemIndex) => {
9408
- const schema3 = this._def.items[itemIndex] || this._def.rest;
9409
- if (!schema3)
11751
+ const schema4 = this._def.items[itemIndex] || this._def.rest;
11752
+ if (!schema4)
9410
11753
  return null;
9411
- return schema3._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
11754
+ return schema4._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
9412
11755
  }).filter((x) => !!x);
9413
11756
  if (ctx.common.async) {
9414
11757
  return Promise.all(items).then((results) => {
@@ -9901,9 +12244,9 @@ var ZodPromise = class extends ZodType {
9901
12244
  }));
9902
12245
  }
9903
12246
  };
9904
- ZodPromise.create = (schema3, params) => {
12247
+ ZodPromise.create = (schema4, params) => {
9905
12248
  return new ZodPromise({
9906
- type: schema3,
12249
+ type: schema4,
9907
12250
  typeName: ZodFirstPartyTypeKind.ZodPromise,
9908
12251
  ...processCreateParams(params)
9909
12252
  });
@@ -10010,17 +12353,17 @@ var ZodEffects = class extends ZodType {
10010
12353
  util.assertNever(effect);
10011
12354
  }
10012
12355
  };
10013
- ZodEffects.create = (schema3, effect, params) => {
12356
+ ZodEffects.create = (schema4, effect, params) => {
10014
12357
  return new ZodEffects({
10015
- schema: schema3,
12358
+ schema: schema4,
10016
12359
  typeName: ZodFirstPartyTypeKind.ZodEffects,
10017
12360
  effect,
10018
12361
  ...processCreateParams(params)
10019
12362
  });
10020
12363
  };
10021
- ZodEffects.createWithPreprocess = (preprocess, schema3, params) => {
12364
+ ZodEffects.createWithPreprocess = (preprocess, schema4, params) => {
10022
12365
  return new ZodEffects({
10023
- schema: schema3,
12366
+ schema: schema4,
10024
12367
  effect: { type: "preprocess", transform: preprocess },
10025
12368
  typeName: ZodFirstPartyTypeKind.ZodEffects,
10026
12369
  ...processCreateParams(params)
@@ -10962,22 +13305,22 @@ function applyJsonDiff(json1, json2) {
10962
13305
  var findAlternationsInTable = (table4, tableSchema) => {
10963
13306
  var _a;
10964
13307
  const columns = (_a = table4.columns) != null ? _a : {};
10965
- let schema3 = {
13308
+ let schema4 = {
10966
13309
  type: "none",
10967
13310
  value: tableSchema
10968
13311
  };
10969
13312
  if ("schema" in table4) {
10970
13313
  if (table4.schema.__new) {
10971
- schema3 = { type: "changed", old: table4.schema.__old, new: table4.schema.__new };
13314
+ schema4 = { type: "changed", old: table4.schema.__old, new: table4.schema.__new };
10972
13315
  } else {
10973
- schema3 = { type: "deleted", value: table4.schema.__old };
13316
+ schema4 = { type: "deleted", value: table4.schema.__old };
10974
13317
  }
10975
13318
  }
10976
13319
  if ("schema__added" in table4) {
10977
- schema3 = { type: "added", value: table4.schema__added };
13320
+ schema4 = { type: "added", value: table4.schema__added };
10978
13321
  }
10979
13322
  if ("schema__deleted" in table4) {
10980
- schema3 = { type: "deleted", value: table4.schema__deleted };
13323
+ schema4 = { type: "deleted", value: table4.schema__deleted };
10981
13324
  }
10982
13325
  const added = Object.keys(columns).filter((it) => it.includes("__added")).map((it) => {
10983
13326
  return { ...columns[it] };
@@ -11013,7 +13356,7 @@ var findAlternationsInTable = (table4, tableSchema) => {
11013
13356
  const mappedAltered = altered.map((it) => alternationsInColumn(it));
11014
13357
  return {
11015
13358
  name: table4.name,
11016
- schema: schema3,
13359
+ schema: schema4,
11017
13360
  deleted,
11018
13361
  added,
11019
13362
  altered: mappedAltered,
@@ -11091,10 +13434,30 @@ var alternationsInColumn = (column4) => {
11091
13434
  return { ...others, autoincrement: { type: "deleted", value: it.autoincrement__deleted } };
11092
13435
  }
11093
13436
  return it;
13437
+ }).map((it) => {
13438
+ if ("primaryKey" in it) {
13439
+ return { ...it, primaryKey: { type: "changed", old: it.primaryKey.__old, new: it.primaryKey.__new } };
13440
+ }
13441
+ if ("primaryKey__added" in it) {
13442
+ const { primaryKey__added, ...others } = it;
13443
+ return { ...others, primaryKey: { type: "added", value: it.primaryKey__added } };
13444
+ }
13445
+ if ("primaryKey__deleted" in it) {
13446
+ const { primaryKey__deleted, ...others } = it;
13447
+ return { ...others, primaryKey: { type: "deleted", value: it.primaryKey__deleted } };
13448
+ }
13449
+ return it;
11094
13450
  });
11095
13451
  return result[0];
11096
13452
  };
11097
13453
 
13454
+ // src/migrationPreparator.ts
13455
+ init_serializer();
13456
+
13457
+ // src/cli/commands/migrate.ts
13458
+ var import_hanji2 = __toESM(require_hanji());
13459
+ var BREAKPOINT = "--> statement-breakpoint\n";
13460
+
11098
13461
  // src/sqlgenerator.ts
11099
13462
  var pgNativeTypes = /* @__PURE__ */ new Set([
11100
13463
  "uuid",
@@ -11150,9 +13513,9 @@ var PgCreateTableConvertor = class extends Convertor {
11150
13513
  return statement.type === "create_table" && dialect3 === "pg";
11151
13514
  }
11152
13515
  convert(st) {
11153
- const { tableName, schema: schema3, columns, compositePKs } = st;
13516
+ const { tableName, schema: schema4, columns, compositePKs } = st;
11154
13517
  let statement = "";
11155
- const name = schema3 ? `"${schema3}"."${tableName}"` : `"${tableName}"`;
13518
+ const name = schema4 ? `"${schema4}"."${tableName}"` : `"${tableName}"`;
11156
13519
  statement += `CREATE TABLE IF NOT EXISTS ${name} (
11157
13520
  `;
11158
13521
  for (let i = 0; i < columns.length; i++) {
@@ -11169,6 +13532,7 @@ var PgCreateTableConvertor = class extends Convertor {
11169
13532
  `;
11170
13533
  if (typeof compositePKs !== "undefined" && compositePKs.length > 0) {
11171
13534
  const compositePK4 = PgSquasher.unsquashPK(compositePKs[0]);
13535
+ statement += BREAKPOINT;
11172
13536
  statement += `ALTER TABLE ${name} ADD CONSTRAINT "${st.compositePkName}" PRIMARY KEY("${compositePK4.columns.join('","')}");`;
11173
13537
  statement += `
11174
13538
  `;
@@ -11181,9 +13545,9 @@ var MySqlCreateTableConvertor = class extends Convertor {
11181
13545
  return statement.type === "create_table" && dialect3 === "mysql";
11182
13546
  }
11183
13547
  convert(st) {
11184
- const { tableName, columns, schema: schema3, compositePKs } = st;
13548
+ const { tableName, columns, schema: schema4, compositePKs } = st;
11185
13549
  let statement = "";
11186
- const tName = schema3 ? `\`${schema3}\`.\`${tableName}\`` : `\`${tableName}\``;
13550
+ const tName = schema4 ? `\`${schema4}\`.\`${tableName}\`` : `\`${tableName}\``;
11187
13551
  statement += `CREATE TABLE ${tName} (
11188
13552
  `;
11189
13553
  for (let i = 0; i < columns.length; i++) {
@@ -11201,7 +13565,10 @@ var MySqlCreateTableConvertor = class extends Convertor {
11201
13565
  `;
11202
13566
  if (typeof compositePKs !== "undefined" && compositePKs.length > 0) {
11203
13567
  const compositePK4 = MySqlSquasher.unsquashPK(compositePKs[0]);
11204
- statement += `ALTER TABLE ${tName} ADD PRIMARY KEY(\`${compositePK4.columns.join("`,`")}\`);`;
13568
+ statement += BREAKPOINT;
13569
+ statement += `ALTER TABLE ${tName} ADD PRIMARY KEY(\`${compositePK4.columns.join(
13570
+ "`,`"
13571
+ )}\`);`;
11205
13572
  statement += `
11206
13573
  `;
11207
13574
  }
@@ -11303,9 +13670,9 @@ var PgRenameTableConvertor = class extends Convertor {
11303
13670
  return statement.type === "rename_table" && dialect3 === "pg";
11304
13671
  }
11305
13672
  convert(statement) {
11306
- const { tableNameFrom, tableNameTo, toSchema: schema3 } = statement;
11307
- const from = schema3 ? `"${schema3}"."${tableNameFrom}"` : `"${tableNameFrom}"`;
11308
- const to = schema3 ? `"${schema3}"."${tableNameTo}"` : `"${tableNameTo}"`;
13673
+ const { tableNameFrom, tableNameTo, toSchema: schema4 } = statement;
13674
+ const from = schema4 ? `"${schema4}"."${tableNameFrom}"` : `"${tableNameFrom}"`;
13675
+ const to = schema4 ? `"${schema4}"."${tableNameTo}"` : `"${tableNameTo}"`;
11309
13676
  return `ALTER TABLE ${from} RENAME TO ${to};`;
11310
13677
  }
11311
13678
  };
@@ -11601,7 +13968,7 @@ var PgAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
11601
13968
  statement.new
11602
13969
  );
11603
13970
  return `ALTER TABLE "${statement.tableName}" DROP CONSTRAINT ${statement.oldConstraintName};
11604
- ALTER TABLE "${statement.tableName}" ADD CONSTRAINT ${statement.newConstraintName} PRIMARY KEY(${newColumns.join(",")});`;
13971
+ ${BREAKPOINT}ALTER TABLE "${statement.tableName}" ADD CONSTRAINT ${statement.newConstraintName} PRIMARY KEY(${newColumns.join(",")});`;
11605
13972
  }
11606
13973
  };
11607
13974
  var MySqlAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
@@ -11713,6 +14080,39 @@ var SqliteAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor
11713
14080
  return msg;
11714
14081
  }
11715
14082
  };
14083
+ var PgAlterTableAlterColumnSetPrimaryKeyConvertor = class extends Convertor {
14084
+ can(statement, dialect3) {
14085
+ return statement.type === "alter_table_alter_column_set_primarykey" && dialect3 === "pg";
14086
+ }
14087
+ convert(statement) {
14088
+ const { tableName, columnName } = statement;
14089
+ return `ALTER TABLE "${tableName}" ADD PRIMARY KEY ("${columnName}");`;
14090
+ }
14091
+ };
14092
+ var PgAlterTableAlterColumnDropPrimaryKeyConvertor = class extends Convertor {
14093
+ can(statement, dialect3) {
14094
+ return statement.type === "alter_table_alter_column_drop_primarykey" && dialect3 === "pg";
14095
+ }
14096
+ convert(statement) {
14097
+ const { tableName, columnName, schema: schema4 } = statement;
14098
+ return `/*
14099
+ Unfortunately in current drizzle-kit version we can't automatically get name for primary key.
14100
+ We are working on making it available!
14101
+
14102
+ Meanwhile you can:
14103
+ 1. Check pk name in your database, by running
14104
+ SELECT constraint_name FROM information_schema.table_constraints
14105
+ WHERE table_schema = '${typeof schema4 === "undefined" || schema4 === "" ? "public" : schema4}'
14106
+ AND table_name = '${tableName}'
14107
+ AND constraint_type = 'PRIMARY KEY';
14108
+ 2. Uncomment code below and paste pk name manually
14109
+
14110
+ Hope to release this update as soon as possible
14111
+ */
14112
+
14113
+ -- ALTER TABLE "${tableName}" DROP CONSTRAINT "<constraint_name>";`;
14114
+ }
14115
+ };
11716
14116
  var PgAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
11717
14117
  can(statement, dialect3) {
11718
14118
  return statement.type === "alter_table_alter_column_set_notnull" && dialect3 === "pg";
@@ -11978,8 +14378,8 @@ var PgAlterTableSetSchemaConvertor = class extends Convertor {
11978
14378
  return statement.type === "alter_table_set_schema" && dialect3 === "pg";
11979
14379
  }
11980
14380
  convert(statement) {
11981
- const { tableName, schema: schema3 } = statement;
11982
- return `ALTER TABLE "${tableName}" SET SCHEMA "${schema3}";
14381
+ const { tableName, schema: schema4 } = statement;
14382
+ return `ALTER TABLE "${tableName}" SET SCHEMA "${schema4}";
11983
14383
  `;
11984
14384
  }
11985
14385
  };
@@ -12037,9 +14437,9 @@ var MysqlAlterTableSetSchemaConvertor = class extends Convertor {
12037
14437
  return statement.type === "alter_table_set_schema" && dialect3 === "mysql";
12038
14438
  }
12039
14439
  convert(statement) {
12040
- const { tableName, schema: schema3 } = statement;
14440
+ const { tableName, schema: schema4 } = statement;
12041
14441
  const nameFrom = `\`${tableName}\``;
12042
- const nameTo = `\`${schema3}\`.\`${tableName}\``;
14442
+ const nameTo = `\`${schema4}\`.\`${tableName}\``;
12043
14443
  return `RENAME TABLE ${nameFrom} TO ${nameTo};
12044
14444
  `;
12045
14445
  }
@@ -12061,8 +14461,8 @@ var MysqlAlterTableRemoveFromSchemaConvertor = class extends Convertor {
12061
14461
  return statement.type === "alter_table_remove_from_schema" && dialect3 === "mysql";
12062
14462
  }
12063
14463
  convert(statement) {
12064
- const { tableName, schema: schema3 } = statement;
12065
- const nameFrom = `\`${schema3}\`.\`${tableName}\``;
14464
+ const { tableName, schema: schema4 } = statement;
14465
+ const nameFrom = `\`${schema4}\`.\`${tableName}\``;
12066
14466
  const nameTo = `\`${tableName}\``;
12067
14467
  return `RENAME TABLE ${nameFrom} TO ${nameTo};
12068
14468
  `;
@@ -12104,6 +14504,8 @@ convertors.push(new PgDropIndexConvertor());
12104
14504
  convertors.push(new SqliteDropIndexConvertor());
12105
14505
  convertors.push(new MySqlDropIndexConvertor());
12106
14506
  convertors.push(new AlterTypeAddValueConvertor());
14507
+ convertors.push(new PgAlterTableAlterColumnSetPrimaryKeyConvertor());
14508
+ convertors.push(new PgAlterTableAlterColumnDropPrimaryKeyConvertor());
12107
14509
  convertors.push(new PgAlterTableAlterColumnSetNotNullConvertor());
12108
14510
  convertors.push(new PgAlterTableAlterColumnDropNotNullConvertor());
12109
14511
  convertors.push(new PgAlterTableAlterColumnSetDefaultConvertor());
@@ -12152,7 +14554,7 @@ var fromJson = (statements, dialect3) => {
12152
14554
  const convertor = filtered.length === 1 ? filtered[0] : void 0;
12153
14555
  if (!convertor) {
12154
14556
  console.log("no convertor:", statement.type, dialect3);
12155
- return "dry run";
14557
+ return "";
12156
14558
  }
12157
14559
  return convertor.convert(statement);
12158
14560
  });
@@ -12185,11 +14587,11 @@ drop type __venum;
12185
14587
 
12186
14588
  // src/jsonStatements.ts
12187
14589
  var preparePgCreateTableJson = (table4, json2) => {
12188
- const { name, schema: schema3, columns, compositePrimaryKeys } = table4;
14590
+ const { name, schema: schema4, columns, compositePrimaryKeys } = table4;
12189
14591
  return {
12190
14592
  type: "create_table",
12191
14593
  tableName: name,
12192
- schema: schema3,
14594
+ schema: schema4,
12193
14595
  columns: Object.values(columns),
12194
14596
  compositePKs: Object.values(compositePrimaryKeys),
12195
14597
  compositePkName: Object.values(compositePrimaryKeys).length > 0 ? json2.tables[name].compositePrimaryKeys[`${name}_${PgSquasher.unsquashPK(
@@ -12198,11 +14600,11 @@ var preparePgCreateTableJson = (table4, json2) => {
12198
14600
  };
12199
14601
  };
12200
14602
  var prepareMySqlCreateTableJson = (table4, json2) => {
12201
- const { name, schema: schema3, columns, compositePrimaryKeys } = table4;
14603
+ const { name, schema: schema4, columns, compositePrimaryKeys } = table4;
12202
14604
  return {
12203
14605
  type: "create_table",
12204
14606
  tableName: name,
12205
- schema: schema3,
14607
+ schema: schema4,
12206
14608
  columns: Object.values(columns),
12207
14609
  compositePKs: Object.values(compositePrimaryKeys),
12208
14610
  compositePkName: Object.values(compositePrimaryKeys).length > 0 ? json2.tables[name].compositePrimaryKeys[`${name}_${MySqlSquasher.unsquashPK(
@@ -12281,21 +14683,21 @@ var prepareDeleteSchemasJson = (values) => {
12281
14683
  };
12282
14684
  });
12283
14685
  };
12284
- var prepareRenameColumns = (tableName, schema3, pairs) => {
14686
+ var prepareRenameColumns = (tableName, schema4, pairs) => {
12285
14687
  return pairs.map((it) => {
12286
14688
  return {
12287
14689
  type: "alter_table_rename_column",
12288
14690
  tableName,
12289
14691
  oldColumnName: it.from.name,
12290
14692
  newColumnName: it.to.name,
12291
- schema: schema3
14693
+ schema: schema4
12292
14694
  };
12293
14695
  });
12294
14696
  };
12295
- var prepareAlterTableColumnsJson = (tableName, schema3, deleted, added, altered, addedFk, json2, dialect3) => {
14697
+ var prepareAlterTableColumnsJson = (tableName, schema4, deleted, added, altered, addedFk, json2, dialect3) => {
12296
14698
  const addColumns = [];
12297
- const dropColumns = _prepareDropColumns(tableName, schema3, deleted);
12298
- const alterColumns = _prepareAlterColumns(tableName, schema3, altered, json2);
14699
+ const dropColumns = _prepareDropColumns(tableName, schema4, deleted);
14700
+ const alterColumns = _prepareAlterColumns(tableName, schema4, altered, json2);
12299
14701
  if (dialect3 === "sqlite") {
12300
14702
  let jsonCreateFKStatements = Object.values(addedFk);
12301
14703
  const sqliteAddColumns = _prepareSQLiteAddColumns(
@@ -12305,27 +14707,27 @@ var prepareAlterTableColumnsJson = (tableName, schema3, deleted, added, altered,
12305
14707
  );
12306
14708
  addColumns.push(...sqliteAddColumns);
12307
14709
  } else {
12308
- addColumns.push(..._prepareAddColumns(tableName, schema3, added));
14710
+ addColumns.push(..._prepareAddColumns(tableName, schema4, added));
12309
14711
  }
12310
14712
  return { addColumns, dropColumns, alterColumns };
12311
14713
  };
12312
- var _prepareDropColumns = (taleName, schema3, columns) => {
14714
+ var _prepareDropColumns = (taleName, schema4, columns) => {
12313
14715
  return columns.map((it) => {
12314
14716
  return {
12315
14717
  type: "alter_table_drop_column",
12316
14718
  tableName: taleName,
12317
14719
  columnName: it.name,
12318
- schema: schema3
14720
+ schema: schema4
12319
14721
  };
12320
14722
  });
12321
14723
  };
12322
- var _prepareAddColumns = (tableName, schema3, columns) => {
14724
+ var _prepareAddColumns = (tableName, schema4, columns) => {
12323
14725
  return columns.map((it) => {
12324
14726
  return {
12325
14727
  type: "alter_table_add_column",
12326
14728
  tableName,
12327
14729
  column: it,
12328
- schema: schema3
14730
+ schema: schema4
12329
14731
  };
12330
14732
  });
12331
14733
  };
@@ -12345,8 +14747,8 @@ var _prepareSQLiteAddColumns = (tableName, columns, referenceData) => {
12345
14747
  };
12346
14748
  });
12347
14749
  };
12348
- var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12349
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
14750
+ var _prepareAlterColumns = (tableName, schema4, columns, json2) => {
14751
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
12350
14752
  let statements = [];
12351
14753
  for (const column4 of columns) {
12352
14754
  const columnName = typeof column4.name !== "string" ? column4.name.new : column4.name;
@@ -12361,7 +14763,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12361
14763
  tableName,
12362
14764
  oldColumnName: column4.name.old,
12363
14765
  newColumnName: column4.name.new,
12364
- schema: schema3
14766
+ schema: schema4
12365
14767
  });
12366
14768
  }
12367
14769
  if (((_a = column4.type) == null ? void 0 : _a.type) === "changed") {
@@ -12370,7 +14772,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12370
14772
  tableName,
12371
14773
  columnName,
12372
14774
  newDataType: column4.type.new,
12373
- schema: schema3,
14775
+ schema: schema4,
12374
14776
  columnDefault,
12375
14777
  columnOnUpdate,
12376
14778
  columnNotNull,
@@ -12383,7 +14785,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12383
14785
  tableName,
12384
14786
  columnName,
12385
14787
  newDefaultValue: column4.default.value,
12386
- schema: schema3
14788
+ schema: schema4
12387
14789
  });
12388
14790
  }
12389
14791
  if (((_c = column4.default) == null ? void 0 : _c.type) === "changed") {
@@ -12392,7 +14794,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12392
14794
  tableName,
12393
14795
  columnName,
12394
14796
  newDefaultValue: column4.default.new,
12395
- schema: schema3
14797
+ schema: schema4
12396
14798
  });
12397
14799
  }
12398
14800
  if (((_d = column4.default) == null ? void 0 : _d.type) === "deleted") {
@@ -12400,7 +14802,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12400
14802
  type: "alter_table_alter_column_drop_default",
12401
14803
  tableName,
12402
14804
  columnName,
12403
- schema: schema3
14805
+ schema: schema4
12404
14806
  });
12405
14807
  }
12406
14808
  if (((_e = column4.notNull) == null ? void 0 : _e.type) === "added") {
@@ -12408,7 +14810,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12408
14810
  type: "alter_table_alter_column_set_notnull",
12409
14811
  tableName,
12410
14812
  columnName,
12411
- schema: schema3,
14813
+ schema: schema4,
12412
14814
  newDataType: columnType,
12413
14815
  columnDefault,
12414
14816
  columnOnUpdate,
@@ -12422,7 +14824,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12422
14824
  type,
12423
14825
  tableName,
12424
14826
  columnName,
12425
- schema: schema3,
14827
+ schema: schema4,
12426
14828
  newDataType: columnType,
12427
14829
  columnDefault,
12428
14830
  columnOnUpdate,
@@ -12435,7 +14837,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12435
14837
  type: "alter_table_alter_column_drop_notnull",
12436
14838
  tableName,
12437
14839
  columnName,
12438
- schema: schema3,
14840
+ schema: schema4,
12439
14841
  newDataType: columnType,
12440
14842
  columnDefault,
12441
14843
  columnOnUpdate,
@@ -12448,7 +14850,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12448
14850
  type: "alter_table_alter_column_set_autoincrement",
12449
14851
  tableName,
12450
14852
  columnName,
12451
- schema: schema3,
14853
+ schema: schema4,
12452
14854
  newDataType: columnType,
12453
14855
  columnDefault,
12454
14856
  columnOnUpdate,
@@ -12462,7 +14864,7 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12462
14864
  type,
12463
14865
  tableName,
12464
14866
  columnName,
12465
- schema: schema3,
14867
+ schema: schema4,
12466
14868
  newDataType: columnType,
12467
14869
  columnDefault,
12468
14870
  columnOnUpdate,
@@ -12475,7 +14877,47 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12475
14877
  type: "alter_table_alter_column_drop_autoincrement",
12476
14878
  tableName,
12477
14879
  columnName,
12478
- schema: schema3,
14880
+ schema: schema4,
14881
+ newDataType: columnType,
14882
+ columnDefault,
14883
+ columnOnUpdate,
14884
+ columnNotNull,
14885
+ columnAutoIncrement
14886
+ });
14887
+ }
14888
+ if (((_k = column4.primaryKey) == null ? void 0 : _k.type) === "added") {
14889
+ statements.push({
14890
+ type: "alter_table_alter_column_set_primarykey",
14891
+ tableName,
14892
+ columnName,
14893
+ schema: schema4,
14894
+ newDataType: columnType,
14895
+ columnDefault,
14896
+ columnOnUpdate,
14897
+ columnNotNull,
14898
+ columnAutoIncrement
14899
+ });
14900
+ }
14901
+ if (((_l = column4.primaryKey) == null ? void 0 : _l.type) === "changed") {
14902
+ const type = column4.primaryKey.new ? "alter_table_alter_column_set_primarykey" : "alter_table_alter_column_drop_primarykey";
14903
+ statements.push({
14904
+ type,
14905
+ tableName,
14906
+ columnName,
14907
+ schema: schema4,
14908
+ newDataType: columnType,
14909
+ columnDefault,
14910
+ columnOnUpdate,
14911
+ columnNotNull,
14912
+ columnAutoIncrement
14913
+ });
14914
+ }
14915
+ if (((_m = column4.primaryKey) == null ? void 0 : _m.type) === "deleted") {
14916
+ statements.push({
14917
+ type: "alter_table_alter_column_drop_primarykey",
14918
+ tableName,
14919
+ columnName,
14920
+ schema: schema4,
12479
14921
  newDataType: columnType,
12480
14922
  columnDefault,
12481
14923
  columnOnUpdate,
@@ -12483,12 +14925,12 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12483
14925
  columnAutoIncrement
12484
14926
  });
12485
14927
  }
12486
- if (((_k = column4.onUpdate) == null ? void 0 : _k.type) === "added") {
14928
+ if (((_n = column4.onUpdate) == null ? void 0 : _n.type) === "added") {
12487
14929
  statements.push({
12488
14930
  type: "alter_table_alter_column_set_on_update",
12489
14931
  tableName,
12490
14932
  columnName,
12491
- schema: schema3,
14933
+ schema: schema4,
12492
14934
  newDataType: columnType,
12493
14935
  columnDefault,
12494
14936
  columnOnUpdate,
@@ -12496,12 +14938,12 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12496
14938
  columnAutoIncrement
12497
14939
  });
12498
14940
  }
12499
- if (((_l = column4.onUpdate) == null ? void 0 : _l.type) === "deleted") {
14941
+ if (((_o = column4.onUpdate) == null ? void 0 : _o.type) === "deleted") {
12500
14942
  statements.push({
12501
14943
  type: "alter_table_alter_column_drop_on_update",
12502
14944
  tableName,
12503
14945
  columnName,
12504
- schema: schema3,
14946
+ schema: schema4,
12505
14947
  newDataType: columnType,
12506
14948
  columnDefault,
12507
14949
  columnOnUpdate,
@@ -12512,54 +14954,54 @@ var _prepareAlterColumns = (tableName, schema3, columns, json2) => {
12512
14954
  }
12513
14955
  return statements;
12514
14956
  };
12515
- var prepareCreateIndexesJson = (tableName, schema3, indexes) => {
14957
+ var prepareCreateIndexesJson = (tableName, schema4, indexes) => {
12516
14958
  return Object.values(indexes).map((indexData) => {
12517
14959
  return {
12518
14960
  type: "create_index",
12519
14961
  tableName,
12520
14962
  data: indexData,
12521
- schema: schema3
14963
+ schema: schema4
12522
14964
  };
12523
14965
  });
12524
14966
  };
12525
- var prepareCreateReferencesJson = (tableName, schema3, foreignKeys) => {
14967
+ var prepareCreateReferencesJson = (tableName, schema4, foreignKeys) => {
12526
14968
  return Object.values(foreignKeys).map((fkData) => {
12527
14969
  return {
12528
14970
  type: "create_reference",
12529
14971
  tableName,
12530
14972
  data: fkData,
12531
- schema: schema3
14973
+ schema: schema4
12532
14974
  };
12533
14975
  });
12534
14976
  };
12535
- var prepareDropReferencesJson = (tableName, schema3, foreignKeys) => {
14977
+ var prepareDropReferencesJson = (tableName, schema4, foreignKeys) => {
12536
14978
  return Object.values(foreignKeys).map((fkData) => {
12537
14979
  return {
12538
14980
  type: "delete_reference",
12539
14981
  tableName,
12540
14982
  data: fkData,
12541
- schema: schema3
14983
+ schema: schema4
12542
14984
  };
12543
14985
  });
12544
14986
  };
12545
- var prepareAlterReferencesJson = (tableName, schema3, foreignKeys) => {
14987
+ var prepareAlterReferencesJson = (tableName, schema4, foreignKeys) => {
12546
14988
  return Object.values(foreignKeys).map((fkData) => {
12547
14989
  return {
12548
14990
  type: "alter_reference",
12549
14991
  tableName,
12550
14992
  data: fkData.__new,
12551
14993
  oldFkey: fkData.__old,
12552
- schema: schema3
14994
+ schema: schema4
12553
14995
  };
12554
14996
  });
12555
14997
  };
12556
- var prepareDropIndexesJson = (tableName, schema3, indexes) => {
14998
+ var prepareDropIndexesJson = (tableName, schema4, indexes) => {
12557
14999
  return Object.values(indexes).map((indexData) => {
12558
15000
  return {
12559
15001
  type: "drop_index",
12560
15002
  tableName,
12561
15003
  data: indexData,
12562
- schema: schema3
15004
+ schema: schema4
12563
15005
  };
12564
15006
  });
12565
15007
  };
@@ -12657,58 +15099,58 @@ var prepareAlterCompositePrimaryKeyMySql = (tableName, pks, json1, json2) => {
12657
15099
  };
12658
15100
 
12659
15101
  // src/snapshotsDiffer.ts
12660
- var makeChanged = (schema3) => {
15102
+ var makeChanged = (schema4) => {
12661
15103
  return objectType({
12662
15104
  type: enumType(["changed"]),
12663
- old: schema3,
12664
- new: schema3
15105
+ old: schema4,
15106
+ new: schema4
12665
15107
  });
12666
15108
  };
12667
- var makeSelfOrChanged = (schema3) => {
15109
+ var makeSelfOrChanged = (schema4) => {
12668
15110
  return unionType([
12669
- schema3,
15111
+ schema4,
12670
15112
  objectType({
12671
15113
  type: enumType(["changed"]),
12672
- old: schema3,
12673
- new: schema3
15114
+ old: schema4,
15115
+ new: schema4
12674
15116
  })
12675
15117
  ]);
12676
15118
  };
12677
- var makePatched = (schema3) => {
15119
+ var makePatched = (schema4) => {
12678
15120
  return unionType([
12679
15121
  objectType({
12680
15122
  type: literalType("added"),
12681
- value: schema3
15123
+ value: schema4
12682
15124
  }),
12683
15125
  objectType({
12684
15126
  type: literalType("deleted"),
12685
- value: schema3
15127
+ value: schema4
12686
15128
  }),
12687
15129
  objectType({
12688
15130
  type: literalType("changed"),
12689
- old: schema3,
12690
- new: schema3
15131
+ old: schema4,
15132
+ new: schema4
12691
15133
  })
12692
15134
  ]);
12693
15135
  };
12694
- var makeSelfOrPatched = (schema3) => {
15136
+ var makeSelfOrPatched = (schema4) => {
12695
15137
  return unionType([
12696
15138
  objectType({
12697
15139
  type: literalType("none"),
12698
- value: schema3.optional()
15140
+ value: schema4.optional()
12699
15141
  }),
12700
15142
  objectType({
12701
15143
  type: literalType("added"),
12702
- value: schema3
15144
+ value: schema4
12703
15145
  }),
12704
15146
  objectType({
12705
15147
  type: literalType("deleted"),
12706
- value: schema3
15148
+ value: schema4
12707
15149
  }),
12708
15150
  objectType({
12709
15151
  type: literalType("changed"),
12710
- old: schema3,
12711
- new: schema3
15152
+ old: schema4,
15153
+ new: schema4
12712
15154
  })
12713
15155
  ]);
12714
15156
  };
@@ -12740,6 +15182,7 @@ var alteredColumnSchema = objectType({
12740
15182
  default: makePatched(anyType()).optional(),
12741
15183
  notNull: makePatched(booleanType()).optional(),
12742
15184
  onUpdate: makePatched(booleanType()).optional(),
15185
+ primaryKey: makePatched(booleanType()).optional(),
12743
15186
  autoincrement: makePatched(booleanType()).optional()
12744
15187
  }).strict();
12745
15188
  var enumSchema2 = objectType({
@@ -12851,9 +15294,9 @@ var applySnapshotsDiff = async (json1, json2, dialect3, schemasResolver, tablesR
12851
15294
  created: table4.added,
12852
15295
  deleted: table4.deleted
12853
15296
  });
12854
- const schema3 = valueFromSelfOrPatchedNew(table4.schema);
15297
+ const schema4 = valueFromSelfOrPatchedNew(table4.schema);
12855
15298
  jsonRenameColumnsStatements.push(
12856
- ...prepareRenameColumns(table4.name, schema3, result.renamed)
15299
+ ...prepareRenameColumns(table4.name, schema4, result.renamed)
12857
15300
  );
12858
15301
  const renamedColumnsAltered = result.renamed.map(
12859
15302
  (it) => alteredColumnSchema.parse(diffForRenamedColumn(it.from, it.to))
@@ -12969,17 +15412,17 @@ var applySnapshotsDiff = async (json1, json2, dialect3, schemasResolver, tablesR
12969
15412
  });
12970
15413
  const rColumns = jsonRenameColumnsStatements.map((it) => {
12971
15414
  const tableName = it.tableName;
12972
- const schema3 = it.schema;
15415
+ const schema4 = it.schema;
12973
15416
  return {
12974
- from: { schema: schema3, table: tableName, column: it.oldColumnName },
12975
- to: { schema: schema3, table: tableName, column: it.newColumnName }
15417
+ from: { schema: schema4, table: tableName, column: it.oldColumnName },
15418
+ to: { schema: schema4, table: tableName, column: it.newColumnName }
12976
15419
  };
12977
15420
  });
12978
15421
  const jsonTableAlternations = allAlteredResolved.map((it) => {
12979
- const schema3 = valueFromSelfOrPatchedNew(it.schema);
15422
+ const schema4 = valueFromSelfOrPatchedNew(it.schema);
12980
15423
  return prepareAlterTableColumnsJson(
12981
15424
  it.name,
12982
- schema3,
15425
+ schema4,
12983
15426
  it.deleted,
12984
15427
  it.added,
12985
15428
  it.altered,
@@ -12997,27 +15440,27 @@ var applySnapshotsDiff = async (json1, json2, dialect3, schemasResolver, tablesR
12997
15440
  { createColumns: [], dropColumns: [], alterColumns: [] }
12998
15441
  );
12999
15442
  const jsonCreateIndexesForAllAlteredTables = allAltered.map((it) => {
13000
- const schema3 = valueFromSelfOrPatchedNew(it.schema);
13001
- return prepareCreateIndexesJson(it.name, schema3, it.addedIndexes || {});
15443
+ const schema4 = valueFromSelfOrPatchedNew(it.schema);
15444
+ return prepareCreateIndexesJson(it.name, schema4, it.addedIndexes || {});
13002
15445
  }).flat();
13003
15446
  const jsonDropIndexesForAllAlteredTables = allAltered.map((it) => {
13004
- const schema3 = valueFromSelfOrPatchedNew(it.schema);
13005
- return prepareDropIndexesJson(it.name, schema3, it.deletedIndexes || {});
15447
+ const schema4 = valueFromSelfOrPatchedNew(it.schema);
15448
+ return prepareDropIndexesJson(it.name, schema4, it.deletedIndexes || {});
13006
15449
  }).flat();
13007
15450
  const jsonCreateReferencesForCreatedTables = created.map((it) => {
13008
15451
  return prepareCreateReferencesJson(it.name, it.schema, it.foreignKeys);
13009
15452
  }).flat();
13010
15453
  const jsonReferencesForAllAlteredTables = allAltered.map((it) => {
13011
- const schema3 = valueFromSelfOrPatchedNew(it.schema);
13012
- const forAdded = dialect3 !== "sqlite" ? prepareCreateReferencesJson(it.name, schema3, it.addedForeignKeys) : [];
15454
+ const schema4 = valueFromSelfOrPatchedNew(it.schema);
15455
+ const forAdded = dialect3 !== "sqlite" ? prepareCreateReferencesJson(it.name, schema4, it.addedForeignKeys) : [];
13013
15456
  const forAltered = prepareDropReferencesJson(
13014
15457
  it.name,
13015
- schema3,
15458
+ schema4,
13016
15459
  it.deletedForeignKeys
13017
15460
  );
13018
15461
  const alteredFKs = prepareAlterReferencesJson(
13019
15462
  it.name,
13020
- schema3,
15463
+ schema4,
13021
15464
  it.alteredForeignKeys
13022
15465
  );
13023
15466
  return [...forAdded, ...forAltered, ...alteredFKs];
@@ -13370,8 +15813,8 @@ var tableRenameKey = (it) => {
13370
15813
  const out = it.schema ? `"${it.schema}"."${it.name}"` : `"${it.name}"`;
13371
15814
  return out;
13372
15815
  };
13373
- var columnRenameKey = (table4, schema3, column4) => {
13374
- const out = schema3 ? `"${schema3}"."${table4}"."${column4}"` : `"${table4}"."${column4}"`;
15816
+ var columnRenameKey = (table4, schema4, column4) => {
15817
+ const out = schema4 ? `"${schema4}"."${table4}"."${column4}"` : `"${table4}"."${column4}"`;
13375
15818
  return out;
13376
15819
  };
13377
15820
  var kloudMeta = () => {
@@ -13422,11 +15865,11 @@ var statementsForDiffs = async (in1, in2) => {
13422
15865
  };
13423
15866
  const columnsResolver = async (input) => {
13424
15867
  const tableName = input.tableName;
13425
- const schema3 = input.schema;
15868
+ const schema4 = input.schema;
13426
15869
  const predicate = (leftMissing, created2) => {
13427
15870
  for (let i = 0; i < leftMissing.length; i++) {
13428
15871
  const it = leftMissing[i];
13429
- if (right._meta.columns[columnRenameKey(tableName, schema3, it.name)] === columnRenameKey(tableName, schema3, created2.name)) {
15872
+ if (right._meta.columns[columnRenameKey(tableName, schema4, it.name)] === columnRenameKey(tableName, schema4, created2.name)) {
13430
15873
  return it;
13431
15874
  }
13432
15875
  }
@@ -13437,7 +15880,7 @@ var statementsForDiffs = async (in1, in2) => {
13437
15880
  input.created,
13438
15881
  predicate
13439
15882
  );
13440
- return { tableName, schema: schema3, created, renamed, deleted };
15883
+ return { tableName, schema: schema4, created, renamed, deleted };
13441
15884
  };
13442
15885
  const result = await applySnapshotsDiff(
13443
15886
  lsquashed,