shimwrappercheck 0.3.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 (49) hide show
  1. package/README.md +198 -192
  2. package/dashboard/README.md +13 -0
  3. package/dashboard/app/{agents → [locale]/agents}/page.tsx +11 -14
  4. package/dashboard/app/{config → [locale]/config}/page.tsx +11 -13
  5. package/dashboard/app/[locale]/error.tsx +25 -0
  6. package/dashboard/app/[locale]/layout.tsx +42 -0
  7. package/dashboard/app/[locale]/not-found.tsx +27 -0
  8. package/dashboard/app/[locale]/page.tsx +53 -0
  9. package/dashboard/app/[locale]/settings/page.tsx +741 -0
  10. package/dashboard/app/api/agents-md/route.ts +2 -8
  11. package/dashboard/app/api/check-tools/route.ts +134 -0
  12. package/dashboard/app/api/config/route.ts +2 -8
  13. package/dashboard/app/api/info/route.ts +26 -0
  14. package/dashboard/app/api/run-checks/route.ts +9 -2
  15. package/dashboard/app/api/settings/route.ts +74 -16
  16. package/dashboard/app/api/status/route.ts +3 -5
  17. package/dashboard/app/api/ui-config/route.ts +62 -0
  18. package/dashboard/app/global-error.tsx +31 -0
  19. package/dashboard/app/globals.css +26 -0
  20. package/dashboard/app/layout.tsx +2 -12
  21. package/dashboard/app/not-found.tsx +22 -0
  22. package/dashboard/components/AvailableChecks.tsx +260 -0
  23. package/dashboard/components/CheckCard.tsx +415 -65
  24. package/dashboard/components/CheckCardList.tsx +28 -23
  25. package/dashboard/components/Header.tsx +52 -16
  26. package/dashboard/components/Icons.tsx +20 -0
  27. package/dashboard/components/LayoutContent.tsx +24 -0
  28. package/dashboard/components/MyShimChecks.tsx +257 -0
  29. package/dashboard/components/Nav.tsx +9 -6
  30. package/dashboard/components/SetDocumentLang.tsx +18 -0
  31. package/dashboard/components/SidebarMyShim.tsx +108 -19
  32. package/dashboard/components/StatusCard.tsx +5 -12
  33. package/dashboard/components/TriggerCommandos.tsx +311 -42
  34. package/dashboard/lib/checks.ts +134 -17
  35. package/dashboard/lib/presets.ts +60 -28
  36. package/dashboard/lib/projectRoot.ts +22 -12
  37. package/dashboard/next-env.d.ts +2 -1
  38. package/dashboard/next.config.js +10 -1
  39. package/dashboard/package.json +11 -6
  40. package/dashboard/scripts/find-port-and-dev.js +48 -15
  41. package/dashboard/tailwind.config.js +1 -4
  42. package/dashboard/tsconfig.json +9 -2
  43. package/package.json +4 -6
  44. package/scripts/run-checks.sh +77 -24
  45. package/scripts/supabase-checked.sh +23 -7
  46. package/scripts/update-readme.js +72 -0
  47. package/templates/run-checks.sh +80 -27
  48. package/dashboard/app/page.tsx +0 -151
  49. package/dashboard/app/settings/page.tsx +0 -467
