gemi 0.4.12 → 0.4.13
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/app/App.d.ts.map +1 -1
- package/dist/app/createFlatApiRoutes.d.ts +4 -2
- package/dist/app/createFlatApiRoutes.d.ts.map +1 -1
- package/dist/app/index.js +177 -177
- package/dist/bin/index.js +495 -65
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +37 -9
- package/dist/client/rpc.d.ts +3 -0
- package/dist/client/rpc.d.ts.map +1 -0
- package/dist/client/useMutation.d.ts +22 -6
- package/dist/client/useMutation.d.ts.map +1 -1
- package/dist/client/useQuery.d.ts +14 -4
- package/dist/client/useQuery.d.ts.map +1 -1
- package/dist/http/ApiRouter.d.ts +39 -42
- package/dist/http/ApiRouter.d.ts.map +1 -1
- package/dist/http/Controller.d.ts +5 -4
- package/dist/http/Controller.d.ts.map +1 -1
- package/dist/http/HttpRequest.d.ts +19 -5
- package/dist/http/HttpRequest.d.ts.map +1 -1
- package/dist/http/Router.d.ts +1 -1
- package/dist/http/Router.d.ts.map +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +159 -157
- package/dist/internal/type-utils.d.ts +8 -0
- package/dist/internal/type-utils.d.ts.map +1 -0
- package/dist/server/index.js +460 -30
- package/package.json +2 -1
package/dist/server/index.js
CHANGED
|
@@ -121,11 +121,11 @@ var require_process = __commonJS((exports, module) => {
|
|
|
121
121
|
|
|
122
122
|
// ../../node_modules/detect-libc/lib/filesystem.js
|
|
123
123
|
var require_filesystem = __commonJS((exports, module) => {
|
|
124
|
-
var
|
|
124
|
+
var fs5 = __require("fs");
|
|
125
125
|
var LDD_PATH = "/usr/bin/ldd";
|
|
126
|
-
var readFileSync = (
|
|
127
|
-
var readFile = (
|
|
128
|
-
|
|
126
|
+
var readFileSync = (path2) => fs5.readFileSync(path2, "utf-8");
|
|
127
|
+
var readFile = (path2) => new Promise((resolve, reject) => {
|
|
128
|
+
fs5.readFile(path2, "utf-8", (err, data) => {
|
|
129
129
|
if (err) {
|
|
130
130
|
reject(err);
|
|
131
131
|
} else {
|
|
@@ -142,7 +142,7 @@ var require_filesystem = __commonJS((exports, module) => {
|
|
|
142
142
|
|
|
143
143
|
// ../../node_modules/detect-libc/lib/detect-libc.js
|
|
144
144
|
var require_detect_libc = __commonJS((exports, module) => {
|
|
145
|
-
var
|
|
145
|
+
var childProcess2 = __require("child_process");
|
|
146
146
|
var { isLinux, getReport } = require_process();
|
|
147
147
|
var { LDD_PATH, readFile, readFileSync } = require_filesystem();
|
|
148
148
|
var cachedFamilyFilesystem;
|
|
@@ -152,7 +152,7 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
152
152
|
var safeCommand = () => {
|
|
153
153
|
if (!commandOut) {
|
|
154
154
|
return new Promise((resolve) => {
|
|
155
|
-
|
|
155
|
+
childProcess2.exec(command, (err, out) => {
|
|
156
156
|
commandOut = err ? " " : out;
|
|
157
157
|
resolve(commandOut);
|
|
158
158
|
});
|
|
@@ -163,7 +163,7 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
163
163
|
var safeCommandSync = () => {
|
|
164
164
|
if (!commandOut) {
|
|
165
165
|
try {
|
|
166
|
-
commandOut =
|
|
166
|
+
commandOut = childProcess2.execSync(command, { encoding: "utf8" });
|
|
167
167
|
} catch (_err) {
|
|
168
168
|
commandOut = " ";
|
|
169
169
|
}
|
|
@@ -1814,9 +1814,9 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
1814
1814
|
];
|
|
1815
1815
|
var sharp;
|
|
1816
1816
|
var errors = [];
|
|
1817
|
-
for (const
|
|
1817
|
+
for (const path2 of paths) {
|
|
1818
1818
|
try {
|
|
1819
|
-
sharp = __require(
|
|
1819
|
+
sharp = __require(path2);
|
|
1820
1820
|
break;
|
|
1821
1821
|
} catch (err) {
|
|
1822
1822
|
errors.push(err);
|
|
@@ -1825,7 +1825,7 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
1825
1825
|
if (sharp) {
|
|
1826
1826
|
module.exports = sharp;
|
|
1827
1827
|
} else {
|
|
1828
|
-
const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((
|
|
1828
|
+
const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((os2) => runtimePlatform.startsWith(os2));
|
|
1829
1829
|
const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
|
|
1830
1830
|
errors.forEach((err) => {
|
|
1831
1831
|
if (err.code !== "MODULE_NOT_FOUND") {
|
|
@@ -1838,9 +1838,9 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
1838
1838
|
const { found, expected } = isUnsupportedNodeRuntime();
|
|
1839
1839
|
help.push("- Please upgrade Node.js:", ` Found ${found}`, ` Requires ${expected}`);
|
|
1840
1840
|
} else if (prebuiltPlatforms.includes(runtimePlatform)) {
|
|
1841
|
-
const [
|
|
1842
|
-
const libc =
|
|
1843
|
-
help.push("- Ensure optional dependencies can be installed:", " npm install --include=optional sharp", " yarn add sharp --ignore-engines", "- Ensure your package manager supports multi-platform installation:", " See https://sharp.pixelplumbing.com/install#cross-platform", "- Add platform-specific dependencies:", ` npm install --os=${
|
|
1841
|
+
const [os2, cpu] = runtimePlatform.split("-");
|
|
1842
|
+
const libc = os2.endsWith("musl") ? " --libc=musl" : "";
|
|
1843
|
+
help.push("- Ensure optional dependencies can be installed:", " npm install --include=optional sharp", " yarn add sharp --ignore-engines", "- Ensure your package manager supports multi-platform installation:", " See https://sharp.pixelplumbing.com/install#cross-platform", "- Add platform-specific dependencies:", ` npm install --os=${os2.replace("musl", "")}${libc} --cpu=${cpu} sharp`);
|
|
1844
1844
|
} else {
|
|
1845
1845
|
help.push(`- Manually install libvips >= ${minimumLibvipsVersion}`, "- Add experimental WebAssembly-based dependencies:", " npm install --cpu=wasm32 sharp", " npm install @img/sharp-wasm32");
|
|
1846
1846
|
}
|
|
@@ -3159,15 +3159,15 @@ var require_route = __commonJS((exports, module) => {
|
|
|
3159
3159
|
};
|
|
3160
3160
|
};
|
|
3161
3161
|
var wrapConversion = function(toModel, graph) {
|
|
3162
|
-
const
|
|
3162
|
+
const path2 = [graph[toModel].parent, toModel];
|
|
3163
3163
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
3164
3164
|
let cur = graph[toModel].parent;
|
|
3165
3165
|
while (graph[cur].parent) {
|
|
3166
|
-
|
|
3166
|
+
path2.unshift(graph[cur].parent);
|
|
3167
3167
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
3168
3168
|
cur = graph[cur].parent;
|
|
3169
3169
|
}
|
|
3170
|
-
fn.conversion =
|
|
3170
|
+
fn.conversion = path2;
|
|
3171
3171
|
return fn;
|
|
3172
3172
|
};
|
|
3173
3173
|
var conversions = require_conversions();
|
|
@@ -4999,9 +4999,9 @@ var require_output = __commonJS((exports, module) => {
|
|
|
4999
4999
|
let err;
|
|
5000
5000
|
if (!is.string(fileOut)) {
|
|
5001
5001
|
err = new Error("Missing output file path");
|
|
5002
|
-
} else if (is.string(this.options.input.file) &&
|
|
5002
|
+
} else if (is.string(this.options.input.file) && path2.resolve(this.options.input.file) === path2.resolve(fileOut)) {
|
|
5003
5003
|
err = new Error("Cannot use same file for input and output");
|
|
5004
|
-
} else if (jp2Regex.test(
|
|
5004
|
+
} else if (jp2Regex.test(path2.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
|
|
5005
5005
|
err = errJp2Save();
|
|
5006
5006
|
}
|
|
5007
5007
|
if (err) {
|
|
@@ -5776,7 +5776,7 @@ var require_output = __commonJS((exports, module) => {
|
|
|
5776
5776
|
}
|
|
5777
5777
|
}
|
|
5778
5778
|
};
|
|
5779
|
-
var
|
|
5779
|
+
var path2 = __require("node:path");
|
|
5780
5780
|
var is = require_is();
|
|
5781
5781
|
var sharp = require_sharp();
|
|
5782
5782
|
var formats = new Map([
|
|
@@ -5958,8 +5958,438 @@ var require_lib = __commonJS((exports, module) => {
|
|
|
5958
5958
|
});
|
|
5959
5959
|
|
|
5960
5960
|
// server/dev.ts
|
|
5961
|
-
import
|
|
5962
|
-
|
|
5961
|
+
import path2 from "path";
|
|
5962
|
+
|
|
5963
|
+
// ../../node_modules/open/index.js
|
|
5964
|
+
import process6 from "node:process";
|
|
5965
|
+
import {Buffer as Buffer2} from "node:buffer";
|
|
5966
|
+
import path from "node:path";
|
|
5967
|
+
import {fileURLToPath} from "node:url";
|
|
5968
|
+
import childProcess from "node:child_process";
|
|
5969
|
+
import fs4, {constants as fsConstants} from "node:fs/promises";
|
|
5970
|
+
|
|
5971
|
+
// ../../node_modules/is-wsl/index.js
|
|
5972
|
+
import process2 from "node:process";
|
|
5973
|
+
import os from "node:os";
|
|
5974
|
+
import fs3 from "node:fs";
|
|
5975
|
+
|
|
5976
|
+
// ../../node_modules/is-inside-container/index.js
|
|
5977
|
+
import fs2 from "node:fs";
|
|
5978
|
+
|
|
5979
|
+
// ../../node_modules/is-docker/index.js
|
|
5980
|
+
import fs from "node:fs";
|
|
5981
|
+
var hasDockerEnv = function() {
|
|
5982
|
+
try {
|
|
5983
|
+
fs.statSync("/.dockerenv");
|
|
5984
|
+
return true;
|
|
5985
|
+
} catch {
|
|
5986
|
+
return false;
|
|
5987
|
+
}
|
|
5988
|
+
};
|
|
5989
|
+
var hasDockerCGroup = function() {
|
|
5990
|
+
try {
|
|
5991
|
+
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
5992
|
+
} catch {
|
|
5993
|
+
return false;
|
|
5994
|
+
}
|
|
5995
|
+
};
|
|
5996
|
+
var isDockerCached;
|
|
5997
|
+
function isDocker() {
|
|
5998
|
+
if (isDockerCached === undefined) {
|
|
5999
|
+
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
6000
|
+
}
|
|
6001
|
+
return isDockerCached;
|
|
6002
|
+
}
|
|
6003
|
+
|
|
6004
|
+
// ../../node_modules/is-inside-container/index.js
|
|
6005
|
+
var cachedResult;
|
|
6006
|
+
var hasContainerEnv = () => {
|
|
6007
|
+
try {
|
|
6008
|
+
fs2.statSync("/run/.containerenv");
|
|
6009
|
+
return true;
|
|
6010
|
+
} catch {
|
|
6011
|
+
return false;
|
|
6012
|
+
}
|
|
6013
|
+
};
|
|
6014
|
+
function isInsideContainer() {
|
|
6015
|
+
if (cachedResult === undefined) {
|
|
6016
|
+
cachedResult = hasContainerEnv() || isDocker();
|
|
6017
|
+
}
|
|
6018
|
+
return cachedResult;
|
|
6019
|
+
}
|
|
6020
|
+
|
|
6021
|
+
// ../../node_modules/is-wsl/index.js
|
|
6022
|
+
var isWsl = () => {
|
|
6023
|
+
if (process2.platform !== "linux") {
|
|
6024
|
+
return false;
|
|
6025
|
+
}
|
|
6026
|
+
if (os.release().toLowerCase().includes("microsoft")) {
|
|
6027
|
+
if (isInsideContainer()) {
|
|
6028
|
+
return false;
|
|
6029
|
+
}
|
|
6030
|
+
return true;
|
|
6031
|
+
}
|
|
6032
|
+
try {
|
|
6033
|
+
return fs3.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
6034
|
+
} catch {
|
|
6035
|
+
return false;
|
|
6036
|
+
}
|
|
6037
|
+
};
|
|
6038
|
+
var is_wsl_default = process2.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
6039
|
+
|
|
6040
|
+
// ../../node_modules/define-lazy-prop/index.js
|
|
6041
|
+
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
6042
|
+
const define = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
|
|
6043
|
+
Object.defineProperty(object, propertyName, {
|
|
6044
|
+
configurable: true,
|
|
6045
|
+
enumerable: true,
|
|
6046
|
+
get() {
|
|
6047
|
+
const result = valueGetter();
|
|
6048
|
+
define(result);
|
|
6049
|
+
return result;
|
|
6050
|
+
},
|
|
6051
|
+
set(value) {
|
|
6052
|
+
define(value);
|
|
6053
|
+
}
|
|
6054
|
+
});
|
|
6055
|
+
return object;
|
|
6056
|
+
}
|
|
6057
|
+
|
|
6058
|
+
// ../../node_modules/default-browser/index.js
|
|
6059
|
+
import {promisify as promisify4} from "node:util";
|
|
6060
|
+
import process5 from "node:process";
|
|
6061
|
+
import {execFile as execFile4} from "node:child_process";
|
|
6062
|
+
|
|
6063
|
+
// ../../node_modules/default-browser-id/index.js
|
|
6064
|
+
import {promisify} from "node:util";
|
|
6065
|
+
import process3 from "node:process";
|
|
6066
|
+
import {execFile} from "node:child_process";
|
|
6067
|
+
var execFileAsync = promisify(execFile);
|
|
6068
|
+
async function defaultBrowserId() {
|
|
6069
|
+
if (process3.platform !== "darwin") {
|
|
6070
|
+
throw new Error("macOS only");
|
|
6071
|
+
}
|
|
6072
|
+
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
6073
|
+
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
6074
|
+
return match?.groups.id ?? "com.apple.Safari";
|
|
6075
|
+
}
|
|
6076
|
+
|
|
6077
|
+
// ../../node_modules/run-applescript/index.js
|
|
6078
|
+
import process4 from "node:process";
|
|
6079
|
+
import {promisify as promisify2} from "node:util";
|
|
6080
|
+
import {execFile as execFile2, execFileSync} from "node:child_process";
|
|
6081
|
+
async function runAppleScript(script, { humanReadableOutput = true } = {}) {
|
|
6082
|
+
if (process4.platform !== "darwin") {
|
|
6083
|
+
throw new Error("macOS only");
|
|
6084
|
+
}
|
|
6085
|
+
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
6086
|
+
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments]);
|
|
6087
|
+
return stdout.trim();
|
|
6088
|
+
}
|
|
6089
|
+
var execFileAsync2 = promisify2(execFile2);
|
|
6090
|
+
|
|
6091
|
+
// ../../node_modules/bundle-name/index.js
|
|
6092
|
+
async function bundleName(bundleId) {
|
|
6093
|
+
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")`);
|
|
6094
|
+
}
|
|
6095
|
+
|
|
6096
|
+
// ../../node_modules/default-browser/windows.js
|
|
6097
|
+
import {promisify as promisify3} from "node:util";
|
|
6098
|
+
import {execFile as execFile3} from "node:child_process";
|
|
6099
|
+
var execFileAsync3 = promisify3(execFile3);
|
|
6100
|
+
var windowsBrowserProgIds = {
|
|
6101
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
6102
|
+
MSEdgeDHTML: { name: "Edge", id: "com.microsoft.edge" },
|
|
6103
|
+
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
6104
|
+
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" },
|
|
6105
|
+
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
6106
|
+
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
6107
|
+
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
6108
|
+
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
6109
|
+
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" }
|
|
6110
|
+
};
|
|
6111
|
+
|
|
6112
|
+
class UnknownBrowserError extends Error {
|
|
6113
|
+
}
|
|
6114
|
+
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
6115
|
+
const { stdout } = await _execFileAsync("reg", [
|
|
6116
|
+
"QUERY",
|
|
6117
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
6118
|
+
"/v",
|
|
6119
|
+
"ProgId"
|
|
6120
|
+
]);
|
|
6121
|
+
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
6122
|
+
if (!match) {
|
|
6123
|
+
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
6124
|
+
}
|
|
6125
|
+
const { id } = match.groups;
|
|
6126
|
+
const browser = windowsBrowserProgIds[id];
|
|
6127
|
+
if (!browser) {
|
|
6128
|
+
throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
6129
|
+
}
|
|
6130
|
+
return browser;
|
|
6131
|
+
}
|
|
6132
|
+
|
|
6133
|
+
// ../../node_modules/default-browser/index.js
|
|
6134
|
+
var execFileAsync4 = promisify4(execFile4);
|
|
6135
|
+
var titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
6136
|
+
async function defaultBrowser2() {
|
|
6137
|
+
if (process5.platform === "darwin") {
|
|
6138
|
+
const id = await defaultBrowserId();
|
|
6139
|
+
const name = await bundleName(id);
|
|
6140
|
+
return { name, id };
|
|
6141
|
+
}
|
|
6142
|
+
if (process5.platform === "linux") {
|
|
6143
|
+
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
6144
|
+
const id = stdout.trim();
|
|
6145
|
+
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
6146
|
+
return { name, id };
|
|
6147
|
+
}
|
|
6148
|
+
if (process5.platform === "win32") {
|
|
6149
|
+
return defaultBrowser();
|
|
6150
|
+
}
|
|
6151
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
6152
|
+
}
|
|
6153
|
+
|
|
6154
|
+
// ../../node_modules/open/index.js
|
|
6155
|
+
var detectArchBinary = function(binary) {
|
|
6156
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
6157
|
+
return binary;
|
|
6158
|
+
}
|
|
6159
|
+
const { [arch]: archBinary } = binary;
|
|
6160
|
+
if (!archBinary) {
|
|
6161
|
+
throw new Error(`${arch} is not supported`);
|
|
6162
|
+
}
|
|
6163
|
+
return archBinary;
|
|
6164
|
+
};
|
|
6165
|
+
var detectPlatformBinary = function({ [platform]: platformBinary }, { wsl }) {
|
|
6166
|
+
if (wsl && is_wsl_default) {
|
|
6167
|
+
return detectArchBinary(wsl);
|
|
6168
|
+
}
|
|
6169
|
+
if (!platformBinary) {
|
|
6170
|
+
throw new Error(`${platform} is not supported`);
|
|
6171
|
+
}
|
|
6172
|
+
return detectArchBinary(platformBinary);
|
|
6173
|
+
};
|
|
6174
|
+
var __dirname2 = path.dirname(fileURLToPath(import.meta.url));
|
|
6175
|
+
var localXdgOpenPath = path.join(__dirname2, "xdg-open");
|
|
6176
|
+
var { platform, arch } = process6;
|
|
6177
|
+
var getWslDrivesMountPoint = (() => {
|
|
6178
|
+
const defaultMountPoint = "/mnt/";
|
|
6179
|
+
let mountPoint;
|
|
6180
|
+
return async function() {
|
|
6181
|
+
if (mountPoint) {
|
|
6182
|
+
return mountPoint;
|
|
6183
|
+
}
|
|
6184
|
+
const configFilePath = "/etc/wsl.conf";
|
|
6185
|
+
let isConfigFileExists = false;
|
|
6186
|
+
try {
|
|
6187
|
+
await fs4.access(configFilePath, fsConstants.F_OK);
|
|
6188
|
+
isConfigFileExists = true;
|
|
6189
|
+
} catch {
|
|
6190
|
+
}
|
|
6191
|
+
if (!isConfigFileExists) {
|
|
6192
|
+
return defaultMountPoint;
|
|
6193
|
+
}
|
|
6194
|
+
const configContent = await fs4.readFile(configFilePath, { encoding: "utf8" });
|
|
6195
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
6196
|
+
if (!configMountPoint) {
|
|
6197
|
+
return defaultMountPoint;
|
|
6198
|
+
}
|
|
6199
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
6200
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
6201
|
+
return mountPoint;
|
|
6202
|
+
};
|
|
6203
|
+
})();
|
|
6204
|
+
var pTryEach = async (array, mapper) => {
|
|
6205
|
+
let latestError;
|
|
6206
|
+
for (const item of array) {
|
|
6207
|
+
try {
|
|
6208
|
+
return await mapper(item);
|
|
6209
|
+
} catch (error) {
|
|
6210
|
+
latestError = error;
|
|
6211
|
+
}
|
|
6212
|
+
}
|
|
6213
|
+
throw latestError;
|
|
6214
|
+
};
|
|
6215
|
+
var baseOpen = async (options) => {
|
|
6216
|
+
options = {
|
|
6217
|
+
wait: false,
|
|
6218
|
+
background: false,
|
|
6219
|
+
newInstance: false,
|
|
6220
|
+
allowNonzeroExitCode: false,
|
|
6221
|
+
...options
|
|
6222
|
+
};
|
|
6223
|
+
if (Array.isArray(options.app)) {
|
|
6224
|
+
return pTryEach(options.app, (singleApp) => baseOpen({
|
|
6225
|
+
...options,
|
|
6226
|
+
app: singleApp
|
|
6227
|
+
}));
|
|
6228
|
+
}
|
|
6229
|
+
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
6230
|
+
appArguments = [...appArguments];
|
|
6231
|
+
if (Array.isArray(app)) {
|
|
6232
|
+
return pTryEach(app, (appName) => baseOpen({
|
|
6233
|
+
...options,
|
|
6234
|
+
app: {
|
|
6235
|
+
name: appName,
|
|
6236
|
+
arguments: appArguments
|
|
6237
|
+
}
|
|
6238
|
+
}));
|
|
6239
|
+
}
|
|
6240
|
+
if (app === "browser" || app === "browserPrivate") {
|
|
6241
|
+
const ids = {
|
|
6242
|
+
"com.google.chrome": "chrome",
|
|
6243
|
+
"google-chrome.desktop": "chrome",
|
|
6244
|
+
"org.mozilla.firefox": "firefox",
|
|
6245
|
+
"firefox.desktop": "firefox",
|
|
6246
|
+
"com.microsoft.msedge": "edge",
|
|
6247
|
+
"com.microsoft.edge": "edge",
|
|
6248
|
+
"microsoft-edge.desktop": "edge"
|
|
6249
|
+
};
|
|
6250
|
+
const flags = {
|
|
6251
|
+
chrome: "--incognito",
|
|
6252
|
+
firefox: "--private-window",
|
|
6253
|
+
edge: "--inPrivate"
|
|
6254
|
+
};
|
|
6255
|
+
const browser = await defaultBrowser2();
|
|
6256
|
+
if (browser.id in ids) {
|
|
6257
|
+
const browserName = ids[browser.id];
|
|
6258
|
+
if (app === "browserPrivate") {
|
|
6259
|
+
appArguments.push(flags[browserName]);
|
|
6260
|
+
}
|
|
6261
|
+
return baseOpen({
|
|
6262
|
+
...options,
|
|
6263
|
+
app: {
|
|
6264
|
+
name: apps[browserName],
|
|
6265
|
+
arguments: appArguments
|
|
6266
|
+
}
|
|
6267
|
+
});
|
|
6268
|
+
}
|
|
6269
|
+
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
6270
|
+
}
|
|
6271
|
+
let command;
|
|
6272
|
+
const cliArguments = [];
|
|
6273
|
+
const childProcessOptions = {};
|
|
6274
|
+
if (platform === "darwin") {
|
|
6275
|
+
command = "open";
|
|
6276
|
+
if (options.wait) {
|
|
6277
|
+
cliArguments.push("--wait-apps");
|
|
6278
|
+
}
|
|
6279
|
+
if (options.background) {
|
|
6280
|
+
cliArguments.push("--background");
|
|
6281
|
+
}
|
|
6282
|
+
if (options.newInstance) {
|
|
6283
|
+
cliArguments.push("--new");
|
|
6284
|
+
}
|
|
6285
|
+
if (app) {
|
|
6286
|
+
cliArguments.push("-a", app);
|
|
6287
|
+
}
|
|
6288
|
+
} else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
|
|
6289
|
+
const mountPoint = await getWslDrivesMountPoint();
|
|
6290
|
+
command = is_wsl_default ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process6.env.SYSTEMROOT || process6.env.windir || "C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
|
|
6291
|
+
cliArguments.push("-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand");
|
|
6292
|
+
if (!is_wsl_default) {
|
|
6293
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
6294
|
+
}
|
|
6295
|
+
const encodedArguments = ["Start"];
|
|
6296
|
+
if (options.wait) {
|
|
6297
|
+
encodedArguments.push("-Wait");
|
|
6298
|
+
}
|
|
6299
|
+
if (app) {
|
|
6300
|
+
encodedArguments.push(`"\`"${app}\`""`);
|
|
6301
|
+
if (options.target) {
|
|
6302
|
+
appArguments.push(options.target);
|
|
6303
|
+
}
|
|
6304
|
+
} else if (options.target) {
|
|
6305
|
+
encodedArguments.push(`"${options.target}"`);
|
|
6306
|
+
}
|
|
6307
|
+
if (appArguments.length > 0) {
|
|
6308
|
+
appArguments = appArguments.map((argument) => `"\`"${argument}\`""`);
|
|
6309
|
+
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
6310
|
+
}
|
|
6311
|
+
options.target = Buffer2.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
6312
|
+
} else {
|
|
6313
|
+
if (app) {
|
|
6314
|
+
command = app;
|
|
6315
|
+
} else {
|
|
6316
|
+
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
6317
|
+
let exeLocalXdgOpen = false;
|
|
6318
|
+
try {
|
|
6319
|
+
await fs4.access(localXdgOpenPath, fsConstants.X_OK);
|
|
6320
|
+
exeLocalXdgOpen = true;
|
|
6321
|
+
} catch {
|
|
6322
|
+
}
|
|
6323
|
+
const useSystemXdgOpen = process6.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
6324
|
+
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
6325
|
+
}
|
|
6326
|
+
if (appArguments.length > 0) {
|
|
6327
|
+
cliArguments.push(...appArguments);
|
|
6328
|
+
}
|
|
6329
|
+
if (!options.wait) {
|
|
6330
|
+
childProcessOptions.stdio = "ignore";
|
|
6331
|
+
childProcessOptions.detached = true;
|
|
6332
|
+
}
|
|
6333
|
+
}
|
|
6334
|
+
if (platform === "darwin" && appArguments.length > 0) {
|
|
6335
|
+
cliArguments.push("--args", ...appArguments);
|
|
6336
|
+
}
|
|
6337
|
+
if (options.target) {
|
|
6338
|
+
cliArguments.push(options.target);
|
|
6339
|
+
}
|
|
6340
|
+
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
6341
|
+
if (options.wait) {
|
|
6342
|
+
return new Promise((resolve, reject) => {
|
|
6343
|
+
subprocess.once("error", reject);
|
|
6344
|
+
subprocess.once("close", (exitCode) => {
|
|
6345
|
+
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
6346
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
6347
|
+
return;
|
|
6348
|
+
}
|
|
6349
|
+
resolve(subprocess);
|
|
6350
|
+
});
|
|
6351
|
+
});
|
|
6352
|
+
}
|
|
6353
|
+
subprocess.unref();
|
|
6354
|
+
return subprocess;
|
|
6355
|
+
};
|
|
6356
|
+
var open = (target, options) => {
|
|
6357
|
+
if (typeof target !== "string") {
|
|
6358
|
+
throw new TypeError("Expected a `target`");
|
|
6359
|
+
}
|
|
6360
|
+
return baseOpen({
|
|
6361
|
+
...options,
|
|
6362
|
+
target
|
|
6363
|
+
});
|
|
6364
|
+
};
|
|
6365
|
+
var apps = {};
|
|
6366
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
6367
|
+
darwin: "google chrome",
|
|
6368
|
+
win32: "chrome",
|
|
6369
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
6370
|
+
}, {
|
|
6371
|
+
wsl: {
|
|
6372
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
6373
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
6374
|
+
}
|
|
6375
|
+
}));
|
|
6376
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
6377
|
+
darwin: "firefox",
|
|
6378
|
+
win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
|
|
6379
|
+
linux: "firefox"
|
|
6380
|
+
}, {
|
|
6381
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
6382
|
+
}));
|
|
6383
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
6384
|
+
darwin: "microsoft edge",
|
|
6385
|
+
win32: "msedge",
|
|
6386
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
6387
|
+
}, {
|
|
6388
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
6389
|
+
}));
|
|
6390
|
+
defineLazyProperty(apps, "browser", () => "browser");
|
|
6391
|
+
defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
|
|
6392
|
+
var open_default = open;
|
|
5963
6393
|
|
|
5964
6394
|
// server/styles.tsx
|
|
5965
6395
|
function createStyles(styles) {
|
|
@@ -6113,7 +6543,7 @@ async function startDevServer() {
|
|
|
6113
6543
|
}
|
|
6114
6544
|
let app = null;
|
|
6115
6545
|
try {
|
|
6116
|
-
app = (await vite.ssrLoadModule(
|
|
6546
|
+
app = (await vite.ssrLoadModule(path2.join(appDir, "bootstrap.ts"))).app;
|
|
6117
6547
|
} catch (err) {
|
|
6118
6548
|
return new Response(renderErrorPage(err), {
|
|
6119
6549
|
status: 500,
|
|
@@ -6154,7 +6584,7 @@ async function startDevServer() {
|
|
|
6154
6584
|
port: process.env.PORT || 5173
|
|
6155
6585
|
});
|
|
6156
6586
|
console.log(`Server started on http://localhost:${process.env.PORT || 5173}`);
|
|
6157
|
-
await
|
|
6587
|
+
await open_default(`http://localhost:${process.env.PORT || 5173}`);
|
|
6158
6588
|
vite.watcher.on("change", async (file) => {
|
|
6159
6589
|
if (file.includes("app/views")) {
|
|
6160
6590
|
return;
|
|
@@ -6168,7 +6598,7 @@ async function startDevServer() {
|
|
|
6168
6598
|
return server;
|
|
6169
6599
|
}
|
|
6170
6600
|
var rootDir = process.cwd();
|
|
6171
|
-
var appDir =
|
|
6601
|
+
var appDir = path2.join(rootDir, "app");
|
|
6172
6602
|
// server/prod.ts
|
|
6173
6603
|
import {join} from "path";
|
|
6174
6604
|
|
|
@@ -6292,7 +6722,7 @@ var D = function(e, t = {}) {
|
|
|
6292
6722
|
return h;
|
|
6293
6723
|
}, Se = (h) => h, L = t.encodePart || Se, I = "", U = (h) => {
|
|
6294
6724
|
I += h;
|
|
6295
|
-
}, $
|
|
6725
|
+
}, $ = () => {
|
|
6296
6726
|
I.length && (o.push(new R(3, "", "", L(I), "", 3)), I = "");
|
|
6297
6727
|
}, V = (h, u, p, A, Y) => {
|
|
6298
6728
|
let g = 3;
|
|
@@ -6311,7 +6741,7 @@ var D = function(e, t = {}) {
|
|
|
6311
6741
|
U(h);
|
|
6312
6742
|
return;
|
|
6313
6743
|
}
|
|
6314
|
-
if ($
|
|
6744
|
+
if ($(), !u && !p) {
|
|
6315
6745
|
if (!h)
|
|
6316
6746
|
return;
|
|
6317
6747
|
o.push(new R(3, "", "", L(h), "", g));
|
|
@@ -6330,7 +6760,7 @@ var D = function(e, t = {}) {
|
|
|
6330
6760
|
let h = a("CHAR"), u = a("NAME"), p = a("REGEX");
|
|
6331
6761
|
if (!u && !p && (p = a("ASTERISK")), u || p) {
|
|
6332
6762
|
let g = h ?? "";
|
|
6333
|
-
t.prefixes.indexOf(g) === -1 && (U(g), g = ""), $
|
|
6763
|
+
t.prefixes.indexOf(g) === -1 && (U(g), g = ""), $();
|
|
6334
6764
|
let m = f();
|
|
6335
6765
|
V(g, u, p, "", m);
|
|
6336
6766
|
continue;
|
|
@@ -6349,7 +6779,7 @@ var D = function(e, t = {}) {
|
|
|
6349
6779
|
V(g, m, O, P, xe);
|
|
6350
6780
|
continue;
|
|
6351
6781
|
}
|
|
6352
|
-
$
|
|
6782
|
+
$(), d("END");
|
|
6353
6783
|
}
|
|
6354
6784
|
return o;
|
|
6355
6785
|
};
|
|
@@ -7034,11 +7464,11 @@ var rootDir2 = process.cwd();
|
|
|
7034
7464
|
var appDir2 = join(rootDir2, "app");
|
|
7035
7465
|
var distDir = join(rootDir2, "dist");
|
|
7036
7466
|
// server/createDevServer.ts
|
|
7037
|
-
import
|
|
7467
|
+
import path3 from "path";
|
|
7038
7468
|
async function createDevServer(params) {
|
|
7039
7469
|
const { app, RootLayout } = params;
|
|
7040
7470
|
const rootDir3 = process.cwd();
|
|
7041
|
-
const appDir3 =
|
|
7471
|
+
const appDir3 = path3.join(rootDir3, "app");
|
|
7042
7472
|
const root = process.cwd();
|
|
7043
7473
|
const vite = await (await import("vite")).createServer({
|
|
7044
7474
|
root,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gemi",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@happy-dom/global-registrator": "^14.12.3",
|
|
6
6
|
"@repo/eslint-config": "*",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@react-email/render": "0.0.17-canary.0",
|
|
53
53
|
"commander": "^12.1.0",
|
|
54
54
|
"history": "^5.3.0",
|
|
55
|
+
"open": "^10.1.0",
|
|
55
56
|
"react-email": "^2.1.4",
|
|
56
57
|
"resend": "^3.4.0",
|
|
57
58
|
"urlpattern-polyfill": "^10.0.0",
|