-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.config.example.js
More file actions
181 lines (171 loc) · 4.89 KB
/
Copy pathdocs.config.example.js
File metadata and controls
181 lines (171 loc) · 4.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/** @type {import('docs-kit').Config} */
export default {
// LLM Configuration
// RECOMMENDED: Reference environment variables from .env for security
llm: {
provider: "openai",
apiKey: { env: "OPENAI_API_KEY" }, // References OPENAI_API_KEY from .env
model: "gpt-4",
embeddingModel: "text-embedding-ada-002",
maxTokens: 2000,
temperature: 0.7,
},
// Alternative (NOT RECOMMENDED): Direct API key
// llm: {
// provider: "openai",
// apiKey: "sk-...", // Never commit this to version control!
// model: "gpt-4",
// },
include: [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**/*.py",
"**/*.java",
"**/*.go",
"**/*.rs",
],
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"**/out/**",
"**/.next/**",
"**/vendor/**",
"**/__pycache__/**",
"**/target/**",
"**/.git/**",
"**/coverage/**",
"**/*.min.js",
"**/*.bundle.js",
"**/*.map",
"**/*.d.ts",
"**/package-lock.json",
"**/yarn.lock",
"**/pnpm-lock.yaml",
],
respectGitignore: true,
maxFileSize: 512_000,
dbPath: ".docs-kit/index.db",
promptRules: [],
coverage: {
lcovPath: "coverage/lcov.info",
enabled: true,
},
// RAG (Retrieval-Augmented Generation) Configuration
// Control when embeddings are created during indexing
rag: {
enabled: false, // Set to false to skip RAG during 'docs-kit index'
chunkSize: 500, // Words per chunk
overlapSize: 50, // Overlapping words between chunks
},
// Indexing Configuration
// Control parallel processing during indexing for faster performance
indexing: {
parallel: true, // Enable parallel indexing using worker threads (default: true)
maxWorkers: undefined, // Max worker threads (default: CPU count - 1, capped at 8)
},
// Architecture governance rules (language-specific configuration)
archGuard: {
// Language-specific guard configurations
languages: [
{
language: "php",
// If 'rules' is empty/undefined, ALL available PHP rules are applied
// To whitelist specific rules, list them here:
// rules: ["php:layer_boundary", "php:naming_class", "php:max_complexity"],
// Glob patterns for files to ignore (violations in these files won't be reported)
ignorePaths: [
"**/legacy/**",
"**/vendor/**",
],
// Override specific rule configurations
overrideRules: [
{
code: "php:layer_boundary",
severity: "warning", // Change from default "error" to "warning"
config: {
source: "src/Domain/**",
forbidden: ["src/Infrastructure/**"],
},
},
{
code: "php:max_complexity",
config: {
max: 15, // Override default max of 10
},
},
],
// Rule codes to exclude (these won't be applied even if in whitelist)
excludeRules: [
"php:missing_return_type_strict",
],
},
{
language: "typescript",
// Apply all TypeScript rules (empty rules array = all)
ignorePaths: [
"**/*.test.ts",
"**/__tests__/**",
],
},
],
// Custom rules that can apply across multiple languages
customRules: [
{
language: ["php", "typescript", "javascript"],
code: "custom:no_todo_comments",
description: "Disallow TODO comments in production code",
severity: "warning",
check: (fileContent, _filePath) => {
const todoRegex = /\/\/\s*TODO:/gi;
const matches = fileContent.match(todoRegex);
return matches ? matches.length : 0;
},
ignorePaths: [
"**/LegacyCode/**",
"**/ThirdParty/**",
],
},
{
language: ["php"],
code: "custom:no_die_exit",
description: "Avoid die() and exit() calls in PHP code",
severity: "error",
check: (fileContent) => {
const pattern = /\b(die|exit)\s*\(/gi;
const matches = fileContent.match(pattern);
return matches ? matches.length : 0;
},
},
],
},
docs: [
{
path: "docs/domain/arch-guard-rules.md",
title: "Arch Guard Rules",
name: "arch-guard-rules",
category: "domain",
module: "Main",
symbols: ["createArchGuard", "ArchGuard", "ArchRule", "ArchViolation"],
next: "docs/domain/projectStatus.md",
showOnMenu: true
},
{
path: "docs/domain/projectStatus.md",
title: "Project Status",
name: "project-status",
category: "domain",
module: "Main",
symbols: ["generateProjectStatus", "ProjectStatusResult"],
previous: "docs/domain/arch-guard-rules.md",
showOnMenu: true
},
{
path: "./docs/examples/",
autoDiscovery: true,
showOnMenu: true
}
],
};