package/README.md CHANGED
@@ -1,61 +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.). **After the wizard, the dashboard starts automatically and your browser opens at http://localhost:3000.**
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. When you run `npx shimwrappercheck setup`, it starts automatically at the end and opens in your browser. **A free port is chosen automatically** (3000, 3001, 3002, …) so it never conflicts with other apps. To start it again later:
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 the URL shown in the terminal (e.g. http://localhost:3000). **In this repo** you can also run from the project root:
81
+ Oder im Repo-Root (wenn `npm run dashboard` in package.json eingetragen ist):
45
82
 
46
83
  ```bash
47
84
  npm run dashboard
48
85
  ```
49
86
 
50
- You can:
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`
131
+
132
+ **Wrapper-Flags** (werden nicht an das echte CLI durchgereicht):
133
+
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.
51
143
 
52
- - **Einstellungen**: Presets (Vibe Code default, custom presets), Supabase/Git command toggles (which commands run checks/hooks), check toggles (frontend, backend, AI review)
53
- - View status (config, presets file, AGENTS.md, run-checks script, hooks)
54
- - Run checks only (button)
55
- - Edit `.shimwrappercheckrc` (Config, raw)
56
- - Edit **AGENTS.md** (agent instructions for Cursor/Codex; changes apply immediately)
144
+ Für **Vercel/gehostetes Dashboard**: `SHIM_PROJECT_ROOT` auf den Pfad zum Repo-Root setzen (dort liegen RC und AGENTS.md).
57
145
 
58
- **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.
146
+ ---
59
147
 
60
148
  ## Install
61
149
 
@@ -63,215 +151,124 @@ You can:
63
151
  npm i -D shimwrappercheck
64
152
  ```
65
153
 
66
- ## Global install (PATH shims)
154
+ ## Global Install (PATH-Shims)
67
155
 
68
- This installs small shims into a bin directory (default: `~/.local/bin`) so you can run
69
- `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:
70
157
 
71
158
  ```bash
72
159
  npx shimwrappercheck install
73
- # options
74
- # --bin-dir <path> (default: ~/.local/bin)
75
- # --interactive (default when no flags)
76
- # --no-interactive
77
- # --add-path (auto-append PATH in shell config)
78
- # --overwrite
79
- # --dry-run
80
- # --no-supabase | --no-git | --no-shim
81
- # --only supabase,git,shim
160
+ # Optionen: --bin-dir <path>, --add-path, --overwrite, --no-supabase | --no-git | --no-shim
82
161
  ```
83
162
 
84
- 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:
85
164
 
86
165
  ```bash
87
166
  export PATH="$HOME/.local/bin:$PATH"
88
167
  ```
89
168
 
90
- When multiple shell configs exist (e.g. `.zshrc` + `.zprofile`), the installer asks which file to update.
169
+ ## Quick Start (ohne Wizard)
91
170
 
92
- ## Quick start
93
-
94
- 1) Add a checks script in your repo (example template below).
95
- 2) Use the shim instead of the raw CLI.
171
+ 1. Checks-Skript und Hooks anlegen:
96
172
 
97
173
  ```bash
98
- # Copy templates (customize to your repo)
99
174
  cp node_modules/shimwrappercheck/templates/run-checks.sh scripts/run-checks.sh
100
175
  cp node_modules/shimwrappercheck/templates/ai-code-review.sh scripts/ai-code-review.sh
101
176
  cp node_modules/shimwrappercheck/templates/husky-pre-push .husky/pre-push
102
-
103
- # Make scripts executable
104
177
  chmod +x scripts/run-checks.sh scripts/ai-code-review.sh .husky/pre-push
105
178
  ```
106
179
 
107
- Add a package.json script (optional):
180
+ 2. Optional in `package.json`:
108
181
 
109
182
  ```json
110
183
  {
111
184
  "scripts": {
112
- "supabase:checked": "supabase"
185
+ "supabase:checked": "supabase",
186
+ "git:checked": "git"
113
187
  }
114
188
  }
115
189
  ```
116
190
 
117
- Then run:
191
+ 3. Nutzen:
118
192
 
119
193
  ```bash
120
194
  npm run supabase:checked -- functions deploy <function-name>
121
- # or
122
- npx supabase functions deploy <function-name>
195
+ npx git push
123
196
  ```
124
197
 
125
- ## Hard Rules (optional tools and configs)
126
-
127
- For the full check pipeline (SAST, architecture, complexity, mutation testing, E2E, AI deductive review), install in your project:
128
-
129
- - **dependency-cruiser**: `npm i -D dependency-cruiser` — enforces no circular deps and layer separation
130
- - **eslint-plugin-complexity**: `npm i -D eslint-plugin-complexity` — cyclomatic complexity max 10 per function
131
- - **Stryker**: `npm i -D @stryker-mutator/core` — mutation testing (min 80% score in full mode)
132
- - **semgrep**: `pip install semgrep` or `brew install semgrep` (or use `npx semgrep`); optional SAST
198
+ ## Setup-Wizard (init)
133
199
 
134
- Config templates are in `templates/`: `.dependency-cruiser.json`, `.semgrep.example.yml`, `stryker.config.json`, `eslint.complexity.json`. Copy into your project root or use the init wizard to optionally install them.
135
-
136
- ## Setup wizard (init)
137
-
138
- 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):
139
201
 
140
202
  ```bash
141
203
  npx shimwrappercheck init
142
- # or
143
- npm exec shimwrappercheck init
144
204
  ```
145
205
 
146
- The wizard can (defaults are tuned based on repo type):
147
-
148
- - detect Supabase and Git usage
149
- - ask which commands should trigger checks/hooks
150
- - install pre-push hooks
151
- - enable AI review and guide you through login
152
- - create a `.shimwrappercheckrc` config
206
+ Erkennung von Supabase/Git, Abfrage der Befehle für Checks/Hooks, Pre-Push-Hooks, AI-Review, Erzeugen von `.shimwrappercheckrc`.
153
207
 
154
- ## How it works
208
+ ## Wie es funktioniert
155
209
 
156
- - The shim determines which checks to run based on git changes (e.g. `src/` vs `supabase/functions/`).
157
- - The shim runs your checks script first (default: `scripts/run-checks.sh`).
158
- - If checks pass, it calls the real Supabase CLI.
159
- - Optional hooks run after deploy to ping health and fetch logs.
160
- - Optional git auto-push can be enabled (this is **not** a git wrapper; it runs after the CLI succeeds).
161
- - 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`).
162
215
 
