widefleet 0.3.0 → 0.3.2

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.
Files changed (74) hide show
  1. package/README.md +19 -45
  2. package/bin/widefleet.mjs +58 -0
  3. package/package.json +18 -12
  4. package/esbuild +0 -0
  5. package/licenses/esbuild.txt +0 -21
  6. package/release.json +0 -5
  7. package/starter/.gitignore +0 -19
  8. package/starter/.oxfmtrc.json +0 -33
  9. package/starter/.oxlintrc.json +0 -69
  10. package/starter/AGENTS.md +0 -31
  11. package/starter/LICENSE +0 -21
  12. package/starter/README.md +0 -143
  13. package/starter/package.json +0 -41
  14. package/starter/pnpm-lock.yaml +0 -2374
  15. package/starter/pnpm-workspace.yaml +0 -5
  16. package/starter/src/app.d.ts +0 -15
  17. package/starter/src/app.html +0 -11
  18. package/starter/src/hooks.client.ts +0 -11
  19. package/starter/src/hooks.server.ts +0 -50
  20. package/starter/src/lib/capture-error.ts +0 -48
  21. package/starter/src/lib/errors.ts +0 -42
  22. package/starter/src/lib/server/browser-errors.ts +0 -88
  23. package/starter/src/lib/server/capture-error.ts +0 -24
  24. package/starter/src/lib/server/data.ts +0 -48
  25. package/starter/src/lib/server/identity.ts +0 -30
  26. package/starter/src/routes/+page.server.ts +0 -72
  27. package/starter/src/routes/+page.svelte +0 -45
  28. package/starter/src/routes/photos/[id]/+server.ts +0 -21
  29. package/starter/tools/oxlint/anti-slop/LICENSE +0 -21
  30. package/starter/tools/oxlint/anti-slop/UPSTREAM.md +0 -7
  31. package/starter/tools/oxlint/anti-slop/effect/index.ts +0 -21
  32. package/starter/tools/oxlint/anti-slop/effect/rules/no-manual-effect-error-tag.ts +0 -52
  33. package/starter/tools/oxlint/anti-slop/effect/rules/no-manual-tag-comparison.ts +0 -45
  34. package/starter/tools/oxlint/anti-slop/effect/rules/no-manual-tagged-construction.ts +0 -37
  35. package/starter/tools/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts +0 -52
  36. package/starter/tools/oxlint/anti-slop/effect/rules/prefer-effect-match.ts +0 -54
  37. package/starter/tools/oxlint/anti-slop/effect/shared/tagged-values.ts +0 -97
  38. package/starter/tools/oxlint/anti-slop/index.ts +0 -47
  39. package/starter/tools/oxlint/anti-slop/rules/no-array-filter-map.ts +0 -28
  40. package/starter/tools/oxlint/anti-slop/rules/no-chained-type-assertions.ts +0 -77
  41. package/starter/tools/oxlint/anti-slop/rules/no-conditional-empty-object-spread.ts +0 -49
  42. package/starter/tools/oxlint/anti-slop/rules/no-known-value-widening.ts +0 -415
  43. package/starter/tools/oxlint/anti-slop/rules/no-module-mocking.ts +0 -80
  44. package/starter/tools/oxlint/anti-slop/rules/no-object-parameters.ts +0 -83
  45. package/starter/tools/oxlint/anti-slop/rules/no-reduce-accumulator-copy.ts +0 -109
  46. package/starter/tools/oxlint/anti-slop/rules/no-reflect-apply.ts +0 -28
  47. package/starter/tools/oxlint/anti-slop/rules/no-reflect-get.ts +0 -28
  48. package/starter/tools/oxlint/anti-slop/rules/no-runtime-typeof.ts +0 -77
  49. package/starter/tools/oxlint/anti-slop/rules/no-shape-in-symbol-names.ts +0 -46
  50. package/starter/tools/oxlint/anti-slop/rules/no-unknown-parameters.ts +0 -69
  51. package/starter/tools/oxlint/anti-slop/rules/no-unknown-returns.ts +0 -82
  52. package/starter/tools/oxlint/anti-slop/rules/no-unknown-type-aliases.ts +0 -54
  53. package/starter/tools/oxlint/anti-slop/rules/no-unsafe-dictionary-type.ts +0 -154
  54. package/starter/tools/oxlint/anti-slop/rules/no-widen-then-assert.ts +0 -366
  55. package/starter/tools/oxlint/anti-slop/rules/require-readable-spacing.ts +0 -47
  56. package/starter/tools/oxlint/anti-slop/rules/require-safety-comment-for-type-assertion.ts +0 -131
  57. package/starter/tools/oxlint/anti-slop/shared/array-method.ts +0 -94
  58. package/starter/tools/oxlint/anti-slop/shared/dictionary-types.ts +0 -515
  59. package/starter/tools/oxlint/anti-slop/shared/function-parameters.ts +0 -49
  60. package/starter/tools/oxlint/anti-slop/shared/lexical-type-parameters.ts +0 -61
  61. package/starter/tools/oxlint/anti-slop/shared/reflect-method.ts +0 -24
  62. package/starter/tools/oxlint/anti-slop/shared/scope.ts +0 -15
  63. package/starter/tools/oxlint/anti-slop/shared/type-alias-resolution.ts +0 -250
  64. package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/LICENSE +0 -22
  65. package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/UPSTREAM.md +0 -28
  66. package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/padding-line-ast.ts +0 -51
  67. package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/padding-line-between-statements.ts +0 -906
  68. package/starter/tools/oxlint/anti-slop/vendor/eslint-stylistic/padding-line-options.d.ts +0 -87
  69. package/starter/tools/prepare.ts +0 -5
  70. package/starter/tools/types.ts +0 -18
  71. package/starter/tsconfig.json +0 -17
  72. package/starter/vite.config.ts +0 -8
  73. package/starter/wrangler.jsonc +0 -17
  74. package/widefleet +0 -4
@@ -1,5 +0,0 @@
1
- packages: []
2
- strictPeerDependencies: true
3
- allowBuilds:
4
- esbuild: true
5
- workerd: true
@@ -1,15 +0,0 @@
1
- import type { AppUser } from "./lib/server/identity.ts";
2
-
3
- declare global {
4
- namespace App {
5
- interface Locals {
6
- user: AppUser;
7
- requestId: string;
8
- errorReported?: boolean;
9
- }
10
-
11
- interface Platform {
12
- env: Cloudflare.Env & { WIDEFLEET_DEPLOYMENT_ID?: string };
13
- }
14
- }
15
- }
@@ -1,11 +0,0 @@
1
- <!doctype html>
2
- <html lang="de">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- %sveltekit.head%
7
- </head>
8
- <body data-sveltekit-preload-data="hover">
9
- <div style="display: contents">%sveltekit.body%</div>
10
- </body>
11
- </html>
@@ -1,11 +0,0 @@
1
- import type { ClientInit, HandleClientError } from "@sveltejs/kit/hooks";
2
- import { captureError } from "./lib/capture-error.ts";
3
-
4
- export const init: ClientInit = () => {
5
- window.addEventListener("error", (event) => captureError(event.error ?? event.message));
6
- window.addEventListener("unhandledrejection", (event) => captureError(event.reason));
7
- };
8
-
9
- export const handleError: HandleClientError = ({ kind, error }) => {
10
- if (kind === "unknown" || error.status >= 500) captureError(error);
11
- };
@@ -1,50 +0,0 @@
1
- import { dev, version } from "$app/env";
2
- import { userFromHeaders } from "./lib/server/identity.ts";
3
- import { error } from "@sveltejs/kit";
4
- import type { Handle, HandleServerError } from "@sveltejs/kit/hooks";
5
- import { captureError } from "./lib/server/capture-error.ts";
6
- import { receiveBrowserError } from "./lib/server/browser-errors.ts";
7
-
8
- export const handle: Handle = async ({ event, resolve }) => {
9
- event.locals.requestId = crypto.randomUUID();
10
-
11
- if (dev) {
12
- event.locals.user = {
13
- id: "local-development",
14
- name: "Lokale Entwicklung",
15
- email: null,
16
- groups: [],
17
- };
18
- } else {
19
- const identity = userFromHeaders(event.request.headers);
20
-
21
- if (identity.isErr()) error(401, "Bitte über die Plattform anmelden.");
22
- event.locals.user = identity.value;
23
- }
24
-
25
- if (event.url.pathname === "/_widefleet/errors") return receiveBrowserError(event);
26
-
27
- const response = await resolve(event);
28
-
29
- const entry = JSON.stringify({
30
- widefleet: 1,
31
- kind: "request",
32
- source: "server",
33
- buildId: version,
34
- deploymentId: event.platform?.env.WIDEFLEET_DEPLOYMENT_ID ?? null,
35
- requestId: event.locals.requestId,
36
- route: event.route.id ?? event.url.pathname,
37
- method: event.request.method,
38
- status: response.status,
39
- message: `${event.request.method} ${event.route.id ?? event.url.pathname}: ${response.status}`,
40
- });
41
-
42
- if (response.status >= 500 && !event.locals.errorReported) console.error(entry);
43
- else console.info(entry);
44
-
45
- return response;
46
- };
47
-
48
- export const handleError: HandleServerError = ({ kind, error: cause, event }) => {
49
- if (kind === "unknown" || cause.status >= 500) captureError(cause, event);
50
- };
@@ -1,48 +0,0 @@
1
- import { browser, dev, version } from "$app/env";
2
- import { describeError } from "./errors.ts";
3
-
4
- const recent = new Map<string, number>();
5
-
6
- let windowStart = 0;
7
-
8
- let sent = 0;
9
-
10
- /** Report a handled browser failure. Automatic hooks use this same bounded transport. */
11
- export const captureError = (cause: unknown) => {
12
- if (!browser || dev) return;
13
-
14
- try {
15
- const now = Date.now();
16
-
17
- if (now - windowStart >= 60_000) {
18
- recent.clear();
19
- windowStart = now;
20
- sent = 0;
21
- }
22
-
23
- if (sent >= 20) return;
24
- const details = describeError(cause);
25
- const key = `${details.message}\n${details.stack}`;
26
-
27
- if (recent.has(key)) return;
28
- recent.set(key, now);
29
- sent += 1;
30
-
31
- void fetch("/_widefleet/errors", {
32
- method: "POST",
33
- headers: { "content-type": "application/json" },
34
- body: JSON.stringify({
35
- id: crypto.randomUUID(),
36
- buildId: version,
37
- route: location.pathname.slice(0, 1024),
38
- ...details,
39
- }),
40
- keepalive: true,
41
- credentials: "same-origin",
42
- }).catch(() => {
43
- // Reporting is best-effort and must never create another unhandled rejection.
44
- });
45
- } catch {
46
- // Error handling must not affect application behavior, including during page teardown.
47
- }
48
- };
@@ -1,42 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const browserError = z.strictObject({
4
- id: z.uuid(),
5
- buildId: z.string().min(1).max(128),
6
- message: z.string().min(1).max(4096),
7
- stack: z.string().max(16384).nullable(),
8
- route: z
9
- .string()
10
- .max(1024)
11
- .regex(/^\/(?!\/)[^?#]*$/),
12
- });
13
-
14
- export const describeError = (cause: unknown) => {
15
- if (cause instanceof Error) {
16
- let stack = cause.stack ?? `${cause.name}: ${cause.message}`;
17
- let current = cause.cause;
18
- const seen = new Set([cause]);
19
-
20
- while (current instanceof Error && !seen.has(current) && seen.size < 5) {
21
- seen.add(current);
22
- stack += `\nCaused by: ${current.stack ?? current.message}`;
23
- current = current.cause;
24
- }
25
-
26
- return { message: cause.message.slice(0, 4096) || cause.name, stack: stack.slice(0, 16384) };
27
- }
28
-
29
- const reported = z.object({ message: z.string(), stack: z.string().optional() }).safeParse(cause);
30
-
31
- if (reported.success)
32
- return {
33
- message: reported.data.message.slice(0, 4096) || "Unknown error",
34
- stack: reported.data.stack?.slice(0, 16384) ?? null,
35
- };
36
- const text = z.string().safeParse(cause);
37
-
38
- return {
39
- message: text.success ? text.data.slice(0, 4096) || "Unknown error" : "Non-Error exception",
40
- stack: null,
41
- };
42
- };
@@ -1,88 +0,0 @@
1
- import { z } from "zod";
2
- import type { RequestEvent } from "@sveltejs/kit";
3
- import { browserError } from "../errors.ts";
4
-
5
- const windows = new Map<string, { start: number; count: number }>();
6
-
7
- const duplicates = new Map<string, number>();
8
-
9
- export const receiveBrowserError = async (event: RequestEvent) => {
10
- const { request, url } = event;
11
-
12
- if (request.method !== "POST") return new Response(null, { status: 405 });
13
-
14
- if (request.headers.get("origin") !== url.origin) return new Response(null, { status: 403 });
15
-
16
- if (!request.headers.get("content-type")?.startsWith("application/json"))
17
- return new Response(null, { status: 415 });
18
-
19
- const now = Date.now();
20
-
21
- for (const [key, value] of windows) {
22
- if (now - value.start >= 60_000) windows.delete(key);
23
- }
24
-
25
- for (const [key, timestamp] of duplicates) {
26
- if (now - timestamp >= 60_000) duplicates.delete(key);
27
- }
28
-
29
- const user = event.locals.user.id;
30
- const window = windows.get(user) ?? { start: now, count: 0 };
31
-
32
- if (window.count >= 30 || (!windows.has(user) && windows.size >= 1000))
33
- return new Response(null, { status: 429, headers: { "retry-after": "60" } });
34
- window.count += 1;
35
- windows.set(user, window);
36
-
37
- const reader = request.body?.getReader();
38
-
39
- if (!reader) return new Response(null, { status: 400 });
40
- const buffer = new Uint8Array(32 * 1024);
41
- let length = 0;
42
-
43
- try {
44
- while (true) {
45
- const part = await reader.read();
46
-
47
- if (part.done) break;
48
- const value = z.instanceof(Uint8Array).parse(part.value);
49
-
50
- if (length + value.length > buffer.length) {
51
- await reader.cancel();
52
-
53
- return new Response(null, { status: 413 });
54
- }
55
-
56
- buffer.set(value, length);
57
- length += value.length;
58
- }
59
-
60
- const parsed = browserError.safeParse(
61
- JSON.parse(new TextDecoder().decode(buffer.subarray(0, length))),
62
- );
63
-
64
- if (!parsed.success) return new Response(null, { status: 400 });
65
- const entry = parsed.data;
66
- const key = `${user}:${entry.id}`;
67
-
68
- if (!duplicates.has(key)) {
69
- if (duplicates.size >= 1000) return new Response(null, { status: 429 });
70
- duplicates.set(key, now);
71
- console.error(
72
- JSON.stringify({
73
- widefleet: 1,
74
- kind: "error",
75
- source: "browser",
76
- ...entry,
77
- requestId: event.locals.requestId,
78
- }),
79
- );
80
- }
81
-
82
- return new Response(null, { status: 204 });
83
- } catch {
84
- return new Response(null, { status: 400 });
85
- } finally {
86
- reader.releaseLock();
87
- }
88
- };
@@ -1,24 +0,0 @@
1
- import { version } from "$app/env";
2
- import type { RequestEvent } from "@sveltejs/kit";
3
- import { describeError } from "../errors.ts";
4
-
5
- /** Report a handled technical failure without exposing its details in the response. */
6
- export const captureError = (cause: unknown, event: RequestEvent) => {
7
- try {
8
- console.error(
9
- JSON.stringify({
10
- widefleet: 1,
11
- kind: "error",
12
- source: "server",
13
- buildId: version,
14
- deploymentId: event.platform?.env.WIDEFLEET_DEPLOYMENT_ID ?? null,
15
- requestId: event.locals.requestId,
16
- route: event.route.id ?? event.url.pathname,
17
- ...describeError(cause),
18
- }),
19
- );
20
- event.locals.errorReported = true;
21
- } catch {
22
- // A reporting failure must not replace the original application error.
23
- }
24
- };
@@ -1,48 +0,0 @@
1
- import { env } from "cloudflare:workers";
2
- import { Result, TaggedError } from "better-result";
3
- import { z } from "zod";
4
-
5
- export class DataUnavailable extends TaggedError("DataUnavailable")<{
6
- message: string;
7
- cause: unknown;
8
- }> {}
9
-
10
- const note = z.object({
11
- id: z.uuid(),
12
- author: z.string(),
13
- message: z.string(),
14
- photo: z.string().nullable(),
15
- created_at: z.string(),
16
- });
17
-
18
- export const database = () =>
19
- Result.tryPromise({
20
- try: async () => {
21
- await env.DB.prepare(
22
- "CREATE TABLE IF NOT EXISTS notes (id TEXT PRIMARY KEY, author_id TEXT NOT NULL, author TEXT NOT NULL, message TEXT NOT NULL, photo TEXT, created_at TEXT NOT NULL)",
23
- ).run();
24
-
25
- return env.DB;
26
- },
27
- catch: (cause) =>
28
- new DataUnavailable({ message: "Die Datenbank ist gerade nicht erreichbar.", cause }),
29
- });
30
-
31
- export const listNotes = () =>
32
- Result.gen(async function* () {
33
- const db = yield* Result.await(database());
34
-
35
- return Result.tryPromise({
36
- try: async () => {
37
- const result = await db
38
- .prepare(
39
- "SELECT id, author, message, photo, created_at FROM notes ORDER BY created_at DESC LIMIT 100",
40
- )
41
- .all();
42
-
43
- return z.array(note).parse(result.results);
44
- },
45
- catch: (cause) =>
46
- new DataUnavailable({ message: "Notizen konnten nicht geladen werden.", cause }),
47
- });
48
- });
@@ -1,30 +0,0 @@
1
- import { Result, TaggedError } from "better-result";
2
- import { z } from "zod";
3
-
4
- const accessContext = z.strictObject({
5
- id: z.string().min(1),
6
- name: z.string(),
7
- email: z.string().nullable(),
8
- groups: z.array(z.string()),
9
- });
10
-
11
- export type AppUser = z.infer<typeof accessContext>;
12
-
13
- export class InvalidIdentity extends TaggedError("InvalidIdentity")<{ message: string }> {}
14
-
15
- // These headers are trustworthy only on the app's private, authenticated ingress.
16
- // The platform proxy removes client-supplied identity headers before SSO verification.
17
- export const userFromHeaders = (headers: Headers) => {
18
- const identity = accessContext.safeParse({
19
- id: headers.get("x-auth-request-user"),
20
- name: headers.get("x-auth-request-preferred-username") ?? "",
21
- email: headers.get("x-auth-request-email"),
22
- groups: (headers.get("x-auth-request-groups") ?? "")
23
- .split(",")
24
- .flatMap((group) => (group.trim() ? [group.trim()] : [])),
25
- });
26
-
27
- return identity.success
28
- ? Result.ok(identity.data)
29
- : Result.err(new InvalidIdentity({ message: "A verified platform identity is required" }));
30
- };
@@ -1,72 +0,0 @@
1
- import { env } from "cloudflare:workers";
2
- import { error, fail } from "@sveltejs/kit";
3
- import { Result } from "better-result";
4
- import { z } from "zod";
5
- import { database, DataUnavailable, listNotes } from "../lib/server/data.ts";
6
- import type { Actions, PageServerLoad } from "./$types";
7
-
8
- export const load: PageServerLoad = async ({ locals, setHeaders }) => {
9
- setHeaders({ "cache-control": "private, no-store" });
10
- const notes = await listNotes();
11
-
12
- if (notes.isErr()) error(503, notes.error.message);
13
-
14
- return { title: env.APP_NAME, user: locals.user, notes: notes.value };
15
- };
16
-
17
- export const actions: Actions = {
18
- default: async ({ request, locals }) => {
19
- const fields = await request.formData();
20
- const message = z.string().trim().min(1).max(500).safeParse(fields.get("message"));
21
- const photo = fields.get("photo");
22
-
23
- if (!message.success)
24
- return fail(400, { message: "Bitte eine Notiz mit höchstens 500 Zeichen eingeben." });
25
-
26
- if (
27
- !(photo instanceof File) ||
28
- photo.size === 0 ||
29
- photo.size > 5 * 1024 * 1024 ||
30
- !["image/jpeg", "image/png", "image/webp"].includes(photo.type)
31
- ) {
32
- return fail(400, {
33
- message: "Bitte ein Foto als JPEG, PNG oder WebP auswählen (höchstens 5 MB).",
34
- });
35
- }
36
-
37
- const db = await database();
38
-
39
- if (db.isErr()) return fail(503, { message: db.error.message });
40
- const id = crypto.randomUUID();
41
- const key = `photos/${id}`;
42
-
43
- const saved = await Result.tryPromise({
44
- try: async () => {
45
- await env.FILES.put(key, await photo.arrayBuffer(), {
46
- httpMetadata: { contentType: photo.type },
47
- });
48
-
49
- try {
50
- await db.value
51
- .prepare(
52
- "INSERT INTO notes (id, author_id, author, message, photo, created_at) VALUES (?, ?, ?, ?, ?, ?)",
53
- )
54
- .bind(id, locals.user.id, locals.user.name, message.data, id, new Date().toISOString())
55
- .run();
56
- } catch (cause) {
57
- await env.FILES.delete(key);
58
- throw cause;
59
- }
60
- },
61
- catch: (cause) =>
62
- new DataUnavailable({
63
- message: "Die Notiz konnte nicht gespeichert werden. Bitte erneut versuchen.",
64
- cause,
65
- }),
66
- });
67
-
68
- if (saved.isErr()) return fail(503, { message: saved.error.message });
69
-
70
- return { saved: true };
71
- },
72
- };
@@ -1,45 +0,0 @@
1
- <script lang="ts">
2
- import type { ActionData, PageData } from "./$types";
3
-
4
- let { data, form }: { data: PageData; form: ActionData } = $props();
5
- </script>
6
-
7
- <svelte:head><title>{data.title}</title></svelte:head>
8
- <main>
9
- <header><p class="eyebrow">UNSER TEAM</p><h1>{data.title}</h1><p>Beobachtungen, Ideen und kleine Fortschritte aus unserem Alltag.</p><p class="identity">Angemeldet als {data.user.name || data.user.id}</p></header>
10
- <section aria-labelledby="new-note"><h2 id="new-note">Was möchtest du teilen?</h2>
11
- {#if form?.message}<p role="alert">{form.message}</p>{/if}
12
- {#if form?.saved}<p role="status">Deine Notiz wurde gespeichert.</p>{/if}
13
- <form method="POST" enctype="multipart/form-data"><label for="message">Deine Notiz</label><textarea id="message" name="message" required maxlength="500" rows="4" placeholder="Was gibt es Neues?"></textarea><label for="photo">Ein Foto dazu</label><input id="photo" name="photo" type="file" accept="image/jpeg,image/png,image/webp" required aria-describedby="photo-hint" /><p id="photo-hint" class="hint">JPEG, PNG oder WebP, bis 5 MB.</p><button>Notiz teilen</button></form>
14
- </section>
15
- <section aria-labelledby="notes"><h2 id="notes">Aus dem Team</h2>
16
- {#if data.notes.length === 0}<p>Noch ist es hier ruhig. Teile die erste Notiz mit deinem Team.</p>{:else}<div class="notes">{#each data.notes as note (note.id)}<article>{#if note.photo}<img src={`/photos/${note.photo}`} alt={`Foto zur Notiz von ${note.author}`} loading="lazy" />{/if}<div class="content"><p>{note.message}</p><footer>{note.author}<br /><time datetime={note.created_at}>{new Date(note.created_at).toISOString().slice(0, 10)}</time></footer></div></article>{/each}</div>{/if}
17
- </section>
18
- </main>
19
-
20
- <style>
21
- :global(body) { margin: 0; background: #f4f2ed; color: #23362e; font-family: ui-sans-serif, system-ui, sans-serif; }
22
- main { max-width: 920px; margin: 64px auto; padding: 0 24px; }
23
- header { max-width: 650px; margin-bottom: 40px; }
24
- .eyebrow { color: #587165; font-size: .75rem; letter-spacing: .15em; font-weight: 700; }
25
- h1 { font-size: clamp(2.4rem, 7vw, 4rem); letter-spacing: -.055em; margin: 16px 0; line-height: 1.05; }
26
- h2 { font-size: 1.25rem; margin-top: 0; }
27
- p { line-height: 1.65; }
28
- .identity, .hint, footer { font-size: .85rem; color: #587165; }
29
- section { margin: 32px 0; }
30
- section:first-of-type { background: #fff; border: 1px solid #d7dfd7; border-radius: 12px; padding: 28px; }
31
- label { display: block; margin-top: 20px; font-weight: 600; }
32
- textarea, input, button { font: inherit; }
33
- textarea { display: block; width: 100%; box-sizing: border-box; margin: 8px 0 20px; border: 1px solid #9eafa3; border-radius: 6px; padding: 12px; resize: vertical; }
34
- input { margin-top: 10px; max-width: 100%; }
35
- button { border: none; border-radius: 6px; background: #245e43; color: #fff; padding: 13px 22px; cursor: pointer; margin-top: 12px; }
36
- button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid #a97b2a; outline-offset: 3px; }
37
- .notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; }
38
- article { border: 1px solid #d7dfd7; border-radius: 12px; overflow: hidden; background: white; }
39
- img { width: 100%; height: 240px; object-fit: cover; }
40
- .content { padding: 20px; }
41
- .content p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0; }
42
- footer { margin-top: 24px; line-height: 1.6; }
43
- [role="alert"] { color: #962e27; }
44
- [role="status"] { color: #245e43; }
45
- </style>
@@ -1,21 +0,0 @@
1
- import { env } from "cloudflare:workers";
2
- import { error, type RequestHandler } from "@sveltejs/kit";
3
- import { z } from "zod";
4
-
5
- export const GET: RequestHandler = async ({ params }) => {
6
- const id = z.uuid().safeParse(params["id"]);
7
-
8
- if (!id.success) error(404, "Foto nicht gefunden.");
9
- const file = await env.FILES.get(`photos/${id.data}`);
10
-
11
- if (!file) error(404, "Foto nicht gefunden.");
12
-
13
- return new Response(await file.arrayBuffer(), {
14
- headers: {
15
- "content-type": file.httpMetadata?.contentType ?? "application/octet-stream",
16
- "cache-control": "private, no-store",
17
- "x-content-type-options": "nosniff",
18
- "content-security-policy": "default-src 'none'; sandbox",
19
- },
20
- });
21
- };
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Dillon Mulroy
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,7 +0,0 @@
1
- # Upstream provenance
2
-
3
- Source: https://github.com/dmmulroy/anti-slop
4
-
5
- Commit: `c44ef22ca116d0ba62a3ff663a0bd13a3f3fa40b`
6
-
7
- Copied from `skills/install-anti-slop/assets/anti-slop/` using the bundled installation script. All generic rules are enabled. Effect rules are present but inactive because the project does not use Effect. No source modifications. Upstream and nested third-party licenses are retained.
@@ -1,21 +0,0 @@
1
- import { eslintCompatPlugin } from "@oxlint/plugins";
2
-
3
- import { noManualEffectErrorTagRule } from "./rules/no-manual-effect-error-tag.ts";
4
- import { noManualTagComparisonRule } from "./rules/no-manual-tag-comparison.ts";
5
- import { noManualTaggedConstructionRule } from "./rules/no-manual-tagged-construction.ts";
6
- import { noServiceConstructorImportsRule } from "./rules/no-service-constructor-imports.ts";
7
- import { preferEffectMatchRule } from "./rules/prefer-effect-match.ts";
8
-
9
- /** Opt-in Oxlint rules for Effect service and Layer architecture. */
10
- const antiSlopEffectPlugin = eslintCompatPlugin({
11
- meta: { name: "anti-slop-effect" },
12
- rules: {
13
- "no-manual-effect-error-tag": noManualEffectErrorTagRule,
14
- "no-manual-tag-comparison": noManualTagComparisonRule,
15
- "no-manual-tagged-construction": noManualTaggedConstructionRule,
16
- "no-service-constructor-imports": noServiceConstructorImportsRule,
17
- "prefer-effect-match": preferEffectMatchRule,
18
- },
19
- });
20
-
21
- export default antiSlopEffectPlugin;
@@ -1,52 +0,0 @@
1
- import { defineRule } from "@oxlint/plugins";
2
-
3
- import {
4
- isInsideBroadEffectHandler,
5
- isReasonTagMember,
6
- isTagMember,
7
- tagMemberFromComparison,
8
- } from "../shared/tagged-values.ts";
9
-
10
- export const noManualEffectErrorTagRule = defineRule({
11
- meta: {
12
- type: "problem",
13
- docs: {
14
- description:
15
- "Use Effect tagged error handlers instead of manually branching on `_tag` in a catch handler.",
16
- },
17
- messages: {
18
- tag: "Use Effect.catchTag or Effect.catchTags instead of manually discriminating a tagged error in a broad Effect catch handler.",
19
- reason:
20
- "Use Effect.catchReason or Effect.catchReasons instead of manually discriminating a tagged `reason` in a broad Effect catch handler.",
21
- },
22
- },
23
- createOnce(context) {
24
- return {
25
- BinaryExpression(node) {
26
- const tagMember = tagMemberFromComparison(node);
27
- if (
28
- tagMember === undefined ||
29
- !isInsideBroadEffectHandler(node)
30
- ) {
31
- return;
32
- }
33
- context.report({
34
- node,
35
- messageId: isReasonTagMember(tagMember) ? "reason" : "tag",
36
- });
37
- },
38
- SwitchStatement(node) {
39
- if (
40
- !isTagMember(node.discriminant) ||
41
- !isInsideBroadEffectHandler(node)
42
- ) {
43
- return;
44
- }
45
- context.report({
46
- node,
47
- messageId: isReasonTagMember(node.discriminant) ? "reason" : "tag",
48
- });
49
- },
50
- };
51
- },
52
- });
@@ -1,45 +0,0 @@
1
- import { defineRule } from "@oxlint/plugins";
2
-
3
- import {
4
- isInsideBroadEffectHandler,
5
- isTagMember,
6
- tagMemberFromComparison,
7
- } from "../shared/tagged-values.ts";
8
-
9
- export const noManualTagComparisonRule = defineRule({
10
- meta: {
11
- type: "problem",
12
- docs: {
13
- description:
14
- "Use Effect Match or Predicate helpers instead of manually branching on `_tag`.",
15
- },
16
- messages: {
17
- manualComparison:
18
- "Use Match.tag/Match.tags for tagged-value branching, or Predicate.isTagged for a simple reusable predicate.",
19
- manualSwitch:
20
- "Use Match.value(value).pipe(Match.tag/Match.tags/Match.tagsExhaustive) or the tagged enum `$match` helper instead of switching on `_tag`.",
21
- },
22
- },
23
- createOnce(context) {
24
- return {
25
- BinaryExpression(node) {
26
- if (
27
- tagMemberFromComparison(node) === undefined ||
28
- isInsideBroadEffectHandler(node)
29
- ) {
30
- return;
31
- }
32
- context.report({ node, messageId: "manualComparison" });
33
- },
34
- SwitchStatement(node) {
35
- if (
36
- !isTagMember(node.discriminant) ||
37
- isInsideBroadEffectHandler(node)
38
- ) {
39
- return;
40
- }
41
- context.report({ node, messageId: "manualSwitch" });
42
- },
43
- };
44
- },
45
- });