@pablopunk/webr 0.3.4 → 0.3.7
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/client/_astro/{App.8tCy4opo.js → App.CuhTptJe.js} +1 -1
- package/dist/server/chunks/{App_1wfxblxd.mjs → App_DDOnT1vx.mjs} +5 -4
- package/dist/server/chunks/{_id__kbExCoFS.mjs → _id__CRXKeG9Q.mjs} +3 -4
- package/dist/server/chunks/{_tab__4yg4_FHP.mjs → _tab__1TQX6GGq.mjs} +3 -4
- package/dist/server/chunks/{compiler_BiU10Vds.mjs → compiler_BnrQvXXD.mjs} +1 -1
- package/dist/server/chunks/{console_BOi2ismd.mjs → console_BOJ74XrS.mjs} +1 -1
- package/dist/server/chunks/{index_DRfLd22k.mjs → index_Bvv1gpI0.mjs} +2 -3
- package/dist/server/chunks/{new_kkCg5K67.mjs → new_CBpgizdT.mjs} +3 -4
- package/dist/server/chunks/{node_BcIF-BVp.mjs → node_C8FqXy_n.mjs} +4 -5
- package/dist/server/chunks/{server_CnGYDmxV.mjs → server_dfdLOyV2.mjs} +44 -1
- package/dist/server/chunks/{settings_BpXfHFqU.mjs → settings_BahL_Diu.mjs} +3 -4
- package/dist/server/chunks/{sharp_qIaxzsTp.mjs → sharp_8J8zk4Wd.mjs} +2 -2
- package/dist/server/entry.mjs +9 -10
- package/package.json +5 -2
- package/server/plugin/index.ts +2 -1
- package/server/update/index.ts +2 -1
- package/server/update/package-manager.ts +3 -1
- package/src/lib/project-icons.ts +11 -0
- package/dist/server/chunks/dist_CpTFMtqT.mjs +0 -9199
- package/dist/server/chunks/rolldown-runtime_BMI-E3GI.mjs +0 -44
|
@@ -1,5 +1,5 @@
|
|
|
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_dfdLOyV2.mjs";
|
|
2
|
+
import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
|
|
3
3
|
import { ViewTransition, createContext, memo, useCallback, useContext, useDeferredValue, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { Archive, ArchiveRestore, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Bot, Check, ChevronDown, ChevronRight, Circle, CircleAlert, CircleCheck, CircleHelp, Command, Copy, Cpu, Folder, FolderTree, GitBranch, ImagePlus, LayoutList, LoaderCircle, MessageCircleQuestion, Mic, Monitor, Moon, PanelLeft, PanelLeftClose, PanelLeftOpen, Pencil, Plus, Search, Server, Settings2, Square, SquarePen, SquareTerminal, Sun, TerminalSquare, Trash2, TriangleAlert, X } from "lucide-react";
|
|
5
5
|
import { createRoot } from "react-dom/client";
|
|
@@ -4422,7 +4422,8 @@ function PaneTabs({ panes, focusedPane, onFocusPane, renderPane }) {
|
|
|
4422
4422
|
//#endregion
|
|
4423
4423
|
//#region src/components/ThreadView.tsx
|
|
4424
4424
|
function ThreadView({ thread, connected, canControl, onFocusPane, focusedPane, windowStart, narrow }) {
|
|
4425
|
-
const
|
|
4425
|
+
const showingLaunch = connected && (isLaunching(thread) || launchFailed(thread));
|
|
4426
|
+
const detached = connected && thread.bindingState === "detached" && !showingLaunch;
|
|
4426
4427
|
useEffect(() => {
|
|
4427
4428
|
if (detached) navigate(`/new?project=${encodeURIComponent(thread.projectId)}`);
|
|
4428
4429
|
}, [detached, thread.projectId]);
|
|
@@ -4434,7 +4435,7 @@ function ThreadView({ thread, connected, canControl, onFocusPane, focusedPane, w
|
|
|
4434
4435
|
canControl,
|
|
4435
4436
|
onFocus: () => onFocusPane(pane.id)
|
|
4436
4437
|
}, pane.terminalId) : null;
|
|
4437
|
-
if (
|
|
4438
|
+
if (showingLaunch) return /* @__PURE__ */ jsx(LaunchProgress, { thread });
|
|
4438
4439
|
const strip = {
|
|
4439
4440
|
panes: thread.panes,
|
|
4440
4441
|
focusedPane,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as $$Base, t as App } from "./App_1wfxblxd.mjs";
|
|
1
|
+
import { S as createAstro, V as __exportAll, i as renderComponent, u as renderTemplate } from "./server_dfdLOyV2.mjs";
|
|
2
|
+
import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
|
|
3
|
+
import { n as $$Base, t as App } from "./App_DDOnT1vx.mjs";
|
|
5
4
|
//#region src/pages/threads/[id].astro
|
|
6
5
|
var _id__exports = /* @__PURE__ */ __exportAll({
|
|
7
6
|
default: () => $$Id,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as $$Base, t as App } from "./App_1wfxblxd.mjs";
|
|
1
|
+
import { S as createAstro, V as __exportAll, i as renderComponent, u as renderTemplate } from "./server_dfdLOyV2.mjs";
|
|
2
|
+
import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
|
|
3
|
+
import { n as $$Base, t as App } from "./App_DDOnT1vx.mjs";
|
|
5
4
|
//#region src/pages/sessions/[session]/tabs/[tab].astro
|
|
6
5
|
var _tab__exports = /* @__PURE__ */ __exportAll({
|
|
7
6
|
default: () => $$Tab,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import "./server_dfdLOyV2.mjs";
|
|
1
2
|
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 { T as s } from "./
|
|
1
|
+
import { T as s } from "./server_dfdLOyV2.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",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as createComponent } from "./compiler_BiU10Vds.mjs";
|
|
1
|
+
import { S as createAstro, V as __exportAll } from "./server_dfdLOyV2.mjs";
|
|
2
|
+
import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
|
|
4
3
|
//#region src/pages/index.astro
|
|
5
4
|
var pages_exports = /* @__PURE__ */ __exportAll({
|
|
6
5
|
default: () => $$Index,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as $$Base, t as App } from "./App_1wfxblxd.mjs";
|
|
1
|
+
import { S as createAstro, V as __exportAll, i as renderComponent, u as renderTemplate } from "./server_dfdLOyV2.mjs";
|
|
2
|
+
import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
|
|
3
|
+
import { n as $$Base, t as App } from "./App_DDOnT1vx.mjs";
|
|
5
4
|
//#region src/pages/new.astro
|
|
6
5
|
var new_exports = /* @__PURE__ */ __exportAll({
|
|
7
6
|
default: () => $$New,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as createAstro, V as __exportAll, b as unescapeHTML, d as maybeRenderHead, p as addAttribute, t as spreadAttributes, u as renderTemplate } from "./server_dfdLOyV2.mjs";
|
|
2
2
|
import { $ as UnsupportedImageFormat, A as MissingGetFontFileRequestUrl, F as NoImageMetadata, Q as UnsupportedImageConversion, T as LocalImageUsedWrongly, W as RemoteImageNotAllowed, b as IncompatibleDescriptorOptions, d as ExpectedNotESMImage, f as FailedToFetchRemoteImageDimensions, j as MissingImageDimension, l as ExpectedImage, p as FontFamilyNotFound, t as AstroError, u as ExpectedImageOptions, w as InvalidImageService, y as ImageMissingAlt } from "./errors_BgIp4W2B.mjs";
|
|
3
|
-
import { S as createAstro, b as unescapeHTML, d as maybeRenderHead, p as addAttribute, t as spreadAttributes, u as renderTemplate } from "./server_CnGYDmxV.mjs";
|
|
4
3
|
import { d as isRemotePath, f as joinPaths, h as removeQueryString, t as isRemoteAllowed, u as isParentDirectory } from "./remote_BxuVLM0r.mjs";
|
|
5
|
-
import { t as createComponent } from "./
|
|
6
|
-
import { t as createConsoleLogger } from "./
|
|
4
|
+
import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
|
|
5
|
+
import { t as createConsoleLogger } from "./console_BOJ74XrS.mjs";
|
|
7
6
|
import path from "node:path";
|
|
8
7
|
import { fileURLToPath } from "node:url";
|
|
9
8
|
import { readFile } from "node:fs/promises";
|
|
@@ -1343,7 +1342,7 @@ var cssFitValues = [
|
|
|
1343
1342
|
];
|
|
1344
1343
|
async function getConfiguredImageService() {
|
|
1345
1344
|
if (!globalThis?.astroAsset?.imageService) {
|
|
1346
|
-
const { default: service } = await import("./
|
|
1345
|
+
const { default: service } = await import("./sharp_8J8zk4Wd.mjs").catch((e) => {
|
|
1347
1346
|
const error = new AstroError(InvalidImageService);
|
|
1348
1347
|
error.cause = e;
|
|
1349
1348
|
throw error;
|
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
import { B as OnlyResponseCanBeReturned, K as ResponseSentError, L as NoMatchingImport, M as MissingMediaQueryDirective, P as NoClientOnlyHint, R as NoMatchingRenderer, Z as UnavailableAstroGlobal, c as EndpointDidNotReturnAResponse, t as AstroError } from "./errors_BgIp4W2B.mjs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
import * as z from "zod/v4";
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
|
+
var __create = Object.create;
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __esmMin = (fn, res, err) => () => {
|
|
12
|
+
if (err) throw err[0];
|
|
13
|
+
try {
|
|
14
|
+
return fn && (res = fn(fn = 0)), res;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
throw err = [e], e;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
20
|
+
var __exportAll = (all, no_symbols) => {
|
|
21
|
+
let target = {};
|
|
22
|
+
for (var name in all) __defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true
|
|
25
|
+
});
|
|
26
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
var __copyProps = (to, from, except, desc) => {
|
|
30
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
31
|
+
key = keys[i];
|
|
32
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
33
|
+
get: ((k) => from[k]).bind(null, key),
|
|
34
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return to;
|
|
38
|
+
};
|
|
39
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
40
|
+
value: mod,
|
|
41
|
+
enumerable: true
|
|
42
|
+
}) : target, mod));
|
|
43
|
+
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
44
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
45
|
+
//#endregion
|
|
3
46
|
//#region node_modules/.pnpm/@oslojs+encoding@1.1.0/node_modules/@oslojs/encoding/dist/hex.js
|
|
4
47
|
function encodeHexUpperCase(data) {
|
|
5
48
|
let result = "";
|
|
@@ -2749,4 +2792,4 @@ function spreadAttributes(values = {}, _name, { class: scopedClassName } = {}) {
|
|
|
2749
2792
|
return markHTMLString(output);
|
|
2750
2793
|
}
|
|
2751
2794
|
//#endregion
|
|
2752
|
-
export { REROUTABLE_STATUS_CODES as A, isRoute404 as C, ASTRO_GENERATOR as D, ASTRO_ERROR_HEADER as E, responseSentSymbol as F, decodeKey as I, decryptString as L, fetchStateSymbol as M, nodeRequestAbortControllerCleanupSymbol as N, DEFAULT_404_COMPONENT as O, originPathnameSymbol as P, generateCspDigest as R, createAstro as S, s as T, pushDirective as _, chunkToString as a, unescapeHTML as b, renderSlotToString as c, maybeRenderHead as d, renderHead as f, normalizeCspResourceEntry as g, isRenderInstruction as h, renderComponent as i, clientAddressSymbol as j, REDIRECT_STATUS_CODES as k, isRenderTemplateResult as l, createRenderInstruction as m, renderPage as n, createSlotValueFromString as o, addAttribute as p, renderJSX as r, renderSlot as s, spreadAttributes as t, renderTemplate as u, isAstroComponentFactory as v, isRoute500 as w, renderEndpoint as x, markHTMLString as y };
|
|
2795
|
+
export { REROUTABLE_STATUS_CODES as A, __esmMin as B, isRoute404 as C, ASTRO_GENERATOR as D, ASTRO_ERROR_HEADER as E, responseSentSymbol as F, __require as H, decodeKey as I, decryptString as L, fetchStateSymbol as M, nodeRequestAbortControllerCleanupSymbol as N, DEFAULT_404_COMPONENT as O, originPathnameSymbol as P, generateCspDigest as R, createAstro as S, s as T, __toCommonJS as U, __exportAll as V, __toESM as W, pushDirective as _, chunkToString as a, unescapeHTML as b, renderSlotToString as c, maybeRenderHead as d, renderHead as f, normalizeCspResourceEntry as g, isRenderInstruction as h, renderComponent as i, clientAddressSymbol as j, REDIRECT_STATUS_CODES as k, isRenderTemplateResult as l, createRenderInstruction as m, renderPage as n, createSlotValueFromString as o, addAttribute as p, renderJSX as r, renderSlot as s, spreadAttributes as t, renderTemplate as u, isAstroComponentFactory as v, isRoute500 as w, renderEndpoint as x, markHTMLString as y, __commonJSMin as z };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as $$Base, t as App } from "./App_1wfxblxd.mjs";
|
|
1
|
+
import { S as createAstro, V as __exportAll, i as renderComponent, u as renderTemplate } from "./server_dfdLOyV2.mjs";
|
|
2
|
+
import { t as createComponent } from "./compiler_BnrQvXXD.mjs";
|
|
3
|
+
import { n as $$Base, t as App } from "./App_DDOnT1vx.mjs";
|
|
5
4
|
//#region src/pages/settings.astro
|
|
6
5
|
var settings_exports = /* @__PURE__ */ __exportAll({
|
|
7
6
|
default: () => $$Settings,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as UnsupportedImageFormat, F as NoImageMetadata, N as MissingSharp, t as AstroError } from "./errors_BgIp4W2B.mjs";
|
|
2
|
-
import { a as resolveDefaultOutputFormat, i as detector, n as baseService, r as parseQuality } from "./
|
|
2
|
+
import { a as resolveDefaultOutputFormat, i as detector, n as baseService, r as parseQuality } from "./node_C8FqXy_n.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/assets/services/sharp.js
|
|
4
4
|
var sharp;
|
|
5
5
|
var qualityTable = {
|
|
@@ -45,7 +45,7 @@ function resolveSharpEncoderOptions(transform, inputFormat, serviceConfig = {})
|
|
|
45
45
|
async function loadSharp() {
|
|
46
46
|
let sharpImport;
|
|
47
47
|
try {
|
|
48
|
-
sharpImport = (await import("
|
|
48
|
+
sharpImport = (await import("sharp")).default;
|
|
49
49
|
} catch {
|
|
50
50
|
throw new AstroError(MissingSharp);
|
|
51
51
|
}
|
package/dist/server/entry.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as REROUTABLE_STATUS_CODES, B as __esmMin, C as isRoute404, D as ASTRO_GENERATOR, E as ASTRO_ERROR_HEADER, F as responseSentSymbol$1, H as __require, I as decodeKey, L as decryptString, M as fetchStateSymbol, N as nodeRequestAbortControllerCleanupSymbol, O as DEFAULT_404_COMPONENT, P as originPathnameSymbol, R as generateCspDigest, T as s, U as __toCommonJS, V as __exportAll, W as __toESM, _ as pushDirective, a as chunkToString, c as renderSlotToString, g as normalizeCspResourceEntry, h as isRenderInstruction, i as renderComponent, j as clientAddressSymbol, k as REDIRECT_STATUS_CODES, l as isRenderTemplateResult, n as renderPage, o as createSlotValueFromString, r as renderJSX, u as renderTemplate, v as isAstroComponentFactory, w as isRoute500, x as renderEndpoint, y as markHTMLString, z as __commonJSMin } from "./chunks/server_dfdLOyV2.mjs";
|
|
2
2
|
import { C as InvalidGetStaticPathsReturn, D as LocalsReassigned, E as LocalsNotAnObject, G as ReservedSlotName, H as PrerenderClientAddressNotAvailable, I as NoManifestAvailable, J as SessionStorageInitError, K as ResponseSentError, O as MiddlewareNoDataOrNextCalled, S as InvalidGetStaticPathsEntry, U as PrerenderDynamicEndpointPathCollide, V as PageNumberParamNotFound, X as StaticClientAddressNotAvailable, Y as SessionStorageSaveError, _ as GetStaticPathsInvalidRouteParam, a as AstroResponseHeadersReassigned, et as i18nNoLocaleFoundInPath, g as GetStaticPathsExpectedParams, h as ForbiddenRewrite, i as ActionsReturnedInvalidDataError, k as MiddlewareNotAResponse, n as isAstroError, o as CacheNotEnabled, q as RewriteWithBodyUsed, r as ActionNotFoundError, s as ClientAddressNotAvailable, t as AstroError, v as GetStaticPathsRequired, z as NoMatchingStaticPathFound } from "./chunks/errors_BgIp4W2B.mjs";
|
|
3
|
-
import { A as REROUTABLE_STATUS_CODES, C as isRoute404, D as ASTRO_GENERATOR, E as ASTRO_ERROR_HEADER, F as responseSentSymbol$1, I as decodeKey, L as decryptString, M as fetchStateSymbol, N as nodeRequestAbortControllerCleanupSymbol, O as DEFAULT_404_COMPONENT, P as originPathnameSymbol, R as generateCspDigest, T as s, _ as pushDirective, a as chunkToString, c as renderSlotToString, g as normalizeCspResourceEntry, h as isRenderInstruction, i as renderComponent, j as clientAddressSymbol, k as REDIRECT_STATUS_CODES, l as isRenderTemplateResult, n as renderPage, o as createSlotValueFromString, r as renderJSX, u as renderTemplate, v as isAstroComponentFactory, w as isRoute500, x as renderEndpoint, y as markHTMLString } from "./chunks/server_CnGYDmxV.mjs";
|
|
4
3
|
import { _ as slash, a as collapseDuplicateSlashes, c as hasFileExtension, f as joinPaths, g as removeTrailingForwardSlash, i as collapseDuplicateLeadingSlashes, l as isInternalPath, m as removeLeadingForwardSlash, n as matchPattern, o as collapseDuplicateTrailingSlashes, p as prependForwardSlash$1, r as appendForwardSlash, s as fileExtension, v as stripRequestBase, y as trimSlashes } from "./chunks/remote_BxuVLM0r.mjs";
|
|
5
|
-
import { n as AstroIntegrationLogger, r as astroToRuntimeLogger, t as createConsoleLogger } from "./chunks/
|
|
4
|
+
import { n as AstroIntegrationLogger, r as astroToRuntimeLogger, t as createConsoleLogger } from "./chunks/console_BOJ74XrS.mjs";
|
|
6
5
|
import React, { createElement, memo } from "react";
|
|
7
6
|
import ReactDOM from "react-dom/server";
|
|
8
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -2426,12 +2425,12 @@ var renderers = [Object.assign({
|
|
|
2426
2425
|
].map(deserializeRouteInfo);
|
|
2427
2426
|
//#endregion
|
|
2428
2427
|
//#region \0virtual:astro:pages
|
|
2429
|
-
var _page0 = () => import("./chunks/
|
|
2430
|
-
var _page1 = () => import("./chunks/
|
|
2431
|
-
var _page2 = () => import("./chunks/
|
|
2432
|
-
var _page3 = () => import("./chunks/
|
|
2433
|
-
var _page4 = () => import("./chunks/
|
|
2434
|
-
var _page5 = () => import("./chunks/
|
|
2428
|
+
var _page0 = () => import("./chunks/node_C8FqXy_n.mjs").then((n) => n.t);
|
|
2429
|
+
var _page1 = () => import("./chunks/new_CBpgizdT.mjs");
|
|
2430
|
+
var _page2 = () => import("./chunks/_tab__1TQX6GGq.mjs");
|
|
2431
|
+
var _page3 = () => import("./chunks/settings_BahL_Diu.mjs");
|
|
2432
|
+
var _page4 = () => import("./chunks/_id__CRXKeG9Q.mjs");
|
|
2433
|
+
var _page5 = () => import("./chunks/index_Bvv1gpI0.mjs");
|
|
2435
2434
|
var pageMap = /* @__PURE__ */ new Map([
|
|
2436
2435
|
["node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node.js", _page0],
|
|
2437
2436
|
["src/pages/new.astro", _page1],
|
|
@@ -2442,7 +2441,7 @@ var pageMap = /* @__PURE__ */ new Map([
|
|
|
2442
2441
|
]);
|
|
2443
2442
|
//#endregion
|
|
2444
2443
|
//#region \0virtual:astro:manifest
|
|
2445
|
-
var _manifest = deserializeManifest({"rootDir":"file:///home/runner/work/webr/webr/","cacheDir":"file:///home/runner/work/webr/webr/node_modules/.astro/","outDir":"file:///home/runner/work/webr/webr/dist/","srcDir":"file:///home/runner/work/webr/webr/src/","publicDir":"file:///home/runner/work/webr/webr/public/","buildClientDir":"file:///home/runner/work/webr/webr/dist/client/","buildServerDir":"file:///home/runner/work/webr/webr/dist/server/","adapterName":"@astrojs/node","assetsDir":"_astro","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"page","component":"_server-islands.astro","params":["name"],"segments":[[{"content":"_server-islands","dynamic":false,"spread":false}],[{"content":"name","dynamic":true,"spread":false}]],"pattern":"^\\/_server-islands\\/([^/]+?)\\/?$","prerender":false,"isIndex":false,"fallbackRoutes":[],"route":"/_server-islands/[name]","origin":"internal","distURL":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/_image","component":"node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node.js","params":[],"pathname":"/_image","pattern":"^\\/_image\\/?$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"type":"endpoint","prerender":false,"fallbackRoutes":[],"distURL":[],"isIndex":false,"origin":"internal","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/new","isIndex":false,"type":"page","pattern":"^\\/new\\/?$","segments":[[{"content":"new","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/new.astro","pathname":"/new","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/sessions/[session]/tabs/[tab]","isIndex":false,"type":"page","pattern":"^\\/sessions\\/([^/]+?)\\/tabs\\/([^/]+?)\\/?$","segments":[[{"content":"sessions","dynamic":false,"spread":false}],[{"content":"session","dynamic":true,"spread":false}],[{"content":"tabs","dynamic":false,"spread":false}],[{"content":"tab","dynamic":true,"spread":false}]],"params":["session","tab"],"component":"src/pages/sessions/[session]/tabs/[tab].astro","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/settings","isIndex":false,"type":"page","pattern":"^\\/settings\\/?$","segments":[[{"content":"settings","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/settings.astro","pathname":"/settings","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/threads/[id]","isIndex":false,"type":"page","pattern":"^\\/threads\\/([^/]+?)\\/?$","segments":[[{"content":"threads","dynamic":false,"spread":false}],[{"content":"id","dynamic":true,"spread":false}]],"params":["id"],"component":"src/pages/threads/[id].astro","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/","isIndex":true,"type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}}],"serverLike":true,"middlewareMode":"classic","base":"/","trailingSlash":"ignore","compressHTML":"jsx","componentMetadata":[["/home/runner/work/webr/webr/src/pages/new.astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/sessions/[session]/tabs/[tab].astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/settings.astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/threads/[id].astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var l=(n,t)=>{let i=async()=>{await(await n())()},e=typeof t.value==\"object\"?t.value:void 0,s={timeout:e==null?void 0:e.timeout};\"requestIdleCallback\"in window?window.requestIdleCallback(i,s):setTimeout(i,s.timeout||200)};(self.Astro||(self.Astro={})).idle=l;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var n=(a,t)=>{let i=async()=>{await(await a())()};if(t.value){let e=matchMedia(t.value);e.matches?i():e.addEventListener(\"change\",i,{once:!0})}};(self.Astro||(self.Astro={})).media=n;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var a=(s,i,o)=>{let r=async()=>{await(await s())()},t=typeof i.value==\"object\"?i.value:void 0,c={rootMargin:t==null?void 0:t.rootMargin},n=new IntersectionObserver(e=>{for(let l of e)if(l.isIntersecting){n.disconnect(),r();break}},c);for(let e of o.children)n.observe(e)};(self.Astro||(self.Astro={})).visible=a;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000noop-middleware":"virtual_astro_middleware.mjs","\u0000virtual:astro:server-island-manifest":"chunks/_virtual_astro_server-island-manifest_C1Q2srgE.mjs","\u0000virtual:astro:session-driver":"chunks/_virtual_astro_session-driver_Dp7RXjOf.mjs","\u0000virtual:astro:actions/noop-entrypoint":"chunks/noop-entrypoint_Z3zFhrGC.mjs","/home/runner/work/webr/webr/node_modules/.pnpm/@astrojs+react@7.0.0_@types+node@22.20.4_@types+react-dom@19.3.0_@types+react@19.3.0__@_02aa85dceaccf3d763325676dd8540a8/node_modules/@astrojs/react/dist/vnode-children.js":"chunks/vnode-children_BSi0H4PL.mjs","@astrojs/node/server.js":"entry.mjs","\u0000virtual:astro:page:src/pages/threads/[id]@_@astro":"chunks/
|
|
2444
|
+
var _manifest = deserializeManifest({"rootDir":"file:///home/runner/work/webr/webr/","cacheDir":"file:///home/runner/work/webr/webr/node_modules/.astro/","outDir":"file:///home/runner/work/webr/webr/dist/","srcDir":"file:///home/runner/work/webr/webr/src/","publicDir":"file:///home/runner/work/webr/webr/public/","buildClientDir":"file:///home/runner/work/webr/webr/dist/client/","buildServerDir":"file:///home/runner/work/webr/webr/dist/server/","adapterName":"@astrojs/node","assetsDir":"_astro","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"page","component":"_server-islands.astro","params":["name"],"segments":[[{"content":"_server-islands","dynamic":false,"spread":false}],[{"content":"name","dynamic":true,"spread":false}]],"pattern":"^\\/_server-islands\\/([^/]+?)\\/?$","prerender":false,"isIndex":false,"fallbackRoutes":[],"route":"/_server-islands/[name]","origin":"internal","distURL":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/_image","component":"node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node.js","params":[],"pathname":"/_image","pattern":"^\\/_image\\/?$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"type":"endpoint","prerender":false,"fallbackRoutes":[],"distURL":[],"isIndex":false,"origin":"internal","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/new","isIndex":false,"type":"page","pattern":"^\\/new\\/?$","segments":[[{"content":"new","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/new.astro","pathname":"/new","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/sessions/[session]/tabs/[tab]","isIndex":false,"type":"page","pattern":"^\\/sessions\\/([^/]+?)\\/tabs\\/([^/]+?)\\/?$","segments":[[{"content":"sessions","dynamic":false,"spread":false}],[{"content":"session","dynamic":true,"spread":false}],[{"content":"tabs","dynamic":false,"spread":false}],[{"content":"tab","dynamic":true,"spread":false}]],"params":["session","tab"],"component":"src/pages/sessions/[session]/tabs/[tab].astro","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/settings","isIndex":false,"type":"page","pattern":"^\\/settings\\/?$","segments":[[{"content":"settings","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/settings.astro","pathname":"/settings","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"_astro/App.B7RjqN_I.css"}],"routeData":{"route":"/threads/[id]","isIndex":false,"type":"page","pattern":"^\\/threads\\/([^/]+?)\\/?$","segments":[[{"content":"threads","dynamic":false,"spread":false}],[{"content":"id","dynamic":true,"spread":false}]],"params":["id"],"component":"src/pages/threads/[id].astro","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"route":"/","isIndex":true,"type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"fallbackRoutes":[],"distURL":[],"origin":"project","_meta":{"trailingSlash":"ignore"}}}],"serverLike":true,"middlewareMode":"classic","base":"/","trailingSlash":"ignore","compressHTML":"jsx","componentMetadata":[["/home/runner/work/webr/webr/src/pages/new.astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/sessions/[session]/tabs/[tab].astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/settings.astro",{"propagation":"none","containsHead":true}],["/home/runner/work/webr/webr/src/pages/threads/[id].astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var l=(n,t)=>{let i=async()=>{await(await n())()},e=typeof t.value==\"object\"?t.value:void 0,s={timeout:e==null?void 0:e.timeout};\"requestIdleCallback\"in window?window.requestIdleCallback(i,s):setTimeout(i,s.timeout||200)};(self.Astro||(self.Astro={})).idle=l;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var n=(a,t)=>{let i=async()=>{await(await a())()};if(t.value){let e=matchMedia(t.value);e.matches?i():e.addEventListener(\"change\",i,{once:!0})}};(self.Astro||(self.Astro={})).media=n;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var a=(s,i,o)=>{let r=async()=>{await(await s())()},t=typeof i.value==\"object\"?i.value:void 0,c={rootMargin:t==null?void 0:t.rootMargin},n=new IntersectionObserver(e=>{for(let l of e)if(l.isIntersecting){n.disconnect(),r();break}},c);for(let e of o.children)n.observe(e)};(self.Astro||(self.Astro={})).visible=a;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000noop-middleware":"virtual_astro_middleware.mjs","\u0000virtual:astro:server-island-manifest":"chunks/_virtual_astro_server-island-manifest_C1Q2srgE.mjs","\u0000virtual:astro:session-driver":"chunks/_virtual_astro_session-driver_Dp7RXjOf.mjs","\u0000virtual:astro:actions/noop-entrypoint":"chunks/noop-entrypoint_Z3zFhrGC.mjs","/home/runner/work/webr/webr/node_modules/.pnpm/@astrojs+react@7.0.0_@types+node@22.20.4_@types+react-dom@19.3.0_@types+react@19.3.0__@_02aa85dceaccf3d763325676dd8540a8/node_modules/@astrojs/react/dist/vnode-children.js":"chunks/vnode-children_BSi0H4PL.mjs","@astrojs/node/server.js":"entry.mjs","\u0000virtual:astro:page:src/pages/threads/[id]@_@astro":"chunks/_id__CRXKeG9Q.mjs","\u0000virtual:astro:page:src/pages/sessions/[session]/tabs/[tab]@_@astro":"chunks/_tab__1TQX6GGq.mjs","\u0000virtual:astro:page:src/pages/index@_@astro":"chunks/index_Bvv1gpI0.mjs","\u0000virtual:astro:page:src/pages/new@_@astro":"chunks/new_CBpgizdT.mjs","\u0000virtual:astro:page:node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_C8FqXy_n.mjs","\u0000virtual:astro:page:src/pages/settings@_@astro":"chunks/settings_BahL_Diu.mjs","/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/dist/assets/services/sharp.js":"chunks/sharp_8J8zk4Wd.mjs","/home/runner/work/webr/webr/src/components/App.tsx":"_astro/App.CuhTptJe.js","/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":"_astro/ClientRouter.astro_astro_type_script_index_0_lang.CTgtIFyY.js","@astrojs/react/client.js":"_astro/client.BDkzSRUN.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-fit@0.10.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-fit/lib/addon-fit.js":"_astro/addon-fit.jgKqzwky.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-web-links@0.11.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-web-links/lib/addon-web-links.js":"_astro/addon-web-links.C9lyQRxI.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+addon-webgl@0.18.0_@xterm+xterm@5.5.0/node_modules/@xterm/addon-webgl/lib/addon-webgl.js":"_astro/addon-webgl.Bd5ox92E.js","/home/runner/work/webr/webr/node_modules/.pnpm/@xterm+xterm@5.5.0/node_modules/@xterm/xterm/lib/xterm.js":"_astro/xterm.B-l5AIf6.js","astro:scripts/before-hydration.js":""},"inlinedScripts":[],"assets":["/apple-touch-icon.png","/brand-mark.png","/favicon-16.png","/favicon-32.png","/favicon.ico","/icon-192.png","/icon-512.png","/icon-maskable-512.png","/manifest.webmanifest","/_astro/App.CuhTptJe.js","/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CTgtIFyY.js","/_astro/addon-fit.jgKqzwky.js","/_astro/addon-web-links.C9lyQRxI.js","/_astro/addon-webgl.Bd5ox92E.js","/_astro/client.BDkzSRUN.js","/_astro/client.Bbg9OBwT.js","/_astro/client.CLSsMr2g.js","/_astro/xterm.B-l5AIf6.js","/_astro/App.B7RjqN_I.css","/_astro/jetbrains-mono.CFJaiWaY.woff2","/_astro/symbols-nerd.CEdkKAK8.woff2"],"buildFormat":"directory","checkOrigin":true,"actionBodySizeLimit":1048576,"serverIslandBodySizeLimit":1048576,"allowedDomains":[],"key":"I0OAi5mWNNmYnbHqxooVtOatZr06ICh0L/yzKPF1b/M=","sessionConfig":{"driver":"unstorage/drivers/fs-lite","options":{"base":"/home/runner/work/webr/webr/node_modules/.astro/sessions"}},"image":{},"devToolbar":{"enabled":false,"debugInfoOutput":""},"logLevel":"info","shouldInjectCspMetaTags":false});
|
|
2446
2445
|
var manifestRoutes = _manifest.routes;
|
|
2447
2446
|
var manifest = Object.assign(_manifest, {
|
|
2448
2447
|
renderers,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pablopunk/webr",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Control your Herdr agents from anywhere.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"herdr",
|
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
"icons": "tsx scripts/build-icons.ts",
|
|
49
49
|
"validate:offline": "tsx scripts/validate-protocol.ts",
|
|
50
50
|
"prepack": "astro build",
|
|
51
|
-
"smoke:install": "tsx scripts/smoke-install.ts"
|
|
51
|
+
"smoke:install": "tsx scripts/smoke-install.ts",
|
|
52
|
+
"screenshots": "tsx scripts/screenshots/capture.ts",
|
|
53
|
+
"screenshots:serve": "tsx scripts/screenshots/serve.ts"
|
|
52
54
|
},
|
|
53
55
|
"dependencies": {
|
|
54
56
|
"@astrojs/node": "11.1.6",
|
|
@@ -83,6 +85,7 @@
|
|
|
83
85
|
"@types/react-dom": "19.3.0",
|
|
84
86
|
"@types/ws": "8.18.2",
|
|
85
87
|
"jsdom": "30.1.1",
|
|
88
|
+
"sharp": "0.35.5",
|
|
86
89
|
"typescript": "5.9.3",
|
|
87
90
|
"vitest": "5.0.3",
|
|
88
91
|
"ws": "8.22.0"
|
package/server/plugin/index.ts
CHANGED
|
@@ -62,6 +62,7 @@ export async function updatePlugin(deps: PluginDeps) {
|
|
|
62
62
|
if (!installedPlugin(deps.run)) return undefined;
|
|
63
63
|
const address = probeAddress(readPluginConfig(pluginConfigDir(deps.run)));
|
|
64
64
|
if ((await isPortOpen(address)) && !(await stopPluginWebr(deps.stateDir, address))) return [`Webr is running on port ${address.port} but the plugin did not start it. Stop it and run "webr install" to use the new version.`];
|
|
65
|
-
const
|
|
65
|
+
const [command, ...args] = deps.launcher ? [deps.launcher.node, deps.launcher.entry] : ['webr'];
|
|
66
|
+
const refreshed = deps.run(command!, [...args, 'install', '--no-open']);
|
|
66
67
|
return refreshed.ok ? quiet(refreshed.output) : [`The new Webr could not refresh the plugin. Run "webr install". ${quiet(refreshed.output).join(' ')}`];
|
|
67
68
|
}
|
package/server/update/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
import { packageInfo } from '../package-info';
|
|
3
3
|
import { fetchLatestVersion, writeCachedLatest } from './latest';
|
|
4
|
-
import { detectPackageManager, globalInstallCommand, installedPackagePath, type InstallCommand } from './package-manager';
|
|
4
|
+
import { detectPackageManager, isNpxRun, globalInstallCommand, installedPackagePath, type InstallCommand } from './package-manager';
|
|
5
5
|
import { isNewerVersion } from './versions';
|
|
6
6
|
|
|
7
7
|
export type UpdateEnvironment = {
|
|
@@ -31,6 +31,7 @@ const restartedPlugin = async (environment: UpdateEnvironment) => (await environ
|
|
|
31
31
|
|
|
32
32
|
export async function runUpdate(environment: UpdateEnvironment) {
|
|
33
33
|
const { name, version } = packageInfo();
|
|
34
|
+
if (isNpxRun(environment.installPath())) return [`Webr ${version} is running through npx. Run "npx @pablopunk/webr@latest install" to refresh the plugin.`, ...(await restartedPlugin(environment))];
|
|
34
35
|
const manager = detectPackageManager(environment.installPath());
|
|
35
36
|
if (!manager) throw new Error('This copy of Webr was not installed globally, so it cannot update itself. If it is a git checkout, pull and rebuild it.');
|
|
36
37
|
const latest = await environment.latestVersion(name);
|
|
@@ -8,8 +8,10 @@ const isInsideNodeModules = (path: string) => /[\\/]node_modules[\\/]/.test(path
|
|
|
8
8
|
const isBunInstall = (path: string) => /[\\/]\.bun[\\/]/.test(path);
|
|
9
9
|
const isPnpmInstall = (path: string) => /[\\/]pnpm[\\/]/.test(path) || /[\\/]\.pnpm[\\/]/.test(path);
|
|
10
10
|
|
|
11
|
+
export const isNpxRun = (path: string) => /[\\/]_npx[\\/]/.test(path);
|
|
12
|
+
|
|
11
13
|
export function detectPackageManager(installPath: string): PackageManager | undefined {
|
|
12
|
-
if (!isInsideNodeModules(installPath)) return undefined;
|
|
14
|
+
if (isNpxRun(installPath) || !isInsideNodeModules(installPath)) return undefined;
|
|
13
15
|
if (isBunInstall(installPath)) return 'bun';
|
|
14
16
|
return isPnpmInstall(installPath) ? 'pnpm' : 'npm';
|
|
15
17
|
}
|
package/src/lib/project-icons.ts
CHANGED
|
@@ -70,6 +70,15 @@ async function iconInDirectory(root: string, directory: string, generic = false)
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
async function childDirectories(directory: string): Promise<string[]> {
|
|
74
|
+
try {
|
|
75
|
+
return (await readdir(directory, { withFileTypes: true })).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort().slice(0, 8);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
if (!unavailable(error)) throw error;
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
73
82
|
async function discover(project: Project): Promise<ProjectIcon | undefined> {
|
|
74
83
|
const directory = project.path.startsWith('~/') ? join(homedir(), project.path.slice(2)) : resolve(project.path);
|
|
75
84
|
let root: string;
|
|
@@ -90,8 +99,10 @@ async function discover(project: Project): Promise<ProjectIcon | undefined> {
|
|
|
90
99
|
} catch (error) {
|
|
91
100
|
if (!unavailable(error)) throw error;
|
|
92
101
|
}
|
|
102
|
+
const sources = await childDirectories(join(root, 'src'));
|
|
93
103
|
const directories = [
|
|
94
104
|
...['', 'public', 'static', 'assets', 'web', 'web/public', 'app', 'app/public', 'src/assets', 'src/app', 'frontend/public'].map((path) => join(root, path)),
|
|
105
|
+
...sources.map((source) => join(root, 'src', source, 'public')),
|
|
95
106
|
...apps.flatMap((app) => ['public', 'src/assets', 'assets'].map((path) => join(root, 'apps', app, path))),
|
|
96
107
|
];
|
|
97
108
|
for (const generic of [false, true]) {
|