@knowcode/doc-builder 1.1.3 → 1.1.4

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/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ All notable changes to @knowcode/doc-builder will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.4] - 2025-01-19
9
+
10
+ ### Fixed
11
+ - Removed deprecated --no-clipboard option
12
+ - Fixed 404 errors with better index.html handling
13
+ - Added fallback index.html when README.html doesn't exist
14
+ - Production deployment now correctly uses --prod flag
15
+
16
+ ### Added
17
+ - Auto-generated index.html with file listing if no README
18
+ - Better logging during deployment preparation
19
+ - Console messages when creating index.html
20
+
21
+ ### Changed
22
+ - Simplified deployment arguments
23
+ - Cleaner deployment command without unnecessary flags
24
+
8
25
  ## [1.1.3] - 2025-01-19
9
26
 
10
27
  ### Fixed
package/lib/deploy.js CHANGED
@@ -187,11 +187,7 @@ async function deployToVercel(config, isProd = false) {
187
187
  }
188
188
 
189
189
  // Deploy command with explicit build settings
190
- // Override any project settings that might be causing issues
191
- const deployArgs = [
192
- '--build-env', 'VERCEL_BUILD_OUTPUT_DIRECTORY=.',
193
- '--no-clipboard'
194
- ];
190
+ const deployArgs = [];
195
191
 
196
192
  if (isProd) {
197
193
  deployArgs.push('--prod');
@@ -299,7 +295,7 @@ async function prepareDeployment(config) {
299
295
  if (!fs.existsSync(indexPath)) {
300
296
  const readmePath = path.join(outputDir, 'README.html');
301
297
  if (fs.existsSync(readmePath)) {
302
- // Create redirect
298
+ // Create redirect to README.html
303
299
  const redirectHtml = `<!DOCTYPE html>
304
300
  <html>
305
301
  <head>
@@ -311,6 +307,37 @@ async function prepareDeployment(config) {
311
307
  </body>
312
308
  </html>`;
313
309
  fs.writeFileSync(indexPath, redirectHtml);
310
+ console.log(chalk.green('✅ Created index.html redirect to README.html'));
311
+ } else {
312
+ // If no README.html, create a basic index listing all HTML files
313
+ const htmlFiles = fs.readdirSync(outputDir)
314
+ .filter(file => file.endsWith('.html') && file !== 'index.html')
315
+ .sort();
316
+
317
+ if (htmlFiles.length > 0) {
318
+ const indexHtml = `<!DOCTYPE html>
319
+ <html>
320
+ <head>
321
+ <title>Documentation</title>
322
+ <style>
323
+ body { font-family: -apple-system, sans-serif; max-width: 800px; margin: 40px auto; padding: 0 20px; }
324
+ h1 { color: #333; }
325
+ ul { list-style: none; padding: 0; }
326
+ li { margin: 10px 0; }
327
+ a { color: #0066cc; text-decoration: none; }
328
+ a:hover { text-decoration: underline; }
329
+ </style>
330
+ </head>
331
+ <body>
332
+ <h1>Documentation</h1>
333
+ <ul>
334
+ ${htmlFiles.map(file => `<li><a href="${file}">${file.replace('.html', '')}</a></li>`).join('\n ')}
335
+ </ul>
336
+ </body>
337
+ </html>`;
338
+ fs.writeFileSync(indexPath, indexHtml);
339
+ console.log(chalk.green('✅ Created index.html with file listing'));
340
+ }
314
341
  }
315
342
  }
316
343
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {