rsbuild-plugin-cloudflare 0.0.6 → 0.0.8
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/README.md +4 -0
- package/dist/additional-modules-CyA1Cd2t.mjs +44062 -0
- package/dist/constants-BSTDVDmV.mjs +8 -0
- package/dist/index.d.mts +0 -6
- package/dist/index.mjs +1592 -80697
- package/dist/miniflare-options-BxJnuymv.mjs +73 -0
- package/dist/miniflare-options-CXTX1Ld-.mjs +14256 -0
- package/dist/{open-NPEHYJ5T-CLdHWlOO.mjs → open-BPppUKSJ-BoP51JHy.mjs} +97 -118
- package/dist/{package-gWrKQHzY.mjs → package-C7Up3cPo.mjs} +4 -6
- package/dist/request-handler-n9oFuRPf.mjs +254 -0
- package/dist/rolldown-runtime-BMUeFane-BXI4m9DX.mjs +29 -0
- package/dist/rolldown-runtime-DegdyBIC.mjs +25 -0
- package/dist/shared-BgcTKVNO.mjs +5 -0
- package/dist/websockets-BRFceXs5.mjs +88 -0
- package/dist/workers/asset-worker/index.js +131 -266
- package/dist/workers/asset-worker/index.js.map +1 -1
- package/dist/workers/router-worker/index.js +94 -202
- package/dist/workers/router-worker/index.js.map +1 -1
- package/dist/workers/runner-worker/index.js +26 -30
- package/dist/workers/runner-worker/index.js.map +1 -1
- package/dist/workers/runner-worker/module-runner-legacy.js +61 -18
- package/dist/workers/runner-worker/module-runner-legacy.js.map +1 -1
- package/dist/workers/runner-worker/module-runner.js +104 -54
- package/dist/workers/runner-worker/module-runner.js.map +1 -1
- package/dist/workers/vite-proxy-worker/index.js +1 -2
- package/dist/workers/vite-proxy-worker/index.js.map +1 -1
- package/package.json +9 -9
- package/dist/chunk-53YJWLG7-_ps118Xl.mjs +0 -43
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createRequire } from "node:module";
|
|
1
|
+
import { n as __name } from "./rolldown-runtime-BMUeFane-BXI4m9DX.mjs";
|
|
3
2
|
import fs from "node:fs";
|
|
4
|
-
import
|
|
3
|
+
import fs$1, { constants } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { promisify } from "node:util";
|
|
7
|
-
import process
|
|
6
|
+
import process from "node:process";
|
|
8
7
|
import os from "node:os";
|
|
9
8
|
import { fileURLToPath } from "node:url";
|
|
10
9
|
import { Buffer } from "node:buffer";
|
|
11
10
|
import childProcess, { execFile } from "node:child_process";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
15
|
-
var isDockerCached;
|
|
11
|
+
// ../../workers-sdk/packages/workers-utils/dist/open-BPppUKSJ.mjs
|
|
12
|
+
let isDockerCached;
|
|
16
13
|
function hasDockerEnv() {
|
|
17
14
|
try {
|
|
18
15
|
fs.statSync("/.dockerenv");
|
|
@@ -21,7 +18,6 @@ function hasDockerEnv() {
|
|
|
21
18
|
return false;
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
__name(hasDockerEnv, "hasDockerEnv");
|
|
25
21
|
function hasDockerCGroup() {
|
|
26
22
|
try {
|
|
27
23
|
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
@@ -29,28 +25,25 @@ function hasDockerCGroup() {
|
|
|
29
25
|
return false;
|
|
30
26
|
}
|
|
31
27
|
}
|
|
32
|
-
__name(hasDockerCGroup, "hasDockerCGroup");
|
|
33
28
|
function isDocker() {
|
|
34
29
|
if (isDockerCached === void 0) isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
35
30
|
return isDockerCached;
|
|
36
31
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var hasContainerEnv = /* @__PURE__ */ __name(() => {
|
|
32
|
+
let cachedResult;
|
|
33
|
+
const hasContainerEnv = () => {
|
|
40
34
|
try {
|
|
41
35
|
fs.statSync("/run/.containerenv");
|
|
42
36
|
return true;
|
|
43
37
|
} catch {
|
|
44
38
|
return false;
|
|
45
39
|
}
|
|
46
|
-
}
|
|
40
|
+
};
|
|
47
41
|
function isInsideContainer() {
|
|
48
42
|
if (cachedResult === void 0) cachedResult = hasContainerEnv() || isDocker();
|
|
49
43
|
return cachedResult;
|
|
50
44
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (process$1.platform !== "linux") return false;
|
|
45
|
+
const isWsl = () => {
|
|
46
|
+
if (process.platform !== "linux") return false;
|
|
54
47
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
55
48
|
if (isInsideContainer()) return false;
|
|
56
49
|
return true;
|
|
@@ -60,18 +53,18 @@ var isWsl = /* @__PURE__ */ __name(() => {
|
|
|
60
53
|
} catch {
|
|
61
54
|
return false;
|
|
62
55
|
}
|
|
63
|
-
}
|
|
64
|
-
var is_wsl_default = process
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const { powerShellPath: psPath
|
|
56
|
+
};
|
|
57
|
+
var is_wsl_default = process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
58
|
+
const execFile$2 = promisify(childProcess.execFile);
|
|
59
|
+
const powerShellPath$1 = /* @__PURE__ */ __name(() => `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, "powerShellPath");
|
|
60
|
+
const executePowerShell = async (command, options = {}) => {
|
|
61
|
+
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
69
62
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
70
|
-
return execFile$
|
|
63
|
+
return execFile$2(psPath ?? powerShellPath$1(), [...executePowerShell.argumentsPrefix, encodedCommand], {
|
|
71
64
|
encoding: "utf8",
|
|
72
65
|
...execFileOptions
|
|
73
66
|
});
|
|
74
|
-
}
|
|
67
|
+
};
|
|
75
68
|
executePowerShell.argumentsPrefix = [
|
|
76
69
|
"-NoProfile",
|
|
77
70
|
"-NonInteractive",
|
|
@@ -89,9 +82,8 @@ function parseMountPointFromConfig(content) {
|
|
|
89
82
|
return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
90
83
|
}
|
|
91
84
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
85
|
+
const execFile$1 = promisify(childProcess.execFile);
|
|
86
|
+
const wslDrivesMountPoint = (() => {
|
|
95
87
|
const defaultMountPoint = "/mnt/";
|
|
96
88
|
let mountPoint;
|
|
97
89
|
return async function() {
|
|
@@ -99,53 +91,55 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
|
99
91
|
const configFilePath = "/etc/wsl.conf";
|
|
100
92
|
let isConfigFileExists = false;
|
|
101
93
|
try {
|
|
102
|
-
await
|
|
94
|
+
await fs$1.access(configFilePath, constants.F_OK);
|
|
103
95
|
isConfigFileExists = true;
|
|
104
96
|
} catch {}
|
|
105
97
|
if (!isConfigFileExists) return defaultMountPoint;
|
|
106
|
-
const parsedMountPoint = parseMountPointFromConfig(await
|
|
98
|
+
const parsedMountPoint = parseMountPointFromConfig(await fs$1.readFile(configFilePath, { encoding: "utf8" }));
|
|
107
99
|
if (parsedMountPoint === void 0) return defaultMountPoint;
|
|
108
100
|
mountPoint = parsedMountPoint;
|
|
109
101
|
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
110
102
|
return mountPoint;
|
|
111
103
|
};
|
|
112
104
|
})();
|
|
113
|
-
|
|
105
|
+
const powerShellPathFromWsl = async () => {
|
|
114
106
|
return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
107
|
+
};
|
|
108
|
+
const powerShellPath = is_wsl_default ? powerShellPathFromWsl : powerShellPath$1;
|
|
109
|
+
let canAccessPowerShellPromise;
|
|
110
|
+
const canAccessPowerShell = async () => {
|
|
118
111
|
canAccessPowerShellPromise ??= (async () => {
|
|
119
112
|
try {
|
|
120
|
-
const psPath = await
|
|
121
|
-
await
|
|
113
|
+
const psPath = await powerShellPath();
|
|
114
|
+
await fs$1.access(psPath, constants.X_OK);
|
|
122
115
|
return true;
|
|
123
116
|
} catch {
|
|
124
117
|
return false;
|
|
125
118
|
}
|
|
126
119
|
})();
|
|
127
120
|
return canAccessPowerShellPromise;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const psPath = await
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
121
|
+
};
|
|
122
|
+
const wslDefaultBrowser = async () => {
|
|
123
|
+
const psPath = await powerShellPath();
|
|
124
|
+
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
125
|
+
const { stdout } = await executePowerShell(command, { powerShellPath: psPath });
|
|
126
|
+
return stdout.trim();
|
|
127
|
+
};
|
|
128
|
+
const convertWslPathToWindows = async (path) => {
|
|
129
|
+
if (/^[a-z]+:\/\//i.test(path)) return path;
|
|
136
130
|
try {
|
|
137
|
-
const { stdout
|
|
138
|
-
return stdout
|
|
131
|
+
const { stdout } = await execFile$1("wslpath", ["-aw", path], { encoding: "utf8" });
|
|
132
|
+
return stdout.trim();
|
|
139
133
|
} catch {
|
|
140
|
-
return
|
|
134
|
+
return path;
|
|
141
135
|
}
|
|
142
|
-
}
|
|
136
|
+
};
|
|
143
137
|
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
144
|
-
const define =
|
|
138
|
+
const define = (value) => Object.defineProperty(object, propertyName, {
|
|
145
139
|
value,
|
|
146
140
|
enumerable: true,
|
|
147
141
|
writable: true
|
|
148
|
-
})
|
|
142
|
+
});
|
|
149
143
|
Object.defineProperty(object, propertyName, {
|
|
150
144
|
configurable: true,
|
|
151
145
|
enumerable: true,
|
|
@@ -160,41 +154,36 @@ function defineLazyProperty(object, propertyName, valueGetter) {
|
|
|
160
154
|
});
|
|
161
155
|
return object;
|
|
162
156
|
}
|
|
163
|
-
|
|
164
|
-
var execFileAsync = promisify(execFile);
|
|
157
|
+
const execFileAsync$3 = promisify(execFile);
|
|
165
158
|
async function defaultBrowserId() {
|
|
166
|
-
if (process
|
|
167
|
-
const { stdout
|
|
159
|
+
if (process.platform !== "darwin") throw new Error("macOS only");
|
|
160
|
+
const { stdout } = await execFileAsync$3("defaults", [
|
|
168
161
|
"read",
|
|
169
162
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
170
163
|
"LSHandlers"
|
|
171
164
|
]);
|
|
172
|
-
const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout
|
|
165
|
+
const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout)?.groups.id ?? "com.apple.Safari";
|
|
173
166
|
if (browserId === "com.apple.safari") return "com.apple.Safari";
|
|
174
167
|
return browserId;
|
|
175
168
|
}
|
|
176
|
-
|
|
177
|
-
var execFileAsync2 = promisify(execFile);
|
|
169
|
+
const execFileAsync$2 = promisify(execFile);
|
|
178
170
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
179
|
-
if (process
|
|
171
|
+
if (process.platform !== "darwin") throw new Error("macOS only");
|
|
180
172
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
181
173
|
const execOptions = {};
|
|
182
174
|
if (signal) execOptions.signal = signal;
|
|
183
|
-
const { stdout
|
|
175
|
+
const { stdout } = await execFileAsync$2("osascript", [
|
|
184
176
|
"-e",
|
|
185
177
|
script,
|
|
186
178
|
outputArguments
|
|
187
179
|
], execOptions);
|
|
188
|
-
return stdout
|
|
180
|
+
return stdout.trim();
|
|
189
181
|
}
|
|
190
|
-
__name(runAppleScript, "runAppleScript");
|
|
191
182
|
async function bundleName(bundleId) {
|
|
192
|
-
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
193
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
183
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
194
184
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
var windowsBrowserProgIds = {
|
|
185
|
+
const execFileAsync$1 = promisify(execFile);
|
|
186
|
+
const windowsBrowserProgIds = {
|
|
198
187
|
MSEdgeHTM: {
|
|
199
188
|
name: "Edge",
|
|
200
189
|
id: "com.microsoft.edge"
|
|
@@ -260,69 +249,64 @@ var windowsBrowserProgIds = {
|
|
|
260
249
|
id: "com.microsoft.ie"
|
|
261
250
|
}
|
|
262
251
|
};
|
|
263
|
-
|
|
264
|
-
var UnknownBrowserError = class extends Error {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
270
|
-
const { stdout: stdout$1 } = await _execFileAsync("reg", [
|
|
252
|
+
const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
253
|
+
var UnknownBrowserError = class extends Error {};
|
|
254
|
+
async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
255
|
+
const { stdout } = await _execFileAsync("reg", [
|
|
271
256
|
"QUERY",
|
|
272
257
|
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
273
258
|
"/v",
|
|
274
259
|
"ProgId"
|
|
275
260
|
]);
|
|
276
|
-
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout
|
|
277
|
-
if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout
|
|
261
|
+
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
262
|
+
if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
278
263
|
const { id } = match.groups;
|
|
279
264
|
const browser = windowsBrowserProgIds[id];
|
|
280
265
|
if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
281
266
|
return browser;
|
|
282
267
|
}
|
|
283
|
-
__name(defaultBrowser, "defaultBrowser");
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
async function
|
|
287
|
-
if (process
|
|
268
|
+
__name(defaultBrowser$1, "defaultBrowser");
|
|
269
|
+
const execFileAsync = promisify(execFile);
|
|
270
|
+
const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
271
|
+
async function defaultBrowser() {
|
|
272
|
+
if (process.platform === "darwin") {
|
|
288
273
|
const id = await defaultBrowserId();
|
|
289
274
|
return {
|
|
290
275
|
name: await bundleName(id),
|
|
291
276
|
id
|
|
292
277
|
};
|
|
293
278
|
}
|
|
294
|
-
if (process
|
|
295
|
-
const { stdout
|
|
279
|
+
if (process.platform === "linux") {
|
|
280
|
+
const { stdout } = await execFileAsync("xdg-mime", [
|
|
296
281
|
"query",
|
|
297
282
|
"default",
|
|
298
283
|
"x-scheme-handler/http"
|
|
299
284
|
]);
|
|
300
|
-
const id = stdout
|
|
285
|
+
const id = stdout.trim();
|
|
301
286
|
return {
|
|
302
287
|
name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
|
|
303
288
|
id
|
|
304
289
|
};
|
|
305
290
|
}
|
|
306
|
-
if (process
|
|
291
|
+
if (process.platform === "win32") return defaultBrowser$1();
|
|
307
292
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
308
293
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
if (apps2.length === 0) return;
|
|
294
|
+
const isInSsh = Boolean(process.env.SSH_CONNECTION || process.env.SSH_CLIENT || process.env.SSH_TTY);
|
|
295
|
+
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
296
|
+
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
297
|
+
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
298
|
+
const { platform, arch: arch$1 } = process;
|
|
299
|
+
const tryEachApp = async (apps, opener) => {
|
|
300
|
+
if (apps.length === 0) return;
|
|
317
301
|
const errors = [];
|
|
318
|
-
for (const app of
|
|
302
|
+
for (const app of apps) try {
|
|
319
303
|
return await opener(app);
|
|
320
304
|
} catch (error) {
|
|
321
305
|
errors.push(error);
|
|
322
306
|
}
|
|
323
307
|
throw new AggregateError(errors, "Failed to open in all supported apps");
|
|
324
|
-
}
|
|
325
|
-
|
|
308
|
+
};
|
|
309
|
+
const baseOpen = async (options) => {
|
|
326
310
|
options = {
|
|
327
311
|
wait: false,
|
|
328
312
|
background: false,
|
|
@@ -370,7 +354,7 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
370
354
|
if (is_wsl_default) {
|
|
371
355
|
const progId = await wslDefaultBrowser();
|
|
372
356
|
browser = _windowsBrowserProgIdMap.get(progId) ?? {};
|
|
373
|
-
} else browser = await
|
|
357
|
+
} else browser = await defaultBrowser();
|
|
374
358
|
if (browser.id in ids) {
|
|
375
359
|
const browserName = ids[browser.id.toLowerCase()];
|
|
376
360
|
if (app === "browserPrivate") {
|
|
@@ -391,7 +375,7 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
391
375
|
const cliArguments = [];
|
|
392
376
|
const childProcessOptions = {};
|
|
393
377
|
let shouldUseWindowsInWsl = false;
|
|
394
|
-
if (is_wsl_default && !isInsideContainer() && !
|
|
378
|
+
if (is_wsl_default && !isInsideContainer() && !isInSsh && !app) shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
395
379
|
if (platform === "darwin") {
|
|
396
380
|
command = "open";
|
|
397
381
|
if (options.wait) cliArguments.push("--wait-apps");
|
|
@@ -399,7 +383,7 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
399
383
|
if (options.newInstance) cliArguments.push("--new");
|
|
400
384
|
if (app) cliArguments.push("-a", app);
|
|
401
385
|
} else if (platform === "win32" || shouldUseWindowsInWsl) {
|
|
402
|
-
command = await
|
|
386
|
+
command = await powerShellPath();
|
|
403
387
|
cliArguments.push(...executePowerShell.argumentsPrefix);
|
|
404
388
|
if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
|
|
405
389
|
if (is_wsl_default && options.target) options.target = await convertWslPathToWindows(options.target);
|
|
@@ -418,13 +402,13 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
418
402
|
} else {
|
|
419
403
|
if (app) command = app;
|
|
420
404
|
else {
|
|
421
|
-
const isBundled = !__dirname
|
|
405
|
+
const isBundled = !__dirname || __dirname === "/";
|
|
422
406
|
let exeLocalXdgOpen = false;
|
|
423
407
|
try {
|
|
424
|
-
await
|
|
408
|
+
await fs$1.access(localXdgOpenPath, constants.X_OK);
|
|
425
409
|
exeLocalXdgOpen = true;
|
|
426
410
|
} catch {}
|
|
427
|
-
command = process
|
|
411
|
+
command = process.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
428
412
|
}
|
|
429
413
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
430
414
|
if (!options.wait) {
|
|
@@ -435,17 +419,17 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
435
419
|
if (platform === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
|
|
436
420
|
if (options.target) cliArguments.push(options.target);
|
|
437
421
|
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
438
|
-
if (options.wait) return new Promise((resolve
|
|
422
|
+
if (options.wait) return new Promise((resolve, reject) => {
|
|
439
423
|
subprocess.once("error", reject);
|
|
440
424
|
subprocess.once("close", (exitCode) => {
|
|
441
425
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
442
426
|
reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
|
|
443
427
|
return;
|
|
444
428
|
}
|
|
445
|
-
resolve
|
|
429
|
+
resolve(subprocess);
|
|
446
430
|
});
|
|
447
431
|
});
|
|
448
|
-
if (isFallbackAttempt) return new Promise((resolve
|
|
432
|
+
if (isFallbackAttempt) return new Promise((resolve, reject) => {
|
|
449
433
|
subprocess.once("error", reject);
|
|
450
434
|
subprocess.once("spawn", () => {
|
|
451
435
|
subprocess.once("close", (exitCode) => {
|
|
@@ -455,40 +439,38 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
455
439
|
return;
|
|
456
440
|
}
|
|
457
441
|
subprocess.unref();
|
|
458
|
-
resolve
|
|
442
|
+
resolve(subprocess);
|
|
459
443
|
});
|
|
460
444
|
});
|
|
461
445
|
});
|
|
462
446
|
subprocess.unref();
|
|
463
|
-
return new Promise((resolve
|
|
447
|
+
return new Promise((resolve, reject) => {
|
|
464
448
|
subprocess.once("error", reject);
|
|
465
449
|
subprocess.once("spawn", () => {
|
|
466
450
|
subprocess.off("error", reject);
|
|
467
|
-
resolve
|
|
451
|
+
resolve(subprocess);
|
|
468
452
|
});
|
|
469
453
|
});
|
|
470
|
-
}
|
|
471
|
-
|
|
454
|
+
};
|
|
455
|
+
const open = (target, options) => {
|
|
472
456
|
if (typeof target !== "string") throw new TypeError("Expected a `target`");
|
|
473
457
|
return baseOpen({
|
|
474
458
|
...options,
|
|
475
459
|
target
|
|
476
460
|
});
|
|
477
|
-
}
|
|
461
|
+
};
|
|
478
462
|
function detectArchBinary(binary) {
|
|
479
463
|
if (typeof binary === "string" || Array.isArray(binary)) return binary;
|
|
480
464
|
const { [arch$1]: archBinary } = binary;
|
|
481
465
|
if (!archBinary) throw new Error(`${arch$1} is not supported`);
|
|
482
466
|
return archBinary;
|
|
483
467
|
}
|
|
484
|
-
__name(detectArchBinary, "detectArchBinary");
|
|
485
468
|
function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
|
|
486
469
|
if (wsl && is_wsl_default) return detectArchBinary(wsl);
|
|
487
470
|
if (!platformBinary) throw new Error(`${platform} is not supported`);
|
|
488
471
|
return detectArchBinary(platformBinary);
|
|
489
472
|
}
|
|
490
|
-
|
|
491
|
-
var apps = {
|
|
473
|
+
const apps = {
|
|
492
474
|
browser: "browser",
|
|
493
475
|
browserPrivate: "browserPrivate"
|
|
494
476
|
};
|
|
@@ -524,7 +506,4 @@ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
|
524
506
|
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
525
507
|
}, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
|
|
526
508
|
defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
//#endregion
|
|
530
|
-
export { open_default as default };
|
|
509
|
+
export { open as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../workers-sdk/packages/vite-plugin-cloudflare/package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@cloudflare/vite-plugin",
|
|
4
|
-
version: "2.0.0-rc.
|
|
4
|
+
version: "2.0.0-rc.5",
|
|
5
5
|
description: "Cloudflare plugin for Vite",
|
|
6
6
|
keywords: [
|
|
7
7
|
"cloudflare",
|
|
@@ -70,7 +70,7 @@ var package_default = {
|
|
|
70
70
|
"semver": "^7.7.1",
|
|
71
71
|
"tinyglobby": "catalog:default",
|
|
72
72
|
"tree-kill": "catalog:default",
|
|
73
|
-
"tsdown": "
|
|
73
|
+
"tsdown": "catalog:default",
|
|
74
74
|
"typescript": "catalog:default",
|
|
75
75
|
"vite": "catalog:default",
|
|
76
76
|
"vite-legacy": "npm:vite@7.1.12",
|
|
@@ -85,6 +85,4 @@ var package_default = {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
|
|
89
|
-
//#endregion
|
|
90
|
-
export { package_default as default };
|
|
88
|
+
export { package_default as default };
|