@prisma/migrate 6.19.0-integration-engines-6-19-0-30-push-otuqumlrponx-17ff4a7bd0bffdf0b40b58a399869660f7f0e368.1 → 6.19.0-integration-feat-remove-library-engine.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 +3 -3
- package/dist/bin.js +27 -28
- package/dist/{chunk-J33EXHZB.js → chunk-2Z63R7HP.js} +10 -12
- package/dist/{chunk-F2XCBEZ4.js → chunk-3VYHMV3C.js} +10 -12
- package/dist/{chunk-Z27SI4AV.js → chunk-43R3GFIU.js} +4 -4
- package/dist/{chunk-3AKRTEIK.js → chunk-45NSU26W.js} +7 -7
- package/dist/{chunk-OP2BDF75.js → chunk-FRY7T46S.js} +10 -11
- package/dist/{chunk-O35BTK6Y.js → chunk-JVGKTJYZ.js} +5 -5
- package/dist/{chunk-VV4M6AN7.js → chunk-JX2HIV7V.js} +10 -10
- package/dist/{chunk-PHXLQVPT.js → chunk-L7EZFBB4.js} +40 -68
- package/dist/{chunk-R4IWP35Z.js → chunk-L7EZXEMS.js} +6 -6
- package/dist/{chunk-NB4FRYRQ.js → chunk-LNQIFWXN.js} +5 -5
- package/dist/{chunk-ZTIS675B.js → chunk-O57XJHDD.js} +64 -76
- package/dist/{chunk-BHJMJSM4.js → chunk-PJYHZKCF.js} +6 -6
- package/dist/{chunk-6ORQRJLP.js → chunk-QZUMMKCI.js} +16 -47
- package/dist/{chunk-VU5BLQUI.js → chunk-T2ACIU5M.js} +14 -8
- package/dist/{chunk-7TVX3D4W.js → chunk-TCBZUTEL.js} +27 -65
- package/dist/{chunk-TW22Y3AA.js → chunk-URVKYSZJ.js} +7 -7
- package/dist/{chunk-D6LYHB65.js → chunk-V5D5NSLS.js} +33 -25
- package/dist/{chunk-D4TRX77Y.js → chunk-W2NKGYXF.js} +7 -9
- package/dist/{chunk-QVMYNWAN.js → chunk-XA2JOJS2.js} +157 -70
- package/dist/commands/DbDrop.js +2 -2
- package/dist/commands/DbExecute.js +4 -4
- package/dist/commands/DbPull.js +5 -6
- package/dist/commands/DbPush.js +4 -4
- package/dist/commands/DbSeed.js +3 -3
- package/dist/commands/MigrateDeploy.js +4 -4
- package/dist/commands/MigrateDev.js +5 -5
- package/dist/commands/MigrateDiff.js +4 -4
- package/dist/commands/MigrateReset.js +5 -5
- package/dist/commands/MigrateResolve.js +4 -4
- package/dist/commands/MigrateStatus.js +4 -4
- package/dist/index.js +31 -32
- package/dist/internals/src/cli/getSchema.d.ts +1 -15
- package/dist/migrate/src/Migrate.d.ts +1 -2
- package/dist/migrate/src/utils/seed.d.ts +0 -6
- package/dist/open-GFNXULGD.js +593 -0
- package/dist/utils/getDatabaseVersionSafe.js +4 -4
- package/dist/utils/introspectSql.js +4 -4
- 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 +3 -3
- package/package.json +11 -11
- package/dist/chunk-RR6BKMNO.js +0 -80
- 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
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var open_GFNXULGD_exports = {};
|
|
30
|
+
__export(open_GFNXULGD_exports, {
|
|
31
|
+
apps: () => apps,
|
|
32
|
+
default: () => open_default,
|
|
33
|
+
openApp: () => openApp
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(open_GFNXULGD_exports);
|
|
36
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
37
|
+
var import_node_fs = __toESM(require("node:fs"));
|
|
38
|
+
var import_node_fs2 = __toESM(require("node:fs"));
|
|
39
|
+
var import_node_process = __toESM(require("node:process"));
|
|
40
|
+
var import_node_os = __toESM(require("node:os"));
|
|
41
|
+
var import_node_fs3 = __toESM(require("node:fs"));
|
|
42
|
+
var import_node_process2 = __toESM(require("node:process"));
|
|
43
|
+
var import_promises = __toESM(require("node:fs/promises"));
|
|
44
|
+
var import_node_util = require("node:util");
|
|
45
|
+
var import_node_process3 = __toESM(require("node:process"));
|
|
46
|
+
var import_node_child_process = require("node:child_process");
|
|
47
|
+
var import_node_process4 = __toESM(require("node:process"));
|
|
48
|
+
var import_node_util2 = require("node:util");
|
|
49
|
+
var import_node_child_process2 = require("node:child_process");
|
|
50
|
+
var import_node_util3 = require("node:util");
|
|
51
|
+
var import_node_child_process3 = require("node:child_process");
|
|
52
|
+
var import_node_util4 = require("node:util");
|
|
53
|
+
var import_node_process5 = __toESM(require("node:process"));
|
|
54
|
+
var import_node_child_process4 = require("node:child_process");
|
|
55
|
+
var import_node_process6 = __toESM(require("node:process"));
|
|
56
|
+
var import_node_buffer = require("node:buffer");
|
|
57
|
+
var import_node_path = __toESM(require("node:path"));
|
|
58
|
+
var import_node_url = require("node:url");
|
|
59
|
+
var import_node_util5 = require("node:util");
|
|
60
|
+
var import_node_child_process5 = __toESM(require("node:child_process"));
|
|
61
|
+
var import_promises2 = __toESM(require("node:fs/promises"));
|
|
62
|
+
const import_meta = {};
|
|
63
|
+
function hasDockerEnv() {
|
|
64
|
+
try {
|
|
65
|
+
import_node_fs.default.statSync("/.dockerenv");
|
|
66
|
+
return true;
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function hasDockerCGroup() {
|
|
72
|
+
try {
|
|
73
|
+
return import_node_fs.default.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
74
|
+
} catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function isDocker() {
|
|
79
|
+
if (isDockerCached === void 0) {
|
|
80
|
+
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
81
|
+
}
|
|
82
|
+
return isDockerCached;
|
|
83
|
+
}
|
|
84
|
+
var isDockerCached;
|
|
85
|
+
var init_is_docker = (0, import_chunk_2ESYSVXG.__esm)({
|
|
86
|
+
"../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js"() {
|
|
87
|
+
"use strict";
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
function isInsideContainer() {
|
|
91
|
+
if (cachedResult === void 0) {
|
|
92
|
+
cachedResult = hasContainerEnv() || isDocker();
|
|
93
|
+
}
|
|
94
|
+
return cachedResult;
|
|
95
|
+
}
|
|
96
|
+
var cachedResult, hasContainerEnv;
|
|
97
|
+
var init_is_inside_container = (0, import_chunk_2ESYSVXG.__esm)({
|
|
98
|
+
"../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js"() {
|
|
99
|
+
"use strict";
|
|
100
|
+
init_is_docker();
|
|
101
|
+
hasContainerEnv = () => {
|
|
102
|
+
try {
|
|
103
|
+
import_node_fs2.default.statSync("/run/.containerenv");
|
|
104
|
+
return true;
|
|
105
|
+
} catch {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
var isWsl, is_wsl_default;
|
|
112
|
+
var init_is_wsl = (0, import_chunk_2ESYSVXG.__esm)({
|
|
113
|
+
"../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js"() {
|
|
114
|
+
"use strict";
|
|
115
|
+
init_is_inside_container();
|
|
116
|
+
isWsl = () => {
|
|
117
|
+
if (import_node_process.default.platform !== "linux") {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (import_node_os.default.release().toLowerCase().includes("microsoft")) {
|
|
121
|
+
if (isInsideContainer()) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
return import_node_fs3.default.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
128
|
+
} catch {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
is_wsl_default = import_node_process.default.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
var wslDrivesMountPoint, powerShellPathFromWsl, powerShellPath;
|
|
136
|
+
var init_wsl_utils = (0, import_chunk_2ESYSVXG.__esm)({
|
|
137
|
+
"../../node_modules/.pnpm/wsl-utils@0.1.0/node_modules/wsl-utils/index.js"() {
|
|
138
|
+
"use strict";
|
|
139
|
+
init_is_wsl();
|
|
140
|
+
init_is_wsl();
|
|
141
|
+
wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
142
|
+
const defaultMountPoint = "/mnt/";
|
|
143
|
+
let mountPoint;
|
|
144
|
+
return async function() {
|
|
145
|
+
if (mountPoint) {
|
|
146
|
+
return mountPoint;
|
|
147
|
+
}
|
|
148
|
+
const configFilePath = "/etc/wsl.conf";
|
|
149
|
+
let isConfigFileExists = false;
|
|
150
|
+
try {
|
|
151
|
+
await import_promises.default.access(configFilePath, import_promises.constants.F_OK);
|
|
152
|
+
isConfigFileExists = true;
|
|
153
|
+
} catch {
|
|
154
|
+
}
|
|
155
|
+
if (!isConfigFileExists) {
|
|
156
|
+
return defaultMountPoint;
|
|
157
|
+
}
|
|
158
|
+
const configContent = await import_promises.default.readFile(configFilePath, { encoding: "utf8" });
|
|
159
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
160
|
+
if (!configMountPoint) {
|
|
161
|
+
return defaultMountPoint;
|
|
162
|
+
}
|
|
163
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
164
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
165
|
+
return mountPoint;
|
|
166
|
+
};
|
|
167
|
+
})();
|
|
168
|
+
powerShellPathFromWsl = async () => {
|
|
169
|
+
const mountPoint = await wslDrivesMountPoint();
|
|
170
|
+
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
171
|
+
};
|
|
172
|
+
powerShellPath = async () => {
|
|
173
|
+
if (is_wsl_default) {
|
|
174
|
+
return powerShellPathFromWsl();
|
|
175
|
+
}
|
|
176
|
+
return `${import_node_process2.default.env.SYSTEMROOT || import_node_process2.default.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
181
|
+
const define = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
|
|
182
|
+
Object.defineProperty(object, propertyName, {
|
|
183
|
+
configurable: true,
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get() {
|
|
186
|
+
const result = valueGetter();
|
|
187
|
+
define(result);
|
|
188
|
+
return result;
|
|
189
|
+
},
|
|
190
|
+
set(value) {
|
|
191
|
+
define(value);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
return object;
|
|
195
|
+
}
|
|
196
|
+
var init_define_lazy_prop = (0, import_chunk_2ESYSVXG.__esm)({
|
|
197
|
+
"../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js"() {
|
|
198
|
+
"use strict";
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
async function defaultBrowserId() {
|
|
202
|
+
if (import_node_process3.default.platform !== "darwin") {
|
|
203
|
+
throw new Error("macOS only");
|
|
204
|
+
}
|
|
205
|
+
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
206
|
+
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
207
|
+
return match?.groups.id ?? "com.apple.Safari";
|
|
208
|
+
}
|
|
209
|
+
var execFileAsync;
|
|
210
|
+
var init_default_browser_id = (0, import_chunk_2ESYSVXG.__esm)({
|
|
211
|
+
"../../node_modules/.pnpm/default-browser-id@5.0.0/node_modules/default-browser-id/index.js"() {
|
|
212
|
+
"use strict";
|
|
213
|
+
execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
217
|
+
if (import_node_process4.default.platform !== "darwin") {
|
|
218
|
+
throw new Error("macOS only");
|
|
219
|
+
}
|
|
220
|
+
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
221
|
+
const execOptions = {};
|
|
222
|
+
if (signal) {
|
|
223
|
+
execOptions.signal = signal;
|
|
224
|
+
}
|
|
225
|
+
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
|
|
226
|
+
return stdout.trim();
|
|
227
|
+
}
|
|
228
|
+
var execFileAsync2;
|
|
229
|
+
var init_run_applescript = (0, import_chunk_2ESYSVXG.__esm)({
|
|
230
|
+
"../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js"() {
|
|
231
|
+
"use strict";
|
|
232
|
+
execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
async function bundleName(bundleId) {
|
|
236
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
237
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
238
|
+
}
|
|
239
|
+
var init_bundle_name = (0, import_chunk_2ESYSVXG.__esm)({
|
|
240
|
+
"../../node_modules/.pnpm/bundle-name@4.1.0/node_modules/bundle-name/index.js"() {
|
|
241
|
+
"use strict";
|
|
242
|
+
init_run_applescript();
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
246
|
+
const { stdout } = await _execFileAsync("reg", [
|
|
247
|
+
"QUERY",
|
|
248
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
249
|
+
"/v",
|
|
250
|
+
"ProgId"
|
|
251
|
+
]);
|
|
252
|
+
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
253
|
+
if (!match) {
|
|
254
|
+
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
255
|
+
}
|
|
256
|
+
const { id } = match.groups;
|
|
257
|
+
const browser = windowsBrowserProgIds[id];
|
|
258
|
+
if (!browser) {
|
|
259
|
+
throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
260
|
+
}
|
|
261
|
+
return browser;
|
|
262
|
+
}
|
|
263
|
+
var execFileAsync3, windowsBrowserProgIds, UnknownBrowserError;
|
|
264
|
+
var init_windows = (0, import_chunk_2ESYSVXG.__esm)({
|
|
265
|
+
"../../node_modules/.pnpm/default-browser@5.2.1/node_modules/default-browser/windows.js"() {
|
|
266
|
+
"use strict";
|
|
267
|
+
execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
|
|
268
|
+
windowsBrowserProgIds = {
|
|
269
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
270
|
+
MSEdgeDHTML: { name: "Edge", id: "com.microsoft.edge" },
|
|
271
|
+
// On macOS, it's "com.microsoft.edgemac"
|
|
272
|
+
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
273
|
+
// Newer Edge/Win10 releases
|
|
274
|
+
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" },
|
|
275
|
+
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
276
|
+
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
277
|
+
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
278
|
+
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
279
|
+
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" }
|
|
280
|
+
};
|
|
281
|
+
UnknownBrowserError = class extends Error {
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
async function defaultBrowser2() {
|
|
286
|
+
if (import_node_process5.default.platform === "darwin") {
|
|
287
|
+
const id = await defaultBrowserId();
|
|
288
|
+
const name = await bundleName(id);
|
|
289
|
+
return { name, id };
|
|
290
|
+
}
|
|
291
|
+
if (import_node_process5.default.platform === "linux") {
|
|
292
|
+
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
293
|
+
const id = stdout.trim();
|
|
294
|
+
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
295
|
+
return { name, id };
|
|
296
|
+
}
|
|
297
|
+
if (import_node_process5.default.platform === "win32") {
|
|
298
|
+
return defaultBrowser();
|
|
299
|
+
}
|
|
300
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
301
|
+
}
|
|
302
|
+
var execFileAsync4, titleize;
|
|
303
|
+
var init_default_browser = (0, import_chunk_2ESYSVXG.__esm)({
|
|
304
|
+
"../../node_modules/.pnpm/default-browser@5.2.1/node_modules/default-browser/index.js"() {
|
|
305
|
+
"use strict";
|
|
306
|
+
init_default_browser_id();
|
|
307
|
+
init_bundle_name();
|
|
308
|
+
init_windows();
|
|
309
|
+
execFileAsync4 = (0, import_node_util4.promisify)(import_node_child_process4.execFile);
|
|
310
|
+
titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
async function getWindowsDefaultBrowserFromWsl() {
|
|
314
|
+
const powershellPath = await powerShellPath();
|
|
315
|
+
const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
316
|
+
const encodedCommand = import_node_buffer.Buffer.from(rawCommand, "utf16le").toString("base64");
|
|
317
|
+
const { stdout } = await execFile5(
|
|
318
|
+
powershellPath,
|
|
319
|
+
[
|
|
320
|
+
"-NoProfile",
|
|
321
|
+
"-NonInteractive",
|
|
322
|
+
"-ExecutionPolicy",
|
|
323
|
+
"Bypass",
|
|
324
|
+
"-EncodedCommand",
|
|
325
|
+
encodedCommand
|
|
326
|
+
],
|
|
327
|
+
{ encoding: "utf8" }
|
|
328
|
+
);
|
|
329
|
+
const progId = stdout.trim();
|
|
330
|
+
const browserMap = {
|
|
331
|
+
ChromeHTML: "com.google.chrome",
|
|
332
|
+
BraveHTML: "com.brave.Browser",
|
|
333
|
+
MSEdgeHTM: "com.microsoft.edge",
|
|
334
|
+
FirefoxURL: "org.mozilla.firefox"
|
|
335
|
+
};
|
|
336
|
+
return browserMap[progId] ? { id: browserMap[progId] } : {};
|
|
337
|
+
}
|
|
338
|
+
function detectArchBinary(binary) {
|
|
339
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
340
|
+
return binary;
|
|
341
|
+
}
|
|
342
|
+
const { [arch]: archBinary } = binary;
|
|
343
|
+
if (!archBinary) {
|
|
344
|
+
throw new Error(`${arch} is not supported`);
|
|
345
|
+
}
|
|
346
|
+
return archBinary;
|
|
347
|
+
}
|
|
348
|
+
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
349
|
+
if (wsl && is_wsl_default) {
|
|
350
|
+
return detectArchBinary(wsl);
|
|
351
|
+
}
|
|
352
|
+
if (!platformBinary) {
|
|
353
|
+
throw new Error(`${platform} is not supported`);
|
|
354
|
+
}
|
|
355
|
+
return detectArchBinary(platformBinary);
|
|
356
|
+
}
|
|
357
|
+
var execFile5, __dirname, localXdgOpenPath, platform, arch, pTryEach, baseOpen, open, openApp, apps, open_default;
|
|
358
|
+
var init_open = (0, import_chunk_2ESYSVXG.__esm)({
|
|
359
|
+
"../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js"() {
|
|
360
|
+
init_wsl_utils();
|
|
361
|
+
init_define_lazy_prop();
|
|
362
|
+
init_default_browser();
|
|
363
|
+
init_is_inside_container();
|
|
364
|
+
execFile5 = (0, import_node_util5.promisify)(import_node_child_process5.default.execFile);
|
|
365
|
+
__dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
366
|
+
localXdgOpenPath = import_node_path.default.join(__dirname, "xdg-open");
|
|
367
|
+
({ platform, arch } = import_node_process6.default);
|
|
368
|
+
pTryEach = async (array, mapper) => {
|
|
369
|
+
let latestError;
|
|
370
|
+
for (const item of array) {
|
|
371
|
+
try {
|
|
372
|
+
return await mapper(item);
|
|
373
|
+
} catch (error) {
|
|
374
|
+
latestError = error;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
throw latestError;
|
|
378
|
+
};
|
|
379
|
+
baseOpen = async (options) => {
|
|
380
|
+
options = {
|
|
381
|
+
wait: false,
|
|
382
|
+
background: false,
|
|
383
|
+
newInstance: false,
|
|
384
|
+
allowNonzeroExitCode: false,
|
|
385
|
+
...options
|
|
386
|
+
};
|
|
387
|
+
if (Array.isArray(options.app)) {
|
|
388
|
+
return pTryEach(options.app, (singleApp) => baseOpen({
|
|
389
|
+
...options,
|
|
390
|
+
app: singleApp
|
|
391
|
+
}));
|
|
392
|
+
}
|
|
393
|
+
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
394
|
+
appArguments = [...appArguments];
|
|
395
|
+
if (Array.isArray(app)) {
|
|
396
|
+
return pTryEach(app, (appName) => baseOpen({
|
|
397
|
+
...options,
|
|
398
|
+
app: {
|
|
399
|
+
name: appName,
|
|
400
|
+
arguments: appArguments
|
|
401
|
+
}
|
|
402
|
+
}));
|
|
403
|
+
}
|
|
404
|
+
if (app === "browser" || app === "browserPrivate") {
|
|
405
|
+
const ids = {
|
|
406
|
+
"com.google.chrome": "chrome",
|
|
407
|
+
"google-chrome.desktop": "chrome",
|
|
408
|
+
"com.brave.Browser": "brave",
|
|
409
|
+
"org.mozilla.firefox": "firefox",
|
|
410
|
+
"firefox.desktop": "firefox",
|
|
411
|
+
"com.microsoft.msedge": "edge",
|
|
412
|
+
"com.microsoft.edge": "edge",
|
|
413
|
+
"com.microsoft.edgemac": "edge",
|
|
414
|
+
"microsoft-edge.desktop": "edge"
|
|
415
|
+
};
|
|
416
|
+
const flags = {
|
|
417
|
+
chrome: "--incognito",
|
|
418
|
+
brave: "--incognito",
|
|
419
|
+
firefox: "--private-window",
|
|
420
|
+
edge: "--inPrivate"
|
|
421
|
+
};
|
|
422
|
+
const browser = is_wsl_default ? await getWindowsDefaultBrowserFromWsl() : await defaultBrowser2();
|
|
423
|
+
if (browser.id in ids) {
|
|
424
|
+
const browserName = ids[browser.id];
|
|
425
|
+
if (app === "browserPrivate") {
|
|
426
|
+
appArguments.push(flags[browserName]);
|
|
427
|
+
}
|
|
428
|
+
return baseOpen({
|
|
429
|
+
...options,
|
|
430
|
+
app: {
|
|
431
|
+
name: apps[browserName],
|
|
432
|
+
arguments: appArguments
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
437
|
+
}
|
|
438
|
+
let command;
|
|
439
|
+
const cliArguments = [];
|
|
440
|
+
const childProcessOptions = {};
|
|
441
|
+
if (platform === "darwin") {
|
|
442
|
+
command = "open";
|
|
443
|
+
if (options.wait) {
|
|
444
|
+
cliArguments.push("--wait-apps");
|
|
445
|
+
}
|
|
446
|
+
if (options.background) {
|
|
447
|
+
cliArguments.push("--background");
|
|
448
|
+
}
|
|
449
|
+
if (options.newInstance) {
|
|
450
|
+
cliArguments.push("--new");
|
|
451
|
+
}
|
|
452
|
+
if (app) {
|
|
453
|
+
cliArguments.push("-a", app);
|
|
454
|
+
}
|
|
455
|
+
} else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
|
|
456
|
+
command = await powerShellPath();
|
|
457
|
+
cliArguments.push(
|
|
458
|
+
"-NoProfile",
|
|
459
|
+
"-NonInteractive",
|
|
460
|
+
"-ExecutionPolicy",
|
|
461
|
+
"Bypass",
|
|
462
|
+
"-EncodedCommand"
|
|
463
|
+
);
|
|
464
|
+
if (!is_wsl_default) {
|
|
465
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
466
|
+
}
|
|
467
|
+
const encodedArguments = ["Start"];
|
|
468
|
+
if (options.wait) {
|
|
469
|
+
encodedArguments.push("-Wait");
|
|
470
|
+
}
|
|
471
|
+
if (app) {
|
|
472
|
+
encodedArguments.push(`"\`"${app}\`""`);
|
|
473
|
+
if (options.target) {
|
|
474
|
+
appArguments.push(options.target);
|
|
475
|
+
}
|
|
476
|
+
} else if (options.target) {
|
|
477
|
+
encodedArguments.push(`"${options.target}"`);
|
|
478
|
+
}
|
|
479
|
+
if (appArguments.length > 0) {
|
|
480
|
+
appArguments = appArguments.map((argument) => `"\`"${argument}\`""`);
|
|
481
|
+
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
482
|
+
}
|
|
483
|
+
options.target = import_node_buffer.Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
484
|
+
} else {
|
|
485
|
+
if (app) {
|
|
486
|
+
command = app;
|
|
487
|
+
} else {
|
|
488
|
+
const isBundled = !__dirname || __dirname === "/";
|
|
489
|
+
let exeLocalXdgOpen = false;
|
|
490
|
+
try {
|
|
491
|
+
await import_promises2.default.access(localXdgOpenPath, import_promises2.constants.X_OK);
|
|
492
|
+
exeLocalXdgOpen = true;
|
|
493
|
+
} catch {
|
|
494
|
+
}
|
|
495
|
+
const useSystemXdgOpen = import_node_process6.default.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
496
|
+
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
497
|
+
}
|
|
498
|
+
if (appArguments.length > 0) {
|
|
499
|
+
cliArguments.push(...appArguments);
|
|
500
|
+
}
|
|
501
|
+
if (!options.wait) {
|
|
502
|
+
childProcessOptions.stdio = "ignore";
|
|
503
|
+
childProcessOptions.detached = true;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
if (platform === "darwin" && appArguments.length > 0) {
|
|
507
|
+
cliArguments.push("--args", ...appArguments);
|
|
508
|
+
}
|
|
509
|
+
if (options.target) {
|
|
510
|
+
cliArguments.push(options.target);
|
|
511
|
+
}
|
|
512
|
+
const subprocess = import_node_child_process5.default.spawn(command, cliArguments, childProcessOptions);
|
|
513
|
+
if (options.wait) {
|
|
514
|
+
return new Promise((resolve, reject) => {
|
|
515
|
+
subprocess.once("error", reject);
|
|
516
|
+
subprocess.once("close", (exitCode) => {
|
|
517
|
+
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
518
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
resolve(subprocess);
|
|
522
|
+
});
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
subprocess.unref();
|
|
526
|
+
return subprocess;
|
|
527
|
+
};
|
|
528
|
+
open = (target, options) => {
|
|
529
|
+
if (typeof target !== "string") {
|
|
530
|
+
throw new TypeError("Expected a `target`");
|
|
531
|
+
}
|
|
532
|
+
return baseOpen({
|
|
533
|
+
...options,
|
|
534
|
+
target
|
|
535
|
+
});
|
|
536
|
+
};
|
|
537
|
+
openApp = (name, options) => {
|
|
538
|
+
if (typeof name !== "string" && !Array.isArray(name)) {
|
|
539
|
+
throw new TypeError("Expected a valid `name`");
|
|
540
|
+
}
|
|
541
|
+
const { arguments: appArguments = [] } = options ?? {};
|
|
542
|
+
if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
|
|
543
|
+
throw new TypeError("Expected `appArguments` as Array type");
|
|
544
|
+
}
|
|
545
|
+
return baseOpen({
|
|
546
|
+
...options,
|
|
547
|
+
app: {
|
|
548
|
+
name,
|
|
549
|
+
arguments: appArguments
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
apps = {};
|
|
554
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
555
|
+
darwin: "google chrome",
|
|
556
|
+
win32: "chrome",
|
|
557
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
558
|
+
}, {
|
|
559
|
+
wsl: {
|
|
560
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
561
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
562
|
+
}
|
|
563
|
+
}));
|
|
564
|
+
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
565
|
+
darwin: "brave browser",
|
|
566
|
+
win32: "brave",
|
|
567
|
+
linux: ["brave-browser", "brave"]
|
|
568
|
+
}, {
|
|
569
|
+
wsl: {
|
|
570
|
+
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
571
|
+
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
572
|
+
}
|
|
573
|
+
}));
|
|
574
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
575
|
+
darwin: "firefox",
|
|
576
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
577
|
+
linux: "firefox"
|
|
578
|
+
}, {
|
|
579
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
580
|
+
}));
|
|
581
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
582
|
+
darwin: "microsoft edge",
|
|
583
|
+
win32: "msedge",
|
|
584
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
585
|
+
}, {
|
|
586
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
587
|
+
}));
|
|
588
|
+
defineLazyProperty(apps, "browser", () => "browser");
|
|
589
|
+
defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
|
|
590
|
+
open_default = open;
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
init_open();
|
|
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var getDatabaseVersionSafe_exports = {};
|
|
20
20
|
__export(getDatabaseVersionSafe_exports, {
|
|
21
|
-
getDatabaseVersionSafe: () =>
|
|
21
|
+
getDatabaseVersionSafe: () => import_chunk_LNQIFWXN.getDatabaseVersionSafe
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(getDatabaseVersionSafe_exports);
|
|
24
|
-
var
|
|
25
|
-
var
|
|
24
|
+
var import_chunk_LNQIFWXN = require("../chunk-LNQIFWXN.js");
|
|
25
|
+
var import_chunk_V5D5NSLS = require("../chunk-V5D5NSLS.js");
|
|
26
|
+
var import_chunk_JX2HIV7V = require("../chunk-JX2HIV7V.js");
|
|
26
27
|
var import_chunk_T64SUJ5L = require("../chunk-T64SUJ5L.js");
|
|
27
|
-
var import_chunk_VV4M6AN7 = require("../chunk-VV4M6AN7.js");
|
|
28
28
|
var import_chunk_GGA2F64G = require("../chunk-GGA2F64G.js");
|
|
29
29
|
var import_chunk_23DZXSTI = require("../chunk-23DZXSTI.js");
|
|
30
30
|
var import_chunk_3WDCTXHL = require("../chunk-3WDCTXHL.js");
|
|
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var introspectSql_exports = {};
|
|
20
20
|
__export(introspectSql_exports, {
|
|
21
|
-
introspectSql: () =>
|
|
21
|
+
introspectSql: () => import_chunk_JVGKTJYZ.introspectSql
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(introspectSql_exports);
|
|
24
|
-
var
|
|
25
|
-
var
|
|
24
|
+
var import_chunk_JVGKTJYZ = require("../chunk-JVGKTJYZ.js");
|
|
25
|
+
var import_chunk_V5D5NSLS = require("../chunk-V5D5NSLS.js");
|
|
26
|
+
var import_chunk_JX2HIV7V = require("../chunk-JX2HIV7V.js");
|
|
26
27
|
var import_chunk_T64SUJ5L = require("../chunk-T64SUJ5L.js");
|
|
27
|
-
var import_chunk_VV4M6AN7 = require("../chunk-VV4M6AN7.js");
|
|
28
28
|
var import_chunk_GGA2F64G = require("../chunk-GGA2F64G.js");
|
|
29
29
|
var import_chunk_23DZXSTI = require("../chunk-23DZXSTI.js");
|
|
30
30
|
var import_chunk_3WDCTXHL = require("../chunk-3WDCTXHL.js");
|
package/dist/utils/seed.js
CHANGED
|
@@ -18,11 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var seed_exports = {};
|
|
20
20
|
__export(seed_exports, {
|
|
21
|
-
executeSeedCommand: () =>
|
|
22
|
-
getSeedCommandFromPackageJson: () => import_chunk_PHXLQVPT.getSeedCommandFromPackageJson
|
|
21
|
+
executeSeedCommand: () => import_chunk_L7EZFBB4.executeSeedCommand
|
|
23
22
|
});
|
|
24
23
|
module.exports = __toCommonJS(seed_exports);
|
|
25
|
-
var
|
|
24
|
+
var import_chunk_L7EZFBB4 = require("../chunk-L7EZFBB4.js");
|
|
26
25
|
var import_chunk_3WDCTXHL = require("../chunk-3WDCTXHL.js");
|
|
27
26
|
var import_chunk_SKRR5WT4 = require("../chunk-SKRR5WT4.js");
|
|
28
27
|
var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
|
|
@@ -32,12 +32,12 @@ __export(setupCockroach_exports, {
|
|
|
32
32
|
tearDownCockroach: () => tearDownCockroach
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(setupCockroach_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_XA2JOJS2 = require("../chunk-XA2JOJS2.js");
|
|
36
36
|
var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
|
|
37
37
|
var import_internals = require("@prisma/internals");
|
|
38
38
|
var import_fs = __toESM(require("fs"));
|
|
39
39
|
var import_path = __toESM(require("path"));
|
|
40
|
-
var import_pg = (0, import_chunk_2ESYSVXG.__toESM)((0,
|
|
40
|
+
var import_pg = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_XA2JOJS2.require_lib)());
|
|
41
41
|
async function setupCockroach(options) {
|
|
42
42
|
const { connectionString } = options;
|
|
43
43
|
const { dirname } = options;
|