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
package/AGENTS.md CHANGED
@@ -19,3 +19,7 @@ It can be edited via the dashboard (Config → AGENTS.md) so agents and humans s
19
19
 
20
20
  - Keep checks fast; run lint/type/build in `scripts/run-checks.sh`.
21
21
  - When changing shim behavior, update README and docs/SHIM_WRAPPER_CONCEPT.md if needed.
22
+
23
+ ## Hard Rules (optional tools)
24
+
25
+ For full shim checks (SAST, architecture, complexity, mutation, E2E, AI deductive review), projects can install: `dependency-cruiser`, `eslint-plugin-complexity`, `@stryker-mutator/core`, and optionally `semgrep` (CLI). Config templates live in `templates/` (e.g. `.dependency-cruiser.json`, `.semgrep.example.yml`, `stryker.config.json`, `eslint.complexity.json`). Run `npx shimwrappercheck init` to optionally copy these into the project.
package/README.md CHANGED
@@ -1,55 +1,149 @@
1
1
  # shimwrappercheck
2
2
 
3
- CLI shim wrapper that enforces project checks before running a real CLI command.
3
+ CLI-Shim, der Projekt-Checks ausführt, bevor ein echtes CLI-Kommando (z. B. Supabase, Git) läuft. Optional: Web-Dashboard zum Konfigurieren von Presets, Trigger-Befehlen, Checks und AGENTS.md.
4
4
 
5
- Out of the box, this package ships **Supabase**, **Git**, and a **generic shim** (`supabase`, `git`, `shim` bins), but the pattern is generic:
6
- you can reuse the scripts for other CLIs by copying/adapting them in your repo.
7
-
8
- This package provides a `supabase` bin that you can use via `npx supabase ...` or `npm run supabase:checked -- ...`.
9
- It is repo-agnostic: you plug in your own `scripts/run-checks.sh` and optional hooks.
5
+ ---
10
6
 
11
7
  ## Features
12
8
 
13
- - Wraps a CLI command and enforces checks before deploy/push (Supabase + Git wrappers included, generic shim for anything else)
14
- - Diff-aware checks (frontend/backend) based on staged/unstaged changes
15
- - Command filtering (only run checks/hooks for specific Supabase commands)
16
- - Network retry for flaky Supabase CLI calls
17
- - Post-deploy hooks: health ping + logs
18
- - Auto git push when ahead of upstream (optional)
19
- - AI review integration (Codex default, Cursor fallback)
20
- - Interactive setup wizard that scans your repo and configures everything
21
- - Global installer that drops PATH shims (`supabase`, `git`, `shim`)
22
- - Generic shim supports pre/post hooks
23
- - **Dashboard**: Web UI to view status, run checks, **Presets & check toggles** (Einstellungen), edit `.shimwrappercheckrc`, and **edit AGENTS.md**
24
- - **Presets**: default "Vibe Code" (GitHub + Supabase, all commands); custom presets with provider toggles; check toggles (frontend, backend, AI review)
9
+ ### CLI & Wrapper
10
+
11
+ - **Supabase-, Git- und generischer Shim**: Wraps `supabase`, `git` oder beliebige CLIs; führt vorher Checks aus.
12
+ - **Diff-bewusste Checks**: Frontend/Backend je nach geänderten Dateien (z. B. `src/` vs. `supabase/functions/`).
13
+ - **Befehlsfilter**: Nur für bestimmte Befehle Checks/Hooks (z. B. `functions`, `db`, `migration`, `push`).
14
+ - **Netzwerk-Retry** bei flaky Supabase-CLI-Aufrufen.
15
+ - **Post-Deploy-Hooks**: Health-Ping und Logs nach Deploy.
16
+ - **Optionaler Auto-Push**: Nach Erfolg automatisch `git push`.
17
+ - **AI-Review**: Codex (Standard), Cursor-Fallback; integriert in Checks.
18
+ - **Interaktiver Setup-Wizard**: Repo-Scan, Konfiguration in einem Durchlauf.
19
+ - **Global Install**: PATH-Shims (`supabase`, `git`, `shim`) in z. B. `~/.local/bin`.
20
+
21
+ ### Dashboard (Web-UI)
22
+
23
+ - **Check Library**: Alle integrierten Checks mit Filter (Frontend / Backend / Enforce / Hooks), Suche, Drag & Drop in „My Shim“. Pro Check: **Tool-Status** (ob z. B. ESLint/Deno installiert ist) und **Copy-Paste-Befehl** zum Nachinstallieren.
24
+ - **My Shim (Sidebar)**:
25
+ - **Trigger Commandos**: Tags pro Tab (Enforce / Hooks) – z. B. `git push`, `supabase functions deploy`. Neue Tags mit **Enter** bestätigen; Speichern schreibt `.shimwrappercheckrc` und Presets.
26
+ - **My Checks**: Reihenfolge der aktiven Checks, Suchen, Entfernen, Drag zum Sortieren; „aktualisiert“-Zeitstempel.
27
+ - **Einstellungen**:
28
+ - **Templates**: Preset wählen (z. B. „Vibe Code“), bei aktivem Preset **⋮** (Optionen: Export, Umbenennen). Eigenes Preset: Provider (Supabase/Git) hinzufügen. **Trigger Commandos & My Checks** 1:1 wie in der Sidebar konfigurierbar.
29
+ - **Information**: Port/Version, **Status** (`.shimwrappercheckrc`, Presets-Datei, AGENTS.md, run-checks.sh, Shim Runner, Husky, Git pre-push, Supabase), Projekt-Root, letzter Check-Fehler, **Aktionen** („Nur Checks ausführen“, Config, AGENTS.md), letzte Check-Ausgabe.
30
+ - **Config (Raw)**: `.shimwrappercheckrc` direkt bearbeiten.
31
+ - **AGENTS.md**: Agent-Anweisungen für Cursor/Codex im Dashboard bearbeiten; Änderungen sofort wirksam.
32
+
33
+ ### Checks (Beispiele)
25
34
 