163
- ## Usage
216
+ ## Usage (Überblick)
164
217
 
165
218
  ```bash
166
- npx supabase functions deploy <function-name>
219
+ npx supabase functions deploy <name>
167
220
  npm run supabase:checked -- db push
168
221
 
169
- # git wrapper
170
222
  npx git push
171
223
  npm run git:checked -- push
172
224
 
173
- # generic shim (any CLI)
225
+ # Nur Checks
226
+ npx supabase --checks-only functions deploy server
227
+
228
+ # Generischer Shim
174
229
  npm exec --package shimwrappercheck -- shim docker build .
175
230
  npm exec --package shimwrappercheck -- shim --cli terraform -- plan
176
231
  ```
177
232
 
178
- Generic shim hooks:
233
+ ## Wrapper-Flags
179
234
 
180
- ```bash
181
- export SHIM_CLI_PRE_HOOKS="scripts/cli-pre-hook.sh"
182
- export SHIM_CLI_POST_HOOKS="scripts/cli-post-hook.sh"
183
- shim docker build .
184
- ```
185
-
186
- 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
187
243
 
188
- ```bash
189
- npm exec --package shimwrappercheck -- shim --cli docker -- build .
190
- ```
244
+ ## Befehlsfilter
191
245
 
192
- You can also run only checks:
193
-
194
- ```bash
195
- npx supabase --checks-only functions deploy server
196
- ```
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`).
197
248
 
198
- ## Wrapper-only flags
249
+ Befehle werden als Token gematcht (z. B. `functions`, `db`, `push`).
199
250
 
200
- These flags are consumed by the shim and are not passed to the wrapped CLI:
251
+ ## Umgebungsvariablen (Auswahl)
201
252
 
202
- - `--no-checks` Skip checks for this invocation.
203
- - `--checks-only` Run checks and exit without running Supabase.
204
- - `--no-hooks` Skip post-deploy hooks (health/logs).
205
- - `--no-push` Skip auto git push.
206
- - `--no-ai-review` Passed through to the checks script (template supports it).
207
- - `--with-frontend` Force frontend checks even if no `src/` changes are detected.
208
- - `--ai-review` Passed through to the checks script (template supports it).
209
- - `--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`
210
268
 
211
- ## Command filtering
269
+ ## Config-Datei
212
270
 
213
- You can control for which Supabase commands checks and hooks should run:
214
-
215
- - `SHIM_ENFORCE_COMMANDS="functions,db,migration"` to run checks only for those commands
216
- - `SHIM_HOOK_COMMANDS="functions,db,migration"` to run hooks only for those commands
217
- - Use `all` or `none` to enable/disable completely
218
-
219
- Commands are matched by token (e.g. `functions`, `db`, `migration`).
220
-
221
- Note: If you want checks for `supabase push`, add `push` to `SHIM_ENFORCE_COMMANDS`.
222
-
223
- For Git, use `SHIM_GIT_ENFORCE_COMMANDS` (default: `push`). You can include `commit,merge,rebase` etc.
224
-
225
- ## Environment variables
226
-
227
- - `SHIM_PROJECT_ROOT` Override project root detection.
228
- - `SHIM_CHECKS_SCRIPT` Path to your checks script (relative to project root or absolute).
229
- - `SHIM_CHECKS_ARGS` Extra args passed to checks script.
230
- - `SHIM_CONFIG_FILE` Custom path to config file (default: `.shimwrappercheckrc`).
231
- - `SHIM_DISABLE_CHECKS=1` Disable checks (same as `--no-checks`).
232
- - `SHIM_DISABLE_HOOKS=1` Disable hooks (same as `--no-hooks`).
233
- - `SHIM_AUTO_PUSH=1|0` Enable/disable auto git push after success (default: on).
234
- - `SHIM_DEFAULT_FUNCTION` Default function name for health/log hooks (default: `server`).
235
- - `SHIM_ENFORCE_COMMANDS` Comma list for which CLI commands checks should run (`all`, `none`, or e.g. `functions,db,migration`).
236
- - `SHIM_HOOK_COMMANDS` Comma list for which CLI commands hooks should run (same format).
237
- - `SHIM_PING_SCRIPT` Override path to health ping script.
238
- - `SHIM_LOG_SCRIPT` Override path to logs script.
239
- - `SHIM_GIT_ENFORCE_COMMANDS` Comma list for which git commands checks should run (`push`, `all`, `none`).
240
- - `SHIM_GIT_CHECKS_SCRIPT` Override checks script for git wrapper.
241
- - `SHIM_GIT_CHECKS_ARGS` Extra args passed to checks script (git wrapper only).
242
- - `SHIM_GIT_REAL_BIN` Absolute path to the real git binary (avoids recursion).
243
- - `SHIM_CLI_ENFORCE_COMMANDS` Generic shim: comma list for which subcommands checks should run.
244
- - `SHIM_CLI_CHECKS_SCRIPT` Generic shim: override checks script.
245
- - `SHIM_CLI_CHECKS_ARGS` Generic shim: extra args passed to checks script.
246
- - `SHIM_CLI_REAL_BIN` Generic shim: absolute path to real CLI binary (avoids recursion).
247
- - `SHIM_CLI_AUTO_PUSH` Generic shim: enable git auto-push after command (0/1).
248
- - `SHIM_CLI_PRE_HOOKS` Generic shim: comma list of pre-hook scripts to run.
249
- - `SHIM_CLI_POST_HOOKS` Generic shim: comma list of post-hook scripts to run.
250
- - `SHIM_CLI_HOOK_COMMANDS` Generic shim: comma list for which subcommands hooks should run.
251
-
252
- Network retry (Supabase CLI):
253
-
254
- - `SUPABASE_RETRY_MAX` Number of retries on network errors (default: 1).
255
- - `SUPABASE_RETRY_BACKOFF_SECONDS` Comma-separated backoff seconds (default: `5,15`).
256
- - `SUPABASE_RETRY_EXTRA_ARGS` Extra args added only on retry attempts.
257
-
258
- Supabase CLI resolution:
259
-
260
- - `SUPABASE_REAL_BIN` Absolute path to the real Supabase CLI.
261
- - `SHIM_SUPABASE_BIN` Same as above (alias).
262
- - `~/.supabase-real-bin` If present, read as real CLI path.
263
-
264
- Post-deploy hooks:
265
-
266
- - `SHIM_HEALTH_FUNCTIONS` Comma-separated function names to ping (fallback if not detected).
267
- - `SHIM_LOG_FUNCTIONS` Comma-separated function names to fetch logs for.
268
- - `SHIM_LOG_LIMIT` Log lines to fetch (default: 30).
269
- - `SUPABASE_PROJECT_REF` Project ref for health ping (or `supabase/project-ref`).
270
- - `SHIM_HEALTH_PATHS` Comma-separated URL paths with `{fn}` placeholder.
271
-
272
- ## Config file (optional)
273
-
274
- Create `.shimwrappercheckrc` in your project root to persist settings:
271
+ `.shimwrappercheckrc` im Projekt-Root (wird vom Dashboard befüllt; kann manuell angepasst werden):
275
272
 
276
273
  ```bash
