feat: trying to add hashes to scripts

This commit is contained in:
Max Richter
2026-01-10 13:03:13 +01:00
parent e65938ecc2
commit e55f787a29
79 changed files with 4209 additions and 720 deletions

View File

@@ -1,4 +1,4 @@
import { OAuth2Client } from "https://deno.land/x/oauth2_client@v1.0.2/mod.ts";
import { OAuth2Client } from "@cmd-johnson/oauth2-client";
import {
GITEA_CLIENT_ID,
GITEA_CLIENT_SECRET,

View File

@@ -1,8 +1,9 @@
import { FreshContext } from "$fresh/server.ts";
import { Context } from "fresh";
import { State } from "../utils.ts";
class DomainError extends Error {
status = 500;
render?: (ctx: FreshContext) => void;
render?: (ctx: Context<State>) => void;
constructor(public statusText = "Internal Server Error") {
super();
}

View File

@@ -1,7 +1,7 @@
import { rgbToHex } from "@lib/string.ts";
import { createLogger } from "@lib/log/index.ts";
import { generateThumbhash } from "@lib/thumbhash.ts";
import { parseMediaType } from "https://deno.land/std@0.224.0/media_types/parse_media_type.ts";
import { parseMediaType } from "@std/media-types";
import path from "node:path";
import { mkdir } from "node:fs/promises";
import { DATA_DIR } from "@lib/env.ts";

View File

@@ -1,7 +1,7 @@
import { render } from "gfm";
import "https://esm.sh/prismjs@1.29.0/components/prism-typescript?no-check";
import "https://esm.sh/prismjs@1.29.0/components/prism-bash?no-check";
import "https://esm.sh/prismjs@1.29.0/components/prism-rust?no-check";
import "prismjs/components/prism-typescript.js";
import "prismjs/components/prism-bash.js";
import "prismjs/components/prism-rust.js";
export type Document = {
name: string;

View File

@@ -1,6 +1,6 @@
import { firefox } from "npm:playwright-extra";
import { firefox } from "playwright-extra";
import { createStreamResponse } from "@lib/helpers.ts";
import StealthPlugin from "npm:puppeteer-extra-plugin-stealth";
import StealthPlugin from "puppeteer-extra-plugin-stealth";
import * as env from "@lib/env.ts";
firefox.use(StealthPlugin());

View File

@@ -1,4 +1,4 @@
import { z } from "npm:zod";
import { z } from "zod";
import { RecipeResource } from "./marka/schema.ts";
export const IngredientSchema = z.object({

View File

@@ -96,5 +96,7 @@ export async function getAllRecommendations(): Promise<
> {
const keys = cache.keys();
const res = await Promise.all(keys.map((k) => cache.get(k)));
return res.filter((s) => !!s).map((r) => JSON.parse(r));
return res.filter((s) => !!s).map((r) =>
typeof r === "string" ? JSON.parse(r) : r
);
}

View File

@@ -186,3 +186,7 @@ export function removeMarkdownFormatting(text: string): string {
return text;
}
export function fileExtension(fname: string) {
return fname.slice((fname.lastIndexOf(".") - 1 >>> 0) + 2);
}

View File

@@ -1,4 +1,4 @@
import { Bot } from "https://deno.land/x/grammy@v1.36.1/mod.ts";
import { Bot } from "grammy";
import { TELEGRAM_API_KEY } from "@lib/env.ts";
import { createLogger } from "./log/index.ts";