@knowcode/doc-builder 1.0.11 → 1.1.1

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/cli.js +24 -13
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,37 @@ 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.1] - 2025-01-19
9
+
10
+ ### Added
11
+ - TL;DR section at the top of CLI help for quick understanding
12
+ - Clear production deployment behavior explanation in help
13
+ - Visual indicators for v1.1.0+ deployment changes
14
+ - Examples showing production URLs vs preview URLs
15
+
16
+ ### Improved
17
+ - Help text now prominently shows default production deployment
18
+ - Added emoji and color highlights for important changes
19
+ - Clearer deployment behavior section
20
+
21
+ ## [1.1.0] - 2025-01-19
22
+
23
+ ### Changed (BREAKING)
24
+ - **Deploy command now defaults to production deployment**
25
+ - Use `--no-prod` flag for preview deployments
26
+ - Default action (no command) deploys to production
27
+ - This ensures documentation is always published to main URL
28
+
29
+ ### Updated
30
+ - All help text and examples reflect production default
31
+ - CLI description clarifies production deployment
32
+ - Example files use simplified deploy command
33
+
34
+ ### Migration
35
+ - Previous: `npx @knowcode/doc-builder deploy --prod`
36
+ - Now: `npx @knowcode/doc-builder deploy`
37
+ - For preview: `npx @knowcode/doc-builder deploy --no-prod`
38
+
8
39
  ## [1.0.11] - 2025-01-19
9
40
 
10
41
  ### Added
package/cli.js CHANGED
@@ -27,11 +27,16 @@ program
27
27
  .addHelpText('before', `
28
28
  ${chalk.cyan('šŸš€ @knowcode/doc-builder')} - Transform your markdown into beautiful documentation sites
29
29
 
30
+ ${chalk.bgGreen.black(' TL;DR ')} ${chalk.green('Just run:')} ${chalk.cyan.bold('npx @knowcode/doc-builder')} ${chalk.green('→ Your docs are live on Vercel!')}
31
+
32
+ ${chalk.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━')}
33
+
30
34
  ${chalk.yellow('What it does:')}
31
35
  • Converts markdown files to static HTML with a beautiful Notion-inspired theme
32
36
  • Automatically generates navigation from your folder structure
33
37
  • Supports mermaid diagrams, syntax highlighting, and dark mode
34
38
  • Deploys to Vercel with one command (zero configuration)
39
+ • ${chalk.green.bold('NEW:')} Deploys directly to production by default (v1.1.0+)
35
40
  • Optional authentication to protect private documentation
36
41
 
37
42
  ${chalk.yellow('Requirements:')}
@@ -45,7 +50,7 @@ ${chalk.yellow('Quick Start:')}
45
50
  ${chalk.gray('$')} echo "# My Documentation" > docs/README.md
46
51
 
47
52
  ${chalk.cyan('2. Build and deploy:')}
48
- ${chalk.gray('$')} npx @knowcode/doc-builder ${chalk.gray('# Build and deploy to Vercel')}
53
+ ${chalk.gray('$')} npx @knowcode/doc-builder ${chalk.gray('# Build and deploy to production')}
49
54
  ${chalk.gray(' or')}
50
55
  ${chalk.gray('$')} npx @knowcode/doc-builder build ${chalk.gray('# Build HTML files only')}
51
56
  ${chalk.gray('$')} npx @knowcode/doc-builder dev ${chalk.gray('# Start development server')}
@@ -116,15 +121,15 @@ ${chalk.yellow('Examples:')}
116
121
  // Deploy command
117
122
  program
118
123
  .command('deploy')
119
- .description('Deploy documentation to Vercel (requires Vercel CLI)')
124
+ .description('Deploy documentation to Vercel production (requires Vercel CLI)')
120
125
  .option('-c, --config <path>', 'path to config file (default: doc-builder.config.js)')
121
- .option('--prod', 'deploy to production (default: preview deployment)')
126
+ .option('--no-prod', 'deploy as preview instead of production')
122
127
  .option('--no-build', 'skip building before deployment')
123
128
  .option('--force', 'force deployment without confirmation')
124
129
  .addHelpText('after', `
125
130
  ${chalk.yellow('Examples:')}
126
- ${chalk.gray('$')} doc-builder deploy ${chalk.gray('# Deploy preview to Vercel')}
127
- ${chalk.gray('$')} doc-builder deploy --prod ${chalk.gray('# Deploy to production')}
131
+ ${chalk.gray('$')} doc-builder deploy ${chalk.gray('# Deploy to production')}
132
+ ${chalk.gray('$')} doc-builder deploy --no-prod ${chalk.gray('# Deploy preview only')}
128
133
  ${chalk.gray('$')} doc-builder deploy --no-build ${chalk.gray('# Deploy existing build')}
129
134
 
130
135
  ${chalk.yellow('First-time Vercel Setup:')}
@@ -183,9 +188,12 @@ ${chalk.yellow('First-time Vercel Setup:')}
183
188
  • Under "Deployment Protection", set to ${chalk.yellow('Disabled')}
184
189
  • This allows public access to your docs
185
190
 
186
- ${chalk.yellow('Subsequent Deployments:')}
187
- ${chalk.gray('$')} npx @knowcode/doc-builder ${chalk.gray('# Deploy preview')}
188
- ${chalk.gray('$')} npx @knowcode/doc-builder deploy --prod ${chalk.gray('# Deploy to production')}
191
+ ${chalk.yellow('Deployment Behavior (v1.1.0+):')}
192
+ ${chalk.green.bold('šŸŽÆ DEFAULT: All deployments go to PRODUCTION')}
193
+
194
+ ${chalk.gray('$')} npx @knowcode/doc-builder ${chalk.gray('# → yourdocs.vercel.app')}
195
+ ${chalk.gray('$')} npx @knowcode/doc-builder deploy ${chalk.gray('# → yourdocs.vercel.app')}
196
+ ${chalk.gray('$')} npx @knowcode/doc-builder deploy --no-prod ${chalk.gray('# → preview URL only')}
189
197
 
190
198
  ${chalk.yellow('When All Else Fails - Delete and Start Fresh:')}
191
199
  Sometimes the cleanest solution is to delete the Vercel project:
@@ -308,7 +316,9 @@ ${chalk.yellow('Troubleshooting:')}
308
316
  }