26
- ## Setup (one command)
35
+ - **Frontend**: Lint, Check Mock Data, Test Run, npm Audit, Snyk, **Update README** (Version aus package.json in README syncen).
36
+ - **Backend**: Deno fmt/lint/audit für Supabase Functions.
37
+ - **Beides**: AI Review, SAST, Architecture, Complexity, Mutation, E2E (Templates/geplant).
38
+ - **Hooks**: Post-Deploy Health Ping, Edge Logs.
27
39
 
28
- Run the full setup in one go (installs package if needed, then runs the wizard):
40
+ ### Konfiguration
41
+
42
+ - **Presets**: `.shimwrappercheck-presets.json` (Presets, Trigger-Befehle, Check-Reihenfolge, Toggles). Dashboard schreibt zusätzlich `.shimwrappercheckrc` für die Shell-Skripte.
43
+ - **Env & RC**: Alle Optionen per Umgebungsvariablen oder `.shimwrappercheckrc` steuerbar.
44
+
45
+ ---
46
+
47
+ ## Anleitung: shimwrappercheck benutzen
48
+
49
+ ### 1. Installieren
50
+
51
+ ```bash
52
+ npm i -D shimwrappercheck
53
+ ```
54
+
55
+ ### 2. Einmal-Setup (Wizard + Dashboard)
56
+
57
+ Alles in einem Schritt: Paket einrichten, Wizard durchlaufen, Dashboard starten:
29
58
 
30
59
  ```bash
31
60
  npx shimwrappercheck setup
32
61
  ```
33
62
 
34
- This installs `shimwrappercheck` as a devDependency if missing, then runs the init wizard (Supabase/Git shims, which commands, AI review, hooks, run-checks.sh, etc.). At the end you get a link to start the dashboard to change settings later.
63
+ Der Wizard fragt u.a.:
35
64
 
36
- ## Dashboard (Web UI)
65
+ - Supabase/Git-Nutzung
66
+ - Welche Befehle Checks/Hooks auslösen
67
+ - Pre-Push-Hooks (Husky)
68
+ - AI-Review
69
+ - Erzeugt `.shimwrappercheckrc` und optional `scripts/run-checks.sh`, Templates.
37
70
 
