@knowcode/doc-builder 1.1.3 ā 1.1.5
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 +30 -0
- package/cli.js +35 -2
- package/lib/deploy.js +33 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,36 @@ 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.5] - 2025-01-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Clear explanation of Vercel URLs after deployment
|
|
12
|
+
- Shows permanent production URL (e.g., gasworld.vercel.app)
|
|
13
|
+
- Explains the difference between production and preview URLs
|
|
14
|
+
- Better post-deployment messaging
|
|
15
|
+
|
|
16
|
+
### Improved
|
|
17
|
+
- Deployment success message now shows both URLs clearly
|
|
18
|
+
- Production URL is highlighted as the one to share
|
|
19
|
+
- Preview URL is explained as deployment-specific
|
|
20
|
+
|
|
21
|
+
## [1.1.4] - 2025-01-19
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- Removed deprecated --no-clipboard option
|
|
25
|
+
- Fixed 404 errors with better index.html handling
|
|
26
|
+
- Added fallback index.html when README.html doesn't exist
|
|
27
|
+
- Production deployment now correctly uses --prod flag
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- Auto-generated index.html with file listing if no README
|
|
31
|
+
- Better logging during deployment preparation
|
|
32
|
+
- Console messages when creating index.html
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
- Simplified deployment arguments
|
|
36
|
+
- Cleaner deployment command without unnecessary flags
|
|
37
|
+
|
|
8
38
|
## [1.1.3] - 2025-01-19
|
|
9
39
|
|
|
10
40
|
### Fixed
|
package/cli.js
CHANGED
|
@@ -319,7 +319,28 @@ ${chalk.yellow('Troubleshooting:')}
|
|
|
319
319
|
// Default to production deployment
|
|
320
320
|
const isProduction = options.prod !== false; // Default true unless explicitly --no-prod
|
|
321
321
|
const url = await deployToVercel(config, isProduction);
|
|
322
|
-
spinner.succeed(`Deployed successfully
|
|
322
|
+
spinner.succeed(`Deployed successfully!`);
|
|
323
|
+
|
|
324
|
+
// Extract project name from URL
|
|
325
|
+
const projectName = url.match(/https:\/\/([^-]+)/)?.[1] || 'your-project';
|
|
326
|
+
|
|
327
|
+
console.log(chalk.green('\nā
Deployment Complete!\n'));
|
|
328
|
+
|
|
329
|
+
if (isProduction) {
|
|
330
|
+
console.log(chalk.yellow('š Your documentation is live at:'));
|
|
331
|
+
console.log(chalk.cyan.bold(` ${projectName}.vercel.app`) + chalk.gray(' (Production URL - share this!)'));
|
|
332
|
+
console.log();
|
|
333
|
+
console.log(chalk.gray('This deployment also created a unique preview URL:'));
|
|
334
|
+
console.log(chalk.gray(` ${url}`));
|
|
335
|
+
console.log(chalk.gray(' (This URL is specific to this deployment)'));
|
|
336
|
+
} else {
|
|
337
|
+
console.log(chalk.yellow('š Preview deployment created at:'));
|
|
338
|
+
console.log(chalk.cyan(` ${url}`));
|
|
339
|
+
console.log();
|
|
340
|
+
console.log(chalk.gray('To deploy to production, run:'));
|
|
341
|
+
console.log(chalk.gray(' npx @knowcode/doc-builder deploy'));
|
|
342
|
+
}
|
|
343
|
+
console.log();
|
|
323
344
|
|
|
324
345
|
} catch (error) {
|
|
325
346
|
spinner.fail('Deployment failed');
|
|
@@ -510,7 +531,19 @@ program
|
|
|
510
531
|
|
|
511
532
|
// Default to production deployment
|
|
512
533
|
const url = await deployToVercel(config, true);
|
|
513
|
-
deploySpinner.succeed(`Deployed successfully
|
|
534
|
+
deploySpinner.succeed(`Deployed successfully!`);
|
|
535
|
+
|
|
536
|
+
// Extract project name from URL
|
|
537
|
+
const projectName = url.match(/https:\/\/([^-]+)/)?.[1] || 'your-project';
|
|
538
|
+
|
|
539
|
+
console.log(chalk.green('\nā
Deployment Complete!\n'));
|
|
540
|
+
console.log(chalk.yellow('š Your documentation is live at:'));
|
|
541
|
+
console.log(chalk.cyan.bold(` ${projectName}.vercel.app`) + chalk.gray(' (Production URL - share this!)'));
|
|
542
|
+
console.log();
|
|
543
|
+
console.log(chalk.gray('This deployment also created a unique preview URL:'));
|
|
544
|
+
console.log(chalk.gray(` ${url}`));
|
|
545
|
+
console.log(chalk.gray(' (This URL is specific to this deployment)'));
|
|
546
|
+
console.log();
|
|
514
547
|
|
|
515
548
|
} catch (error) {
|
|
516
549
|
console.error(chalk.red('\nError: ' + error.message));
|
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
|
-
|
|
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
|
}
|