@knowcode/doc-builder 1.0.8 → 1.0.10

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,31 @@ 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.10] - 2025-01-19
9
+
10
+ ### Fixed
11
+ - Fixed persistent "buildCommand should be string,null" error
12
+ - vercel.json now explicitly sets buildCommand to empty string
13
+ - Added explicit build environment variables to deployment
14
+ - Added specific error handling for buildCommand conflicts
15
+
16
+ ### Added
17
+ - Better error messages for build settings conflicts
18
+ - Instructions to clear Vercel project settings
19
+ - Alternative reset instructions when settings conflict
20
+
21
+ ### Changed
22
+ - Deploy command now includes build skip flags
23
+ - All build-related fields explicitly set to empty strings
24
+
25
+ ## [1.0.9] - 2025-01-19
26
+
27
+ ### Fixed
28
+ - Fixed "buildCommand should be string,null" error
29
+ - Simplified vercel.json to minimal configuration
30
+ - Removed unnecessary buildCommand and installCommand fields
31
+ - Only include outputDirectory in vercel.json
32
+
8
33
  ## [1.0.8] - 2025-01-19
9
34
 
10
35
  ### Added
package/lib/deploy.js CHANGED
@@ -58,13 +58,13 @@ 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 vercel.json that explicitly overrides build settings
63
62
  const vercelConfig = {
64
- buildCommand: "",
65
- outputDirectory: ".",
66
- installCommand: "",
67
- framework: null
63
+ "buildCommand": "",
64
+ "outputDirectory": ".",
65
+ "devCommand": "",
66
+ "installCommand": "",
67
+ "framework": null
68
68
  };
69
69
 
70
70
  fs.writeJsonSync(vercelConfigPath, vercelConfig, { spaces: 2 });
@@ -197,23 +197,40 @@ async function deployToVercel(config, isProd = false) {
197
197
  // Create vercel.json in output directory for deployment
198
198
  const vercelConfigPath = path.join(outputPath, 'vercel.json');
199
199
  if (!fs.existsSync(vercelConfigPath)) {
200
+ // Create vercel.json that explicitly overrides build settings
200
201
  const vercelConfig = {
201
- buildCommand: "",
202
- outputDirectory: ".",
203
- installCommand: "",
204
- framework: null
202
+ "buildCommand": "",
203
+ "outputDirectory": ".",
204
+ "devCommand": "",
205
+ "installCommand": "",
206
+ "framework": null
205
207
  };
206
208
  fs.writeJsonSync(vercelConfigPath, vercelConfig, { spaces: 2 });
207
209
  }
208
210
 
209
- // Deploy command
210
- const deployCmd = isProd ? 'vercel --prod' : 'vercel';
211
+ // Deploy command with explicit build settings
212
+ // Override any project settings that might be causing issues
213
+ const deployArgs = [
214
+ '--build-env', 'VERCEL_BUILD_OUTPUT_DIRECTORY=.',
215
+ '--no-clipboard'
216
+ ];
217
+
218
+ if (isProd) {
219
+ deployArgs.push('--prod');
220
+ }
221
+
222
+ const deployCmd = `vercel ${deployArgs.join(' ')}`;
211
223
 
212
224
  try {
213
225
  // Run deployment from the output directory
214
226
  const output = execSync(deployCmd, {
215
227
  cwd: outputPath,
216
- encoding: 'utf8'
228
+ encoding: 'utf8',
229
+ env: {
230
+ ...process.env,
231
+ // Force Vercel to skip build
232
+ VERCEL_BUILD_SKIP: '1'
233
+ }
217
234
  });
218
235
 
219
236
  // Extract URL from output
@@ -239,6 +256,27 @@ async function deployToVercel(config, isProd = false) {
239
256
 
240
257
  throw new Error('Root Directory misconfiguration - see instructions above');
241
258
  }
259
+
260
+ // Check if this is the buildCommand error
261
+ if (error.message && error.message.includes('buildCommand') && error.message.includes('should be string,null')) {
262
+ console.log(chalk.red.bold('\nāŒ ERROR: Vercel has saved build settings that conflict!\n'));
263
+ console.log(chalk.yellow('Your Vercel project has build settings that need to be cleared.\n'));
264
+
265
+ console.log(chalk.green.bold('šŸ”§ TO FIX THIS:\n'));
266
+ console.log(chalk.white('Option 1 - Clear project settings:'));
267
+ console.log(chalk.cyan('1. Go to your project settings'));
268
+ console.log(chalk.cyan('2. Under "Build & Development Settings"'));
269
+ console.log(chalk.cyan('3. Clear ALL fields (Build Command, Output Directory, etc.)'));
270
+ console.log(chalk.cyan('4. Save and try again\n'));
271
+
272
+ console.log(chalk.white('Option 2 - Reset and start fresh:'));
273
+ console.log(chalk.cyan('1. Run: npx @knowcode/doc-builder reset-vercel'));
274
+ console.log(chalk.cyan('2. Run: npx @knowcode/doc-builder deploy'));
275
+ console.log(chalk.cyan('3. Create a NEW project (don\'t link to existing)\n'));
276
+
277
+ throw new Error('Build settings conflict - see instructions above');
278
+ }
279
+
242
280
  throw new Error(`Vercel deployment failed: ${error.message}`);
243
281
  }
244
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {