shimwrappercheck 0.2.0 → 0.4.0

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 (70) hide show
  1. package/AGENTS.md +4 -0
  2. package/README.md +203 -180
  3. package/dashboard/README.md +13 -0
  4. package/dashboard/app/{agents → [locale]/agents}/page.tsx +14 -17
  5. package/dashboard/app/{config → [locale]/config}/page.tsx +13 -15
  6. package/dashboard/app/[locale]/error.tsx +25 -0
  7. package/dashboard/app/[locale]/layout.tsx +42 -0
  8. package/dashboard/app/[locale]/not-found.tsx +27 -0
  9. package/dashboard/app/[locale]/page.tsx +53 -0
  10. package/dashboard/app/[locale]/settings/page.tsx +741 -0
  11. package/dashboard/app/api/agents-md/route.ts +2 -8
  12. package/dashboard/app/api/check-tools/route.ts +134 -0
  13. package/dashboard/app/api/config/route.ts +2 -8
  14. package/dashboard/app/api/info/route.ts +26 -0
  15. package/dashboard/app/api/run-checks/route.ts +56 -22
  16. package/dashboard/app/api/settings/route.ts +84 -16
  17. package/dashboard/app/api/status/route.ts +16 -4
  18. package/dashboard/app/api/ui-config/route.ts +62 -0
  19. package/dashboard/app/global-error.tsx +31 -0
  20. package/dashboard/app/globals.css +28 -9
  21. package/dashboard/app/layout.tsx +2 -6
  22. package/dashboard/app/not-found.tsx +22 -0
  23. package/dashboard/components/AvailableChecks.tsx +260 -0
  24. package/dashboard/components/CheckCard.tsx +466 -0
  25. package/dashboard/components/CheckCardList.tsx +156 -0
  26. package/dashboard/components/Header.tsx +65 -0
  27. package/dashboard/components/Icons.tsx +20 -0
  28. package/dashboard/components/LayoutContent.tsx +24 -0
  29. package/dashboard/components/MyShimChecks.tsx +257 -0
  30. package/dashboard/components/Nav.tsx +9 -6
  31. package/dashboard/components/SetDocumentLang.tsx +18 -0
  32. package/dashboard/components/SidebarMyShim.tsx +133 -0
  33. package/dashboard/components/StatusCard.tsx +8 -15
  34. package/dashboard/components/TriggerCommandos.tsx +369 -0
  35. package/dashboard/lib/checks.ts +233 -0
  36. package/dashboard/lib/presets.ts +87 -14
  37. package/dashboard/lib/projectRoot.ts +22 -12
  38. package/dashboard/next-env.d.ts +6 -0
  39. package/dashboard/next.config.js +10 -1
  40. package/dashboard/package.json +12 -7
  41. package/dashboard/scripts/find-port-and-dev.js +63 -0
  42. package/dashboard/tailwind.config.js +1 -4
  43. package/dashboard/tsconfig.json +9 -2
  44. package/package.json +25 -3
  45. package/scripts/ai-code-review.sh +217 -0
  46. package/scripts/ai-deductive-review.js +142 -0
  47. package/scripts/cli.js +8 -1
  48. package/scripts/find-free-port.js +21 -0
  49. package/scripts/git-checked.sh +25 -9
  50. package/scripts/init.js +81 -4
  51. package/scripts/prepublish-clean.js +11 -0
  52. package/scripts/run-checks.sh +120 -0
  53. package/scripts/setup.js +1 -0
  54. package/scripts/shim-runner.js +194 -0
  55. package/scripts/supabase-checked.sh +23 -7
  56. package/scripts/update-readme.js +72 -0
  57. package/templates/.dependency-cruiser.json +35 -0
  58. package/templates/.semgrep.example.yml +19 -0
  59. package/templates/eslint.complexity.json +12 -0
  60. package/templates/git-pre-push +13 -9
  61. package/templates/husky-pre-push +10 -7
  62. package/templates/run-checks.sh +80 -27
  63. package/templates/stryker.config.json +16 -0
  64. package/dashboard/.next/cache/config.json +0 -7
  65. package/dashboard/.next/package.json +0 -1
  66. package/dashboard/.next/routes-manifest.json +0 -1
  67. package/dashboard/.next/trace +0 -1
  68. package/dashboard/app/page.tsx +0 -122
  69. package/dashboard/app/settings/page.tsx +0 -422
  70. package/dashboard/package-lock.json +0 -5307
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ /**
4
+ * Catches errors in [locale] routes and shows a fallback instead of 500.
5
+ * Location: app/[locale]/error.tsx
6
+ */
7
+ import { useEffect } from "react";
8
+
9
+ export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
10
+ useEffect(() => {
11
+ console.error("Route error:", error);
12
+ }, [error]);
13
+
14
+ return (
15
+ <div className="min-h-[40vh] flex flex-col items-center justify-center p-8 text-white bg-[#0f0f0f]">
16
+ <h1 className="text-xl font-semibold mb-2">Fehler</h1>
17
+ <p className="text-neutral-400 text-sm mb-4 max-w-md text-center">
18
+ {error.message || "Ein unerwarteter Fehler ist aufgetreten."}
19
+ </p>
20
+ <button type="button" onClick={reset} className="px-4 py-2 rounded bg-white/20 hover:bg-white/30 text-sm">
21
+ Erneut versuchen
22
+ </button>
23
+ </div>
24
+ );
25
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Locale layout: validates locale, loads messages, provides NextIntlClientProvider.
3
+ * Location: app/[locale]/layout.tsx
4
+ */
5
+ import { NextIntlClientProvider } from "next-intl";
6
+ import { getMessages } from "next-intl/server";
7
+ import { hasLocale } from "next-intl";
8
+ import { notFound } from "next/navigation";
9
+ import { routing } from "@/i18n/routing";
10
+ import Header from "@/components/Header";
11
+ import LayoutContent from "@/components/LayoutContent";
12
+ import SetDocumentLang from "@/components/SetDocumentLang";
13
+
14
+ type Props = {
15
+ children: React.ReactNode;
16
+ params: Promise<{ locale: string }>;
17
+ };
18
+
19
+ export default async function LocaleLayout({ children, params }: Props) {
20
+ const { locale } = await params;
21
+ if (!hasLocale(routing.locales, locale)) {
22
+ notFound();
23
+ }
24
+ let messages: Record<string, unknown> | undefined;
25
+ try {
26
+ messages = await getMessages();
27
+ } catch (e) {
28
+ console.error("getMessages failed:", e);
29
+ messages = {};
30
+ }
31
+ const now = new Date();
32
+
33
+ return (
34
+ <NextIntlClientProvider messages={messages ?? {}} locale={locale} timeZone="Europe/Berlin" now={now}>
35
+ <SetDocumentLang />
36
+ <Header />
37
+ <div className="flex flex-1 min-h-0 flex-col w-full bg-[#0f0f0f]">
38
+ <LayoutContent>{children}</LayoutContent>
39
+ </div>
40
+ </NextIntlClientProvider>
41
+ );
42
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * 404 page for [locale]: uses translations and locale-aware links.
3
+ * Location: app/[locale]/not-found.tsx
4
+ */
5
+ "use client";
6
+
7
+ import { useTranslations } from "next-intl";
8
+ import { Link } from "@/i18n/navigation";
9
+
10
+ export default function NotFound() {
11
+ const t = useTranslations("notFound");
12
+ const tCommon = useTranslations("common");
13
+ return (
14
+ <div className="flex flex-col items-center justify-center min-h-[50vh] gap-6 text-white">
15
+ <h1 className="text-2xl font-semibold">{t("title")}</h1>
16
+ <p className="text-white/70">{t("description")}</p>
17
+ <div className="flex gap-4">
18
+ <Link href="/" className="btn btn-primary btn-sm">
19
+ {tCommon("myshim")}
20
+ </Link>
21
+ <Link href="/settings" className="btn btn-outline btn-sm border-white/50 text-white">
22
+ {tCommon("settings")}
23
+ </Link>
24
+ </div>
25
+ </div>
26
+ );
27
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Dashboard home: Check Library.
3
+ * Status und Aktionen sind unter Einstellungen → Information.
4
+ * Location: app/page.tsx
5
+ */
6
+ "use client";
7
+
8
+ import { useEffect, useState } from "react";
9
+ import type { SettingsData } from "@/lib/presets";
10
+ import AvailableChecks from "@/components/AvailableChecks";
11
+
12
+ export default function DashboardPage() {
13
+ const [settings, setSettings] = useState<SettingsData | null>(null);
14
+
15
+ const loadData = () => {
16
+ fetch("/api/settings")
17
+ .then((r) => r.json())
18
+ .then((data) => setSettings(data))
19
+ .catch(() => setSettings(null));
20
+ };
21
+
22
+ useEffect(() => {
23
+ loadData();
24
+ const handler = () => loadData();
25
+ window.addEventListener("settings-updated", handler);
26
+ return () => window.removeEventListener("settings-updated", handler);
27
+ }, []);
28
+
29
+ const saveSettings = (next: SettingsData) => {
30
+ setSettings(next);
31
+ fetch("/api/settings", {
32
+ method: "POST",
33
+ headers: { "Content-Type": "application/json" },
34
+ body: JSON.stringify(next),
35
+ }).then(() => {
36
+ if (typeof window !== "undefined") window.dispatchEvent(new Event("settings-updated"));
37
+ });
38
+ };
39
+
40
+ const handleActivate = saveSettings;
41
+ const handleDeactivate = saveSettings;
42
+
43
+ return (
44
+ <div className="space-y-8 text-white">
45
+ <AvailableChecks
46
+ settings={settings}
47
+ onActivate={handleActivate}
48
+ onDeactivate={handleDeactivate}
49
+ onSave={saveSettings}
50
+ />
51
+ </div>
52
+ );
53
+ }