drizzle-kit 0.20.6-88f61dc → 0.20.7-02055e2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.cjs +700 -613
- package/package.json +2 -3
- package/serializer/pgSerializer.d.ts +2 -0
- package/serializer/sqliteSerializer.d.ts +2 -0
- package/serializer/studioUtils.d.ts +4 -4
- package/utils-studio.d.mts +2 -2
- package/utils-studio.d.ts +2 -2
- package/utils-studio.js +700 -702
- package/utils-studio.mjs +626 -628
- package/utils.js +191 -178
- package/serializer/schemaToDrizzle.d.ts +0 -7
package/bin.cjs
CHANGED
@@ -469,8 +469,8 @@ var init_lib = __esm({
|
|
469
469
|
};
|
470
470
|
overrideErrorMap = errorMap;
|
471
471
|
makeIssue = (params) => {
|
472
|
-
const { data, path:
|
473
|
-
const fullPath = [...
|
472
|
+
const { data, path: path4, errorMaps, issueData } = params;
|
473
|
+
const fullPath = [...path4, ...issueData.path || []];
|
474
474
|
const fullIssue = {
|
475
475
|
...issueData,
|
476
476
|
path: fullPath
|
@@ -552,10 +552,10 @@ var init_lib = __esm({
|
|
552
552
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
553
553
|
})(errorUtil || (errorUtil = {}));
|
554
554
|
ParseInputLazyPath = class {
|
555
|
-
constructor(parent, value,
|
555
|
+
constructor(parent, value, path4, key) {
|
556
556
|
this.parent = parent;
|
557
557
|
this.data = value;
|
558
|
-
this._path =
|
558
|
+
this._path = path4;
|
559
559
|
this._key = key;
|
560
560
|
}
|
561
561
|
get path() {
|
@@ -5774,7 +5774,7 @@ var require_ms = __commonJS({
|
|
5774
5774
|
// node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js
|
5775
5775
|
var require_common = __commonJS({
|
5776
5776
|
"node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js"(exports, module2) {
|
5777
|
-
function setup(
|
5777
|
+
function setup(env2) {
|
5778
5778
|
createDebug.debug = createDebug;
|
5779
5779
|
createDebug.default = createDebug;
|
5780
5780
|
createDebug.coerce = coerce2;
|
@@ -5783,8 +5783,8 @@ var require_common = __commonJS({
|
|
5783
5783
|
createDebug.enabled = enabled;
|
5784
5784
|
createDebug.humanize = require_ms();
|
5785
5785
|
createDebug.destroy = destroy;
|
5786
|
-
Object.keys(
|
5787
|
-
createDebug[key] =
|
5786
|
+
Object.keys(env2).forEach((key) => {
|
5787
|
+
createDebug[key] = env2[key];
|
5788
5788
|
});
|
5789
5789
|
createDebug.names = [];
|
5790
5790
|
createDebug.skips = [];
|
@@ -6120,23 +6120,23 @@ var require_has_flag = __commonJS({
|
|
6120
6120
|
var require_supports_color = __commonJS({
|
6121
6121
|
"node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module2) {
|
6122
6122
|
"use strict";
|
6123
|
-
var
|
6123
|
+
var os2 = require("os");
|
6124
6124
|
var tty2 = require("tty");
|
6125
6125
|
var hasFlag2 = require_has_flag();
|
6126
|
-
var { env:
|
6126
|
+
var { env: env2 } = process;
|
6127
6127
|
var forceColor;
|
6128
6128
|
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
6129
6129
|
forceColor = 0;
|
6130
6130
|
} else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
|
6131
6131
|
forceColor = 1;
|
6132
6132
|
}
|
6133
|
-
if ("FORCE_COLOR" in
|
6134
|
-
if (
|
6133
|
+
if ("FORCE_COLOR" in env2) {
|
6134
|
+
if (env2.FORCE_COLOR === "true") {
|
6135
6135
|
forceColor = 1;
|
6136
|
-
} else if (
|
6136
|
+
} else if (env2.FORCE_COLOR === "false") {
|
6137
6137
|
forceColor = 0;
|
6138
6138
|
} else {
|
6139
|
-
forceColor =
|
6139
|
+
forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3);
|
6140
6140
|
}
|
6141
6141
|
}
|
6142
6142
|
function translateLevel2(level) {
|
@@ -6164,44 +6164,44 @@ var require_supports_color = __commonJS({
|
|
6164
6164
|
return 0;
|
6165
6165
|
}
|
6166
6166
|
const min = forceColor || 0;
|
6167
|
-
if (
|
6167
|
+
if (env2.TERM === "dumb") {
|
6168
6168
|
return min;
|
6169
6169
|
}
|
6170
6170
|
if (process.platform === "win32") {
|
6171
|
-
const osRelease =
|
6171
|
+
const osRelease = os2.release().split(".");
|
6172
6172
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
6173
6173
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
6174
6174
|
}
|
6175
6175
|
return 1;
|
6176
6176
|
}
|
6177
|
-
if ("CI" in
|
6178
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in
|
6177
|
+
if ("CI" in env2) {
|
6178
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
6179
6179
|
return 1;
|
6180
6180
|
}
|
6181
6181
|
return min;
|
6182
6182
|
}
|
6183
|
-
if ("TEAMCITY_VERSION" in
|
6184
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(
|
6183
|
+
if ("TEAMCITY_VERSION" in env2) {
|
6184
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
6185
6185
|
}
|
6186
|
-
if (
|
6186
|
+
if (env2.COLORTERM === "truecolor") {
|
6187
6187
|
return 3;
|
6188
6188
|
}
|
6189
|
-
if ("TERM_PROGRAM" in
|
6190
|
-
const version = parseInt((
|
6191
|
-
switch (
|
6189
|
+
if ("TERM_PROGRAM" in env2) {
|
6190
|
+
const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
6191
|
+
switch (env2.TERM_PROGRAM) {
|
6192
6192
|
case "iTerm.app":
|
6193
6193
|
return version >= 3 ? 3 : 2;
|
6194
6194
|
case "Apple_Terminal":
|
6195
6195
|
return 2;
|
6196
6196
|
}
|
6197
6197
|
}
|
6198
|
-
if (/-256(color)?$/i.test(
|
6198
|
+
if (/-256(color)?$/i.test(env2.TERM)) {
|
6199
6199
|
return 2;
|
6200
6200
|
}
|
6201
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(
|
6201
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
6202
6202
|
return 1;
|
6203
6203
|
}
|
6204
|
-
if ("COLORTERM" in
|
6204
|
+
if ("COLORTERM" in env2) {
|
6205
6205
|
return 1;
|
6206
6206
|
}
|
6207
6207
|
return min;
|
@@ -6572,16 +6572,16 @@ var require_node2 = __commonJS({
|
|
6572
6572
|
}
|
6573
6573
|
exports2.urlGenerate = urlGenerate;
|
6574
6574
|
function normalize(aPath) {
|
6575
|
-
var
|
6575
|
+
var path4 = aPath;
|
6576
6576
|
var url = urlParse(aPath);
|
6577
6577
|
if (url) {
|
6578
6578
|
if (!url.path) {
|
6579
6579
|
return aPath;
|
6580
6580
|
}
|
6581
|
-
|
6581
|
+
path4 = url.path;
|
6582
6582
|
}
|
6583
|
-
var isAbsolute = exports2.isAbsolute(
|
6584
|
-
var parts =
|
6583
|
+
var isAbsolute = exports2.isAbsolute(path4);
|
6584
|
+
var parts = path4.split(/\/+/);
|
6585
6585
|
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
6586
6586
|
part = parts[i];
|
6587
6587
|
if (part === ".") {
|
@@ -6598,15 +6598,15 @@ var require_node2 = __commonJS({
|
|
6598
6598
|
}
|
6599
6599
|
}
|
6600
6600
|
}
|
6601
|
-
|
6602
|
-
if (
|
6603
|
-
|
6601
|
+
path4 = parts.join("/");
|
6602
|
+
if (path4 === "") {
|
6603
|
+
path4 = isAbsolute ? "/" : ".";
|
6604
6604
|
}
|
6605
6605
|
if (url) {
|
6606
|
-
url.path =
|
6606
|
+
url.path = path4;
|
6607
6607
|
return urlGenerate(url);
|
6608
6608
|
}
|
6609
|
-
return
|
6609
|
+
return path4;
|
6610
6610
|
}
|
6611
6611
|
exports2.normalize = normalize;
|
6612
6612
|
function join22(aRoot, aPath) {
|
@@ -7243,13 +7243,13 @@ var require_node2 = __commonJS({
|
|
7243
7243
|
function randomIntInRange(low, high) {
|
7244
7244
|
return Math.round(low + Math.random() * (high - low));
|
7245
7245
|
}
|
7246
|
-
function doQuickSort(ary, comparator,
|
7247
|
-
if (
|
7248
|
-
var pivotIndex = randomIntInRange(
|
7249
|
-
var i =
|
7246
|
+
function doQuickSort(ary, comparator, p, r) {
|
7247
|
+
if (p < r) {
|
7248
|
+
var pivotIndex = randomIntInRange(p, r);
|
7249
|
+
var i = p - 1;
|
7250
7250
|
swap(ary, pivotIndex, r);
|
7251
7251
|
var pivot = ary[r];
|
7252
|
-
for (var j =
|
7252
|
+
for (var j = p; j < r; j++) {
|
7253
7253
|
if (comparator(ary[j], pivot) <= 0) {
|
7254
7254
|
i += 1;
|
7255
7255
|
swap(ary, i, j);
|
@@ -7257,7 +7257,7 @@ var require_node2 = __commonJS({
|
|
7257
7257
|
}
|
7258
7258
|
swap(ary, i + 1, j);
|
7259
7259
|
var q = i + 1;
|
7260
|
-
doQuickSort(ary, comparator,
|
7260
|
+
doQuickSort(ary, comparator, p, q - 1);
|
7261
7261
|
doQuickSort(ary, comparator, q + 1, r);
|
7262
7262
|
}
|
7263
7263
|
}
|
@@ -8136,7 +8136,7 @@ var require_node2 = __commonJS({
|
|
8136
8136
|
});
|
8137
8137
|
var require_source_map_support = __commonJS2((exports2, module22) => {
|
8138
8138
|
var SourceMapConsumer = require_source_map().SourceMapConsumer;
|
8139
|
-
var
|
8139
|
+
var path4 = require("path");
|
8140
8140
|
var fs32;
|
8141
8141
|
try {
|
8142
8142
|
fs32 = require("fs");
|
@@ -8209,15 +8209,15 @@ var require_node2 = __commonJS({
|
|
8209
8209
|
function supportRelativeURL(file, url) {
|
8210
8210
|
if (!file)
|
8211
8211
|
return url;
|
8212
|
-
var dir =
|
8212
|
+
var dir = path4.dirname(file);
|
8213
8213
|
var match2 = /^\w+:\/\/[^\/]*/.exec(dir);
|
8214
8214
|
var protocol = match2 ? match2[0] : "";
|
8215
8215
|
var startPath = dir.slice(protocol.length);
|
8216
8216
|
if (protocol && /^\/\w\:/.test(startPath)) {
|
8217
8217
|
protocol += "/";
|
8218
|
-
return protocol +
|
8218
|
+
return protocol + path4.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
|
8219
8219
|
}
|
8220
|
-
return protocol +
|
8220
|
+
return protocol + path4.resolve(dir.slice(protocol.length), url);
|
8221
8221
|
}
|
8222
8222
|
function retrieveSourceMapURL(source) {
|
8223
8223
|
var fileData;
|
@@ -8697,7 +8697,7 @@ var require_node2 = __commonJS({
|
|
8697
8697
|
});
|
8698
8698
|
};
|
8699
8699
|
}
|
8700
|
-
var
|
8700
|
+
var readFile = (fp) => new Promise((resolve2, reject) => {
|
8701
8701
|
_fs.default.readFile(fp, "utf8", (err2, data) => {
|
8702
8702
|
if (err2)
|
8703
8703
|
return reject(err2);
|
@@ -8895,7 +8895,7 @@ var require_node2 = __commonJS({
|
|
8895
8895
|
data: _this3.packageJsonCache.get(filepath)[options.packageKey]
|
8896
8896
|
};
|
8897
8897
|
}
|
8898
|
-
const data = _this3.options.parseJSON(yield
|
8898
|
+
const data = _this3.options.parseJSON(yield readFile(filepath));
|
8899
8899
|
return {
|
8900
8900
|
path: filepath,
|
8901
8901
|
data
|
@@ -8903,7 +8903,7 @@ var require_node2 = __commonJS({
|
|
8903
8903
|
}
|
8904
8904
|
return {
|
8905
8905
|
path: filepath,
|
8906
|
-
data: yield
|
8906
|
+
data: yield readFile(filepath)
|
8907
8907
|
};
|
8908
8908
|
}
|
8909
8909
|
return {};
|
@@ -9013,12 +9013,12 @@ var require_node2 = __commonJS({
|
|
9013
9013
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
9014
9014
|
exports2.removeExtension = exports2.fileExistsAsync = exports2.readJsonFromDiskAsync = exports2.readJsonFromDiskSync = exports2.fileExistsSync = void 0;
|
9015
9015
|
var fs32 = require("fs");
|
9016
|
-
function fileExistsSync(
|
9017
|
-
if (!fs32.existsSync(
|
9016
|
+
function fileExistsSync(path4) {
|
9017
|
+
if (!fs32.existsSync(path4)) {
|
9018
9018
|
return false;
|
9019
9019
|
}
|
9020
9020
|
try {
|
9021
|
-
var stats = fs32.statSync(
|
9021
|
+
var stats = fs32.statSync(path4);
|
9022
9022
|
return stats.isFile();
|
9023
9023
|
} catch (err2) {
|
9024
9024
|
return false;
|
@@ -9032,8 +9032,8 @@ var require_node2 = __commonJS({
|
|
9032
9032
|
return require(packageJsonPath);
|
9033
9033
|
}
|
9034
9034
|
exports2.readJsonFromDiskSync = readJsonFromDiskSync;
|
9035
|
-
function readJsonFromDiskAsync(
|
9036
|
-
fs32.readFile(
|
9035
|
+
function readJsonFromDiskAsync(path4, callback) {
|
9036
|
+
fs32.readFile(path4, "utf8", function(err2, result) {
|
9037
9037
|
if (err2 || !result) {
|
9038
9038
|
return callback();
|
9039
9039
|
}
|
@@ -9051,8 +9051,8 @@ var require_node2 = __commonJS({
|
|
9051
9051
|
});
|
9052
9052
|
}
|
9053
9053
|
exports2.fileExistsAsync = fileExistsAsync;
|
9054
|
-
function removeExtension(
|
9055
|
-
return
|
9054
|
+
function removeExtension(path4) {
|
9055
|
+
return path4.substring(0, path4.lastIndexOf(".")) || path4;
|
9056
9056
|
}
|
9057
9057
|
exports2.removeExtension = removeExtension;
|
9058
9058
|
});
|
@@ -9060,7 +9060,7 @@ var require_node2 = __commonJS({
|
|
9060
9060
|
"use strict";
|
9061
9061
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
9062
9062
|
exports2.getAbsoluteMappingEntries = void 0;
|
9063
|
-
var
|
9063
|
+
var path4 = require("path");
|
9064
9064
|
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
9065
9065
|
var sortedKeys = sortByLongestPrefix(Object.keys(paths));
|
9066
9066
|
var absolutePaths = [];
|
@@ -9069,7 +9069,7 @@ var require_node2 = __commonJS({
|
|
9069
9069
|
absolutePaths.push({
|
9070
9070
|
pattern: key,
|
9071
9071
|
paths: paths[key].map(function(pathToResolve) {
|
9072
|
-
return
|
9072
|
+
return path4.resolve(absoluteBaseUrl, pathToResolve);
|
9073
9073
|
})
|
9074
9074
|
});
|
9075
9075
|
}
|
@@ -9096,7 +9096,7 @@ var require_node2 = __commonJS({
|
|
9096
9096
|
"use strict";
|
9097
9097
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
9098
9098
|
exports2.exhaustiveTypeException = exports2.getStrippedPath = exports2.getPathsToTry = void 0;
|
9099
|
-
var
|
9099
|
+
var path4 = require("path");
|
9100
9100
|
var path_1 = require("path");
|
9101
9101
|
var filesystem_1 = require_filesystem();
|
9102
9102
|
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
|
@@ -9116,9 +9116,9 @@ var require_node2 = __commonJS({
|
|
9116
9116
|
}));
|
9117
9117
|
pathsToTry.push({
|
9118
9118
|
type: "package",
|
9119
|
-
path:
|
9119
|
+
path: path4.join(physicalPath, "/package.json")
|
9120
9120
|
});
|
9121
|
-
var indexPath =
|
9121
|
+
var indexPath = path4.join(physicalPath, "/index");
|
9122
9122
|
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
9123
9123
|
return { type: "index", path: indexPath + e };
|
9124
9124
|
}));
|
@@ -9166,7 +9166,7 @@ var require_node2 = __commonJS({
|
|
9166
9166
|
"use strict";
|
9167
9167
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
9168
9168
|
exports2.matchFromAbsolutePaths = exports2.createMatchPath = void 0;
|
9169
|
-
var
|
9169
|
+
var path4 = require("path");
|
9170
9170
|
var Filesystem = require_filesystem();
|
9171
9171
|
var MappingEntry = require_mapping_entry();
|
9172
9172
|
var TryPath = require_try_path();
|
@@ -9210,7 +9210,7 @@ var require_node2 = __commonJS({
|
|
9210
9210
|
return obj[key];
|
9211
9211
|
}, packageJson);
|
9212
9212
|
if (candidateMapping && typeof candidateMapping === "string") {
|
9213
|
-
var candidateFilePath =
|
9213
|
+
var candidateFilePath = path4.join(path4.dirname(packageJsonPath), candidateMapping);
|
9214
9214
|
if (fileExists(candidateFilePath)) {
|
9215
9215
|
return candidateFilePath;
|
9216
9216
|
}
|
@@ -9250,7 +9250,7 @@ var require_node2 = __commonJS({
|
|
9250
9250
|
"use strict";
|
9251
9251
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
9252
9252
|
exports2.matchFromAbsolutePathsAsync = exports2.createMatchPathAsync = void 0;
|
9253
|
-
var
|
9253
|
+
var path4 = require("path");
|
9254
9254
|
var TryPath = require_try_path();
|
9255
9255
|
var MappingEntry = require_mapping_entry();
|
9256
9256
|
var Filesystem = require_filesystem();
|
@@ -9304,7 +9304,7 @@ var require_node2 = __commonJS({
|
|
9304
9304
|
if (typeof mainFieldMapping !== "string") {
|
9305
9305
|
return tryNext();
|
9306
9306
|
}
|
9307
|
-
var mappedFilePath =
|
9307
|
+
var mappedFilePath = path4.join(path4.dirname(packageJsonPath), mainFieldMapping);
|
9308
9308
|
fileExistsAsync(mappedFilePath, function(err2, exists) {
|
9309
9309
|
if (err2) {
|
9310
9310
|
return doneCallback(err2);
|
@@ -9954,8 +9954,8 @@ var require_node2 = __commonJS({
|
|
9954
9954
|
}
|
9955
9955
|
function literal(s) {
|
9956
9956
|
for (const c2 of s) {
|
9957
|
-
const
|
9958
|
-
if (
|
9957
|
+
const p = peek();
|
9958
|
+
if (p !== c2) {
|
9959
9959
|
throw invalidChar(read());
|
9960
9960
|
}
|
9961
9961
|
read();
|
@@ -10469,9 +10469,9 @@ var require_node2 = __commonJS({
|
|
10469
10469
|
__assign = Object.assign || function(t) {
|
10470
10470
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
10471
10471
|
s = arguments[i];
|
10472
|
-
for (var
|
10473
|
-
if (Object.prototype.hasOwnProperty.call(s,
|
10474
|
-
t[
|
10472
|
+
for (var p in s)
|
10473
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
10474
|
+
t[p] = s[p];
|
10475
10475
|
}
|
10476
10476
|
return t;
|
10477
10477
|
};
|
@@ -10479,7 +10479,7 @@ var require_node2 = __commonJS({
|
|
10479
10479
|
};
|
10480
10480
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
10481
10481
|
exports2.loadTsconfig = exports2.walkForTsConfig = exports2.tsConfigLoader = void 0;
|
10482
|
-
var
|
10482
|
+
var path4 = require("path");
|
10483
10483
|
var fs32 = require("fs");
|
10484
10484
|
var JSON5 = require_lib32();
|
10485
10485
|
var StripBom = require_strip_bom();
|
@@ -10509,14 +10509,14 @@ var require_node2 = __commonJS({
|
|
10509
10509
|
}
|
10510
10510
|
function resolveConfigPath(cwd, filename) {
|
10511
10511
|
if (filename) {
|
10512
|
-
var absolutePath = fs32.lstatSync(filename).isDirectory() ?
|
10512
|
+
var absolutePath = fs32.lstatSync(filename).isDirectory() ? path4.resolve(filename, "./tsconfig.json") : path4.resolve(cwd, filename);
|
10513
10513
|
return absolutePath;
|
10514
10514
|
}
|
10515
10515
|
if (fs32.statSync(cwd).isFile()) {
|
10516
|
-
return
|
10516
|
+
return path4.resolve(cwd);
|
10517
10517
|
}
|
10518
10518
|
var configAbsolutePath = walkForTsConfig(cwd);
|
10519
|
-
return configAbsolutePath ?
|
10519
|
+
return configAbsolutePath ? path4.resolve(configAbsolutePath) : void 0;
|
10520
10520
|
}
|
10521
10521
|
function walkForTsConfig(directory, readdirSync3) {
|
10522
10522
|
if (readdirSync3 === void 0) {
|
@@ -10527,10 +10527,10 @@ var require_node2 = __commonJS({
|
|
10527
10527
|
for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
|
10528
10528
|
var fileToCheck = filesToCheck_1[_i];
|
10529
10529
|
if (files.indexOf(fileToCheck) !== -1) {
|
10530
|
-
return
|
10530
|
+
return path4.join(directory, fileToCheck);
|
10531
10531
|
}
|
10532
10532
|
}
|
10533
|
-
var parentDirectory =
|
10533
|
+
var parentDirectory = path4.dirname(directory);
|
10534
10534
|
if (directory === parentDirectory) {
|
10535
10535
|
return void 0;
|
10536
10536
|
}
|
@@ -10577,15 +10577,15 @@ var require_node2 = __commonJS({
|
|
10577
10577
|
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
10578
10578
|
extendedConfigValue += ".json";
|
10579
10579
|
}
|
10580
|
-
var currentDir =
|
10581
|
-
var extendedConfigPath =
|
10580
|
+
var currentDir = path4.dirname(configFilePath);
|
10581
|
+
var extendedConfigPath = path4.join(currentDir, extendedConfigValue);
|
10582
10582
|
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync4(extendedConfigPath)) {
|
10583
|
-
extendedConfigPath =
|
10583
|
+
extendedConfigPath = path4.join(currentDir, "node_modules", extendedConfigValue);
|
10584
10584
|
}
|
10585
10585
|
var config = loadTsconfig(extendedConfigPath, existsSync4, readFileSync4) || {};
|
10586
10586
|
if ((_a3 = config.compilerOptions) === null || _a3 === void 0 ? void 0 : _a3.baseUrl) {
|
10587
|
-
var extendsDir =
|
10588
|
-
config.compilerOptions.baseUrl =
|
10587
|
+
var extendsDir = path4.dirname(extendedConfigValue);
|
10588
|
+
config.compilerOptions.baseUrl = path4.join(extendsDir, config.compilerOptions.baseUrl);
|
10589
10589
|
}
|
10590
10590
|
return config;
|
10591
10591
|
}
|
@@ -10600,7 +10600,7 @@ var require_node2 = __commonJS({
|
|
10600
10600
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
10601
10601
|
exports2.configLoader = exports2.loadConfig = void 0;
|
10602
10602
|
var TsConfigLoader2 = require_tsconfig_loader();
|
10603
|
-
var
|
10603
|
+
var path4 = require("path");
|
10604
10604
|
function loadConfig2(cwd) {
|
10605
10605
|
if (cwd === void 0) {
|
10606
10606
|
cwd = process.cwd();
|
@@ -10611,7 +10611,7 @@ var require_node2 = __commonJS({
|
|
10611
10611
|
function configLoader(_a3) {
|
10612
10612
|
var cwd = _a3.cwd, explicitParams = _a3.explicitParams, _b = _a3.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
10613
10613
|
if (explicitParams) {
|
10614
|
-
var absoluteBaseUrl =
|
10614
|
+
var absoluteBaseUrl = path4.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path4.join(cwd, explicitParams.baseUrl);
|
10615
10615
|
return {
|
10616
10616
|
resultType: "success",
|
10617
10617
|
configFileAbsolutePath: "",
|
@@ -10638,7 +10638,7 @@ var require_node2 = __commonJS({
|
|
10638
10638
|
resultType: "success",
|
10639
10639
|
configFileAbsolutePath: loadResult.tsConfigPath,
|
10640
10640
|
baseUrl: loadResult.baseUrl,
|
10641
|
-
absoluteBaseUrl:
|
10641
|
+
absoluteBaseUrl: path4.resolve(path4.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
10642
10642
|
paths: loadResult.paths || {},
|
10643
10643
|
addMatchAll: loadResult.baseUrl !== void 0
|
10644
10644
|
};
|
@@ -11094,8 +11094,8 @@ var require_node2 = __commonJS({
|
|
11094
11094
|
});
|
11095
11095
|
var getOptions = (cwd) => {
|
11096
11096
|
var _a3, _b, _c, _d;
|
11097
|
-
const { data, path:
|
11098
|
-
if (
|
11097
|
+
const { data, path: path4 } = joycon.loadSync(["tsconfig.json", "jsconfig.json"], cwd);
|
11098
|
+
if (path4 && data) {
|
11099
11099
|
return {
|
11100
11100
|
jsxFactory: (_a3 = data.compilerOptions) == null ? void 0 : _a3.jsxFactory,
|
11101
11101
|
jsxFragment: (_b = data.compilerOptions) == null ? void 0 : _b.jsxFragmentFactory,
|
@@ -11432,14 +11432,14 @@ var init_utils = __esm({
|
|
11432
11432
|
)
|
11433
11433
|
);
|
11434
11434
|
}
|
11435
|
-
const
|
11436
|
-
if (!(0, import_fs.existsSync)(
|
11437
|
-
console.log(`${
|
11435
|
+
const path4 = (0, import_path.join)((0, import_path.resolve)(configPath ?? defaultConfigPath));
|
11436
|
+
if (!(0, import_fs.existsSync)(path4)) {
|
11437
|
+
console.log(`${path4} file does not exist`);
|
11438
11438
|
process.exit(1);
|
11439
11439
|
}
|
11440
|
-
console.log(source_default.grey(`Reading config file '${
|
11440
|
+
console.log(source_default.grey(`Reading config file '${path4}'`));
|
11441
11441
|
const { unregister } = await safeRegister();
|
11442
|
-
const required = require(`${
|
11442
|
+
const required = require(`${path4}`);
|
11443
11443
|
const content = required.default ?? required;
|
11444
11444
|
unregister();
|
11445
11445
|
const res = mySqlCliConfigSchema.safeParse(content);
|
@@ -11462,14 +11462,14 @@ var init_utils = __esm({
|
|
11462
11462
|
if (!configPath) {
|
11463
11463
|
console.log(source_default.gray(`No config path provided, using default path`));
|
11464
11464
|
}
|
11465
|
-
const
|
11466
|
-
if (!(0, import_fs.existsSync)(
|
11467
|
-
console.log(source_default.red(`${
|
11465
|
+
const path4 = (0, import_path.join)((0, import_path.resolve)(configPath ?? defaultConfigPath));
|
11466
|
+
if (!(0, import_fs.existsSync)(path4)) {
|
11467
|
+
console.log(source_default.red(`${path4} file does not exist`));
|
11468
11468
|
process.exit(1);
|
11469
11469
|
}
|
11470
|
-
console.log(source_default.grey(`Reading config file '${
|
11470
|
+
console.log(source_default.grey(`Reading config file '${path4}'`));
|
11471
11471
|
const { unregister } = await safeRegister();
|
11472
|
-
const required = require(`${
|
11472
|
+
const required = require(`${path4}`);
|
11473
11473
|
const content = required.default ?? required;
|
11474
11474
|
unregister();
|
11475
11475
|
return content;
|
@@ -11983,8 +11983,8 @@ We have encountered a collision between the index name on columns ${source_defau
|
|
11983
11983
|
}
|
11984
11984
|
for (const [key, value] of Object.entries(tableToPk)) {
|
11985
11985
|
result[key].compositePrimaryKeys = {
|
11986
|
-
[`${key}_${value.join("_")}
|
11987
|
-
name: `${key}_${value.join("_")}
|
11986
|
+
[`${key}_${value.join("_")}`]: {
|
11987
|
+
name: `${key}_${value.join("_")}`,
|
11988
11988
|
columns: value
|
11989
11989
|
}
|
11990
11990
|
};
|
@@ -12162,9 +12162,10 @@ var pgSerializer_exports = {};
|
|
12162
12162
|
__export(pgSerializer_exports, {
|
12163
12163
|
fromDatabase: () => fromDatabase2,
|
12164
12164
|
generatePgSnapshot: () => generatePgSnapshot,
|
12165
|
-
indexName: () => indexName2
|
12165
|
+
indexName: () => indexName2,
|
12166
|
+
toDrizzle: () => toDrizzle
|
12166
12167
|
});
|
12167
|
-
var import_pg_core2, import_pg_core3, import_drizzle_orm5, dialect4, indexName2, generatePgSnapshot, trimChar, fromDatabase2, columnToDefault, defaultForColumn;
|
12168
|
+
var import_pg_core2, import_pg_core3, import_drizzle_orm5, dialect4, indexName2, generatePgSnapshot, trimChar, fromDatabase2, columnToDefault, defaultForColumn, toDrizzle;
|
12168
12169
|
var init_pgSerializer = __esm({
|
12169
12170
|
"src/serializer/pgSerializer.ts"() {
|
12170
12171
|
import_pg_core2 = require("drizzle-orm/pg-core");
|
@@ -12179,6 +12180,7 @@ var init_pgSerializer = __esm({
|
|
12179
12180
|
};
|
12180
12181
|
generatePgSnapshot = (tables, enums, schemas, schemaFilter) => {
|
12181
12182
|
const result = {};
|
12183
|
+
const indexesInSchema = {};
|
12182
12184
|
for (const table4 of tables) {
|
12183
12185
|
const {
|
12184
12186
|
name: tableName,
|
@@ -12330,6 +12332,24 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
12330
12332
|
return it.name;
|
12331
12333
|
}
|
12332
12334
|
});
|
12335
|
+
if (typeof indexesInSchema[schema4 ?? "public"] !== "undefined") {
|
12336
|
+
if (indexesInSchema[schema4 ?? "public"].includes(name)) {
|
12337
|
+
console.log(
|
12338
|
+
`
|
12339
|
+
${withStyle.errorWarning(
|
12340
|
+
`We've found duplicated index name across ${source_default.underline.blue(
|
12341
|
+
schema4 ?? "public"
|
12342
|
+
)} schema. Please rename your index in either the ${source_default.underline.blue(
|
12343
|
+
tableName
|
12344
|
+
)} table or the table with the duplicated index name`
|
12345
|
+
)}`
|
12346
|
+
);
|
12347
|
+
process.exit(1);
|
12348
|
+
}
|
12349
|
+
indexesInSchema[schema4 ?? "public"].push(name);
|
12350
|
+
} else {
|
12351
|
+
indexesInSchema[schema4 ?? "public"] = [name];
|
12352
|
+
}
|
12333
12353
|
indexesObject[name] = {
|
12334
12354
|
name,
|
12335
12355
|
columns: indexColumns,
|
@@ -12775,6 +12795,108 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
12775
12795
|
}
|
12776
12796
|
}
|
12777
12797
|
};
|
12798
|
+
toDrizzle = (schema4, schemaName) => {
|
12799
|
+
const tables = {};
|
12800
|
+
Object.values(schema4.tables).forEach((t) => {
|
12801
|
+
const columns = {};
|
12802
|
+
Object.values(t.columns).forEach((c) => {
|
12803
|
+
const columnName = c.name;
|
12804
|
+
const type = c.type;
|
12805
|
+
let columnBuilder;
|
12806
|
+
if (type === "bigint") {
|
12807
|
+
columnBuilder = new import_pg_core2.PgBigInt53Builder(columnName);
|
12808
|
+
} else if (type === "bigserial") {
|
12809
|
+
columnBuilder = new import_pg_core2.PgBigSerial53Builder(columnName);
|
12810
|
+
} else if (type === "boolean") {
|
12811
|
+
columnBuilder = new import_pg_core2.PgBooleanBuilder(columnName);
|
12812
|
+
} else if (type === "cidr") {
|
12813
|
+
columnBuilder = new import_pg_core2.PgCidrBuilder(columnName);
|
12814
|
+
} else if (type === "date") {
|
12815
|
+
columnBuilder = new import_pg_core2.PgDateBuilder(columnName);
|
12816
|
+
} else if (type === "double precision") {
|
12817
|
+
columnBuilder = new import_pg_core2.PgDoublePrecisionBuilder(columnName);
|
12818
|
+
} else if (type === "inet") {
|
12819
|
+
columnBuilder = new import_pg_core2.PgInetBuilder(columnName);
|
12820
|
+
} else if (type === "integer") {
|
12821
|
+
columnBuilder = new import_pg_core2.PgIntegerBuilder(columnName);
|
12822
|
+
} else if (type === "interval" || type.startsWith("interval ")) {
|
12823
|
+
columnBuilder = new import_pg_core2.PgIntervalBuilder(columnName, {});
|
12824
|
+
} else if (type === "json") {
|
12825
|
+
columnBuilder = new import_pg_core2.PgJsonBuilder(columnName);
|
12826
|
+
} else if (type === "jsonb") {
|
12827
|
+
columnBuilder = new import_pg_core2.PgJsonbBuilder(columnName);
|
12828
|
+
} else if (type === "macaddr") {
|
12829
|
+
columnBuilder = new import_pg_core2.PgMacaddrBuilder(columnName);
|
12830
|
+
} else if (type === "macaddr8") {
|
12831
|
+
columnBuilder = new import_pg_core2.PgMacaddr8Builder(columnName);
|
12832
|
+
} else if (type === "numeric" || type.startsWith("numeric(")) {
|
12833
|
+
columnBuilder = new import_pg_core2.PgNumericBuilder(columnName);
|
12834
|
+
} else if (type === "real") {
|
12835
|
+
columnBuilder = new import_pg_core2.PgRealBuilder(columnName);
|
12836
|
+
} else if (type === "serial") {
|
12837
|
+
columnBuilder = new import_pg_core2.PgSerialBuilder(columnName);
|
12838
|
+
} else if (type === "smallint") {
|
12839
|
+
columnBuilder = new import_pg_core2.PgSmallIntBuilder(columnName);
|
12840
|
+
} else if (type === "smallserial") {
|
12841
|
+
columnBuilder = new import_pg_core2.PgSmallSerialBuilder(columnName);
|
12842
|
+
} else if (type === "text") {
|
12843
|
+
columnBuilder = new import_pg_core2.PgTextBuilder(columnName, {});
|
12844
|
+
} else if (type === "time" || type.startsWith("time(") || type === "time with time zone") {
|
12845
|
+
columnBuilder = new import_pg_core2.PgTimeBuilder(columnName, false, void 0);
|
12846
|
+
} else if (type === "timestamp" || type.startsWith("timestamp(") || type === "timestamp with time zone") {
|
12847
|
+
columnBuilder = new import_pg_core2.PgTimestampBuilder(columnName, false, void 0);
|
12848
|
+
} else if (type === "uuid") {
|
12849
|
+
columnBuilder = new import_pg_core2.PgUUIDBuilder(columnName);
|
12850
|
+
} else if (type === "varchar" || type.startsWith("varchar(")) {
|
12851
|
+
columnBuilder = new import_pg_core2.PgVarcharBuilder(columnName, {});
|
12852
|
+
} else if (type === "char" || type.startsWith("char(")) {
|
12853
|
+
columnBuilder = new import_pg_core2.PgCharBuilder(columnName, {});
|
12854
|
+
} else {
|
12855
|
+
columnBuilder = (0, import_pg_core2.customType)({
|
12856
|
+
dataType() {
|
12857
|
+
return type;
|
12858
|
+
}
|
12859
|
+
})(columnName);
|
12860
|
+
}
|
12861
|
+
if (c.notNull) {
|
12862
|
+
columnBuilder = columnBuilder.notNull();
|
12863
|
+
}
|
12864
|
+
if (c.default) {
|
12865
|
+
columnBuilder = columnBuilder.default(c.default);
|
12866
|
+
}
|
12867
|
+
if (c.primaryKey) {
|
12868
|
+
columnBuilder = columnBuilder.primaryKey();
|
12869
|
+
}
|
12870
|
+
columns[columnName] = columnBuilder;
|
12871
|
+
});
|
12872
|
+
if (schemaName === "public") {
|
12873
|
+
tables[t.name] = (0, import_pg_core2.pgTable)(t.name, columns, (cb) => {
|
12874
|
+
const res = {};
|
12875
|
+
Object.values(t.compositePrimaryKeys).forEach((cpk) => {
|
12876
|
+
const gh = cpk.columns.map((c) => cb[c]);
|
12877
|
+
res[cpk.name] = new import_pg_core2.PrimaryKeyBuilder(
|
12878
|
+
gh,
|
12879
|
+
cpk.name
|
12880
|
+
);
|
12881
|
+
});
|
12882
|
+
return res;
|
12883
|
+
});
|
12884
|
+
} else {
|
12885
|
+
tables[t.name] = (0, import_pg_core2.pgSchema)(schemaName).table(t.name, columns, (cb) => {
|
12886
|
+
const res = {};
|
12887
|
+
Object.values(t.compositePrimaryKeys).forEach((cpk) => {
|
12888
|
+
const gh = cpk.columns.map((c) => cb[c]);
|
12889
|
+
res[cpk.name] = new import_pg_core2.PrimaryKeyBuilder(
|
12890
|
+
gh,
|
12891
|
+
cpk.name
|
12892
|
+
);
|
12893
|
+
});
|
12894
|
+
return res;
|
12895
|
+
});
|
12896
|
+
}
|
12897
|
+
});
|
12898
|
+
return tables;
|
12899
|
+
};
|
12778
12900
|
}
|
12779
12901
|
});
|
12780
12902
|
|
@@ -12813,7 +12935,8 @@ var init_sqliteImports = __esm({
|
|
12813
12935
|
var sqliteSerializer_exports = {};
|
12814
12936
|
__export(sqliteSerializer_exports, {
|
12815
12937
|
fromDatabase: () => fromDatabase3,
|
12816
|
-
generateSqliteSnapshot: () => generateSqliteSnapshot
|
12938
|
+
generateSqliteSnapshot: () => generateSqliteSnapshot,
|
12939
|
+
toDrizzle: () => toDrizzle2
|
12817
12940
|
});
|
12818
12941
|
function mapSqlToSqliteType(sqlType) {
|
12819
12942
|
if ([
|
@@ -12850,7 +12973,7 @@ function mapSqlToSqliteType(sqlType) {
|
|
12850
12973
|
return "numeric";
|
12851
12974
|
}
|
12852
12975
|
}
|
12853
|
-
var import_drizzle_orm7, import_sqlite_core2, dialect5, generateSqliteSnapshot, fromDatabase3;
|
12976
|
+
var import_drizzle_orm7, import_sqlite_core2, dialect5, generateSqliteSnapshot, fromDatabase3, toDrizzle2;
|
12854
12977
|
var init_sqliteSerializer = __esm({
|
12855
12978
|
"src/serializer/sqliteSerializer.ts"() {
|
12856
12979
|
import_drizzle_orm7 = require("drizzle-orm");
|
@@ -13218,6 +13341,50 @@ WHERE
|
|
13218
13341
|
}
|
13219
13342
|
};
|
13220
13343
|
};
|
13344
|
+
toDrizzle2 = (schema4) => {
|
13345
|
+
const tables = {};
|
13346
|
+
Object.values(schema4.tables).forEach((t) => {
|
13347
|
+
const columns = {};
|
13348
|
+
Object.values(t.columns).forEach((c) => {
|
13349
|
+
const columnName = c.name;
|
13350
|
+
const type = c.type;
|
13351
|
+
let columnBuilder;
|
13352
|
+
if (type === "integer") {
|
13353
|
+
columnBuilder = new import_sqlite_core2.SQLiteIntegerBuilder(columnName);
|
13354
|
+
} else if (type === "text") {
|
13355
|
+
columnBuilder = new import_sqlite_core2.SQLiteTextBuilder(columnName, {});
|
13356
|
+
} else if (type === "blob") {
|
13357
|
+
columnBuilder = new import_sqlite_core2.SQLiteBlobBufferBuilder(columnName);
|
13358
|
+
} else if (type === "real") {
|
13359
|
+
columnBuilder = new import_sqlite_core2.SQLiteRealBuilder(columnName);
|
13360
|
+
} else {
|
13361
|
+
columnBuilder = new import_sqlite_core2.SQLiteNumericBuilder(columnName);
|
13362
|
+
}
|
13363
|
+
if (c.notNull) {
|
13364
|
+
columnBuilder = columnBuilder.notNull();
|
13365
|
+
}
|
13366
|
+
if (c.default) {
|
13367
|
+
columnBuilder = columnBuilder.default(c.default);
|
13368
|
+
}
|
13369
|
+
if (c.primaryKey) {
|
13370
|
+
columnBuilder = columnBuilder.primaryKey();
|
13371
|
+
}
|
13372
|
+
columns[columnName] = columnBuilder;
|
13373
|
+
});
|
13374
|
+
tables[t.name] = (0, import_sqlite_core2.sqliteTable)(t.name, columns, (cb) => {
|
13375
|
+
const res = {};
|
13376
|
+
Object.values(t.compositePrimaryKeys).forEach((cpk) => {
|
13377
|
+
const gh = cpk.columns.map((c) => cb[c]);
|
13378
|
+
res[cpk.name] = new import_sqlite_core2.PrimaryKeyBuilder(
|
13379
|
+
gh,
|
13380
|
+
cpk.name
|
13381
|
+
);
|
13382
|
+
});
|
13383
|
+
return res;
|
13384
|
+
});
|
13385
|
+
});
|
13386
|
+
return tables;
|
13387
|
+
};
|
13221
13388
|
}
|
13222
13389
|
});
|
13223
13390
|
|
@@ -13251,8 +13418,8 @@ var init_serializer = __esm({
|
|
13251
13418
|
}
|
13252
13419
|
}).sql;
|
13253
13420
|
};
|
13254
|
-
serializeMySql = async (
|
13255
|
-
const filenames = prepareFilenames(
|
13421
|
+
serializeMySql = async (path4) => {
|
13422
|
+
const filenames = prepareFilenames(path4);
|
13256
13423
|
console.log(source_default.gray(`Reading schema files:
|
13257
13424
|
${filenames.join("\n")}
|
13258
13425
|
`));
|
@@ -13261,25 +13428,25 @@ ${filenames.join("\n")}
|
|
13261
13428
|
const { tables, enums, schemas } = await prepareFromMySqlImports2(filenames);
|
13262
13429
|
return generateMySqlSnapshot2(tables, enums, schemas);
|
13263
13430
|
};
|
13264
|
-
serializePg = async (
|
13265
|
-
const filenames = prepareFilenames(
|
13431
|
+
serializePg = async (path4, schemaFilter) => {
|
13432
|
+
const filenames = prepareFilenames(path4);
|
13266
13433
|
const { prepareFromPgImports: prepareFromPgImports2 } = await Promise.resolve().then(() => (init_pgImports(), pgImports_exports));
|
13267
13434
|
const { generatePgSnapshot: generatePgSnapshot2 } = await Promise.resolve().then(() => (init_pgSerializer(), pgSerializer_exports));
|
13268
13435
|
const { tables, enums, schemas } = await prepareFromPgImports2(filenames);
|
13269
13436
|
return generatePgSnapshot2(tables, enums, schemas, schemaFilter);
|
13270
13437
|
};
|
13271
|
-
serializeSQLite = async (
|
13272
|
-
const filenames = prepareFilenames(
|
13438
|
+
serializeSQLite = async (path4) => {
|
13439
|
+
const filenames = prepareFilenames(path4);
|
13273
13440
|
const { prepareFromSqliteImports: prepareFromSqliteImports2 } = await Promise.resolve().then(() => (init_sqliteImports(), sqliteImports_exports));
|
13274
13441
|
const { generateSqliteSnapshot: generateSqliteSnapshot2 } = await Promise.resolve().then(() => (init_sqliteSerializer(), sqliteSerializer_exports));
|
13275
13442
|
const { tables, enums } = await prepareFromSqliteImports2(filenames);
|
13276
13443
|
return generateSqliteSnapshot2(tables, enums);
|
13277
13444
|
};
|
13278
|
-
prepareFilenames = (
|
13279
|
-
if (typeof
|
13280
|
-
|
13445
|
+
prepareFilenames = (path4) => {
|
13446
|
+
if (typeof path4 === "string") {
|
13447
|
+
path4 = [path4];
|
13281
13448
|
}
|
13282
|
-
const result =
|
13449
|
+
const result = path4.reduce((result2, cur) => {
|
13283
13450
|
const globbed = glob.sync(cur);
|
13284
13451
|
globbed.forEach((it) => {
|
13285
13452
|
const fileName = import_fs2.default.lstatSync(it).isDirectory() ? null : import_path2.default.resolve(it);
|
@@ -13293,7 +13460,7 @@ ${filenames.join("\n")}
|
|
13293
13460
|
return !(it.endsWith(".ts") || it.endsWith(".js") || it.endsWith(".cjs") || it.endsWith(".mjs") || it.endsWith(".mts") || it.endsWith(".cts"));
|
13294
13461
|
});
|
13295
13462
|
if (res.length === 0) {
|
13296
|
-
console.log(error(`No schema files found for path config [${
|
13463
|
+
console.log(error(`No schema files found for path config [${path4.map((it) => `'${it}'`).join(", ")}]`));
|
13297
13464
|
console.log(error(`If path represents a file - please make sure to use .ts or other extension in the path`));
|
13298
13465
|
process.exit(1);
|
13299
13466
|
}
|
@@ -15310,7 +15477,7 @@ var init_sqlgenerator = __esm({
|
|
15310
15477
|
if (typeof compositePKs !== "undefined" && compositePKs.length > 0) {
|
15311
15478
|
statement += ",\n";
|
15312
15479
|
const compositePK4 = PgSquasher.unsquashPK(compositePKs[0]);
|
15313
|
-
statement += ` CONSTRAINT ${st.compositePkName} PRIMARY KEY("${compositePK4.columns.join(`","`)}")`;
|
15480
|
+
statement += ` CONSTRAINT "${st.compositePkName}" PRIMARY KEY("${compositePK4.columns.join(`","`)}")`;
|
15314
15481
|
}
|
15315
15482
|
if (typeof uniqueConstraints !== "undefined" && uniqueConstraints.length > 0) {
|
15316
15483
|
for (const uniqueConstraint4 of uniqueConstraints) {
|
@@ -17702,13 +17869,14 @@ var init_snapshotsDiffer = __esm({
|
|
17702
17869
|
jsonStatements.push(...jsonDropTables);
|
17703
17870
|
jsonStatements.push(...jsonRenameTables);
|
17704
17871
|
jsonStatements.push(...jsonRenameColumnsStatements);
|
17705
|
-
jsonStatements.push(...jsonDeletedCompositePKs);
|
17706
17872
|
if (dialect6 !== "mysql") {
|
17707
17873
|
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
17708
17874
|
}
|
17709
17875
|
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
17710
17876
|
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
17877
|
+
jsonStatements.push(...jsonDeletedCompositePKs);
|
17711
17878
|
jsonStatements.push(...jsonTableAlternations.alterColumns);
|
17879
|
+
jsonStatements.push(...jsonAddedCompositePKs);
|
17712
17880
|
if (dialect6 === "mysql") {
|
17713
17881
|
jsonStatements.push(...jsonAddedUniqueConstraints);
|
17714
17882
|
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
@@ -17720,7 +17888,6 @@ var init_snapshotsDiffer = __esm({
|
|
17720
17888
|
jsonStatements.push(...jsonTableAlternations.dropColumns);
|
17721
17889
|
if (dialect6 !== "sqlite")
|
17722
17890
|
jsonStatements.push(...jsonCreateReferences);
|
17723
|
-
jsonStatements.push(...jsonAddedCompositePKs);
|
17724
17891
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
17725
17892
|
if (dialect6 !== "mysql") {
|
17726
17893
|
jsonStatements.push(...jsonAddedUniqueConstraints);
|
@@ -17815,11 +17982,11 @@ var init_pgUp = __esm({
|
|
17815
17982
|
path: it,
|
17816
17983
|
raw: report.rawMap[it]
|
17817
17984
|
})).forEach((it) => {
|
17818
|
-
const
|
17985
|
+
const path4 = it.path;
|
17819
17986
|
const result = updateUpToV4(it.raw, prevId);
|
17820
17987
|
prevId = result.id;
|
17821
|
-
console.log(`[${source_default.green("\u2713")}] ${
|
17822
|
-
(0, import_fs5.writeFileSync)(
|
17988
|
+
console.log(`[${source_default.green("\u2713")}] ${path4}`);
|
17989
|
+
(0, import_fs5.writeFileSync)(path4, JSON.stringify(result, null, 2));
|
17823
17990
|
});
|
17824
17991
|
console.log("Everything's fine \u{1F436}\u{1F525}");
|
17825
17992
|
};
|
@@ -18070,10 +18237,10 @@ var init_mysqlUp = __esm({
|
|
18070
18237
|
path: it,
|
18071
18238
|
raw: report.rawMap[it]
|
18072
18239
|
})).forEach((it) => {
|
18073
|
-
const
|
18240
|
+
const path4 = it.path;
|
18074
18241
|
const result = updateToLatestV4(it.raw);
|
18075
|
-
console.log(`[${source_default.green("\u2713")}] ${
|
18076
|
-
import_fs6.default.writeFileSync(
|
18242
|
+
console.log(`[${source_default.green("\u2713")}] ${path4}`);
|
18243
|
+
import_fs6.default.writeFileSync(path4, JSON.stringify(result, null, 2));
|
18077
18244
|
});
|
18078
18245
|
console.log("Everything's fine \u{1F436}\u{1F525}");
|
18079
18246
|
};
|
@@ -18566,7 +18733,7 @@ var init_upFolders = __esm({
|
|
18566
18733
|
date.setUTCMinutes(Number(it.substring(10, 12)));
|
18567
18734
|
date.setUTCSeconds(Number(it.substring(12, 14)));
|
18568
18735
|
date.setUTCMilliseconds(0);
|
18569
|
-
const
|
18736
|
+
const path4 = (0, import_path4.join)(out, it);
|
18570
18737
|
const pathJson = (0, import_path4.join)(out, it, "snapshot.json");
|
18571
18738
|
const pathSQL = (0, import_path4.join)(out, it, "migration.sql");
|
18572
18739
|
const snapshot = JSON.parse((0, import_fs7.readFileSync)(pathJson).toString());
|
@@ -18577,7 +18744,7 @@ var init_upFolders = __esm({
|
|
18577
18744
|
json: snapshot,
|
18578
18745
|
date,
|
18579
18746
|
sql: sql2,
|
18580
|
-
path:
|
18747
|
+
path: path4
|
18581
18748
|
});
|
18582
18749
|
res2.idx += 1;
|
18583
18750
|
return res2;
|
@@ -19478,14 +19645,14 @@ var require_brace_expansion = __commonJS({
|
|
19478
19645
|
var pre = m.pre;
|
19479
19646
|
var body = m.body;
|
19480
19647
|
var post = m.post;
|
19481
|
-
var
|
19482
|
-
|
19648
|
+
var p = pre.split(",");
|
19649
|
+
p[p.length - 1] += "{" + body + "}";
|
19483
19650
|
var postParts = parseCommaParts(post);
|
19484
19651
|
if (post.length) {
|
19485
|
-
|
19486
|
-
|
19652
|
+
p[p.length - 1] += postParts.shift();
|
19653
|
+
p.push.apply(p, postParts);
|
19487
19654
|
}
|
19488
|
-
parts.push.apply(parts,
|
19655
|
+
parts.push.apply(parts, p);
|
19489
19656
|
return parts;
|
19490
19657
|
}
|
19491
19658
|
function expandTop(str) {
|
@@ -19540,8 +19707,8 @@ var require_brace_expansion = __commonJS({
|
|
19540
19707
|
if (n.length === 1) {
|
19541
19708
|
n = expand2(n[0], false).map(embrace);
|
19542
19709
|
if (n.length === 1) {
|
19543
|
-
return post.map(function(
|
19544
|
-
return m.pre + n[0] +
|
19710
|
+
return post.map(function(p) {
|
19711
|
+
return m.pre + n[0] + p;
|
19545
19712
|
});
|
19546
19713
|
}
|
19547
19714
|
}
|
@@ -19745,12 +19912,12 @@ var init_mjs = __esm({
|
|
19745
19912
|
init_unescape();
|
19746
19913
|
init_escape();
|
19747
19914
|
init_unescape();
|
19748
|
-
minimatch = (
|
19915
|
+
minimatch = (p, pattern, options = {}) => {
|
19749
19916
|
assertValidPattern(pattern);
|
19750
19917
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|
19751
19918
|
return false;
|
19752
19919
|
}
|
19753
|
-
return new Minimatch(pattern, options).match(
|
19920
|
+
return new Minimatch(pattern, options).match(p);
|
19754
19921
|
};
|
19755
19922
|
starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
|
19756
19923
|
starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
|
@@ -19828,7 +19995,7 @@ var init_mjs = __esm({
|
|
19828
19995
|
}, {});
|
19829
19996
|
reSpecials = charSet("().*{}+?[]^$\\!");
|
19830
19997
|
addPatternStartSet = charSet("[.(");
|
19831
|
-
filter = (pattern, options = {}) => (
|
19998
|
+
filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
19832
19999
|
minimatch.filter = filter;
|
19833
20000
|
ext = (a, b = {}) => Object.assign({}, a, b);
|
19834
20001
|
defaults = (def) => {
|
@@ -19836,7 +20003,7 @@ var init_mjs = __esm({
|
|
19836
20003
|
return minimatch;
|
19837
20004
|
}
|
19838
20005
|
const orig = minimatch;
|
19839
|
-
const m = (
|
20006
|
+
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
|
19840
20007
|
return Object.assign(m, {
|
19841
20008
|
Minimatch: class Minimatch extends orig.Minimatch {
|
19842
20009
|
constructor(pattern, options = {}) {
|
@@ -19982,9 +20149,9 @@ var init_mjs = __esm({
|
|
19982
20149
|
this.set = set2.filter((s) => s.indexOf(false) === -1);
|
19983
20150
|
if (this.isWindows) {
|
19984
20151
|
for (let i = 0; i < this.set.length; i++) {
|
19985
|
-
const
|
19986
|
-
if (
|
19987
|
-
|
20152
|
+
const p = this.set[i];
|
20153
|
+
if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
|
20154
|
+
p[2] = "?";
|
19988
20155
|
}
|
19989
20156
|
}
|
19990
20157
|
}
|
@@ -20061,10 +20228,10 @@ var init_mjs = __esm({
|
|
20061
20228
|
didSomething = false;
|
20062
20229
|
if (!this.preserveMultipleSlashes) {
|
20063
20230
|
for (let i = 1; i < parts.length - 1; i++) {
|
20064
|
-
const
|
20065
|
-
if (i === 1 &&
|
20231
|
+
const p = parts[i];
|
20232
|
+
if (i === 1 && p === "" && parts[0] === "")
|
20066
20233
|
continue;
|
20067
|
-
if (
|
20234
|
+
if (p === "." || p === "") {
|
20068
20235
|
didSomething = true;
|
20069
20236
|
parts.splice(i, 1);
|
20070
20237
|
i--;
|
@@ -20077,8 +20244,8 @@ var init_mjs = __esm({
|
|
20077
20244
|
}
|
20078
20245
|
let dd = 0;
|
20079
20246
|
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
20080
|
-
const
|
20081
|
-
if (
|
20247
|
+
const p = parts[dd - 1];
|
20248
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
20082
20249
|
didSomething = true;
|
20083
20250
|
parts.splice(dd - 1, 2);
|
20084
20251
|
dd -= 2;
|
@@ -20120,11 +20287,11 @@ var init_mjs = __esm({
|
|
20120
20287
|
parts.splice(gs + 1, gss - gs);
|
20121
20288
|
}
|
20122
20289
|
let next = parts[gs + 1];
|
20123
|
-
const
|
20124
|
-
const
|
20290
|
+
const p = parts[gs + 2];
|
20291
|
+
const p2 = parts[gs + 3];
|
20125
20292
|
if (next !== "..")
|
20126
20293
|
continue;
|
20127
|
-
if (!
|
20294
|
+
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
|
20128
20295
|
continue;
|
20129
20296
|
}
|
20130
20297
|
didSomething = true;
|
@@ -20136,10 +20303,10 @@ var init_mjs = __esm({
|
|
20136
20303
|
}
|
20137
20304
|
if (!this.preserveMultipleSlashes) {
|
20138
20305
|
for (let i = 1; i < parts.length - 1; i++) {
|
20139
|
-
const
|
20140
|
-
if (i === 1 &&
|
20306
|
+
const p = parts[i];
|
20307
|
+
if (i === 1 && p === "" && parts[0] === "")
|
20141
20308
|
continue;
|
20142
|
-
if (
|
20309
|
+
if (p === "." || p === "") {
|
20143
20310
|
didSomething = true;
|
20144
20311
|
parts.splice(i, 1);
|
20145
20312
|
i--;
|
@@ -20152,8 +20319,8 @@ var init_mjs = __esm({
|
|
20152
20319
|
}
|
20153
20320
|
let dd = 0;
|
20154
20321
|
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
20155
|
-
const
|
20156
|
-
if (
|
20322
|
+
const p = parts[dd - 1];
|
20323
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
20157
20324
|
didSomething = true;
|
20158
20325
|
const needDot = dd === 1 && parts[dd + 1] === "**";
|
20159
20326
|
const splin = needDot ? ["."] : [];
|
@@ -20275,14 +20442,14 @@ var init_mjs = __esm({
|
|
20275
20442
|
this.debug("matchOne", file.length, pattern.length);
|
20276
20443
|
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
20277
20444
|
this.debug("matchOne loop");
|
20278
|
-
var
|
20445
|
+
var p = pattern[pi];
|
20279
20446
|
var f = file[fi];
|
20280
|
-
this.debug(pattern,
|
20281
|
-
if (
|
20447
|
+
this.debug(pattern, p, f);
|
20448
|
+
if (p === false) {
|
20282
20449
|
return false;
|
20283
20450
|
}
|
20284
|
-
if (
|
20285
|
-
this.debug("GLOBSTAR", [pattern,
|
20451
|
+
if (p === GLOBSTAR) {
|
20452
|
+
this.debug("GLOBSTAR", [pattern, p, f]);
|
20286
20453
|
var fr = fi;
|
20287
20454
|
var pr = pi + 1;
|
20288
20455
|
if (pr === pl) {
|
@@ -20317,12 +20484,12 @@ var init_mjs = __esm({
|
|
20317
20484
|
return false;
|
20318
20485
|
}
|
20319
20486
|
let hit;
|
20320
|
-
if (typeof
|
20321
|
-
hit = f ===
|
20322
|
-
this.debug("string match",
|
20487
|
+
if (typeof p === "string") {
|
20488
|
+
hit = f === p;
|
20489
|
+
this.debug("string match", p, f, hit);
|
20323
20490
|
} else {
|
20324
|
-
hit =
|
20325
|
-
this.debug("pattern match",
|
20491
|
+
hit = p.test(f);
|
20492
|
+
this.debug("pattern match", p, f, hit);
|
20326
20493
|
}
|
20327
20494
|
if (!hit)
|
20328
20495
|
return false;
|
@@ -20371,7 +20538,7 @@ var init_mjs = __esm({
|
|
20371
20538
|
let dotTravAllowed = pattern.charAt(0) === ".";
|
20372
20539
|
let dotFileAllowed = options.dot || dotTravAllowed;
|
20373
20540
|
const patternStart = () => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
20374
|
-
const subPatternStart = (
|
20541
|
+
const subPatternStart = (p) => p.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
20375
20542
|
const clearStateChar = () => {
|
20376
20543
|
if (stateChar) {
|
20377
20544
|
switch (stateChar) {
|
@@ -20574,11 +20741,11 @@ var init_mjs = __esm({
|
|
20574
20741
|
const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
20575
20742
|
const flags = options.nocase ? "i" : "";
|
20576
20743
|
let re = set2.map((pattern) => {
|
20577
|
-
const pp = pattern.map((
|
20578
|
-
pp.forEach((
|
20744
|
+
const pp = pattern.map((p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src);
|
20745
|
+
pp.forEach((p, i) => {
|
20579
20746
|
const next = pp[i + 1];
|
20580
20747
|
const prev = pp[i - 1];
|
20581
|
-
if (
|
20748
|
+
if (p !== GLOBSTAR || prev === GLOBSTAR) {
|
20582
20749
|
return;
|
20583
20750
|
}
|
20584
20751
|
if (prev === void 0) {
|
@@ -20594,7 +20761,7 @@ var init_mjs = __esm({
|
|
20594
20761
|
pp[i + 1] = GLOBSTAR;
|
20595
20762
|
}
|
20596
20763
|
});
|
20597
|
-
return pp.filter((
|
20764
|
+
return pp.filter((p) => p !== GLOBSTAR).join("/");
|
20598
20765
|
}).join("|");
|
20599
20766
|
re = "^(?:" + re + ")$";
|
20600
20767
|
if (this.negate)
|
@@ -20606,13 +20773,13 @@ var init_mjs = __esm({
|
|
20606
20773
|
}
|
20607
20774
|
return this.regexp;
|
20608
20775
|
}
|
20609
|
-
slashSplit(
|
20776
|
+
slashSplit(p) {
|
20610
20777
|
if (this.preserveMultipleSlashes) {
|
20611
|
-
return
|
20612
|
-
} else if (this.isWindows && /^\/\/[^\/]+/.test(
|
20613
|
-
return ["", ...
|
20778
|
+
return p.split("/");
|
20779
|
+
} else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
|
20780
|
+
return ["", ...p.split(/\/+/)];
|
20614
20781
|
} else {
|
20615
|
-
return
|
20782
|
+
return p.split(/\/+/);
|
20616
20783
|
}
|
20617
20784
|
}
|
20618
20785
|
match(f, partial = this.partial) {
|
@@ -21064,56 +21231,56 @@ var require_textParsers = __commonJS({
|
|
21064
21231
|
if (!value) {
|
21065
21232
|
return null;
|
21066
21233
|
}
|
21067
|
-
var
|
21234
|
+
var p = arrayParser.create(value, function(entry) {
|
21068
21235
|
if (entry !== null) {
|
21069
21236
|
entry = parsePoint(entry);
|
21070
21237
|
}
|
21071
21238
|
return entry;
|
21072
21239
|
});
|
21073
|
-
return
|
21240
|
+
return p.parse();
|
21074
21241
|
};
|
21075
21242
|
var parseFloatArray = function(value) {
|
21076
21243
|
if (!value) {
|
21077
21244
|
return null;
|
21078
21245
|
}
|
21079
|
-
var
|
21246
|
+
var p = arrayParser.create(value, function(entry) {
|
21080
21247
|
if (entry !== null) {
|
21081
21248
|
entry = parseFloat(entry);
|
21082
21249
|
}
|
21083
21250
|
return entry;
|
21084
21251
|
});
|
21085
|
-
return
|
21252
|
+
return p.parse();
|
21086
21253
|
};
|
21087
21254
|
var parseStringArray = function(value) {
|
21088
21255
|
if (!value) {
|
21089
21256
|
return null;
|
21090
21257
|
}
|
21091
|
-
var
|
21092
|
-
return
|
21258
|
+
var p = arrayParser.create(value);
|
21259
|
+
return p.parse();
|
21093
21260
|
};
|
21094
21261
|
var parseDateArray = function(value) {
|
21095
21262
|
if (!value) {
|
21096
21263
|
return null;
|
21097
21264
|
}
|
21098
|
-
var
|
21265
|
+
var p = arrayParser.create(value, function(entry) {
|
21099
21266
|
if (entry !== null) {
|
21100
21267
|
entry = parseDate(entry);
|
21101
21268
|
}
|
21102
21269
|
return entry;
|
21103
21270
|
});
|
21104
|
-
return
|
21271
|
+
return p.parse();
|
21105
21272
|
};
|
21106
21273
|
var parseIntervalArray = function(value) {
|
21107
21274
|
if (!value) {
|
21108
21275
|
return null;
|
21109
21276
|
}
|
21110
|
-
var
|
21277
|
+
var p = arrayParser.create(value, function(entry) {
|
21111
21278
|
if (entry !== null) {
|
21112
21279
|
entry = parseInterval(entry);
|
21113
21280
|
}
|
21114
21281
|
return entry;
|
21115
21282
|
});
|
21116
|
-
return
|
21283
|
+
return p.parse();
|
21117
21284
|
};
|
21118
21285
|
var parseByteAArray = function(value) {
|
21119
21286
|
if (!value) {
|
@@ -23779,7 +23946,7 @@ var require_split2 = __commonJS({
|
|
23779
23946
|
var require_helper = __commonJS({
|
23780
23947
|
"node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/helper.js"(exports, module2) {
|
23781
23948
|
"use strict";
|
23782
|
-
var
|
23949
|
+
var path4 = require("path");
|
23783
23950
|
var Stream = require("stream").Stream;
|
23784
23951
|
var split = require_split2();
|
23785
23952
|
var util2 = require("util");
|
@@ -23817,8 +23984,8 @@ var require_helper = __commonJS({
|
|
23817
23984
|
return old;
|
23818
23985
|
};
|
23819
23986
|
module2.exports.getFileName = function(rawEnv) {
|
23820
|
-
var
|
23821
|
-
var file =
|
23987
|
+
var env2 = rawEnv || process.env;
|
23988
|
+
var file = env2.PGPASSFILE || (isWin ? path4.join(env2.APPDATA || "./", "postgresql", "pgpass.conf") : path4.join(env2.HOME || "./", ".pgpass"));
|
23822
23989
|
return file;
|
23823
23990
|
};
|
23824
23991
|
module2.exports.usePgPass = function(stats, fname) {
|
@@ -23950,7 +24117,7 @@ var require_helper = __commonJS({
|
|
23950
24117
|
var require_lib = __commonJS({
|
23951
24118
|
"node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js"(exports, module2) {
|
23952
24119
|
"use strict";
|
23953
|
-
var
|
24120
|
+
var path4 = require("path");
|
23954
24121
|
var fs8 = require("fs");
|
23955
24122
|
var helper = require_helper();
|
23956
24123
|
module2.exports = function(connInfo, cb) {
|
@@ -26120,15 +26287,6 @@ var init_sqliteIntrospect = __esm({
|
|
26120
26287
|
}
|
26121
26288
|
});
|
26122
26289
|
|
26123
|
-
// src/serializer/schemaToDrizzle.ts
|
26124
|
-
var import_pg_core4, import_sqlite_core3;
|
26125
|
-
var init_schemaToDrizzle = __esm({
|
26126
|
-
"src/serializer/schemaToDrizzle.ts"() {
|
26127
|
-
import_pg_core4 = require("drizzle-orm/pg-core");
|
26128
|
-
import_sqlite_core3 = require("drizzle-orm/sqlite-core");
|
26129
|
-
}
|
26130
|
-
});
|
26131
|
-
|
26132
26290
|
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js
|
26133
26291
|
var require_constants = __commonJS({
|
26134
26292
|
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js"(exports, module2) {
|
@@ -27207,9 +27365,9 @@ var require_yallist = __commonJS({
|
|
27207
27365
|
var head = this.head;
|
27208
27366
|
var tail = this.tail;
|
27209
27367
|
for (var walker = head; walker !== null; walker = walker.prev) {
|
27210
|
-
var
|
27368
|
+
var p = walker.prev;
|
27211
27369
|
walker.prev = walker.next;
|
27212
|
-
walker.next =
|
27370
|
+
walker.next = p;
|
27213
27371
|
}
|
27214
27372
|
this.head = tail;
|
27215
27373
|
this.tail = head;
|
@@ -27707,20 +27865,20 @@ var require_range = __commonJS({
|
|
27707
27865
|
};
|
27708
27866
|
var replaceTilde = (comp, options) => {
|
27709
27867
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
27710
|
-
return comp.replace(r, (_2, M, m,
|
27711
|
-
debug("tilde", comp, _2, M, m,
|
27868
|
+
return comp.replace(r, (_2, M, m, p, pr) => {
|
27869
|
+
debug("tilde", comp, _2, M, m, p, pr);
|
27712
27870
|
let ret;
|
27713
27871
|
if (isX(M)) {
|
27714
27872
|
ret = "";
|
27715
27873
|
} else if (isX(m)) {
|
27716
27874
|
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
27717
|
-
} else if (isX(
|
27875
|
+
} else if (isX(p)) {
|
27718
27876
|
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
27719
27877
|
} else if (pr) {
|
27720
27878
|
debug("replaceTilde pr", pr);
|
27721
|
-
ret = `>=${M}.${m}.${
|
27879
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
27722
27880
|
} else {
|
27723
|
-
ret = `>=${M}.${m}.${
|
27881
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
27724
27882
|
}
|
27725
27883
|
debug("tilde return", ret);
|
27726
27884
|
return ret;
|
@@ -27733,14 +27891,14 @@ var require_range = __commonJS({
|
|
27733
27891
|
debug("caret", comp, options);
|
27734
27892
|
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
27735
27893
|
const z2 = options.includePrerelease ? "-0" : "";
|
27736
|
-
return comp.replace(r, (_2, M, m,
|
27737
|
-
debug("caret", comp, _2, M, m,
|
27894
|
+
return comp.replace(r, (_2, M, m, p, pr) => {
|
27895
|
+
debug("caret", comp, _2, M, m, p, pr);
|
27738
27896
|
let ret;
|
27739
27897
|
if (isX(M)) {
|
27740
27898
|
ret = "";
|
27741
27899
|
} else if (isX(m)) {
|
27742
27900
|
ret = `>=${M}.0.0${z2} <${+M + 1}.0.0-0`;
|
27743
|
-
} else if (isX(
|
27901
|
+
} else if (isX(p)) {
|
27744
27902
|
if (M === "0") {
|
27745
27903
|
ret = `>=${M}.${m}.0${z2} <${M}.${+m + 1}.0-0`;
|
27746
27904
|
} else {
|
@@ -27750,23 +27908,23 @@ var require_range = __commonJS({
|
|
27750
27908
|
debug("replaceCaret pr", pr);
|
27751
27909
|
if (M === "0") {
|
27752
27910
|
if (m === "0") {
|
27753
|
-
ret = `>=${M}.${m}.${
|
27911
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
27754
27912
|
} else {
|
27755
|
-
ret = `>=${M}.${m}.${
|
27913
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
27756
27914
|
}
|
27757
27915
|
} else {
|
27758
|
-
ret = `>=${M}.${m}.${
|
27916
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
27759
27917
|
}
|
27760
27918
|
} else {
|
27761
27919
|
debug("no pr");
|
27762
27920
|
if (M === "0") {
|
27763
27921
|
if (m === "0") {
|
27764
|
-
ret = `>=${M}.${m}.${
|
27922
|
+
ret = `>=${M}.${m}.${p}${z2} <${M}.${m}.${+p + 1}-0`;
|
27765
27923
|
} else {
|
27766
|
-
ret = `>=${M}.${m}.${
|
27924
|
+
ret = `>=${M}.${m}.${p}${z2} <${M}.${+m + 1}.0-0`;
|
27767
27925
|
}
|
27768
27926
|
} else {
|
27769
|
-
ret = `>=${M}.${m}.${
|
27927
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
27770
27928
|
}
|
27771
27929
|
}
|
27772
27930
|
debug("caret return", ret);
|
@@ -27780,11 +27938,11 @@ var require_range = __commonJS({
|
|
27780
27938
|
var replaceXRange = (comp, options) => {
|
27781
27939
|
comp = comp.trim();
|
27782
27940
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
27783
|
-
return comp.replace(r, (ret, gtlt, M, m,
|
27784
|
-
debug("xRange", comp, ret, gtlt, M, m,
|
27941
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
27942
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
27785
27943
|
const xM = isX(M);
|
27786
27944
|
const xm = xM || isX(m);
|
27787
|
-
const xp = xm || isX(
|
27945
|
+
const xp = xm || isX(p);
|
27788
27946
|
const anyX = xp;
|
27789
27947
|
if (gtlt === "=" && anyX) {
|
27790
27948
|
gtlt = "";
|
@@ -27800,16 +27958,16 @@ var require_range = __commonJS({
|
|
27800
27958
|
if (xm) {
|
27801
27959
|
m = 0;
|
27802
27960
|
}
|
27803
|
-
|
27961
|
+
p = 0;
|
27804
27962
|
if (gtlt === ">") {
|
27805
27963
|
gtlt = ">=";
|
27806
27964
|
if (xm) {
|
27807
27965
|
M = +M + 1;
|
27808
27966
|
m = 0;
|
27809
|
-
|
27967
|
+
p = 0;
|
27810
27968
|
} else {
|
27811
27969
|
m = +m + 1;
|
27812
|
-
|
27970
|
+
p = 0;
|
27813
27971
|
}
|
27814
27972
|
} else if (gtlt === "<=") {
|
27815
27973
|
gtlt = "<";
|
@@ -27822,7 +27980,7 @@ var require_range = __commonJS({
|
|
27822
27980
|
if (gtlt === "<") {
|
27823
27981
|
pr = "-0";
|
27824
27982
|
}
|
27825
|
-
ret = `${gtlt + M}.${m}.${
|
27983
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
27826
27984
|
} else if (xm) {
|
27827
27985
|
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
27828
27986
|
} else if (xp) {
|
@@ -31624,10 +31782,10 @@ var require_long = __commonJS({
|
|
31624
31782
|
radix = radix || 10;
|
31625
31783
|
if (radix < 2 || 36 < radix)
|
31626
31784
|
throw RangeError("radix");
|
31627
|
-
var
|
31628
|
-
if ((
|
31785
|
+
var p;
|
31786
|
+
if ((p = str.indexOf("-")) > 0)
|
31629
31787
|
throw Error("interior hyphen");
|
31630
|
-
else if (
|
31788
|
+
else if (p === 0) {
|
31631
31789
|
return fromString(str.substring(1), unsigned, radix).neg();
|
31632
31790
|
}
|
31633
31791
|
var radixToPower = fromNumber(pow_dbl(radix, 8));
|
@@ -37500,8 +37658,8 @@ var require_change_user = __commonJS({
|
|
37500
37658
|
if (typeof this.database !== "string") {
|
37501
37659
|
throw new Error('"database" connection config property must be a string');
|
37502
37660
|
}
|
37503
|
-
const
|
37504
|
-
return this.serializeToBuffer(Buffer.allocUnsafe(
|
37661
|
+
const p = this.serializeToBuffer(Packet.MockBuffer());
|
37662
|
+
return this.serializeToBuffer(Buffer.allocUnsafe(p.offset));
|
37505
37663
|
}
|
37506
37664
|
};
|
37507
37665
|
module2.exports = ChangeUser;
|
@@ -37984,8 +38142,8 @@ var require_handshake_response = __commonJS({
|
|
37984
38142
|
if (typeof this.database !== "string") {
|
37985
38143
|
throw new Error('"database" connection config property must be a string');
|
37986
38144
|
}
|
37987
|
-
const
|
37988
|
-
return this.serializeResponse(Buffer.alloc(
|
38145
|
+
const p = this.serializeResponse(Packet.MockBuffer());
|
38146
|
+
return this.serializeResponse(Buffer.alloc(p.offset));
|
37989
38147
|
}
|
37990
38148
|
static fromPacket(packet) {
|
37991
38149
|
const args = {};
|
@@ -38415,7 +38573,7 @@ var require_text_row = __commonJS({
|
|
38415
38573
|
var require_packets = __commonJS({
|
38416
38574
|
"node_modules/.pnpm/mysql2@2.3.3/node_modules/mysql2/lib/packets/index.js"(exports, module2) {
|
38417
38575
|
"use strict";
|
38418
|
-
var
|
38576
|
+
var process4 = require("process");
|
38419
38577
|
var AuthSwitchRequest = require_auth_switch_request();
|
38420
38578
|
var AuthSwitchRequestMoreData = require_auth_switch_request_more_data();
|
38421
38579
|
var AuthSwitchResponse = require_auth_switch_response();
|
@@ -38456,13 +38614,13 @@ var require_packets = __commonJS({
|
|
38456
38614
|
};
|
38457
38615
|
Object.entries(ctorMap).forEach(([name, ctor]) => {
|
38458
38616
|
module2.exports[name] = ctor;
|
38459
|
-
if (
|
38617
|
+
if (process4.env.NODE_DEBUG) {
|
38460
38618
|
if (ctor.prototype.toPacket) {
|
38461
38619
|
const old = ctor.prototype.toPacket;
|
38462
38620
|
ctor.prototype.toPacket = function() {
|
38463
|
-
const
|
38464
|
-
|
38465
|
-
return
|
38621
|
+
const p = old.call(this);
|
38622
|
+
p._name = name;
|
38623
|
+
return p;
|
38466
38624
|
};
|
38467
38625
|
}
|
38468
38626
|
}
|
@@ -39059,8 +39217,8 @@ var require_compressed_protocol = __commonJS({
|
|
39059
39217
|
connection._lastWrittenPacketId = 0;
|
39060
39218
|
connection._lastReceivedPacketId = 0;
|
39061
39219
|
connection._handleCompressedPacket = handleCompressedPacket;
|
39062
|
-
connection._inflatedPacketsParser = new PacketParser((
|
39063
|
-
connection.handlePacket(
|
39220
|
+
connection._inflatedPacketsParser = new PacketParser((p) => {
|
39221
|
+
connection.handlePacket(p);
|
39064
39222
|
}, 4);
|
39065
39223
|
connection._inflatedPacketsParser._lastPacket = 0;
|
39066
39224
|
connection.packetParser = new PacketParser((packet) => {
|
@@ -40099,7 +40257,7 @@ var require_text_parser = __commonJS({
|
|
40099
40257
|
var require_query4 = __commonJS({
|
40100
40258
|
"node_modules/.pnpm/mysql2@2.3.3/node_modules/mysql2/lib/commands/query.js"(exports, module2) {
|
40101
40259
|
"use strict";
|
40102
|
-
var
|
40260
|
+
var process4 = require("process");
|
40103
40261
|
var Timers = require("timers");
|
40104
40262
|
var Readable = require("stream").Readable;
|
40105
40263
|
var Command2 = require_command();
|
@@ -40168,11 +40326,11 @@ var require_query4 = __commonJS({
|
|
40168
40326
|
fields = this._fields;
|
40169
40327
|
}
|
40170
40328
|
if (fields) {
|
40171
|
-
|
40329
|
+
process4.nextTick(() => {
|
40172
40330
|
this.onResult(null, rows, fields);
|
40173
40331
|
});
|
40174
40332
|
} else {
|
40175
|
-
|
40333
|
+
process4.nextTick(() => {
|
40176
40334
|
this.onResult(null, rows);
|
40177
40335
|
});
|
40178
40336
|
}
|
@@ -40217,12 +40375,12 @@ var require_query4 = __commonJS({
|
|
40217
40375
|
this._fields.push([]);
|
40218
40376
|
return this.readField;
|
40219
40377
|
}
|
40220
|
-
_streamLocalInfile(connection,
|
40378
|
+
_streamLocalInfile(connection, path4) {
|
40221
40379
|
if (this._streamFactory) {
|
40222
|
-
this._localStream = this._streamFactory(
|
40380
|
+
this._localStream = this._streamFactory(path4);
|
40223
40381
|
} else {
|
40224
40382
|
this._localStreamError = new Error(
|
40225
|
-
`As a result of LOCAL INFILE command server wants to read ${
|
40383
|
+
`As a result of LOCAL INFILE command server wants to read ${path4} file, but as of v2.0 you must provide streamFactory option returning ReadStream.`
|
40226
40384
|
);
|
40227
40385
|
connection.writePacket(EmptyPacket);
|
40228
40386
|
return this.infileOk;
|
@@ -42147,10 +42305,10 @@ var require_lru_cache2 = __commonJS({
|
|
42147
42305
|
if (aborted && !ignoreAbort && !updateCache) {
|
42148
42306
|
return fetchFail(ac.signal.reason);
|
42149
42307
|
}
|
42150
|
-
if (this.valList[index4] ===
|
42308
|
+
if (this.valList[index4] === p) {
|
42151
42309
|
if (v2 === void 0) {
|
42152
|
-
if (
|
42153
|
-
this.valList[index4] =
|
42310
|
+
if (p.__staleWhileFetching) {
|
42311
|
+
this.valList[index4] = p.__staleWhileFetching;
|
42154
42312
|
} else {
|
42155
42313
|
this.delete(k);
|
42156
42314
|
}
|
@@ -42174,20 +42332,20 @@ var require_lru_cache2 = __commonJS({
|
|
42174
42332
|
const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
|
42175
42333
|
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
42176
42334
|
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
42177
|
-
if (this.valList[index4] ===
|
42178
|
-
const del = !noDelete ||
|
42335
|
+
if (this.valList[index4] === p) {
|
42336
|
+
const del = !noDelete || p.__staleWhileFetching === void 0;
|
42179
42337
|
if (del) {
|
42180
42338
|
this.delete(k);
|
42181
42339
|
} else if (!allowStaleAborted) {
|
42182
|
-
this.valList[index4] =
|
42340
|
+
this.valList[index4] = p.__staleWhileFetching;
|
42183
42341
|
}
|
42184
42342
|
}
|
42185
42343
|
if (allowStale) {
|
42186
|
-
if (options.status &&
|
42344
|
+
if (options.status && p.__staleWhileFetching !== void 0) {
|
42187
42345
|
options.status.returnedStale = true;
|
42188
42346
|
}
|
42189
|
-
return
|
42190
|
-
} else if (
|
42347
|
+
return p.__staleWhileFetching;
|
42348
|
+
} else if (p.__returned === p) {
|
42191
42349
|
throw er;
|
42192
42350
|
}
|
42193
42351
|
};
|
@@ -42204,23 +42362,23 @@ var require_lru_cache2 = __commonJS({
|
|
42204
42362
|
};
|
42205
42363
|
if (options.status)
|
42206
42364
|
options.status.fetchDispatched = true;
|
42207
|
-
const
|
42208
|
-
|
42209
|
-
|
42210
|
-
|
42365
|
+
const p = new Promise(pcall).then(cb, eb);
|
42366
|
+
p.__abortController = ac;
|
42367
|
+
p.__staleWhileFetching = v;
|
42368
|
+
p.__returned = null;
|
42211
42369
|
if (index4 === void 0) {
|
42212
|
-
this.set(k,
|
42370
|
+
this.set(k, p, { ...fetchOpts.options, status: void 0 });
|
42213
42371
|
index4 = this.keyMap.get(k);
|
42214
42372
|
} else {
|
42215
|
-
this.valList[index4] =
|
42373
|
+
this.valList[index4] = p;
|
42216
42374
|
}
|
42217
|
-
return
|
42375
|
+
return p;
|
42218
42376
|
}
|
42219
|
-
isBackgroundFetch(
|
42220
|
-
return
|
42221
|
-
|
42377
|
+
isBackgroundFetch(p) {
|
42378
|
+
return p && typeof p === "object" && typeof p.then === "function" && Object.prototype.hasOwnProperty.call(
|
42379
|
+
p,
|
42222
42380
|
"__staleWhileFetching"
|
42223
|
-
) && Object.prototype.hasOwnProperty.call(
|
42381
|
+
) && Object.prototype.hasOwnProperty.call(p, "__returned") && (p.__returned === p || p.__returned === null);
|
42224
42382
|
}
|
42225
42383
|
// this takes the union of get() and set() opts, because it does both
|
42226
42384
|
async fetch(k, {
|
@@ -42274,8 +42432,8 @@ var require_lru_cache2 = __commonJS({
|
|
42274
42432
|
if (index4 === void 0) {
|
42275
42433
|
if (status)
|
42276
42434
|
status.fetch = "miss";
|
42277
|
-
const
|
42278
|
-
return
|
42435
|
+
const p = this.backgroundFetch(k, index4, options, fetchContext);
|
42436
|
+
return p.__returned = p;
|
42279
42437
|
} else {
|
42280
42438
|
const v = this.valList[index4];
|
42281
42439
|
if (this.isBackgroundFetch(v)) {
|
@@ -42298,15 +42456,15 @@ var require_lru_cache2 = __commonJS({
|
|
42298
42456
|
this.statusTTL(status, index4);
|
42299
42457
|
return v;
|
42300
42458
|
}
|
42301
|
-
const
|
42302
|
-
const hasStale =
|
42459
|
+
const p = this.backgroundFetch(k, index4, options, fetchContext);
|
42460
|
+
const hasStale = p.__staleWhileFetching !== void 0;
|
42303
42461
|
const staleVal = hasStale && allowStale;
|
42304
42462
|
if (status) {
|
42305
42463
|
status.fetch = hasStale && isStale ? "stale" : "refresh";
|
42306
42464
|
if (staleVal && isStale)
|
42307
42465
|
status.returnedStale = true;
|
42308
42466
|
}
|
42309
|
-
return staleVal ?
|
42467
|
+
return staleVal ? p.__staleWhileFetching : p.__returned = p;
|
42310
42468
|
}
|
42311
42469
|
}
|
42312
42470
|
get(k, {
|
@@ -42352,9 +42510,9 @@ var require_lru_cache2 = __commonJS({
|
|
42352
42510
|
status.get = "miss";
|
42353
42511
|
}
|
42354
42512
|
}
|
42355
|
-
connect(
|
42356
|
-
this.prev[n] =
|
42357
|
-
this.next[
|
42513
|
+
connect(p, n) {
|
42514
|
+
this.prev[n] = p;
|
42515
|
+
this.next[p] = n;
|
42358
42516
|
}
|
42359
42517
|
moveToTail(index4) {
|
42360
42518
|
if (index4 !== this.tail) {
|
@@ -42564,7 +42722,7 @@ var require_named_placeholders = __commonJS({
|
|
42564
42722
|
}
|
42565
42723
|
return s;
|
42566
42724
|
}
|
42567
|
-
function
|
42725
|
+
function join6(tree) {
|
42568
42726
|
if (tree.length == 1) {
|
42569
42727
|
return tree;
|
42570
42728
|
}
|
@@ -42590,7 +42748,7 @@ var require_named_placeholders = __commonJS({
|
|
42590
42748
|
if (cache && (tree = cache.get(query))) {
|
42591
42749
|
return toArrayParams(tree, paramsObj);
|
42592
42750
|
}
|
42593
|
-
tree =
|
42751
|
+
tree = join6(parse(query));
|
42594
42752
|
if (cache) {
|
42595
42753
|
cache.set(query, tree);
|
42596
42754
|
}
|
@@ -42690,8 +42848,8 @@ var require_connection2 = __commonJS({
|
|
42690
42848
|
this._outOfOrderPackets = [];
|
42691
42849
|
this.clientEncoding = CharsetToEncoding[this.config.charsetNumber];
|
42692
42850
|
this.stream.on("error", this._handleNetworkError.bind(this));
|
42693
|
-
this.packetParser = new PacketParser((
|
42694
|
-
this.handlePacket(
|
42851
|
+
this.packetParser = new PacketParser((p) => {
|
42852
|
+
this.handlePacket(p);
|
42695
42853
|
});
|
42696
42854
|
this.stream.on("data", (data) => {
|
42697
42855
|
if (this.connectTimeout) {
|
@@ -43472,7 +43630,7 @@ var require_pool_connection = __commonJS({
|
|
43472
43630
|
var require_pool = __commonJS({
|
43473
43631
|
"node_modules/.pnpm/mysql2@2.3.3/node_modules/mysql2/lib/pool.js"(exports, module2) {
|
43474
43632
|
"use strict";
|
43475
|
-
var
|
43633
|
+
var process4 = require("process");
|
43476
43634
|
var mysql = require_mysql2();
|
43477
43635
|
var EventEmitter = require("events").EventEmitter;
|
43478
43636
|
var PoolConnection = require_pool_connection();
|
@@ -43503,13 +43661,13 @@ var require_pool = __commonJS({
|
|
43503
43661
|
}
|
43504
43662
|
getConnection(cb) {
|
43505
43663
|
if (this._closed) {
|
43506
|
-
return
|
43664
|
+
return process4.nextTick(() => cb(new Error("Pool is closed.")));
|
43507
43665
|
}
|
43508
43666
|
let connection;
|
43509
43667
|
if (this._freeConnections.length > 0) {
|
43510
43668
|
connection = this._freeConnections.shift();
|
43511
43669
|
this.emit("acquire", connection);
|
43512
|
-
return
|
43670
|
+
return process4.nextTick(() => cb(null, connection));
|
43513
43671
|
}
|
43514
43672
|
if (this.config.connectionLimit === 0 || this._allConnections.length < this.config.connectionLimit) {
|
43515
43673
|
connection = new PoolConnection(this, {
|
@@ -43529,7 +43687,7 @@ var require_pool = __commonJS({
|
|
43529
43687
|
});
|
43530
43688
|
}
|
43531
43689
|
if (!this.config.waitForConnections) {
|
43532
|
-
return
|
43690
|
+
return process4.nextTick(() => cb(new Error("No connections available.")));
|
43533
43691
|
}
|
43534
43692
|
if (this.config.queueLimit && this._connectionQueue.length >= this.config.queueLimit) {
|
43535
43693
|
return cb(new Error("Queue limit reached."));
|
@@ -43542,11 +43700,11 @@ var require_pool = __commonJS({
|
|
43542
43700
|
if (!connection._pool) {
|
43543
43701
|
if (this._connectionQueue.length) {
|
43544
43702
|
cb = this._connectionQueue.shift();
|
43545
|
-
|
43703
|
+
process4.nextTick(this.getConnection.bind(this, cb));
|
43546
43704
|
}
|
43547
43705
|
} else if (this._connectionQueue.length) {
|
43548
43706
|
cb = this._connectionQueue.shift();
|
43549
|
-
|
43707
|
+
process4.nextTick(cb.bind(null, null, connection));
|
43550
43708
|
} else {
|
43551
43709
|
this._freeConnections.push(connection);
|
43552
43710
|
this.emit("release", connection);
|
@@ -43684,7 +43842,7 @@ var require_pool_config = __commonJS({
|
|
43684
43842
|
var require_pool_cluster = __commonJS({
|
43685
43843
|
"node_modules/.pnpm/mysql2@2.3.3/node_modules/mysql2/lib/pool_cluster.js"(exports, module2) {
|
43686
43844
|
"use strict";
|
43687
|
-
var
|
43845
|
+
var process4 = require("process");
|
43688
43846
|
var Pool = require_pool();
|
43689
43847
|
var PoolConfig = require_pool_config();
|
43690
43848
|
var Connection2 = require_connection2();
|
@@ -43848,7 +44006,7 @@ var require_pool_cluster = __commonJS({
|
|
43848
44006
|
}
|
43849
44007
|
};
|
43850
44008
|
if (this._closed) {
|
43851
|
-
|
44009
|
+
process4.nextTick(cb);
|
43852
44010
|
return;
|
43853
44011
|
}
|
43854
44012
|
this._closed = true;
|
@@ -43865,7 +44023,7 @@ var require_pool_cluster = __commonJS({
|
|
43865
44023
|
this._nodes[id].pool.end(onEnd);
|
43866
44024
|
}
|
43867
44025
|
if (waitingClose === 0) {
|
43868
|
-
|
44026
|
+
process4.nextTick(onEnd);
|
43869
44027
|
}
|
43870
44028
|
}
|
43871
44029
|
_findNodeIds(pattern) {
|
@@ -44519,15 +44677,15 @@ var require_promise = __commonJS({
|
|
44519
44677
|
});
|
44520
44678
|
|
44521
44679
|
// src/orm-extenstions/d1-driver/session.ts
|
44522
|
-
var import_drizzle_orm10, import_drizzle_orm11, import_drizzle_orm12,
|
44680
|
+
var import_drizzle_orm10, import_drizzle_orm11, import_drizzle_orm12, import_sqlite_core3, import_drizzle_orm13, _a, SQLiteWranglerD1Session, _a2, PreparedQuery;
|
44523
44681
|
var init_session = __esm({
|
44524
44682
|
"src/orm-extenstions/d1-driver/session.ts"() {
|
44525
44683
|
import_drizzle_orm10 = require("drizzle-orm");
|
44526
44684
|
import_drizzle_orm11 = require("drizzle-orm");
|
44527
44685
|
import_drizzle_orm12 = require("drizzle-orm");
|
44528
|
-
|
44686
|
+
import_sqlite_core3 = require("drizzle-orm/sqlite-core");
|
44529
44687
|
import_drizzle_orm13 = require("drizzle-orm");
|
44530
|
-
SQLiteWranglerD1Session = class extends
|
44688
|
+
SQLiteWranglerD1Session = class extends import_sqlite_core3.SQLiteSession {
|
44531
44689
|
constructor(client, configPath, dbName, dialect6, schema4, options = {}) {
|
44532
44690
|
super(dialect6);
|
44533
44691
|
this.client = client;
|
@@ -44556,7 +44714,7 @@ var init_session = __esm({
|
|
44556
44714
|
};
|
44557
44715
|
_a = import_drizzle_orm10.entityKind;
|
44558
44716
|
SQLiteWranglerD1Session[_a] = "SQLiteD1Session";
|
44559
|
-
PreparedQuery = class extends
|
44717
|
+
PreparedQuery = class extends import_sqlite_core3.SQLitePreparedQuery {
|
44560
44718
|
constructor(stmt, configPath, dbName, queryString, params, logger, fields, executeMethod, customResultMapper) {
|
44561
44719
|
super("async", executeMethod, {
|
44562
44720
|
sql: queryString,
|
@@ -44681,20 +44839,20 @@ function drizzle(client, configPath, dbName, config = {}) {
|
|
44681
44839
|
const session = new SQLiteWranglerD1Session(client, configPath, dbName, dialect6, schema4, {
|
44682
44840
|
logger
|
44683
44841
|
});
|
44684
|
-
return new
|
44842
|
+
return new import_sqlite_core4.BaseSQLiteDatabase(
|
44685
44843
|
"async",
|
44686
44844
|
dialect6,
|
44687
44845
|
session,
|
44688
44846
|
schema4
|
44689
44847
|
);
|
44690
44848
|
}
|
44691
|
-
var import_drizzle_orm14,
|
44849
|
+
var import_drizzle_orm14, import_sqlite_core4, WranglerDialect;
|
44692
44850
|
var init_driver = __esm({
|
44693
44851
|
"src/orm-extenstions/d1-driver/driver.ts"() {
|
44694
44852
|
import_drizzle_orm14 = require("drizzle-orm");
|
44695
|
-
|
44853
|
+
import_sqlite_core4 = require("drizzle-orm/sqlite-core");
|
44696
44854
|
init_session();
|
44697
|
-
WranglerDialect = class extends
|
44855
|
+
WranglerDialect = class extends import_sqlite_core4.SQLiteAsyncDialect {
|
44698
44856
|
sqlToQuery(sql2) {
|
44699
44857
|
return sql2.toQuery({
|
44700
44858
|
escapeName: this.escapeName,
|
@@ -44714,7 +44872,7 @@ var require_windows = __commonJS({
|
|
44714
44872
|
module2.exports = isexe;
|
44715
44873
|
isexe.sync = sync2;
|
44716
44874
|
var fs8 = require("fs");
|
44717
|
-
function checkPathExt(
|
44875
|
+
function checkPathExt(path4, options) {
|
44718
44876
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
44719
44877
|
if (!pathext) {
|
44720
44878
|
return true;
|
@@ -44724,26 +44882,26 @@ var require_windows = __commonJS({
|
|
44724
44882
|
return true;
|
44725
44883
|
}
|
44726
44884
|
for (var i = 0; i < pathext.length; i++) {
|
44727
|
-
var
|
44728
|
-
if (
|
44885
|
+
var p = pathext[i].toLowerCase();
|
44886
|
+
if (p && path4.substr(-p.length).toLowerCase() === p) {
|
44729
44887
|
return true;
|
44730
44888
|
}
|
44731
44889
|
}
|
44732
44890
|
return false;
|
44733
44891
|
}
|
44734
|
-
function checkStat(stat,
|
44892
|
+
function checkStat(stat, path4, options) {
|
44735
44893
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
44736
44894
|
return false;
|
44737
44895
|
}
|
44738
|
-
return checkPathExt(
|
44896
|
+
return checkPathExt(path4, options);
|
44739
44897
|
}
|
44740
|
-
function isexe(
|
44741
|
-
fs8.stat(
|
44742
|
-
cb(er, er ? false : checkStat(stat,
|
44898
|
+
function isexe(path4, options, cb) {
|
44899
|
+
fs8.stat(path4, function(er, stat) {
|
44900
|
+
cb(er, er ? false : checkStat(stat, path4, options));
|
44743
44901
|
});
|
44744
44902
|
}
|
44745
|
-
function sync2(
|
44746
|
-
return checkStat(fs8.statSync(
|
44903
|
+
function sync2(path4, options) {
|
44904
|
+
return checkStat(fs8.statSync(path4), path4, options);
|
44747
44905
|
}
|
44748
44906
|
}
|
44749
44907
|
});
|
@@ -44754,13 +44912,13 @@ var require_mode = __commonJS({
|
|
44754
44912
|
module2.exports = isexe;
|
44755
44913
|
isexe.sync = sync2;
|
44756
44914
|
var fs8 = require("fs");
|
44757
|
-
function isexe(
|
44758
|
-
fs8.stat(
|
44915
|
+
function isexe(path4, options, cb) {
|
44916
|
+
fs8.stat(path4, function(er, stat) {
|
44759
44917
|
cb(er, er ? false : checkStat(stat, options));
|
44760
44918
|
});
|
44761
44919
|
}
|
44762
|
-
function sync2(
|
44763
|
-
return checkStat(fs8.statSync(
|
44920
|
+
function sync2(path4, options) {
|
44921
|
+
return checkStat(fs8.statSync(path4), options);
|
44764
44922
|
}
|
44765
44923
|
function checkStat(stat, options) {
|
44766
44924
|
return stat.isFile() && checkMode(stat, options);
|
@@ -44793,7 +44951,7 @@ var require_isexe = __commonJS({
|
|
44793
44951
|
}
|
44794
44952
|
module2.exports = isexe;
|
44795
44953
|
isexe.sync = sync2;
|
44796
|
-
function isexe(
|
44954
|
+
function isexe(path4, options, cb) {
|
44797
44955
|
if (typeof options === "function") {
|
44798
44956
|
cb = options;
|
44799
44957
|
options = {};
|
@@ -44803,7 +44961,7 @@ var require_isexe = __commonJS({
|
|
44803
44961
|
throw new TypeError("callback not provided");
|
44804
44962
|
}
|
44805
44963
|
return new Promise(function(resolve2, reject) {
|
44806
|
-
isexe(
|
44964
|
+
isexe(path4, options || {}, function(er, is9) {
|
44807
44965
|
if (er) {
|
44808
44966
|
reject(er);
|
44809
44967
|
} else {
|
@@ -44812,7 +44970,7 @@ var require_isexe = __commonJS({
|
|
44812
44970
|
});
|
44813
44971
|
});
|
44814
44972
|
}
|
44815
|
-
core(
|
44973
|
+
core(path4, options || {}, function(er, is9) {
|
44816
44974
|
if (er) {
|
44817
44975
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
44818
44976
|
er = null;
|
@@ -44822,9 +44980,9 @@ var require_isexe = __commonJS({
|
|
44822
44980
|
cb(er, is9);
|
44823
44981
|
});
|
44824
44982
|
}
|
44825
|
-
function sync2(
|
44983
|
+
function sync2(path4, options) {
|
44826
44984
|
try {
|
44827
|
-
return core.sync(
|
44985
|
+
return core.sync(path4, options || {});
|
44828
44986
|
} catch (er) {
|
44829
44987
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
44830
44988
|
return false;
|
@@ -44840,7 +44998,7 @@ var require_isexe = __commonJS({
|
|
44840
44998
|
var require_lib4 = __commonJS({
|
44841
44999
|
"node_modules/.pnpm/which@3.0.1/node_modules/which/lib/index.js"(exports, module2) {
|
44842
45000
|
var isexe = require_isexe();
|
44843
|
-
var { join:
|
45001
|
+
var { join: join6, delimiter, sep: sep2, posix } = require("path");
|
44844
45002
|
var isWindows = process.platform === "win32";
|
44845
45003
|
var rSlash = new RegExp(`[${posix.sep}${sep2 === posix.sep ? "" : sep2}]`.replace(/(\\)/g, "\\$1"));
|
44846
45004
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
@@ -44873,15 +45031,15 @@ var require_lib4 = __commonJS({
|
|
44873
45031
|
var getPathPart = (raw, cmd) => {
|
44874
45032
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
44875
45033
|
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
44876
|
-
return prefix +
|
45034
|
+
return prefix + join6(pathPart, cmd);
|
44877
45035
|
};
|
44878
45036
|
var which2 = async (cmd, opt = {}) => {
|
44879
45037
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
44880
45038
|
const found = [];
|
44881
45039
|
for (const envPart of pathEnv) {
|
44882
|
-
const
|
45040
|
+
const p = getPathPart(envPart, cmd);
|
44883
45041
|
for (const ext2 of pathExt) {
|
44884
|
-
const withExt =
|
45042
|
+
const withExt = p + ext2;
|
44885
45043
|
const is9 = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
44886
45044
|
if (is9) {
|
44887
45045
|
if (!opt.all) {
|
@@ -44903,9 +45061,9 @@ var require_lib4 = __commonJS({
|
|
44903
45061
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
44904
45062
|
const found = [];
|
44905
45063
|
for (const pathEnvPart of pathEnv) {
|
44906
|
-
const
|
45064
|
+
const p = getPathPart(pathEnvPart, cmd);
|
44907
45065
|
for (const ext2 of pathExt) {
|
44908
|
-
const withExt =
|
45066
|
+
const withExt = p + ext2;
|
44909
45067
|
const is9 = isexe.sync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
44910
45068
|
if (is9) {
|
44911
45069
|
if (!opt.all) {
|
@@ -46066,7 +46224,7 @@ var init_core = __esm({
|
|
46066
46224
|
}
|
46067
46225
|
$ = new Proxy(function(pieces, ...args) {
|
46068
46226
|
const from = new Error().stack.split(/^\s*at\s/m)[2].trim();
|
46069
|
-
if (pieces.some((
|
46227
|
+
if (pieces.some((p) => p == void 0)) {
|
46070
46228
|
throw new Error(`Malformed command at ${from}`);
|
46071
46229
|
}
|
46072
46230
|
let resolve2, reject;
|
@@ -46208,7 +46366,7 @@ var init_core = __esm({
|
|
46208
46366
|
return this.child.stderr;
|
46209
46367
|
}
|
46210
46368
|
get exitCode() {
|
46211
|
-
return this.then((
|
46369
|
+
return this.then((p) => p.exitCode, (p) => p.exitCode);
|
46212
46370
|
}
|
46213
46371
|
then(onfulfilled, onrejected) {
|
46214
46372
|
if (this.isHalted && !this.child) {
|
@@ -46248,9 +46406,9 @@ var init_core = __esm({
|
|
46248
46406
|
if (!this.child.pid)
|
46249
46407
|
throw new Error("The process pid is undefined.");
|
46250
46408
|
let children = await psTree(this.child.pid);
|
46251
|
-
for (const
|
46409
|
+
for (const p of children) {
|
46252
46410
|
try {
|
46253
|
-
process.kill(+
|
46411
|
+
process.kill(+p.PID, signal);
|
46254
46412
|
} catch (e) {
|
46255
46413
|
}
|
46256
46414
|
}
|
@@ -46511,9 +46669,9 @@ var require_path = __commonJS({
|
|
46511
46669
|
"use strict";
|
46512
46670
|
Object.defineProperty(exports, "__esModule", { value: true });
|
46513
46671
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
46514
|
-
var
|
46515
|
-
var
|
46516
|
-
var IS_WINDOWS_PLATFORM =
|
46672
|
+
var os2 = require("os");
|
46673
|
+
var path4 = require("path");
|
46674
|
+
var IS_WINDOWS_PLATFORM = os2.platform() === "win32";
|
46517
46675
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
46518
46676
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
46519
46677
|
var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g;
|
@@ -46524,7 +46682,7 @@ var require_path = __commonJS({
|
|
46524
46682
|
}
|
46525
46683
|
exports.unixify = unixify;
|
46526
46684
|
function makeAbsolute(cwd, filepath) {
|
46527
|
-
return
|
46685
|
+
return path4.resolve(cwd, filepath);
|
46528
46686
|
}
|
46529
46687
|
exports.makeAbsolute = makeAbsolute;
|
46530
46688
|
function removeLeadingDotSegment(entry) {
|
@@ -47371,11 +47529,11 @@ var require_expand = __commonJS({
|
|
47371
47529
|
let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
47372
47530
|
let walk = (node, parent = {}) => {
|
47373
47531
|
node.queue = [];
|
47374
|
-
let
|
47532
|
+
let p = parent;
|
47375
47533
|
let q = parent.queue;
|
47376
|
-
while (
|
47377
|
-
|
47378
|
-
q =
|
47534
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
47535
|
+
p = p.parent;
|
47536
|
+
q = p.queue;
|
47379
47537
|
}
|
47380
47538
|
if (node.invalid || node.dollar) {
|
47381
47539
|
q.push(append(q.pop(), stringify(node, options)));
|
@@ -47845,7 +48003,7 @@ var require_braces = __commonJS({
|
|
47845
48003
|
var require_constants3 = __commonJS({
|
47846
48004
|
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports, module2) {
|
47847
48005
|
"use strict";
|
47848
|
-
var
|
48006
|
+
var path4 = require("path");
|
47849
48007
|
var WIN_SLASH = "\\\\/";
|
47850
48008
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
47851
48009
|
var DOT_LITERAL = "\\.";
|
@@ -48015,7 +48173,7 @@ var require_constants3 = __commonJS({
|
|
48015
48173
|
/* | */
|
48016
48174
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
48017
48175
|
/* \uFEFF */
|
48018
|
-
SEP:
|
48176
|
+
SEP: path4.sep,
|
48019
48177
|
/**
|
48020
48178
|
* Create EXTGLOB_CHARS
|
48021
48179
|
*/
|
@@ -48042,7 +48200,7 @@ var require_constants3 = __commonJS({
|
|
48042
48200
|
var require_utils5 = __commonJS({
|
48043
48201
|
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js"(exports) {
|
48044
48202
|
"use strict";
|
48045
|
-
var
|
48203
|
+
var path4 = require("path");
|
48046
48204
|
var win32 = process.platform === "win32";
|
48047
48205
|
var {
|
48048
48206
|
REGEX_BACKSLASH,
|
@@ -48071,7 +48229,7 @@ var require_utils5 = __commonJS({
|
|
48071
48229
|
if (options && typeof options.windows === "boolean") {
|
48072
48230
|
return options.windows;
|
48073
48231
|
}
|
48074
|
-
return win32 === true ||
|
48232
|
+
return win32 === true || path4.sep === "\\";
|
48075
48233
|
};
|
48076
48234
|
exports.escapeLast = (input, char, lastIdx) => {
|
48077
48235
|
const idx = input.lastIndexOf(char, lastIdx);
|
@@ -49219,7 +49377,7 @@ var require_parse3 = __commonJS({
|
|
49219
49377
|
var require_picomatch = __commonJS({
|
49220
49378
|
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js"(exports, module2) {
|
49221
49379
|
"use strict";
|
49222
|
-
var
|
49380
|
+
var path4 = require("path");
|
49223
49381
|
var scan = require_scan();
|
49224
49382
|
var parse = require_parse3();
|
49225
49383
|
var utils = require_utils5();
|
@@ -49305,12 +49463,12 @@ var require_picomatch = __commonJS({
|
|
49305
49463
|
};
|
49306
49464
|
picomatch.matchBase = (input, glob2, options, posix = utils.isWindows(options)) => {
|
49307
49465
|
const regex = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options);
|
49308
|
-
return regex.test(
|
49466
|
+
return regex.test(path4.basename(input));
|
49309
49467
|
};
|
49310
49468
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
49311
49469
|
picomatch.parse = (pattern, options) => {
|
49312
49470
|
if (Array.isArray(pattern))
|
49313
|
-
return pattern.map((
|
49471
|
+
return pattern.map((p) => picomatch.parse(p, options));
|
49314
49472
|
return parse(pattern, { ...options, fastpaths: false });
|
49315
49473
|
};
|
49316
49474
|
picomatch.scan = (input, options) => scan(input, options);
|
@@ -49414,7 +49572,7 @@ var require_micromatch = __commonJS({
|
|
49414
49572
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
49415
49573
|
}
|
49416
49574
|
if (options.nonull === true || options.nullglob === true) {
|
49417
|
-
return options.unescape ? patterns.map((
|
49575
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
49418
49576
|
}
|
49419
49577
|
}
|
49420
49578
|
return matches;
|
@@ -49445,7 +49603,7 @@ var require_micromatch = __commonJS({
|
|
49445
49603
|
throw new TypeError(`Expected a string: "${util2.inspect(str)}"`);
|
49446
49604
|
}
|
49447
49605
|
if (Array.isArray(pattern)) {
|
49448
|
-
return pattern.some((
|
49606
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
49449
49607
|
}
|
49450
49608
|
if (typeof pattern === "string") {
|
49451
49609
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
@@ -49491,7 +49649,7 @@ var require_micromatch = __commonJS({
|
|
49491
49649
|
if (typeof str !== "string") {
|
49492
49650
|
throw new TypeError(`Expected a string: "${util2.inspect(str)}"`);
|
49493
49651
|
}
|
49494
|
-
return [].concat(patterns).every((
|
49652
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
49495
49653
|
};
|
49496
49654
|
micromatch.capture = (glob2, input, options) => {
|
49497
49655
|
let posix = utils.isWindows(options);
|
@@ -49535,7 +49693,7 @@ var require_pattern = __commonJS({
|
|
49535
49693
|
"use strict";
|
49536
49694
|
Object.defineProperty(exports, "__esModule", { value: true });
|
49537
49695
|
exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
49538
|
-
var
|
49696
|
+
var path4 = require("path");
|
49539
49697
|
var globParent = require_glob_parent();
|
49540
49698
|
var micromatch = require_micromatch();
|
49541
49699
|
var GLOBSTAR2 = "**";
|
@@ -49630,7 +49788,7 @@ var require_pattern = __commonJS({
|
|
49630
49788
|
}
|
49631
49789
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
49632
49790
|
function isAffectDepthOfReadingPattern(pattern) {
|
49633
|
-
const basename =
|
49791
|
+
const basename = path4.basename(pattern);
|
49634
49792
|
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
49635
49793
|
}
|
49636
49794
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
@@ -49729,8 +49887,8 @@ var require_utils6 = __commonJS({
|
|
49729
49887
|
exports.errno = errno;
|
49730
49888
|
var fs8 = require_fs();
|
49731
49889
|
exports.fs = fs8;
|
49732
|
-
var
|
49733
|
-
exports.path =
|
49890
|
+
var path4 = require_path();
|
49891
|
+
exports.path = path4;
|
49734
49892
|
var pattern = require_pattern();
|
49735
49893
|
exports.pattern = pattern;
|
49736
49894
|
var stream = require_stream2();
|
@@ -49842,8 +50000,8 @@ var require_async = __commonJS({
|
|
49842
50000
|
"use strict";
|
49843
50001
|
Object.defineProperty(exports, "__esModule", { value: true });
|
49844
50002
|
exports.read = void 0;
|
49845
|
-
function read(
|
49846
|
-
settings.fs.lstat(
|
50003
|
+
function read(path4, settings, callback) {
|
50004
|
+
settings.fs.lstat(path4, (lstatError, lstat) => {
|
49847
50005
|
if (lstatError !== null) {
|
49848
50006
|
callFailureCallback(callback, lstatError);
|
49849
50007
|
return;
|
@@ -49852,7 +50010,7 @@ var require_async = __commonJS({
|
|
49852
50010
|
callSuccessCallback(callback, lstat);
|
49853
50011
|
return;
|
49854
50012
|
}
|
49855
|
-
settings.fs.stat(
|
50013
|
+
settings.fs.stat(path4, (statError, stat) => {
|
49856
50014
|
if (statError !== null) {
|
49857
50015
|
if (settings.throwErrorOnBrokenSymbolicLink) {
|
49858
50016
|
callFailureCallback(callback, statError);
|
@@ -49884,13 +50042,13 @@ var require_sync = __commonJS({
|
|
49884
50042
|
"use strict";
|
49885
50043
|
Object.defineProperty(exports, "__esModule", { value: true });
|
49886
50044
|
exports.read = void 0;
|
49887
|
-
function read(
|
49888
|
-
const lstat = settings.fs.lstatSync(
|
50045
|
+
function read(path4, settings) {
|
50046
|
+
const lstat = settings.fs.lstatSync(path4);
|
49889
50047
|
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
49890
50048
|
return lstat;
|
49891
50049
|
}
|
49892
50050
|
try {
|
49893
|
-
const stat = settings.fs.statSync(
|
50051
|
+
const stat = settings.fs.statSync(path4);
|
49894
50052
|
if (settings.markSymbolicLink) {
|
49895
50053
|
stat.isSymbolicLink = () => true;
|
49896
50054
|
}
|
@@ -49961,17 +50119,17 @@ var require_out = __commonJS({
|
|
49961
50119
|
var sync2 = require_sync();
|
49962
50120
|
var settings_1 = require_settings();
|
49963
50121
|
exports.Settings = settings_1.default;
|
49964
|
-
function stat(
|
50122
|
+
function stat(path4, optionsOrSettingsOrCallback, callback) {
|
49965
50123
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
49966
|
-
async.read(
|
50124
|
+
async.read(path4, getSettings(), optionsOrSettingsOrCallback);
|
49967
50125
|
return;
|
49968
50126
|
}
|
49969
|
-
async.read(
|
50127
|
+
async.read(path4, getSettings(optionsOrSettingsOrCallback), callback);
|
49970
50128
|
}
|
49971
50129
|
exports.stat = stat;
|
49972
|
-
function statSync(
|
50130
|
+
function statSync(path4, optionsOrSettings) {
|
49973
50131
|
const settings = getSettings(optionsOrSettings);
|
49974
|
-
return sync2.read(
|
50132
|
+
return sync2.read(path4, settings);
|
49975
50133
|
}
|
49976
50134
|
exports.statSync = statSync;
|
49977
50135
|
function getSettings(settingsOrOptions = {}) {
|
@@ -50190,16 +50348,16 @@ var require_async2 = __commonJS({
|
|
50190
50348
|
return;
|
50191
50349
|
}
|
50192
50350
|
const tasks = names.map((name) => {
|
50193
|
-
const
|
50351
|
+
const path4 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
50194
50352
|
return (done) => {
|
50195
|
-
fsStat.stat(
|
50353
|
+
fsStat.stat(path4, settings.fsStatSettings, (error2, stats) => {
|
50196
50354
|
if (error2 !== null) {
|
50197
50355
|
done(error2);
|
50198
50356
|
return;
|
50199
50357
|
}
|
50200
50358
|
const entry = {
|
50201
50359
|
name,
|
50202
|
-
path:
|
50360
|
+
path: path4,
|
50203
50361
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
50204
50362
|
};
|
50205
50363
|
if (settings.stats) {
|
@@ -50317,7 +50475,7 @@ var require_settings2 = __commonJS({
|
|
50317
50475
|
"node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js"(exports) {
|
50318
50476
|
"use strict";
|
50319
50477
|
Object.defineProperty(exports, "__esModule", { value: true });
|
50320
|
-
var
|
50478
|
+
var path4 = require("path");
|
50321
50479
|
var fsStat = require_out();
|
50322
50480
|
var fs8 = require_fs4();
|
50323
50481
|
var Settings = class {
|
@@ -50325,7 +50483,7 @@ var require_settings2 = __commonJS({
|
|
50325
50483
|
this._options = _options;
|
50326
50484
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
50327
50485
|
this.fs = fs8.createFileSystemAdapter(this._options.fs);
|
50328
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
50486
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path4.sep);
|
50329
50487
|
this.stats = this._getValue(this._options.stats, false);
|
50330
50488
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
50331
50489
|
this.fsStatSettings = new fsStat.Settings({
|
@@ -50352,17 +50510,17 @@ var require_out2 = __commonJS({
|
|
50352
50510
|
var sync2 = require_sync2();
|
50353
50511
|
var settings_1 = require_settings2();
|
50354
50512
|
exports.Settings = settings_1.default;
|
50355
|
-
function scandir(
|
50513
|
+
function scandir(path4, optionsOrSettingsOrCallback, callback) {
|
50356
50514
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
50357
|
-
async.read(
|
50515
|
+
async.read(path4, getSettings(), optionsOrSettingsOrCallback);
|
50358
50516
|
return;
|
50359
50517
|
}
|
50360
|
-
async.read(
|
50518
|
+
async.read(path4, getSettings(optionsOrSettingsOrCallback), callback);
|
50361
50519
|
}
|
50362
50520
|
exports.scandir = scandir;
|
50363
|
-
function scandirSync(
|
50521
|
+
function scandirSync(path4, optionsOrSettings) {
|
50364
50522
|
const settings = getSettings(optionsOrSettings);
|
50365
|
-
return sync2.read(
|
50523
|
+
return sync2.read(path4, settings);
|
50366
50524
|
}
|
50367
50525
|
exports.scandirSync = scandirSync;
|
50368
50526
|
function getSettings(settingsOrOptions = {}) {
|
@@ -50600,7 +50758,7 @@ var require_queue = __commonJS({
|
|
50600
50758
|
queue.drained = drained;
|
50601
50759
|
return queue;
|
50602
50760
|
function push(value) {
|
50603
|
-
var
|
50761
|
+
var p = new Promise(function(resolve2, reject) {
|
50604
50762
|
pushCb(value, function(err2, result) {
|
50605
50763
|
if (err2) {
|
50606
50764
|
reject(err2);
|
@@ -50609,11 +50767,11 @@ var require_queue = __commonJS({
|
|
50609
50767
|
resolve2(result);
|
50610
50768
|
});
|
50611
50769
|
});
|
50612
|
-
|
50613
|
-
return
|
50770
|
+
p.catch(noop2);
|
50771
|
+
return p;
|
50614
50772
|
}
|
50615
50773
|
function unshift(value) {
|
50616
|
-
var
|
50774
|
+
var p = new Promise(function(resolve2, reject) {
|
50617
50775
|
unshiftCb(value, function(err2, result) {
|
50618
50776
|
if (err2) {
|
50619
50777
|
reject(err2);
|
@@ -50622,8 +50780,8 @@ var require_queue = __commonJS({
|
|
50622
50780
|
resolve2(result);
|
50623
50781
|
});
|
50624
50782
|
});
|
50625
|
-
|
50626
|
-
return
|
50783
|
+
p.catch(noop2);
|
50784
|
+
return p;
|
50627
50785
|
}
|
50628
50786
|
function drained() {
|
50629
50787
|
if (queue.idle()) {
|
@@ -50632,13 +50790,13 @@ var require_queue = __commonJS({
|
|
50632
50790
|
});
|
50633
50791
|
}
|
50634
50792
|
var previousDrain = queue.drain;
|
50635
|
-
var
|
50793
|
+
var p = new Promise(function(resolve2) {
|
50636
50794
|
queue.drain = function() {
|
50637
50795
|
previousDrain();
|
50638
50796
|
resolve2();
|
50639
50797
|
};
|
50640
50798
|
});
|
50641
|
-
return
|
50799
|
+
return p;
|
50642
50800
|
}
|
50643
50801
|
}
|
50644
50802
|
module2.exports = fastqueue;
|
@@ -50966,7 +51124,7 @@ var require_settings3 = __commonJS({
|
|
50966
51124
|
"node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js"(exports) {
|
50967
51125
|
"use strict";
|
50968
51126
|
Object.defineProperty(exports, "__esModule", { value: true });
|
50969
|
-
var
|
51127
|
+
var path4 = require("path");
|
50970
51128
|
var fsScandir = require_out2();
|
50971
51129
|
var Settings = class {
|
50972
51130
|
constructor(_options = {}) {
|
@@ -50976,7 +51134,7 @@ var require_settings3 = __commonJS({
|
|
50976
51134
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
50977
51135
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
50978
51136
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
50979
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
51137
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path4.sep);
|
50980
51138
|
this.fsScandirSettings = new fsScandir.Settings({
|
50981
51139
|
followSymbolicLinks: this._options.followSymbolicLinks,
|
50982
51140
|
fs: this._options.fs,
|
@@ -51038,7 +51196,7 @@ var require_reader2 = __commonJS({
|
|
51038
51196
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/readers/reader.js"(exports) {
|
51039
51197
|
"use strict";
|
51040
51198
|
Object.defineProperty(exports, "__esModule", { value: true });
|
51041
|
-
var
|
51199
|
+
var path4 = require("path");
|
51042
51200
|
var fsStat = require_out();
|
51043
51201
|
var utils = require_utils6();
|
51044
51202
|
var Reader = class {
|
@@ -51051,7 +51209,7 @@ var require_reader2 = __commonJS({
|
|
51051
51209
|
});
|
51052
51210
|
}
|
51053
51211
|
_getFullEntryPath(filepath) {
|
51054
|
-
return
|
51212
|
+
return path4.resolve(this._settings.cwd, filepath);
|
51055
51213
|
}
|
51056
51214
|
_makeEntry(stats, pattern) {
|
51057
51215
|
const entry = {
|
@@ -51445,7 +51603,7 @@ var require_provider = __commonJS({
|
|
51445
51603
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/provider.js"(exports) {
|
51446
51604
|
"use strict";
|
51447
51605
|
Object.defineProperty(exports, "__esModule", { value: true });
|
51448
|
-
var
|
51606
|
+
var path4 = require("path");
|
51449
51607
|
var deep_1 = require_deep();
|
51450
51608
|
var entry_1 = require_entry();
|
51451
51609
|
var error_1 = require_error();
|
@@ -51459,7 +51617,7 @@ var require_provider = __commonJS({
|
|
51459
51617
|
this.entryTransformer = new entry_2.default(this._settings);
|
51460
51618
|
}
|
51461
51619
|
_getRootDirectory(task) {
|
51462
|
-
return
|
51620
|
+
return path4.resolve(this._settings.cwd, task.base);
|
51463
51621
|
}
|
51464
51622
|
_getReaderOptions(task) {
|
51465
51623
|
const basePath = task.base === "." ? "" : task.base;
|
@@ -51641,8 +51799,8 @@ var require_settings4 = __commonJS({
|
|
51641
51799
|
Object.defineProperty(exports, "__esModule", { value: true });
|
51642
51800
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
51643
51801
|
var fs8 = require("fs");
|
51644
|
-
var
|
51645
|
-
var CPU_COUNT = Math.max(
|
51802
|
+
var os2 = require("os");
|
51803
|
+
var CPU_COUNT = Math.max(os2.cpus().length, 1);
|
51646
51804
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
51647
51805
|
lstat: fs8.lstat,
|
51648
51806
|
lstatSync: fs8.lstatSync,
|
@@ -51841,15 +51999,15 @@ var require_path_type = __commonJS({
|
|
51841
51999
|
var require_dir_glob = __commonJS({
|
51842
52000
|
"node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.js"(exports, module2) {
|
51843
52001
|
"use strict";
|
51844
|
-
var
|
52002
|
+
var path4 = require("path");
|
51845
52003
|
var pathType = require_path_type();
|
51846
52004
|
var getExtensions = (extensions) => extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0];
|
51847
52005
|
var getPath = (filepath, cwd) => {
|
51848
52006
|
const pth = filepath[0] === "!" ? filepath.slice(1) : filepath;
|
51849
|
-
return
|
52007
|
+
return path4.isAbsolute(pth) ? pth : path4.join(cwd, pth);
|
51850
52008
|
};
|
51851
52009
|
var addExtensions = (file, extensions) => {
|
51852
|
-
if (
|
52010
|
+
if (path4.extname(file)) {
|
51853
52011
|
return `**/${file}`;
|
51854
52012
|
}
|
51855
52013
|
return `**/${file}.${getExtensions(extensions)}`;
|
@@ -51862,15 +52020,15 @@ var require_dir_glob = __commonJS({
|
|
51862
52020
|
throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``);
|
51863
52021
|
}
|
51864
52022
|
if (options.files && options.extensions) {
|
51865
|
-
return options.files.map((x) =>
|
52023
|
+
return options.files.map((x) => path4.posix.join(directory, addExtensions(x, options.extensions)));
|
51866
52024
|
}
|
51867
52025
|
if (options.files) {
|
51868
|
-
return options.files.map((x) =>
|
52026
|
+
return options.files.map((x) => path4.posix.join(directory, `**/${x}`));
|
51869
52027
|
}
|
51870
52028
|
if (options.extensions) {
|
51871
|
-
return [
|
52029
|
+
return [path4.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)];
|
51872
52030
|
}
|
51873
|
-
return [
|
52031
|
+
return [path4.posix.join(directory, "**")];
|
51874
52032
|
};
|
51875
52033
|
module2.exports = async (input, options) => {
|
51876
52034
|
options = {
|
@@ -52116,17 +52274,17 @@ var require_ignore = __commonJS({
|
|
52116
52274
|
var throwError = (message, Ctor) => {
|
52117
52275
|
throw new Ctor(message);
|
52118
52276
|
};
|
52119
|
-
var checkPath = (
|
52120
|
-
if (!isString2(
|
52277
|
+
var checkPath = (path4, originalPath, doThrow) => {
|
52278
|
+
if (!isString2(path4)) {
|
52121
52279
|
return doThrow(
|
52122
52280
|
`path must be a string, but got \`${originalPath}\``,
|
52123
52281
|
TypeError
|
52124
52282
|
);
|
52125
52283
|
}
|
52126
|
-
if (!
|
52284
|
+
if (!path4) {
|
52127
52285
|
return doThrow(`path must not be empty`, TypeError);
|
52128
52286
|
}
|
52129
|
-
if (checkPath.isNotRelative(
|
52287
|
+
if (checkPath.isNotRelative(path4)) {
|
52130
52288
|
const r = "`path.relative()`d";
|
52131
52289
|
return doThrow(
|
52132
52290
|
`path should be a ${r} string, but got "${originalPath}"`,
|
@@ -52135,9 +52293,9 @@ var require_ignore = __commonJS({
|
|
52135
52293
|
}
|
52136
52294
|
return true;
|
52137
52295
|
};
|
52138
|
-
var isNotRelative = (
|
52296
|
+
var isNotRelative = (path4) => REGEX_TEST_INVALID_PATH.test(path4);
|
52139
52297
|
checkPath.isNotRelative = isNotRelative;
|
52140
|
-
checkPath.convert = (
|
52298
|
+
checkPath.convert = (p) => p;
|
52141
52299
|
var Ignore = class {
|
52142
52300
|
constructor({
|
52143
52301
|
ignorecase = true,
|
@@ -52194,7 +52352,7 @@ var require_ignore = __commonJS({
|
|
52194
52352
|
// setting `checkUnignored` to `false` could reduce additional
|
52195
52353
|
// path matching.
|
52196
52354
|
// @returns {TestResult} true if a file is ignored
|
52197
|
-
_testOne(
|
52355
|
+
_testOne(path4, checkUnignored) {
|
52198
52356
|
let ignored = false;
|
52199
52357
|
let unignored = false;
|
52200
52358
|
this._rules.forEach((rule) => {
|
@@ -52202,7 +52360,7 @@ var require_ignore = __commonJS({
|
|
52202
52360
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
52203
52361
|
return;
|
52204
52362
|
}
|
52205
|
-
const matched = rule.regex.test(
|
52363
|
+
const matched = rule.regex.test(path4);
|
52206
52364
|
if (matched) {
|
52207
52365
|
ignored = !negative;
|
52208
52366
|
unignored = negative;
|
@@ -52215,24 +52373,24 @@ var require_ignore = __commonJS({
|
|
52215
52373
|
}
|
52216
52374
|
// @returns {TestResult}
|
52217
52375
|
_test(originalPath, cache, checkUnignored, slices) {
|
52218
|
-
const
|
52376
|
+
const path4 = originalPath && checkPath.convert(originalPath);
|
52219
52377
|
checkPath(
|
52220
|
-
|
52378
|
+
path4,
|
52221
52379
|
originalPath,
|
52222
52380
|
this._allowRelativePaths ? RETURN_FALSE : throwError
|
52223
52381
|
);
|
52224
|
-
return this._t(
|
52382
|
+
return this._t(path4, cache, checkUnignored, slices);
|
52225
52383
|
}
|
52226
|
-
_t(
|
52227
|
-
if (
|
52228
|
-
return cache[
|
52384
|
+
_t(path4, cache, checkUnignored, slices) {
|
52385
|
+
if (path4 in cache) {
|
52386
|
+
return cache[path4];
|
52229
52387
|
}
|
52230
52388
|
if (!slices) {
|
52231
|
-
slices =
|
52389
|
+
slices = path4.split(SLASH);
|
52232
52390
|
}
|
52233
52391
|
slices.pop();
|
52234
52392
|
if (!slices.length) {
|
52235
|
-
return cache[
|
52393
|
+
return cache[path4] = this._testOne(path4, checkUnignored);
|
52236
52394
|
}
|
52237
52395
|
const parent = this._t(
|
52238
52396
|
slices.join(SLASH) + SLASH,
|
@@ -52240,24 +52398,24 @@ var require_ignore = __commonJS({
|
|
52240
52398
|
checkUnignored,
|
52241
52399
|
slices
|
52242
52400
|
);
|
52243
|
-
return cache[
|
52401
|
+
return cache[path4] = parent.ignored ? parent : this._testOne(path4, checkUnignored);
|
52244
52402
|
}
|
52245
|
-
ignores(
|
52246
|
-
return this._test(
|
52403
|
+
ignores(path4) {
|
52404
|
+
return this._test(path4, this._ignoreCache, false).ignored;
|
52247
52405
|
}
|
52248
52406
|
createFilter() {
|
52249
|
-
return (
|
52407
|
+
return (path4) => !this.ignores(path4);
|
52250
52408
|
}
|
52251
52409
|
filter(paths) {
|
52252
52410
|
return makeArray(paths).filter(this.createFilter());
|
52253
52411
|
}
|
52254
52412
|
// @returns {TestResult}
|
52255
|
-
test(
|
52256
|
-
return this._test(
|
52413
|
+
test(path4) {
|
52414
|
+
return this._test(path4, this._testCache, true);
|
52257
52415
|
}
|
52258
52416
|
};
|
52259
52417
|
var factory = (options) => new Ignore(options);
|
52260
|
-
var isPathValid = (
|
52418
|
+
var isPathValid = (path4) => checkPath(path4 && checkPath.convert(path4), path4, RETURN_FALSE);
|
52261
52419
|
factory.isPathValid = isPathValid;
|
52262
52420
|
factory.default = factory;
|
52263
52421
|
module2.exports = factory;
|
@@ -52268,19 +52426,19 @@ var require_ignore = __commonJS({
|
|
52268
52426
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
52269
52427
|
checkPath.convert = makePosix;
|
52270
52428
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
52271
|
-
checkPath.isNotRelative = (
|
52429
|
+
checkPath.isNotRelative = (path4) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path4) || isNotRelative(path4);
|
52272
52430
|
}
|
52273
52431
|
}
|
52274
52432
|
});
|
52275
52433
|
|
52276
52434
|
// node_modules/.pnpm/slash@4.0.0/node_modules/slash/index.js
|
52277
|
-
function slash(
|
52278
|
-
const isExtendedLengthPath = /^\\\\\?\\/.test(
|
52279
|
-
const hasNonAscii = /[^\u0000-\u0080]+/.test(
|
52435
|
+
function slash(path4) {
|
52436
|
+
const isExtendedLengthPath = /^\\\\\?\\/.test(path4);
|
52437
|
+
const hasNonAscii = /[^\u0000-\u0080]+/.test(path4);
|
52280
52438
|
if (isExtendedLengthPath || hasNonAscii) {
|
52281
|
-
return
|
52439
|
+
return path4;
|
52282
52440
|
}
|
52283
|
-
return
|
52441
|
+
return path4.replace(/\\/g, "/");
|
52284
52442
|
}
|
52285
52443
|
var init_slash = __esm({
|
52286
52444
|
"node_modules/.pnpm/slash@4.0.0/node_modules/slash/index.js"() {
|
@@ -52466,9 +52624,9 @@ var init_globby = __esm({
|
|
52466
52624
|
createFilterFunction = (isIgnored) => {
|
52467
52625
|
const seen = /* @__PURE__ */ new Set();
|
52468
52626
|
return (fastGlobResult) => {
|
52469
|
-
const
|
52470
|
-
const pathKey = import_node_path2.default.normalize(
|
52471
|
-
const seenOrIgnored = seen.has(pathKey) || isIgnored && isIgnored(
|
52627
|
+
const path4 = fastGlobResult.path || fastGlobResult;
|
52628
|
+
const pathKey = import_node_path2.default.normalize(path4);
|
52629
|
+
const seenOrIgnored = seen.has(pathKey) || isIgnored && isIgnored(path4);
|
52472
52630
|
seen.add(pathKey);
|
52473
52631
|
return !seenOrIgnored;
|
52474
52632
|
};
|
@@ -52874,17 +53032,17 @@ var require_visit = __commonJS({
|
|
52874
53032
|
visit.BREAK = BREAK;
|
52875
53033
|
visit.SKIP = SKIP;
|
52876
53034
|
visit.REMOVE = REMOVE;
|
52877
|
-
function visit_(key, node, visitor,
|
52878
|
-
const ctrl = callVisitor(key, node, visitor,
|
53035
|
+
function visit_(key, node, visitor, path4) {
|
53036
|
+
const ctrl = callVisitor(key, node, visitor, path4);
|
52879
53037
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
52880
|
-
replaceNode(key,
|
52881
|
-
return visit_(key, ctrl, visitor,
|
53038
|
+
replaceNode(key, path4, ctrl);
|
53039
|
+
return visit_(key, ctrl, visitor, path4);
|
52882
53040
|
}
|
52883
53041
|
if (typeof ctrl !== "symbol") {
|
52884
53042
|
if (identity.isCollection(node)) {
|
52885
|
-
|
53043
|
+
path4 = Object.freeze(path4.concat(node));
|
52886
53044
|
for (let i = 0; i < node.items.length; ++i) {
|
52887
|
-
const ci = visit_(i, node.items[i], visitor,
|
53045
|
+
const ci = visit_(i, node.items[i], visitor, path4);
|
52888
53046
|
if (typeof ci === "number")
|
52889
53047
|
i = ci - 1;
|
52890
53048
|
else if (ci === BREAK)
|
@@ -52895,13 +53053,13 @@ var require_visit = __commonJS({
|
|
52895
53053
|
}
|
52896
53054
|
}
|
52897
53055
|
} else if (identity.isPair(node)) {
|
52898
|
-
|
52899
|
-
const ck = visit_("key", node.key, visitor,
|
53056
|
+
path4 = Object.freeze(path4.concat(node));
|
53057
|
+
const ck = visit_("key", node.key, visitor, path4);
|
52900
53058
|
if (ck === BREAK)
|
52901
53059
|
return BREAK;
|
52902
53060
|
else if (ck === REMOVE)
|
52903
53061
|
node.key = null;
|
52904
|
-
const cv = visit_("value", node.value, visitor,
|
53062
|
+
const cv = visit_("value", node.value, visitor, path4);
|
52905
53063
|
if (cv === BREAK)
|
52906
53064
|
return BREAK;
|
52907
53065
|
else if (cv === REMOVE)
|
@@ -52922,17 +53080,17 @@ var require_visit = __commonJS({
|
|
52922
53080
|
visitAsync.BREAK = BREAK;
|
52923
53081
|
visitAsync.SKIP = SKIP;
|
52924
53082
|
visitAsync.REMOVE = REMOVE;
|
52925
|
-
async function visitAsync_(key, node, visitor,
|
52926
|
-
const ctrl = await callVisitor(key, node, visitor,
|
53083
|
+
async function visitAsync_(key, node, visitor, path4) {
|
53084
|
+
const ctrl = await callVisitor(key, node, visitor, path4);
|
52927
53085
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
52928
|
-
replaceNode(key,
|
52929
|
-
return visitAsync_(key, ctrl, visitor,
|
53086
|
+
replaceNode(key, path4, ctrl);
|
53087
|
+
return visitAsync_(key, ctrl, visitor, path4);
|
52930
53088
|
}
|
52931
53089
|
if (typeof ctrl !== "symbol") {
|
52932
53090
|
if (identity.isCollection(node)) {
|
52933
|
-
|
53091
|
+
path4 = Object.freeze(path4.concat(node));
|
52934
53092
|
for (let i = 0; i < node.items.length; ++i) {
|
52935
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
53093
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path4);
|
52936
53094
|
if (typeof ci === "number")
|
52937
53095
|
i = ci - 1;
|
52938
53096
|
else if (ci === BREAK)
|
@@ -52943,13 +53101,13 @@ var require_visit = __commonJS({
|
|
52943
53101
|
}
|
52944
53102
|
}
|
52945
53103
|
} else if (identity.isPair(node)) {
|
52946
|
-
|
52947
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
53104
|
+
path4 = Object.freeze(path4.concat(node));
|
53105
|
+
const ck = await visitAsync_("key", node.key, visitor, path4);
|
52948
53106
|
if (ck === BREAK)
|
52949
53107
|
return BREAK;
|
52950
53108
|
else if (ck === REMOVE)
|
52951
53109
|
node.key = null;
|
52952
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
53110
|
+
const cv = await visitAsync_("value", node.value, visitor, path4);
|
52953
53111
|
if (cv === BREAK)
|
52954
53112
|
return BREAK;
|
52955
53113
|
else if (cv === REMOVE)
|
@@ -52976,24 +53134,24 @@ var require_visit = __commonJS({
|
|
52976
53134
|
}
|
52977
53135
|
return visitor;
|
52978
53136
|
}
|
52979
|
-
function callVisitor(key, node, visitor,
|
53137
|
+
function callVisitor(key, node, visitor, path4) {
|
52980
53138
|
var _a3, _b, _c, _d, _e;
|
52981
53139
|
if (typeof visitor === "function")
|
52982
|
-
return visitor(key, node,
|
53140
|
+
return visitor(key, node, path4);
|
52983
53141
|
if (identity.isMap(node))
|
52984
|
-
return (_a3 = visitor.Map) == null ? void 0 : _a3.call(visitor, key, node,
|
53142
|
+
return (_a3 = visitor.Map) == null ? void 0 : _a3.call(visitor, key, node, path4);
|
52985
53143
|
if (identity.isSeq(node))
|
52986
|
-
return (_b = visitor.Seq) == null ? void 0 : _b.call(visitor, key, node,
|
53144
|
+
return (_b = visitor.Seq) == null ? void 0 : _b.call(visitor, key, node, path4);
|
52987
53145
|
if (identity.isPair(node))
|
52988
|
-
return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node,
|
53146
|
+
return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node, path4);
|
52989
53147
|
if (identity.isScalar(node))
|
52990
|
-
return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node,
|
53148
|
+
return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node, path4);
|
52991
53149
|
if (identity.isAlias(node))
|
52992
|
-
return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node,
|
53150
|
+
return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node, path4);
|
52993
53151
|
return void 0;
|
52994
53152
|
}
|
52995
|
-
function replaceNode(key,
|
52996
|
-
const parent =
|
53153
|
+
function replaceNode(key, path4, node) {
|
53154
|
+
const parent = path4[path4.length - 1];
|
52997
53155
|
if (identity.isCollection(parent)) {
|
52998
53156
|
parent.items[key] = node;
|
52999
53157
|
} else if (identity.isPair(parent)) {
|
@@ -53589,10 +53747,10 @@ var require_Collection = __commonJS({
|
|
53589
53747
|
var createNode = require_createNode();
|
53590
53748
|
var identity = require_identity();
|
53591
53749
|
var Node = require_Node();
|
53592
|
-
function collectionFromPath(schema4,
|
53750
|
+
function collectionFromPath(schema4, path4, value) {
|
53593
53751
|
let v = value;
|
53594
|
-
for (let i =
|
53595
|
-
const k =
|
53752
|
+
for (let i = path4.length - 1; i >= 0; --i) {
|
53753
|
+
const k = path4[i];
|
53596
53754
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
53597
53755
|
const a = [];
|
53598
53756
|
a[k] = v;
|
@@ -53611,7 +53769,7 @@ var require_Collection = __commonJS({
|
|
53611
53769
|
sourceObjects: /* @__PURE__ */ new Map()
|
53612
53770
|
});
|
53613
53771
|
}
|
53614
|
-
var isEmptyPath = (
|
53772
|
+
var isEmptyPath = (path4) => path4 == null || typeof path4 === "object" && !!path4[Symbol.iterator]().next().done;
|
53615
53773
|
var Collection = class extends Node.NodeBase {
|
53616
53774
|
constructor(type, schema4) {
|
53617
53775
|
super(type);
|
@@ -53641,11 +53799,11 @@ var require_Collection = __commonJS({
|
|
53641
53799
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
53642
53800
|
* that already exists in the map.
|
53643
53801
|
*/
|
53644
|
-
addIn(
|
53645
|
-
if (isEmptyPath(
|
53802
|
+
addIn(path4, value) {
|
53803
|
+
if (isEmptyPath(path4))
|
53646
53804
|
this.add(value);
|
53647
53805
|
else {
|
53648
|
-
const [key, ...rest] =
|
53806
|
+
const [key, ...rest] = path4;
|
53649
53807
|
const node = this.get(key, true);
|
53650
53808
|
if (identity.isCollection(node))
|
53651
53809
|
node.addIn(rest, value);
|
@@ -53659,8 +53817,8 @@ var require_Collection = __commonJS({
|
|
53659
53817
|
* Removes a value from the collection.
|
53660
53818
|
* @returns `true` if the item was found and removed.
|
53661
53819
|
*/
|
53662
|
-
deleteIn(
|
53663
|
-
const [key, ...rest] =
|
53820
|
+
deleteIn(path4) {
|
53821
|
+
const [key, ...rest] = path4;
|
53664
53822
|
if (rest.length === 0)
|
53665
53823
|
return this.delete(key);
|
53666
53824
|
const node = this.get(key, true);
|
@@ -53674,8 +53832,8 @@ var require_Collection = __commonJS({
|
|
53674
53832
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
53675
53833
|
* `true` (collections are always returned intact).
|
53676
53834
|
*/
|
53677
|
-
getIn(
|
53678
|
-
const [key, ...rest] =
|
53835
|
+
getIn(path4, keepScalar) {
|
53836
|
+
const [key, ...rest] = path4;
|
53679
53837
|
const node = this.get(key, true);
|
53680
53838
|
if (rest.length === 0)
|
53681
53839
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
@@ -53693,8 +53851,8 @@ var require_Collection = __commonJS({
|
|
53693
53851
|
/**
|
53694
53852
|
* Checks if the collection includes a value with the key `key`.
|
53695
53853
|
*/
|
53696
|
-
hasIn(
|
53697
|
-
const [key, ...rest] =
|
53854
|
+
hasIn(path4) {
|
53855
|
+
const [key, ...rest] = path4;
|
53698
53856
|
if (rest.length === 0)
|
53699
53857
|
return this.has(key);
|
53700
53858
|
const node = this.get(key, true);
|
@@ -53704,8 +53862,8 @@ var require_Collection = __commonJS({
|
|
53704
53862
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
53705
53863
|
* boolean to add/remove the item from the set.
|
53706
53864
|
*/
|
53707
|
-
setIn(
|
53708
|
-
const [key, ...rest] =
|
53865
|
+
setIn(path4, value) {
|
53866
|
+
const [key, ...rest] = path4;
|
53709
53867
|
if (rest.length === 0) {
|
53710
53868
|
this.set(key, value);
|
53711
53869
|
} else {
|
@@ -55767,7 +55925,7 @@ var require_timestamp = __commonJS({
|
|
55767
55925
|
const sign = str[0];
|
55768
55926
|
const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
|
55769
55927
|
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
55770
|
-
const res = parts.replace(/_/g, "").split(":").reduce((res2,
|
55928
|
+
const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
|
55771
55929
|
return sign === "-" ? num(-1) * res : res;
|
55772
55930
|
}
|
55773
55931
|
function stringifySexagesimal(node) {
|
@@ -56162,9 +56320,9 @@ var require_Document = __commonJS({
|
|
56162
56320
|
this.contents.add(value);
|
56163
56321
|
}
|
56164
56322
|
/** Adds a value to the document. */
|
56165
|
-
addIn(
|
56323
|
+
addIn(path4, value) {
|
56166
56324
|
if (assertCollection(this.contents))
|
56167
|
-
this.contents.addIn(
|
56325
|
+
this.contents.addIn(path4, value);
|
56168
56326
|
}
|
56169
56327
|
/**
|
56170
56328
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
@@ -56239,14 +56397,14 @@ var require_Document = __commonJS({
|
|
56239
56397
|
* Removes a value from the document.
|
56240
56398
|
* @returns `true` if the item was found and removed.
|
56241
56399
|
*/
|
56242
|
-
deleteIn(
|
56243
|
-
if (Collection.isEmptyPath(
|
56400
|
+
deleteIn(path4) {
|
56401
|
+
if (Collection.isEmptyPath(path4)) {
|
56244
56402
|
if (this.contents == null)
|
56245
56403
|
return false;
|
56246
56404
|
this.contents = null;
|
56247
56405
|
return true;
|
56248
56406
|
}
|
56249
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
56407
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path4) : false;
|
56250
56408
|
}
|
56251
56409
|
/**
|
56252
56410
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
@@ -56261,10 +56419,10 @@ var require_Document = __commonJS({
|
|
56261
56419
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
56262
56420
|
* `true` (collections are always returned intact).
|
56263
56421
|
*/
|
56264
|
-
getIn(
|
56265
|
-
if (Collection.isEmptyPath(
|
56422
|
+
getIn(path4, keepScalar) {
|
56423
|
+
if (Collection.isEmptyPath(path4))
|
56266
56424
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
56267
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
56425
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path4, keepScalar) : void 0;
|
56268
56426
|
}
|
56269
56427
|
/**
|
56270
56428
|
* Checks if the document includes a value with the key `key`.
|
@@ -56275,10 +56433,10 @@ var require_Document = __commonJS({
|
|
56275
56433
|
/**
|
56276
56434
|
* Checks if the document includes a value at `path`.
|
56277
56435
|
*/
|
56278
|
-
hasIn(
|
56279
|
-
if (Collection.isEmptyPath(
|
56436
|
+
hasIn(path4) {
|
56437
|
+
if (Collection.isEmptyPath(path4))
|
56280
56438
|
return this.contents !== void 0;
|
56281
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
56439
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path4) : false;
|
56282
56440
|
}
|
56283
56441
|
/**
|
56284
56442
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
@@ -56295,13 +56453,13 @@ var require_Document = __commonJS({
|
|
56295
56453
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
56296
56454
|
* boolean to add/remove the item from the set.
|
56297
56455
|
*/
|
56298
|
-
setIn(
|
56299
|
-
if (Collection.isEmptyPath(
|
56456
|
+
setIn(path4, value) {
|
56457
|
+
if (Collection.isEmptyPath(path4)) {
|
56300
56458
|
this.contents = value;
|
56301
56459
|
} else if (this.contents == null) {
|
56302
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
56460
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path4), value);
|
56303
56461
|
} else if (assertCollection(this.contents)) {
|
56304
|
-
this.contents.setIn(
|
56462
|
+
this.contents.setIn(path4, value);
|
56305
56463
|
}
|
56306
56464
|
}
|
56307
56465
|
/**
|
@@ -58193,9 +58351,9 @@ var require_cst_visit = __commonJS({
|
|
58193
58351
|
visit.BREAK = BREAK;
|
58194
58352
|
visit.SKIP = SKIP;
|
58195
58353
|
visit.REMOVE = REMOVE;
|
58196
|
-
visit.itemAtPath = (cst,
|
58354
|
+
visit.itemAtPath = (cst, path4) => {
|
58197
58355
|
let item = cst;
|
58198
|
-
for (const [field, index4] of
|
58356
|
+
for (const [field, index4] of path4) {
|
58199
58357
|
const tok = item == null ? void 0 : item[field];
|
58200
58358
|
if (tok && "items" in tok) {
|
58201
58359
|
item = tok.items[index4];
|
@@ -58204,23 +58362,23 @@ var require_cst_visit = __commonJS({
|
|
58204
58362
|
}
|
58205
58363
|
return item;
|
58206
58364
|
};
|
58207
|
-
visit.parentCollection = (cst,
|
58208
|
-
const parent = visit.itemAtPath(cst,
|
58209
|
-
const field =
|
58365
|
+
visit.parentCollection = (cst, path4) => {
|
58366
|
+
const parent = visit.itemAtPath(cst, path4.slice(0, -1));
|
58367
|
+
const field = path4[path4.length - 1][0];
|
58210
58368
|
const coll = parent == null ? void 0 : parent[field];
|
58211
58369
|
if (coll && "items" in coll)
|
58212
58370
|
return coll;
|
58213
58371
|
throw new Error("Parent collection not found");
|
58214
58372
|
};
|
58215
|
-
function _visit(
|
58216
|
-
let ctrl = visitor(item,
|
58373
|
+
function _visit(path4, item, visitor) {
|
58374
|
+
let ctrl = visitor(item, path4);
|
58217
58375
|
if (typeof ctrl === "symbol")
|
58218
58376
|
return ctrl;
|
58219
58377
|
for (const field of ["key", "value"]) {
|
58220
58378
|
const token = item[field];
|
58221
58379
|
if (token && "items" in token) {
|
58222
58380
|
for (let i = 0; i < token.items.length; ++i) {
|
58223
|
-
const ci = _visit(Object.freeze(
|
58381
|
+
const ci = _visit(Object.freeze(path4.concat([[field, i]])), token.items[i], visitor);
|
58224
58382
|
if (typeof ci === "number")
|
58225
58383
|
i = ci - 1;
|
58226
58384
|
else if (ci === BREAK)
|
@@ -58231,10 +58389,10 @@ var require_cst_visit = __commonJS({
|
|
58231
58389
|
}
|
58232
58390
|
}
|
58233
58391
|
if (typeof ctrl === "function" && field === "key")
|
58234
|
-
ctrl = ctrl(item,
|
58392
|
+
ctrl = ctrl(item, path4);
|
58235
58393
|
}
|
58236
58394
|
}
|
58237
|
-
return typeof ctrl === "function" ? ctrl(item,
|
58395
|
+
return typeof ctrl === "function" ? ctrl(item, path4) : ctrl;
|
58238
58396
|
}
|
58239
58397
|
exports.visit = visit;
|
58240
58398
|
}
|
@@ -60021,19 +60179,19 @@ __export(studioUtils_exports, {
|
|
60021
60179
|
preparePgSchema: () => preparePgSchema,
|
60022
60180
|
prepareSQLiteSchema: () => prepareSQLiteSchema
|
60023
60181
|
});
|
60024
|
-
var import_drizzle_orm15, import_mysql_core4,
|
60182
|
+
var import_drizzle_orm15, import_mysql_core4, import_pg_core4, import_sqlite_core5, preparePgSchema, prepareMySqlSchema, prepareSQLiteSchema, prepareModels, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleDb;
|
60025
60183
|
var init_studioUtils = __esm({
|
60026
60184
|
"src/serializer/studioUtils.ts"() {
|
60027
60185
|
import_drizzle_orm15 = require("drizzle-orm");
|
60028
60186
|
import_mysql_core4 = require("drizzle-orm/mysql-core");
|
60029
|
-
|
60030
|
-
|
60187
|
+
import_pg_core4 = require("drizzle-orm/pg-core");
|
60188
|
+
import_sqlite_core5 = require("drizzle-orm/sqlite-core");
|
60031
60189
|
init_utils();
|
60032
60190
|
init_utils3();
|
60033
60191
|
init_global();
|
60034
60192
|
init_serializer();
|
60035
|
-
preparePgSchema = async (
|
60036
|
-
const imports = prepareFilenames(
|
60193
|
+
preparePgSchema = async (path4) => {
|
60194
|
+
const imports = prepareFilenames(path4);
|
60037
60195
|
const pgSchema4 = {};
|
60038
60196
|
const relations4 = {};
|
60039
60197
|
const { unregister } = await safeRegister();
|
@@ -60042,8 +60200,8 @@ var init_studioUtils = __esm({
|
|
60042
60200
|
const i0 = require(`${it}`);
|
60043
60201
|
const i0values = Object.entries(i0);
|
60044
60202
|
i0values.forEach(([k, t]) => {
|
60045
|
-
if ((0, import_drizzle_orm15.is)(t,
|
60046
|
-
const schema4 = (0,
|
60203
|
+
if ((0, import_drizzle_orm15.is)(t, import_pg_core4.PgTable)) {
|
60204
|
+
const schema4 = (0, import_pg_core4.getTableConfig)(t).schema || "public";
|
60047
60205
|
pgSchema4[schema4] = pgSchema4[schema4] || {};
|
60048
60206
|
pgSchema4[schema4][k] = t;
|
60049
60207
|
}
|
@@ -60055,8 +60213,8 @@ var init_studioUtils = __esm({
|
|
60055
60213
|
unregister();
|
60056
60214
|
return { schema: pgSchema4, relations: relations4 };
|
60057
60215
|
};
|
60058
|
-
prepareMySqlSchema = async (
|
60059
|
-
const imports = prepareFilenames(
|
60216
|
+
prepareMySqlSchema = async (path4) => {
|
60217
|
+
const imports = prepareFilenames(path4);
|
60060
60218
|
const mysqlSchema4 = {
|
60061
60219
|
public: {}
|
60062
60220
|
};
|
@@ -60079,8 +60237,8 @@ var init_studioUtils = __esm({
|
|
60079
60237
|
unregister();
|
60080
60238
|
return { schema: mysqlSchema4, relations: relations4 };
|
60081
60239
|
};
|
60082
|
-
prepareSQLiteSchema = async (
|
60083
|
-
const imports = prepareFilenames(
|
60240
|
+
prepareSQLiteSchema = async (path4) => {
|
60241
|
+
const imports = prepareFilenames(path4);
|
60084
60242
|
const sqliteSchema2 = {
|
60085
60243
|
public: {}
|
60086
60244
|
};
|
@@ -60091,7 +60249,7 @@ var init_studioUtils = __esm({
|
|
60091
60249
|
const i0 = require(`${it}`);
|
60092
60250
|
const i0values = Object.entries(i0);
|
60093
60251
|
i0values.forEach(([k, t]) => {
|
60094
|
-
if ((0, import_drizzle_orm15.is)(t,
|
60252
|
+
if ((0, import_drizzle_orm15.is)(t, import_sqlite_core5.SQLiteTable)) {
|
60095
60253
|
const schema4 = "public";
|
60096
60254
|
sqliteSchema2[schema4][k] = t;
|
60097
60255
|
}
|
@@ -60103,8 +60261,8 @@ var init_studioUtils = __esm({
|
|
60103
60261
|
unregister();
|
60104
60262
|
return { schema: sqliteSchema2, relations: relations4 };
|
60105
60263
|
};
|
60106
|
-
prepareModels = async (
|
60107
|
-
const imports = prepareFilenames(
|
60264
|
+
prepareModels = async (path4) => {
|
60265
|
+
const imports = prepareFilenames(path4);
|
60108
60266
|
const sqliteSchema2 = {};
|
60109
60267
|
const pgSchema4 = {};
|
60110
60268
|
const mysqlSchema4 = {};
|
@@ -60114,13 +60272,13 @@ var init_studioUtils = __esm({
|
|
60114
60272
|
const i0 = require(`${it}`);
|
60115
60273
|
const i0values = Object.entries(i0);
|
60116
60274
|
i0values.forEach(([k, t]) => {
|
60117
|
-
if ((0, import_drizzle_orm15.is)(t,
|
60275
|
+
if ((0, import_drizzle_orm15.is)(t, import_pg_core4.PgTable)) {
|
60118
60276
|
pgSchema4[k] = t;
|
60119
60277
|
}
|
60120
60278
|
if ((0, import_drizzle_orm15.is)(t, import_mysql_core4.MySqlTable)) {
|
60121
60279
|
mysqlSchema4[k] = t;
|
60122
60280
|
}
|
60123
|
-
if ((0, import_drizzle_orm15.is)(t,
|
60281
|
+
if ((0, import_drizzle_orm15.is)(t, import_sqlite_core5.SQLiteTable)) {
|
60124
60282
|
sqliteSchema2[k] = t;
|
60125
60283
|
}
|
60126
60284
|
if ((0, import_drizzle_orm15.is)(t, import_drizzle_orm15.Relations)) {
|
@@ -60328,7 +60486,8 @@ var init_utils5 = __esm({
|
|
60328
60486
|
init_pgIntrospect();
|
60329
60487
|
init_pgPushUtils();
|
60330
60488
|
init_sqliteIntrospect();
|
60331
|
-
|
60489
|
+
init_sqliteSerializer();
|
60490
|
+
init_pgSerializer();
|
60332
60491
|
init_studioUtils();
|
60333
60492
|
init_pgConnect();
|
60334
60493
|
assertV1OutFolder = (out, dialect6) => {
|
@@ -61131,8 +61290,8 @@ var require_package = __commonJS({
|
|
61131
61290
|
var require_main = __commonJS({
|
61132
61291
|
"node_modules/.pnpm/dotenv@16.0.3/node_modules/dotenv/lib/main.js"(exports, module2) {
|
61133
61292
|
var fs8 = require("fs");
|
61134
|
-
var
|
61135
|
-
var
|
61293
|
+
var path4 = require("path");
|
61294
|
+
var os2 = require("os");
|
61136
61295
|
var packageJson = require_package();
|
61137
61296
|
var version = packageJson.version;
|
61138
61297
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
@@ -61159,10 +61318,10 @@ var require_main = __commonJS({
|
|
61159
61318
|
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
61160
61319
|
}
|
61161
61320
|
function _resolveHome(envPath) {
|
61162
|
-
return envPath[0] === "~" ?
|
61321
|
+
return envPath[0] === "~" ? path4.join(os2.homedir(), envPath.slice(1)) : envPath;
|
61163
61322
|
}
|
61164
61323
|
function config(options) {
|
61165
|
-
let dotenvPath =
|
61324
|
+
let dotenvPath = path4.resolve(process.cwd(), ".env");
|
61166
61325
|
let encoding = "utf8";
|
61167
61326
|
const debug = Boolean(options && options.debug);
|
61168
61327
|
const override = Boolean(options && options.override);
|
@@ -61969,7 +62128,7 @@ __export(cli_exports, {
|
|
61969
62128
|
});
|
61970
62129
|
module.exports = __toCommonJS(cli_exports);
|
61971
62130
|
var import_commander = require("commander");
|
61972
|
-
var
|
62131
|
+
var import_fs11 = require("fs");
|
61973
62132
|
init_lib();
|
61974
62133
|
|
61975
62134
|
// src/cli/commands/check.ts
|
@@ -62011,14 +62170,14 @@ var checkHandler = (out, dialect6) => {
|
|
62011
62170
|
|
62012
62171
|
// src/cli/index.ts
|
62013
62172
|
var import_hanji11 = __toESM(require_hanji());
|
62014
|
-
var
|
62173
|
+
var import_path7 = __toESM(require("path"));
|
62015
62174
|
init_utils3();
|
62016
62175
|
init_source();
|
62017
62176
|
|
62018
62177
|
// package.json
|
62019
62178
|
var package_default = {
|
62020
62179
|
name: "drizzle-kit",
|
62021
|
-
version: "0.20.
|
62180
|
+
version: "0.20.7",
|
62022
62181
|
repository: "https://github.com/drizzle-team/drizzle-kit-mirror",
|
62023
62182
|
author: "Drizzle Team",
|
62024
62183
|
license: "MIT",
|
@@ -62074,12 +62233,11 @@ var package_default = {
|
|
62074
62233
|
]
|
62075
62234
|
},
|
62076
62235
|
dependencies: {
|
62077
|
-
"@drizzle-team/studio": "^0.0.
|
62236
|
+
"@drizzle-team/studio": "^0.0.35",
|
62078
62237
|
"@esbuild-kit/esm-loader": "^2.5.5",
|
62079
62238
|
camelcase: "^7.0.1",
|
62080
62239
|
chalk: "^5.2.0",
|
62081
62240
|
commander: "^9.4.1",
|
62082
|
-
"env-paths": "^3.0.0",
|
62083
62241
|
esbuild: "^0.19.7",
|
62084
62242
|
"esbuild-register": "^3.5.0",
|
62085
62243
|
glob: "^8.1.0",
|
@@ -62170,10 +62328,10 @@ var upSqliteHandlerV4 = (out) => {
|
|
62170
62328
|
path: it,
|
62171
62329
|
raw: report.rawMap[it]
|
62172
62330
|
})).forEach((it) => {
|
62173
|
-
const
|
62331
|
+
const path4 = it.path;
|
62174
62332
|
const result = updateToLatestV42(it.raw);
|
62175
|
-
console.log(`[${source_default.green("\u2713")}] ${
|
62176
|
-
import_fs9.default.writeFileSync(
|
62333
|
+
console.log(`[${source_default.green("\u2713")}] ${path4}`);
|
62334
|
+
import_fs9.default.writeFileSync(path4, JSON.stringify(result, null, 2));
|
62177
62335
|
});
|
62178
62336
|
console.log("Everything's fine \u{1F436}\u{1F525}");
|
62179
62337
|
};
|
@@ -62244,6 +62402,7 @@ init_source();
|
|
62244
62402
|
var import_hanji9 = __toESM(require_hanji());
|
62245
62403
|
init_mysqlSchema();
|
62246
62404
|
init_selector_ui();
|
62405
|
+
init_outputs();
|
62247
62406
|
var filterStatements = (statements, currentSchema, prevSchema) => {
|
62248
62407
|
return statements.filter((statement) => {
|
62249
62408
|
if (statement.type === "alter_table_alter_column_set_type") {
|
@@ -62287,7 +62446,8 @@ var filterStatements = (statements, currentSchema, prevSchema) => {
|
|
62287
62446
|
};
|
62288
62447
|
var logSuggestionsAndReturn = async ({
|
62289
62448
|
connection,
|
62290
|
-
statements
|
62449
|
+
statements,
|
62450
|
+
json2
|
62291
62451
|
}) => {
|
62292
62452
|
let shouldAskForApprove = false;
|
62293
62453
|
const statementsToExecute = [];
|
@@ -62373,7 +62533,6 @@ var logSuggestionsAndReturn = async ({
|
|
62373
62533
|
shouldAskForApprove = true;
|
62374
62534
|
}
|
62375
62535
|
}
|
62376
|
-
shouldAskForApprove = true;
|
62377
62536
|
} else if (statement.type === "alter_table_alter_column_set_notnull") {
|
62378
62537
|
if (typeof statement.columnDefault === "undefined") {
|
62379
62538
|
const res = await connection.query(
|
@@ -62395,6 +62554,16 @@ var logSuggestionsAndReturn = async ({
|
|
62395
62554
|
const res = await connection.query(
|
62396
62555
|
`select count(*) as count from \`${statement.tableName}\``
|
62397
62556
|
);
|
62557
|
+
if (Object.values(json2.tables[statement.tableName].columns).filter(
|
62558
|
+
(column7) => column7.autoincrement
|
62559
|
+
).length > 0) {
|
62560
|
+
console.log(
|
62561
|
+
`${withStyle.errorWarning(
|
62562
|
+
`You have removed the primary key from a ${statement.tableName} table without removing the auto-increment property from this table. As the database error states: 'there can be only one auto column, and it must be defined as a key. Make sure to remove autoincrement from ${statement.tableName} table`
|
62563
|
+
)}`
|
62564
|
+
);
|
62565
|
+
process.exit(1);
|
62566
|
+
}
|
62398
62567
|
const count = Number(res[0][0].count);
|
62399
62568
|
if (count > 0) {
|
62400
62569
|
infoToPrint.push(
|
@@ -62405,6 +62574,17 @@ var logSuggestionsAndReturn = async ({
|
|
62405
62574
|
tablesToTruncate.push(statement.tableName);
|
62406
62575
|
shouldAskForApprove = true;
|
62407
62576
|
}
|
62577
|
+
} else if (statement.type === "delete_composite_pk") {
|
62578
|
+
if (Object.values(json2.tables[statement.tableName].columns).filter(
|
62579
|
+
(column7) => column7.autoincrement
|
62580
|
+
).length > 0) {
|
62581
|
+
console.log(
|
62582
|
+
`${withStyle.errorWarning(
|
62583
|
+
`You have removed the primary key from a ${statement.tableName} table without removing the auto-increment property from this table. As the database error states: 'there can be only one auto column, and it must be defined as a key. Make sure to remove autoincrement from ${statement.tableName} table`
|
62584
|
+
)}`
|
62585
|
+
);
|
62586
|
+
process.exit(1);
|
62587
|
+
}
|
62408
62588
|
} else if (statement.type === "alter_table_add_column") {
|
62409
62589
|
if (statement.column.notNull && typeof statement.column.default === "undefined") {
|
62410
62590
|
const res = await connection.query(
|
@@ -62769,97 +62949,6 @@ init_sqlgenerator();
|
|
62769
62949
|
init_selector_ui();
|
62770
62950
|
var import_studio = require("@drizzle-team/studio");
|
62771
62951
|
init_global();
|
62772
|
-
|
62773
|
-
// src/utils/certs.ts
|
62774
|
-
init_build();
|
62775
|
-
var import_path7 = require("path");
|
62776
|
-
|
62777
|
-
// node_modules/.pnpm/env-paths@3.0.0/node_modules/env-paths/index.js
|
62778
|
-
var import_node_path3 = __toESM(require("node:path"), 1);
|
62779
|
-
var import_node_os2 = __toESM(require("node:os"), 1);
|
62780
|
-
var import_node_process3 = __toESM(require("node:process"), 1);
|
62781
|
-
var homedir = import_node_os2.default.homedir();
|
62782
|
-
var tmpdir = import_node_os2.default.tmpdir();
|
62783
|
-
var { env: env2 } = import_node_process3.default;
|
62784
|
-
var macos = (name) => {
|
62785
|
-
const library = import_node_path3.default.join(homedir, "Library");
|
62786
|
-
return {
|
62787
|
-
data: import_node_path3.default.join(library, "Application Support", name),
|
62788
|
-
config: import_node_path3.default.join(library, "Preferences", name),
|
62789
|
-
cache: import_node_path3.default.join(library, "Caches", name),
|
62790
|
-
log: import_node_path3.default.join(library, "Logs", name),
|
62791
|
-
temp: import_node_path3.default.join(tmpdir, name)
|
62792
|
-
};
|
62793
|
-
};
|
62794
|
-
var windows = (name) => {
|
62795
|
-
const appData = env2.APPDATA || import_node_path3.default.join(homedir, "AppData", "Roaming");
|
62796
|
-
const localAppData = env2.LOCALAPPDATA || import_node_path3.default.join(homedir, "AppData", "Local");
|
62797
|
-
return {
|
62798
|
-
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
62799
|
-
data: import_node_path3.default.join(localAppData, name, "Data"),
|
62800
|
-
config: import_node_path3.default.join(appData, name, "Config"),
|
62801
|
-
cache: import_node_path3.default.join(localAppData, name, "Cache"),
|
62802
|
-
log: import_node_path3.default.join(localAppData, name, "Log"),
|
62803
|
-
temp: import_node_path3.default.join(tmpdir, name)
|
62804
|
-
};
|
62805
|
-
};
|
62806
|
-
var linux = (name) => {
|
62807
|
-
const username = import_node_path3.default.basename(homedir);
|
62808
|
-
return {
|
62809
|
-
data: import_node_path3.default.join(env2.XDG_DATA_HOME || import_node_path3.default.join(homedir, ".local", "share"), name),
|
62810
|
-
config: import_node_path3.default.join(env2.XDG_CONFIG_HOME || import_node_path3.default.join(homedir, ".config"), name),
|
62811
|
-
cache: import_node_path3.default.join(env2.XDG_CACHE_HOME || import_node_path3.default.join(homedir, ".cache"), name),
|
62812
|
-
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
62813
|
-
log: import_node_path3.default.join(env2.XDG_STATE_HOME || import_node_path3.default.join(homedir, ".local", "state"), name),
|
62814
|
-
temp: import_node_path3.default.join(tmpdir, username, name)
|
62815
|
-
};
|
62816
|
-
};
|
62817
|
-
function envPaths(name, { suffix = "nodejs" } = {}) {
|
62818
|
-
if (typeof name !== "string") {
|
62819
|
-
throw new TypeError(`Expected a string, got ${typeof name}`);
|
62820
|
-
}
|
62821
|
-
if (suffix) {
|
62822
|
-
name += `-${suffix}`;
|
62823
|
-
}
|
62824
|
-
if (import_node_process3.default.platform === "darwin") {
|
62825
|
-
return macos(name);
|
62826
|
-
}
|
62827
|
-
if (import_node_process3.default.platform === "win32") {
|
62828
|
-
return windows(name);
|
62829
|
-
}
|
62830
|
-
return linux(name);
|
62831
|
-
}
|
62832
|
-
|
62833
|
-
// src/utils/certs.ts
|
62834
|
-
var import_promises = require("fs/promises");
|
62835
|
-
var import_fs11 = require("fs");
|
62836
|
-
var p = envPaths("drizzle-studio", {
|
62837
|
-
suffix: ""
|
62838
|
-
});
|
62839
|
-
$.verbose = false;
|
62840
|
-
$.cwd = p.data;
|
62841
|
-
var certs = async () => {
|
62842
|
-
const res = await $`mkcert --help`.nothrow();
|
62843
|
-
const keyPath = (0, import_path7.join)(p.data, "localhost-key.pem");
|
62844
|
-
const certPath = (0, import_path7.join)(p.data, "localhost.pem");
|
62845
|
-
if (res.exitCode === 0) {
|
62846
|
-
(0, import_fs11.mkdirSync)(p.data, { recursive: true });
|
62847
|
-
try {
|
62848
|
-
await Promise.all([(0, import_promises.access)(keyPath), (0, import_promises.access)(certPath)]);
|
62849
|
-
} catch (e) {
|
62850
|
-
await $`mkcert localhost`.nothrow();
|
62851
|
-
}
|
62852
|
-
const [key, cert] = await Promise.all([
|
62853
|
-
(0, import_promises.readFile)(keyPath, { encoding: "utf-8" }),
|
62854
|
-
(0, import_promises.readFile)(certPath, { encoding: "utf-8" })
|
62855
|
-
]);
|
62856
|
-
return key && cert ? { key, cert } : null;
|
62857
|
-
}
|
62858
|
-
return null;
|
62859
|
-
};
|
62860
|
-
certs();
|
62861
|
-
|
62862
|
-
// src/cli/index.ts
|
62863
62952
|
var printVersions = async () => {
|
62864
62953
|
const v = await versions();
|
62865
62954
|
console.log(`${source_default.gray(v)}
|
@@ -62968,7 +63057,8 @@ var dbPushMysqlCommand = new import_commander.Command("push:mysql").option(
|
|
62968
63057
|
schemasToRemove
|
62969
63058
|
} = await logSuggestionsAndReturn({
|
62970
63059
|
connection: connection.client,
|
62971
|
-
statements: filteredStatements
|
63060
|
+
statements: filteredStatements,
|
63061
|
+
json2: statements == null ? void 0 : statements.validatedCur
|
62972
63062
|
});
|
62973
63063
|
const filteredSqlStatements = filteredStatements.map(
|
62974
63064
|
(filteredStatement) => fromJson([filteredStatement], "mysql")[0]
|
@@ -63389,8 +63479,8 @@ var introspectPgCommand = new import_commander.Command("introspect:pg").option("
|
|
63389
63479
|
tablesFilter,
|
63390
63480
|
schemasFilter
|
63391
63481
|
);
|
63392
|
-
const schemaFile =
|
63393
|
-
(0,
|
63482
|
+
const schemaFile = import_path7.default.join(validatedConfig.out, "schema.ts");
|
63483
|
+
(0, import_fs11.writeFileSync)(schemaFile, ts.file);
|
63394
63484
|
console.log();
|
63395
63485
|
if (snapshots.length === 0) {
|
63396
63486
|
const { sqlStatements, _meta } = await prepareSQL(
|
@@ -63442,8 +63532,8 @@ var introspectMySqlCommand = new import_commander.Command("introspect:mysql").op
|
|
63442
63532
|
const filterConfig = res.tablesFilter;
|
63443
63533
|
const tablesFilter = filterConfig ? typeof filterConfig === "string" ? [filterConfig] : filterConfig : [];
|
63444
63534
|
const { schema: schema4, ts } = await mysqlIntrospect2(res, tablesFilter);
|
63445
|
-
const schemaFile =
|
63446
|
-
(0,
|
63535
|
+
const schemaFile = import_path7.default.join(out, "schema.ts");
|
63536
|
+
(0, import_fs11.writeFileSync)(schemaFile, ts.file);
|
63447
63537
|
console.log();
|
63448
63538
|
if (snapshots.length === 0) {
|
63449
63539
|
const { sqlStatements, _meta } = await prepareSQL(
|
@@ -63495,8 +63585,8 @@ var introspectSQLiteCommand = new import_commander.Command("introspect:sqlite").
|
|
63495
63585
|
const filterConfig = res.tablesFilter;
|
63496
63586
|
const tablesFilter = filterConfig ? typeof filterConfig === "string" ? [filterConfig] : filterConfig : [];
|
63497
63587
|
const { schema: schema4, ts } = await sqliteIntrospect2(res, tablesFilter);
|
63498
|
-
const schemaFile =
|
63499
|
-
(0,
|
63588
|
+
const schemaFile = import_path7.default.join(out, "schema.ts");
|
63589
|
+
(0, import_fs11.writeFileSync)(schemaFile, ts.file);
|
63500
63590
|
console.log();
|
63501
63591
|
if (snapshots.length === 0) {
|
63502
63592
|
const { sqlStatements, _meta } = await prepareSQL(
|
@@ -63637,12 +63727,9 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
|
|
63637
63727
|
)
|
63638
63728
|
);
|
63639
63729
|
}
|
63640
|
-
const { key, cert } = await certs() || {};
|
63641
63730
|
server.start({
|
63642
63731
|
host,
|
63643
63732
|
port,
|
63644
|
-
key,
|
63645
|
-
cert,
|
63646
63733
|
cb: (err2, address) => {
|
63647
63734
|
if (err2) {
|
63648
63735
|
console.error(err2);
|
@@ -63654,7 +63741,7 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
|
|
63654
63741
|
if (host !== "127.0.0.1") {
|
63655
63742
|
queryParams.host = host;
|
63656
63743
|
}
|
63657
|
-
const queryString = Object.keys(queryParams).map((
|
63744
|
+
const queryString = Object.keys(queryParams).map((key) => `${key}=${queryParams[key]}`).join("&");
|
63658
63745
|
console.log(
|
63659
63746
|
`
|
63660
63747
|
Drizzle Studio is up and running on ${source_default.blue(
|