@knowcode/doc-builder 1.4.21 → 1.4.24
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/.claude/settings.local.json +2 -1
- package/CHANGELOG.md +38 -0
- package/README.md +44 -0
- package/assets/css/notion-style.css +3 -6
- package/cli.js +27 -8
- package/html/README.html +4 -2
- package/html/claude-workflow-guide.html +4 -2
- package/html/css/notion-style.css +3 -6
- package/html/documentation-index.html +31 -5
- package/html/guides/authentication-guide.html +377 -0
- package/html/guides/document-standards.html +2 -1
- package/html/guides/documentation-standards.html +519 -0
- package/html/guides/troubleshooting-guide.html +448 -0
- package/html/index.html +4 -2
- package/lib/deploy.js +50 -2
- package/package.json +2 -2
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<meta name="description" content="Documentation site built with @knowcode/doc-builder">
|
|
7
|
+
<title>Troubleshooting Guide for @knowcode/doc-builder - Documentation</title>
|
|
8
|
+
|
|
9
|
+
<!-- Fonts -->
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
11
|
+
|
|
12
|
+
<!-- Icons -->
|
|
13
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
|
14
|
+
|
|
15
|
+
<!-- Mermaid -->
|
|
16
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
|
|
17
|
+
|
|
18
|
+
<!-- Styles -->
|
|
19
|
+
<link rel="stylesheet" href="/css/notion-style.css">
|
|
20
|
+
|
|
21
|
+
<!-- Favicon -->
|
|
22
|
+
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>📚</text></svg>">
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<!-- Header -->
|
|
26
|
+
<header class="header">
|
|
27
|
+
<div class="header-content">
|
|
28
|
+
<a href="/index.html" class="logo">Documentation</a>
|
|
29
|
+
|
|
30
|
+
<div class="header-actions">
|
|
31
|
+
<div class="deployment-info">
|
|
32
|
+
<span class="deployment-date" title="Built with doc-builder v1.4.23">Last updated: Jul 21, 2025, 07:42 PM UTC</span>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
|
|
38
|
+
<i class="fas fa-moon"></i>
|
|
39
|
+
</button>
|
|
40
|
+
|
|
41
|
+
<button id="menu-toggle" class="menu-toggle" aria-label="Toggle menu">
|
|
42
|
+
<i class="fas fa-bars"></i>
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</header>
|
|
47
|
+
|
|
48
|
+
<!-- Preview Banner -->
|
|
49
|
+
<div id="preview-banner" class="preview-banner">
|
|
50
|
+
<div class="banner-content">
|
|
51
|
+
<i class="fas fa-exclamation-triangle banner-icon"></i>
|
|
52
|
+
<span class="banner-text">This documentation is a preview version - some content may be incomplete</span>
|
|
53
|
+
<button id="dismiss-banner" class="banner-dismiss" aria-label="Dismiss banner">
|
|
54
|
+
<i class="fas fa-times"></i>
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<!-- Breadcrumbs -->
|
|
60
|
+
<nav class="breadcrumbs" id="breadcrumbs">
|
|
61
|
+
<!-- Breadcrumbs will be generated by JavaScript -->
|
|
62
|
+
</nav>
|
|
63
|
+
|
|
64
|
+
<!-- Main Content -->
|
|
65
|
+
<div class="main-wrapper">
|
|
66
|
+
<!-- Sidebar -->
|
|
67
|
+
<aside class="sidebar">
|
|
68
|
+
<div class="sidebar-header">
|
|
69
|
+
<div class="filter-box">
|
|
70
|
+
<input type="text" placeholder="Filter items..." class="filter-input" id="nav-filter">
|
|
71
|
+
<i class="fas fa-search filter-icon"></i>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<nav class="navigation">
|
|
75
|
+
|
|
76
|
+
<div class="nav-section" data-level="0">
|
|
77
|
+
<a class="nav-title" href="/README.html" >
|
|
78
|
+
<i class="fas fa-home"></i> Documentation
|
|
79
|
+
</a>
|
|
80
|
+
<div class="nav-content" >
|
|
81
|
+
<a href="/README.html" class="nav-item" data-tooltip="@knowcode/doc-builder."><i class="fas fa-file-alt"></i> Overview</a>
|
|
82
|
+
<a href="/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
|
|
83
|
+
<a href="/documentation-index.html" class="nav-item" data-tooltip="This directory contains additional documentation for the @knowcode/doc-builder project, organized by topic and purpose."><i class="fas fa-file-alt"></i> Documentation Index</a></div></div>
|
|
84
|
+
<div class="nav-section" data-level="1">
|
|
85
|
+
<a class="nav-title collapsible expanded" href="#" data-target="nav-guides-1" >
|
|
86
|
+
<i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Guides
|
|
87
|
+
</a>
|
|
88
|
+
<div class="nav-content" id="nav-guides-1">
|
|
89
|
+
<a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="This guide explains how to configure and use the built-in authentication feature in @knowcode/doc-builder to protect your documentation with basic..."><i class="fas fa-file-alt"></i> Authentication Guide</a>
|
|
90
|
+
<a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
|
|
91
|
+
<a href="/guides/troubleshooting-guide.html" class="nav-item active" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a></div></div>
|
|
92
|
+
</nav>
|
|
93
|
+
<div class="resize-handle"></div>
|
|
94
|
+
</aside>
|
|
95
|
+
|
|
96
|
+
<!-- Content Area -->
|
|
97
|
+
<main class="content">
|
|
98
|
+
<div class="content-inner">
|
|
99
|
+
<h1>Troubleshooting Guide for @knowcode/doc-builder</h1>
|
|
100
|
+
<p><strong>Generated</strong>: 2025-07-21 19:15 UTC<br><strong>Status</strong>: Complete<br><strong>Verified</strong>: ✅</p>
|
|
101
|
+
<h2>Overview</h2>
|
|
102
|
+
<p>This guide helps you resolve common issues when using @knowcode/doc-builder. Most problems have simple solutions, and this guide covers the most frequent ones.</p>
|
|
103
|
+
<h2>NPX Cache Issues</h2>
|
|
104
|
+
<h3>Problem</h3>
|
|
105
|
+
<p>The most common issue users face is npx caching an older version of doc-builder.</p>
|
|
106
|
+
<p><strong>Symptoms:</strong></p>
|
|
107
|
+
<ul>
|
|
108
|
+
<li>❌ Running <code>npx @knowcode/doc-builder</code> shows an old version number</li>
|
|
109
|
+
<li>❌ New features aren't available despite updating</li>
|
|
110
|
+
<li>❌ Bug fixes don't appear to be working</li>
|
|
111
|
+
<li>❌ Version shown doesn't match npm registry</li>
|
|
112
|
+
</ul>
|
|
113
|
+
<p><strong>Example:</strong></p>
|
|
114
|
+
<pre><code class="language-bash">$ npx @knowcode/doc-builder --version
|
|
115
|
+
1.4.11 # Old version!
|
|
116
|
+
|
|
117
|
+
# But npm shows:
|
|
118
|
+
$ npm view @knowcode/doc-builder version
|
|
119
|
+
1.4.22 # Latest version
|
|
120
|
+
</code></pre>
|
|
121
|
+
<h3>Solution</h3>
|
|
122
|
+
<pre><code class="language-bash"># Method 1: Clear the npx cache
|
|
123
|
+
npx clear-npx-cache
|
|
124
|
+
|
|
125
|
+
# Method 2: Force the latest version
|
|
126
|
+
npx @knowcode/doc-builder@latest
|
|
127
|
+
|
|
128
|
+
# Method 3: Specify exact version
|
|
129
|
+
npx @knowcode/doc-builder@1.4.22
|
|
130
|
+
</code></pre>
|
|
131
|
+
<h3>Why This Happens</h3>
|
|
132
|
+
<div class="mermaid-wrapper">
|
|
133
|
+
<div class="mermaid-title">Diagram</div>
|
|
134
|
+
<div class="mermaid">graph TD
|
|
135
|
+
A[Run npx @knowcode/doc-builder] --> B{Package in cache?}
|
|
136
|
+
B -->|Yes| C[Use cached version]
|
|
137
|
+
B -->|No| D[Download from npm]
|
|
138
|
+
C --> E[May be outdated!]
|
|
139
|
+
D --> F[Latest version]
|
|
140
|
+
|
|
141
|
+
style C fill:#ffcdd2
|
|
142
|
+
style E fill:#ffcdd2
|
|
143
|
+
style F fill:#c8e6c9</div>
|
|
144
|
+
</div>
|
|
145
|
+
<p>NPX caches packages to improve performance, but this cache doesn't automatically update when new versions are published.</p>
|
|
146
|
+
<h3>Prevention</h3>
|
|
147
|
+
<ol>
|
|
148
|
+
<li><p><strong>Always use @latest for current version:</strong></p>
|
|
149
|
+
<pre><code class="language-bash">npx @knowcode/doc-builder@latest deploy
|
|
150
|
+
</code></pre>
|
|
151
|
+
</li>
|
|
152
|
+
<li><p><strong>For development, install globally:</strong></p>
|
|
153
|
+
<pre><code class="language-bash">npm install -g @knowcode/doc-builder
|
|
154
|
+
doc-builder deploy
|
|
155
|
+
</code></pre>
|
|
156
|
+
</li>
|
|
157
|
+
<li><p><strong>For projects, install as dev dependency:</strong></p>
|
|
158
|
+
<pre><code class="language-bash">npm install --save-dev @knowcode/doc-builder
|
|
159
|
+
npx doc-builder deploy # Uses local version
|
|
160
|
+
</code></pre>
|
|
161
|
+
</li>
|
|
162
|
+
</ol>
|
|
163
|
+
<h2>Build Issues</h2>
|
|
164
|
+
<h3>No Markdown Files Found</h3>
|
|
165
|
+
<p><strong>Error:</strong> <code>No markdown files found in docs directory</code></p>
|
|
166
|
+
<p><strong>Solutions:</strong></p>
|
|
167
|
+
<ol>
|
|
168
|
+
<li><p><strong>Check directory structure:</strong></p>
|
|
169
|
+
<pre><code class="language-bash">ls -la docs/
|
|
170
|
+
# Should show .md files
|
|
171
|
+
</code></pre>
|
|
172
|
+
</li>
|
|
173
|
+
<li><p><strong>Ensure correct file extensions:</strong></p>
|
|
174
|
+
<ul>
|
|
175
|
+
<li>✅ <code>README.md</code></li>
|
|
176
|
+
<li>✅ <code>guide.md</code></li>
|
|
177
|
+
<li>❌ <code>README.txt</code></li>
|
|
178
|
+
<li>❌ <code>guide.markdown</code></li>
|
|
179
|
+
</ul>
|
|
180
|
+
</li>
|
|
181
|
+
<li><p><strong>Use custom input directory:</strong></p>
|
|
182
|
+
<pre><code class="language-bash">npx @knowcode/doc-builder build --input my-docs
|
|
183
|
+
</code></pre>
|
|
184
|
+
</li>
|
|
185
|
+
</ol>
|
|
186
|
+
<h3>Build Output Missing</h3>
|
|
187
|
+
<p><strong>Problem:</strong> HTML files not generated</p>
|
|
188
|
+
<p><strong>Check:</strong></p>
|
|
189
|
+
<ol>
|
|
190
|
+
<li>Look in <code>html/</code> directory (default output)</li>
|
|
191
|
+
<li>Check for build errors in console</li>
|
|
192
|
+
<li>Verify markdown files are valid</li>
|
|
193
|
+
</ol>
|
|
194
|
+
<p><strong>Solution:</strong></p>
|
|
195
|
+
<pre><code class="language-bash"># Clean build
|
|
196
|
+
rm -rf html/
|
|
197
|
+
npx @knowcode/doc-builder build
|
|
198
|
+
|
|
199
|
+
# Check output
|
|
200
|
+
ls -la html/
|
|
201
|
+
</code></pre>
|
|
202
|
+
<h2>Deployment Issues</h2>
|
|
203
|
+
<h3>Vercel CLI Not Found</h3>
|
|
204
|
+
<p><strong>Error:</strong> <code>Vercel CLI not found!</code></p>
|
|
205
|
+
<p><strong>Solution:</strong></p>
|
|
206
|
+
<pre><code class="language-bash"># Install Vercel CLI globally
|
|
207
|
+
npm install -g vercel
|
|
208
|
+
|
|
209
|
+
# Verify installation
|
|
210
|
+
vercel --version
|
|
211
|
+
</code></pre>
|
|
212
|
+
<h3>Deployment Fails</h3>
|
|
213
|
+
<p><strong>Common causes:</strong></p>
|
|
214
|
+
<ol>
|
|
215
|
+
<li><p><strong>Root Directory Issue</strong></p>
|
|
216
|
+
<pre><code class="language-bash"># Reset Vercel configuration
|
|
217
|
+
npx @knowcode/doc-builder reset-vercel
|
|
218
|
+
</code></pre>
|
|
219
|
+
</li>
|
|
220
|
+
<li><p><strong>Build Not Complete</strong></p>
|
|
221
|
+
<pre><code class="language-bash"># Build before deploy
|
|
222
|
+
npx @knowcode/doc-builder build
|
|
223
|
+
npx @knowcode/doc-builder deploy
|
|
224
|
+
</code></pre>
|
|
225
|
+
</li>
|
|
226
|
+
<li><p><strong>Wrong Directory</strong></p>
|
|
227
|
+
<ul>
|
|
228
|
+
<li>Ensure you're in project root</li>
|
|
229
|
+
<li>Check that <code>html/</code> directory exists</li>
|
|
230
|
+
</ul>
|
|
231
|
+
</li>
|
|
232
|
+
</ol>
|
|
233
|
+
<h3>Wrong Production URL Displayed</h3>
|
|
234
|
+
<p><strong>Problem:</strong> Deployment shows incorrect URL (e.g., <code>doc.vercel.app</code> instead of <code>doc-builder-delta.vercel.app</code>)</p>
|
|
235
|
+
<p><strong>Fixed in:</strong> v1.4.22+</p>
|
|
236
|
+
<p><strong>Solution:</strong></p>
|
|
237
|
+
<pre><code class="language-bash"># Update to latest version
|
|
238
|
+
npx clear-npx-cache
|
|
239
|
+
npx @knowcode/doc-builder@latest deploy
|
|
240
|
+
</code></pre>
|
|
241
|
+
<h2>Configuration Issues</h2>
|
|
242
|
+
<h3>Config File Not Loading</h3>
|
|
243
|
+
<p><strong>Symptoms:</strong></p>
|
|
244
|
+
<ul>
|
|
245
|
+
<li>Default settings used instead of custom config</li>
|
|
246
|
+
<li>Site name shows "Documentation"</li>
|
|
247
|
+
</ul>
|
|
248
|
+
<p><strong>Solutions:</strong></p>
|
|
249
|
+
<ol>
|
|
250
|
+
<li><p><strong>Check file name:</strong></p>
|
|
251
|
+
<ul>
|
|
252
|
+
<li>✅ <code>doc-builder.config.js</code></li>
|
|
253
|
+
<li>❌ <code>docbuilder.config.js</code></li>
|
|
254
|
+
<li>❌ <code>doc-builder-config.js</code></li>
|
|
255
|
+
</ul>
|
|
256
|
+
</li>
|
|
257
|
+
<li><p><strong>Verify export format:</strong></p>
|
|
258
|
+
<pre><code class="language-javascript">// Correct
|
|
259
|
+
module.exports = {
|
|
260
|
+
siteName: 'My Docs'
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
// Wrong
|
|
264
|
+
export default {
|
|
265
|
+
siteName: 'My Docs'
|
|
266
|
+
};
|
|
267
|
+
</code></pre>
|
|
268
|
+
</li>
|
|
269
|
+
<li><p><strong>Use explicit config path:</strong></p>
|
|
270
|
+
<pre><code class="language-bash">npx @knowcode/doc-builder build --config ./my-config.js
|
|
271
|
+
</code></pre>
|
|
272
|
+
</li>
|
|
273
|
+
</ol>
|
|
274
|
+
<h2>Authentication Issues</h2>
|
|
275
|
+
<h3>Login Page Not Working</h3>
|
|
276
|
+
<p><strong>Check:</strong></p>
|
|
277
|
+
<ol>
|
|
278
|
+
<li>Authentication enabled in config</li>
|
|
279
|
+
<li>Credentials match exactly (case-sensitive)</li>
|
|
280
|
+
<li>Cookies enabled in browser</li>
|
|
281
|
+
</ol>
|
|
282
|
+
<p><strong>Debug:</strong></p>
|
|
283
|
+
<pre><code class="language-javascript">// doc-builder.config.js
|
|
284
|
+
module.exports = {
|
|
285
|
+
features: {
|
|
286
|
+
authentication: true // Must be true
|
|
287
|
+
},
|
|
288
|
+
auth: {
|
|
289
|
+
username: 'admin', // Case sensitive!
|
|
290
|
+
password: 'secret' // Case sensitive!
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
</code></pre>
|
|
294
|
+
<h2>Styling Issues</h2>
|
|
295
|
+
<h3>CSS Not Loading</h3>
|
|
296
|
+
<p><strong>Symptoms:</strong></p>
|
|
297
|
+
<ul>
|
|
298
|
+
<li>Plain HTML without styling</li>
|
|
299
|
+
<li>404 errors for CSS files</li>
|
|
300
|
+
</ul>
|
|
301
|
+
<p><strong>Fixed in:</strong> v1.2.0+</p>
|
|
302
|
+
<p><strong>Solutions:</strong></p>
|
|
303
|
+
<ol>
|
|
304
|
+
<li>Update to latest version</li>
|
|
305
|
+
<li>Check browser console for 404 errors</li>
|
|
306
|
+
<li>Verify <code>html/css/</code> directory exists after build</li>
|
|
307
|
+
</ol>
|
|
308
|
+
<h3>Dark Mode Not Working</h3>
|
|
309
|
+
<p><strong>Check:</strong></p>
|
|
310
|
+
<ol>
|
|
311
|
+
<li>Feature enabled in config</li>
|
|
312
|
+
<li>Browser supports CSS variables</li>
|
|
313
|
+
<li>No conflicting styles</li>
|
|
314
|
+
</ol>
|
|
315
|
+
<h2>Development Server Issues</h2>
|
|
316
|
+
<h3>Port Already in Use</h3>
|
|
317
|
+
<p><strong>Error:</strong> <code>Port 3000 is already in use</code></p>
|
|
318
|
+
<p><strong>Solutions:</strong></p>
|
|
319
|
+
<pre><code class="language-bash"># Use different port
|
|
320
|
+
npx @knowcode/doc-builder dev --port 8080
|
|
321
|
+
|
|
322
|
+
# Find process using port
|
|
323
|
+
lsof -i :3000 # macOS/Linux
|
|
324
|
+
netstat -ano | findstr :3000 # Windows
|
|
325
|
+
</code></pre>
|
|
326
|
+
<h3>Hot Reload Not Working</h3>
|
|
327
|
+
<p><strong>Common causes:</strong></p>
|
|
328
|
+
<ol>
|
|
329
|
+
<li>File system events not supported</li>
|
|
330
|
+
<li>Saving files outside watched directory</li>
|
|
331
|
+
<li>Browser cache</li>
|
|
332
|
+
</ol>
|
|
333
|
+
<p><strong>Solutions:</strong></p>
|
|
334
|
+
<ul>
|
|
335
|
+
<li>Hard refresh browser (Ctrl/Cmd + Shift + R)</li>
|
|
336
|
+
<li>Check that files are in <code>docs/</code> directory</li>
|
|
337
|
+
<li>Restart dev server</li>
|
|
338
|
+
</ul>
|
|
339
|
+
<h2>Platform-Specific Issues</h2>
|
|
340
|
+
<h3>Windows Path Issues</h3>
|
|
341
|
+
<p><strong>Problem:</strong> Paths with backslashes cause errors</p>
|
|
342
|
+
<p><strong>Solution:</strong> Use forward slashes or escape backslashes:</p>
|
|
343
|
+
<pre><code class="language-javascript">// Bad
|
|
344
|
+
docsDir: 'C:\Users\me\docs'
|
|
345
|
+
|
|
346
|
+
// Good
|
|
347
|
+
docsDir: 'C:/Users/me/docs'
|
|
348
|
+
// Or
|
|
349
|
+
docsDir: 'C:\\Users\\me\\docs'
|
|
350
|
+
</code></pre>
|
|
351
|
+
<h3>macOS Permission Issues</h3>
|
|
352
|
+
<p><strong>Error:</strong> <code>EACCES: permission denied</code></p>
|
|
353
|
+
<p><strong>Solutions:</strong></p>
|
|
354
|
+
<ol>
|
|
355
|
+
<li>Don't use sudo with npm/npx</li>
|
|
356
|
+
<li>Fix npm permissions:<pre><code class="language-bash">mkdir ~/.npm-global
|
|
357
|
+
npm config set prefix '~/.npm-global'
|
|
358
|
+
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
|
|
359
|
+
source ~/.zshrc
|
|
360
|
+
</code></pre>
|
|
361
|
+
</li>
|
|
362
|
+
</ol>
|
|
363
|
+
<h2>Getting Help</h2>
|
|
364
|
+
<h3>Debug Information</h3>
|
|
365
|
+
<p>When reporting issues, include:</p>
|
|
366
|
+
<ol>
|
|
367
|
+
<li><p><strong>Version information:</strong></p>
|
|
368
|
+
<pre><code class="language-bash">npx @knowcode/doc-builder --version
|
|
369
|
+
node --version
|
|
370
|
+
npm --version
|
|
371
|
+
</code></pre>
|
|
372
|
+
</li>
|
|
373
|
+
<li><p><strong>Error messages:</strong> Full error output</p>
|
|
374
|
+
</li>
|
|
375
|
+
<li><p><strong>Configuration:</strong> Your <code>doc-builder.config.js</code> (remove passwords)</p>
|
|
376
|
+
</li>
|
|
377
|
+
<li><p><strong>Directory structure:</strong></p>
|
|
378
|
+
<pre><code class="language-bash">tree -L 2 # or ls -la
|
|
379
|
+
</code></pre>
|
|
380
|
+
</li>
|
|
381
|
+
</ol>
|
|
382
|
+
<h3>Support Channels</h3>
|
|
383
|
+
<ol>
|
|
384
|
+
<li><strong>GitHub Issues:</strong> Report bugs and feature requests</li>
|
|
385
|
+
<li><strong>npm Page:</strong> Check for updates and documentation</li>
|
|
386
|
+
<li><strong>This Guide:</strong> Reference for common problems</li>
|
|
387
|
+
</ol>
|
|
388
|
+
<h2>Quick Reference</h2>
|
|
389
|
+
<table>
|
|
390
|
+
<thead>
|
|
391
|
+
<tr>
|
|
392
|
+
<th>Problem</th>
|
|
393
|
+
<th>Solution</th>
|
|
394
|
+
</tr>
|
|
395
|
+
</thead>
|
|
396
|
+
<tbody><tr>
|
|
397
|
+
<td>Old version running</td>
|
|
398
|
+
<td><code>npx clear-npx-cache</code></td>
|
|
399
|
+
</tr>
|
|
400
|
+
<tr>
|
|
401
|
+
<td>Vercel deploy fails</td>
|
|
402
|
+
<td><code>npx @knowcode/doc-builder reset-vercel</code></td>
|
|
403
|
+
</tr>
|
|
404
|
+
<tr>
|
|
405
|
+
<td>No markdown found</td>
|
|
406
|
+
<td>Check <code>docs/</code> directory exists</td>
|
|
407
|
+
</tr>
|
|
408
|
+
<tr>
|
|
409
|
+
<td>CSS not loading</td>
|
|
410
|
+
<td>Update to latest version</td>
|
|
411
|
+
</tr>
|
|
412
|
+
<tr>
|
|
413
|
+
<td>Port in use</td>
|
|
414
|
+
<td><code>--port 8080</code></td>
|
|
415
|
+
</tr>
|
|
416
|
+
<tr>
|
|
417
|
+
<td>Config not loading</td>
|
|
418
|
+
<td>Check filename and format</td>
|
|
419
|
+
</tr>
|
|
420
|
+
</tbody></table>
|
|
421
|
+
<hr>
|
|
422
|
+
<h2>Document History</h2>
|
|
423
|
+
<table>
|
|
424
|
+
<thead>
|
|
425
|
+
<tr>
|
|
426
|
+
<th>Date</th>
|
|
427
|
+
<th>Version</th>
|
|
428
|
+
<th>Author</th>
|
|
429
|
+
<th>Changes</th>
|
|
430
|
+
</tr>
|
|
431
|
+
</thead>
|
|
432
|
+
<tbody><tr>
|
|
433
|
+
<td>2025-07-21</td>
|
|
434
|
+
<td>1.0</td>
|
|
435
|
+
<td>System</td>
|
|
436
|
+
<td>Initial troubleshooting guide</td>
|
|
437
|
+
</tr>
|
|
438
|
+
</tbody></table>
|
|
439
|
+
|
|
440
|
+
</div>
|
|
441
|
+
</main>
|
|
442
|
+
</div>
|
|
443
|
+
|
|
444
|
+
<!-- Scripts -->
|
|
445
|
+
<script src="/js/main.js"></script>
|
|
446
|
+
|
|
447
|
+
</body>
|
|
448
|
+
</html>
|
package/html/index.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<div class="header-actions">
|
|
31
31
|
<div class="deployment-info">
|
|
32
|
-
<span class="deployment-date" title="Built with doc-builder v1.4.
|
|
32
|
+
<span class="deployment-date" title="Built with doc-builder v1.4.23">Last updated: Jul 21, 2025, 07:42 PM UTC</span>
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
|
|
@@ -86,7 +86,9 @@
|
|
|
86
86
|
<i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Guides
|
|
87
87
|
</a>
|
|
88
88
|
<div class="nav-content" id="nav-guides-1">
|
|
89
|
-
<a href="/guides/
|
|
89
|
+
<a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="This guide explains how to configure and use the built-in authentication feature in @knowcode/doc-builder to protect your documentation with basic..."><i class="fas fa-file-alt"></i> Authentication Guide</a>
|
|
90
|
+
<a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
|
|
91
|
+
<a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a></div></div>
|
|
90
92
|
</nav>
|
|
91
93
|
<div class="resize-handle"></div>
|
|
92
94
|
</aside>
|
package/lib/deploy.js
CHANGED
|
@@ -280,9 +280,57 @@ async function deployToVercel(config, isProd = false) {
|
|
|
280
280
|
process.stderr.write(data.toString());
|
|
281
281
|
});
|
|
282
282
|
|
|
283
|
-
vercelProcess.on('close', (code) => {
|
|
283
|
+
vercelProcess.on('close', async (code) => {
|
|
284
284
|
if (code === 0) {
|
|
285
|
-
|
|
285
|
+
// Try to get the production URL from Vercel CLI
|
|
286
|
+
try {
|
|
287
|
+
const { execSync } = require('child_process');
|
|
288
|
+
const projectInfo = execSync('vercel project ls', {
|
|
289
|
+
cwd: outputPath,
|
|
290
|
+
encoding: 'utf8',
|
|
291
|
+
stdio: ['pipe', 'pipe', 'ignore']
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
// Try to determine the project name from the deployment URL or .vercel/project.json
|
|
295
|
+
let projectName = null;
|
|
296
|
+
|
|
297
|
+
// First try to get from .vercel/project.json
|
|
298
|
+
try {
|
|
299
|
+
const projectJsonPath = path.join(outputPath, '.vercel', 'project.json');
|
|
300
|
+
if (fs.existsSync(projectJsonPath)) {
|
|
301
|
+
const projectData = fs.readJsonSync(projectJsonPath);
|
|
302
|
+
// Get project name from Vercel API if needed
|
|
303
|
+
const projectId = projectData.projectId;
|
|
304
|
+
if (projectId) {
|
|
305
|
+
// For now, try to extract from deployment URL
|
|
306
|
+
const deployMatch = deployUrl.match(/https:\/\/([^-]+)/);
|
|
307
|
+
if (deployMatch) {
|
|
308
|
+
projectName = deployMatch[1];
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
} catch (e) {
|
|
313
|
+
// Ignore errors reading project.json
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Extract the production URL for the current project
|
|
317
|
+
const lines = projectInfo.split('\n');
|
|
318
|
+
for (const line of lines) {
|
|
319
|
+
// Look for project by checking if the line contains the deployment URL domain
|
|
320
|
+
const urlMatch = line.match(/https:\/\/[^\s]+\.vercel\.app/);
|
|
321
|
+
if (urlMatch && (
|
|
322
|
+
(projectName && line.toLowerCase().includes(projectName)) ||
|
|
323
|
+
line.includes(deployUrl.split('.')[0].split('//')[1])
|
|
324
|
+
)) {
|
|
325
|
+
resolve({ deployUrl, productionUrl: urlMatch[0] });
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
} catch (err) {
|
|
330
|
+
// Fallback if we can't get project info
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
resolve({ deployUrl, productionUrl: null });
|
|
286
334
|
} else {
|
|
287
335
|
reject(new Error(`Vercel deployment failed with code ${code}`));
|
|
288
336
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knowcode/doc-builder",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.24",
|
|
4
4
|
"description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"author": "KnowCode",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@knowcode/doc-builder": "^1.4.
|
|
24
|
+
"@knowcode/doc-builder": "^1.4.21",
|
|
25
25
|
"chalk": "^4.1.2",
|
|
26
26
|
"commander": "^11.0.0",
|
|
27
27
|
"fs-extra": "^11.2.0",
|