noyrax-doc-cli 1.0.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/LOCAL_USAGE.md +205 -0
- package/PUBLISH_INSTRUCTIONS.md +68 -0
- package/README.md +233 -0
- package/USAGE.md +350 -0
- package/bin/noyrax-generate.js +51 -0
- package/bin/noyrax-scan.js +53 -0
- package/bin/noyrax-validate.js +51 -0
- package/bin/noyrax-verify-adrs.js +54 -0
- package/bin/noyrax-verify-all.js +77 -0
- package/bin/noyrax-verify-architecture.js +54 -0
- package/bin/noyrax-verify-imports.js +54 -0
- package/package.json +46 -0
package/LOCAL_USAGE.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Lokale Verwendung von @noyrax/doc-cli
|
|
2
|
+
|
|
3
|
+
Da das Package noch nicht in npm veröffentlicht ist, gibt es mehrere Möglichkeiten, es lokal zu verwenden:
|
|
4
|
+
|
|
5
|
+
## Option 1: npm link (Empfohlen für Entwicklung)
|
|
6
|
+
|
|
7
|
+
### Schritt 1: Package verlinken
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Im noyrax-doc-cli Verzeichnis
|
|
11
|
+
cd noyrax-doc-cli
|
|
12
|
+
npm link
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Schritt 2: In Ihrem Projekt verwenden
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# In Ihrem Projekt-Verzeichnis
|
|
19
|
+
cd /path/to/your/project
|
|
20
|
+
|
|
21
|
+
# Package verlinken
|
|
22
|
+
npm link @noyrax/doc-cli
|
|
23
|
+
|
|
24
|
+
# noyrax Package installieren (falls noch nicht vorhanden)
|
|
25
|
+
npm install noyrax
|
|
26
|
+
|
|
27
|
+
# Jetzt können Sie die Commands verwenden
|
|
28
|
+
noyrax-scan
|
|
29
|
+
noyrax-validate
|
|
30
|
+
noyrax-verify-all
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Option 2: Direkter Pfad (ohne npm link)
|
|
34
|
+
|
|
35
|
+
### In package.json Ihres Projekts
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@noyrax/doc-cli": "file:../noyrax-doc-cli",
|
|
41
|
+
"noyrax": "^1.0.4"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Dann:
|
|
47
|
+
```bash
|
|
48
|
+
npm install
|
|
49
|
+
noyrax-scan
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Option 3: Direkt mit node aufrufen
|
|
53
|
+
|
|
54
|
+
Sie können die Scripts auch direkt mit node aufrufen:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Von Ihrem Projekt-Verzeichnis aus
|
|
58
|
+
node ../noyrax-doc-cli/bin/noyrax-scan.js
|
|
59
|
+
node ../noyrax-doc-cli/bin/noyrax-validate.js
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Option 4: Relative Pfade in package.json Scripts
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"scripts": {
|
|
67
|
+
"docs:scan": "node ../noyrax-doc-cli/bin/noyrax-scan.js",
|
|
68
|
+
"docs:validate": "node ../noyrax-doc-cli/bin/noyrax-validate.js",
|
|
69
|
+
"docs:verify": "node ../noyrax-doc-cli/bin/noyrax-verify-all.js"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Option 5: Globale Installation (nicht empfohlen)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Im noyrax-doc-cli Verzeichnis
|
|
78
|
+
cd noyrax-doc-cli
|
|
79
|
+
npm install -g .
|
|
80
|
+
|
|
81
|
+
# Jetzt überall verfügbar
|
|
82
|
+
noyrax-scan
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Empfohlener Workflow für lokale Entwicklung
|
|
86
|
+
|
|
87
|
+
### 1. Setup einmalig
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Im noyrax-doc-cli Verzeichnis
|
|
91
|
+
cd noyrax-doc-cli
|
|
92
|
+
npm link
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 2. In jedem neuen Projekt
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# In Ihrem Projekt
|
|
99
|
+
npm link @noyrax/doc-cli
|
|
100
|
+
npm install noyrax
|
|
101
|
+
|
|
102
|
+
# Commands verwenden
|
|
103
|
+
noyrax-scan
|
|
104
|
+
noyrax-validate
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 3. Unlink (wenn nicht mehr benötigt)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Im Projekt
|
|
111
|
+
npm unlink @noyrax/doc-cli
|
|
112
|
+
|
|
113
|
+
# Im noyrax-doc-cli Verzeichnis (optional)
|
|
114
|
+
npm unlink
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Wichtige Hinweise
|
|
118
|
+
|
|
119
|
+
### noyrax Package muss kompiliert sein
|
|
120
|
+
|
|
121
|
+
Das `noyrax` Package muss kompiliert sein, damit die CLI-Scripts funktionieren:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Im noyrax Package-Verzeichnis
|
|
125
|
+
cd documentation-system-plugin
|
|
126
|
+
npm run compile
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Pfad-Anpassung für lokale Entwicklung
|
|
130
|
+
|
|
131
|
+
Falls Sie das Package in einem anderen Verzeichnis haben, müssen Sie die Pfade in den bin-Scripts anpassen. Die Scripts suchen automatisch nach:
|
|
132
|
+
1. `node_modules/noyrax` (wenn als npm-Package installiert)
|
|
133
|
+
2. Relativer Pfad `../documentation-system-plugin` (für lokale Entwicklung)
|
|
134
|
+
|
|
135
|
+
## Testen der Installation
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Prüfen ob Commands verfügbar sind
|
|
139
|
+
which noyrax-scan # Linux/Mac
|
|
140
|
+
where noyrax-scan # Windows
|
|
141
|
+
|
|
142
|
+
# Oder direkt testen
|
|
143
|
+
noyrax-scan --help # Sollte Fehler zeigen, aber Command wird gefunden
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Fehlerbehebung
|
|
147
|
+
|
|
148
|
+
### "Could not find noyrax package"
|
|
149
|
+
|
|
150
|
+
**Problem:** Das noyrax Package wird nicht gefunden.
|
|
151
|
+
|
|
152
|
+
**Lösung 1:** Relativen Pfad prüfen
|
|
153
|
+
```bash
|
|
154
|
+
# Prüfen ob documentation-system-plugin existiert
|
|
155
|
+
ls ../documentation-system-plugin/package.json
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Lösung 2:** noyrax installieren
|
|
159
|
+
```bash
|
|
160
|
+
npm install noyrax
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### "Script not found"
|
|
164
|
+
|
|
165
|
+
**Problem:** Das noyrax Package ist nicht kompiliert.
|
|
166
|
+
|
|
167
|
+
**Lösung:**
|
|
168
|
+
```bash
|
|
169
|
+
cd documentation-system-plugin
|
|
170
|
+
npm run compile
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### "Command not found" (nach npm link)
|
|
174
|
+
|
|
175
|
+
**Problem:** npm link wurde nicht korrekt ausgeführt.
|
|
176
|
+
|
|
177
|
+
**Lösung:**
|
|
178
|
+
```bash
|
|
179
|
+
# Im noyrax-doc-cli Verzeichnis
|
|
180
|
+
npm link
|
|
181
|
+
|
|
182
|
+
# Im Projekt-Verzeichnis
|
|
183
|
+
npm link @noyrax/doc-cli
|
|
184
|
+
|
|
185
|
+
# Prüfen
|
|
186
|
+
npm list -g --depth=0 | grep noyrax
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Für die Veröffentlichung
|
|
190
|
+
|
|
191
|
+
Wenn Sie das Package später in npm veröffentlichen möchten:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# 1. Version setzen
|
|
195
|
+
npm version patch # oder minor, major
|
|
196
|
+
|
|
197
|
+
# 2. Veröffentlichen
|
|
198
|
+
npm publish --access public
|
|
199
|
+
|
|
200
|
+
# 3. Dann können andere es installieren mit:
|
|
201
|
+
npm install -D @noyrax/doc-cli noyrax
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Hinweis:** Sie benötigen einen npm-Account und müssen dem `@noyrax` Scope beitreten.
|
|
205
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Anleitung: Package veröffentlichen mit Granular Access Token
|
|
2
|
+
|
|
3
|
+
Da npm für Scoped Packages (`@noyrax/*`) 2FA oder einen Granular Access Token mit "Bypass 2FA" erfordert, hier die Anleitung:
|
|
4
|
+
|
|
5
|
+
## Schritt 1: Granular Access Token erstellen
|
|
6
|
+
|
|
7
|
+
1. Gehen Sie zu: https://www.npmjs.com/settings/benjaminbehrens/tokens
|
|
8
|
+
2. Klicken Sie auf **"Generate New Token"** → **"Granular Access Token"**
|
|
9
|
+
3. Konfigurieren Sie den Token:
|
|
10
|
+
- **Token Name**: z.B. "doc-cli-publish"
|
|
11
|
+
- **Expiration**: Wählen Sie eine Ablaufzeit (z.B. "90 days" oder "No expiration")
|
|
12
|
+
- **Package Access**:
|
|
13
|
+
- Wählen Sie **"Select packages"**
|
|
14
|
+
- Wählen Sie **`@noyrax/doc-cli`** (oder `@noyrax/*` für alle Packages)
|
|
15
|
+
- **Permissions**:
|
|
16
|
+
- ✅ **"Read and Publish"** aktivieren
|
|
17
|
+
- **Bypass 2FA**:
|
|
18
|
+
- ✅ **"Bypass 2FA"** aktivieren (wichtig!)
|
|
19
|
+
4. Klicken Sie auf **"Generate Token"**
|
|
20
|
+
5. **Kopieren Sie den Token sofort** (er wird nur einmal angezeigt!)
|
|
21
|
+
|
|
22
|
+
## Schritt 2: Token konfigurieren
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Token setzen (ersetzt <IHR_TOKEN> mit dem kopierten Token)
|
|
26
|
+
npm config set //registry.npmjs.org/:_authToken <IHR_TOKEN>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Oder temporär für einen Befehl:**
|
|
30
|
+
```bash
|
|
31
|
+
npm publish --access public --//registry.npmjs.org/:_authToken=<IHR_TOKEN>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Schritt 3: Package veröffentlichen
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cd noyrax-doc-cli
|
|
38
|
+
npm publish --access public
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Alternative: Package ohne Scope veröffentlichen
|
|
42
|
+
|
|
43
|
+
Falls Sie keinen Granular Access Token erstellen können, können Sie das Package auch ohne Scope veröffentlichen:
|
|
44
|
+
|
|
45
|
+
1. In `package.json` den Namen ändern:
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"name": "noyrax-doc-cli" // statt "@noyrax/doc-cli"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. Dann veröffentlichen:
|
|
53
|
+
```bash
|
|
54
|
+
npm publish
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Nachteil:** Das Package wäre dann unter `noyrax-doc-cli` statt `@noyrax/doc-cli` verfügbar.
|
|
58
|
+
|
|
59
|
+
## Verifikation
|
|
60
|
+
|
|
61
|
+
Nach der Veröffentlichung können Sie prüfen:
|
|
62
|
+
```bash
|
|
63
|
+
npm view @noyrax/doc-cli
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Oder im Browser:
|
|
67
|
+
https://www.npmjs.com/package/@noyrax/doc-cli
|
|
68
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# @noyrax/doc-cli
|
|
2
|
+
|
|
3
|
+
Standalone CLI für Noyrax Documentation System - Scan, Validate, Generate, Verify
|
|
4
|
+
|
|
5
|
+
## Überblick
|
|
6
|
+
|
|
7
|
+
Dieses Package stellt alle CLI-Befehle des Noyrax Documentation System als eigenständige, installierbare Commands zur Verfügung. Es nutzt nur das `noyrax` (documentation-system-plugin) Package als Dependency und funktioniert ohne Database- oder Semantic-Brain-Plugins.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -D @noyrax/doc-cli noyrax
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Wichtig:** Das `noyrax` Package muss ebenfalls installiert sein, da es als Peer-Dependency verwendet wird.
|
|
16
|
+
|
|
17
|
+
## Verfügbare Commands
|
|
18
|
+
|
|
19
|
+
### Dokumentations-Generierung
|
|
20
|
+
|
|
21
|
+
#### `noyrax-scan`
|
|
22
|
+
Führt einen vollständigen Scan durch und generiert die Dokumentation.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
noyrax-scan
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Funktionalität:**
|
|
29
|
+
- Scannt das Projekt nach TypeScript/JavaScript/Python-Dateien
|
|
30
|
+
- Extrahiert Symbole (Funktionen, Klassen, Interfaces, etc.)
|
|
31
|
+
- Generiert Modul-Dokumentation in `docs/modules/`
|
|
32
|
+
- Erstellt Symbol-Index in `docs/index/symbols.jsonl`
|
|
33
|
+
- Generiert Dependency-Graph in `docs/system/DEPENDENCY_GRAPH.md`
|
|
34
|
+
- Erstellt Change Report in `docs/system/CHANGE_REPORT.md`
|
|
35
|
+
|
|
36
|
+
#### `noyrax-generate`
|
|
37
|
+
Generiert nur die Dokumentation (ohne Scan).
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
noyrax-generate
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Verwendung:** Wenn bereits gescannt wurde und nur die Dokumentation aktualisiert werden soll.
|
|
44
|
+
|
|
45
|
+
### Validierung
|
|
46
|
+
|
|
47
|
+
#### `noyrax-validate`
|
|
48
|
+
Validiert die Dokumentation gegen den Code.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
noyrax-validate
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Funktionalität:**
|
|
55
|
+
- Prüft Signatur-Übereinstimmung zwischen Code und Dokumentation
|
|
56
|
+
- Prüft Coverage (welche Symbole sind dokumentiert)
|
|
57
|
+
- Erkennt veraltete Dokumentation
|
|
58
|
+
- Gibt Exit-Code zurück:
|
|
59
|
+
- `0` = Alles valide
|
|
60
|
+
- `1` = Warnungen (z.B. fehlende Docs)
|
|
61
|
+
- `2` = Fehler (z.B. Signatur-Mismatch)
|
|
62
|
+
|
|
63
|
+
### Verification
|
|
64
|
+
|
|
65
|
+
#### `noyrax-verify-adrs`
|
|
66
|
+
Prüft ADR-Claims gegen den Code.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
noyrax-verify-adrs
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Funktionalität:**
|
|
73
|
+
- Prüft, ob in ADRs erwähnte Dateien existieren
|
|
74
|
+
- Prüft, ob in ADRs erwähnte Funktionen existieren
|
|
75
|
+
- Erkennt veraltete ADR-Claims
|
|
76
|
+
|
|
77
|
+
**Optionen:**
|
|
78
|
+
```bash
|
|
79
|
+
noyrax-verify-adrs --verbose # Ausführliche Ausgabe mit Warnungen
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### `noyrax-verify-architecture`
|
|
83
|
+
Prüft Architektur-Regeln.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
noyrax-verify-architecture
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Funktionalität:**
|
|
90
|
+
- Prüft Import-Richtungen
|
|
91
|
+
- Erkennt zirkuläre Abhängigkeiten
|
|
92
|
+
- Validiert Modul-Struktur
|
|
93
|
+
|
|
94
|
+
#### `noyrax-verify-imports`
|
|
95
|
+
Prüft Import-Verfügbarkeit.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
noyrax-verify-imports
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Funktionalität:**
|
|
102
|
+
- Prüft, ob alle Imports verfügbar sind
|
|
103
|
+
- Erkennt fehlende Dependencies
|
|
104
|
+
- Validiert Import-Pfade
|
|
105
|
+
|
|
106
|
+
#### `noyrax-verify-all`
|
|
107
|
+
Führt alle Verification-Checks aus.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
noyrax-verify-all
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Funktionalität:**
|
|
114
|
+
- Führt `verify-architecture`, `verify-adrs` und `verify-imports` nacheinander aus
|
|
115
|
+
- Gibt Exit-Code `1` zurück, wenn ein Check fehlschlägt
|
|
116
|
+
|
|
117
|
+
## Workflow-Integration
|
|
118
|
+
|
|
119
|
+
### Standard-Workflow
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# 1. Dokumentation generieren
|
|
123
|
+
noyrax-scan
|
|
124
|
+
|
|
125
|
+
# 2. Dokumentation validieren
|
|
126
|
+
noyrax-validate
|
|
127
|
+
|
|
128
|
+
# 3. Verification-Checks
|
|
129
|
+
noyrax-verify-all
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### In package.json Scripts
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"scripts": {
|
|
137
|
+
"docs:scan": "noyrax-scan",
|
|
138
|
+
"docs:validate": "noyrax-validate",
|
|
139
|
+
"docs:verify": "noyrax-verify-all",
|
|
140
|
+
"docs:full": "noyrax-scan && noyrax-validate && noyrax-verify-all"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Dann können Sie verwenden:
|
|
146
|
+
```bash
|
|
147
|
+
npm run docs:scan
|
|
148
|
+
npm run docs:validate
|
|
149
|
+
npm run docs:verify
|
|
150
|
+
npm run docs:full
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Mit npx (ohne Installation)
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npx @noyrax/doc-cli noyrax-scan
|
|
157
|
+
npx @noyrax/doc-cli noyrax-validate
|
|
158
|
+
npx @noyrax/doc-cli noyrax-verify-all
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Cursor Rules Integration
|
|
162
|
+
|
|
163
|
+
Die CLI-Befehle sind in den Cursor Rules dokumentiert:
|
|
164
|
+
|
|
165
|
+
- **`001-pre-check.mdc`**: Verification-Commands Quick-Reference
|
|
166
|
+
- **`026-reality-driven-verification.mdc`**: Build-Verification Commands
|
|
167
|
+
|
|
168
|
+
Die Cursor Rules unterstützen beide Varianten:
|
|
169
|
+
1. **Standalone CLI** (`noyrax-scan`, `noyrax-validate`, etc.) - für neue Projekte
|
|
170
|
+
2. **Lokale Scripts** (`npm run scan:cli`, etc.) - für Projekte mit documentation-system-plugin
|
|
171
|
+
|
|
172
|
+
## Voraussetzungen
|
|
173
|
+
|
|
174
|
+
- Node.js >= 18.0.0
|
|
175
|
+
- TypeScript >= 4.9.0 oder >= 5.0.0
|
|
176
|
+
- Das `noyrax` Package muss installiert und kompiliert sein
|
|
177
|
+
|
|
178
|
+
## Fehlerbehebung
|
|
179
|
+
|
|
180
|
+
### "Could not find noyrax package"
|
|
181
|
+
|
|
182
|
+
**Lösung:** Installieren Sie das `noyrax` Package:
|
|
183
|
+
```bash
|
|
184
|
+
npm install noyrax
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### "Script not found"
|
|
188
|
+
|
|
189
|
+
**Lösung:** Stellen Sie sicher, dass das `noyrax` Package kompiliert ist:
|
|
190
|
+
```bash
|
|
191
|
+
cd node_modules/noyrax
|
|
192
|
+
npm run compile
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### "Command not found"
|
|
196
|
+
|
|
197
|
+
**Lösung:** Stellen Sie sicher, dass `@noyrax/doc-cli` installiert ist:
|
|
198
|
+
```bash
|
|
199
|
+
npm install -D @noyrax/doc-cli
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Oder verwenden Sie `npx`:
|
|
203
|
+
```bash
|
|
204
|
+
npx noyrax-scan
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Vorteile
|
|
208
|
+
|
|
209
|
+
1. **Eigenständig**: Nur Doku-Plugin als Dependency, keine Database/Semantic-Brain
|
|
210
|
+
2. **Einfache Installation**: `npm install -D @noyrax/doc-cli noyrax`
|
|
211
|
+
3. **Konsistente Commands**: Gleiche Befehle in allen Projekten
|
|
212
|
+
4. **Cursor Rules Integration**: Dokumentiert in den Rules
|
|
213
|
+
5. **Keine Abhängigkeiten**: Funktioniert ohne VS Code Extension
|
|
214
|
+
|
|
215
|
+
## Unterschied zu lokalen Scripts
|
|
216
|
+
|
|
217
|
+
| Aspekt | Standalone CLI | Lokale Scripts |
|
|
218
|
+
|--------|----------------|----------------|
|
|
219
|
+
| **Installation** | `npm install -D @noyrax/doc-cli` | Teil von `noyrax` Package |
|
|
220
|
+
| **Verwendung** | `noyrax-scan` | `npm run scan:cli` |
|
|
221
|
+
| **Abhängigkeiten** | Nur `noyrax` | Vollständiges Plugin-Ecosystem |
|
|
222
|
+
| **Verfügbarkeit** | In jedem Projekt | Nur in Projekten mit `noyrax` |
|
|
223
|
+
|
|
224
|
+
## Weitere Informationen
|
|
225
|
+
|
|
226
|
+
- [Noyrax Documentation](https://noyrax.dev)
|
|
227
|
+
- [GitHub Repository](https://github.com/noyrax/noyrax)
|
|
228
|
+
- [Cursor Rules](https://github.com/noyrax/noyrax/tree/main/documentation-system-plugin/packages/doc-system-agent/templates/cursor-rules)
|
|
229
|
+
|
|
230
|
+
## Lizenz
|
|
231
|
+
|
|
232
|
+
MIT
|
|
233
|
+
|
package/USAGE.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# Verwendung von @noyrax/doc-cli
|
|
2
|
+
|
|
3
|
+
## Schnellstart
|
|
4
|
+
|
|
5
|
+
### 1. Installation
|
|
6
|
+
|
|
7
|
+
In einem neuen Projekt:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Package installieren
|
|
11
|
+
npm install -D @noyrax/doc-cli noyrax
|
|
12
|
+
|
|
13
|
+
# Oder mit npx (ohne Installation)
|
|
14
|
+
npx @noyrax/doc-cli noyrax-scan
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Wichtig:** Das `noyrax` Package muss ebenfalls installiert sein, da es als Peer-Dependency verwendet wird.
|
|
18
|
+
|
|
19
|
+
### 2. Erste Verwendung
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Dokumentation generieren
|
|
23
|
+
npx noyrax-scan
|
|
24
|
+
|
|
25
|
+
# Dokumentation validieren
|
|
26
|
+
npx noyrax-validate
|
|
27
|
+
|
|
28
|
+
# Alle Checks ausführen
|
|
29
|
+
npx noyrax-verify-all
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Verwendungs-Szenarien
|
|
33
|
+
|
|
34
|
+
### Szenario 1: Lokale Entwicklung (mit npm link)
|
|
35
|
+
|
|
36
|
+
Wenn Sie das Package lokal entwickeln:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Im noyrax-doc-cli Verzeichnis
|
|
40
|
+
cd noyrax-doc-cli
|
|
41
|
+
npm link
|
|
42
|
+
|
|
43
|
+
# In Ihrem Projekt
|
|
44
|
+
cd /path/to/your/project
|
|
45
|
+
npm link @noyrax/doc-cli
|
|
46
|
+
npm install noyrax
|
|
47
|
+
|
|
48
|
+
# Jetzt können Sie die Commands verwenden
|
|
49
|
+
noyrax-scan
|
|
50
|
+
noyrax-validate
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Szenario 2: Als npm Package (nach Veröffentlichung)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Installation
|
|
57
|
+
npm install -D @noyrax/doc-cli noyrax
|
|
58
|
+
|
|
59
|
+
# Verwendung
|
|
60
|
+
npx noyrax-scan
|
|
61
|
+
npx noyrax-validate
|
|
62
|
+
npx noyrax-verify-all
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Szenario 3: In package.json Scripts
|
|
66
|
+
|
|
67
|
+
Fügen Sie die Commands zu Ihren `package.json` Scripts hinzu:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"scripts": {
|
|
72
|
+
"docs:scan": "noyrax-scan",
|
|
73
|
+
"docs:validate": "noyrax-validate",
|
|
74
|
+
"docs:verify": "noyrax-verify-all",
|
|
75
|
+
"docs:full": "noyrax-scan && noyrax-validate && noyrax-verify-all",
|
|
76
|
+
"precommit": "noyrax-validate && noyrax-verify-all"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Dann können Sie verwenden:
|
|
82
|
+
```bash
|
|
83
|
+
npm run docs:scan
|
|
84
|
+
npm run docs:validate
|
|
85
|
+
npm run docs:verify
|
|
86
|
+
npm run docs:full
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Szenario 4: In CI/CD Pipelines
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
# GitHub Actions Beispiel
|
|
93
|
+
- name: Generate Documentation
|
|
94
|
+
run: npx noyrax-scan
|
|
95
|
+
|
|
96
|
+
- name: Validate Documentation
|
|
97
|
+
run: npx noyrax-validate
|
|
98
|
+
|
|
99
|
+
- name: Verify All
|
|
100
|
+
run: npx noyrax-verify-all
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Verfügbare Commands im Detail
|
|
104
|
+
|
|
105
|
+
### Dokumentations-Generierung
|
|
106
|
+
|
|
107
|
+
#### `noyrax-scan`
|
|
108
|
+
Vollständiger Scan und Generierung der Dokumentation.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
noyrax-scan
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Was passiert:**
|
|
115
|
+
1. Scannt `src/` nach TypeScript/JavaScript/Python-Dateien
|
|
116
|
+
2. Extrahiert alle Symbole (Funktionen, Klassen, Interfaces, etc.)
|
|
117
|
+
3. Generiert Modul-Dokumentation in `docs/modules/`
|
|
118
|
+
4. Erstellt Symbol-Index in `docs/index/symbols.jsonl`
|
|
119
|
+
5. Generiert Dependency-Graph in `docs/system/DEPENDENCY_GRAPH.md`
|
|
120
|
+
6. Erstellt Change Report in `docs/system/CHANGE_REPORT.md`
|
|
121
|
+
|
|
122
|
+
**Output:**
|
|
123
|
+
- `docs/modules/*.md` - API-Dokumentation pro Datei
|
|
124
|
+
- `docs/index/symbols.jsonl` - Symbol-Index
|
|
125
|
+
- `docs/system/DEPENDENCY_GRAPH.md` - Mermaid-Graph
|
|
126
|
+
- `docs/system/DEPENDENCIES.md` - Dependency-Übersicht
|
|
127
|
+
- `docs/system/CHANGE_REPORT.md` - Änderungshistorie
|
|
128
|
+
|
|
129
|
+
#### `noyrax-generate`
|
|
130
|
+
Nur Generierung (ohne Scan).
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
noyrax-generate
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Verwendung:** Wenn bereits gescannt wurde und nur die Dokumentation aktualisiert werden soll.
|
|
137
|
+
|
|
138
|
+
### Validierung
|
|
139
|
+
|
|
140
|
+
#### `noyrax-validate`
|
|
141
|
+
Validiert die Dokumentation gegen den Code.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
noyrax-validate
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Was passiert:**
|
|
148
|
+
1. Prüft Signatur-Übereinstimmung zwischen Code und Docs
|
|
149
|
+
2. Prüft Coverage (welche Symbole sind dokumentiert)
|
|
150
|
+
3. Erkennt veraltete Dokumentation
|
|
151
|
+
|
|
152
|
+
**Exit-Codes:**
|
|
153
|
+
- `0` = Alles valide ✅
|
|
154
|
+
- `1` = Warnungen (z.B. fehlende Docs) ⚠️
|
|
155
|
+
- `2` = Fehler (z.B. Signatur-Mismatch) ❌
|
|
156
|
+
|
|
157
|
+
### Verification
|
|
158
|
+
|
|
159
|
+
#### `noyrax-verify-adrs`
|
|
160
|
+
Prüft ADR-Claims gegen den Code.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
noyrax-verify-adrs
|
|
164
|
+
noyrax-verify-adrs --verbose # Ausführliche Ausgabe
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Was passiert:**
|
|
168
|
+
- Prüft, ob in ADRs erwähnte Dateien existieren
|
|
169
|
+
- Prüft, ob in ADRs erwähnte Funktionen existieren
|
|
170
|
+
- Erkennt veraltete ADR-Claims
|
|
171
|
+
|
|
172
|
+
#### `noyrax-verify-architecture`
|
|
173
|
+
Prüft Architektur-Regeln.
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
noyrax-verify-architecture
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Was passiert:**
|
|
180
|
+
- Prüft Import-Richtungen
|
|
181
|
+
- Erkennt zirkuläre Abhängigkeiten
|
|
182
|
+
- Validiert Modul-Struktur
|
|
183
|
+
|
|
184
|
+
#### `noyrax-verify-imports`
|
|
185
|
+
Prüft Import-Verfügbarkeit.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
noyrax-verify-imports
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Was passiert:**
|
|
192
|
+
- Prüft, ob alle Imports verfügbar sind
|
|
193
|
+
- Erkennt fehlende Dependencies
|
|
194
|
+
- Validiert Import-Pfade
|
|
195
|
+
|
|
196
|
+
#### `noyrax-verify-all`
|
|
197
|
+
Führt alle Verification-Checks aus.
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
noyrax-verify-all
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Was passiert:**
|
|
204
|
+
- Führt `verify-architecture`, `verify-adrs` und `verify-imports` nacheinander aus
|
|
205
|
+
- Gibt Exit-Code `1` zurück, wenn ein Check fehlschlägt
|
|
206
|
+
|
|
207
|
+
## Typischer Workflow
|
|
208
|
+
|
|
209
|
+
### Nach Code-Änderungen
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# 1. Dokumentation aktualisieren
|
|
213
|
+
noyrax-scan
|
|
214
|
+
|
|
215
|
+
# 2. Dokumentation validieren
|
|
216
|
+
noyrax-validate
|
|
217
|
+
|
|
218
|
+
# 3. Alle Checks ausführen
|
|
219
|
+
noyrax-verify-all
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Vor Commit
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Schneller Check
|
|
226
|
+
noyrax-validate && noyrax-verify-all
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### In package.json
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"scripts": {
|
|
234
|
+
"precommit": "noyrax-validate && noyrax-verify-all",
|
|
235
|
+
"docs": "noyrax-scan && noyrax-validate"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Integration mit Cursor Rules
|
|
241
|
+
|
|
242
|
+
Die Commands sind automatisch in den Cursor Rules dokumentiert. Wenn Sie die Cursor Rules in Ihrem Projekt verwenden, werden die Commands automatisch erkannt:
|
|
243
|
+
|
|
244
|
+
**In `001-pre-check.mdc`:**
|
|
245
|
+
```markdown
|
|
246
|
+
### Standalone CLI (nach Installation von @noyrax/doc-cli)
|
|
247
|
+
noyrax-scan
|
|
248
|
+
noyrax-validate
|
|
249
|
+
noyrax-verify-all
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Der AI-Agent wird diese Commands automatisch verwenden, wenn:**
|
|
253
|
+
- Das Package installiert ist
|
|
254
|
+
- Die Cursor Rules aktiv sind
|
|
255
|
+
- Der Agent Dokumentation generieren/validieren soll
|
|
256
|
+
|
|
257
|
+
## Fehlerbehebung
|
|
258
|
+
|
|
259
|
+
### "Could not find noyrax package"
|
|
260
|
+
|
|
261
|
+
**Problem:** Das `noyrax` Package ist nicht installiert.
|
|
262
|
+
|
|
263
|
+
**Lösung:**
|
|
264
|
+
```bash
|
|
265
|
+
npm install noyrax
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### "Script not found"
|
|
269
|
+
|
|
270
|
+
**Problem:** Das `noyrax` Package ist nicht kompiliert.
|
|
271
|
+
|
|
272
|
+
**Lösung:**
|
|
273
|
+
```bash
|
|
274
|
+
cd node_modules/noyrax
|
|
275
|
+
npm run compile
|
|
276
|
+
cd ../..
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### "Command not found"
|
|
280
|
+
|
|
281
|
+
**Problem:** `@noyrax/doc-cli` ist nicht installiert oder nicht im PATH.
|
|
282
|
+
|
|
283
|
+
**Lösung 1:** Mit npx verwenden
|
|
284
|
+
```bash
|
|
285
|
+
npx noyrax-scan
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Lösung 2:** Lokal installieren
|
|
289
|
+
```bash
|
|
290
|
+
npm install -D @noyrax/doc-cli
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Lösung 3:** Global installieren (nicht empfohlen)
|
|
294
|
+
```bash
|
|
295
|
+
npm install -g @noyrax/doc-cli
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Beispiel-Projekt
|
|
299
|
+
|
|
300
|
+
### Minimales Setup
|
|
301
|
+
|
|
302
|
+
```json
|
|
303
|
+
{
|
|
304
|
+
"name": "my-project",
|
|
305
|
+
"version": "1.0.0",
|
|
306
|
+
"scripts": {
|
|
307
|
+
"docs:scan": "noyrax-scan",
|
|
308
|
+
"docs:validate": "noyrax-validate",
|
|
309
|
+
"docs:verify": "noyrax-verify-all"
|
|
310
|
+
},
|
|
311
|
+
"devDependencies": {
|
|
312
|
+
"@noyrax/doc-cli": "^1.0.0",
|
|
313
|
+
"noyrax": "^1.0.4",
|
|
314
|
+
"typescript": "^5.0.0"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Verwendung
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Installation
|
|
323
|
+
npm install
|
|
324
|
+
|
|
325
|
+
# Dokumentation generieren
|
|
326
|
+
npm run docs:scan
|
|
327
|
+
|
|
328
|
+
# Dokumentation validieren
|
|
329
|
+
npm run docs:validate
|
|
330
|
+
|
|
331
|
+
# Alle Checks
|
|
332
|
+
npm run docs:verify
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Unterschied zu lokalen Scripts
|
|
336
|
+
|
|
337
|
+
| Aspekt | Standalone CLI | Lokale Scripts |
|
|
338
|
+
|--------|----------------|----------------|
|
|
339
|
+
| **Installation** | `npm install -D @noyrax/doc-cli` | Teil von `noyrax` Package |
|
|
340
|
+
| **Verwendung** | `noyrax-scan` | `npm run scan:cli` |
|
|
341
|
+
| **Abhängigkeiten** | Nur `noyrax` | Vollständiges Plugin-Ecosystem |
|
|
342
|
+
| **Verfügbarkeit** | In jedem Projekt | Nur in Projekten mit `noyrax` |
|
|
343
|
+
| **CI/CD** | Einfach (npx) | Benötigt vollständiges Setup |
|
|
344
|
+
|
|
345
|
+
## Weitere Informationen
|
|
346
|
+
|
|
347
|
+
- [README.md](./README.md) - Vollständige Dokumentation
|
|
348
|
+
- [Noyrax Documentation](https://noyrax.dev)
|
|
349
|
+
- [Cursor Rules](https://github.com/noyrax/noyrax/tree/main/documentation-system-plugin/packages/doc-system-agent/templates/cursor-rules)
|
|
350
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI Wrapper für noyrax-generate
|
|
5
|
+
* Ruft generate-cli.js aus dem documentation-system-plugin auf
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
// Finde documentation-system-plugin
|
|
13
|
+
function findPluginPath() {
|
|
14
|
+
try {
|
|
15
|
+
const pluginPath = require.resolve('noyrax/package.json');
|
|
16
|
+
return path.dirname(pluginPath);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
const possiblePaths = [
|
|
19
|
+
path.join(process.cwd(), 'node_modules', 'noyrax'),
|
|
20
|
+
path.join(__dirname, '..', 'node_modules', 'noyrax'),
|
|
21
|
+
path.join(__dirname, '..', '..', 'documentation-system-plugin')
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
for (const possiblePath of possiblePaths) {
|
|
25
|
+
if (fs.existsSync(path.join(possiblePath, 'package.json'))) {
|
|
26
|
+
return possiblePath;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
throw new Error('Could not find noyrax package. Please install it: npm install noyrax');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const pluginDir = findPluginPath();
|
|
36
|
+
const generateScript = path.join(pluginDir, 'out', 'cli', 'generate-cli.js');
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(generateScript)) {
|
|
39
|
+
throw new Error(`Generate script not found at ${generateScript}. Please ensure noyrax is compiled.`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
execSync(`node "${generateScript}"`, {
|
|
43
|
+
stdio: 'inherit',
|
|
44
|
+
cwd: process.cwd(),
|
|
45
|
+
env: process.env
|
|
46
|
+
});
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('Error running noyrax-generate:', error.message);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI Wrapper für noyrax-scan
|
|
5
|
+
* Ruft scan-cli.js aus dem documentation-system-plugin auf
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
// Finde documentation-system-plugin
|
|
13
|
+
function findPluginPath() {
|
|
14
|
+
// Versuche zuerst über require.resolve (wenn als npm-Package installiert)
|
|
15
|
+
try {
|
|
16
|
+
const pluginPath = require.resolve('noyrax/package.json');
|
|
17
|
+
return path.dirname(pluginPath);
|
|
18
|
+
} catch (e) {
|
|
19
|
+
// Fallback: Suche in node_modules relativ zum aktuellen Verzeichnis
|
|
20
|
+
const possiblePaths = [
|
|
21
|
+
path.join(process.cwd(), 'node_modules', 'noyrax'),
|
|
22
|
+
path.join(__dirname, '..', 'node_modules', 'noyrax'),
|
|
23
|
+
path.join(__dirname, '..', '..', 'documentation-system-plugin')
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
for (const possiblePath of possiblePaths) {
|
|
27
|
+
if (fs.existsSync(path.join(possiblePath, 'package.json'))) {
|
|
28
|
+
return possiblePath;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
throw new Error('Could not find noyrax package. Please install it: npm install noyrax');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
const pluginDir = findPluginPath();
|
|
38
|
+
const scanScript = path.join(pluginDir, 'out', 'cli', 'scan-cli.js');
|
|
39
|
+
|
|
40
|
+
if (!fs.existsSync(scanScript)) {
|
|
41
|
+
throw new Error(`Scan script not found at ${scanScript}. Please ensure noyrax is compiled.`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
execSync(`node "${scanScript}"`, {
|
|
45
|
+
stdio: 'inherit',
|
|
46
|
+
cwd: process.cwd(),
|
|
47
|
+
env: process.env
|
|
48
|
+
});
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error('Error running noyrax-scan:', error.message);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI Wrapper für noyrax-validate
|
|
5
|
+
* Ruft validate-cli.js aus dem documentation-system-plugin auf
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
// Finde documentation-system-plugin
|
|
13
|
+
function findPluginPath() {
|
|
14
|
+
try {
|
|
15
|
+
const pluginPath = require.resolve('noyrax/package.json');
|
|
16
|
+
return path.dirname(pluginPath);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
const possiblePaths = [
|
|
19
|
+
path.join(process.cwd(), 'node_modules', 'noyrax'),
|
|
20
|
+
path.join(__dirname, '..', 'node_modules', 'noyrax'),
|
|
21
|
+
path.join(__dirname, '..', '..', 'documentation-system-plugin')
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
for (const possiblePath of possiblePaths) {
|
|
25
|
+
if (fs.existsSync(path.join(possiblePath, 'package.json'))) {
|
|
26
|
+
return possiblePath;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
throw new Error('Could not find noyrax package. Please install it: npm install noyrax');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const pluginDir = findPluginPath();
|
|
36
|
+
const validateScript = path.join(pluginDir, 'out', 'cli', 'validate-cli.js');
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(validateScript)) {
|
|
39
|
+
throw new Error(`Validate script not found at ${validateScript}. Please ensure noyrax is compiled.`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
execSync(`node "${validateScript}"`, {
|
|
43
|
+
stdio: 'inherit',
|
|
44
|
+
cwd: process.cwd(),
|
|
45
|
+
env: process.env
|
|
46
|
+
});
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('Error running noyrax-validate:', error.message);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI Wrapper für noyrax-verify-adrs
|
|
5
|
+
* Ruft verify-adrs.js aus dem documentation-system-plugin auf
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
// Finde documentation-system-plugin
|
|
13
|
+
function findPluginPath() {
|
|
14
|
+
try {
|
|
15
|
+
const pluginPath = require.resolve('noyrax/package.json');
|
|
16
|
+
return path.dirname(pluginPath);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
const possiblePaths = [
|
|
19
|
+
path.join(process.cwd(), 'node_modules', 'noyrax'),
|
|
20
|
+
path.join(__dirname, '..', 'node_modules', 'noyrax'),
|
|
21
|
+
path.join(__dirname, '..', '..', 'documentation-system-plugin')
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
for (const possiblePath of possiblePaths) {
|
|
25
|
+
if (fs.existsSync(path.join(possiblePath, 'package.json'))) {
|
|
26
|
+
return possiblePath;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
throw new Error('Could not find noyrax package. Please install it: npm install noyrax');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const pluginDir = findPluginPath();
|
|
36
|
+
const verifyScript = path.join(pluginDir, 'scripts', 'verify-adrs.js');
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(verifyScript)) {
|
|
39
|
+
throw new Error(`Verify ADRs script not found at ${verifyScript}. Please ensure noyrax is compiled.`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Übertrage alle Argumente
|
|
43
|
+
const args = process.argv.slice(2).join(' ');
|
|
44
|
+
|
|
45
|
+
execSync(`node "${verifyScript}" ${args}`, {
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
cwd: process.cwd(),
|
|
48
|
+
env: process.env
|
|
49
|
+
});
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error('Error running noyrax-verify-adrs:', error.message);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI Wrapper für noyrax-verify-all
|
|
5
|
+
* Führt alle Verification-Scripts aus: verify-architecture, verify-adrs, verify-imports
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
// Finde documentation-system-plugin
|
|
13
|
+
function findPluginPath() {
|
|
14
|
+
try {
|
|
15
|
+
const pluginPath = require.resolve('noyrax/package.json');
|
|
16
|
+
return path.dirname(pluginPath);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
const possiblePaths = [
|
|
19
|
+
path.join(process.cwd(), 'node_modules', 'noyrax'),
|
|
20
|
+
path.join(__dirname, '..', 'node_modules', 'noyrax'),
|
|
21
|
+
path.join(__dirname, '..', '..', 'documentation-system-plugin')
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
for (const possiblePath of possiblePaths) {
|
|
25
|
+
if (fs.existsSync(path.join(possiblePath, 'package.json'))) {
|
|
26
|
+
return possiblePath;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
throw new Error('Could not find noyrax package. Please install it: npm install noyrax');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const pluginDir = findPluginPath();
|
|
36
|
+
const scriptsDir = path.join(pluginDir, 'scripts');
|
|
37
|
+
|
|
38
|
+
const scripts = [
|
|
39
|
+
'verify-architecture.js',
|
|
40
|
+
'verify-adrs.js',
|
|
41
|
+
'verify-imports.js'
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
let hasErrors = false;
|
|
45
|
+
|
|
46
|
+
for (const script of scripts) {
|
|
47
|
+
const scriptPath = path.join(scriptsDir, script);
|
|
48
|
+
|
|
49
|
+
if (!fs.existsSync(scriptPath)) {
|
|
50
|
+
console.warn(`Warning: ${script} not found at ${scriptPath}. Skipping.`);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
console.log(`\nRunning ${script}...`);
|
|
55
|
+
try {
|
|
56
|
+
execSync(`node "${scriptPath}"`, {
|
|
57
|
+
stdio: 'inherit',
|
|
58
|
+
cwd: process.cwd(),
|
|
59
|
+
env: process.env
|
|
60
|
+
});
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error(`Error in ${script}:`, error.message);
|
|
63
|
+
hasErrors = true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (hasErrors) {
|
|
68
|
+
console.error('\nSome verification checks failed.');
|
|
69
|
+
process.exit(1);
|
|
70
|
+
} else {
|
|
71
|
+
console.log('\nAll verification checks passed.');
|
|
72
|
+
}
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error('Error running noyrax-verify-all:', error.message);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI Wrapper für noyrax-verify-architecture
|
|
5
|
+
* Ruft verify-architecture.js aus dem documentation-system-plugin auf
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
// Finde documentation-system-plugin
|
|
13
|
+
function findPluginPath() {
|
|
14
|
+
try {
|
|
15
|
+
const pluginPath = require.resolve('noyrax/package.json');
|
|
16
|
+
return path.dirname(pluginPath);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
const possiblePaths = [
|
|
19
|
+
path.join(process.cwd(), 'node_modules', 'noyrax'),
|
|
20
|
+
path.join(__dirname, '..', 'node_modules', 'noyrax'),
|
|
21
|
+
path.join(__dirname, '..', '..', 'documentation-system-plugin')
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
for (const possiblePath of possiblePaths) {
|
|
25
|
+
if (fs.existsSync(path.join(possiblePath, 'package.json'))) {
|
|
26
|
+
return possiblePath;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
throw new Error('Could not find noyrax package. Please install it: npm install noyrax');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const pluginDir = findPluginPath();
|
|
36
|
+
const verifyScript = path.join(pluginDir, 'scripts', 'verify-architecture.js');
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(verifyScript)) {
|
|
39
|
+
throw new Error(`Verify architecture script not found at ${verifyScript}. Please ensure noyrax is compiled.`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Übertrage alle Argumente
|
|
43
|
+
const args = process.argv.slice(2).join(' ');
|
|
44
|
+
|
|
45
|
+
execSync(`node "${verifyScript}" ${args}`, {
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
cwd: process.cwd(),
|
|
48
|
+
env: process.env
|
|
49
|
+
});
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error('Error running noyrax-verify-architecture:', error.message);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI Wrapper für noyrax-verify-imports
|
|
5
|
+
* Ruft verify-imports.js aus dem documentation-system-plugin auf
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
// Finde documentation-system-plugin
|
|
13
|
+
function findPluginPath() {
|
|
14
|
+
try {
|
|
15
|
+
const pluginPath = require.resolve('noyrax/package.json');
|
|
16
|
+
return path.dirname(pluginPath);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
const possiblePaths = [
|
|
19
|
+
path.join(process.cwd(), 'node_modules', 'noyrax'),
|
|
20
|
+
path.join(__dirname, '..', 'node_modules', 'noyrax'),
|
|
21
|
+
path.join(__dirname, '..', '..', 'documentation-system-plugin')
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
for (const possiblePath of possiblePaths) {
|
|
25
|
+
if (fs.existsSync(path.join(possiblePath, 'package.json'))) {
|
|
26
|
+
return possiblePath;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
throw new Error('Could not find noyrax package. Please install it: npm install noyrax');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const pluginDir = findPluginPath();
|
|
36
|
+
const verifyScript = path.join(pluginDir, 'scripts', 'verify-imports.js');
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(verifyScript)) {
|
|
39
|
+
throw new Error(`Verify imports script not found at ${verifyScript}. Please ensure noyrax is compiled.`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Übertrage alle Argumente
|
|
43
|
+
const args = process.argv.slice(2).join(' ');
|
|
44
|
+
|
|
45
|
+
execSync(`node "${verifyScript}" ${args}`, {
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
cwd: process.cwd(),
|
|
48
|
+
env: process.env
|
|
49
|
+
});
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error('Error running noyrax-verify-imports:', error.message);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "noyrax-doc-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Standalone CLI für Noyrax Documentation System - Scan, Validate, Generate, Verify",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"noyrax-scan": "bin/noyrax-scan.js",
|
|
9
|
+
"noyrax-validate": "bin/noyrax-validate.js",
|
|
10
|
+
"noyrax-generate": "bin/noyrax-generate.js",
|
|
11
|
+
"noyrax-verify-adrs": "bin/noyrax-verify-adrs.js",
|
|
12
|
+
"noyrax-verify-architecture": "bin/noyrax-verify-architecture.js",
|
|
13
|
+
"noyrax-verify-imports": "bin/noyrax-verify-imports.js",
|
|
14
|
+
"noyrax-verify-all": "bin/noyrax-verify-all.js"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"noyrax": "*",
|
|
22
|
+
"typescript": "^4.9.0 || ^5.0.0"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"noyrax",
|
|
29
|
+
"documentation",
|
|
30
|
+
"cli",
|
|
31
|
+
"scan",
|
|
32
|
+
"validate",
|
|
33
|
+
"verify",
|
|
34
|
+
"docs-as-code"
|
|
35
|
+
],
|
|
36
|
+
"author": "Benjamin Behrens <contact@noyrax.dev>",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/noyrax/noyrax.git"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://noyrax.dev",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/noyrax/noyrax/issues"
|
|
45
|
+
}
|
|
46
|
+
}
|