277
274
  SHIM_ENFORCE_COMMANDS="functions,db,migration"
@@ -281,23 +278,32 @@ SHIM_AUTO_PUSH=1
281
278
  SHIM_CHECKS_ARGS="--no-ai-review"
282
279
  ```
283
280
 
284
- Note: `.shimwrappercheckrc` is sourced as a shell file.
281
+ Die Datei wird als Shell-Skript eingelesen.
285
282
 
286
283
  ## Templates
287
284
 
288
- - `templates/run-checks.sh` Minimal checks runner; customize for your repo.
289
- - `templates/ai-code-review.sh` Optional AI review step (Codex default, Cursor fallback).
290
- - `templates/husky-pre-push` Husky pre-push hook that runs checks.
291
- - `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.
292
300
 
293
- ## Notes
301
+ ## Hinweise
294
302
 
295
- - If the shim is installed locally, it avoids recursion by resolving the real Supabase CLI.
296
- - If no real CLI is found, it runs `npx --package supabase supabase ...`.
297
- - The git wrapper should be invoked via `npx git` or `npm run git:checked` to avoid shadowing your system git.
298
- - Hooks are resolved from your repo first (`scripts/ping-edge-health.sh`, `scripts/fetch-edge-logs.sh`) and fall back to the package scripts.
299
- - 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.
300
306
 
