adds eslint

This commit is contained in:
geoffsee
2025-06-24 17:29:52 -04:00
committed by Geoff Seemueller
parent 9698fc6f3b
commit 02c3253343
169 changed files with 4896 additions and 4804 deletions

View File

@@ -1,24 +1,20 @@
import { types } from "mobx-state-tree";
import renderPage from "@open-gsio/client/server";
import renderPage from '@open-gsio/client/server';
import { types } from 'mobx-state-tree';
export default types
.model("StaticAssetStore", {})
.volatile((self) => ({
.model('StaticAssetStore', {})
.volatile(self => ({
env: {} as Env,
ctx: {} as ExecutionContext,
}))
.actions((self) => ({
.actions(self => ({
setEnv(env: Env) {
self.env = env;
},
setCtx(ctx: ExecutionContext) {
self.ctx = ctx;
},
async handleSsr(
url: string,
headers: Headers,
env: Vike.PageContext.env,
) {
async handleSsr(url: string, headers: Headers, env: Vike.PageContext.env) {
const pageContextInit = {
urlOriginal: url,
headersOriginal: headers,
@@ -29,7 +25,6 @@ export default types
const pageContext = await renderPage(pageContextInit);
const { httpResponse } = pageContext;
if (!httpResponse) {
return null;
} else {
@@ -41,8 +36,8 @@ export default types
try {
return await env.ASSETS.fetch(request);
} catch (error) {
console.error("Error serving static asset:", error);
return new Response("Asset not found", { status: 404 });
console.error('Error serving static asset:', error);
return new Response('Asset not found', { status: 404 });
}
},
}));