@prisma/migrate 6.20.0-integration-merge-release-workflows2.1 → 6.20.0-integration-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Migrate.js +5 -7
- package/dist/SchemaEngineCLI.js +4 -4
- package/dist/SchemaEngineWasm.js +4 -4
- package/dist/bin.js +59 -62
- package/dist/{chunk-TW22Y3AA.js → chunk-272GEALL.js} +19 -23
- package/dist/{chunk-NB4FRYRQ.js → chunk-3I675WMS.js} +6 -6
- package/dist/{chunk-R4IWP35Z.js → chunk-ANKMSTAX.js} +12 -15
- package/dist/{chunk-6ORQRJLP.js → chunk-D7TRYHBP.js} +30 -114
- package/dist/{chunk-F2XCBEZ4.js → chunk-EC6XGJS6.js} +16 -45
- package/dist/{chunk-7TVX3D4W.js → chunk-F6PHYOSL.js} +27 -65
- package/dist/{chunk-OP2BDF75.js → chunk-FRY7T46S.js} +10 -11
- package/dist/{chunk-22YP3RXZ.js → chunk-GH6IOZTT.js} +7 -7
- package/dist/{chunk-VU5BLQUI.js → chunk-HFRA2WBM.js} +223 -22
- package/dist/{chunk-J33EXHZB.js → chunk-HNEFGYLW.js} +15 -38
- package/dist/{chunk-74LUB4XX.js → chunk-K4HINZKE.js} +27 -37
- package/dist/{chunk-PHXLQVPT.js → chunk-L7EZFBB4.js} +40 -68
- package/dist/{chunk-AXR7LS2N.js → chunk-PEUHUCS4.js} +4 -5
- package/dist/{chunk-BHJMJSM4.js → chunk-PI5GR2QW.js} +20 -19
- package/dist/{chunk-ZTIS675B.js → chunk-PYDC3Q6V.js} +136 -205
- package/dist/{chunk-Z27SI4AV.js → chunk-R2N4YKAR.js} +9 -7
- package/dist/{chunk-GSX25HRL.js → chunk-SYWL5XS4.js} +5 -5
- package/dist/{chunk-D4TRX77Y.js → chunk-WF7UXKO5.js} +6 -9
- package/dist/chunk-WHMCFTZO.js +176 -0
- package/dist/{chunk-3AKRTEIK.js → chunk-WQKZ5H57.js} +15 -18
- package/dist/{chunk-QVMYNWAN.js → chunk-XA2JOJS2.js} +157 -70
- package/dist/{chunk-O35BTK6Y.js → chunk-YFUB52PK.js} +9 -13
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbExecute.js +6 -8
- package/dist/commands/DbPull.js +9 -11
- package/dist/commands/DbPush.js +7 -9
- package/dist/commands/DbSeed.js +3 -3
- package/dist/commands/MigrateDeploy.js +7 -9
- package/dist/commands/MigrateDev.js +7 -10
- package/dist/commands/MigrateDiff.js +7 -8
- package/dist/commands/MigrateReset.js +7 -10
- package/dist/commands/MigrateResolve.js +7 -9
- package/dist/commands/MigrateStatus.js +7 -9
- package/dist/index.js +37 -39
- package/dist/internals/src/cli/getSchema.d.ts +1 -15
- package/dist/migrate/src/Migrate.d.ts +1 -3
- package/dist/migrate/src/commands/MigrateDiff.d.ts +1 -0
- package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +9 -3
- package/dist/migrate/src/utils/getDatabaseVersionSafe.d.ts +2 -1
- package/dist/migrate/src/utils/introspectSql.d.ts +2 -1
- package/dist/migrate/src/utils/seed.d.ts +0 -6
- package/dist/open-GFNXULGD.js +593 -0
- package/dist/utils/ensureDatabaseExists.js +6 -6
- package/dist/utils/getDatabaseVersionSafe.js +6 -8
- package/dist/utils/introspectSql.js +6 -8
- package/dist/utils/seed.js +2 -3
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +30734 -30124
- package/dist/utils/setupMongo.js +2048 -768
- package/dist/utils/setupPostgres.js +2 -2
- package/dist/utils/spinner.js +2 -3
- package/dist/views/handleViewsIO.js +2 -2
- package/package.json +11 -11
- package/dist/chunk-D6LYHB65.js +0 -905
- package/dist/chunk-RR6BKMNO.js +0 -80
- package/dist/chunk-VV4M6AN7.js +0 -233
- package/dist/migrate/src/utils/replaceOrAddDatasource.d.ts +0 -2
- package/dist/migrate/src/utils/replaceOrAddDatasource.test.d.ts +0 -1
- package/dist/utils/replaceOrAddDatasource.js +0 -25
- package/dist/utils/replaceOrAddDatasource.test.js +0 -207
|
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_HFRA2WBM_exports = {};
|
|
30
|
+
__export(chunk_HFRA2WBM_exports, {
|
|
31
31
|
createSpinner: () => createSpinner
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_HFRA2WBM_exports);
|
|
34
|
+
var import_chunk_3WDCTXHL = require("./chunk-3WDCTXHL.js");
|
|
35
35
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
36
36
|
var import_node_process = __toESM(require("node:process"));
|
|
37
37
|
var import_node_process2 = __toESM(require("node:process"));
|
|
@@ -40,6 +40,8 @@ var import_node_tty = __toESM(require("node:tty"));
|
|
|
40
40
|
var import_node_process3 = __toESM(require("node:process"));
|
|
41
41
|
var import_node_process4 = __toESM(require("node:process"));
|
|
42
42
|
var import_node_process5 = __toESM(require("node:process"));
|
|
43
|
+
var import_node_process6 = __toESM(require("node:process"));
|
|
44
|
+
var import_node_process7 = __toESM(require("node:process"));
|
|
43
45
|
var require_spinners = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
44
46
|
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json"(exports, module2) {
|
|
45
47
|
module2.exports = {
|
|
@@ -1952,6 +1954,12 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
1952
1954
|
if (env.TERM === "xterm-kitty") {
|
|
1953
1955
|
return 3;
|
|
1954
1956
|
}
|
|
1957
|
+
if (env.TERM === "xterm-ghostty") {
|
|
1958
|
+
return 3;
|
|
1959
|
+
}
|
|
1960
|
+
if (env.TERM === "wezterm") {
|
|
1961
|
+
return 3;
|
|
1962
|
+
}
|
|
1955
1963
|
if ("TERM_PROGRAM" in env) {
|
|
1956
1964
|
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1957
1965
|
switch (env.TERM_PROGRAM) {
|
|
@@ -2159,12 +2167,121 @@ Object.defineProperties(createChalk.prototype, styles2);
|
|
|
2159
2167
|
var chalk = createChalk();
|
|
2160
2168
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
2161
2169
|
var source_default = chalk;
|
|
2170
|
+
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
2171
|
+
if (property === "length" || property === "prototype") {
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
if (property === "arguments" || property === "caller") {
|
|
2175
|
+
return;
|
|
2176
|
+
}
|
|
2177
|
+
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
2178
|
+
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
2179
|
+
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
2180
|
+
return;
|
|
2181
|
+
}
|
|
2182
|
+
Object.defineProperty(to, property, fromDescriptor);
|
|
2183
|
+
};
|
|
2184
|
+
var canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
2185
|
+
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
2186
|
+
};
|
|
2187
|
+
var changePrototype = (to, from) => {
|
|
2188
|
+
const fromPrototype = Object.getPrototypeOf(from);
|
|
2189
|
+
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
2190
|
+
return;
|
|
2191
|
+
}
|
|
2192
|
+
Object.setPrototypeOf(to, fromPrototype);
|
|
2193
|
+
};
|
|
2194
|
+
var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
2195
|
+
${fromBody}`;
|
|
2196
|
+
var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
2197
|
+
var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
2198
|
+
var changeToString = (to, from, name) => {
|
|
2199
|
+
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
2200
|
+
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
2201
|
+
Object.defineProperty(newToString, "name", toStringName);
|
|
2202
|
+
const { writable, enumerable, configurable } = toStringDescriptor;
|
|
2203
|
+
Object.defineProperty(to, "toString", { value: newToString, writable, enumerable, configurable });
|
|
2204
|
+
};
|
|
2205
|
+
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
2206
|
+
const { name } = to;
|
|
2207
|
+
for (const property of Reflect.ownKeys(from)) {
|
|
2208
|
+
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
2209
|
+
}
|
|
2210
|
+
changePrototype(to, from);
|
|
2211
|
+
changeToString(to, from, name);
|
|
2212
|
+
return to;
|
|
2213
|
+
}
|
|
2214
|
+
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
2215
|
+
var onetime = (function_, options = {}) => {
|
|
2216
|
+
if (typeof function_ !== "function") {
|
|
2217
|
+
throw new TypeError("Expected a function");
|
|
2218
|
+
}
|
|
2219
|
+
let returnValue;
|
|
2220
|
+
let callCount = 0;
|
|
2221
|
+
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
2222
|
+
const onetime2 = function(...arguments_) {
|
|
2223
|
+
calledFunctions.set(onetime2, ++callCount);
|
|
2224
|
+
if (callCount === 1) {
|
|
2225
|
+
returnValue = function_.apply(this, arguments_);
|
|
2226
|
+
function_ = void 0;
|
|
2227
|
+
} else if (options.throw === true) {
|
|
2228
|
+
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
2229
|
+
}
|
|
2230
|
+
return returnValue;
|
|
2231
|
+
};
|
|
2232
|
+
mimicFunction(onetime2, function_);
|
|
2233
|
+
calledFunctions.set(onetime2, callCount);
|
|
2234
|
+
return onetime2;
|
|
2235
|
+
};
|
|
2236
|
+
onetime.callCount = (function_) => {
|
|
2237
|
+
if (!calledFunctions.has(function_)) {
|
|
2238
|
+
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
2239
|
+
}
|
|
2240
|
+
return calledFunctions.get(function_);
|
|
2241
|
+
};
|
|
2242
|
+
var onetime_default = onetime;
|
|
2243
|
+
var terminal = import_node_process4.default.stderr.isTTY ? import_node_process4.default.stderr : import_node_process4.default.stdout.isTTY ? import_node_process4.default.stdout : void 0;
|
|
2244
|
+
var restoreCursor = terminal ? onetime_default(() => {
|
|
2245
|
+
(0, import_chunk_3WDCTXHL.onExit)(() => {
|
|
2246
|
+
terminal.write("\x1B[?25h");
|
|
2247
|
+
}, { alwaysLast: true });
|
|
2248
|
+
}) : () => {
|
|
2249
|
+
};
|
|
2250
|
+
var restore_cursor_default = restoreCursor;
|
|
2251
|
+
var isHidden = false;
|
|
2252
|
+
var cliCursor = {};
|
|
2253
|
+
cliCursor.show = (writableStream = import_node_process3.default.stderr) => {
|
|
2254
|
+
if (!writableStream.isTTY) {
|
|
2255
|
+
return;
|
|
2256
|
+
}
|
|
2257
|
+
isHidden = false;
|
|
2258
|
+
writableStream.write("\x1B[?25h");
|
|
2259
|
+
};
|
|
2260
|
+
cliCursor.hide = (writableStream = import_node_process3.default.stderr) => {
|
|
2261
|
+
if (!writableStream.isTTY) {
|
|
2262
|
+
return;
|
|
2263
|
+
}
|
|
2264
|
+
restore_cursor_default();
|
|
2265
|
+
isHidden = true;
|
|
2266
|
+
writableStream.write("\x1B[?25l");
|
|
2267
|
+
};
|
|
2268
|
+
cliCursor.toggle = (force, writableStream) => {
|
|
2269
|
+
if (force !== void 0) {
|
|
2270
|
+
isHidden = force;
|
|
2271
|
+
}
|
|
2272
|
+
if (isHidden) {
|
|
2273
|
+
cliCursor.show(writableStream);
|
|
2274
|
+
} else {
|
|
2275
|
+
cliCursor.hide(writableStream);
|
|
2276
|
+
}
|
|
2277
|
+
};
|
|
2278
|
+
var cli_cursor_default = cliCursor;
|
|
2162
2279
|
var import_cli_spinners = (0, import_chunk_2ESYSVXG.__toESM)(require_cli_spinners(), 1);
|
|
2163
2280
|
function isUnicodeSupported() {
|
|
2164
|
-
if (
|
|
2165
|
-
return
|
|
2281
|
+
if (import_node_process5.default.platform !== "win32") {
|
|
2282
|
+
return import_node_process5.default.env.TERM !== "linux";
|
|
2166
2283
|
}
|
|
2167
|
-
return Boolean(
|
|
2284
|
+
return Boolean(import_node_process5.default.env.CI) || Boolean(import_node_process5.default.env.WT_SESSION) || Boolean(import_node_process5.default.env.TERMINUS_SUBLIME) || import_node_process5.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process5.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process5.default.env.TERM_PROGRAM === "vscode" || import_node_process5.default.env.TERM === "xterm-256color" || import_node_process5.default.env.TERM === "alacritty" || import_node_process5.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
2168
2285
|
}
|
|
2169
2286
|
var main = {
|
|
2170
2287
|
info: source_default.blue("\u2139"),
|
|
@@ -2180,15 +2297,99 @@ var fallback = {
|
|
|
2180
2297
|
};
|
|
2181
2298
|
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
2182
2299
|
var log_symbols_default = logSymbols;
|
|
2300
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
2301
|
+
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
2302
|
+
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
2303
|
+
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
2304
|
+
const pattern = `${osc}|${csi}`;
|
|
2305
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
2306
|
+
}
|
|
2307
|
+
var regex = ansiRegex();
|
|
2308
|
+
function stripAnsi(string) {
|
|
2309
|
+
if (typeof string !== "string") {
|
|
2310
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
2311
|
+
}
|
|
2312
|
+
return string.replace(regex, "");
|
|
2313
|
+
}
|
|
2314
|
+
function isAmbiguous(x) {
|
|
2315
|
+
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
2316
|
+
}
|
|
2317
|
+
function isFullWidth(x) {
|
|
2318
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
2319
|
+
}
|
|
2320
|
+
function isWide(x) {
|
|
2321
|
+
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
2322
|
+
}
|
|
2323
|
+
function validate(codePoint) {
|
|
2324
|
+
if (!Number.isSafeInteger(codePoint)) {
|
|
2325
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
2329
|
+
validate(codePoint);
|
|
2330
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
2331
|
+
return 2;
|
|
2332
|
+
}
|
|
2333
|
+
return 1;
|
|
2334
|
+
}
|
|
2335
|
+
var emoji_regex_default = () => {
|
|
2336
|
+
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
2337
|
+
};
|
|
2338
|
+
var segmenter = new Intl.Segmenter();
|
|
2339
|
+
var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
2340
|
+
function stringWidth(string, options = {}) {
|
|
2341
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
2342
|
+
return 0;
|
|
2343
|
+
}
|
|
2344
|
+
const {
|
|
2345
|
+
ambiguousIsNarrow = true,
|
|
2346
|
+
countAnsiEscapeCodes = false
|
|
2347
|
+
} = options;
|
|
2348
|
+
if (!countAnsiEscapeCodes) {
|
|
2349
|
+
string = stripAnsi(string);
|
|
2350
|
+
}
|
|
2351
|
+
if (string.length === 0) {
|
|
2352
|
+
return 0;
|
|
2353
|
+
}
|
|
2354
|
+
let width = 0;
|
|
2355
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
2356
|
+
for (const { segment: character } of segmenter.segment(string)) {
|
|
2357
|
+
const codePoint = character.codePointAt(0);
|
|
2358
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
2359
|
+
continue;
|
|
2360
|
+
}
|
|
2361
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
2362
|
+
continue;
|
|
2363
|
+
}
|
|
2364
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
2365
|
+
continue;
|
|
2366
|
+
}
|
|
2367
|
+
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
2368
|
+
continue;
|
|
2369
|
+
}
|
|
2370
|
+
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
2371
|
+
continue;
|
|
2372
|
+
}
|
|
2373
|
+
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
2374
|
+
continue;
|
|
2375
|
+
}
|
|
2376
|
+
if (emoji_regex_default().test(character)) {
|
|
2377
|
+
width += 2;
|
|
2378
|
+
continue;
|
|
2379
|
+
}
|
|
2380
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
2381
|
+
}
|
|
2382
|
+
return width;
|
|
2383
|
+
}
|
|
2183
2384
|
function isInteractive({ stream = process.stdout } = {}) {
|
|
2184
2385
|
return Boolean(
|
|
2185
2386
|
stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env)
|
|
2186
2387
|
);
|
|
2187
2388
|
}
|
|
2188
2389
|
function isUnicodeSupported2() {
|
|
2189
|
-
const { env: env2 } =
|
|
2390
|
+
const { env: env2 } = import_node_process6.default;
|
|
2190
2391
|
const { TERM, TERM_PROGRAM } = env2;
|
|
2191
|
-
if (
|
|
2392
|
+
if (import_node_process6.default.platform !== "win32") {
|
|
2192
2393
|
return TERM !== "linux";
|
|
2193
2394
|
}
|
|
2194
2395
|
return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -2212,24 +2413,24 @@ var StdinDiscarder = class {
|
|
|
2212
2413
|
}
|
|
2213
2414
|
}
|
|
2214
2415
|
#realStart() {
|
|
2215
|
-
if (
|
|
2416
|
+
if (import_node_process7.default.platform === "win32" || !import_node_process7.default.stdin.isTTY) {
|
|
2216
2417
|
return;
|
|
2217
2418
|
}
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2419
|
+
import_node_process7.default.stdin.setRawMode(true);
|
|
2420
|
+
import_node_process7.default.stdin.on("data", this.#handleInput);
|
|
2421
|
+
import_node_process7.default.stdin.resume();
|
|
2221
2422
|
}
|
|
2222
2423
|
#realStop() {
|
|
2223
|
-
if (!
|
|
2424
|
+
if (!import_node_process7.default.stdin.isTTY) {
|
|
2224
2425
|
return;
|
|
2225
2426
|
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2427
|
+
import_node_process7.default.stdin.off("data", this.#handleInput);
|
|
2428
|
+
import_node_process7.default.stdin.pause();
|
|
2429
|
+
import_node_process7.default.stdin.setRawMode(false);
|
|
2229
2430
|
}
|
|
2230
2431
|
#handleInput(chunk) {
|
|
2231
2432
|
if (chunk[0] === ASCII_ETX_CODE) {
|
|
2232
|
-
|
|
2433
|
+
import_node_process7.default.emit("SIGINT");
|
|
2233
2434
|
}
|
|
2234
2435
|
}
|
|
2235
2436
|
};
|
|
@@ -2382,8 +2583,8 @@ var Ora = class {
|
|
|
2382
2583
|
const fullSuffixText = this.#getFullSuffixText(this.#suffixText, "-");
|
|
2383
2584
|
const fullText = " ".repeat(this.#indent) + fullPrefixText + "--" + this.#text + "--" + fullSuffixText;
|
|
2384
2585
|
this.#lineCount = 0;
|
|
2385
|
-
for (const line of
|
|
2386
|
-
this.#lineCount += Math.max(1, Math.ceil(
|
|
2586
|
+
for (const line of stripAnsi(fullText).split("\n")) {
|
|
2587
|
+
this.#lineCount += Math.max(1, Math.ceil(stringWidth(line, { countAnsiEscapeCodes: true }) / columns));
|
|
2387
2588
|
}
|
|
2388
2589
|
}
|
|
2389
2590
|
get isEnabled() {
|
|
@@ -2465,7 +2666,7 @@ var Ora = class {
|
|
|
2465
2666
|
return this;
|
|
2466
2667
|
}
|
|
2467
2668
|
if (this.#options.hideCursor) {
|
|
2468
|
-
|
|
2669
|
+
cli_cursor_default.hide(this.#stream);
|
|
2469
2670
|
}
|
|
2470
2671
|
if (this.#options.discardStdin && import_node_process.default.stdin.isTTY) {
|
|
2471
2672
|
this.#isDiscardingStdin = true;
|
|
@@ -2484,7 +2685,7 @@ var Ora = class {
|
|
|
2484
2685
|
this.#frameIndex = 0;
|
|
2485
2686
|
this.clear();
|
|
2486
2687
|
if (this.#options.hideCursor) {
|
|
2487
|
-
|
|
2688
|
+
cli_cursor_default.show(this.#stream);
|
|
2488
2689
|
}
|
|
2489
2690
|
if (this.#options.discardStdin && import_node_process.default.stdin.isTTY && this.#isDiscardingStdin) {
|
|
2490
2691
|
stdin_discarder_default.stop();
|
|
@@ -26,18 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_HNEFGYLW_exports = {};
|
|
30
|
+
__export(chunk_HNEFGYLW_exports, {
|
|
31
31
|
MigrateReset: () => MigrateReset
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_HNEFGYLW_exports);
|
|
34
34
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
35
35
|
var import_chunk_FBDQVK4W = require("./chunk-FBDQVK4W.js");
|
|
36
36
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
37
37
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var import_chunk_D6LYHB65 = require("./chunk-D6LYHB65.js");
|
|
38
|
+
var import_chunk_K4HINZKE = require("./chunk-K4HINZKE.js");
|
|
39
|
+
var import_chunk_WHMCFTZO = require("./chunk-WHMCFTZO.js");
|
|
41
40
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
42
41
|
var import_internals = require("@prisma/internals");
|
|
43
42
|
var import_prompts = __toESM(require("prompts"));
|
|
@@ -57,8 +56,6 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
|
57
56
|
-h, --help Display this help message
|
|
58
57
|
--config Custom path to your Prisma config file
|
|
59
58
|
--schema Custom path to your Prisma schema
|
|
60
|
-
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|
61
|
-
--skip-seed Skip triggering seed
|
|
62
59
|
-f, --force Skip the confirmation prompt
|
|
63
60
|
|
|
64
61
|
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
@@ -78,8 +75,6 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
78
75
|
"-h": "--help",
|
|
79
76
|
"--force": Boolean,
|
|
80
77
|
"-f": "--force",
|
|
81
|
-
"--skip-generate": Boolean,
|
|
82
|
-
"--skip-seed": Boolean,
|
|
83
78
|
"--schema": String,
|
|
84
79
|
"--config": String,
|
|
85
80
|
"--telemetry-information": String
|
|
@@ -90,22 +85,23 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
90
85
|
if (args["--help"]) {
|
|
91
86
|
return this.help();
|
|
92
87
|
}
|
|
93
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
94
88
|
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
95
89
|
schemaPathFromArg: args["--schema"],
|
|
96
90
|
schemaPathFromConfig: config.schema,
|
|
97
91
|
schemaEngineConfig: config
|
|
98
92
|
});
|
|
99
93
|
const { migrationsDirPath } = (0, import_internals.inferDirectoryConfig)(schemaContext, config);
|
|
100
|
-
const datasourceInfo = (0,
|
|
94
|
+
const datasourceInfo = (0, import_chunk_K4HINZKE.parseDatasourceInfo)(schemaContext.primaryDatasource, config);
|
|
101
95
|
const adapter = config.engine === "js" ? await config.adapter() : void 0;
|
|
102
96
|
(0, import_chunk_2FXU5NZQ.printDatasource)({ datasourceInfo, adapter });
|
|
103
|
-
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate reset",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
97
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate reset", config });
|
|
98
|
+
const successMessage = await (0, import_chunk_K4HINZKE.ensureDatabaseExists)(
|
|
99
|
+
schemaContext.primaryDatasourceDirectory,
|
|
100
|
+
(0, import_internals.getSchemaDatasourceProvider)(schemaContext),
|
|
101
|
+
config
|
|
102
|
+
);
|
|
103
|
+
if (successMessage) {
|
|
104
|
+
process.stdout.write("\n" + successMessage + "\n");
|
|
109
105
|
}
|
|
110
106
|
process.stdout.write("\n");
|
|
111
107
|
if (!args["--force"]) {
|
|
@@ -128,7 +124,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
128
124
|
externalTables: config.tables?.external ?? [],
|
|
129
125
|
externalEnums: config.enums?.external ?? []
|
|
130
126
|
};
|
|
131
|
-
const migrate = await
|
|
127
|
+
const migrate = await import_chunk_WHMCFTZO.Migrate.setup({
|
|
132
128
|
schemaEngineConfig: config,
|
|
133
129
|
migrationsDirPath,
|
|
134
130
|
schemaContext,
|
|
@@ -159,25 +155,6 @@ ${(0, import_chunk_KRQEFTDT.printFilesFromMigrationIds)("migrations", migrationI
|
|
|
159
155
|
`
|
|
160
156
|
);
|
|
161
157
|
}
|
|
162
|
-
if (!process.env.PRISMA_MIGRATE_SKIP_GENERATE && !args["--skip-generate"]) {
|
|
163
|
-
await migrate.tryToRunGenerate(datasourceInfo);
|
|
164
|
-
}
|
|
165
|
-
if (!process.env.PRISMA_MIGRATE_SKIP_SEED && !args["--skip-seed"]) {
|
|
166
|
-
const seedCommandFromPrismaConfig = config.migrations?.seed;
|
|
167
|
-
const seedCommandFromPkgJson = await (0, import_chunk_PHXLQVPT.getSeedCommandFromPackageJson)(process.cwd());
|
|
168
|
-
const seedCommand = seedCommandFromPrismaConfig ?? seedCommandFromPkgJson;
|
|
169
|
-
if (seedCommand) {
|
|
170
|
-
process.stdout.write("\n");
|
|
171
|
-
const successfulSeeding = await (0, import_chunk_PHXLQVPT.executeSeedCommand)({ commandFromConfig: seedCommand });
|
|
172
|
-
if (successfulSeeding) {
|
|
173
|
-
process.stdout.write(`
|
|
174
|
-
${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.
|
|
175
|
-
`);
|
|
176
|
-
} else {
|
|
177
|
-
process.exit(1);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
158
|
return ``;
|
|
182
159
|
}
|
|
183
160
|
help(error) {
|
|
@@ -26,34 +26,37 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_K4HINZKE_exports = {};
|
|
30
|
+
__export(chunk_K4HINZKE_exports, {
|
|
31
31
|
ensureCanConnectToDatabase: () => ensureCanConnectToDatabase,
|
|
32
32
|
ensureDatabaseExists: () => ensureDatabaseExists,
|
|
33
33
|
getDbLocation: () => getDbLocation,
|
|
34
34
|
parseDatasourceInfo: () => parseDatasourceInfo,
|
|
35
35
|
prettifyProvider: () => prettifyProvider
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(chunk_K4HINZKE_exports);
|
|
38
38
|
var import_chunk_TWPTG4XS = require("./chunk-TWPTG4XS.js");
|
|
39
39
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
40
|
+
var import_node_path = __toESM(require("node:path"));
|
|
40
41
|
var import_internals = require("@prisma/internals");
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
function parseDatasourceInfo(datasource, config) {
|
|
43
|
+
let url;
|
|
44
|
+
if (config.engine === "classic") {
|
|
45
|
+
url = config.datasource.url;
|
|
46
|
+
}
|
|
43
47
|
if (!datasource) {
|
|
44
48
|
return {
|
|
45
49
|
name: void 0,
|
|
46
50
|
prettyProvider: void 0,
|
|
47
51
|
dbName: void 0,
|
|
48
52
|
dbLocation: void 0,
|
|
49
|
-
url
|
|
53
|
+
url,
|
|
50
54
|
schema: void 0,
|
|
51
55
|
schemas: void 0,
|
|
52
56
|
configDir: void 0
|
|
53
57
|
};
|
|
54
58
|
}
|
|
55
59
|
const prettyProvider = prettifyProvider(datasource.provider);
|
|
56
|
-
const url = (0, import_internals.getEffectiveUrl)(datasource).value;
|
|
57
60
|
if (!url || datasource.provider === "sqlserver") {
|
|
58
61
|
return {
|
|
59
62
|
name: datasource.name,
|
|
@@ -63,7 +66,7 @@ function parseDatasourceInfo(datasource) {
|
|
|
63
66
|
url: url || void 0,
|
|
64
67
|
schema: void 0,
|
|
65
68
|
schemas: datasource.schemas,
|
|
66
|
-
configDir:
|
|
69
|
+
configDir: import_node_path.default.dirname(datasource.sourceFilePath)
|
|
67
70
|
};
|
|
68
71
|
}
|
|
69
72
|
try {
|
|
@@ -85,7 +88,7 @@ function parseDatasourceInfo(datasource) {
|
|
|
85
88
|
url,
|
|
86
89
|
schema,
|
|
87
90
|
schemas: datasource.schemas,
|
|
88
|
-
configDir:
|
|
91
|
+
configDir: import_node_path.default.dirname(datasource.sourceFilePath)
|
|
89
92
|
};
|
|
90
93
|
if (datasource.provider === "postgresql" && datasourceInfo.dbName === void 0) {
|
|
91
94
|
datasourceInfo.dbName = "postgres";
|
|
@@ -100,31 +103,29 @@ function parseDatasourceInfo(datasource) {
|
|
|
100
103
|
url,
|
|
101
104
|
schema: void 0,
|
|
102
105
|
schemas: datasource.schemas,
|
|
103
|
-
configDir:
|
|
106
|
+
configDir: import_node_path.default.dirname(datasource.sourceFilePath)
|
|
104
107
|
};
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
|
-
async function ensureCanConnectToDatabase(
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
+
async function ensureCanConnectToDatabase(pathResolutionRoot, config) {
|
|
111
|
+
if (config.engine !== "classic") {
|
|
112
|
+
return;
|
|
110
113
|
}
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
const canConnect = await (0, import_internals.canConnectToDatabase)(url, schemaDir);
|
|
114
|
+
const url = config.datasource.url;
|
|
115
|
+
const canConnect = await (0, import_internals.canConnectToDatabase)(url, pathResolutionRoot);
|
|
114
116
|
if (canConnect === true) {
|
|
115
|
-
return
|
|
117
|
+
return;
|
|
116
118
|
} else {
|
|
117
119
|
const { code, message } = canConnect;
|
|
118
120
|
throw new Error(`${code}: ${message}`);
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
|
-
async function ensureDatabaseExists(
|
|
122
|
-
if (
|
|
123
|
-
|
|
123
|
+
async function ensureDatabaseExists(pathResolutionRoot, provider, config) {
|
|
124
|
+
if (config.engine !== "classic") {
|
|
125
|
+
return void 0;
|
|
124
126
|
}
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
const canConnect = await (0, import_internals.canConnectToDatabase)(url, schemaDir);
|
|
127
|
+
const url = config.datasource.url;
|
|
128
|
+
const canConnect = await (0, import_internals.canConnectToDatabase)(url, pathResolutionRoot);
|
|
128
129
|
if (canConnect === true) {
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
@@ -132,13 +133,13 @@ async function ensureDatabaseExists(datasource) {
|
|
|
132
133
|
if (code !== "P1003") {
|
|
133
134
|
throw new Error(`${code}: ${message}`);
|
|
134
135
|
}
|
|
135
|
-
if (await (0, import_internals.createDatabase)(url,
|
|
136
|
-
if (
|
|
136
|
+
if (await (0, import_internals.createDatabase)(url, pathResolutionRoot)) {
|
|
137
|
+
if (provider === "sqlserver") {
|
|
137
138
|
return `SQL Server database created.
|
|
138
139
|
`;
|
|
139
140
|
}
|
|
140
141
|
const credentials = (0, import_internals.uriToCredentials)(url);
|
|
141
|
-
const prettyProvider = prettifyProvider(
|
|
142
|
+
const prettyProvider = prettifyProvider(provider);
|
|
142
143
|
let message2 = `${prettyProvider} database${credentials.database ? ` ${credentials.database} ` : " "}created`;
|
|
143
144
|
const dbLocation = getDbLocation(credentials);
|
|
144
145
|
if (dbLocation) {
|
|
@@ -181,14 +182,3 @@ function prettifyProvider(provider) {
|
|
|
181
182
|
return `MongoDB`;
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
|
-
function getConnectionUrl(datasource) {
|
|
185
|
-
const url = (0, import_internals.getEffectiveUrl)(datasource);
|
|
186
|
-
if (!url.value) {
|
|
187
|
-
if (url.fromEnvVar) {
|
|
188
|
-
throw new Error(`Environment variable '${url.fromEnvVar}' with database connection URL was not found.`);
|
|
189
|
-
} else {
|
|
190
|
-
throw new Error(`Datasource is missing a database connection URL.`);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return url.value;
|
|
194
|
-
}
|