Frontend uudelleenrakennettu: Astro-komponentit, Wasm pääsäikeessä, ei Workeria

Vanha frontend siirretty temp/. Uusi rakenne:
- StatusBar.astro, Terminal.astro, Editor.astro, Guide.astro
- global.css erillinen
- Wasm pääsäikeessä (ei Worker — yksinkertainen, debugattava)
- Tab-completion, dropdown, projektikortti, Monaco, GUIDE.md
- Ei tokenisointia eikä koodilaboratoriota

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jaakko Vanhala
2026-04-09 20:17:39 +03:00
parent e3fdb91ac5
commit a8c4af0975
9617 changed files with 996171 additions and 5349 deletions

View File

@@ -0,0 +1,73 @@
import nodeFs from "node:fs";
import npath from "node:path";
import { slash } from "../core/path.js";
import { cleanUrl } from "../vite-plugin-utils/index.js";
const FALLBACK_FLAG = "astroFallbackFlag";
function loadFallbackPlugin({
fs,
root
}) {
if (!fs || fs === nodeFs || fs.default === nodeFs) {
return false;
}
const tryLoadModule = async (id) => {
try {
return await fs.promises.readFile(cleanUrl(id), "utf-8");
} catch {
try {
return await fs.promises.readFile(id, "utf-8");
} catch {
try {
const fullpath = new URL("." + id, root);
return await fs.promises.readFile(fullpath, "utf-8");
} catch {
}
}
}
};
return [
{
name: "astro:load-fallback",
enforce: "post",
async resolveId(id, parent) {
if (parent) {
const candidateId = npath.posix.join(npath.posix.dirname(slash(parent)), id);
try {
const stats = await fs.promises.stat(candidateId);
if (!stats.isDirectory()) {
const params = new URLSearchParams(FALLBACK_FLAG);
return `${candidateId}?${params.toString()}`;
}
} catch {
}
}
},
load: {
filter: {
id: new RegExp(`(?:\\?|&)${FALLBACK_FLAG}(?:&|=|$)`)
},
async handler(id) {
const code = await tryLoadModule(id.slice(0, -(1 + FALLBACK_FLAG.length)));
if (code) {
return { code };
}
}
}
},
{
name: "astro:load-fallback-hmr",
enforce: "pre",
handleHotUpdate(context) {
const read = context.read;
context.read = async () => {
const source = await tryLoadModule(context.file);
if (source) return source;
return read.call(context);
};
}
}
];
}
export {
loadFallbackPlugin as default
};