@gitpagedocs/cli 1.1.54 → 1.1.56
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 +43 -31
- package/ai/application/run-ai-cli-command.ts +16 -5
- package/ai/core/models/parse-ai-cli-config.ts +78 -0
- package/ai/infrastructure/ai-config-file.ts +77 -8
- package/ai/infrastructure/file-system-adapter.ts +5 -3
- package/ai/presentation/ai-prompts.ts +1 -1
- package/application/report/config-only-reporter.mjs +63 -62
- package/builders/config-orchestrator.mjs +34 -40
- package/builders/project-links.mjs +26 -0
- package/builders/root-config-builder.mjs +7 -9
- package/builders/route-builders.mjs +136 -111
- package/builders/theme-template.mjs +76 -75
- package/builders/version-config-builder.mjs +186 -151
- package/content/docs-en.mjs +20 -17
- package/content/docs-es.mjs +14 -13
- package/content/docs-pt.mjs +14 -13
- package/contracts/doc-versions.mjs +3 -1
- package/contracts/index.mjs +0 -0
- package/data/i18n-langmenu.mjs +36 -0
- package/data/path-mappings.mjs +26 -34
- package/data/route-metas.mjs +93 -73
- package/data/urls.mjs +12 -7
- package/package.json +60 -60
- package/presentation/commands/config-clear.ts +23 -0
- package/presentation/commands/diagnostics.ts +1 -1
- package/presentation/commands/run-command.ts +6 -0
- package/presentation/index.ts +1 -1
- package/runtime/output.mjs +25 -1
- package/runtime/workflow.mjs +28 -45
- package/start.mjs +1 -1
- package/ui/logger.mjs +9 -9
- package/builders/source-viewer.mjs +0 -330
package/data/i18n-langmenu.mjs
CHANGED
|
@@ -17,9 +17,21 @@ export const defaultLangMenu = {
|
|
|
17
17
|
focusMode: "Modo foco",
|
|
18
18
|
versionLinksLabel: "Links do repositorio",
|
|
19
19
|
titleHeaderMenuMd: "Markdown",
|
|
20
|
+
titleHeaderMenuSourceViewer: "Codigo fonte",
|
|
20
21
|
titleHeaderMenuVideo: "Vídeo",
|
|
21
22
|
titleHeaderMenuAudio: "Áudio",
|
|
22
23
|
titleHeaderMenuHtml: "Páginas",
|
|
24
|
+
sourceViewerBranchLabel: "Branch",
|
|
25
|
+
sourceViewerFilterLabel: "Filtrar arquivos",
|
|
26
|
+
sourceViewerClearLabel: "Limpar",
|
|
27
|
+
sourceViewerLoadingTree: "Carregando arvore do repositorio...",
|
|
28
|
+
sourceViewerLoadingFile: "Carregando arquivo...",
|
|
29
|
+
sourceViewerNotFound: "Repositorio, branch ou arvore de codigo nao encontrado.",
|
|
30
|
+
sourceViewerFileError: "Nao foi possivel carregar o arquivo.",
|
|
31
|
+
sourceViewerEmpty: "Nenhuma entrada encontrada.",
|
|
32
|
+
sourceViewerSelectFile: "Selecione um arquivo",
|
|
33
|
+
sourceViewerPreview: "Preview",
|
|
34
|
+
sourceViewerCode: "Codigo",
|
|
23
35
|
lastUpdateVersionLabel: "Ultima versao de atualizacao",
|
|
24
36
|
darkMode: "Modo escuro",
|
|
25
37
|
lightMode: "Modo claro",
|
|
@@ -118,9 +130,21 @@ export const defaultLangMenu = {
|
|
|
118
130
|
focusMode: "Focus mode",
|
|
119
131
|
versionLinksLabel: "Repository links",
|
|
120
132
|
titleHeaderMenuMd: "Markdown",
|
|
133
|
+
titleHeaderMenuSourceViewer: "Source code",
|
|
121
134
|
titleHeaderMenuVideo: "Video",
|
|
122
135
|
titleHeaderMenuAudio: "Audio",
|
|
123
136
|
titleHeaderMenuHtml: "Pages",
|
|
137
|
+
sourceViewerBranchLabel: "Branch",
|
|
138
|
+
sourceViewerFilterLabel: "Filter files",
|
|
139
|
+
sourceViewerClearLabel: "Clear",
|
|
140
|
+
sourceViewerLoadingTree: "Loading source tree...",
|
|
141
|
+
sourceViewerLoadingFile: "Loading file...",
|
|
142
|
+
sourceViewerNotFound: "Repository, branch, or source tree was not found.",
|
|
143
|
+
sourceViewerFileError: "File could not be loaded.",
|
|
144
|
+
sourceViewerEmpty: "No entries found.",
|
|
145
|
+
sourceViewerSelectFile: "Select a file",
|
|
146
|
+
sourceViewerPreview: "Preview",
|
|
147
|
+
sourceViewerCode: "Code",
|
|
124
148
|
lastUpdateVersionLabel: "Last update version",
|
|
125
149
|
darkMode: "Dark mode",
|
|
126
150
|
lightMode: "Light mode",
|
|
@@ -219,9 +243,21 @@ export const defaultLangMenu = {
|
|
|
219
243
|
focusMode: "Modo foco",
|
|
220
244
|
versionLinksLabel: "Enlaces del repositorio",
|
|
221
245
|
titleHeaderMenuMd: "Markdown",
|
|
246
|
+
titleHeaderMenuSourceViewer: "Codigo fuente",
|
|
222
247
|
titleHeaderMenuVideo: "Vídeo",
|
|
223
248
|
titleHeaderMenuAudio: "Áudio",
|
|
224
249
|
titleHeaderMenuHtml: "Páginas",
|
|
250
|
+
sourceViewerBranchLabel: "Branch",
|
|
251
|
+
sourceViewerFilterLabel: "Filtrar archivos",
|
|
252
|
+
sourceViewerClearLabel: "Limpiar",
|
|
253
|
+
sourceViewerLoadingTree: "Cargando arbol del repositorio...",
|
|
254
|
+
sourceViewerLoadingFile: "Cargando archivo...",
|
|
255
|
+
sourceViewerNotFound: "Repositorio, branch o arbol de codigo no encontrado.",
|
|
256
|
+
sourceViewerFileError: "No se pudo cargar el archivo.",
|
|
257
|
+
sourceViewerEmpty: "No se encontraron entradas.",
|
|
258
|
+
sourceViewerSelectFile: "Selecciona un archivo",
|
|
259
|
+
sourceViewerPreview: "Preview",
|
|
260
|
+
sourceViewerCode: "Codigo",
|
|
225
261
|
lastUpdateVersionLabel: "Ultima version de actualizacion",
|
|
226
262
|
darkMode: "Modo oscuro",
|
|
227
263
|
lightMode: "Modo claro",
|
package/data/path-mappings.mjs
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
/** Path and media mappings for doc versions */
|
|
2
|
-
|
|
3
|
-
export const ROUTE_PATHS = {
|
|
4
|
-
1: { pt: "getting-started.md", en: "getting-started.md", es: "getting-started.md" },
|
|
5
|
-
2: { pt: "project-overview.md", en: "project-overview.md", es: "project-overview.md" },
|
|
6
|
-
3: { pt: "functionalities.md", en: "functionalities.md", es: "functionalities.md" },
|
|
7
|
-
4: { pt: "github-issues-projects.md", en: "github-issues-projects.md", es: "github-issues-projects.md" },
|
|
8
|
-
5: { pt: "git-introduction.md", en: "git-introduction.md", es: "git-introduction.md" },
|
|
9
|
-
6: { pt: "authorized-routes.md", en: "authorized-routes.md", es: "authorized-routes.md" },
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const VIDEO_IDS = ["bdIJkGr2NV0", "c67GaAkf1BE", "N3my6W_Rdwg", "r8jQ9hVA2qs"];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export const SOURCE_VIEWER_META = {
|
|
28
|
-
titles: { pt: "Código fonte", en: "Source code", es: "Código fuente" },
|
|
29
|
-
descriptions: {
|
|
30
|
-
pt: "Visualizar código-fonte do projeto",
|
|
31
|
-
en: "View project source code",
|
|
32
|
-
es: "Ver código fuente del proyecto",
|
|
33
|
-
},
|
|
34
|
-
};
|
|
1
|
+
/** Path and media mappings for doc versions */
|
|
2
|
+
|
|
3
|
+
export const ROUTE_PATHS = {
|
|
4
|
+
1: { pt: "getting-started.md", en: "getting-started.md", es: "getting-started.md" },
|
|
5
|
+
2: { pt: "project-overview.md", en: "project-overview.md", es: "project-overview.md" },
|
|
6
|
+
3: { pt: "functionalities.md", en: "functionalities.md", es: "functionalities.md" },
|
|
7
|
+
4: { pt: "github-issues-projects.md", en: "github-issues-projects.md", es: "github-issues-projects.md" },
|
|
8
|
+
5: { pt: "git-introduction.md", en: "git-introduction.md", es: "git-introduction.md" },
|
|
9
|
+
6: { pt: "authorized-routes.md", en: "authorized-routes.md", es: "authorized-routes.md" },
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const VIDEO_IDS = ["bdIJkGr2NV0", "c67GaAkf1BE", "N3my6W_Rdwg", "r8jQ9hVA2qs"];
|
|
13
|
+
export const AUDIO_IDS = ["0w80F8FffQ4"];
|
|
14
|
+
|
|
15
|
+
export const PAGE2_AUDIO = {
|
|
16
|
+
enabled: true,
|
|
17
|
+
autoPlayOnLoad: true,
|
|
18
|
+
loopEnabled: false,
|
|
19
|
+
tracks: [
|
|
20
|
+
{
|
|
21
|
+
url: "https://www.youtube.com/watch?v=0w80F8FffQ4",
|
|
22
|
+
type: "youtube",
|
|
23
|
+
title: { pt: "Musica pagina 2", en: "Page 2 music", es: "Musica pagina 2" },
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
package/data/route-metas.mjs
CHANGED
|
@@ -1,73 +1,93 @@
|
|
|
1
|
-
/** Route and video metadata for doc versions */
|
|
2
|
-
|
|
3
|
-
export const DEFAULT_HIERARCHY = { md: 0,
|
|
4
|
-
|
|
5
|
-
export const ROUTE_META_ID1 = {
|
|
6
|
-
titles: { pt: "Primeiros passos", en: "Getting Started", es: "Primeros pasos" },
|
|
7
|
-
descriptions: { pt: "Configure o repositório do zero", en: "Configure repository from zero", es: "Configura el repositorio desde cero" },
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const ROUTE_META_ID2 = {
|
|
11
|
-
titles: { pt: "Visão geral do projeto", en: "Project overview", es: "Visión general del proyecto" },
|
|
12
|
-
descriptions: { pt: "Stack, objetivo e estrutura do Git Page Docs", en: "Stack, goals and structure of Git Page Docs", es: "Stack, objetivos y estructura de Git Page Docs" },
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const ROUTE_META_ID3 = {
|
|
16
|
-
titles: { pt: "Funcionalidades", en: "Functionalities", es: "Funcionalidades" },
|
|
17
|
-
descriptions: { pt: "CLI, opções, configuração e recursos", en: "CLI, options, configuration and features", es: "CLI, opciones, configuración y funciones" },
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const ROUTE_META_ID4 = {
|
|
21
|
-
titles: { pt: "GitHub Issues e Projects", en: "GitHub issues and projects", es: "GitHub issues y projects" },
|
|
22
|
-
descriptions: { pt: "Como usar Issues e Projects no GitHub", en: "How to use GitHub Issues and Projects", es: "Cómo usar GitHub Issues y Projects" },
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const ROUTE_META_ID5 = {
|
|
26
|
-
titles: { pt: "Introdução ao Git", en: "Introduction to Git", es: "Introducción a Git" },
|
|
27
|
-
descriptions: { pt: "Conceitos básicos de Git para iniciantes", en: "Basic Git concepts for beginners", es: "Conceptos básicos de Git para principiantes" },
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const ROUTE_META_ID6 = {
|
|
31
|
-
titles: { pt: "Rotas autorizadas", en: "Authorized routes", es: "Rutas autorizadas" },
|
|
32
|
-
descriptions: {
|
|
33
|
-
pt: "Controle acesso por chave, roles e provedores externos",
|
|
34
|
-
en: "Control access by key, roles and external providers",
|
|
35
|
-
es: "Controla acceso por clave, roles y proveedores externos",
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const
|
|
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
|
-
|
|
1
|
+
/** Route and video metadata for doc versions */
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_HIERARCHY = { md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 };
|
|
4
|
+
|
|
5
|
+
export const ROUTE_META_ID1 = {
|
|
6
|
+
titles: { pt: "Primeiros passos", en: "Getting Started", es: "Primeros pasos" },
|
|
7
|
+
descriptions: { pt: "Configure o repositório do zero", en: "Configure repository from zero", es: "Configura el repositorio desde cero" },
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const ROUTE_META_ID2 = {
|
|
11
|
+
titles: { pt: "Visão geral do projeto", en: "Project overview", es: "Visión general del proyecto" },
|
|
12
|
+
descriptions: { pt: "Stack, objetivo e estrutura do Git Page Docs", en: "Stack, goals and structure of Git Page Docs", es: "Stack, objetivos y estructura de Git Page Docs" },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const ROUTE_META_ID3 = {
|
|
16
|
+
titles: { pt: "Funcionalidades", en: "Functionalities", es: "Funcionalidades" },
|
|
17
|
+
descriptions: { pt: "CLI, opções, configuração e recursos", en: "CLI, options, configuration and features", es: "CLI, opciones, configuración y funciones" },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const ROUTE_META_ID4 = {
|
|
21
|
+
titles: { pt: "GitHub Issues e Projects", en: "GitHub issues and projects", es: "GitHub issues y projects" },
|
|
22
|
+
descriptions: { pt: "Como usar Issues e Projects no GitHub", en: "How to use GitHub Issues and Projects", es: "Cómo usar GitHub Issues y Projects" },
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const ROUTE_META_ID5 = {
|
|
26
|
+
titles: { pt: "Introdução ao Git", en: "Introduction to Git", es: "Introducción a Git" },
|
|
27
|
+
descriptions: { pt: "Conceitos básicos de Git para iniciantes", en: "Basic Git concepts for beginners", es: "Conceptos básicos de Git para principiantes" },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const ROUTE_META_ID6 = {
|
|
31
|
+
titles: { pt: "Rotas autorizadas", en: "Authorized routes", es: "Rutas autorizadas" },
|
|
32
|
+
descriptions: {
|
|
33
|
+
pt: "Controle acesso por chave, roles e provedores externos",
|
|
34
|
+
en: "Control access by key, roles and external providers",
|
|
35
|
+
es: "Controla acceso por clave, roles y proveedores externos",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const SOURCE_VIEWER_META = {
|
|
40
|
+
id: 7,
|
|
41
|
+
titles: { pt: "Codigo fonte", en: "Source code", es: "Codigo fuente" },
|
|
42
|
+
descriptions: {
|
|
43
|
+
pt: "Explore a arvore do repositorio, navegue por pastas e visualize arquivos diretamente na documentacao.",
|
|
44
|
+
en: "Explore the repository tree, browse folders, and preview files directly inside the documentation.",
|
|
45
|
+
es: "Explora el arbol del repositorio, navega por carpetas y previsualiza archivos directamente en la documentacion.",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const AUDIO_META_ID12 = {
|
|
50
|
+
id: 12,
|
|
51
|
+
title: { pt: "Trilha de audio", en: "Audio track", es: "Pista de audio" },
|
|
52
|
+
description: {
|
|
53
|
+
pt: "Ouça uma faixa de exemplo diretamente na documentacao.",
|
|
54
|
+
en: "Listen to a sample track directly inside the documentation.",
|
|
55
|
+
es: "Escucha una pista de ejemplo directamente en la documentacion.",
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const VIDEO_META_ID1 = {
|
|
60
|
+
title: { pt: "Interactive vs non-interactive modes | Copilot CLI for beginners", en: "Interactive vs non-interactive modes | Copilot CLI for beginners", es: "Interactive vs non-interactive modes | Copilot CLI for beginners" },
|
|
61
|
+
description: {
|
|
62
|
+
pt: "Quer saber a forma mais rápida de usar o GitHub Copilot no terminal? Neste tutorial, exploramos os dois modos principais do Copilot CLI.",
|
|
63
|
+
en: "Want to know the fastest way to prompt GitHub Copilot from your terminal? In this beginner tutorial, we explore the two main modes of the Copilot CLI. Discover how to use the interactive mode to have GitHub Copilot run your project locally or use the non-interactive mode with the -p flag for quick summaries without leaving your shell context.",
|
|
64
|
+
es: "¿Quieres conocer la forma más rápida de usar GitHub Copilot desde tu terminal? En este tutorial exploramos los dos modos principales del Copilot CLI.",
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const VIDEO_META_ID2 = {
|
|
69
|
+
title: { pt: "How to use GitHub issues and projects | GitHub for Beginners", en: "How to use GitHub issues and projects | GitHub for Beginners", es: "How to use GitHub issues and projects | GitHub for Beginners" },
|
|
70
|
+
description: {
|
|
71
|
+
pt: "Aprenda a usar GitHub Issues e Projects para gerenciar seu trabalho.",
|
|
72
|
+
en: "Learn how to use GitHub Issues and Projects to manage your work effectively.",
|
|
73
|
+
es: "Aprende a usar GitHub Issues y Projects para gestionar tu trabajo.",
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const VIDEO_META_ID3 = {
|
|
78
|
+
title: { pt: "How I built an AI Python tutor with the GitHub Copilot SDK", en: "How I built an AI Python tutor with the GitHub Copilot SDK", es: "How I built an AI Python tutor with the GitHub Copilot SDK" },
|
|
79
|
+
description: {
|
|
80
|
+
pt: "Construindo um tutor de Python com IA usando o GitHub Copilot SDK.",
|
|
81
|
+
en: "Building an AI Python tutor using the GitHub Copilot SDK.",
|
|
82
|
+
es: "Construyendo un tutor de Python con IA usando el GitHub Copilot SDK.",
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const VIDEO_META_ID4 = {
|
|
87
|
+
title: { pt: "A brief introduction to Git for beginners | GitHub", en: "A brief introduction to Git for beginners | GitHub", es: "A brief introduction to Git for beginners | GitHub" },
|
|
88
|
+
description: {
|
|
89
|
+
pt: "Introdução ao Git para iniciantes.",
|
|
90
|
+
en: "A brief introduction to Git for beginners.",
|
|
91
|
+
es: "Una breve introducción a Git para principiantes.",
|
|
92
|
+
},
|
|
93
|
+
};
|
package/data/urls.mjs
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
/** Official layout URLs for git-page-docs repository
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/** Official layout URLs for git-page-docs repository.
|
|
2
|
+
* The canonical home is the root `gitpagelayouts/` folder; the legacy
|
|
3
|
+
* `gitpagedocs/layouts/` folder stays online for older deployments. */
|
|
4
|
+
|
|
5
|
+
export const OFFICIAL_LAYOUTS_CONFIG_URL =
|
|
6
|
+
"https://github.com/Vidigal-code/git-page-docs/blob/main/gitpagelayouts/layoutsConfig.json";
|
|
7
|
+
|
|
8
|
+
export const OFFICIAL_LAYOUTS_TEMPLATES_URL =
|
|
9
|
+
"https://github.com/Vidigal-code/git-page-docs/blob/main/gitpagelayouts/templates";
|
|
10
|
+
|
|
11
|
+
export const LEGACY_OFFICIAL_LAYOUTS_CONFIG_URL =
|
|
12
|
+
"https://github.com/Vidigal-code/git-page-docs/blob/main/gitpagedocs/layouts/layoutsConfig.json";
|
package/package.json
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@gitpagedocs/cli",
|
|
3
|
-
"version": "1.1.
|
|
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": "^1.1.
|
|
33
|
-
"@gitpagedocs/tools": "^1.1.
|
|
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
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@gitpagedocs/cli",
|
|
3
|
+
"version": "1.1.56",
|
|
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": "^1.1.56",
|
|
33
|
+
"@gitpagedocs/tools": "^1.1.56",
|
|
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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AiConfigFileRepository } from "../../ai/infrastructure/ai-config-file";
|
|
2
|
+
import type { CommandContext } from "./run-command";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `gitpagedocs config clear` — delete the stored `.gitpagedocsconfig` from the
|
|
6
|
+
* per-user config directory and any legacy repo-root copy, wiping the saved AI
|
|
7
|
+
* credentials (API key, provider, scan paths).
|
|
8
|
+
*/
|
|
9
|
+
export async function runConfigClear(ctx: CommandContext): Promise<void> {
|
|
10
|
+
const repository = new AiConfigFileRepository({ cwd: ctx.cwd });
|
|
11
|
+
const removed = await repository.clear();
|
|
12
|
+
|
|
13
|
+
if (!removed.length) {
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
15
|
+
console.log("\n No stored .gitpagedocsconfig found - nothing to clear.\n");
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
console.log(
|
|
21
|
+
["", " Stored AI configuration removed (credentials wiped):", ...removed.map((p) => ` - ${p}`), ""].join("\n"),
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -50,7 +50,7 @@ export async function runDoctor(ctx: CommandContext): Promise<void> {
|
|
|
50
50
|
console.log("\n gitpagedocs doctor\n");
|
|
51
51
|
for (const c of checks) {
|
|
52
52
|
// eslint-disable-next-line no-console
|
|
53
|
-
console.log(` ${c.ok ? "
|
|
53
|
+
console.log(` ${c.ok ? "[ok]" : "[x] "} ${c.label.padEnd(22)} ${c.detail}`);
|
|
54
54
|
}
|
|
55
55
|
const failed = checks.filter((c) => !c.ok && c.label !== "gh (GitHub CLI)").length;
|
|
56
56
|
// eslint-disable-next-line no-console
|
|
@@ -18,6 +18,7 @@ export type CommandHandler = (ctx: CommandContext) => Promise<void>;
|
|
|
18
18
|
import { runVersion, runDoctor, runUpdate } from "./diagnostics";
|
|
19
19
|
import { runProvider, runModels } from "./ai-info";
|
|
20
20
|
import { runConfig } from "./config-info";
|
|
21
|
+
import { runConfigClear } from "./config-clear";
|
|
21
22
|
import { runMcp } from "./mcp";
|
|
22
23
|
import { runDocs } from "./docs";
|
|
23
24
|
import { runPagesActions, runPagesDeploy } from "./pages";
|
|
@@ -54,6 +55,11 @@ export async function runNewCommand(argv: string[], pkgRoot: string): Promise<bo
|
|
|
54
55
|
await runPagesDeploy(ctx);
|
|
55
56
|
return true;
|
|
56
57
|
}
|
|
58
|
+
// Wipe the stored AI credentials config: `config clear`.
|
|
59
|
+
if (args[0] === "config" && args[1] === "clear") {
|
|
60
|
+
await runConfigClear(ctx);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
57
63
|
|
|
58
64
|
const handler = REGISTRY[args[0] ?? ""];
|
|
59
65
|
if (!handler) return false;
|
package/presentation/index.ts
CHANGED
|
@@ -100,7 +100,7 @@ async function main(): Promise<void> {
|
|
|
100
100
|
|
|
101
101
|
const pages = result.summary.pages ?? [];
|
|
102
102
|
console.log(
|
|
103
|
-
`\
|
|
103
|
+
`\nProcesso completo. Páginas no padrão gitpagedocs: ${pages.join(", ") || "(nenhuma)"}`,
|
|
104
104
|
);
|
|
105
105
|
console.log(
|
|
106
106
|
`[gitpagedocs:ai] ${result.summary.outputs.length} arquivos markdown gerados e conectados ao config.json da versão mais recente.`,
|
package/runtime/output.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, rmSync } from "node:fs";
|
|
1
|
+
import { existsSync, readdirSync, rmSync } from "node:fs";
|
|
2
2
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import {
|
|
@@ -23,6 +23,28 @@ const DEFAULT_ICON_SVG = `<?xml version="1.0" encoding="utf-8"?>
|
|
|
23
23
|
</svg>
|
|
24
24
|
`;
|
|
25
25
|
|
|
26
|
+
function listExistingVersionIds(root, outputDir) {
|
|
27
|
+
const versionsRoot = path.join(root, outputDir, "docs", "versions");
|
|
28
|
+
if (!existsSync(versionsRoot)) return [];
|
|
29
|
+
return readdirSync(versionsRoot, { withFileTypes: true })
|
|
30
|
+
.filter((entry) => entry.isDirectory())
|
|
31
|
+
.map((entry) => entry.name);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function removeLegacySourceViewerFiles(root, outputDir) {
|
|
35
|
+
const versionIds = listExistingVersionIds(root, outputDir);
|
|
36
|
+
for (const versionId of versionIds) {
|
|
37
|
+
for (const language of ["pt", "en", "es"]) {
|
|
38
|
+
for (const fileName of ["source-viewer", "source-viewer.html"]) {
|
|
39
|
+
const legacyPath = path.join(root, outputDir, "docs", "versions", versionId, language, fileName);
|
|
40
|
+
if (existsSync(legacyPath)) {
|
|
41
|
+
rmSync(legacyPath, { force: true });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
26
48
|
async function writeJson(root, relativePath, data) {
|
|
27
49
|
const absolutePath = path.join(root, relativePath);
|
|
28
50
|
await mkdir(path.dirname(absolutePath), { recursive: true });
|
|
@@ -75,6 +97,8 @@ export async function writeConfigOnlyOutput(options) {
|
|
|
75
97
|
await writeJson(root, `${outputDir}/docs/versions/${versionId}/config.json`, versionConfig);
|
|
76
98
|
}
|
|
77
99
|
|
|
100
|
+
removeLegacySourceViewerFiles(root, outputDir);
|
|
101
|
+
|
|
78
102
|
for (const [versionId, versionConfig] of Object.entries(artifacts.versionConfigs)) {
|
|
79
103
|
const versionRoutesMd = versionConfig["routes-md"] ?? versionConfig.routes ?? [];
|
|
80
104
|
for (const route of versionRoutesMd) {
|