diff --git a/web/package.json b/web/package.json
index 0b4e6d9..8e138d3 100644
--- a/web/package.json
+++ b/web/package.json
@@ -6,7 +6,7 @@
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
- "preview": "vite preview",
+ "preview": "vite preview --base /Prometheus/",
"test": "vitest run",
"test:e2e": "playwright test"
},
diff --git a/web/src/App.tsx b/web/src/App.tsx
index 6b8510d..c6cf12c 100644
--- a/web/src/App.tsx
+++ b/web/src/App.tsx
@@ -1,4 +1,4 @@
-import { BookText, Check, Copy, Download, FileCode2, Github, Loader2, Play, RotateCcw, Share2, Square } from "lucide-react"
+import { BookText, Check, Copy, Download, FileCode2, Github, Loader2, Play, RotateCcw, Share2, Square, TriangleAlert } from "lucide-react"
import { useEffect, useRef, useState } from "react"
import { toast } from "sonner"
@@ -602,6 +602,14 @@ export default function App() {
Share link
+ {preset === "Strong" ? (
+
+
+
+ Strong is very strict and only supports Lua 5.1. It will fail in environments such as the web playground runtime (Lua 5.4).
+
+
+ ) : null}
diff --git a/web/src/e2e/app.spec.ts b/web/src/e2e/app.spec.ts
index 32a757c..d13940e 100644
--- a/web/src/e2e/app.spec.ts
+++ b/web/src/e2e/app.spec.ts
@@ -34,6 +34,22 @@ test("runs input script and shows logs", async ({ page }) => {
await expect(page.getByText("Run works")).toBeVisible()
})
+test("shows a strictness warning for the Strong preset", async ({ page }) => {
+ await page.goto("/")
+ await expect(page.getByRole("heading", { name: "Prometheus Playground" })).toBeVisible()
+
+ const warning = page.getByText("Strong is very strict and only supports Lua 5.1. It will fail in environments such as the web playground runtime (Lua 5.4).")
+ await expect(warning).toBeHidden()
+
+ await page.getByRole("combobox").first().click()
+ await page.getByRole("option", { name: "Strong" }).click()
+ await expect(warning).toBeVisible()
+
+ await page.getByRole("combobox").first().click()
+ await page.getByRole("option", { name: "Medium" }).click()
+ await expect(warning).toBeHidden()
+})
+
test("share link roundtrip keeps the same obfuscated output", async ({ browser, page, context }) => {
await context.grantPermissions(["clipboard-read", "clipboard-write"])
await page.goto("/")
diff --git a/web/src/worker/prometheusRunner.ts b/web/src/worker/prometheusRunner.ts
index d80a401..199c7e2 100644
--- a/web/src/worker/prometheusRunner.ts
+++ b/web/src/worker/prometheusRunner.ts
@@ -16,6 +16,14 @@ type LuaFactoryConstructor = new (
let luaFactoryCtorPromise: Promise | null = null
+function resolveWasmUri(wasmUrl: string): string {
+ if (typeof process !== "undefined" && process.versions?.node && wasmUrl.startsWith("/@fs/")) {
+ return wasmUrl.slice("/@fs".length)
+ }
+
+ return wasmUrl
+}
+
async function getLuaFactoryConstructor(): Promise {
if (luaFactoryCtorPromise) {
return luaFactoryCtorPromise
@@ -174,7 +182,7 @@ export async function runPrometheus(options: PrometheusOptions): Promise void) => void