38
- A Next.js dashboard lets you manage presets, checks, config, and AGENTS.md:
71
+ **Danach startet das Dashboard automatisch** und öffnet im Browser (z. B. http://localhost:3000). Ein freier Port (3000, 3001, …) wird automatisch gewählt.
72
+
73
+ ### 3. Dashboard nutzen
74
+
75
+ **Dashboard später starten** (aus dem Projekt-Root, in dem `node_modules/shimwrappercheck` liegt):
39
76
 
40
77
  ```bash
41
78
  cd node_modules/shimwrappercheck/dashboard && npm install && npm run dev
42
79
  ```
43
80
 
44
- Then open http://localhost:3000. You can:
81
+ Oder im Repo-Root (wenn `npm run dashboard` in package.json eingetragen ist):
82
+
83
+ ```bash
84
+ npm run dashboard
85
+ ```
86
+
87
+ Dann die im Terminal angezeigte URL im Browser öffnen.
88
+
89
+ **Im Dashboard:**
90
+
91
+ 1. **Trigger Commandos (My Shim, links)**
92
+ - Tab **Enforce** oder **Hooks** wählen.
93
+ - Befehle eintippen (z. B. `git push`, `supabase functions deploy`), mit **Enter** als Tag bestätigen.
94
+ - Änderungen werden gespeichert und in `.shimwrappercheckrc` / Presets übernommen.
95
+
96
+ 2. **My Checks (My Shim, links)**
97
+ - Checks aus der **Check Library** (rechts) per Drag in „My Checks“ ziehen.
98
+ - Reihenfolge per Drag ändern, einzeln entfernen.
99
+ - Pro Check: Info/Settings; **Tool-Status** zeigt, ob das Tool (z. B. ESLint, Deno) vorhanden ist, und bietet einen **Kopieren**-Befehl zum Nachinstallieren.
100
+
101
+ 3. **Check Library (rechts)**
102
+ - Filter: Frontend, Backend, Enforce, Hooks (Mehrfachauswahl).
103
+ - Suche, Drag zu My Shim zum Aktivieren.
104
+
105
+ 4. **Einstellungen**
106
+ - **Templates**: Preset wechseln, ⋮ am aktiven Preset für Export/Umbenennen; Trigger Commandos & My Checks wie in der Sidebar bearbeiten.
107
+ - **Information**: Status aller Dateien/Skripte, „Nur Checks ausführen“, Links zu Config und AGENTS.md.
108
+
109
+ 5. **Config / AGENTS.md**
110
+ - Über Einstellungen → Information oder Navigation: Roh-Editor für `.shimwrappercheckrc` und Editor für AGENTS.md.
111
+
112
+ ### 4. Checked Befehle ausführen
113
+
114
+ Nach dem Setup nutzt du den Shim statt des „nackten“ CLIs:
115
+
116
+ ```bash
117
+ # Supabase (Checks laufen vor dem echten Befehl)
118
+ npx supabase functions deploy <name>
119
+ npm run supabase:checked -- db push
120
+
121
+ # Git (z. B. pre-push oder manuell)
122
+ npx git push
123
+ npm run git:checked -- push
124
+ ```
125
+
126
+ **Nur Checks ausführen** (ohne Supabase/Git):
127
+
128
+ - Im Dashboard unter **Einstellungen → Information** auf „Nur Checks ausführen“ klicken,
129
+ oder
130
+ - CLI: `npx supabase --checks-only functions deploy server`
45
131
 
46
- - **Einstellungen**: Presets (Vibe Code default, custom presets), Supabase/Git command toggles (which commands run checks/hooks), check toggles (frontend, backend, AI review)
47
- - View status (config, presets file, AGENTS.md, run-checks script, hooks)
48
- - Run checks only (button)
49
- - Edit `.shimwrappercheckrc` (Config, raw)
50
- - Edit **AGENTS.md** (agent instructions for Cursor/Codex; changes apply immediately)
132
+ **Wrapper-Flags** (werden nicht an das echte CLI durchgereicht):
51
133
 
52
- **AGENTS.md** is used by AI agents; editing it in the dashboard keeps agent instructions in sync. Set `SHIM_PROJECT_ROOT` when deploying the dashboard (e.g. on Vercel) to the repo root path where `.shimwrappercheckrc` and `AGENTS.md` live.
134
+ - `--no-checks` Checks überspringen
135
+ - `--checks-only` Nur Checks, kein Supabase/Git
136
+ - `--no-hooks` Post-Deploy-Hooks überspringen
137
+ - `--no-push` Auto-Push überspringen
138
+
139
+ ### 5. Konfigurationsdateien
140
+
141
+ - **`.shimwrappercheckrc`** (Projekt-Root): Wird vom Dashboard beim Speichern (Trigger Commandos, Presets, Checks) geschrieben. Enthält z. B. `SHIM_ENFORCE_COMMANDS`, `SHIM_HOOK_COMMANDS`, `SHIM_CHECK_ORDER`, Toggles.
142
+ - **`.shimwrappercheck-presets.json`**: Vollständige Preset- und Check-Daten; Dashboard liest/schreibt diese Datei und leitet daraus die RC ab.
143
+
144
+ Für **Vercel/gehostetes Dashboard**: `SHIM_PROJECT_ROOT` auf den Pfad zum Repo-Root setzen (dort liegen RC und AGENTS.md).
145
+
146
+ ---
53
147
 
54
148
  ## Install
55
149
 
@@ -57,204 +151,124 @@ Then open http://localhost:3000. You can:
57
151
  npm i -D shimwrappercheck
58
152
  ```
59
153
 
60
- ## Global install (PATH shims)
154
+ ## Global Install (PATH-Shims)
61
155
 
62
- This installs small shims into a bin directory (default: `~/.local/bin`) so you can run
63
- `supabase`, `git`, or `shim` directly without `npx`.
156
+ Shims in ein Bin-Verzeichnis (z. B. `~/.local/bin`) legen, dann `supabase` / `git` / `shim` ohne `npx` nutzbar:
64
157
 
65
158
  ```bash
66
159
  npx shimwrappercheck install
67
- # options
68
- # --bin-dir <path> (default: ~/.local/bin)
69
- # --interactive (default when no flags)
70
- # --no-interactive
71
- # --add-path (auto-append PATH in shell config)
72
- # --overwrite
73
- # --dry-run
74
- # --no-supabase | --no-git | --no-shim
75
- # --only supabase,git,shim
160
+ # Optionen: --bin-dir <path>, --add-path, --overwrite, --no-supabase | --no-git | --no-shim
76
161
  ```
77
162
 
78
- If the bin dir is not in PATH, add (or use `--add-path` to append automatically):
163
+ Falls das Bin-Verzeichnis nicht in der PATH liegt:
79
164
 
80
165
  ```bash
81
166
  export PATH="$HOME/.local/bin:$PATH"
82
167
  ```
83
168
 
84
- When multiple shell configs exist (e.g. `.zshrc` + `.zprofile`), the installer asks which file to update.
85
-
86
- ## Quick start
169
+ ## Quick Start (ohne Wizard)
87
170
 
88
- 1) Add a checks script in your repo (example template below).
89
- 2) Use the shim instead of the raw CLI.
171
+ 1. Checks-Skript und Hooks anlegen:
90
172
 
91
173
  ```bash
92
- # Copy templates (customize to your repo)
93
174
  cp node_modules/shimwrappercheck/templates/run-checks.sh scripts/run-checks.sh
94
175
  cp node_modules/shimwrappercheck/templates/ai-code-review.sh scripts/ai-code-review.sh
95
176
  cp node_modules/shimwrappercheck/templates/husky-pre-push .husky/pre-push
96
-
97
- # Make scripts executable
98
177
  chmod +x scripts/run-checks.sh scripts/ai-code-review.sh .husky/pre-push
99
178
  ```
100
179
 
101
- Add a package.json script (optional):
180
+ 2. Optional in `package.json`:
102
181
 
103
182
  ```json
104
183
  {
105
184
  "scripts": {
106
- "supabase:checked": "supabase"
185
+ "supabase:checked": "supabase",
186
+ "git:checked": "git"
107
187
  }
108
188
  }
109
189
  ```
110
190
 
111
- Then run:
191
+ 3. Nutzen:
112
192
 
113
193
  ```bash
114
194
  npm run supabase:checked -- functions deploy <function-name>
115
- # or
116
- npx supabase functions deploy <function-name>
195
+ npx git push
117
196
  ```
118
197
 
119
- ## Setup wizard (init)
198
+ ## Setup-Wizard (init)
120
199
 
121
- Run the interactive init to scan your codebase and configure the shim (or use `npx shimwrappercheck setup` to install + init in one step):
200
+ Nur den interaktiven Init ausführen (ohne erneutes Installieren):
122
201
 
123
202
  ```bash
124
203
  npx shimwrappercheck init
125
- # or
126
- npm exec shimwrappercheck init
127
204
  ```
128
205
 
129
- The wizard can (defaults are tuned based on repo type):
130
-
131
- - detect Supabase and Git usage
132
- - ask which commands should trigger checks/hooks
133
- - install pre-push hooks
134
- - enable AI review and guide you through login
135
- - create a `.shimwrappercheckrc` config
206
+ Erkennung von Supabase/Git, Abfrage der Befehle für Checks/Hooks, Pre-Push-Hooks, AI-Review, Erzeugen von `.shimwrappercheckrc`.
136
207
 
137
- ## How it works
208
+ ## Wie es funktioniert
138
209
 
139
- - The shim determines which checks to run based on git changes (e.g. `src/` vs `supabase/functions/`).
140
- - The shim runs your checks script first (default: `scripts/run-checks.sh`).
141
- - If checks pass, it calls the real Supabase CLI.
142
- - Optional hooks run after deploy to ping health and fetch logs.
143
- - Optional git auto-push can be enabled (this is **not** a git wrapper; it runs after the CLI succeeds).
144
- - Git push checks are enforced via pre-push hooks (template provided).
210
+ - Der Shim prüft anhand der konfigurierten **Trigger Commandos**, ob für den ausgeführten Befehl (z. B. `functions`, `db`, `push`) Checks/Hooks laufen sollen.
211
+ - Zuerst läuft euer **run-checks.sh** (Frontend/Backend je nach Diff).
212
+ - Bei Erfolg wird das echte CLI (Supabase/Git) aufgerufen.
213
+ - Optional: Post-Deploy-Hooks (Health-Ping, Logs), optional Auto-Push.
214
+ - Git-Push-Checks laufen über den Pre-Push-Hook (Husky oder `.git/hooks/pre-push`).
145
215
 
146
- ## Usage
216
+ ## Usage (Überblick)
147
217
 
148
218
  ```bash
149
- npx supabase functions deploy <function-name>
219
+ npx supabase functions deploy <name>
150
220
  npm run supabase:checked -- db push
151
221
 
152
- # git wrapper
153
222
  npx git push
154
223
  npm run git:checked -- push
155
224
 
156
- # generic shim (any CLI)
225
+ # Nur Checks
226
+ npx supabase --checks-only functions deploy server
227
+
228
+ # Generischer Shim
157
229
  npm exec --package shimwrappercheck -- shim docker build .
158
230
  npm exec --package shimwrappercheck -- shim --cli terraform -- plan
159
231
  ```
160
232
 
161
- Generic shim hooks:
233
+ ## Wrapper-Flags
162
234
 
163
- ```bash
164
- export SHIM_CLI_PRE_HOOKS="scripts/cli-pre-hook.sh"
165
- export SHIM_CLI_POST_HOOKS="scripts/cli-post-hook.sh"
166
- shim docker build .
167
- ```
168
-
169
- Tip: Use `--` to separate shim flags from CLI args when needed:
235
+ - `--no-checks` Checks für diesen Aufruf überspringen
236
+ - `--checks-only` Nur Checks, kein Supabase/Git
237
+ - `--no-hooks` Post-Deploy-Hooks überspringen
238
+ - `--no-push` Auto-Push überspringen
239
+ - `--no-ai-review` An run-checks.sh durchgereicht
240
+ - `--with-frontend` Frontend-Checks erzwingen
241
+ - `--ai-review` An run-checks.sh durchgereicht
242
+ - `--auto-push` (Generischer Shim) Auto-Push nach Befehl
170
243
 
171
- ```bash
172
- npm exec --package shimwrappercheck -- shim --cli docker -- build .
173
- ```
244
+ ## Befehlsfilter
174
245
 
175
- You can also run only checks:
176
-
177
- ```bash
178
- npx supabase --checks-only functions deploy server
179
- ```
246
+ - **Supabase**: `SHIM_ENFORCE_COMMANDS="functions,db,migration"`, `SHIM_HOOK_COMMANDS="functions,db,migration"` (oder `all` / `none`).
247
+ - **Git**: `SHIM_GIT_ENFORCE_COMMANDS` (z. B. `push`, `commit`, `merge`, `rebase`).
180
248
 
181
- ## Wrapper-only flags
249
+ Befehle werden als Token gematcht (z. B. `functions`, `db`, `push`).
182
250
 
183
- These flags are consumed by the shim and are not passed to the wrapped CLI:
251
+ ## Umgebungsvariablen (Auswahl)
184
252
 
185
- - `--no-checks` Skip checks for this invocation.
186
- - `--checks-only` Run checks and exit without running Supabase.
187
- - `--no-hooks` Skip post-deploy hooks (health/logs).
188
- - `--no-push` Skip auto git push.
189
- - `--no-ai-review` Passed through to the checks script (template supports it).
190
- - `--with-frontend` Force frontend checks even if no `src/` changes are detected.
191
- - `--ai-review` Passed through to the checks script (template supports it).
192
- - `--auto-push` Generic shim: enable git auto-push after command.
253
+ - `SHIM_PROJECT_ROOT` Projekt-Root (z. B. für Dashboard auf Vercel)
254
+ - `SHIM_CHECKS_SCRIPT` Pfad zum Checks-Skript
255
+ - `SHIM_CHECKS_ARGS` Zusätzliche Argumente für run-checks
256
+ - `SHIM_CONFIG_FILE` Konfigurationsdatei (Standard: `.shimwrappercheckrc`)
257
+ - `SHIM_DISABLE_CHECKS=1` Checks deaktivieren
258
+ - `SHIM_DISABLE_HOOKS=1` Hooks deaktivieren
259
+ - `SHIM_AUTO_PUSH=1|0` Auto-Push nach Erfolg
260
+ - `SHIM_ENFORCE_COMMANDS` Supabase-Befehle für Checks
261
+ - `SHIM_HOOK_COMMANDS` Supabase-Befehle für Hooks
262
+ - `SHIM_GIT_ENFORCE_COMMANDS` Git-Befehle für Checks
263
+ - `SHIM_DEFAULT_FUNCTION` Standard-Funktion für Health/Logs
264
+ - `SHIM_HEALTH_FUNCTIONS`, `SHIM_LOG_FUNCTIONS`, `SHIM_LOG_LIMIT`
265
+ - `SUPABASE_PROJECT_REF`, `SHIM_HEALTH_PATHS`
266
+ - Netzwerk-Retry: `SUPABASE_RETRY_MAX`, `SUPABASE_RETRY_BACKOFF_SECONDS`
267
+ - Generischer Shim: `SHIM_CLI_*`, `SHIM_CLI_PRE_HOOKS`, `SHIM_CLI_POST_HOOKS`
193
268
 
194
- ## Command filtering
269
+ ## Config-Datei
195
270
 
196
- You can control for which Supabase commands checks and hooks should run:
197
-
198
- - `SHIM_ENFORCE_COMMANDS="functions,db,migration"` to run checks only for those commands
199
- - `SHIM_HOOK_COMMANDS="functions,db,migration"` to run hooks only for those commands
200
- - Use `all` or `none` to enable/disable completely
201
-
202
- Commands are matched by token (e.g. `functions`, `db`, `migration`).
203
-
204
- Note: If you want checks for `supabase push`, add `push` to `SHIM_ENFORCE_COMMANDS`.
205
-
206
- For Git, use `SHIM_GIT_ENFORCE_COMMANDS` (default: `push`). You can include `commit,merge,rebase` etc.
207
-
208
- ## Environment variables
209
-
210
- - `SHIM_PROJECT_ROOT` Override project root detection.
211
- - `SHIM_CHECKS_SCRIPT` Path to your checks script (relative to project root or absolute).
212
- - `SHIM_CHECKS_ARGS` Extra args passed to checks script.
213
- - `SHIM_CONFIG_FILE` Custom path to config file (default: `.shimwrappercheckrc`).
214
- - `SHIM_DISABLE_CHECKS=1` Disable checks (same as `--no-checks`).
215
- - `SHIM_DISABLE_HOOKS=1` Disable hooks (same as `--no-hooks`).
216
- - `SHIM_AUTO_PUSH=1|0` Enable/disable auto git push after success (default: on).
217
- - `SHIM_DEFAULT_FUNCTION` Default function name for health/log hooks (default: `server`).
218
- - `SHIM_ENFORCE_COMMANDS` Comma list for which CLI commands checks should run (`all`, `none`, or e.g. `functions,db,migration`).
219
- - `SHIM_HOOK_COMMANDS` Comma list for which CLI commands hooks should run (same format).
220
- - `SHIM_PING_SCRIPT` Override path to health ping script.
221
- - `SHIM_LOG_SCRIPT` Override path to logs script.
222
- - `SHIM_GIT_ENFORCE_COMMANDS` Comma list for which git commands checks should run (`push`, `all`, `none`).
223
- - `SHIM_GIT_CHECKS_SCRIPT` Override checks script for git wrapper.
224
- - `SHIM_GIT_CHECKS_ARGS` Extra args passed to checks script (git wrapper only).
225
- - `SHIM_GIT_REAL_BIN` Absolute path to the real git binary (avoids recursion).
226
- - `SHIM_CLI_ENFORCE_COMMANDS` Generic shim: comma list for which subcommands checks should run.
227
- - `SHIM_CLI_CHECKS_SCRIPT` Generic shim: override checks script.
228
- - `SHIM_CLI_CHECKS_ARGS` Generic shim: extra args passed to checks script.
229
- - `SHIM_CLI_REAL_BIN` Generic shim: absolute path to real CLI binary (avoids recursion).
230
- - `SHIM_CLI_AUTO_PUSH` Generic shim: enable git auto-push after command (0/1).
231
- - `SHIM_CLI_PRE_HOOKS` Generic shim: comma list of pre-hook scripts to run.
232
- - `SHIM_CLI_POST_HOOKS` Generic shim: comma list of post-hook scripts to run.
233
- - `SHIM_CLI_HOOK_COMMANDS` Generic shim: comma list for which subcommands hooks should run.
234
-
235
- Network retry (Supabase CLI):
236
-
237
- - `SUPABASE_RETRY_MAX` Number of retries on network errors (default: 1).
238
- - `SUPABASE_RETRY_BACKOFF_SECONDS` Comma-separated backoff seconds (default: `5,15`).
239
- - `SUPABASE_RETRY_EXTRA_ARGS` Extra args added only on retry attempts.
240
-
241
- Supabase CLI resolution:
242
-
243
- - `SUPABASE_REAL_BIN` Absolute path to the real Supabase CLI.
244
- - `SHIM_SUPABASE_BIN` Same as above (alias).
245
- - `~/.supabase-real-bin` If present, read as real CLI path.
246
-
247
- Post-deploy hooks:
248
-
249
- - `SHIM_HEALTH_FUNCTIONS` Comma-separated function names to ping (fallback if not detected).
250
- - `SHIM_LOG_FUNCTIONS` Comma-separated function names to fetch logs for.
251
- - `SHIM_LOG_LIMIT` Log lines to fetch (default: 30).
252
- - `SUPABASE_PROJECT_REF` Project ref for health ping (or `supabase/project-ref`).
253
- - `SHIM_HEALTH_PATHS` Comma-separated URL paths with `{fn}` placeholder.
254
-
255
- ## Config file (optional)
256
-
257
- Create `.shimwrappercheckrc` in your project root to persist settings:
271
+ `.shimwrappercheckrc` im Projekt-Root (wird vom Dashboard befüllt; kann manuell angepasst werden):
258
272
 
259
273
  ```bash
260
274
  SHIM_ENFORCE_COMMANDS="functions,db,migration"
@@ -264,23 +278,32 @@ SHIM_AUTO_PUSH=1
264
278
  SHIM_CHECKS_ARGS="--no-ai-review"
265
279
  ```
266
280
 
267
- Note: `.shimwrappercheckrc` is sourced as a shell file.
281
+ Die Datei wird als Shell-Skript eingelesen.
268
282
 
269
283
  ## Templates
270
284
 
271
- - `templates/run-checks.sh` Minimal checks runner; customize for your repo.
272
- - `templates/ai-code-review.sh` Optional AI review step (Codex default, Cursor fallback).
273
- - `templates/husky-pre-push` Husky pre-push hook that runs checks.
274
- - `templates/git-pre-push` Plain git hook version of the same.
285
+ - `templates/run-checks.sh` Runner für Lint, Tests, Deno, AI-Review usw.
286
+ - `templates/ai-code-review.sh` Optionaler AI-Review-Schritt
287
+ - `templates/husky-pre-push` Husky Pre-Push-Hook
288
+ - `templates/git-pre-push` Reiner Git-Hook
289
+
290
+ ## Hard Rules (optionale Tools)
291
+
292
+ Für SAST, Architektur, Komplexität, Mutation, E2E:
293
+
294
+ - **dependency-cruiser**: `npm i -D dependency-cruiser`
295
+ - **eslint-plugin-complexity**: `npm i -D eslint-plugin-complexity`
296
+ - **Stryker**: `npm i -D @stryker-mutator/core`
297
+ - **semgrep**: z. B. `brew install semgrep` oder `npx semgrep`
298
+
299
+ Konfig-Vorlagen in `templates/`: `.dependency-cruiser.json`, `.semgrep.example.yml`, `stryker.config.json`, `eslint.complexity.json`. Optional über den Init-Wizard einrichten.
275
300
 
276
- ## Notes
301
+ ## Hinweise
277
302
 
278
- - If the shim is installed locally, it avoids recursion by resolving the real Supabase CLI.
279
- - If no real CLI is found, it runs `npx --package supabase supabase ...`.
280
- - The git wrapper should be invoked via `npx git` or `npm run git:checked` to avoid shadowing your system git.
281
- - Hooks are resolved from your repo first (`scripts/ping-edge-health.sh`, `scripts/fetch-edge-logs.sh`) and fall back to the package scripts.
282
- - Generic shim hooks default to `scripts/cli-pre-hook.sh` and `scripts/cli-post-hook.sh` if present.
303
+ - Bei lokaler Installation vermeidet der Shim Rekursion, indem das echte Supabase-CLI erkannt wird.
304
+ - Das Git-Wrapper sollte über `npx git` oder `npm run git:checked` aufgerufen werden, um das System-Git nicht zu überschreiben.
305
+ - Hooks werden zuerst im Repo gesucht (`scripts/ping-edge-health.sh`, `scripts/fetch-edge-logs.sh`), danach im Paket.
283
306
 
284
- ## License
307
+ ## Lizenz
285
308
 
286
- UNLICENSED (update if you want a public license).
309
+ MIT (siehe package.json).
@@ -11,6 +11,19 @@ npm run dev
11
11
 
12
12
  Open http://localhost:3000.
13
13
 
14
+ ## Quality checks
15
+
16
+ From the `dashboard` folder:
17
+
18
+ ```bash
19
+ npm run check # Prettier + TypeScript + ESLint
20
+ npm run lint # ESLint only
21
+ npm run format # Prettier write
22
+ npm run format:check # Prettier check
23
+ ```
24
+
25
+ Security: run `npm audit` and optionally `npx snyk test`. If Snyk reports a Next.js vulnerability, consider upgrading Next (see [Next.js upgrade guide](https://nextjs.org/docs/app/guides/upgrading)).
26
+
14
27
  ## Deploy (e.g. Vercel)
15
28
 
16
29
  - Set **Root Directory** to `dashboard` (or deploy from repo root and build from `dashboard`).
@@ -5,8 +5,11 @@
5
5
  "use client";
6
6
 
7
7
  import { useEffect, useState } from "react";
8
+ import { useTranslations } from "next-intl";
8
9
 
9
10
  export default function AgentsPage() {
11
+ const t = useTranslations("common");
12
+ const tAgents = useTranslations("agents");
10
13
  const [raw, setRaw] = useState("");
11
14
  const [loading, setLoading] = useState(true);
12
15
  const [saving, setSaving] = useState(false);
@@ -37,13 +40,13 @@ export default function AgentsPage() {
37
40
  setSaving(false);
38
41
  if (data.error) setMessage({ type: "error", text: data.error });
39
42
  else {
40
- setMessage({ type: "success", text: "AGENTS.md gespeichert." });
43
+ setMessage({ type: "success", text: tAgents("saved") });
41
44
  setExists(true);
42
45
  }
43
46
  })
44
47
  .catch(() => {
45
48
  setSaving(false);
46
- setMessage({ type: "error", text: "Speichern fehlgeschlagen." });
49
+ setMessage({ type: "error", text: t("saveFailed") });
47
50
  });
48
51
  };
49
52
 
@@ -56,32 +59,26 @@ export default function AgentsPage() {
56
59
  }
57
60
 
58
61
  return (
59
- <div className="space-y-6">
60
- <h1 className="text-3xl font-bold">AGENTS.md</h1>
61
- <p className="text-base-content/80">
62
- Agent-Anweisungen für Cursor/Codex. Wird von Agents gelesen; hier bearbeitbar. Änderungen gelten sofort.
63
- </p>
62
+ <div className="space-y-6 text-white">
63
+ <h1 className="text-3xl font-bold">{tAgents("title")}</h1>
64
+ <p className="text-neutral-300">{tAgents("description")}</p>
64
65
  {!exists && (
65
- <div className="alert alert-info">
66
- <span>AGENTS.md existiert noch nicht. Beim Speichern wird sie im Projekt-Root angelegt.</span>
66
+ <div className="alert bg-neutral-800 border-neutral-600 text-neutral-300">
67
+ <span>{tAgents("notExists")}</span>
67
68
  </div>
68
69
  )}
69
70
  <textarea
70
- className="textarea textarea-bordered w-full font-mono text-sm min-h-[400px]"
71
+ className="textarea w-full font-mono text-sm min-h-[400px] bg-neutral-800 border-neutral-600 text-white"
71
72
  value={raw}
72
73
  onChange={(e) => setRaw(e.target.value)}
73
- placeholder="# Agent instructions..."
74
+ placeholder={tAgents("placeholder")}
74
75
  spellCheck={false}
75
76
  />
76
77
  <div className="flex gap-4 items-center">
77
78
  <button type="button" className="btn btn-primary" onClick={save} disabled={saving}>
78
- {saving ? "Speichern…" : "Speichern"}
79
+ {saving ? t("saving") : t("save")}
79
80
  </button>
80
- {message && (
81
- <span className={message.type === "success" ? "text-success" : "text-error"}>
82
- {message.text}
83
- </span>
84
- )}
81
+ {message && <span className={message.type === "success" ? "text-success" : "text-error"}>{message.text}</span>}
85
82
  </div>
86
83
  </div>
87
84
  );
@@ -5,7 +5,11 @@
5
5
  "use client";
6
6
 
7
7
  import { useEffect, useState } from "react";
8
+ import { useTranslations } from "next-intl";
9
+
8
10
  export default function ConfigPage() {
11
+ const t = useTranslations("common");
12
+ const tConfig = useTranslations("config");
9
13
  const [raw, setRaw] = useState("");
10
14
  const [loading, setLoading] = useState(true);
11
15
  const [saving, setSaving] = useState(false);
@@ -33,11 +37,11 @@ export default function ConfigPage() {
33
37
  .then((data) => {
34
38
  setSaving(false);
35
39
  if (data.error) setMessage({ type: "error", text: data.error });
36
- else setMessage({ type: "success", text: "Config gespeichert." });
40
+ else setMessage({ type: "success", text: tConfig("saved") });
37
41
  })
38
42
  .catch(() => {
39
43
  setSaving(false);
40
- setMessage({ type: "error", text: "Speichern fehlgeschlagen." });
44
+ setMessage({ type: "error", text: t("saveFailed") });
41
45
  });
42
46
  };
43
47
 
@@ -50,27 +54,21 @@ export default function ConfigPage() {
50
54
  }
51
55
 
52
56
  return (
53
- <div className="space-y-6">
54
- <h1 className="text-3xl font-bold">Config (.shimwrappercheckrc)</h1>
55
- <p className="text-base-content/80">
56
- Shell-Variablen und Kommentare. Wird beim nächsten Aufruf des Shims verwendet.
57
- </p>
57
+ <div className="space-y-6 text-white">
58
+ <h1 className="text-3xl font-bold">{tConfig("title")}</h1>
59
+ <p className="text-neutral-300">{tConfig("description")}</p>
58
60
  <textarea
59
- className="textarea textarea-bordered w-full font-mono text-sm min-h-[320px]"
61
+ className="textarea w-full font-mono text-sm min-h-[320px] bg-neutral-800 border-neutral-600 text-white"
60
62
  value={raw}
61
63
  onChange={(e) => setRaw(e.target.value)}
62
- placeholder="# shimwrappercheck config\nSHIM_ENFORCE_COMMANDS=\"functions,db,migration\"\n..."
64
+ placeholder={tConfig("placeholder")}
63
65
  spellCheck={false}
64
66
  />
65
67
  <div className="flex gap-4 items-center">
66
68
  <button type="button" className="btn btn-primary" onClick={save} disabled={saving}>
67
- {saving ? "Speichern…" : "Speichern"}
69
+ {saving ? t("saving") : t("save")}
68
70
  </button>
69
- {message && (
70
- <span className={message.type === "success" ? "text-success" : "text-error"}>
71
- {message.text}
72
- </span>
73
- )}
71
+ {message && <span className={message.type === "success" ? "text-success" : "text-error"}>{message.text}</span>}
74
72
  </div>
75
73
  </div>
76
74
  );