@knowcode/doc-builder 1.9.7 → 1.9.8
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/doc-builder.config.js +77 -10
- package/doc-builder.config.js.backup.1753793768283 +47 -0
- package/lib/config.js +4 -1
- package/lib/core-builder.js +1 -1
- package/lib/supabase-auth.js +10 -6
- package/package.json +1 -1
package/doc-builder.config.js
CHANGED
|
@@ -1,17 +1,41 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"configVersion": "1.9.
|
|
3
|
-
"siteName": "@knowcode/doc-builder",
|
|
4
|
-
"siteDescription": "Beautiful documentation with the least effort possible",
|
|
2
|
+
"configVersion": "1.9.7",
|
|
5
3
|
"docsDir": "docs",
|
|
6
4
|
"outputDir": "html",
|
|
7
|
-
"
|
|
5
|
+
"siteName": "@knowcode/doc-builder",
|
|
6
|
+
"siteDescription": "Beautiful documentation with the least effort possible",
|
|
7
|
+
"favicon": "✨",
|
|
8
8
|
"features": {
|
|
9
9
|
"authentication": false,
|
|
10
10
|
"changelog": true,
|
|
11
11
|
"mermaid": true,
|
|
12
|
+
"tooltips": true,
|
|
13
|
+
"search": false,
|
|
12
14
|
"darkMode": true,
|
|
13
15
|
"phosphorIcons": true,
|
|
14
|
-
"
|
|
16
|
+
"phosphorWeight": "regular",
|
|
17
|
+
"phosphorSize": "1.2em",
|
|
18
|
+
"normalizeTitle": true,
|
|
19
|
+
"showPdfDownload": true,
|
|
20
|
+
"menuDefaultOpen": false,
|
|
21
|
+
"attachments": true,
|
|
22
|
+
"dynamicNavIcons": true,
|
|
23
|
+
"subtleColors": true
|
|
24
|
+
},
|
|
25
|
+
"auth": {
|
|
26
|
+
"supabaseUrl": "https://xcihhnfcitjrwbynxmka.supabase.co",
|
|
27
|
+
"supabaseAnonKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhjaWhobmZjaXRqcndieW54bWthIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTM0Mzc2MzcsImV4cCI6MjA2OTAxMzYzN30.zvWp3JFIR8fBIiwuFF5gqOR_Kxb42baZS5fsBz60XOY"
|
|
28
|
+
},
|
|
29
|
+
"changelog": {
|
|
30
|
+
"daysBack": 14,
|
|
31
|
+
"enabled": true
|
|
32
|
+
},
|
|
33
|
+
"folderOrder": [],
|
|
34
|
+
"folderDescriptions": {},
|
|
35
|
+
"folderIcons": {},
|
|
36
|
+
"deployment": {
|
|
37
|
+
"platform": "vercel",
|
|
38
|
+
"outputDirectory": "html"
|
|
15
39
|
},
|
|
16
40
|
"seo": {
|
|
17
41
|
"enabled": true,
|
|
@@ -26,13 +50,18 @@ module.exports = {
|
|
|
26
50
|
"vercel",
|
|
27
51
|
"notion-style"
|
|
28
52
|
],
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
53
|
+
"titleTemplate": "{pageTitle} | {siteName}",
|
|
54
|
+
"autoKeywords": true,
|
|
55
|
+
"keywordLimit": 7,
|
|
56
|
+
"descriptionFallback": "smart",
|
|
32
57
|
"organization": {
|
|
33
58
|
"name": "Knowcode Ltd",
|
|
34
|
-
"url": "https://knowcode.tech"
|
|
59
|
+
"url": "https://knowcode.tech",
|
|
60
|
+
"logo": ""
|
|
35
61
|
},
|
|
62
|
+
"ogImage": "/og-default.png",
|
|
63
|
+
"generateSitemap": true,
|
|
64
|
+
"generateRobotsTxt": true,
|
|
36
65
|
"customMetaTags": [
|
|
37
66
|
{
|
|
38
67
|
"name": "google-site-verification",
|
|
@@ -43,5 +72,43 @@ module.exports = {
|
|
|
43
72
|
"content": "B2D8C4C12C530D47AA962B24CAA09630"
|
|
44
73
|
}
|
|
45
74
|
]
|
|
46
|
-
}
|
|
75
|
+
},
|
|
76
|
+
"attachmentTypes": [
|
|
77
|
+
".pdf",
|
|
78
|
+
".doc",
|
|
79
|
+
".docx",
|
|
80
|
+
".xls",
|
|
81
|
+
".xlsx",
|
|
82
|
+
".csv",
|
|
83
|
+
".ppt",
|
|
84
|
+
".pptx",
|
|
85
|
+
".txt",
|
|
86
|
+
".rtf",
|
|
87
|
+
".html",
|
|
88
|
+
".htm",
|
|
89
|
+
".zip",
|
|
90
|
+
".tar",
|
|
91
|
+
".gz",
|
|
92
|
+
".7z",
|
|
93
|
+
".rar",
|
|
94
|
+
".png",
|
|
95
|
+
".jpg",
|
|
96
|
+
".jpeg",
|
|
97
|
+
".gif",
|
|
98
|
+
".svg",
|
|
99
|
+
".webp",
|
|
100
|
+
".ico",
|
|
101
|
+
".bmp",
|
|
102
|
+
".json",
|
|
103
|
+
".xml",
|
|
104
|
+
".yaml",
|
|
105
|
+
".yml",
|
|
106
|
+
".toml",
|
|
107
|
+
".mp4",
|
|
108
|
+
".mp3",
|
|
109
|
+
".wav",
|
|
110
|
+
".avi",
|
|
111
|
+
".mov"
|
|
112
|
+
],
|
|
113
|
+
"productionUrl": "https://doc-builder-delta.vercel.app"
|
|
47
114
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"configVersion": "1.9.6",
|
|
3
|
+
"siteName": "@knowcode/doc-builder",
|
|
4
|
+
"siteDescription": "Beautiful documentation with the least effort possible",
|
|
5
|
+
"docsDir": "docs",
|
|
6
|
+
"outputDir": "html",
|
|
7
|
+
"productionUrl": "https://doc-builder-delta.vercel.app",
|
|
8
|
+
"features": {
|
|
9
|
+
"authentication": false,
|
|
10
|
+
"changelog": true,
|
|
11
|
+
"mermaid": true,
|
|
12
|
+
"darkMode": true,
|
|
13
|
+
"phosphorIcons": true,
|
|
14
|
+
"menuDefaultOpen": false
|
|
15
|
+
},
|
|
16
|
+
"seo": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"siteUrl": "https://doc-builder-delta.vercel.app",
|
|
19
|
+
"author": "Lindsay Smith",
|
|
20
|
+
"twitterHandle": "@planbbackups",
|
|
21
|
+
"language": "en-US",
|
|
22
|
+
"keywords": [
|
|
23
|
+
"documentation",
|
|
24
|
+
"markdown",
|
|
25
|
+
"static site generator",
|
|
26
|
+
"vercel",
|
|
27
|
+
"notion-style"
|
|
28
|
+
],
|
|
29
|
+
"generateSitemap": true,
|
|
30
|
+
"generateRobotsTxt": true,
|
|
31
|
+
"ogImage": "/og-default.png",
|
|
32
|
+
"organization": {
|
|
33
|
+
"name": "Knowcode Ltd",
|
|
34
|
+
"url": "https://knowcode.tech"
|
|
35
|
+
},
|
|
36
|
+
"customMetaTags": [
|
|
37
|
+
{
|
|
38
|
+
"name": "google-site-verification",
|
|
39
|
+
"content": "FtzcDTf5BQ9K5EfnGazQkgU2U4FiN3ITzM7gHwqUAqQ"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "msvalidate.01",
|
|
43
|
+
"content": "B2D8C4C12C530D47AA962B24CAA09630"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
};
|
package/lib/config.js
CHANGED
|
@@ -375,7 +375,10 @@ async function loadConfig(configPath, options = {}) {
|
|
|
375
375
|
console.warn(chalk.yellow(`Warning: Failed to load config file: ${error.message}`));
|
|
376
376
|
}
|
|
377
377
|
} else if (!options.preset && !options.legacy) {
|
|
378
|
-
console.log(chalk.gray('No config file found,
|
|
378
|
+
console.log(chalk.gray('No config file found, creating default config...'));
|
|
379
|
+
// Create default config file with all settings
|
|
380
|
+
await saveConfig(customConfigPath, config);
|
|
381
|
+
console.log(chalk.green(`✅ Created ${configPath} with default settings`));
|
|
379
382
|
}
|
|
380
383
|
|
|
381
384
|
// Apply CLI options (these override config file)
|
package/lib/core-builder.js
CHANGED
|
@@ -1326,7 +1326,7 @@ async function generateSupabaseAuthFiles(outputDir, config) {
|
|
|
1326
1326
|
const supabaseAuth = new SupabaseAuth(authConfig);
|
|
1327
1327
|
|
|
1328
1328
|
// Generate auth script and save to js/auth.js
|
|
1329
|
-
const authScript = supabaseAuth.generateAuthScript();
|
|
1329
|
+
const authScript = supabaseAuth.generateAuthScript(config);
|
|
1330
1330
|
await fs.writeFile(path.join(outputDir, 'js', 'auth.js'), authScript);
|
|
1331
1331
|
|
|
1332
1332
|
// Also copy to root for backward compatibility
|
package/lib/supabase-auth.js
CHANGED
|
@@ -26,7 +26,7 @@ class SupabaseAuth {
|
|
|
26
26
|
/**
|
|
27
27
|
* Generate client-side auth script for inclusion in HTML pages
|
|
28
28
|
*/
|
|
29
|
-
generateAuthScript() {
|
|
29
|
+
generateAuthScript(fullConfig) {
|
|
30
30
|
return `
|
|
31
31
|
/**
|
|
32
32
|
* Supabase Authentication for Documentation Site
|
|
@@ -56,6 +56,9 @@ class SupabaseAuth {
|
|
|
56
56
|
// Check authentication and site access
|
|
57
57
|
async function checkAuth() {
|
|
58
58
|
try {
|
|
59
|
+
// Check if global authentication is enabled
|
|
60
|
+
const isGlobalAuthEnabled = ${fullConfig.features?.authentication === 'supabase'};
|
|
61
|
+
|
|
59
62
|
// Check if current page is in private directory
|
|
60
63
|
const currentPath = window.location.pathname;
|
|
61
64
|
const isPrivatePage = currentPath.includes('/private/');
|
|
@@ -64,11 +67,11 @@ class SupabaseAuth {
|
|
|
64
67
|
const { data: { user }, error: userError } = await supabaseClient.auth.getUser();
|
|
65
68
|
|
|
66
69
|
if (userError || !user) {
|
|
67
|
-
//
|
|
68
|
-
if (isPrivatePage) {
|
|
70
|
+
// Redirect if global auth is enabled OR if we're on a private page
|
|
71
|
+
if (isGlobalAuthEnabled || isPrivatePage) {
|
|
69
72
|
redirectToLogin();
|
|
70
73
|
} else {
|
|
71
|
-
//
|
|
74
|
+
// Truly public page (no global auth and not private)
|
|
72
75
|
document.body.classList.add('authenticated'); // Use same class to show body
|
|
73
76
|
updateAuthButton(false);
|
|
74
77
|
}
|
|
@@ -84,7 +87,7 @@ class SupabaseAuth {
|
|
|
84
87
|
.single();
|
|
85
88
|
|
|
86
89
|
if (accessError || !access) {
|
|
87
|
-
if (isPrivatePage) {
|
|
90
|
+
if (isGlobalAuthEnabled || isPrivatePage) {
|
|
88
91
|
showAccessDenied();
|
|
89
92
|
} else {
|
|
90
93
|
// Public page, show it but don't grant private navigation access
|
|
@@ -102,7 +105,8 @@ class SupabaseAuth {
|
|
|
102
105
|
|
|
103
106
|
} catch (error) {
|
|
104
107
|
console.error('Auth check failed:', error);
|
|
105
|
-
|
|
108
|
+
const isGlobalAuthEnabled = ${fullConfig.features?.authentication === 'supabase'};
|
|
109
|
+
if (isGlobalAuthEnabled || window.location.pathname.includes('/private/')) {
|
|
106
110
|
redirectToLogin();
|
|
107
111
|
} else {
|
|
108
112
|
// Public page, show it anyway
|