@prisma/migrate 6.19.0-integration-next.13 → 6.19.0-integration-feat-remove-library-engine.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/Migrate.js +3 -3
  2. package/dist/bin.js +24 -24
  3. package/dist/{chunk-UJA5DXI3.js → chunk-2Z63R7HP.js} +5 -5
  4. package/dist/{chunk-4LNQFWQD.js → chunk-3VYHMV3C.js} +5 -5
  5. package/dist/{chunk-NG4757TP.js → chunk-45NSU26W.js} +6 -6
  6. package/dist/{chunk-OP2BDF75.js → chunk-FRY7T46S.js} +10 -11
  7. package/dist/{chunk-XAPRGBTZ.js → chunk-JVGKTJYZ.js} +5 -5
  8. package/dist/{chunk-VV4M6AN7.js → chunk-JX2HIV7V.js} +10 -10
  9. package/dist/{chunk-Q66L2LFA.js → chunk-L7EZXEMS.js} +5 -5
  10. package/dist/{chunk-SIUB4YHK.js → chunk-LNQIFWXN.js} +5 -5
  11. package/dist/{chunk-HDTRNRXE.js → chunk-O57XJHDD.js} +62 -39
  12. package/dist/{chunk-ANMWKEMD.js → chunk-PJYHZKCF.js} +5 -5
  13. package/dist/{chunk-OPD3GTJ2.js → chunk-QZUMMKCI.js} +7 -7
  14. package/dist/{chunk-VU5BLQUI.js → chunk-T2ACIU5M.js} +14 -8
  15. package/dist/{chunk-AP47ZTTC.js → chunk-TCBZUTEL.js} +5 -5
  16. package/dist/{chunk-CQLPPAWH.js → chunk-URVKYSZJ.js} +5 -5
  17. package/dist/{chunk-MOFG2YPJ.js → chunk-V5D5NSLS.js} +32 -22
  18. package/dist/{chunk-QVMYNWAN.js → chunk-XA2JOJS2.js} +157 -70
  19. package/dist/commands/DbExecute.js +4 -4
  20. package/dist/commands/DbPull.js +5 -5
  21. package/dist/commands/DbPush.js +4 -4
  22. package/dist/commands/MigrateDeploy.js +4 -4
  23. package/dist/commands/MigrateDev.js +4 -4
  24. package/dist/commands/MigrateDiff.js +4 -4
  25. package/dist/commands/MigrateReset.js +4 -4
  26. package/dist/commands/MigrateResolve.js +4 -4
  27. package/dist/commands/MigrateStatus.js +4 -4
  28. package/dist/index.js +26 -26
  29. package/dist/open-GFNXULGD.js +593 -0
  30. package/dist/utils/getDatabaseVersionSafe.js +4 -4
  31. package/dist/utils/introspectSql.js +4 -4
  32. package/dist/utils/setupCockroach.js +2 -2
  33. package/dist/utils/setupMSSQL.js +30734 -30124
  34. package/dist/utils/setupMongo.js +2048 -768
  35. package/dist/utils/setupPostgres.js +2 -2
  36. package/dist/utils/spinner.js +3 -3
  37. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -20,46 +20,46 @@ var index_exports = {};
20
20
  __export(index_exports, {
21
21
  DbCommand: () => import_chunk_EJG7GKM7.DbCommand,
22
22
  DbDrop: () => import_chunk_43R3GFIU.DbDrop,
23
- DbExecute: () => import_chunk_AP47ZTTC.DbExecute,
24
- DbPull: () => import_chunk_OPD3GTJ2.DbPull,
25
- DbPush: () => import_chunk_CQLPPAWH.DbPush,
23
+ DbExecute: () => import_chunk_TCBZUTEL.DbExecute,
24
+ DbPull: () => import_chunk_QZUMMKCI.DbPull,
25
+ DbPush: () => import_chunk_URVKYSZJ.DbPush,
26
26
  DbSeed: () => import_chunk_W2NKGYXF.DbSeed,
27
27
  EngineResults: () => import_chunk_LVR7W5DD.EngineResults,
28
- Migrate: () => import_chunk_MOFG2YPJ.Migrate,
28
+ Migrate: () => import_chunk_V5D5NSLS.Migrate,
29
29
  MigrateCommand: () => import_chunk_LLO7YF56.MigrateCommand,
30
- MigrateDeploy: () => import_chunk_ANMWKEMD.MigrateDeploy,
31
- MigrateDev: () => import_chunk_4LNQFWQD.MigrateDev,
32
- MigrateDiff: () => import_chunk_HDTRNRXE.MigrateDiff,
33
- MigrateReset: () => import_chunk_UJA5DXI3.MigrateReset,
34
- MigrateResolve: () => import_chunk_NG4757TP.MigrateResolve,
35
- MigrateStatus: () => import_chunk_Q66L2LFA.MigrateStatus,
30
+ MigrateDeploy: () => import_chunk_PJYHZKCF.MigrateDeploy,
31
+ MigrateDev: () => import_chunk_3VYHMV3C.MigrateDev,
32
+ MigrateDiff: () => import_chunk_O57XJHDD.MigrateDiff,
33
+ MigrateReset: () => import_chunk_2Z63R7HP.MigrateReset,
34
+ MigrateResolve: () => import_chunk_45NSU26W.MigrateResolve,
35
+ MigrateStatus: () => import_chunk_L7EZXEMS.MigrateStatus,
36
36
  SchemaEngineCLI: () => import_chunk_GSX25HRL.SchemaEngineCLI,
37
37
  SchemaEngineWasm: () => import_chunk_22YP3RXZ.SchemaEngineWasm,
38
38
  byline: () => import_chunk_L6KOIJJ5.byline,
39
- getDatabaseVersionSafe: () => import_chunk_SIUB4YHK.getDatabaseVersionSafe,
40
- introspectSql: () => import_chunk_XAPRGBTZ.introspectSql
39
+ getDatabaseVersionSafe: () => import_chunk_LNQIFWXN.getDatabaseVersionSafe,
40
+ introspectSql: () => import_chunk_JVGKTJYZ.introspectSql
41
41
  });
