@knowcode/doc-builder 1.0.7 → 1.0.9

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,33 @@ 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.0.9] - 2025-01-19
9
+
10
+ ### Fixed
11
+ - Fixed "buildCommand should be string,null" error
12
+ - Simplified vercel.json to minimal configuration
13
+ - Removed unnecessary buildCommand and installCommand fields
14
+ - Only include outputDirectory in vercel.json
15
+
16
+ ## [1.0.8] - 2025-01-19
17
+
18
+ ### Added
19
+ - Extremely prominent Root Directory warnings throughout setup
20
+ - Red background critical warnings before setup begins
21
+ - Clear post-setup instructions with visual formatting
22
+ - Step-by-step Root Directory fix instructions after linking
23
+ - Warning in help text about Root Directory configuration
24
+
25
+ ### Improved
26
+ - Made Root Directory warnings impossible to miss
27
+ - Added visual boxes and colors to critical warnings
28
+ - Enhanced setup flow with pre-deployment warnings
29
+ - Better formatting of post-setup instructions
30
+
31
+ ### Changed
32
+ - All setup flows now show Root Directory warning first
33
+ - Both deploy command and default flow show warnings
34
+
8
35
  ## [1.0.7] - 2025-01-19
9
36
 
10
37
  ### Added
package/cli.js CHANGED
@@ -149,6 +149,12 @@ ${chalk.yellow('First-time Vercel Setup:')}
149
149
  ${chalk.green('Q: What is your project name?')}
150
150
  → Answer: ${chalk.yellow('Your project name')} (e.g., "my-docs" or "gasworld")
151
151
 
152
+ ${chalk.bgRed.white.bold(' ⚠️ CRITICAL: ABOUT ROOT DIRECTORY ')}
153
+ ${chalk.red('If asked about Root Directory at ANY point:')}
154
+ ${chalk.red('• LEAVE IT EMPTY (blank)')}
155
+ ${chalk.red('• DO NOT enter "html"')}
156
+ ${chalk.red('• We deploy FROM html folder already!')}
157
+
152
158
  ${chalk.green('Q: Which framework preset?')}
153
159
  → Answer: ${chalk.yellow('Other (Static HTML)')} (always choose this)
154
160
 
@@ -243,6 +249,19 @@ ${chalk.yellow('Troubleshooting:')}
243
249
  spinner.stop();
244
250
  console.log(chalk.yellow('\n🚀 First time deploying to Vercel!\n'));
245
251
 
252
+ // Show critical warning about Root Directory
253
+ console.log(chalk.bgRed.white.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
254
+ console.log(chalk.bgRed.white.bold(' ⚠️ CRITICAL WARNING - READ BEFORE CONTINUING! '));
255
+ console.log(chalk.bgRed.white.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
256
+
257
+ console.log(chalk.yellow.bold('During setup, if Vercel asks about Root Directory:'));
258
+ console.log(chalk.red.bold('• LEAVE IT EMPTY (blank)'));
259
+ console.log(chalk.red.bold('• DO NOT ENTER "html"'));
260
+ console.log(chalk.red.bold('• We are ALREADY deploying from the html folder!\n'));
261
+
262
+ console.log(chalk.white('Setting Root Directory to "html" will cause errors.'));
263
+ console.log(chalk.white('You\'ll need to fix it in project settings later.\n'));
264
+
246
265
  const setupConfirm = await prompts({
247
266
  type: 'confirm',
248
267
  name: 'value',
@@ -419,6 +438,16 @@ program
419
438
  deploySpinner.stop();
420
439
  console.log(chalk.yellow('\n🚀 First time deploying to Vercel!\n'));
421
440
 
441
+ // Show critical warning about Root Directory
442
+ console.log(chalk.bgRed.white.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
443
+ console.log(chalk.bgRed.white.bold(' ⚠️ CRITICAL WARNING - READ BEFORE CONTINUING! '));
444
+ console.log(chalk.bgRed.white.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
445
+
446
+ console.log(chalk.yellow.bold('During setup, if Vercel asks about Root Directory:'));
447
+ console.log(chalk.red.bold('• LEAVE IT EMPTY (blank)'));
448
+ console.log(chalk.red.bold('• DO NOT ENTER "html"'));
449
+ console.log(chalk.red.bold('• We are ALREADY deploying from the html folder!\n'));
450
+
422
451
  const setupConfirm = await prompts({
423
452
  type: 'confirm',
424
453
  name: 'value',
package/lib/deploy.js CHANGED
@@ -58,13 +58,10 @@ async function setupVercelProject(config) {
58
58
  fs.mkdirSync(outputDir, { recursive: true });
59
59
  }
60
60
 
61
- // Create vercel.json for static site
62
- // Use empty string instead of false to avoid Vercel issues
61
+ // Create minimal vercel.json for static site
62
+ // Only include required fields
63
63
  const vercelConfig = {
64
- buildCommand: "",
65
- outputDirectory: ".",
66
- installCommand: "",
67
- framework: null
64
+ outputDirectory: "."
68
65
  };
69
66
 
70
67
  fs.writeJsonSync(vercelConfigPath, vercelConfig, { spaces: 2 });
@@ -93,6 +90,12 @@ async function setupVercelProject(config) {
93
90
  console.log(chalk.white('5️⃣ ') + chalk.green('What\'s the name of your existing project?'));
94
91
  console.log(chalk.white(' 👉 Answer: ') + chalk.yellow.bold(answers.projectName) + ' (your actual project name)\n');
95
92
 
93
+ console.log(chalk.red.bold('⚠️ CRITICAL WARNING ABOUT ROOT DIRECTORY:\n'));
94
+ console.log(chalk.bgRed.white.bold(' If Vercel asks about Root Directory or shows it in settings: '));
95
+ console.log(chalk.bgRed.white.bold(' LEAVE IT COMPLETELY EMPTY! DO NOT ENTER "html"! '));
96
+ console.log(chalk.white('\nWe are already in the html folder - setting Root Directory'));
97
+ console.log(chalk.white('to "html" will cause "html/html does not exist" errors!\n'));
98
+
96
99
  console.log(chalk.blue('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
97
100
 
98
101
  try {
@@ -107,14 +110,27 @@ async function setupVercelProject(config) {
107
110
  }
108
111
 
109
112
  // Important reminders for Vercel settings
110
- console.log(chalk.yellow('\n⚠️ IMPORTANT: Vercel Project Settings\n'));
111
- console.log(chalk.white('After deployment, go to your Vercel dashboard:'));
112
- console.log();
113
- console.log(chalk.red.bold('🔴 CRITICAL: Check Root Directory Setting'));
114
- console.log(chalk.white('1. Go to: ') + chalk.cyan(`https://vercel.com/${answers.projectName}/settings`));
115
- console.log(chalk.white('2. Under "Build & Development Settings"'));
116
- console.log(chalk.white('3. Make sure "Root Directory" is ') + chalk.yellow.bold('EMPTY or "./"'));
117
- console.log(chalk.white(' (NOT "html" or any other directory)'));
113
+ console.log(chalk.red('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
114
+ console.log(chalk.red.bold('🚨 CRITICAL POST-SETUP STEP - DO THIS NOW!'));
115
+ console.log(chalk.red('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
116
+
117
+ console.log(chalk.yellow.bold('Vercel may have set Root Directory incorrectly!\n'));
118
+
119
+ console.log(chalk.white.bold('1. GO TO YOUR PROJECT SETTINGS NOW:'));
120
+ console.log(chalk.cyan(` https://vercel.com/${answers.projectName}/settings\n`));
121
+
122
+ console.log(chalk.white.bold('2. Find "Root Directory" under "Build & Development Settings"\n'));
123
+
124
+ console.log(chalk.white.bold('3. CHECK THE VALUE:'));
125
+ console.log(chalk.green(' ✅ CORRECT: ') + chalk.green.bold('Empty (blank) or "./"'));
126
+ console.log(chalk.red(' ❌ WRONG: ') + chalk.red.bold('"html" or any other value\n'));
127
+
128
+ console.log(chalk.white.bold('4. IF IT SAYS "html":'));
129
+ console.log(chalk.yellow(' • DELETE the value completely'));
130
+ console.log(chalk.yellow(' • Leave it EMPTY'));
131
+ console.log(chalk.yellow(' • Click SAVE\n'));
132
+
133
+ console.log(chalk.bgRed.white.bold(' Failure to do this will cause deployment errors! '));
118
134
  console.log();
119
135
  console.log(chalk.yellow('🔐 For Public Access:'));
120
136
  console.log(chalk.white('1. Navigate to Project Settings > General'));
@@ -178,11 +194,9 @@ async function deployToVercel(config, isProd = false) {
178
194
  // Create vercel.json in output directory for deployment
179
195
  const vercelConfigPath = path.join(outputPath, 'vercel.json');
180
196
  if (!fs.existsSync(vercelConfigPath)) {
197
+ // Create minimal vercel.json for static site
181
198
  const vercelConfig = {
182
- buildCommand: "",
183
- outputDirectory: ".",
184
- installCommand: "",
185
- framework: null
199
+ outputDirectory: "."
186
200
  };
187
201
  fs.writeJsonSync(vercelConfigPath, vercelConfig, { spaces: 2 });
188
202
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {