@pablopunk/webr 0.1.1 → 0.1.3
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 +12 -4
- package/dist/client/_astro/App.1PYvyCIo.css +1 -0
- package/dist/client/_astro/App.B3aX6cef.js +2 -0
- package/dist/server/chunks/{App_BmsGAwGf.mjs → App_CmESMUHE.mjs} +15 -14
- package/dist/server/chunks/{_id__u0ueX6GO.mjs → _id__CQzMt2xL.mjs} +7 -6
- package/dist/server/chunks/{_tab__DL6wyr-j.mjs → _tab__D-smYrCo.mjs} +7 -6
- package/dist/server/chunks/_virtual_astro_session-driver_Dp7RXjOf.mjs +123 -0
- package/dist/server/chunks/{compiler_CpXox_xS.mjs → compiler_BiU10Vds.mjs} +1 -1
- package/dist/server/chunks/{console_CucE1SwS.mjs → console_BOi2ismd.mjs} +6 -6
- package/dist/server/chunks/dist_CpTFMtqT.mjs +9199 -0
- package/dist/server/chunks/{index_DyyPce_k.mjs → index_DRfLd22k.mjs} +5 -4
- package/dist/server/chunks/{new_G7XChx5p.mjs → new_NXgn74q9.mjs} +7 -6
- package/dist/server/chunks/{node_BlixNyYV.mjs → node_BcIF-BVp.mjs} +461 -14
- package/dist/server/chunks/rolldown-runtime_BMI-E3GI.mjs +44 -0
- package/dist/server/chunks/{server_DS45LC4q.mjs → server_CnGYDmxV.mjs} +271 -15
- package/dist/server/chunks/{settings_DLV2Js3e.mjs → settings_D1jcCWzt.mjs} +7 -6
- package/dist/server/chunks/{sharp_CgNvPCpY.mjs → sharp_qIaxzsTp.mjs} +2 -2
- package/dist/server/chunks/vnode-children_BSi0H4PL.mjs +213 -0
- package/dist/server/entry.mjs +18980 -5126
- package/package.json +1 -1
- package/server/cli.ts +15 -11
- package/server/plugin/probe.ts +3 -3
- package/server/port.ts +53 -4
- package/server/run.ts +3 -3
- package/server/where.ts +22 -0
- package/src/server/directories.ts +12 -5
- package/src/server/host.ts +3 -4
- package/src/server/runtime/target.ts +1 -0
- package/src/server/transport/herdr-target.ts +21 -7
- package/src/server/transport/registry.ts +1 -1
- package/src/server/transport/saved-machines.ts +41 -0
- package/dist/client/_astro/App.BxlQhLhN.css +0 -1
- package/dist/client/_astro/App.CzxEZ_Dw.js +0 -2
- package/dist/server/chunks/_virtual_astro_session-driver_DS5V7T-N.mjs +0 -6
- package/dist/server/chunks/vnode-children_CRmaSs5G.mjs +0 -24
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as createAstro, f as renderHead, i as renderComponent, m as createRenderInstruction, p as addAttribute, s as renderSlot, u as renderTemplate } from "./
|
|
2
|
-
import { t as createComponent } from "./
|
|
1
|
+
import { S as createAstro, f as renderHead, i as renderComponent, m as createRenderInstruction, p as addAttribute, s as renderSlot, u as renderTemplate } from "./server_CnGYDmxV.mjs";
|
|
2
|
+
import { t as createComponent } from "./compiler_BiU10Vds.mjs";
|
|
3
3
|
import { createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
|
-
import { Archive, ArchiveRestore, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Check, ChevronDown, ChevronRight, Circle, CircleAlert, CircleCheck, CircleHelp, Copy, Cpu, Folder, FolderTree, GitBranch, ImagePlus, LayoutList, LoaderCircle, MessageCircleQuestion, Monitor, Moon, PanelBottom, PanelLeft, PanelLeftClose, PanelLeftOpen, PanelRight, Plus, Search, Settings2, SquarePen, SquareTerminal, Sun, TerminalSquare, Trash2, TriangleAlert, X } from "lucide-react";
|
|
4
|
+
import { Archive, ArchiveRestore, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Check, ChevronDown, ChevronRight, Circle, CircleAlert, CircleCheck, CircleHelp, Copy, Cpu, Folder, FolderTree, GitBranch, ImagePlus, LayoutList, LoaderCircle, MessageCircleQuestion, Monitor, Moon, PanelBottom, PanelLeft, PanelLeftClose, PanelLeftOpen, PanelRight, Plus, Search, Server, Settings2, SquarePen, SquareTerminal, Sun, TerminalSquare, Trash2, TriangleAlert, X } from "lucide-react";
|
|
5
5
|
import { createRoot } from "react-dom/client";
|
|
6
6
|
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -39,8 +39,8 @@ var $$ClientRouter = createComponent(($$result, $$props, $$slots) => {
|
|
|
39
39
|
const Astro = $$result.createAstro($$props, $$slots);
|
|
40
40
|
Astro.self = $$ClientRouter;
|
|
41
41
|
const { fallback = "animate" } = Astro.props;
|
|
42
|
-
return renderTemplate`<meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback"${addAttribute(fallback, "content")}>${renderScript($$result, "/
|
|
43
|
-
}, "/
|
|
42
|
+
return renderTemplate`<meta name="astro-view-transitions-enabled" content="true"><meta name="astro-view-transitions-fallback"${addAttribute(fallback, "content")}>${renderScript($$result, "/home/runner/work/webr/webr/node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/components/ClientRouter.astro?astro&type=script&index=0&lang.ts")}`;
|
|
43
|
+
}, "/home/runner/work/webr/webr/node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/components/ClientRouter.astro", void 0);
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/assets/fonts/jetbrains-mono.woff2?url
|
|
46
46
|
var jetbrains_mono_default = "/_astro/jetbrains-mono.CFJaiWaY.woff2";
|
|
@@ -63,7 +63,7 @@ var $$Base = createComponent(($$result, $$props, $$slots) => {
|
|
|
63
63
|
document.addEventListener('astro:before-swap', (event) => { event.newDocument.documentElement.dataset.theme = document.documentElement.dataset.theme; });
|
|
64
64
|
document.addEventListener('astro:after-swap', restoreWebrTheme);
|
|
65
65
|
<\/script>${renderHead($$result)}</head><body>${renderSlot($$result, $$slots["default"])}</body></html>`;
|
|
66
|
-
}, "/
|
|
66
|
+
}, "/home/runner/work/webr/webr/src/layouts/Base.astro", void 0);
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/components/dialogs.tsx
|
|
69
69
|
var root;
|
|
@@ -1034,6 +1034,7 @@ function ComposerCombobox({ label, value, options, onChange, icon, allowCustom =
|
|
|
1034
1034
|
className: "composer-select-option",
|
|
1035
1035
|
children: [
|
|
1036
1036
|
option.icon && /* @__PURE__ */ jsx("span", {
|
|
1037
|
+
className: "composer-select-option-icon",
|
|
1037
1038
|
"aria-hidden": "true",
|
|
1038
1039
|
children: option.icon
|
|
1039
1040
|
}),
|
|
@@ -1110,6 +1111,7 @@ function ProjectPicker({ projects, projectId, onChange, onAddProject }) {
|
|
|
1110
1111
|
}
|
|
1111
1112
|
//#endregion
|
|
1112
1113
|
//#region src/components/LaunchSelectors.tsx
|
|
1114
|
+
var machineIcon = (machine) => machine.id === "local" ? /* @__PURE__ */ jsx(Monitor, { size: 14 }) : /* @__PURE__ */ jsx(Server, { size: 14 });
|
|
1113
1115
|
function LaunchSelectors({ machine, machines, projects, projectId, harness, model, onMachineChange, onProjectChange, onHarnessChange, onModelChange, onAddProject }) {
|
|
1114
1116
|
const models = machine.harnesses.find((choice) => choice.id === harness)?.models ?? [];
|
|
1115
1117
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -1119,8 +1121,9 @@ function LaunchSelectors({ machine, machines, projects, projectId, harness, mode
|
|
|
1119
1121
|
label: "Machine",
|
|
1120
1122
|
value: machine.id,
|
|
1121
1123
|
onChange: onMachineChange,
|
|
1122
|
-
icon:
|
|
1124
|
+
icon: machineIcon(machine),
|
|
1123
1125
|
options: machines.map((choice) => ({
|
|
1126
|
+
icon: machineIcon(choice),
|
|
1124
1127
|
value: choice.id,
|
|
1125
1128
|
label: `${choice.name}${choice.connected ? "" : " · Not connected"}`,
|
|
1126
1129
|
shortLabel: choice.name,
|
|
@@ -1519,7 +1522,7 @@ function NewThreadView({ projects, machines, selectedProjectId, onOpenSidebar })
|
|
|
1519
1522
|
children: "Threads"
|
|
1520
1523
|
}),
|
|
1521
1524
|
/* @__PURE__ */ jsx("h1", { children: "What do you want to build today?" }),
|
|
1522
|
-
machine.connected && machine.
|
|
1525
|
+
machine.connected && machine.writable && (!machineProjects.length || creatingWorkspace) ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1523
1526
|
/* @__PURE__ */ jsx("p", { children: !machineProjects.length ? "This Herdr session has no projects yet." : "Add a project to this Herdr session." }),
|
|
1524
1527
|
/* @__PURE__ */ jsx(CreateWorkspace, {
|
|
1525
1528
|
machineId: machine.id,
|
|
@@ -1588,7 +1591,7 @@ function NewThreadView({ projects, machines, selectedProjectId, onOpenSidebar })
|
|
|
1588
1591
|
onProjectChange: changeProject,
|
|
1589
1592
|
onHarnessChange: changeHarness,
|
|
1590
1593
|
onModelChange: setModel,
|
|
1591
|
-
onAddProject: machine.connected && machine.
|
|
1594
|
+
onAddProject: machine.connected && machine.writable ? () => setCreatingWorkspace(true) : void 0
|
|
1592
1595
|
}),
|
|
1593
1596
|
/* @__PURE__ */ jsx(Tooltip$1, {
|
|
1594
1597
|
label: worktree ? "new worktree" : "current checkout",
|
|
@@ -1816,11 +1819,9 @@ function InviteDialog({ invite, onClose }) {
|
|
|
1816
1819
|
] }) : /* @__PURE__ */ jsxs(Dialog.Description, {
|
|
1817
1820
|
className: "dialog-message",
|
|
1818
1821
|
children: [
|
|
1819
|
-
"
|
|
1820
|
-
/* @__PURE__ */ jsx("code", { children: "--lan" }),
|
|
1821
|
-
" or ",
|
|
1822
|
+
"No network address was found for other devices. Start Webr with ",
|
|
1822
1823
|
/* @__PURE__ */ jsx("code", { children: "--origin <url>" }),
|
|
1823
|
-
"
|
|
1824
|
+
" if you reach it through a proxy."
|
|
1824
1825
|
]
|
|
1825
1826
|
}),
|
|
1826
1827
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -4264,7 +4265,7 @@ function RuntimeApp({ page, bootstrap, threadId, projectId }) {
|
|
|
4264
4265
|
machines,
|
|
4265
4266
|
selectedProjectId: projectId,
|
|
4266
4267
|
onOpenSidebar: toggleSidebar
|
|
4267
|
-
}),
|
|
4268
|
+
}, projectId),
|
|
4268
4269
|
page === "settings" && /* @__PURE__ */ jsx(SettingsView, { onOpenSidebar: toggleSidebar }),
|
|
4269
4270
|
page === "missing" && /* @__PURE__ */ jsxs("main", {
|
|
4270
4271
|
className: "not-found",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
|
|
2
|
+
import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_CnGYDmxV.mjs";
|
|
3
|
+
import { t as createComponent } from "./compiler_BiU10Vds.mjs";
|
|
4
|
+
import { n as $$Base, t as App } from "./App_CmESMUHE.mjs";
|
|
4
5
|
//#region src/pages/threads/[id].astro
|
|
5
6
|
var _id__exports = /* @__PURE__ */ __exportAll({
|
|
6
7
|
default: () => $$Id,
|
|
@@ -21,11 +22,11 @@ var $$Id = createComponent(($$result, $$props, $$slots) => {
|
|
|
21
22
|
"client:load": true,
|
|
22
23
|
"data-astro-transition-persist": "webr-app",
|
|
23
24
|
"client:component-hydration": "load",
|
|
24
|
-
"client:component-path": "/
|
|
25
|
+
"client:component-path": "/home/runner/work/webr/webr/src/components/App.tsx",
|
|
25
26
|
"client:component-export": "default"
|
|
26
27
|
})}` })}`;
|
|
27
|
-
}, "/
|
|
28
|
-
var $$file = "/
|
|
28
|
+
}, "/home/runner/work/webr/webr/src/pages/threads/[id].astro", void 0);
|
|
29
|
+
var $$file = "/home/runner/work/webr/webr/src/pages/threads/[id].astro";
|
|
29
30
|
var $$url = "/threads/[id]";
|
|
30
31
|
//#endregion
|
|
31
32
|
//#region \0virtual:astro:page:src/pages/threads/[id]@_@astro
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
|
|
2
|
+
import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_CnGYDmxV.mjs";
|
|
3
|
+
import { t as createComponent } from "./compiler_BiU10Vds.mjs";
|
|
4
|
+
import { n as $$Base, t as App } from "./App_CmESMUHE.mjs";
|
|
4
5
|
//#region src/pages/sessions/[session]/tabs/[tab].astro
|
|
5
6
|
var _tab__exports = /* @__PURE__ */ __exportAll({
|
|
6
7
|
default: () => $$Tab,
|
|
@@ -22,11 +23,11 @@ var $$Tab = createComponent(($$result, $$props, $$slots) => {
|
|
|
22
23
|
"client:load": true,
|
|
23
24
|
"data-astro-transition-persist": "webr-app",
|
|
24
25
|
"client:component-hydration": "load",
|
|
25
|
-
"client:component-path": "/
|
|
26
|
+
"client:component-path": "/home/runner/work/webr/webr/src/components/App.tsx",
|
|
26
27
|
"client:component-export": "default"
|
|
27
28
|
})}` })}`;
|
|
28
|
-
}, "/
|
|
29
|
-
var $$file = "/
|
|
29
|
+
}, "/home/runner/work/webr/webr/src/pages/sessions/[session]/tabs/[tab].astro", void 0);
|
|
30
|
+
var $$file = "/home/runner/work/webr/webr/src/pages/sessions/[session]/tabs/[tab].astro";
|
|
30
31
|
var $$url = "/sessions/[session]/tabs/[tab]";
|
|
31
32
|
//#endregion
|
|
32
33
|
//#region \0virtual:astro:page:src/pages/sessions/[session]/tabs/[tab]@_@astro
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { existsSync, promises } from "node:fs";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
//#region node_modules/.pnpm/unstorage@1.17.5/node_modules/unstorage/drivers/utils/index.mjs
|
|
4
|
+
function defineDriver(factory) {
|
|
5
|
+
return factory;
|
|
6
|
+
}
|
|
7
|
+
function createError(driver, message, opts) {
|
|
8
|
+
const err = new Error(`[unstorage] [${driver}] ${message}`, opts);
|
|
9
|
+
if (Error.captureStackTrace) Error.captureStackTrace(err, createError);
|
|
10
|
+
return err;
|
|
11
|
+
}
|
|
12
|
+
function createRequiredError(driver, name) {
|
|
13
|
+
if (Array.isArray(name)) return createError(driver, `Missing some of the required options ${name.map((n) => "`" + n + "`").join(", ")}`);
|
|
14
|
+
return createError(driver, `Missing required option \`${name}\`.`);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region node_modules/.pnpm/unstorage@1.17.5/node_modules/unstorage/drivers/utils/node-fs.mjs
|
|
18
|
+
function ignoreNotfound(err) {
|
|
19
|
+
return err.code === "ENOENT" || err.code === "EISDIR" ? null : err;
|
|
20
|
+
}
|
|
21
|
+
function ignoreExists(err) {
|
|
22
|
+
return err.code === "EEXIST" ? null : err;
|
|
23
|
+
}
|
|
24
|
+
async function writeFile(path, data, encoding) {
|
|
25
|
+
await ensuredir(dirname(path));
|
|
26
|
+
return promises.writeFile(path, data, encoding);
|
|
27
|
+
}
|
|
28
|
+
function readFile(path, encoding) {
|
|
29
|
+
return promises.readFile(path, encoding).catch(ignoreNotfound);
|
|
30
|
+
}
|
|
31
|
+
function unlink(path) {
|
|
32
|
+
return promises.unlink(path).catch(ignoreNotfound);
|
|
33
|
+
}
|
|
34
|
+
function readdir(dir) {
|
|
35
|
+
return promises.readdir(dir, { withFileTypes: true }).catch(ignoreNotfound).then((r) => r || []);
|
|
36
|
+
}
|
|
37
|
+
async function ensuredir(dir) {
|
|
38
|
+
if (existsSync(dir)) return;
|
|
39
|
+
await ensuredir(dirname(dir)).catch(ignoreExists);
|
|
40
|
+
await promises.mkdir(dir).catch(ignoreExists);
|
|
41
|
+
}
|
|
42
|
+
async function readdirRecursive(dir, ignore, maxDepth) {
|
|
43
|
+
if (ignore && ignore(dir)) return [];
|
|
44
|
+
const entries = await readdir(dir);
|
|
45
|
+
const files = [];
|
|
46
|
+
await Promise.all(entries.map(async (entry) => {
|
|
47
|
+
const entryPath = resolve(dir, entry.name);
|
|
48
|
+
if (entry.isDirectory()) {
|
|
49
|
+
if (maxDepth === void 0 || maxDepth > 0) {
|
|
50
|
+
const dirFiles = await readdirRecursive(entryPath, ignore, maxDepth === void 0 ? void 0 : maxDepth - 1);
|
|
51
|
+
files.push(...dirFiles.map((f) => entry.name + "/" + f));
|
|
52
|
+
}
|
|
53
|
+
} else if (!(ignore && ignore(entry.name))) files.push(entry.name);
|
|
54
|
+
}));
|
|
55
|
+
return files;
|
|
56
|
+
}
|
|
57
|
+
async function rmRecursive(dir) {
|
|
58
|
+
const entries = await readdir(dir);
|
|
59
|
+
await Promise.all(entries.map((entry) => {
|
|
60
|
+
const entryPath = resolve(dir, entry.name);
|
|
61
|
+
if (entry.isDirectory()) return rmRecursive(entryPath).then(() => promises.rmdir(entryPath));
|
|
62
|
+
else return promises.unlink(entryPath);
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region node_modules/.pnpm/unstorage@1.17.5/node_modules/unstorage/drivers/fs-lite.mjs
|
|
67
|
+
var PATH_TRAVERSE_RE = /\.\.:|\.\.$/;
|
|
68
|
+
var DRIVER_NAME = "fs-lite";
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region \0virtual:astro:session-driver
|
|
71
|
+
var _virtual_astro_session_driver_default = defineDriver((opts = {}) => {
|
|
72
|
+
if (!opts.base) throw createRequiredError(DRIVER_NAME, "base");
|
|
73
|
+
opts.base = resolve(opts.base);
|
|
74
|
+
const r = (key) => {
|
|
75
|
+
if (PATH_TRAVERSE_RE.test(key)) throw createError(DRIVER_NAME, `Invalid key: ${JSON.stringify(key)}. It should not contain .. segments`);
|
|
76
|
+
return join(opts.base, key.replace(/:/g, "/"));
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
name: DRIVER_NAME,
|
|
80
|
+
options: opts,
|
|
81
|
+
flags: { maxDepth: true },
|
|
82
|
+
hasItem(key) {
|
|
83
|
+
return existsSync(r(key));
|
|
84
|
+
},
|
|
85
|
+
getItem(key) {
|
|
86
|
+
return readFile(r(key), "utf8");
|
|
87
|
+
},
|
|
88
|
+
getItemRaw(key) {
|
|
89
|
+
return readFile(r(key));
|
|
90
|
+
},
|
|
91
|
+
async getMeta(key) {
|
|
92
|
+
const { atime, mtime, size, birthtime, ctime } = await promises.stat(r(key)).catch(() => ({}));
|
|
93
|
+
return {
|
|
94
|
+
atime,
|
|
95
|
+
mtime,
|
|
96
|
+
size,
|
|
97
|
+
birthtime,
|
|
98
|
+
ctime
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
setItem(key, value) {
|
|
102
|
+
if (opts.readOnly) return;
|
|
103
|
+
return writeFile(r(key), value, "utf8");
|
|
104
|
+
},
|
|
105
|
+
setItemRaw(key, value) {
|
|
106
|
+
if (opts.readOnly) return;
|
|
107
|
+
return writeFile(r(key), value);
|
|
108
|
+
},
|
|
109
|
+
removeItem(key) {
|
|
110
|
+
if (opts.readOnly) return;
|
|
111
|
+
return unlink(r(key));
|
|
112
|
+
},
|
|
113
|
+
getKeys(_base, topts) {
|
|
114
|
+
return readdirRecursive(r("."), opts.ignore, topts?.maxDepth);
|
|
115
|
+
},
|
|
116
|
+
async clear() {
|
|
117
|
+
if (opts.readOnly || opts.noClear) return;
|
|
118
|
+
await rmRecursive(r("."));
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
//#endregion
|
|
123
|
+
export { _virtual_astro_session_driver_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./server_DS45LC4q.mjs";
|
|
2
1
|
import { t as AstroError, x as InvalidComponentArgs } from "./errors_BgIp4W2B.mjs";
|
|
2
|
+
import "./server_CnGYDmxV.mjs";
|
|
3
3
|
//#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/runtime/server/astro-component.js
|
|
4
4
|
function validateArgs(args) {
|
|
5
5
|
if (args.length !== 3) return false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { T as s } from "./server_CnGYDmxV.mjs";
|
|
2
2
|
//#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/core/logger/core.js
|
|
3
3
|
var dateTimeFormat = new Intl.DateTimeFormat([], {
|
|
4
4
|
hour: "2-digit",
|
|
@@ -44,14 +44,14 @@ function getEventPrefix({ level, label }) {
|
|
|
44
44
|
const timestamp = `${dateTimeFormat.format(/* @__PURE__ */ new Date())}`;
|
|
45
45
|
const prefix = [];
|
|
46
46
|
if (level === "error" || level === "warn") {
|
|
47
|
-
prefix.push(
|
|
47
|
+
prefix.push(s.bold(timestamp));
|
|
48
48
|
prefix.push(`[${level.toUpperCase()}]`);
|
|
49
49
|
} else prefix.push(timestamp);
|
|
50
50
|
if (label) prefix.push(`[${label}]`);
|
|
51
|
-
if (level === "error") return
|
|
52
|
-
if (level === "warn") return
|
|
53
|
-
if (prefix.length === 1) return
|
|
54
|
-
return
|
|
51
|
+
if (level === "error") return s.red(prefix.join(" "));
|
|
52
|
+
if (level === "warn") return s.yellow(prefix.join(" "));
|
|
53
|
+
if (prefix.length === 1) return s.dim(prefix[0]);
|
|
54
|
+
return s.dim(prefix[0]) + " " + s.blue(prefix.splice(1).join(" "));
|
|
55
55
|
}
|
|
56
56
|
var AstroLogger = class {
|
|
57
57
|
options;
|