301
- ## License
307
+ ## Lizenz
302
308
 
303
- 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
 
@@ -57,31 +60,25 @@ export default function AgentsPage() {
57
60
 
58
61
  return (
59
62
  <div className="space-y-6 text-white">
60
- <h1 className="text-3xl font-bold">AGENTS.md</h1>
61
- <p className="text-neutral-300">
62
- Agent-Anweisungen für Cursor/Codex. Wird von Agents gelesen; hier bearbeitbar. Änderungen gelten sofort.
63
- </p>
63
+ <h1 className="text-3xl font-bold">{tAgents("title")}</h1>
64
+ <p className="text-neutral-300">{tAgents("description")}</p>
64
65
  {!exists && (
65
66
  <div className="alert bg-neutral-800 border-neutral-600 text-neutral-300">
66
- <span>AGENTS.md existiert noch nicht. Beim Speichern wird sie im Projekt-Root angelegt.</span>
67
+ <span>{tAgents("notExists")}</span>
67
68
  </div>
68
69
  )}
69
70
  <textarea
70
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
 
@@ -51,26 +55,20 @@ export default function ConfigPage() {
51
55
 
52
56
  return (
53
57
  <div className="space-y-6 text-white">
54
- <h1 className="text-3xl font-bold">Config (.shimwrappercheckrc)</h1>
55
- <p className="text-neutral-300">
56
- Shell-Variablen und Kommentare. Wird beim nächsten Aufruf des Shims verwendet.
57
- </p>
58
+ <h1 className="text-3xl font-bold">{tConfig("title")}</h1>
59
+ <p className="text-neutral-300">{tConfig("description")}</p>
58
60
  <textarea
59
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
  );