@knowcode/doc-builder 1.9.29 → 1.9.31
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/assets/js/main.js +7 -0
- package/lib/core-builder.js +18 -1
- package/package.json +12 -2
- package/.claude/settings.local.json +0 -56
- package/CACHE-BUSTING-GUIDE.md +0 -82
- package/CLAUDE.md +0 -86
- package/CONTRIBUTING.md +0 -148
- package/GITHUB_SETUP.md +0 -203
- package/RELEASE-NOTES-1.7.5.md +0 -64
- package/Screenshot 2025-07-22 at 19.51.21.png +0 -0
- package/Screenshot 2025-07-26 at 17.06.49.png +0 -0
- package/add-user-clive.sql +0 -35
- package/add-user-lindsay-fixed.sql +0 -85
- package/add-user-lindsay.sql +0 -68
- package/add-user-pmorgan.sql +0 -35
- package/add-user-robbie.sql +0 -35
- package/add-wru-users.sql +0 -105
- package/debug-login.sql +0 -30
- package/doc-builder.config.js +0 -126
- package/doc-builder.config.js.backup.1753793768283 +0 -47
- package/doc-builder.config.js.backup.1753803964423 +0 -114
- package/doc-builder.config.js.backup.1753945707032 +0 -115
- package/doc-builder.config.js.backup.1754059241330 +0 -115
- package/doc-builder.config.js.backup.1754119567787 +0 -123
- package/doc-builder.config.js.backup.1754120048862 +0 -124
- package/doc-builder.config.js.backup.1754120529913 +0 -124
- package/doc-builder.config.js.backup.1754218469785 +0 -124
- package/doc-builder.config.js.backup.1754384764054 +0 -124
- package/doc-builder.config.js.backup.1754567425847 +0 -124
- package/doc-builder.config.js.backup.1754568137859 +0 -126
- package/doc-builder.config.js.backup.1754569388252 +0 -126
- package/doc-builder.config.js.backup.1754576694123 +0 -126
- package/doc-builder.config.js.backup.1755031374829 +0 -126
- package/doc-builder.config.js.backup.1755034500990 +0 -126
- package/grant-access.sql +0 -15
- package/html/11.png +0 -0
- package/html/404.html +0 -115
- package/html/README.html +0 -522
- package/html/Screenshot 2025-08-12 at 21.35.07.png +0 -0
- package/html/about-doc-builder.html +0 -491
- package/html/auth.js +0 -157
- package/html/claude-workflow-guide.html +0 -525
- package/html/css/notion-style.css +0 -2502
- package/html/documentation-index.html +0 -471
- package/html/guides/authentication-default-change.html +0 -370
- package/html/guides/authentication-guide.html +0 -509
- package/html/guides/cache-control-anti-pattern.html +0 -361
- package/html/guides/claude-workflow-guide.html +0 -1074
- package/html/guides/configuration-guide.html +0 -472
- package/html/guides/document-standards.html +0 -518
- package/html/guides/documentation-standards.html +0 -694
- package/html/guides/html-embedding-guide.html +0 -461
- package/html/guides/image-modal-guide.html +0 -515
- package/html/guides/next-steps-walkthrough.html +0 -638
- package/html/guides/phosphor-icons-guide.html +0 -584
- package/html/guides/private-directory-authentication-troubleshooting.html +0 -555
- package/html/guides/private-directory-authentication.html +0 -541
- package/html/guides/public-site-deployment.html +0 -431
- package/html/guides/search-engine-verification-guide.html +0 -542
- package/html/guides/seo-guide.html +0 -661
- package/html/guides/seo-optimization-guide.html +0 -887
- package/html/guides/supabase-auth-implementation-plan.html +0 -543
- package/html/guides/supabase-auth-integration-plan.html +0 -671
- package/html/guides/supabase-auth-setup-guide.html +0 -498
- package/html/guides/supabase-authentication-complete-guide.html +0 -866
- package/html/guides/troubleshooting-guide.html +0 -633
- package/html/guides/vercel-deployment-auth-setup.html +0 -337
- package/html/guides/windows-setup-guide.html +0 -859
- package/html/image-modal-test.html +0 -318
- package/html/index.html +0 -522
- package/html/js/auth.js +0 -157
- package/html/js/main.js +0 -1747
- package/html/launch/README.html +0 -297
- package/html/launch/bubble-plugin-specification.html +0 -933
- package/html/launch/go-to-market-strategy.html +0 -663
- package/html/launch/launch-announcements.html +0 -593
- package/html/login.html +0 -102
- package/html/logout.html +0 -18
- package/html/private/cache-control-anti-pattern.html +0 -429
- package/html/private/launch/README.html +0 -371
- package/html/private/launch/auth-cleanup-summary.html +0 -361
- package/html/private/launch/bubble-plugin-specification.html +0 -1007
- package/html/private/launch/go-to-market-strategy.html +0 -737
- package/html/private/launch/launch-announcements.html +0 -667
- package/html/private/launch/vercel-deployment-auth-setup.html +0 -417
- package/html/private/next-steps-walkthrough.html +0 -679
- package/html/private/supabase-auth-implementation-completed.html +0 -454
- package/html/private/supabase-auth-implementation-plan.html +0 -594
- package/html/private/supabase-auth-integration-plan.html +0 -704
- package/html/private/supabase-auth-setup-guide.html +0 -555
- package/html/private/test-private-doc.html +0 -302
- package/html/private/user-management-tooling.html +0 -601
- package/html/prompts/Screenshot 2025-08-02 at 08.49.55.png +0 -0
- package/html/prompts/beautiful-documentation-design.html +0 -784
- package/html/prompts/markdown-document-standards.html +0 -422
- package/html/prompts/project-rename-strategy-sasha-publish.html +0 -530
- package/html/robots.txt +0 -9
- package/html/sitemap.xml +0 -357
- package/html/test-questions/how-does-it-work%3F.html +0 -294
- package/html/test-questions/step-1%3A%20getting-started.html +0 -289
- package/html/test-questions/what-is-the-purpose.html +0 -293
- package/html/test-status.html +0 -281
- package/html/vercel-cli-setup-guide.html +0 -495
- package/html/vercel-first-time-setup-guide.html +0 -454
- package/html/vercel.json +0 -29
- package/html-static/11.png +0 -0
- package/html-static/404.html +0 -115
- package/html-static/README.html +0 -599
- package/html-static/Screenshot 2025-08-12 at 21.35.07.png +0 -0
- package/html-static/about-doc-builder.html +0 -568
- package/html-static/css/notion-style.css +0 -2502
- package/html-static/documentation-index.html +0 -548
- package/html-static/guides/authentication-default-change.html +0 -447
- package/html-static/guides/authentication-guide.html +0 -586
- package/html-static/guides/claude-workflow-guide.html +0 -1151
- package/html-static/guides/configuration-guide.html +0 -549
- package/html-static/guides/documentation-standards.html +0 -771
- package/html-static/guides/html-embedding-guide.html +0 -538
- package/html-static/guides/image-modal-guide.html +0 -592
- package/html-static/guides/phosphor-icons-guide.html +0 -661
- package/html-static/guides/private-directory-authentication-troubleshooting.html +0 -632
- package/html-static/guides/private-directory-authentication.html +0 -618
- package/html-static/guides/public-site-deployment.html +0 -508
- package/html-static/guides/search-engine-verification-guide.html +0 -619
- package/html-static/guides/seo-guide.html +0 -738
- package/html-static/guides/seo-optimization-guide.html +0 -964
- package/html-static/guides/supabase-authentication-complete-guide.html +0 -943
- package/html-static/guides/troubleshooting-guide.html +0 -710
- package/html-static/guides/windows-setup-guide.html +0 -936
- package/html-static/image-modal-test.html +0 -395
- package/html-static/index.html +0 -599
- package/html-static/js/main.js +0 -1747
- package/html-static/prompts/Screenshot 2025-08-02 at 08.49.55.png +0 -0
- package/html-static/prompts/beautiful-documentation-design.html +0 -861
- package/html-static/prompts/markdown-document-standards.html +0 -499
- package/html-static/prompts/project-rename-strategy-sasha-publish.html +0 -607
- package/html-static/robots.txt +0 -5
- package/html-static/sitemap.xml +0 -195
- package/html-static/test-questions/how-does-it-work%3F.html +0 -371
- package/html-static/test-questions/step-1%3A%20getting-started.html +0 -366
- package/html-static/test-questions/what-is-the-purpose.html +0 -370
- package/html-static/vercel-cli-setup-guide.html +0 -572
- package/html-static/vercel-first-time-setup-guide.html +0 -531
- package/manage-users.sql +0 -191
- package/migrate-to-domain-auth.sql +0 -47
- package/package/CACHE-BUSTING-GUIDE.md +0 -82
- package/package/CHANGELOG.md +0 -902
- package/package/README.md +0 -248
- package/package/assets/css/notion-style.css +0 -2211
- package/package/assets/js/auth.js +0 -67
- package/package/assets/js/main.js +0 -1565
- package/package/cli.js +0 -764
- package/package/index.js +0 -38
- package/package/knowcode-doc-builder-1.3.15.tgz +0 -0
- package/package/lib/builder.js +0 -32
- package/package/lib/config.js +0 -278
- package/package/lib/core-builder.js +0 -957
- package/package/lib/deploy.js +0 -497
- package/package/lib/dev-server.js +0 -96
- package/package/package.json +0 -34
- package/package/scripts/npx-runner.js +0 -27
- package/package/scripts/setup.js +0 -56
- package/package/test-cache-bust.sh +0 -43
- package/public-config.js +0 -22
- package/public-html/404.html +0 -115
- package/public-html/README.html +0 -149
- package/public-html/css/notion-style.css +0 -2036
- package/public-html/index.html +0 -149
- package/public-html/js/auth.js +0 -67
- package/public-html/js/main.js +0 -1485
- package/quick-test-commands.md +0 -40
- package/recordings/Screenshot 2025-07-24 at 18.22.01.png +0 -0
- package/recordings/mh-ls-22jul.txt +0 -2305
- package/screenshot.png +0 -0
- package/scripts/Screenshot 2025-07-23 at 15.39.41.png +0 -0
- package/setup-database-v2.sql +0 -53
- package/setup-database.sql +0 -41
- package/test-auth-config.js +0 -17
- package/test-cache-bust.sh +0 -43
- package/test-docs/README.md +0 -39
- package/test-html/404.html +0 -115
- package/test-html/README.html +0 -172
- package/test-html/auth.js +0 -97
- package/test-html/css/notion-style.css +0 -2036
- package/test-html/index.html +0 -172
- package/test-html/js/auth.js +0 -97
- package/test-html/js/main.js +0 -1485
- package/test-html/login.html +0 -102
- package/test-html/logout.html +0 -18
- package/update-domain.sql +0 -9
- package/user-access-view.sql +0 -49
- package/user-management/README.md +0 -301
- package/user-management/add-users.sh +0 -776
- package/user-management/create-user.js +0 -65
- package/user-management/users.txt +0 -15
- package/view-all-users.sql +0 -40
- package/wru-auth-config.js +0 -17
package/package/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @knowcode/doc-builder - Programmatic API
|
|
3
|
-
*
|
|
4
|
-
* This module exports functions for use in scripts or other tools
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { build } = require('./lib/builder');
|
|
8
|
-
const { startDevServer } = require('./lib/dev-server');
|
|
9
|
-
const { deployToVercel, setupVercelProject } = require('./lib/deploy');
|
|
10
|
-
const { loadConfig, createDefaultConfig } = require('./lib/config');
|
|
11
|
-
|
|
12
|
-
module.exports = {
|
|
13
|
-
// Main functions
|
|
14
|
-
build,
|
|
15
|
-
startDevServer,
|
|
16
|
-
deployToVercel,
|
|
17
|
-
setupVercelProject,
|
|
18
|
-
|
|
19
|
-
// Config utilities
|
|
20
|
-
loadConfig,
|
|
21
|
-
createDefaultConfig,
|
|
22
|
-
|
|
23
|
-
// Convenience wrapper for common operations
|
|
24
|
-
async buildDocs(configPath = 'doc-builder.config.js', options = {}) {
|
|
25
|
-
const config = await loadConfig(configPath, options);
|
|
26
|
-
return build(config);
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
async deploy(configPath = 'doc-builder.config.js', options = {}) {
|
|
30
|
-
const config = await loadConfig(configPath, options);
|
|
31
|
-
return deployToVercel(config, options.prod);
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
async dev(configPath = 'doc-builder.config.js', options = {}) {
|
|
35
|
-
const config = await loadConfig(configPath, options);
|
|
36
|
-
return startDevServer(config, options.port || 3000);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
Binary file
|
package/package/lib/builder.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const fs = require('fs-extra');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
const { buildDocumentation } = require('./core-builder');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Main build function
|
|
8
|
-
* Now fully self-contained!
|
|
9
|
-
*/
|
|
10
|
-
async function build(config) {
|
|
11
|
-
console.log(chalk.blue(`\n🚀 Building ${config.siteName}...\n`));
|
|
12
|
-
|
|
13
|
-
// Validate config
|
|
14
|
-
if (!config || typeof config !== 'object') {
|
|
15
|
-
throw new Error('Invalid configuration provided to build function');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
// Use the self-contained builder
|
|
20
|
-
await buildDocumentation(config);
|
|
21
|
-
console.log(chalk.green('\n✨ Build complete!\n'));
|
|
22
|
-
} catch (error) {
|
|
23
|
-
console.error(chalk.red('\n❌ Build failed:'), error.message);
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Asset copying is now handled in core-builder.js
|
|
29
|
-
|
|
30
|
-
module.exports = {
|
|
31
|
-
build
|
|
32
|
-
};
|
package/package/lib/config.js
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
const fs = require('fs-extra');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Default configuration
|
|
7
|
-
*/
|
|
8
|
-
const defaultConfig = {
|
|
9
|
-
// Source and output directories
|
|
10
|
-
docsDir: 'docs',
|
|
11
|
-
outputDir: 'html',
|
|
12
|
-
|
|
13
|
-
// Site metadata
|
|
14
|
-
siteName: 'Documentation',
|
|
15
|
-
siteDescription: 'Documentation site built with @knowcode/doc-builder',
|
|
16
|
-
|
|
17
|
-
// Features
|
|
18
|
-
features: {
|
|
19
|
-
authentication: false,
|
|
20
|
-
changelog: true,
|
|
21
|
-
mermaid: true,
|
|
22
|
-
tooltips: true,
|
|
23
|
-
search: false,
|
|
24
|
-
darkMode: true
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
// Authentication (if enabled)
|
|
28
|
-
auth: {
|
|
29
|
-
username: 'admin',
|
|
30
|
-
password: 'password'
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
// Changelog settings
|
|
34
|
-
changelog: {
|
|
35
|
-
daysBack: 14,
|
|
36
|
-
enabled: true
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
// Navigation configuration
|
|
40
|
-
folderOrder: [],
|
|
41
|
-
folderDescriptions: {},
|
|
42
|
-
folderIcons: {},
|
|
43
|
-
|
|
44
|
-
// Deployment
|
|
45
|
-
deployment: {
|
|
46
|
-
platform: 'vercel',
|
|
47
|
-
outputDirectory: 'html'
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Notion-inspired preset - clean, modern documentation style
|
|
53
|
-
*/
|
|
54
|
-
const notionInspiredPreset = {
|
|
55
|
-
docsDir: 'docs',
|
|
56
|
-
outputDir: 'html',
|
|
57
|
-
siteName: 'Documentation', // Clean default name
|
|
58
|
-
siteDescription: 'Transforming complex sales through intelligent automation',
|
|
59
|
-
|
|
60
|
-
features: {
|
|
61
|
-
authentication: true,
|
|
62
|
-
changelog: true,
|
|
63
|
-
mermaid: true,
|
|
64
|
-
tooltips: true,
|
|
65
|
-
search: false,
|
|
66
|
-
darkMode: true
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
auth: {
|
|
70
|
-
username: 'admin',
|
|
71
|
-
password: 'docs2025'
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
changelog: {
|
|
75
|
-
daysBack: 14,
|
|
76
|
-
enabled: true
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
// Folder descriptions from existing code
|
|
80
|
-
folderDescriptions: {
|
|
81
|
-
'product-roadmap': 'Strategic vision, timeline, and feature planning',
|
|
82
|
-
'product-requirements': 'Detailed product specifications, requirements documents, and feature definitions',
|
|
83
|
-
'architecture': 'System design, data flows, and technical infrastructure documentation',
|
|
84
|
-
'system-analysis': 'Comprehensive system analysis, functional requirements, and cross-component documentation',
|
|
85
|
-
'bubble': 'Core application platform - business logic, UI/UX, and user workflows',
|
|
86
|
-
'quickbase': 'Database schema, data management, and backend operations',
|
|
87
|
-
'activecampaign': 'Marketing automation integration and lead management system',
|
|
88
|
-
'juno-signer': 'Document signing service for digital signatures and PDF generation',
|
|
89
|
-
'juno-api-deprecated': 'Legacy API documentation (deprecated, for reference only)',
|
|
90
|
-
'postman': 'API testing tools, collections, and test automation',
|
|
91
|
-
'mcp': 'Model Context Protocol setup and configuration guides',
|
|
92
|
-
'team': 'Team roles, responsibilities, and task assignments',
|
|
93
|
-
'thought-leadership': 'Strategic thinking, industry insights, and future vision',
|
|
94
|
-
'paths': 'Dynamic pathway routing system for insurance applications',
|
|
95
|
-
'testing': 'Testing procedures, checklists, and quality assurance',
|
|
96
|
-
'technical': 'Technical documentation and implementation details',
|
|
97
|
-
'application': 'Application components, data types, and workflows'
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
folderIcons: {
|
|
101
|
-
'root': 'fas fa-home',
|
|
102
|
-
'product-roadmap': 'fas fa-road',
|
|
103
|
-
'product-requirements': 'fas fa-clipboard-list',
|
|
104
|
-
'architecture': 'fas fa-sitemap',
|
|
105
|
-
'system-analysis': 'fas fa-analytics',
|
|
106
|
-
'system': 'fas fa-cogs',
|
|
107
|
-
'bubble': 'fas fa-bubble',
|
|
108
|
-
'quickbase': 'fas fa-database',
|
|
109
|
-
'activecampaign': 'fas fa-envelope',
|
|
110
|
-
'juno-signer': 'fas fa-signature',
|
|
111
|
-
'juno-api-deprecated': 'fas fa-archive',
|
|
112
|
-
'postman': 'fas fa-flask',
|
|
113
|
-
'mcp': 'fas fa-puzzle-piece',
|
|
114
|
-
'team': 'fas fa-users',
|
|
115
|
-
'thought-leadership': 'fas fa-lightbulb',
|
|
116
|
-
'middleware': 'fas fa-layer-group',
|
|
117
|
-
'paths': 'fas fa-route',
|
|
118
|
-
'testing': 'fas fa-vial',
|
|
119
|
-
'juno-api': 'fas fa-plug'
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
folderOrder: [
|
|
123
|
-
'product-roadmap',
|
|
124
|
-
'product-requirements',
|
|
125
|
-
'architecture',
|
|
126
|
-
'system-analysis',
|
|
127
|
-
'bubble',
|
|
128
|
-
'quickbase',
|
|
129
|
-
'activecampaign',
|
|
130
|
-
'juno-signer',
|
|
131
|
-
'juno-api-deprecated',
|
|
132
|
-
'postman',
|
|
133
|
-
'mcp',
|
|
134
|
-
'team',
|
|
135
|
-
'thought-leadership'
|
|
136
|
-
]
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Load configuration
|
|
141
|
-
*/
|
|
142
|
-
async function loadConfig(configPath, options = {}) {
|
|
143
|
-
let config = { ...defaultConfig };
|
|
144
|
-
|
|
145
|
-
// Apply preset if specified
|
|
146
|
-
if (options.preset === 'notion-inspired') {
|
|
147
|
-
config = { ...config, ...notionInspiredPreset };
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Load custom config file if it exists
|
|
151
|
-
const customConfigPath = path.join(process.cwd(), configPath);
|
|
152
|
-
if (fs.existsSync(customConfigPath)) {
|
|
153
|
-
try {
|
|
154
|
-
const customConfig = require(customConfigPath);
|
|
155
|
-
config = { ...config, ...customConfig };
|
|
156
|
-
|
|
157
|
-
// Handle alternative config formats
|
|
158
|
-
if (customConfig.site) {
|
|
159
|
-
// Map site.title to siteName
|
|
160
|
-
if (customConfig.site.title) {
|
|
161
|
-
config.siteName = customConfig.site.title;
|
|
162
|
-
console.log(chalk.gray(` Using site name: ${config.siteName}`));
|
|
163
|
-
}
|
|
164
|
-
if (customConfig.site.description) {
|
|
165
|
-
config.siteDescription = customConfig.site.description;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Map input/output to docsDir/outputDir
|
|
170
|
-
if (customConfig.input) {
|
|
171
|
-
config.docsDir = customConfig.input;
|
|
172
|
-
}
|
|
173
|
-
if (customConfig.output) {
|
|
174
|
-
config.outputDir = customConfig.output;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
console.log(chalk.gray(`Loaded config from ${configPath}`));
|
|
178
|
-
} catch (error) {
|
|
179
|
-
console.warn(chalk.yellow(`Warning: Failed to load config file: ${error.message}`));
|
|
180
|
-
}
|
|
181
|
-
} else if (!options.preset && !options.legacy) {
|
|
182
|
-
console.log(chalk.gray('No config file found, using defaults'));
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// Apply CLI options (these override config file)
|
|
186
|
-
if (options.input) {
|
|
187
|
-
config.docsDir = options.input;
|
|
188
|
-
}
|
|
189
|
-
if (options.output) {
|
|
190
|
-
config.outputDir = options.output;
|
|
191
|
-
}
|
|
192
|
-
if (options.auth === false) {
|
|
193
|
-
config.features.authentication = false;
|
|
194
|
-
}
|
|
195
|
-
if (options.changelog === false) {
|
|
196
|
-
config.features.changelog = false;
|
|
197
|
-
config.changelog.enabled = false;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// Legacy mode - auto-detect structure
|
|
201
|
-
if (options.legacy) {
|
|
202
|
-
const docsPath = path.join(process.cwd(), 'docs');
|
|
203
|
-
const htmlPath = path.join(process.cwd(), 'html');
|
|
204
|
-
|
|
205
|
-
if (fs.existsSync(docsPath) && fs.existsSync(htmlPath)) {
|
|
206
|
-
console.log(chalk.gray('Legacy mode: detected docs/ and html/ structure'));
|
|
207
|
-
config.docsDir = 'docs';
|
|
208
|
-
config.outputDir = 'html';
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// Validate paths - but be lenient for deploy command
|
|
213
|
-
const docsPath = path.join(process.cwd(), config.docsDir);
|
|
214
|
-
if (!fs.existsSync(docsPath)) {
|
|
215
|
-
console.warn(chalk.yellow(`Warning: Documentation directory not found: ${config.docsDir}`));
|
|
216
|
-
console.log(chalk.gray(`Create it with: mkdir ${config.docsDir} && echo "# Documentation" > ${config.docsDir}/README.md`));
|
|
217
|
-
// Don't throw error - let commands handle missing directories appropriately
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return config;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Create default configuration
|
|
225
|
-
*/
|
|
226
|
-
async function createDefaultConfig() {
|
|
227
|
-
const answers = await require('prompts')([
|
|
228
|
-
{
|
|
229
|
-
type: 'text',
|
|
230
|
-
name: 'siteName',
|
|
231
|
-
message: 'Site name:',
|
|
232
|
-
initial: 'My Documentation'
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
type: 'text',
|
|
236
|
-
name: 'siteDescription',
|
|
237
|
-
message: 'Site description:',
|
|
238
|
-
initial: 'Documentation for my project'
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
type: 'confirm',
|
|
242
|
-
name: 'authentication',
|
|
243
|
-
message: 'Enable authentication?',
|
|
244
|
-
initial: false
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
type: prev => prev ? 'text' : null,
|
|
248
|
-
name: 'authUsername',
|
|
249
|
-
message: 'Authentication username:',
|
|
250
|
-
initial: 'admin'
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
type: prev => prev ? 'password' : null,
|
|
254
|
-
name: 'authPassword',
|
|
255
|
-
message: 'Authentication password:',
|
|
256
|
-
initial: 'password'
|
|
257
|
-
}
|
|
258
|
-
]);
|
|
259
|
-
|
|
260
|
-
const config = { ...defaultConfig };
|
|
261
|
-
config.siteName = answers.siteName;
|
|
262
|
-
config.siteDescription = answers.siteDescription;
|
|
263
|
-
config.features.authentication = answers.authentication;
|
|
264
|
-
|
|
265
|
-
if (answers.authentication) {
|
|
266
|
-
config.auth.username = answers.authUsername;
|
|
267
|
-
config.auth.password = answers.authPassword;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return config;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
module.exports = {
|
|
274
|
-
defaultConfig,
|
|
275
|
-
notionInspiredPreset,
|
|
276
|
-
loadConfig,
|
|
277
|
-
createDefaultConfig
|
|
278
|
-
};
|