@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,111 @@
|
|
|
1
|
+
/** Build route objects for md, html, and video content types */
|
|
2
|
+
|
|
3
|
+
export function buildMdRoute(versionId, routeId, pathByLang, titles, descriptions, options = {}) {
|
|
4
|
+
const {
|
|
5
|
+
titleCss = "font-size: 1.85rem; font-weight: 700;",
|
|
6
|
+
titleDarkCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
7
|
+
titleLightCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
8
|
+
titlePosition = "center",
|
|
9
|
+
titleIsVisible = true,
|
|
10
|
+
descriptionCss = "font-size: 1.2rem; font-weight: 500;",
|
|
11
|
+
descriptionDarkCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
12
|
+
descriptionLightCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
13
|
+
descriptionPosition = "center",
|
|
14
|
+
descriptionIsVisible = true,
|
|
15
|
+
fullscreenEnabled = true,
|
|
16
|
+
marginTop = "",
|
|
17
|
+
marginBottom = "",
|
|
18
|
+
blockLink = true,
|
|
19
|
+
container,
|
|
20
|
+
browseAll = false,
|
|
21
|
+
RouteguideBrand = true,
|
|
22
|
+
RouteGuideSpeciFicbrand = [],
|
|
23
|
+
RouteguideBrandPosition = "center",
|
|
24
|
+
RouteguideBrandContainerTop = false,
|
|
25
|
+
audio,
|
|
26
|
+
authorization,
|
|
27
|
+
} = options;
|
|
28
|
+
const out = {
|
|
29
|
+
id: routeId,
|
|
30
|
+
title: titles ?? { pt: "Documentação", en: "Documentation", es: "Documentación" },
|
|
31
|
+
description: descriptions ?? { pt: "Descrição da página", en: "Page description", es: "Descripción de la página" },
|
|
32
|
+
titleCss,
|
|
33
|
+
titleDarkCss,
|
|
34
|
+
titleLightCss,
|
|
35
|
+
titlePosition,
|
|
36
|
+
titleIsVisible,
|
|
37
|
+
descriptionCss,
|
|
38
|
+
descriptionDarkCss,
|
|
39
|
+
descriptionLightCss,
|
|
40
|
+
descriptionPosition,
|
|
41
|
+
descriptionIsVisible,
|
|
42
|
+
path: pathByLang,
|
|
43
|
+
fullscreenEnabled,
|
|
44
|
+
marginTop,
|
|
45
|
+
marginBottom,
|
|
46
|
+
blockLink,
|
|
47
|
+
container,
|
|
48
|
+
browseAll,
|
|
49
|
+
RouteguideBrand,
|
|
50
|
+
RouteGuideSpeciFicbrand,
|
|
51
|
+
RouteguideBrandPosition,
|
|
52
|
+
RouteguideBrandContainerTop,
|
|
53
|
+
};
|
|
54
|
+
if (container !== undefined) out.container = container;
|
|
55
|
+
if (audio !== undefined) out.audio = audio;
|
|
56
|
+
if (authorization !== undefined) out.authorization = authorization;
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function buildHtmlRoute(versionId, routeId, pathByLang, titles, descriptions, options = {}) {
|
|
61
|
+
const base = buildMdRoute(versionId, routeId, pathByLang, titles, descriptions, options);
|
|
62
|
+
return { ...base };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function buildVideoRoute(versionId, routeId, videoType, pathVideo, titles, descriptions, options = {}) {
|
|
66
|
+
const {
|
|
67
|
+
titleCss = "font-size: 1.85rem; font-weight: 700;",
|
|
68
|
+
titleDarkCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
69
|
+
titleLightCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
70
|
+
titlePosition = "center",
|
|
71
|
+
titleIsVisible = true,
|
|
72
|
+
descriptionCss = "font-size: 1.2rem; font-weight: 500;",
|
|
73
|
+
descriptionDarkCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
74
|
+
descriptionLightCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
75
|
+
descriptionPosition = "center",
|
|
76
|
+
descriptionIsVisible = true,
|
|
77
|
+
fullscreenEnabled = true,
|
|
78
|
+
marginTop = "",
|
|
79
|
+
marginBottom = "",
|
|
80
|
+
blockLink = true,
|
|
81
|
+
container,
|
|
82
|
+
browseAll = false,
|
|
83
|
+
authorization,
|
|
84
|
+
} = options;
|
|
85
|
+
const videoTypeByLang = typeof videoType === "string" ? { pt: videoType, en: videoType, es: videoType } : videoType;
|
|
86
|
+
const pathVideoByLang = typeof pathVideo === "string" ? { pt: pathVideo, en: pathVideo, es: pathVideo } : pathVideo;
|
|
87
|
+
const obj = {
|
|
88
|
+
id: routeId,
|
|
89
|
+
title: titles ?? { pt: "Vídeo", en: "Video", es: "Vídeo" },
|
|
90
|
+
description: descriptions ?? { pt: "Descrição do vídeo", en: "Video description", es: "Descripción del vídeo" },
|
|
91
|
+
titleCss,
|
|
92
|
+
titleDarkCss,
|
|
93
|
+
titleLightCss,
|
|
94
|
+
titlePosition,
|
|
95
|
+
titleIsVisible,
|
|
96
|
+
descriptionCss,
|
|
97
|
+
descriptionDarkCss,
|
|
98
|
+
descriptionLightCss,
|
|
99
|
+
descriptionPosition,
|
|
100
|
+
descriptionIsVisible,
|
|
101
|
+
fullscreenEnabled,
|
|
102
|
+
marginTop,
|
|
103
|
+
marginBottom,
|
|
104
|
+
blockLink,
|
|
105
|
+
browseAll,
|
|
106
|
+
video: { videoType: videoTypeByLang, pathVideo: pathVideoByLang },
|
|
107
|
+
};
|
|
108
|
+
if (container !== undefined) obj.container = container;
|
|
109
|
+
if (authorization !== undefined) obj.authorization = authorization;
|
|
110
|
+
return obj;
|
|
111
|
+
}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/** Generate GitHub-style source code viewer HTML from src/, cli/, and root config files */
|
|
2
|
+
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { readFileSync, readdirSync, existsSync } from "node:fs";
|
|
5
|
+
|
|
6
|
+
function buildTreeFromKeys(fileKeys) {
|
|
7
|
+
const root = {};
|
|
8
|
+
for (const key of fileKeys) {
|
|
9
|
+
const parts = key.split("/");
|
|
10
|
+
let curr = root;
|
|
11
|
+
for (let i = 0; i < parts.length; i++) {
|
|
12
|
+
const part = parts[i];
|
|
13
|
+
const isLast = i === parts.length - 1;
|
|
14
|
+
if (!curr[part]) curr[part] = isLast ? { path: key } : {};
|
|
15
|
+
if (isLast) curr[part].path = key;
|
|
16
|
+
else curr = curr[part];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return root;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ROOT_FILES = ["README.md", "package.json", "package-lock.json", "next.config.ts", "tsconfig.json", ".eslintrc.json"];
|
|
23
|
+
|
|
24
|
+
function collectSourceFiles(projectRoot) {
|
|
25
|
+
const files = {};
|
|
26
|
+
function scan(dir, prefix = "") {
|
|
27
|
+
if (!existsSync(dir)) return;
|
|
28
|
+
const entries = readdirSync(dir, { withFileTypes: true })
|
|
29
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
30
|
+
for (const e of entries) {
|
|
31
|
+
const name = e.name;
|
|
32
|
+
if (name === "node_modules" || name.startsWith(".")) continue;
|
|
33
|
+
const rel = prefix ? `${prefix}/${name}` : name;
|
|
34
|
+
const fullPath = path.join(dir, name);
|
|
35
|
+
if (e.isDirectory()) {
|
|
36
|
+
scan(fullPath, rel);
|
|
37
|
+
} else {
|
|
38
|
+
try {
|
|
39
|
+
const content = readFileSync(fullPath, "utf-8");
|
|
40
|
+
files[rel] = content;
|
|
41
|
+
} catch {
|
|
42
|
+
/* skip binary or unreadable */
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
for (const f of ROOT_FILES) {
|
|
48
|
+
const p = path.join(projectRoot, f);
|
|
49
|
+
if (existsSync(p)) {
|
|
50
|
+
try {
|
|
51
|
+
files[f] = readFileSync(p, "utf-8");
|
|
52
|
+
} catch {}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const srcDir = path.join(projectRoot, "src");
|
|
56
|
+
const cliDir = path.join(projectRoot, "cli");
|
|
57
|
+
if (existsSync(srcDir)) scan(srcDir, "src");
|
|
58
|
+
if (existsSync(cliDir)) scan(cliDir, "cli");
|
|
59
|
+
return files;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** GitHub-like file viewer: breadcrumb bar, file header, table layout, dark theme */
|
|
63
|
+
export function generateSourceViewerHtml(root) {
|
|
64
|
+
const files = collectSourceFiles(root);
|
|
65
|
+
const fileKeys = Object.keys(files).sort();
|
|
66
|
+
const tree = buildTreeFromKeys(fileKeys);
|
|
67
|
+
const noFilesMsg = "No files found.";
|
|
68
|
+
const dataJson = JSON.stringify({ files, fileKeys, tree });
|
|
69
|
+
return `<!DOCTYPE html>
|
|
70
|
+
<html lang="en">
|
|
71
|
+
<head>
|
|
72
|
+
<meta charset="UTF-8"/>
|
|
73
|
+
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
74
|
+
<title>Source code - GitHub</title>
|
|
75
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css"/>
|
|
76
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
77
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"></script>
|
|
78
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/tsx.min.js"></script>
|
|
79
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/javascript.min.js"></script>
|
|
80
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/json.min.js"></script>
|
|
81
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/css.min.js"></script>
|
|
82
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/markdown.min.js"></script>
|
|
83
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.1/marked.min.js"></script>
|
|
84
|
+
<style>
|
|
85
|
+
/* GitHub dark theme - variables */
|
|
86
|
+
:root{
|
|
87
|
+
--github-bg: #0d1117;
|
|
88
|
+
--github-bg-secondary: #161b22;
|
|
89
|
+
--github-bg-tertiary: #21262d;
|
|
90
|
+
--github-border: #30363d;
|
|
91
|
+
--github-border-muted: #21262d;
|
|
92
|
+
--github-fg: #e6edf3;
|
|
93
|
+
--github-fg-muted: #8b949e;
|
|
94
|
+
--github-accent: #58a6ff;
|
|
95
|
+
--github-accent-soft: #79c0ff;
|
|
96
|
+
}
|
|
97
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
98
|
+
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;background:var(--github-bg);color:var(--github-fg);min-height:100vh;font-size:14px;line-height:1.5}
|
|
99
|
+
|
|
100
|
+
/* Top bar - GitHub style */
|
|
101
|
+
.top-bar{background:var(--github-bg-secondary);border-bottom:1px solid var(--github-border-muted);padding:8px 16px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
|
102
|
+
.top-bar .crumb{color:var(--github-fg-muted);text-decoration:none}
|
|
103
|
+
.top-bar .crumb:hover{color:var(--github-accent)}
|
|
104
|
+
.top-bar .crumb-sep{color:var(--github-fg-muted);user-select:none}
|
|
105
|
+
.top-bar .file-name{color:var(--github-fg);font-weight:600}
|
|
106
|
+
|
|
107
|
+
/* Layout */
|
|
108
|
+
.layout{display:flex;height:calc(100vh - 45px)}
|
|
109
|
+
|
|
110
|
+
/* Sidebar - GitHub file tree */
|
|
111
|
+
.sidebar{width:260px;min-width:200px;background:var(--github-bg-secondary);border-right:1px solid var(--github-border-muted);overflow-y:auto;padding:8px 0;flex-shrink:0}
|
|
112
|
+
.sidebar .folder,.sidebar .file{padding:4px 12px 4px 8px;font-size:13px;cursor:pointer;display:flex;align-items:center;gap:6px;border-radius:6px;margin:0 8px}
|
|
113
|
+
.sidebar .folder:hover,.sidebar .file:hover{background:var(--github-bg-tertiary)}
|
|
114
|
+
.sidebar .file{color:var(--github-fg-muted)}
|
|
115
|
+
.sidebar .file.active{color:var(--github-accent);background:var(--github-bg-tertiary)}
|
|
116
|
+
.sidebar .icon{width:16px;text-align:center;flex-shrink:0}
|
|
117
|
+
.sidebar .icon svg{vertical-align:middle}
|
|
118
|
+
.sidebar .folder .icon{color:var(--github-accent-soft)}
|
|
119
|
+
.sidebar .chevron{width:16px;transition:transform .15s;flex-shrink:0}
|
|
120
|
+
.sidebar .folder.collapsed .chevron{transform:rotate(-90deg)}
|
|
121
|
+
.sidebar .children{margin-left:4px}
|
|
122
|
+
.sidebar .children.hidden{display:none}
|
|
123
|
+
.sidebar .search-wrap{padding:8px;border-bottom:1px solid var(--github-border-muted)}
|
|
124
|
+
.sidebar .search-input{width:100%;padding:6px 10px;font-size:12px;border:1px solid var(--github-border);border-radius:6px;background:var(--github-bg);color:var(--github-fg);outline:none}
|
|
125
|
+
.sidebar .search-input:focus{border-color:var(--github-accent)}
|
|
126
|
+
.sidebar .search-input::placeholder{color:var(--github-fg-muted)}
|
|
127
|
+
.sidebar .tree-actions{display:flex;gap:4px;padding:4px 8px;border-bottom:1px solid var(--github-border-muted)}
|
|
128
|
+
.sidebar .tree-btn{padding:4px 8px;font-size:11px;border:1px solid var(--github-border);border-radius:4px;background:var(--github-bg-tertiary);color:var(--github-fg-muted);cursor:pointer}
|
|
129
|
+
.sidebar .tree-btn:hover{color:var(--github-fg);background:var(--github-border)}
|
|
130
|
+
|
|
131
|
+
/* Content - GitHub file view */
|
|
132
|
+
.content{flex:1;display:flex;flex-direction:column;overflow:hidden;background:var(--github-bg)}
|
|
133
|
+
.content .file-header{background:var(--github-bg-secondary);border-bottom:1px solid var(--github-border-muted);padding:8px 16px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
|
|
134
|
+
.content .file-header .file-path{font-weight:600;color:var(--github-fg)}
|
|
135
|
+
.content .file-header .copy-btn{padding:4px 12px;font-size:12px;border:1px solid var(--github-border);border-radius:6px;background:var(--github-bg-tertiary);color:var(--github-fg);cursor:pointer}
|
|
136
|
+
.content .file-header .copy-btn:hover{background:var(--github-border);border-color:var(--github-fg-muted)}
|
|
137
|
+
.content .code-wrap{flex:1;overflow:auto}
|
|
138
|
+
.content .code-table{width:100%;border-collapse:collapse;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;font-size:12px;line-height:1.45}
|
|
139
|
+
.content .code-table td{vertical-align:top;padding:0}
|
|
140
|
+
.content .line-nums{padding:16px 0;text-align:right;user-select:none;color:var(--github-fg-muted);background:var(--github-bg-secondary);border-right:1px solid var(--github-border-muted);width:1%;min-width:50px}
|
|
141
|
+
.content .line-nums span{display:block;padding:0 16px}
|
|
142
|
+
.content .line-code{padding:16px 0;padding-left:16px}
|
|
143
|
+
.content .line-code .line{display:block;min-height:1.45em;white-space:pre}
|
|
144
|
+
.content .empty{color:var(--github-fg-muted);padding:24px;font-style:italic}
|
|
145
|
+
.content .md-preview{padding:24px;line-height:1.6}
|
|
146
|
+
.content .md-preview h1,.content .md-preview h2,.content .md-preview h3{margin-top:1em;margin-bottom:0.5em;font-weight:600}
|
|
147
|
+
.content .md-preview code{background:var(--github-bg-tertiary);padding:2px 6px;border-radius:4px;font-size:0.9em}
|
|
148
|
+
.content .md-preview pre{background:var(--github-bg-tertiary);padding:16px;overflow-x:auto;border-radius:6px;font-size:13px}
|
|
149
|
+
.content .btn-group{display:flex;gap:8px;margin-bottom:16px}
|
|
150
|
+
.content .btn{padding:6px 12px;border:1px solid var(--github-border);border-radius:6px;background:var(--github-bg-tertiary);color:var(--github-fg);cursor:pointer;font-size:12px}
|
|
151
|
+
.content .btn.active{background:var(--github-accent);border-color:var(--github-accent);color:#fff}
|
|
152
|
+
.content .btn:hover{background:var(--github-border)}
|
|
153
|
+
|
|
154
|
+
@media(max-width:767px){
|
|
155
|
+
.layout{flex-direction:column;height:auto;min-height:100vh}
|
|
156
|
+
.sidebar{width:100%;max-height:200px;border-right:none;border-bottom:1px solid var(--github-border-muted)}
|
|
157
|
+
.content .code-wrap{min-height:400px}
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
160
|
+
</head>
|
|
161
|
+
<body>
|
|
162
|
+
<div class="top-bar">
|
|
163
|
+
<span class="crumb">source</span>
|
|
164
|
+
<span class="crumb-sep">/</span>
|
|
165
|
+
<span class="file-name" id="breadcrumbFile">-</span>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="layout">
|
|
168
|
+
<aside class="sidebar">
|
|
169
|
+
<div class="search-wrap"><input type="text" class="search-input" id="searchInput" placeholder="Filter files..." autocomplete="off"/></div>
|
|
170
|
+
<div class="tree-actions"><button class="tree-btn" id="expandAll">Expand all</button><button class="tree-btn" id="collapseAll">Collapse all</button></div>
|
|
171
|
+
<div id="tree"></div>
|
|
172
|
+
</aside>
|
|
173
|
+
<main class="content">
|
|
174
|
+
<div class="file-header" id="fileHeader" style="display:none">
|
|
175
|
+
<span class="file-path" id="headerPath"></span>
|
|
176
|
+
<button class="copy-btn" id="copyBtn">Copy</button>
|
|
177
|
+
</div>
|
|
178
|
+
<div class="code-wrap">
|
|
179
|
+
<pre class="content-inner" id="viewer"><code class="empty">${fileKeys.length ? "Select a file from the sidebar" : noFilesMsg}</code></pre>
|
|
180
|
+
</div>
|
|
181
|
+
</main>
|
|
182
|
+
</div>
|
|
183
|
+
<script type="application/json" id="filesData">${dataJson.replace(/<\/script>/gi, "<\\/script>")}</script>
|
|
184
|
+
<script>
|
|
185
|
+
(function(){
|
|
186
|
+
var el=document.getElementById("filesData");
|
|
187
|
+
var raw=el?el.textContent:"{}";
|
|
188
|
+
var data=JSON.parse(raw);
|
|
189
|
+
var files=data.files||{}, keys=data.fileKeys||[], treeData=data.tree||{};
|
|
190
|
+
function esc(s){var d=document.createElement("div");d.textContent=s;return d.innerHTML}
|
|
191
|
+
function getLang(p){
|
|
192
|
+
if(p.endsWith(".ts")||p.endsWith(".tsx"))return"typescript";
|
|
193
|
+
if(p.endsWith(".js")||p.endsWith(".mjs")||p.endsWith(".cjs"))return"javascript";
|
|
194
|
+
if(p.endsWith(".json"))return"json";
|
|
195
|
+
if(p.endsWith(".css"))return"css";
|
|
196
|
+
if(p.endsWith(".md"))return"markdown";
|
|
197
|
+
return"";
|
|
198
|
+
}
|
|
199
|
+
var viewMode="code";
|
|
200
|
+
function setViewMode(mode){viewMode=mode}
|
|
201
|
+
function selectFile(path){
|
|
202
|
+
document.querySelectorAll(".sidebar .file.active").forEach(function(n){n.classList.remove("active")});
|
|
203
|
+
document.querySelectorAll(".sidebar .folder.active").forEach(function(n){n.classList.remove("active")});
|
|
204
|
+
var node=document.querySelector('.sidebar .file[data-path="'+path.replace(/"/g,'\\"')+'"]');
|
|
205
|
+
if(node){node.classList.add("active");node.scrollIntoView({block:"nearest"})}
|
|
206
|
+
document.getElementById("breadcrumbFile").textContent=path;
|
|
207
|
+
document.getElementById("fileHeader").style.display="block";
|
|
208
|
+
document.getElementById("headerPath").textContent=path;
|
|
209
|
+
var content=files[path]||"";
|
|
210
|
+
var isReadme=path.toLowerCase()==="readme.md";
|
|
211
|
+
var viewer=document.getElementById("viewer");
|
|
212
|
+
if(isReadme){
|
|
213
|
+
var btnHtml='<div class="btn-group"><button class="btn'+(viewMode==='preview'?' active':'')+'" data-mode="preview">Preview</button><button class="btn'+(viewMode==='code'?' active':'')+'" data-mode="code">Code</button></div>';
|
|
214
|
+
if(viewMode==="preview"&&typeof marked!=="undefined"){
|
|
215
|
+
viewer.innerHTML=btnHtml+'<div class="md-preview">'+marked.parse(content||"")+'</div>';
|
|
216
|
+
}else{
|
|
217
|
+
var lines=(content||"").split("\\n");
|
|
218
|
+
var lineHtml="";
|
|
219
|
+
lines.forEach(function(line,i){lineHtml+="<span class=\\"line-num\\">"+(i+1)+"</span><span class=\\"line\\">"+esc(line)+"\\n</span>"});
|
|
220
|
+
viewer.innerHTML=btnHtml+"<code>"+lineHtml+"</code>";
|
|
221
|
+
if(typeof hljs!=="undefined"){var c=viewer.querySelector("code");if(c){c.className="language-markdown";hljs.highlightElement(c)}}
|
|
222
|
+
}
|
|
223
|
+
viewer.classList.remove("empty");
|
|
224
|
+
viewer.querySelectorAll(".btn").forEach(function(btn){
|
|
225
|
+
btn.onclick=function(){setViewMode(btn.dataset.mode);selectFile(path)};
|
|
226
|
+
});
|
|
227
|
+
}else{
|
|
228
|
+
var lines=content.split("\\n");
|
|
229
|
+
var nums="",code="";
|
|
230
|
+
lines.forEach(function(line,i){nums+="<span>"+(i+1)+"</span>";code+="<span class=\\"line\\">"+esc(line)+"\\n</span>"});
|
|
231
|
+
viewer.innerHTML='<table class="code-table"><tr><td class="line-nums">'+nums+'</td><td class="line-code"><code>'+code+'</code></td></tr></table>';
|
|
232
|
+
viewer.classList.remove("empty");
|
|
233
|
+
var c=viewer.querySelector("code");if(c&&typeof hljs!=="undefined"){c.className="language-"+getLang(path);hljs.highlightElement(c)}
|
|
234
|
+
}
|
|
235
|
+
window._currentPath=path;window._currentContent=content;
|
|
236
|
+
}
|
|
237
|
+
document.getElementById("copyBtn").onclick=function(){
|
|
238
|
+
var p=window._currentPath,c=window._currentContent;
|
|
239
|
+
if(!c)return;
|
|
240
|
+
navigator.clipboard&&navigator.clipboard.writeText(c).then(function(){var b=document.getElementById("copyBtn");var t=b.textContent;b.textContent="Copied!";setTimeout(function(){b.textContent=t},1500)});
|
|
241
|
+
};
|
|
242
|
+
function folderIcon(){return'<svg width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.58 0 1.165.224 1.587.624l.357.364A.75.75 0 0 0 8 2h5.25A1.75 1.75 0 0 1 15 3.75v8.5A1.75 1.75 0 0 1 13.25 14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 2.178.78 1.408 1.513 1.513Z"/></svg>'}
|
|
243
|
+
function fileIcon(){return'<svg width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Z"/></svg>'}
|
|
244
|
+
function chevronDown(){return'<svg width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"/></svg>'}
|
|
245
|
+
function renderTree(node, parentEl, indent){
|
|
246
|
+
indent=indent||0;
|
|
247
|
+
var keys=Object.keys(node).sort();
|
|
248
|
+
for(var i=0;i<keys.length;i++){
|
|
249
|
+
var k=keys[i];
|
|
250
|
+
var v=node[k];
|
|
251
|
+
if(k==="path")continue;
|
|
252
|
+
if(v&&typeof v==="object"&&v.path){
|
|
253
|
+
var div=document.createElement("div");
|
|
254
|
+
div.className="file";
|
|
255
|
+
div.dataset.path=v.path;
|
|
256
|
+
div.style.marginLeft=(indent*12)+"px";
|
|
257
|
+
div.innerHTML='<span class="icon">'+fileIcon()+'</span>'+esc(k);
|
|
258
|
+
div.onclick=function(p){return function(){selectFile(p)}}(v.path);
|
|
259
|
+
parentEl.appendChild(div);
|
|
260
|
+
}else if(v&&typeof v==="object"){
|
|
261
|
+
var folderDiv=document.createElement("div");
|
|
262
|
+
folderDiv.className="folder";
|
|
263
|
+
folderDiv.style.marginLeft=(indent*12)+"px";
|
|
264
|
+
folderDiv.innerHTML='<span class="chevron">'+chevronDown()+'</span><span class="icon">'+folderIcon()+'</span>'+esc(k);
|
|
265
|
+
var children=document.createElement("div");
|
|
266
|
+
children.className="children";
|
|
267
|
+
folderDiv.onclick=function(e){
|
|
268
|
+
if(e.target.closest(".file"))return;
|
|
269
|
+
var self=e.currentTarget;
|
|
270
|
+
self.classList.toggle("collapsed");
|
|
271
|
+
children.classList.toggle("hidden",self.classList.contains("collapsed"));
|
|
272
|
+
};
|
|
273
|
+
parentEl.appendChild(folderDiv);
|
|
274
|
+
parentEl.appendChild(children);
|
|
275
|
+
renderTree(v,children,indent+1);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function buildTreeFromKeys(keys){
|
|
280
|
+
var root={};
|
|
281
|
+
keys.forEach(function(key){
|
|
282
|
+
var parts=key.split("/");
|
|
283
|
+
var curr=root;
|
|
284
|
+
for(var i=0;i<parts.length;i++){
|
|
285
|
+
var part=parts[i];
|
|
286
|
+
var isLast=i===parts.length-1;
|
|
287
|
+
if(!curr[part])curr[part]=isLast?{path:key}:{};
|
|
288
|
+
if(isLast)curr[part].path=key;
|
|
289
|
+
else curr=curr[part];
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
return root;
|
|
293
|
+
}
|
|
294
|
+
function buildTree(filterQuery){
|
|
295
|
+
var treeEl=document.getElementById("tree");
|
|
296
|
+
treeEl.innerHTML="";
|
|
297
|
+
var filteredKeys=filterQuery?keys.filter(function(k){return k.toLowerCase().indexOf(filterQuery.toLowerCase())>=0;}):keys;
|
|
298
|
+
var data=filteredKeys.length?buildTreeFromKeys(filteredKeys):{};
|
|
299
|
+
if(Object.keys(data).length>0){
|
|
300
|
+
renderTree(data,treeEl,0);
|
|
301
|
+
}else{
|
|
302
|
+
filteredKeys.sort();
|
|
303
|
+
filteredKeys.forEach(function(k){
|
|
304
|
+
var div=document.createElement("div");
|
|
305
|
+
div.className="file";
|
|
306
|
+
div.dataset.path=k;
|
|
307
|
+
div.innerHTML='<span class="icon">'+fileIcon()+'</span>'+esc(k.split("/").pop());
|
|
308
|
+
div.onclick=function(){selectFile(k)};
|
|
309
|
+
treeEl.appendChild(div);
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
document.getElementById("searchInput").oninput=function(){
|
|
314
|
+
var q=this.value.trim();
|
|
315
|
+
buildTree(q);
|
|
316
|
+
};
|
|
317
|
+
document.getElementById("expandAll").onclick=function(){
|
|
318
|
+
document.querySelectorAll(".sidebar .folder.collapsed").forEach(function(f){f.classList.remove("collapsed")});
|
|
319
|
+
document.querySelectorAll(".sidebar .children.hidden").forEach(function(c){c.classList.remove("hidden")});
|
|
320
|
+
};
|
|
321
|
+
document.getElementById("collapseAll").onclick=function(){
|
|
322
|
+
document.querySelectorAll(".sidebar .folder").forEach(function(f){f.classList.add("collapsed")});
|
|
323
|
+
document.querySelectorAll(".sidebar .children").forEach(function(c){c.classList.add("hidden")});
|
|
324
|
+
};
|
|
325
|
+
buildTree();
|
|
326
|
+
})();
|
|
327
|
+
</script>
|
|
328
|
+
</body>
|
|
329
|
+
</html>`;
|
|
330
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** Build theme JSON template from layout definition */
|
|
2
|
+
|
|
3
|
+
import { THEME_COLORS } from "../data/theme-colors.mjs";
|
|
4
|
+
|
|
5
|
+
export function createThemeTemplate(layout, themeColors = THEME_COLORS) {
|
|
6
|
+
const colors = themeColors[layout.id] ?? themeColors.default;
|
|
7
|
+
const dark = layout.mode === "dark";
|
|
8
|
+
return {
|
|
9
|
+
id: layout.id,
|
|
10
|
+
name: layout.name,
|
|
11
|
+
author: layout.author,
|
|
12
|
+
version: "1.0.0",
|
|
13
|
+
mode: layout.mode,
|
|
14
|
+
supportsLightAndDarkModes: layout.supportsLightAndDarkModes,
|
|
15
|
+
colors,
|
|
16
|
+
typography: {
|
|
17
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif",
|
|
18
|
+
fontSize: {
|
|
19
|
+
small: "0.875rem",
|
|
20
|
+
base: "1rem",
|
|
21
|
+
medium: "1.125rem",
|
|
22
|
+
large: "1.25rem",
|
|
23
|
+
xlarge: "2rem",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
components: {
|
|
27
|
+
header: {
|
|
28
|
+
height: "80px",
|
|
29
|
+
backgroundColor: dark ? "#0B1220" : "#FFFFFF",
|
|
30
|
+
borderBottom: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
31
|
+
},
|
|
32
|
+
footer: {
|
|
33
|
+
height: "60px",
|
|
34
|
+
backgroundColor: dark ? "#0B1220" : "#FFFFFF",
|
|
35
|
+
borderTop: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
36
|
+
},
|
|
37
|
+
card: {
|
|
38
|
+
borderRadius: "16px",
|
|
39
|
+
padding: "24px",
|
|
40
|
+
boxShadow: dark ? "0 18px 60px rgba(0, 0, 0, 0.45)" : "0 18px 50px rgba(15, 23, 42, 0.08)",
|
|
41
|
+
},
|
|
42
|
+
button: {
|
|
43
|
+
borderRadius: "12px",
|
|
44
|
+
padding: "10px 18px",
|
|
45
|
+
border: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
46
|
+
hoverGlow: dark ? "0 0 0 3px rgba(124, 58, 237, 0.18)" : "0 0 0 4px rgba(109, 40, 217, 0.15)",
|
|
47
|
+
},
|
|
48
|
+
select: {
|
|
49
|
+
borderRadius: "12px",
|
|
50
|
+
padding: "10px 40px 10px 16px",
|
|
51
|
+
border: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
52
|
+
backgroundColor: dark ? "#0F172A" : "#FFFFFF",
|
|
53
|
+
textAlign: "center",
|
|
54
|
+
iconColor: colors.secondary,
|
|
55
|
+
hoverBorderColor: dark ? "rgba(34, 211, 238, 0.7)" : "rgba(8, 145, 178, 0.7)",
|
|
56
|
+
focusBorderColor: dark ? "rgba(124, 58, 237, 0.8)" : "rgba(109, 40, 217, 0.8)",
|
|
57
|
+
focusGlow: dark ? "0 0 0 4px rgba(124, 58, 237, 0.18)" : "0 0 0 4px rgba(109, 40, 217, 0.15)",
|
|
58
|
+
},
|
|
59
|
+
checkbox: {
|
|
60
|
+
width: "20px",
|
|
61
|
+
height: "20px",
|
|
62
|
+
accentColor: colors.primary,
|
|
63
|
+
borderColor: dark ? "#475569" : "#CBD5E1",
|
|
64
|
+
hoverBorderColor: dark ? "rgba(34, 211, 238, 0.75)" : "rgba(8, 145, 178, 0.7)",
|
|
65
|
+
checkMarkColor: colors.background,
|
|
66
|
+
borderRadius: "6px",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
animations: {
|
|
70
|
+
enableTypingEffect: false,
|
|
71
|
+
enableGlow: dark,
|
|
72
|
+
transitionDuration: "0.22s",
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/** Build version config (routes, menus) for each doc version */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ROUTE_PATHS,
|
|
5
|
+
VIDEO_IDS,
|
|
6
|
+
PAGE2_AUDIO,
|
|
7
|
+
SOURCE_VIEWER_META,
|
|
8
|
+
} from "../data/path-mappings.mjs";
|
|
9
|
+
import {
|
|
10
|
+
ROUTE_META_ID1,
|
|
11
|
+
ROUTE_META_ID2,
|
|
12
|
+
ROUTE_META_ID3,
|
|
13
|
+
ROUTE_META_ID4,
|
|
14
|
+
ROUTE_META_ID5,
|
|
15
|
+
ROUTE_META_ID6,
|
|
16
|
+
VIDEO_META_ID1,
|
|
17
|
+
VIDEO_META_ID2,
|
|
18
|
+
VIDEO_META_ID3,
|
|
19
|
+
VIDEO_META_ID4,
|
|
20
|
+
DEFAULT_HIERARCHY,
|
|
21
|
+
} from "../data/route-metas.mjs";
|
|
22
|
+
import { buildMdRoute, buildHtmlRoute, buildVideoRoute } from "./route-builders.mjs";
|
|
23
|
+
|
|
24
|
+
const ROUTE_METAS = {
|
|
25
|
+
1: ROUTE_META_ID1,
|
|
26
|
+
2: ROUTE_META_ID2,
|
|
27
|
+
3: ROUTE_META_ID3,
|
|
28
|
+
4: ROUTE_META_ID4,
|
|
29
|
+
5: ROUTE_META_ID5,
|
|
30
|
+
6: ROUTE_META_ID6,
|
|
31
|
+
};
|
|
32
|
+
const VIDEO_METAS = { 1: VIDEO_META_ID1, 2: VIDEO_META_ID2, 3: VIDEO_META_ID3, 4: VIDEO_META_ID4 };
|
|
33
|
+
|
|
34
|
+
function buildVersionMdRoutes(versionId) {
|
|
35
|
+
const base = `gitpagedocs/docs/versions/${versionId}`;
|
|
36
|
+
return [1, 2, 3, 4, 5, 6].map((id) => {
|
|
37
|
+
const paths = ROUTE_PATHS[id];
|
|
38
|
+
const meta = ROUTE_METAS[id];
|
|
39
|
+
const pathByLang = {
|
|
40
|
+
pt: `${base}/pt/${paths.pt}`,
|
|
41
|
+
en: `${base}/en/${paths.en}`,
|
|
42
|
+
es: `${base}/es/${paths.es}`,
|
|
43
|
+
};
|
|
44
|
+
const routeOptions = {
|
|
45
|
+
...(id === 2 ? { audio: PAGE2_AUDIO } : {}),
|
|
46
|
+
...(id === 3 ? { authorization: { requiredRoles: ["maintainer"] } } : {}),
|
|
47
|
+
...(id === 6
|
|
48
|
+
? {
|
|
49
|
+
authorization: {
|
|
50
|
+
accessKeyId: "docs-key",
|
|
51
|
+
requiredRoles: ["maintainer"],
|
|
52
|
+
requireExternalAuth: true,
|
|
53
|
+
allowedProviders: ["authjs", "clerk", "firebase", "jwt"],
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
: {}),
|
|
57
|
+
};
|
|
58
|
+
return buildMdRoute(versionId, id, pathByLang, meta.titles, meta.descriptions, routeOptions);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function buildVersionHtmlRoutes(versionId) {
|
|
63
|
+
const base = `gitpagedocs/docs/versions/${versionId}`;
|
|
64
|
+
const pathByLangSource = {
|
|
65
|
+
pt: `${base}/pt/source-viewer`,
|
|
66
|
+
en: `${base}/en/source-viewer`,
|
|
67
|
+
es: `${base}/es/source-viewer`,
|
|
68
|
+
};
|
|
69
|
+
return [
|
|
70
|
+
buildHtmlRoute(versionId, 1, pathByLangSource, SOURCE_VIEWER_META.titles, SOURCE_VIEWER_META.descriptions, {
|
|
71
|
+
container: "full",
|
|
72
|
+
blockLink: true,
|
|
73
|
+
authorization: { accessKeyId: "source-viewer-key" },
|
|
74
|
+
}),
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function buildVersionVideoRoutes(versionId) {
|
|
79
|
+
return [1, 2, 3, 4].map((id) =>
|
|
80
|
+
buildVideoRoute(
|
|
81
|
+
versionId,
|
|
82
|
+
id,
|
|
83
|
+
"youtube",
|
|
84
|
+
VIDEO_IDS[id - 1],
|
|
85
|
+
VIDEO_METAS[id].title,
|
|
86
|
+
VIDEO_METAS[id].description,
|
|
87
|
+
{
|
|
88
|
+
authorization: {
|
|
89
|
+
requireExternalAuth: true,
|
|
90
|
+
allowedProviders: ["authjs", "clerk", "firebase", "jwt"],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function buildVersionMenus(versionId) {
|
|
98
|
+
const base = `gitpagedocs/docs/versions/${versionId}`;
|
|
99
|
+
const menuMd = [1, 2, 3, 4, 5, 6].map((id) => ({
|
|
100
|
+
id: id,
|
|
101
|
+
pt: { title: ROUTE_METAS[id].titles.pt, "path-click": `${base}/pt/${ROUTE_PATHS[id].pt}` },
|
|
102
|
+
en: { title: ROUTE_METAS[id].titles.en, "path-click": `${base}/en/${ROUTE_PATHS[id].en}` },
|
|
103
|
+
es: { title: ROUTE_METAS[id].titles.es, "path-click": `${base}/es/${ROUTE_PATHS[id].es}` },
|
|
104
|
+
}));
|
|
105
|
+
const menuHtml = [
|
|
106
|
+
{
|
|
107
|
+
id: 1,
|
|
108
|
+
pt: { title: "Código fonte", "path-click": `${base}/pt/source-viewer` },
|
|
109
|
+
en: { title: "Source code", "path-click": `${base}/en/source-viewer` },
|
|
110
|
+
es: { title: "Código fuente", "path-click": `${base}/es/source-viewer` },
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
const menuVideo = [1, 2, 3, 4].map((id) => ({
|
|
114
|
+
id: id,
|
|
115
|
+
pt: { title: VIDEO_METAS[id].title.pt.slice(0, 40) + "...", "path-click": `page:${id}` },
|
|
116
|
+
en: { title: VIDEO_METAS[id].title.en.slice(0, 40) + "...", "path-click": `page:${id}` },
|
|
117
|
+
es: { title: VIDEO_METAS[id].title.es.slice(0, 40) + "...", "path-click": `page:${id}` },
|
|
118
|
+
}));
|
|
119
|
+
return { md: menuMd, html: menuHtml, video: menuVideo };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Build version config for a single doc version.
|
|
124
|
+
* @param {string} versionId - e.g. "1.0.0", "1.1.0", "1.1.1"
|
|
125
|
+
* @returns {object} Version config with routes-md, routes-html, routes-video, menus, hierarchy
|
|
126
|
+
*/
|
|
127
|
+
export function buildVersionConfig(versionId) {
|
|
128
|
+
return {
|
|
129
|
+
auth: {
|
|
130
|
+
accessKeys: {
|
|
131
|
+
"docs-key": "open-gitpagedocs-docs",
|
|
132
|
+
"source-viewer-key": "open-source-viewer",
|
|
133
|
+
},
|
|
134
|
+
rolesStorageKey: "git-page-docs:route-auth:roles",
|
|
135
|
+
providers: [
|
|
136
|
+
{ type: "authjs", enabled: true, sessionEndpoint: "/api/auth/session", rolesClaimPath: "user.roles" },
|
|
137
|
+
{ type: "clerk", enabled: true, rolesClaimPath: "claims.publicMetadata.roles" },
|
|
138
|
+
{ type: "firebase", enabled: true, tokenStorageKey: "git-page-docs:firebase-token", rolesClaimPath: "roles" },
|
|
139
|
+
{ type: "jwt", enabled: true, tokenStorageKey: "git-page-docs:jwt-token", rolesClaimPath: "roles" },
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
"routes-md": buildVersionMdRoutes(versionId),
|
|
143
|
+
"routes-html": buildVersionHtmlRoutes(versionId),
|
|
144
|
+
"routes-video": buildVersionVideoRoutes(versionId),
|
|
145
|
+
"menus-header-md": buildVersionMenus(versionId).md,
|
|
146
|
+
"menus-header-html": buildVersionMenus(versionId).html,
|
|
147
|
+
"menus-header-video": buildVersionMenus(versionId).video,
|
|
148
|
+
hierarchyPage: DEFAULT_HIERARCHY,
|
|
149
|
+
hierarchyMenu: DEFAULT_HIERARCHY,
|
|
150
|
+
};
|
|
151
|
+
}
|