42
42
  module.exports = __toCommonJS(index_exports);
43
- var import_chunk_XAPRGBTZ = require("./chunk-XAPRGBTZ.js");
43
+ var import_chunk_JVGKTJYZ = require("./chunk-JVGKTJYZ.js");
44
44
  var import_chunk_LVR7W5DD = require("./chunk-LVR7W5DD.js");
45
45
  var import_chunk_43R3GFIU = require("./chunk-43R3GFIU.js");
46
46
  var import_chunk_IHDN3L3R = require("./chunk-IHDN3L3R.js");
47
- var import_chunk_SIUB4YHK = require("./chunk-SIUB4YHK.js");
48
- var import_chunk_ANMWKEMD = require("./chunk-ANMWKEMD.js");
49
- var import_chunk_4LNQFWQD = require("./chunk-4LNQFWQD.js");
47
+ var import_chunk_LNQIFWXN = require("./chunk-LNQIFWXN.js");
48
+ var import_chunk_PJYHZKCF = require("./chunk-PJYHZKCF.js");
49
+ var import_chunk_3VYHMV3C = require("./chunk-3VYHMV3C.js");
50
50
  var import_chunk_C3722PDA = require("./chunk-C3722PDA.js");
51
51
  var import_chunk_7CQBDP4H = require("./chunk-7CQBDP4H.js");
52
- var import_chunk_HDTRNRXE = require("./chunk-HDTRNRXE.js");
52
+ var import_chunk_O57XJHDD = require("./chunk-O57XJHDD.js");
53
53
  var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
54
- var import_chunk_UJA5DXI3 = require("./chunk-UJA5DXI3.js");
54
+ var import_chunk_2Z63R7HP = require("./chunk-2Z63R7HP.js");
55
55
  var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
56
56
  var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
57
- var import_chunk_NG4757TP = require("./chunk-NG4757TP.js");
58
- var import_chunk_Q66L2LFA = require("./chunk-Q66L2LFA.js");
57
+ var import_chunk_45NSU26W = require("./chunk-45NSU26W.js");
58
+ var import_chunk_L7EZXEMS = require("./chunk-L7EZXEMS.js");
59
59
  var import_chunk_EJG7GKM7 = require("./chunk-EJG7GKM7.js");
60
- var import_chunk_AP47ZTTC = require("./chunk-AP47ZTTC.js");
61
- var import_chunk_OPD3GTJ2 = require("./chunk-OPD3GTJ2.js");
62
- var import_chunk_VU5BLQUI = require("./chunk-VU5BLQUI.js");
60
+ var import_chunk_TCBZUTEL = require("./chunk-TCBZUTEL.js");
61
+ var import_chunk_QZUMMKCI = require("./chunk-QZUMMKCI.js");
62
+ var import_chunk_T2ACIU5M = require("./chunk-T2ACIU5M.js");
63
63
  var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
64
64
  var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
65
65
  var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
@@ -67,7 +67,7 @@ var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
67
67
  var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
68
68
  var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
69
69
  var import_chunk_2R6DII47 = require("./chunk-2R6DII47.js");
70
- var import_chunk_CQLPPAWH = require("./chunk-CQLPPAWH.js");
70
+ var import_chunk_URVKYSZJ = require("./chunk-URVKYSZJ.js");
71
71
  var import_chunk_FBDQVK4W = require("./chunk-FBDQVK4W.js");
72
72
  var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
73
73
  var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
@@ -76,8 +76,8 @@ var import_chunk_TWPTG4XS = require("./chunk-TWPTG4XS.js");
76
76
  var import_chunk_W2NKGYXF = require("./chunk-W2NKGYXF.js");
77
77
  var import_chunk_L7EZFBB4 = require("./chunk-L7EZFBB4.js");
78
78
  var import_chunk_LLO7YF56 = require("./chunk-LLO7YF56.js");
79
- var import_chunk_MOFG2YPJ = require("./chunk-MOFG2YPJ.js");
80
- var import_chunk_VV4M6AN7 = require("./chunk-VV4M6AN7.js");
79
+ var import_chunk_V5D5NSLS = require("./chunk-V5D5NSLS.js");
80
+ var import_chunk_JX2HIV7V = require("./chunk-JX2HIV7V.js");
81
81
  var import_chunk_T64SUJ5L = require("./chunk-T64SUJ5L.js");
82
82
  var import_chunk_GGA2F64G = require("./chunk-GGA2F64G.js");
83
83
  var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
@@ -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();