@knowcode/doc-builder 1.0.11 ā 1.1.0
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 +18 -0
- package/cli.js +16 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ 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.0] - 2025-01-19
|
|
9
|
+
|
|
10
|
+
### Changed (BREAKING)
|
|
11
|
+
- **Deploy command now defaults to production deployment**
|
|
12
|
+
- Use `--no-prod` flag for preview deployments
|
|
13
|
+
- Default action (no command) deploys to production
|
|
14
|
+
- This ensures documentation is always published to main URL
|
|
15
|
+
|
|
16
|
+
### Updated
|
|
17
|
+
- All help text and examples reflect production default
|
|
18
|
+
- CLI description clarifies production deployment
|
|
19
|
+
- Example files use simplified deploy command
|
|
20
|
+
|
|
21
|
+
### Migration
|
|
22
|
+
- Previous: `npx @knowcode/doc-builder deploy --prod`
|
|
23
|
+
- Now: `npx @knowcode/doc-builder deploy`
|
|
24
|
+
- For preview: `npx @knowcode/doc-builder deploy --no-prod`
|
|
25
|
+
|
|
8
26
|
## [1.0.11] - 2025-01-19
|
|
9
27
|
|
|
10
28
|
### Added
|
package/cli.js
CHANGED
|
@@ -45,7 +45,7 @@ ${chalk.yellow('Quick Start:')}
|
|
|
45
45
|
${chalk.gray('$')} echo "# My Documentation" > docs/README.md
|
|
46
46
|
|
|
47
47
|
${chalk.cyan('2. Build and deploy:')}
|
|
48
|
-
${chalk.gray('$')} npx @knowcode/doc-builder ${chalk.gray('# Build and deploy to
|
|
48
|
+
${chalk.gray('$')} npx @knowcode/doc-builder ${chalk.gray('# Build and deploy to production')}
|
|
49
49
|
${chalk.gray(' or')}
|
|
50
50
|
${chalk.gray('$')} npx @knowcode/doc-builder build ${chalk.gray('# Build HTML files only')}
|
|
51
51
|
${chalk.gray('$')} npx @knowcode/doc-builder dev ${chalk.gray('# Start development server')}
|
|
@@ -116,15 +116,15 @@ ${chalk.yellow('Examples:')}
|
|
|
116
116
|
// Deploy command
|
|
117
117
|
program
|
|
118
118
|
.command('deploy')
|
|
119
|
-
.description('Deploy documentation to Vercel (requires Vercel CLI)')
|
|
119
|
+
.description('Deploy documentation to Vercel production (requires Vercel CLI)')
|
|
120
120
|
.option('-c, --config <path>', 'path to config file (default: doc-builder.config.js)')
|
|
121
|
-
.option('--prod', 'deploy
|
|
121
|
+
.option('--no-prod', 'deploy as preview instead of production')
|
|
122
122
|
.option('--no-build', 'skip building before deployment')
|
|
123
123
|
.option('--force', 'force deployment without confirmation')
|
|
124
124
|
.addHelpText('after', `
|
|
125
125
|
${chalk.yellow('Examples:')}
|
|
126
|
-
${chalk.gray('$')} doc-builder deploy ${chalk.gray('# Deploy
|
|
127
|
-
${chalk.gray('$')} doc-builder deploy --prod
|
|
126
|
+
${chalk.gray('$')} doc-builder deploy ${chalk.gray('# Deploy to production')}
|
|
127
|
+
${chalk.gray('$')} doc-builder deploy --no-prod ${chalk.gray('# Deploy preview only')}
|
|
128
128
|
${chalk.gray('$')} doc-builder deploy --no-build ${chalk.gray('# Deploy existing build')}
|
|
129
129
|
|
|
130
130
|
${chalk.yellow('First-time Vercel Setup:')}
|
|
@@ -184,8 +184,9 @@ ${chalk.yellow('First-time Vercel Setup:')}
|
|
|
184
184
|
⢠This allows public access to your docs
|
|
185
185
|
|
|
186
186
|
${chalk.yellow('Subsequent Deployments:')}
|
|
187
|
-
${chalk.gray('$')} npx @knowcode/doc-builder ${chalk.gray('#
|
|
188
|
-
${chalk.gray('$')} npx @knowcode/doc-builder deploy
|
|
187
|
+
${chalk.gray('$')} npx @knowcode/doc-builder ${chalk.gray('# Build and deploy to production')}
|
|
188
|
+
${chalk.gray('$')} npx @knowcode/doc-builder deploy ${chalk.gray('# Deploy to production')}
|
|
189
|
+
${chalk.gray('$')} npx @knowcode/doc-builder deploy --no-prod ${chalk.gray('# Deploy preview only')}
|
|
189
190
|
|
|
190
191
|
${chalk.yellow('When All Else Fails - Delete and Start Fresh:')}
|
|
191
192
|
Sometimes the cleanest solution is to delete the Vercel project:
|
|
@@ -308,7 +309,9 @@ ${chalk.yellow('Troubleshooting:')}
|
|
|
308
309
|
}
|
|
309
310
|
|
|
310
311
|
spinner.start('Deploying to Vercel...');
|
|
311
|
-
|
|
312
|
+
// Default to production deployment
|
|
313
|
+
const isProduction = options.prod !== false; // Default true unless explicitly --no-prod
|
|
314
|
+
const url = await deployToVercel(config, isProduction);
|
|
312
315
|
spinner.succeed(`Deployed successfully! ${chalk.cyan(url)}`);
|
|
313
316
|
|
|
314
317
|
} catch (error) {
|
|
@@ -422,7 +425,7 @@ ${chalk.yellow('What gets created:')}
|
|
|
422
425
|
// Create example files
|
|
423
426
|
const exampleFiles = {
|
|
424
427
|
'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
|
|
428
|
+
'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
429
|
'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
430
|
};
|
|
428
431
|
|
|
@@ -452,8 +455,8 @@ ${chalk.yellow('What gets created:')}
|
|
|
452
455
|
// Add a default command handler for when doc-builder is run without arguments
|
|
453
456
|
program
|
|
454
457
|
.action(async () => {
|
|
455
|
-
// Default action is build + deploy
|
|
456
|
-
console.log(chalk.cyan('\nš Building and deploying your documentation...\n'));
|
|
458
|
+
// Default action is build + deploy to production
|
|
459
|
+
console.log(chalk.cyan('\nš Building and deploying your documentation to production...\n'));
|
|
457
460
|
|
|
458
461
|
try {
|
|
459
462
|
// Build first
|
|
@@ -498,7 +501,8 @@ program
|
|
|
498
501
|
deploySpinner.start('Deploying to Vercel...');
|
|
499
502
|
}
|
|
500
503
|
|
|
501
|
-
|
|
504
|
+
// Default to production deployment
|
|
505
|
+
const url = await deployToVercel(config, true);
|
|
502
506
|
deploySpinner.succeed(`Deployed successfully! ${chalk.cyan(url)}`);
|
|
503
507
|
|
|
504
508
|
} catch (error) {
|