309
317
 
310
318
  spinner.start('Deploying to Vercel...');
311
- const url = await deployToVercel(config, options.prod);
319
+ // Default to production deployment
320
+ const isProduction = options.prod !== false; // Default true unless explicitly --no-prod
321
+ const url = await deployToVercel(config, isProduction);
312
322
  spinner.succeed(`Deployed successfully! ${chalk.cyan(url)}`);
313
323
 
314
324
  } catch (error) {
@@ -422,7 +432,7 @@ ${chalk.yellow('What gets created:')}
422
432
  // Create example files
423
433
  const exampleFiles = {
424
434
  'README.md': `# Welcome to Your Documentation\n\nThis is an example documentation site created with @knowcode/doc-builder.\n\n## Features\n\n- šŸ“ Write in Markdown\n- šŸŽØ Beautiful Notion-inspired design\n- šŸ“Š Mermaid diagram support\n- šŸŒ™ Dark mode\n- šŸš€ Deploy to Vercel\n\n## Getting Started\n\n1. Edit this file and add your content\n2. Create new markdown files\n3. Run \`npx @knowcode/doc-builder\` to build and deploy\n\n## Example Diagram\n\n\`\`\`mermaid\ngraph TD\n A[Write Docs] --> B[Build]\n B --> C[Deploy]\n C --> D[Share]\n\`\`\`\n`,
425
- 'getting-started.md': `# Getting Started\n\n**Generated**: ${new Date().toISOString().split('T')[0]}\n**Status**: Draft\n**Verified**: ā“\n\n## Overview\n\nThis guide will help you get started with your documentation.\n\n## Installation\n\nNo installation required! Just use:\n\n\`\`\`bash\nnpx @knowcode/doc-builder\n\`\`\`\n\n## Writing Documentation\n\n1. Create markdown files in the \`docs\` folder\n2. Use folders to organize your content\n3. Add front matter for metadata\n\n## Building\n\nTo build your documentation:\n\n\`\`\`bash\nnpx @knowcode/doc-builder build\n\`\`\`\n\n## Deployment\n\nDeploy to Vercel:\n\n\`\`\`bash\nnpx @knowcode/doc-builder deploy --prod\n\`\`\`\n`,
435
+ 'getting-started.md': `# Getting Started\n\n**Generated**: ${new Date().toISOString().split('T')[0]}\n**Status**: Draft\n**Verified**: ā“\n\n## Overview\n\nThis guide will help you get started with your documentation.\n\n## Installation\n\nNo installation required! Just use:\n\n\`\`\`bash\nnpx @knowcode/doc-builder\n\`\`\`\n\n## Writing Documentation\n\n1. Create markdown files in the \`docs\` folder\n2. Use folders to organize your content\n3. Add front matter for metadata\n\n## Building\n\nTo build your documentation:\n\n\`\`\`bash\nnpx @knowcode/doc-builder build\n\`\`\`\n\n## Deployment\n\nDeploy to Vercel:\n\n\`\`\`bash\nnpx @knowcode/doc-builder deploy\n\`\`\`\n`,
426
436
  'guides/configuration.md': `# Configuration Guide\n\n**Generated**: ${new Date().toISOString().split('T')[0]}\n**Status**: Draft\n**Verified**: ā“\n\n## Overview\n\n@knowcode/doc-builder works with zero configuration, but you can customize it.\n\n## Configuration File\n\nCreate \`doc-builder.config.js\`:\n\n\`\`\`javascript\nmodule.exports = {\n siteName: 'My Documentation',\n siteDescription: 'Documentation for my project',\n \n features: {\n authentication: false,\n changelog: true,\n mermaid: true,\n darkMode: true\n }\n};\n\`\`\`\n\n## Options\n\n### Site Information\n\n- \`siteName\`: Your documentation site name\n- \`siteDescription\`: Brief description\n\n### Directories\n\n- \`docsDir\`: Input directory (default: 'docs')\n- \`outputDir\`: Output directory (default: 'html')\n\n### Features\n\n- \`authentication\`: Enable password protection\n- \`changelog\`: Generate changelog automatically\n- \`mermaid\`: Support for diagrams\n- \`darkMode\`: Dark theme support\n`
427
437
  };
428
438
 
@@ -452,8 +462,8 @@ ${chalk.yellow('What gets created:')}
452
462
  // Add a default command handler for when doc-builder is run without arguments
453
463
  program
454
464
  .action(async () => {
455
- // Default action is build + deploy
456
- console.log(chalk.cyan('\nšŸš€ Building and deploying your documentation...\n'));
465
+ // Default action is build + deploy to production
466
+ console.log(chalk.cyan('\nšŸš€ Building and deploying your documentation to production...\n'));
457
467
 
458
468
  try {
459
469
  // Build first
@@ -498,7 +508,8 @@ program
498
508
  deploySpinner.start('Deploying to Vercel...');
499
509
  }
500
510
 
501
- const url = await deployToVercel(config, false);
511
+ // Default to production deployment
512
+ const url = await deployToVercel(config, true);
502
513
  deploySpinner.succeed(`Deployed successfully! ${chalk.cyan(url)}`);
503
514
 
504
515
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.0.11",
3
+ "version": "1.1.1",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {