@gitpagedocs/cli 1.1.44
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 +169 -0
- package/ai/application/ai-command.ts +24 -0
- package/ai/application/ai-provider-factory.ts +22 -0
- package/ai/application/run-ai-cli-command.ts +136 -0
- package/ai/config.ts +22 -0
- package/ai/core/models/ai-cli-config.ts +31 -0
- package/ai/core/ports/illm-provider.ts +32 -0
- package/ai/infrastructure/ai-config-file.ts +32 -0
- package/ai/infrastructure/file-system-adapter.ts +83 -0
- package/ai/infrastructure/llm/tools-llm-provider.ts +54 -0
- package/ai/presentation/ai-prompts.ts +239 -0
- package/application/config-only/handler.mjs +55 -0
- package/application/home/handler.mjs +83 -0
- package/application/ports/cli-runtime-ports.ts +87 -0
- package/application/report/config-only-reporter.mjs +62 -0
- package/application/use-cases/dispatch-mode.ts +18 -0
- package/builders/config-orchestrator.mjs +40 -0
- package/builders/root-config-builder.mjs +54 -0
- package/builders/route-builders.mjs +111 -0
- package/builders/source-viewer.mjs +330 -0
- package/builders/theme-template.mjs +75 -0
- package/builders/version-config-builder.mjs +151 -0
- package/content/docs-en.mjs +542 -0
- package/content/docs-es.mjs +459 -0
- package/content/docs-pt.mjs +459 -0
- package/content/docs.mjs +9 -0
- package/contracts/doc-versions.mjs +1 -0
- package/contracts/index.mjs +1 -0
- package/data/default-site-config.mjs +312 -0
- package/data/i18n-langmenu.mjs +122 -0
- package/data/i18n-translations.mjs +20 -0
- package/data/layouts.mjs +353 -0
- package/data/path-mappings.mjs +34 -0
- package/data/route-metas.mjs +73 -0
- package/data/theme-colors.mjs +387 -0
- package/data/urls.mjs +7 -0
- package/data/version-constants.mjs +3 -0
- package/domain/models/cli-options.ts +18 -0
- package/domain/services/sanitize-segment.mjs +7 -0
- package/home/constants.mjs +4 -0
- package/home/home-file-writer.mjs +20 -0
- package/home/templates.mjs +48 -0
- package/index.mjs +26 -0
- package/infrastructure/config-only/runtime.mjs +17 -0
- package/infrastructure/home/runtime.mjs +37 -0
- package/package.json +60 -0
- package/presentation/commands/ai-info.ts +57 -0
- package/presentation/commands/config-info.ts +24 -0
- package/presentation/commands/diagnostics.ts +70 -0
- package/presentation/commands/docs.ts +37 -0
- package/presentation/commands/mcp.ts +20 -0
- package/presentation/commands/pages.ts +91 -0
- package/presentation/commands/run-command.ts +62 -0
- package/presentation/index.ts +108 -0
- package/presentation/options/parser.ts +104 -0
- package/presentation/options/resolver.ts +25 -0
- package/presentation/options/schema.ts +10 -0
- package/presentation/ui/banner.ts +13 -0
- package/presentation/ui/clack.ts +74 -0
- package/presentation/ui/prompts.ts +64 -0
- package/runtime/doc-path-resolver.mjs +57 -0
- package/runtime/git-ops.mjs +110 -0
- package/runtime/output.mjs +122 -0
- package/runtime/workflow.mjs +144 -0
- package/start.mjs +12 -0
- package/ui/logger.mjs +9 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
export const THEME_COLORS = {
|
|
2
|
+
"matrix-dark": {
|
|
3
|
+
background: "#030606",
|
|
4
|
+
primary: "#22C55E",
|
|
5
|
+
secondary: "#4ADE80",
|
|
6
|
+
text: "#DCFCE7",
|
|
7
|
+
textSecondary: "#86EFAC",
|
|
8
|
+
cardBackground: "#04120A",
|
|
9
|
+
cardBorder: "#14532D",
|
|
10
|
+
error: "#F87171",
|
|
11
|
+
success: "#22C55E",
|
|
12
|
+
},
|
|
13
|
+
"matrix-light": {
|
|
14
|
+
background: "#F0FDF4",
|
|
15
|
+
primary: "#15803D",
|
|
16
|
+
secondary: "#16A34A",
|
|
17
|
+
text: "#052E16",
|
|
18
|
+
textSecondary: "#166534",
|
|
19
|
+
cardBackground: "#FFFFFF",
|
|
20
|
+
cardBorder: "#BBF7D0",
|
|
21
|
+
error: "#DC2626",
|
|
22
|
+
success: "#16A34A",
|
|
23
|
+
},
|
|
24
|
+
default: {
|
|
25
|
+
background: "#FFFFFF",
|
|
26
|
+
primary: "#0EA5E9",
|
|
27
|
+
secondary: "#2563EB",
|
|
28
|
+
text: "#0F172A",
|
|
29
|
+
textSecondary: "#334155",
|
|
30
|
+
cardBackground: "#FFFFFF",
|
|
31
|
+
cardBorder: "#E2E8F0",
|
|
32
|
+
error: "#DC2626",
|
|
33
|
+
success: "#16A34A",
|
|
34
|
+
},
|
|
35
|
+
"github-dark": {
|
|
36
|
+
background: "#0D1117",
|
|
37
|
+
primary: "#58A6FF",
|
|
38
|
+
secondary: "#2EA043",
|
|
39
|
+
text: "#E6EDF3",
|
|
40
|
+
textSecondary: "#8B949E",
|
|
41
|
+
cardBackground: "#161B22",
|
|
42
|
+
cardBorder: "#30363D",
|
|
43
|
+
error: "#F85149",
|
|
44
|
+
success: "#3FB950",
|
|
45
|
+
},
|
|
46
|
+
"github-light": {
|
|
47
|
+
background: "#FFFFFF",
|
|
48
|
+
primary: "#0969DA",
|
|
49
|
+
secondary: "#1A7F37",
|
|
50
|
+
text: "#1F2328",
|
|
51
|
+
textSecondary: "#57606A",
|
|
52
|
+
cardBackground: "#FFFFFF",
|
|
53
|
+
cardBorder: "#D0D7DE",
|
|
54
|
+
error: "#D1242F",
|
|
55
|
+
success: "#1A7F37",
|
|
56
|
+
},
|
|
57
|
+
"cyberpunk-dark": {
|
|
58
|
+
background: "#090014",
|
|
59
|
+
primary: "#F472B6",
|
|
60
|
+
secondary: "#22D3EE",
|
|
61
|
+
text: "#F5D0FE",
|
|
62
|
+
textSecondary: "#C4B5FD",
|
|
63
|
+
cardBackground: "#160024",
|
|
64
|
+
cardBorder: "#7E22CE",
|
|
65
|
+
error: "#FB7185",
|
|
66
|
+
success: "#2DD4BF",
|
|
67
|
+
},
|
|
68
|
+
"cyberpunk-light": {
|
|
69
|
+
background: "#FFF1F8",
|
|
70
|
+
primary: "#DB2777",
|
|
71
|
+
secondary: "#0891B2",
|
|
72
|
+
text: "#4A044E",
|
|
73
|
+
textSecondary: "#6D28D9",
|
|
74
|
+
cardBackground: "#FFFFFF",
|
|
75
|
+
cardBorder: "#F5D0FE",
|
|
76
|
+
error: "#E11D48",
|
|
77
|
+
success: "#0D9488",
|
|
78
|
+
},
|
|
79
|
+
"aurora-dark": {
|
|
80
|
+
background: "#070A14",
|
|
81
|
+
primary: "#7C3AED",
|
|
82
|
+
secondary: "#22D3EE",
|
|
83
|
+
text: "#E5E7EB",
|
|
84
|
+
textSecondary: "#B8C3D6",
|
|
85
|
+
cardBackground: "#101726",
|
|
86
|
+
cardBorder: "#334155",
|
|
87
|
+
error: "#FB7185",
|
|
88
|
+
success: "#34D399",
|
|
89
|
+
},
|
|
90
|
+
"aurora-light": {
|
|
91
|
+
background: "#F8FAFC",
|
|
92
|
+
primary: "#6D28D9",
|
|
93
|
+
secondary: "#0891B2",
|
|
94
|
+
text: "#0F172A",
|
|
95
|
+
textSecondary: "#475569",
|
|
96
|
+
cardBackground: "#FFFFFF",
|
|
97
|
+
cardBorder: "#E2E8F0",
|
|
98
|
+
error: "#E11D48",
|
|
99
|
+
success: "#059669",
|
|
100
|
+
},
|
|
101
|
+
"nord-dark": {
|
|
102
|
+
background: "#2E3440",
|
|
103
|
+
primary: "#88C0D0",
|
|
104
|
+
secondary: "#81A1C1",
|
|
105
|
+
text: "#ECEFF4",
|
|
106
|
+
textSecondary: "#D8DEE9",
|
|
107
|
+
cardBackground: "#3B4252",
|
|
108
|
+
cardBorder: "#4C566A",
|
|
109
|
+
error: "#BF616A",
|
|
110
|
+
success: "#A3BE8C",
|
|
111
|
+
},
|
|
112
|
+
"nord-light": {
|
|
113
|
+
background: "#ECEFF4",
|
|
114
|
+
primary: "#5E81AC",
|
|
115
|
+
secondary: "#81A1C1",
|
|
116
|
+
text: "#2E3440",
|
|
117
|
+
textSecondary: "#4C566A",
|
|
118
|
+
cardBackground: "#FFFFFF",
|
|
119
|
+
cardBorder: "#D8DEE9",
|
|
120
|
+
error: "#BF616A",
|
|
121
|
+
success: "#5E81AC",
|
|
122
|
+
},
|
|
123
|
+
"sunset-dark": {
|
|
124
|
+
background: "#1A0F0C",
|
|
125
|
+
primary: "#FB923C",
|
|
126
|
+
secondary: "#F472B6",
|
|
127
|
+
text: "#FFE4D6",
|
|
128
|
+
textSecondary: "#FDBA74",
|
|
129
|
+
cardBackground: "#2A1611",
|
|
130
|
+
cardBorder: "#7C2D12",
|
|
131
|
+
error: "#FB7185",
|
|
132
|
+
success: "#4ADE80",
|
|
133
|
+
},
|
|
134
|
+
"sunset-light": {
|
|
135
|
+
background: "#FFF7ED",
|
|
136
|
+
primary: "#EA580C",
|
|
137
|
+
secondary: "#DB2777",
|
|
138
|
+
text: "#431407",
|
|
139
|
+
textSecondary: "#9A3412",
|
|
140
|
+
cardBackground: "#FFFFFF",
|
|
141
|
+
cardBorder: "#FED7AA",
|
|
142
|
+
error: "#E11D48",
|
|
143
|
+
success: "#16A34A",
|
|
144
|
+
},
|
|
145
|
+
"mono-dark": {
|
|
146
|
+
background: "#0B0F0C",
|
|
147
|
+
primary: "#A3E635",
|
|
148
|
+
secondary: "#65A30D",
|
|
149
|
+
text: "#ECFCCB",
|
|
150
|
+
textSecondary: "#BEF264",
|
|
151
|
+
cardBackground: "#141A16",
|
|
152
|
+
cardBorder: "#365314",
|
|
153
|
+
error: "#F87171",
|
|
154
|
+
success: "#84CC16",
|
|
155
|
+
},
|
|
156
|
+
"mono-light": {
|
|
157
|
+
background: "#F7FEE7",
|
|
158
|
+
primary: "#4D7C0F",
|
|
159
|
+
secondary: "#65A30D",
|
|
160
|
+
text: "#1A2E05",
|
|
161
|
+
textSecondary: "#3F6212",
|
|
162
|
+
cardBackground: "#FFFFFF",
|
|
163
|
+
cardBorder: "#D9F99D",
|
|
164
|
+
error: "#DC2626",
|
|
165
|
+
success: "#4D7C0F",
|
|
166
|
+
},
|
|
167
|
+
"oceanic-dark": {
|
|
168
|
+
background: "#06121A",
|
|
169
|
+
primary: "#0EA5E9",
|
|
170
|
+
secondary: "#22D3EE",
|
|
171
|
+
text: "#DDF6FF",
|
|
172
|
+
textSecondary: "#9CC5D8",
|
|
173
|
+
cardBackground: "#0C1C27",
|
|
174
|
+
cardBorder: "#1E3A4B",
|
|
175
|
+
error: "#F87171",
|
|
176
|
+
success: "#34D399",
|
|
177
|
+
},
|
|
178
|
+
"oceanic-light": {
|
|
179
|
+
background: "#F0F9FF",
|
|
180
|
+
primary: "#0284C7",
|
|
181
|
+
secondary: "#0891B2",
|
|
182
|
+
text: "#0C4A6E",
|
|
183
|
+
textSecondary: "#1D4E89",
|
|
184
|
+
cardBackground: "#FFFFFF",
|
|
185
|
+
cardBorder: "#BAE6FD",
|
|
186
|
+
error: "#DC2626",
|
|
187
|
+
success: "#0F766E",
|
|
188
|
+
},
|
|
189
|
+
"rose-dark": {
|
|
190
|
+
background: "#1B0B13",
|
|
191
|
+
primary: "#F43F5E",
|
|
192
|
+
secondary: "#FB7185",
|
|
193
|
+
text: "#FFE4EA",
|
|
194
|
+
textSecondary: "#F9A8D4",
|
|
195
|
+
cardBackground: "#28111C",
|
|
196
|
+
cardBorder: "#7A1F3D",
|
|
197
|
+
error: "#FB7185",
|
|
198
|
+
success: "#34D399",
|
|
199
|
+
},
|
|
200
|
+
"rose-light": {
|
|
201
|
+
background: "#FFF1F5",
|
|
202
|
+
primary: "#E11D48",
|
|
203
|
+
secondary: "#DB2777",
|
|
204
|
+
text: "#7A1733",
|
|
205
|
+
textSecondary: "#9D174D",
|
|
206
|
+
cardBackground: "#FFFFFF",
|
|
207
|
+
cardBorder: "#FBCFE8",
|
|
208
|
+
error: "#DC2626",
|
|
209
|
+
success: "#059669",
|
|
210
|
+
},
|
|
211
|
+
"forest-dark": {
|
|
212
|
+
background: "#0A140F",
|
|
213
|
+
primary: "#22C55E",
|
|
214
|
+
secondary: "#4ADE80",
|
|
215
|
+
text: "#DCFCE7",
|
|
216
|
+
textSecondary: "#86EFAC",
|
|
217
|
+
cardBackground: "#122017",
|
|
218
|
+
cardBorder: "#275A3F",
|
|
219
|
+
error: "#F87171",
|
|
220
|
+
success: "#22C55E",
|
|
221
|
+
},
|
|
222
|
+
"forest-light": {
|
|
223
|
+
background: "#F3FFF5",
|
|
224
|
+
primary: "#15803D",
|
|
225
|
+
secondary: "#16A34A",
|
|
226
|
+
text: "#14532D",
|
|
227
|
+
textSecondary: "#166534",
|
|
228
|
+
cardBackground: "#FFFFFF",
|
|
229
|
+
cardBorder: "#BBF7D0",
|
|
230
|
+
error: "#DC2626",
|
|
231
|
+
success: "#15803D",
|
|
232
|
+
},
|
|
233
|
+
"graphite-dark": {
|
|
234
|
+
background: "#0B0F14",
|
|
235
|
+
primary: "#60A5FA",
|
|
236
|
+
secondary: "#93C5FD",
|
|
237
|
+
text: "#E5E7EB",
|
|
238
|
+
textSecondary: "#9CA3AF",
|
|
239
|
+
cardBackground: "#141A22",
|
|
240
|
+
cardBorder: "#2A3442",
|
|
241
|
+
error: "#F87171",
|
|
242
|
+
success: "#34D399",
|
|
243
|
+
},
|
|
244
|
+
"graphite-light": {
|
|
245
|
+
background: "#F8FAFC",
|
|
246
|
+
primary: "#2563EB",
|
|
247
|
+
secondary: "#3B82F6",
|
|
248
|
+
text: "#0F172A",
|
|
249
|
+
textSecondary: "#475569",
|
|
250
|
+
cardBackground: "#FFFFFF",
|
|
251
|
+
cardBorder: "#CBD5E1",
|
|
252
|
+
error: "#DC2626",
|
|
253
|
+
success: "#059669",
|
|
254
|
+
},
|
|
255
|
+
"lava-dark": {
|
|
256
|
+
background: "#1A0D08",
|
|
257
|
+
primary: "#F97316",
|
|
258
|
+
secondary: "#FB923C",
|
|
259
|
+
text: "#FFE7D5",
|
|
260
|
+
textSecondary: "#FDBA74",
|
|
261
|
+
cardBackground: "#2B1610",
|
|
262
|
+
cardBorder: "#7C2D12",
|
|
263
|
+
error: "#FB7185",
|
|
264
|
+
success: "#4ADE80",
|
|
265
|
+
},
|
|
266
|
+
"lava-light": {
|
|
267
|
+
background: "#FFF7ED",
|
|
268
|
+
primary: "#EA580C",
|
|
269
|
+
secondary: "#F97316",
|
|
270
|
+
text: "#7C2D12",
|
|
271
|
+
textSecondary: "#9A3412",
|
|
272
|
+
cardBackground: "#FFFFFF",
|
|
273
|
+
cardBorder: "#FED7AA",
|
|
274
|
+
error: "#DC2626",
|
|
275
|
+
success: "#16A34A",
|
|
276
|
+
},
|
|
277
|
+
"skyline-dark": {
|
|
278
|
+
background: "#080E1E",
|
|
279
|
+
primary: "#3B82F6",
|
|
280
|
+
secondary: "#22D3EE",
|
|
281
|
+
text: "#E0E7FF",
|
|
282
|
+
textSecondary: "#93C5FD",
|
|
283
|
+
cardBackground: "#101A2F",
|
|
284
|
+
cardBorder: "#2B3A67",
|
|
285
|
+
error: "#F87171",
|
|
286
|
+
success: "#34D399",
|
|
287
|
+
},
|
|
288
|
+
"skyline-light": {
|
|
289
|
+
background: "#EFF6FF",
|
|
290
|
+
primary: "#2563EB",
|
|
291
|
+
secondary: "#0EA5E9",
|
|
292
|
+
text: "#1E3A8A",
|
|
293
|
+
textSecondary: "#1D4ED8",
|
|
294
|
+
cardBackground: "#FFFFFF",
|
|
295
|
+
cardBorder: "#BFDBFE",
|
|
296
|
+
error: "#DC2626",
|
|
297
|
+
success: "#059669",
|
|
298
|
+
},
|
|
299
|
+
"emerald-dark": {
|
|
300
|
+
background: "#07150F",
|
|
301
|
+
primary: "#10B981",
|
|
302
|
+
secondary: "#34D399",
|
|
303
|
+
text: "#D1FAE5",
|
|
304
|
+
textSecondary: "#6EE7B7",
|
|
305
|
+
cardBackground: "#10231A",
|
|
306
|
+
cardBorder: "#1F6A4C",
|
|
307
|
+
error: "#F87171",
|
|
308
|
+
success: "#10B981",
|
|
309
|
+
},
|
|
310
|
+
"emerald-light": {
|
|
311
|
+
background: "#ECFDF5",
|
|
312
|
+
primary: "#059669",
|
|
313
|
+
secondary: "#10B981",
|
|
314
|
+
text: "#064E3B",
|
|
315
|
+
textSecondary: "#065F46",
|
|
316
|
+
cardBackground: "#FFFFFF",
|
|
317
|
+
cardBorder: "#A7F3D0",
|
|
318
|
+
error: "#DC2626",
|
|
319
|
+
success: "#059669",
|
|
320
|
+
},
|
|
321
|
+
"violet-dark": {
|
|
322
|
+
background: "#12081F",
|
|
323
|
+
primary: "#8B5CF6",
|
|
324
|
+
secondary: "#A78BFA",
|
|
325
|
+
text: "#EDE9FE",
|
|
326
|
+
textSecondary: "#C4B5FD",
|
|
327
|
+
cardBackground: "#1E1033",
|
|
328
|
+
cardBorder: "#4C1D95",
|
|
329
|
+
error: "#FB7185",
|
|
330
|
+
success: "#34D399",
|
|
331
|
+
},
|
|
332
|
+
"violet-light": {
|
|
333
|
+
background: "#F5F3FF",
|
|
334
|
+
primary: "#7C3AED",
|
|
335
|
+
secondary: "#8B5CF6",
|
|
336
|
+
text: "#4C1D95",
|
|
337
|
+
textSecondary: "#5B21B6",
|
|
338
|
+
cardBackground: "#FFFFFF",
|
|
339
|
+
cardBorder: "#DDD6FE",
|
|
340
|
+
error: "#DC2626",
|
|
341
|
+
success: "#059669",
|
|
342
|
+
},
|
|
343
|
+
"amber-dark": {
|
|
344
|
+
background: "#1A1306",
|
|
345
|
+
primary: "#F59E0B",
|
|
346
|
+
secondary: "#FBBF24",
|
|
347
|
+
text: "#FEF3C7",
|
|
348
|
+
textSecondary: "#FCD34D",
|
|
349
|
+
cardBackground: "#2A1E0D",
|
|
350
|
+
cardBorder: "#7C5B13",
|
|
351
|
+
error: "#FB7185",
|
|
352
|
+
success: "#4ADE80",
|
|
353
|
+
},
|
|
354
|
+
"amber-light": {
|
|
355
|
+
background: "#FFFBEB",
|
|
356
|
+
primary: "#D97706",
|
|
357
|
+
secondary: "#F59E0B",
|
|
358
|
+
text: "#78350F",
|
|
359
|
+
textSecondary: "#92400E",
|
|
360
|
+
cardBackground: "#FFFFFF",
|
|
361
|
+
cardBorder: "#FDE68A",
|
|
362
|
+
error: "#DC2626",
|
|
363
|
+
success: "#16A34A",
|
|
364
|
+
},
|
|
365
|
+
"slate-dark": {
|
|
366
|
+
background: "#0B1120",
|
|
367
|
+
primary: "#64748B",
|
|
368
|
+
secondary: "#94A3B8",
|
|
369
|
+
text: "#E2E8F0",
|
|
370
|
+
textSecondary: "#CBD5E1",
|
|
371
|
+
cardBackground: "#111827",
|
|
372
|
+
cardBorder: "#334155",
|
|
373
|
+
error: "#F87171",
|
|
374
|
+
success: "#34D399",
|
|
375
|
+
},
|
|
376
|
+
"slate-light": {
|
|
377
|
+
background: "#F8FAFC",
|
|
378
|
+
primary: "#475569",
|
|
379
|
+
secondary: "#64748B",
|
|
380
|
+
text: "#1E293B",
|
|
381
|
+
textSecondary: "#334155",
|
|
382
|
+
cardBackground: "#FFFFFF",
|
|
383
|
+
cardBorder: "#CBD5E1",
|
|
384
|
+
error: "#DC2626",
|
|
385
|
+
success: "#16A34A",
|
|
386
|
+
},
|
|
387
|
+
};
|
package/data/urls.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Official layout URLs for git-page-docs repository */
|
|
2
|
+
|
|
3
|
+
export const OFFICIAL_LAYOUTS_CONFIG_URL =
|
|
4
|
+
"https://github.com/Vidigal-code/git-page-docs/blob/main/gitpagedocs/layouts/layoutsConfig.json";
|
|
5
|
+
|
|
6
|
+
export const OFFICIAL_LAYOUTS_TEMPLATES_URL =
|
|
7
|
+
"https://github.com/Vidigal-code/git-page-docs/blob/main/gitpagedocs/layouts/templates";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type CliMode = "home" | "full" | "config-only" | "ai";
|
|
2
|
+
|
|
3
|
+
export interface CliOptions {
|
|
4
|
+
isBuild: boolean;
|
|
5
|
+
isServe: boolean;
|
|
6
|
+
mode: CliMode;
|
|
7
|
+
aiCommand?: string;
|
|
8
|
+
outputDir: string;
|
|
9
|
+
useLocalLayoutConfig: boolean;
|
|
10
|
+
shouldPush: boolean;
|
|
11
|
+
githubOwner: string;
|
|
12
|
+
githubRepo: string;
|
|
13
|
+
docsPath: string;
|
|
14
|
+
basePath: string;
|
|
15
|
+
repositorySearch?: boolean;
|
|
16
|
+
isInteractive: boolean;
|
|
17
|
+
hasArgs: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Write .env, Dockerfile, README to home output directory */
|
|
2
|
+
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { mkdir } from "node:fs/promises";
|
|
5
|
+
import { writeFile } from "node:fs/promises";
|
|
6
|
+
import { getEnvTemplate, getDockerfileTemplate, getReadmeTemplate } from "./templates.mjs";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {string} root
|
|
10
|
+
* @param {string} outputDir - e.g. gitpagedocshome or .
|
|
11
|
+
* @param {{ repositorySearch?: boolean; basePath?: string }} opts
|
|
12
|
+
*/
|
|
13
|
+
export async function writeHomeFiles(root, outputDir, opts = {}) {
|
|
14
|
+
const basePath = outputDir === "." || outputDir === "./" ? root : path.join(root, outputDir);
|
|
15
|
+
await mkdir(basePath, { recursive: true });
|
|
16
|
+
|
|
17
|
+
await writeFile(path.join(basePath, ".env"), getEnvTemplate(opts), "utf-8");
|
|
18
|
+
await writeFile(path.join(basePath, "Dockerfile"), getDockerfileTemplate(), "utf-8");
|
|
19
|
+
await writeFile(path.join(basePath, "README.md"), getReadmeTemplate({ outputDir }), "utf-8");
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Template content for home distribution files */
|
|
2
|
+
|
|
3
|
+
export function getEnvTemplate({ repositorySearch = false, basePath = "" }) {
|
|
4
|
+
const pathLine = basePath
|
|
5
|
+
? `GITPAGEDOCS_PATH=${basePath}`
|
|
6
|
+
: `# GITPAGEDOCS_PATH=gi-page-docs`;
|
|
7
|
+
return `# GitPageDocs - Local development
|
|
8
|
+
# Set to "true" to enable the search aggregator home.
|
|
9
|
+
GITPAGEDOCS_REPOSITORY_SEARCH=${String(repositorySearch)}
|
|
10
|
+
|
|
11
|
+
# Base path (when GITPAGEDOCS_REPOSITORY_SEARCH=false).
|
|
12
|
+
# Example: localhost:3000/gi-page-docs
|
|
13
|
+
${pathLine}
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getDockerfileTemplate() {
|
|
18
|
+
return `FROM nginx:alpine
|
|
19
|
+
COPY . /usr/share/nginx/html
|
|
20
|
+
EXPOSE 80
|
|
21
|
+
CMD ["nginx", "-g", "daemon off;"]
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getReadmeTemplate({ outputDir = "gitpagedocshome" }) {
|
|
26
|
+
const cdDir = outputDir === "." || outputDir === "./" ? "." : outputDir;
|
|
27
|
+
return `# GitPageDocs Home
|
|
28
|
+
|
|
29
|
+
Pre-built GitPageDocs static site by Vidigal-code.
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
\`\`\`bash
|
|
34
|
+
npx serve .
|
|
35
|
+
\`\`\`
|
|
36
|
+
|
|
37
|
+
## Docker
|
|
38
|
+
|
|
39
|
+
\`\`\`bash
|
|
40
|
+
docker build -t gitpagedocshome .
|
|
41
|
+
docker run -p 3000:80 gitpagedocshome
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
## Credits
|
|
45
|
+
|
|
46
|
+
Powered by Vidigal-code - https://github.com/Vidigal-code/git-page-docs
|
|
47
|
+
`;
|
|
48
|
+
}
|
package/index.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
|
|
7
|
+
const scriptPath = fileURLToPath(import.meta.url);
|
|
8
|
+
const scriptDir = path.dirname(scriptPath);
|
|
9
|
+
const tsEntry = path.join(scriptDir, "presentation", "index.ts");
|
|
10
|
+
|
|
11
|
+
const result = spawnSync(
|
|
12
|
+
process.execPath,
|
|
13
|
+
["--import", "tsx", tsEntry, ...process.argv.slice(2)],
|
|
14
|
+
{
|
|
15
|
+
stdio: "inherit",
|
|
16
|
+
cwd: process.cwd(),
|
|
17
|
+
env: process.env,
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
if (result.error) {
|
|
22
|
+
console.error("[gitpagedocs] Failed to run TypeScript CLI runtime.", result.error);
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
} else if (typeof result.status === "number" && result.status !== 0) {
|
|
25
|
+
process.exitCode = result.status;
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { getCurrentGitBranch, runGitPushForGeneratedArtifacts } from "../../runtime/git-ops.mjs";
|
|
3
|
+
import { writeConfigOnlyOutput, writeText } from "../../runtime/output.mjs";
|
|
4
|
+
import { ensureGitHubPagesWorkflow } from "../../runtime/workflow.mjs";
|
|
5
|
+
import { logInfo } from "../../ui/logger.mjs";
|
|
6
|
+
|
|
7
|
+
export function createConfigOnlyRuntime() {
|
|
8
|
+
return {
|
|
9
|
+
hasPath: existsSync,
|
|
10
|
+
writeConfigOnlyOutput,
|
|
11
|
+
writeText,
|
|
12
|
+
ensureGitHubPagesWorkflow,
|
|
13
|
+
getCurrentGitBranch,
|
|
14
|
+
runGitPushForGeneratedArtifacts,
|
|
15
|
+
logInfo,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { cpSync, existsSync, readdirSync, rmSync } from "node:fs";
|
|
3
|
+
import { execSync } from "node:child_process";
|
|
4
|
+
import { writeConfigOnlyOutput, writeText } from "../../runtime/output.mjs";
|
|
5
|
+
import { writeHomeFiles } from "../../home/home-file-writer.mjs";
|
|
6
|
+
import { logInfo, logSuccess } from "../../ui/logger.mjs";
|
|
7
|
+
|
|
8
|
+
function ensureDirEmpty(root, relativeDir) {
|
|
9
|
+
const target = path.join(root, relativeDir);
|
|
10
|
+
if (existsSync(target)) {
|
|
11
|
+
rmSync(target, { recursive: true, force: true });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function copyRecursive(src, dest) {
|
|
16
|
+
cpSync(src, dest, { recursive: true, force: true });
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function runNextBuild(root, env) {
|
|
20
|
+
execSync("npx next build frontend", { cwd: root, env, stdio: "inherit" });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function createHomeRuntime() {
|
|
24
|
+
return {
|
|
25
|
+
joinPath: (...parts) => path.join(...parts),
|
|
26
|
+
ensureDirEmpty,
|
|
27
|
+
copyRecursive,
|
|
28
|
+
readDirNames: (absolutePath) => readdirSync(absolutePath),
|
|
29
|
+
existsPath: existsSync,
|
|
30
|
+
runNextBuild,
|
|
31
|
+
writeConfigOnlyOutput,
|
|
32
|
+
writeHomeFiles,
|
|
33
|
+
writeText,
|
|
34
|
+
logSuccess,
|
|
35
|
+
logInfo,
|
|
36
|
+
};
|
|
37
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gitpagedocs/cli",
|
|
3
|
+
"version": "1.1.44",
|
|
4
|
+
"description": "CLI that scaffolds and maintains gitpagedocs documentation, generates docs with AI, configures GitHub Pages, and runs the MCP server.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"gitpagedocs": "index.mjs"
|
|
7
|
+
},
|
|
8
|
+
"main": "index.mjs",
|
|
9
|
+
"files": [
|
|
10
|
+
"index.mjs",
|
|
11
|
+
"start.mjs",
|
|
12
|
+
"ai",
|
|
13
|
+
"application",
|
|
14
|
+
"builders",
|
|
15
|
+
"content",
|
|
16
|
+
"contracts",
|
|
17
|
+
"data",
|
|
18
|
+
"domain",
|
|
19
|
+
"home",
|
|
20
|
+
"infrastructure",
|
|
21
|
+
"presentation",
|
|
22
|
+
"runtime",
|
|
23
|
+
"ui",
|
|
24
|
+
"prebuilt",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=20"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@clack/prompts": "^1.5.1",
|
|
32
|
+
"@gitpagedocs/mcp": "workspace:*",
|
|
33
|
+
"@gitpagedocs/tools": "workspace:*",
|
|
34
|
+
"tsx": "^4.21.0"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/Vidigal-code/git-page-docs.git",
|
|
39
|
+
"directory": "cli"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"gitpagedocs",
|
|
43
|
+
"documentation",
|
|
44
|
+
"markdown",
|
|
45
|
+
"spa",
|
|
46
|
+
"cli",
|
|
47
|
+
"github-pages",
|
|
48
|
+
"create-gitpagedocs"
|
|
49
|
+
],
|
|
50
|
+
"author": "Vidigal-code",
|
|
51
|
+
"license": "ISC",
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/Vidigal-code/git-page-docs/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://vidigal-code.github.io/git-page-docs/",
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"registry": "https://registry.npmjs.org/",
|
|
58
|
+
"access": "public"
|
|
59
|
+
}
|
|
60
|
+
}
|