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.
- package/README.md +198 -192
- package/dashboard/README.md +13 -0
- package/dashboard/app/{agents → [locale]/agents}/page.tsx +11 -14
- package/dashboard/app/{config → [locale]/config}/page.tsx +11 -13
- package/dashboard/app/[locale]/error.tsx +25 -0
- package/dashboard/app/[locale]/layout.tsx +42 -0
- package/dashboard/app/[locale]/not-found.tsx +27 -0
- package/dashboard/app/[locale]/page.tsx +53 -0
- package/dashboard/app/[locale]/settings/page.tsx +741 -0
- package/dashboard/app/api/agents-md/route.ts +2 -8
- package/dashboard/app/api/check-tools/route.ts +134 -0
- package/dashboard/app/api/config/route.ts +2 -8
- package/dashboard/app/api/info/route.ts +26 -0
- package/dashboard/app/api/run-checks/route.ts +9 -2
- package/dashboard/app/api/settings/route.ts +74 -16
- package/dashboard/app/api/status/route.ts +3 -5
- package/dashboard/app/api/ui-config/route.ts +62 -0
- package/dashboard/app/global-error.tsx +31 -0
- package/dashboard/app/globals.css +26 -0
- package/dashboard/app/layout.tsx +2 -12
- package/dashboard/app/not-found.tsx +22 -0
- package/dashboard/components/AvailableChecks.tsx +260 -0
- package/dashboard/components/CheckCard.tsx +415 -65
- package/dashboard/components/CheckCardList.tsx +28 -23
- package/dashboard/components/Header.tsx +52 -16
- package/dashboard/components/Icons.tsx +20 -0
- package/dashboard/components/LayoutContent.tsx +24 -0
- package/dashboard/components/MyShimChecks.tsx +257 -0
- package/dashboard/components/Nav.tsx +9 -6
- package/dashboard/components/SetDocumentLang.tsx +18 -0
- package/dashboard/components/SidebarMyShim.tsx +108 -19
- package/dashboard/components/StatusCard.tsx +5 -12
- package/dashboard/components/TriggerCommandos.tsx +311 -42
- package/dashboard/lib/checks.ts +134 -17
- package/dashboard/lib/presets.ts +60 -28
- package/dashboard/lib/projectRoot.ts +22 -12
- package/dashboard/next-env.d.ts +2 -1
- package/dashboard/next.config.js +10 -1
- package/dashboard/package.json +11 -6
- package/dashboard/scripts/find-port-and-dev.js +48 -15
- package/dashboard/tailwind.config.js +1 -4
- package/dashboard/tsconfig.json +9 -2
- package/package.json +4 -6
- package/scripts/run-checks.sh +77 -24
- package/scripts/supabase-checked.sh +23 -7
- package/scripts/update-readme.js +72 -0
- package/templates/run-checks.sh +80 -27
- package/dashboard/app/page.tsx +0 -151
- package/dashboard/app/settings/page.tsx +0 -467
package/README.md
CHANGED
|
@@ -1,61 +1,149 @@
|
|
|
1
1
|
# shimwrappercheck
|
|
2
2
|
|
|
3
|
-
CLI
|
|
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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- **
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
63
|
+
Der Wizard fragt u. a.:
|
|
35
64
|
|
|
36
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
154
|
+
## Global Install (PATH-Shims)
|
|
67
155
|
|
|
68
|
-
|
|
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
|
-
#
|
|
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
|
-
|
|
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
|
-
|
|
169
|
+
## Quick Start (ohne Wizard)
|
|
91
170
|
|
|
92
|
-
|
|
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
|
-
|
|
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
|
-
|
|
191
|
+
3. Nutzen:
|
|
118
192
|
|
|
119
193
|
```bash
|
|
120
194
|
npm run supabase:checked -- functions deploy <function-name>
|
|
121
|
-
|
|
122
|
-
npx supabase functions deploy <function-name>
|
|
195
|
+
npx git push
|
|
123
196
|
```
|
|
124
197
|
|
|
125
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
208
|
+
## Wie es funktioniert
|
|
155
209
|
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
- Optional
|
|
160
|
-
-
|
|
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 <
|
|
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
|
-
#
|
|
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
|
-
|
|
233
|
+
## Wrapper-Flags
|
|
179
234
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
189
|
-
npm exec --package shimwrappercheck -- shim --cli docker -- build .
|
|
190
|
-
```
|
|
244
|
+
## Befehlsfilter
|
|
191
245
|
|
|
192
|
-
|
|
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
|
-
|
|
249
|
+
Befehle werden als Token gematcht (z. B. `functions`, `db`, `push`).
|
|
199
250
|
|
|
200
|
-
|
|
251
|
+
## Umgebungsvariablen (Auswahl)
|
|
201
252
|
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
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
|
-
##
|
|
269
|
+
## Config-Datei
|
|
212
270
|
|
|
213
|
-
|
|
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
|
-
|
|
281
|
+
Die Datei wird als Shell-Skript eingelesen.
|
|
285
282
|
|
|
286
283
|
## Templates
|
|
287
284
|
|
|
288
|
-
- `templates/run-checks.sh`
|
|
289
|
-
- `templates/ai-code-review.sh`
|
|
290
|
-
- `templates/husky-pre-push` Husky
|
|
291
|
-
- `templates/git-pre-push`
|
|
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
|
-
##
|
|
301
|
+
## Hinweise
|
|
294
302
|
|
|
295
|
-
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
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
|
-
##
|
|
307
|
+
## Lizenz
|
|
302
308
|
|
|
303
|
-
|
|
309
|
+
MIT (siehe package.json).
|
package/dashboard/README.md
CHANGED
|
@@ -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: "
|
|
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: "
|
|
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">
|
|
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>
|
|
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="
|
|
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 ? "
|
|
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: "
|
|
40
|
+
else setMessage({ type: "success", text: tConfig("saved") });
|
|
37
41
|
})
|
|
38
42
|
.catch(() => {
|
|
39
43
|
setSaving(false);
|
|
40
|
-
setMessage({ type: "error", text: "
|
|
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">
|
|
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="
|
|
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 ? "
|
|
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
|
);
|