@knowcode/doc-builder 1.5.1 → 1.5.3
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/.claude/settings.local.json +3 -1
- package/CHANGELOG.md +33 -0
- package/README.md +0 -8
- package/assets/css/notion-style.css +78 -2
- package/assets/js/main.js +111 -1
- package/html/README.html +4 -4
- package/html/claude-workflow-guide.html +3 -3
- package/html/css/notion-style.css +56 -0
- package/html/documentation-index.html +4 -4
- package/html/guides/authentication-guide.html +4 -4
- package/html/guides/claude-workflow-guide.html +531 -0
- package/html/guides/documentation-standards.html +4 -4
- package/html/guides/seo-guide.html +4 -4
- package/html/guides/troubleshooting-guide.html +4 -4
- package/html/index.html +4 -4
- package/html/js/main.js +86 -0
- package/html/sitemap.xml +18 -12
- package/html/vercel-cli-setup-guide.html +4 -4
- package/html/vercel-first-time-setup-guide.html +4 -4
- package/package.json +4 -2
- package/publish.sh +198 -0
- package/knowcode-doc-builder-1.4.4.tgz +0 -0
package/html/index.html
CHANGED
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"name": "Knowcode Ltd",
|
|
59
59
|
"url": "https://knowcode.tech"
|
|
60
60
|
},
|
|
61
|
-
"datePublished": "2025-07-
|
|
62
|
-
"dateModified": "2025-07-
|
|
61
|
+
"datePublished": "2025-07-22T06:01:14.255Z",
|
|
62
|
+
"dateModified": "2025-07-22T06:01:14.255Z",
|
|
63
63
|
"mainEntityOfPage": {
|
|
64
64
|
"@type": "WebPage",
|
|
65
65
|
"@id": "https://doc-builder-delta.vercel.app/README.html"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
<div class="header-actions">
|
|
94
94
|
<div class="deployment-info">
|
|
95
|
-
<span class="deployment-date" title="Built with doc-builder v1.5.
|
|
95
|
+
<span class="deployment-date" title="Built with doc-builder v1.5.2">Last updated: Jul 22, 2025, 06:01 AM UTC</span>
|
|
96
96
|
</div>
|
|
97
97
|
|
|
98
98
|
|
|
@@ -142,7 +142,6 @@
|
|
|
142
142
|
</a>
|
|
143
143
|
<div class="nav-content" >
|
|
144
144
|
<a href="/README.html" class="nav-item active" data-tooltip="@knowcode/doc-builder."><i class="fas fa-file-alt"></i> Overview</a>
|
|
145
|
-
<a href="/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
|
|
146
145
|
<a href="/documentation-index.html" class="nav-item" data-tooltip="This directory contains additional documentation for the @knowcode/doc-builder project, organized by topic and purpose."><i class="fas fa-file-alt"></i> Documentation Index</a>
|
|
147
146
|
<a href="/vercel-cli-setup-guide.html" class="nav-item" data-tooltip="This guide provides comprehensive instructions for installing and configuring the Vercel CLI across different operating systems and environments."><i class="fas fa-file-alt"></i> Vercel Cli Setup Guide</a>
|
|
148
147
|
<a href="/vercel-first-time-setup-guide.html" class="nav-item" data-tooltip="This guide provides a detailed explanation of every prompt you'll encounter during the first-time Vercel setup process when using."><i class="fas fa-file-alt"></i> Vercel First Time Setup Guide</a></div></div>
|
|
@@ -152,6 +151,7 @@
|
|
|
152
151
|
</a>
|
|
153
152
|
<div class="nav-content" id="nav-guides-1">
|
|
154
153
|
<a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="This guide explains how to configure and use the built-in authentication feature in @knowcode/doc-builder to protect your documentation with basic..."><i class="fas fa-file-alt"></i> Authentication Guide</a>
|
|
154
|
+
<a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
|
|
155
155
|
<a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
|
|
156
156
|
<a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="fas fa-file-alt"></i> Seo Guide</a>
|
|
157
157
|
<a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a></div></div>
|
package/html/js/main.js
CHANGED
|
@@ -518,6 +518,92 @@ if (menuToggle) {
|
|
|
518
518
|
});
|
|
519
519
|
}
|
|
520
520
|
|
|
521
|
+
// Floating Menu Button for Mobile
|
|
522
|
+
function initFloatingMenuButton() {
|
|
523
|
+
// Only initialize on mobile
|
|
524
|
+
if (window.innerWidth > 768) return;
|
|
525
|
+
|
|
526
|
+
// Check if button already exists
|
|
527
|
+
if (document.getElementById('floating-menu-toggle')) return;
|
|
528
|
+
|
|
529
|
+
// Create floating button
|
|
530
|
+
const floatingButton = document.createElement('button');
|
|
531
|
+
floatingButton.id = 'floating-menu-toggle';
|
|
532
|
+
floatingButton.className = 'floating-menu-toggle';
|
|
533
|
+
floatingButton.setAttribute('aria-label', 'Toggle menu');
|
|
534
|
+
floatingButton.innerHTML = '<i class="fas fa-bars"></i>';
|
|
535
|
+
floatingButton.style.display = 'none'; // Hidden by default
|
|
536
|
+
|
|
537
|
+
// Add to body
|
|
538
|
+
document.body.appendChild(floatingButton);
|
|
539
|
+
|
|
540
|
+
// Toggle sidebar on click
|
|
541
|
+
floatingButton.addEventListener('click', () => {
|
|
542
|
+
sidebar.classList.toggle('open');
|
|
543
|
+
// Update icon based on state
|
|
544
|
+
const icon = floatingButton.querySelector('i');
|
|
545
|
+
if (sidebar.classList.contains('open')) {
|
|
546
|
+
icon.className = 'fas fa-times';
|
|
547
|
+
} else {
|
|
548
|
+
icon.className = 'fas fa-bars';
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
// Show/hide based on scroll position
|
|
553
|
+
let scrollTimeout;
|
|
554
|
+
|
|
555
|
+
window.addEventListener('scroll', () => {
|
|
556
|
+
clearTimeout(scrollTimeout);
|
|
557
|
+
scrollTimeout = setTimeout(() => {
|
|
558
|
+
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
559
|
+
const headerHeight = document.querySelector('.header')?.offsetHeight || 64;
|
|
560
|
+
|
|
561
|
+
// Show floating button when scrolled past header
|
|
562
|
+
if (scrollTop > headerHeight + 50) {
|
|
563
|
+
floatingButton.style.display = 'flex';
|
|
564
|
+
// Add slight delay for smooth appearance
|
|
565
|
+
setTimeout(() => {
|
|
566
|
+
floatingButton.classList.add('visible');
|
|
567
|
+
}, 10);
|
|
568
|
+
} else {
|
|
569
|
+
floatingButton.classList.remove('visible');
|
|
570
|
+
// Hide after transition completes
|
|
571
|
+
setTimeout(() => {
|
|
572
|
+
if (!floatingButton.classList.contains('visible')) {
|
|
573
|
+
floatingButton.style.display = 'none';
|
|
574
|
+
}
|
|
575
|
+
}, 300);
|
|
576
|
+
}
|
|
577
|
+
}, 100);
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
// Update icon when sidebar state changes from other sources
|
|
581
|
+
const observer = new MutationObserver(() => {
|
|
582
|
+
const icon = floatingButton.querySelector('i');
|
|
583
|
+
if (sidebar.classList.contains('open')) {
|
|
584
|
+
icon.className = 'fas fa-times';
|
|
585
|
+
} else {
|
|
586
|
+
icon.className = 'fas fa-bars';
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
observer.observe(sidebar, {
|
|
591
|
+
attributes: true,
|
|
592
|
+
attributeFilter: ['class']
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// Initialize floating button on load and resize
|
|
597
|
+
document.addEventListener('DOMContentLoaded', initFloatingMenuButton);
|
|
598
|
+
window.addEventListener('resize', () => {
|
|
599
|
+
const existingButton = document.getElementById('floating-menu-toggle');
|
|
600
|
+
if (window.innerWidth > 768 && existingButton) {
|
|
601
|
+
existingButton.remove();
|
|
602
|
+
} else if (window.innerWidth <= 768 && !existingButton) {
|
|
603
|
+
initFloatingMenuButton();
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
|
|
521
607
|
// Prevent sidebar from closing when clicking nav items
|
|
522
608
|
// Only close when clicking outside the sidebar or the close button
|
|
523
609
|
document.addEventListener('click', (e) => {
|
package/html/sitemap.xml
CHANGED
|
@@ -2,73 +2,79 @@
|
|
|
2
2
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
3
3
|
<url>
|
|
4
4
|
<loc>https://doc-builder-delta.vercel.app/404.html</loc>
|
|
5
|
-
<lastmod>2025-07-
|
|
5
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
6
6
|
<changefreq>monthly</changefreq>
|
|
7
7
|
<priority>0.6</priority>
|
|
8
8
|
</url>
|
|
9
9
|
<url>
|
|
10
10
|
<loc>https://doc-builder-delta.vercel.app/README.html</loc>
|
|
11
|
-
<lastmod>2025-07-
|
|
11
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
12
12
|
<changefreq>monthly</changefreq>
|
|
13
13
|
<priority>0.6</priority>
|
|
14
14
|
</url>
|
|
15
15
|
<url>
|
|
16
16
|
<loc>https://doc-builder-delta.vercel.app/claude-workflow-guide.html</loc>
|
|
17
|
-
<lastmod>2025-07-
|
|
17
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
18
18
|
<changefreq>monthly</changefreq>
|
|
19
19
|
<priority>0.8</priority>
|
|
20
20
|
</url>
|
|
21
21
|
<url>
|
|
22
22
|
<loc>https://doc-builder-delta.vercel.app/documentation-index.html</loc>
|
|
23
|
-
<lastmod>2025-07-
|
|
23
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
24
24
|
<changefreq>monthly</changefreq>
|
|
25
25
|
<priority>0.6</priority>
|
|
26
26
|
</url>
|
|
27
27
|
<url>
|
|
28
28
|
<loc>https://doc-builder-delta.vercel.app/guides/authentication-guide.html</loc>
|
|
29
|
-
<lastmod>2025-07-
|
|
29
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
30
|
+
<changefreq>monthly</changefreq>
|
|
31
|
+
<priority>0.8</priority>
|
|
32
|
+
</url>
|
|
33
|
+
<url>
|
|
34
|
+
<loc>https://doc-builder-delta.vercel.app/guides/claude-workflow-guide.html</loc>
|
|
35
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
30
36
|
<changefreq>monthly</changefreq>
|
|
31
37
|
<priority>0.8</priority>
|
|
32
38
|
</url>
|
|
33
39
|
<url>
|
|
34
40
|
<loc>https://doc-builder-delta.vercel.app/guides/document-standards.html</loc>
|
|
35
|
-
<lastmod>2025-07-
|
|
41
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
36
42
|
<changefreq>monthly</changefreq>
|
|
37
43
|
<priority>0.8</priority>
|
|
38
44
|
</url>
|
|
39
45
|
<url>
|
|
40
46
|
<loc>https://doc-builder-delta.vercel.app/guides/documentation-standards.html</loc>
|
|
41
|
-
<lastmod>2025-07-
|
|
47
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
42
48
|
<changefreq>monthly</changefreq>
|
|
43
49
|
<priority>0.8</priority>
|
|
44
50
|
</url>
|
|
45
51
|
<url>
|
|
46
52
|
<loc>https://doc-builder-delta.vercel.app/guides/seo-guide.html</loc>
|
|
47
|
-
<lastmod>2025-07-
|
|
53
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
48
54
|
<changefreq>monthly</changefreq>
|
|
49
55
|
<priority>0.8</priority>
|
|
50
56
|
</url>
|
|
51
57
|
<url>
|
|
52
58
|
<loc>https://doc-builder-delta.vercel.app/guides/troubleshooting-guide.html</loc>
|
|
53
|
-
<lastmod>2025-07-
|
|
59
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
54
60
|
<changefreq>monthly</changefreq>
|
|
55
61
|
<priority>0.8</priority>
|
|
56
62
|
</url>
|
|
57
63
|
<url>
|
|
58
64
|
<loc>https://doc-builder-delta.vercel.app/index.html</loc>
|
|
59
|
-
<lastmod>2025-07-
|
|
65
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
60
66
|
<changefreq>weekly</changefreq>
|
|
61
67
|
<priority>1.0</priority>
|
|
62
68
|
</url>
|
|
63
69
|
<url>
|
|
64
70
|
<loc>https://doc-builder-delta.vercel.app/vercel-cli-setup-guide.html</loc>
|
|
65
|
-
<lastmod>2025-07-
|
|
71
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
66
72
|
<changefreq>monthly</changefreq>
|
|
67
73
|
<priority>0.8</priority>
|
|
68
74
|
</url>
|
|
69
75
|
<url>
|
|
70
76
|
<loc>https://doc-builder-delta.vercel.app/vercel-first-time-setup-guide.html</loc>
|
|
71
|
-
<lastmod>2025-07-
|
|
77
|
+
<lastmod>2025-07-22T06:01:14.316Z</lastmod>
|
|
72
78
|
<changefreq>monthly</changefreq>
|
|
73
79
|
<priority>0.8</priority>
|
|
74
80
|
</url>
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"name": "Knowcode Ltd",
|
|
59
59
|
"url": "https://knowcode.tech"
|
|
60
60
|
},
|
|
61
|
-
"datePublished": "2025-07-
|
|
62
|
-
"dateModified": "2025-07-
|
|
61
|
+
"datePublished": "2025-07-22T06:01:14.298Z",
|
|
62
|
+
"dateModified": "2025-07-22T06:01:14.298Z",
|
|
63
63
|
"mainEntityOfPage": {
|
|
64
64
|
"@type": "WebPage",
|
|
65
65
|
"@id": "https://doc-builder-delta.vercel.app/vercel-cli-setup-guide.html"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
<div class="header-actions">
|
|
94
94
|
<div class="deployment-info">
|
|
95
|
-
<span class="deployment-date" title="Built with doc-builder v1.5.
|
|
95
|
+
<span class="deployment-date" title="Built with doc-builder v1.5.2">Last updated: Jul 22, 2025, 06:01 AM UTC</span>
|
|
96
96
|
</div>
|
|
97
97
|
|
|
98
98
|
|
|
@@ -142,7 +142,6 @@
|
|
|
142
142
|
</a>
|
|
143
143
|
<div class="nav-content" >
|
|
144
144
|
<a href="/README.html" class="nav-item" data-tooltip="@knowcode/doc-builder."><i class="fas fa-file-alt"></i> Overview</a>
|
|
145
|
-
<a href="/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
|
|
146
145
|
<a href="/documentation-index.html" class="nav-item" data-tooltip="This directory contains additional documentation for the @knowcode/doc-builder project, organized by topic and purpose."><i class="fas fa-file-alt"></i> Documentation Index</a>
|
|
147
146
|
<a href="/vercel-cli-setup-guide.html" class="nav-item active" data-tooltip="This guide provides comprehensive instructions for installing and configuring the Vercel CLI across different operating systems and environments."><i class="fas fa-file-alt"></i> Vercel Cli Setup Guide</a>
|
|
148
147
|
<a href="/vercel-first-time-setup-guide.html" class="nav-item" data-tooltip="This guide provides a detailed explanation of every prompt you'll encounter during the first-time Vercel setup process when using."><i class="fas fa-file-alt"></i> Vercel First Time Setup Guide</a></div></div>
|
|
@@ -152,6 +151,7 @@
|
|
|
152
151
|
</a>
|
|
153
152
|
<div class="nav-content collapsed" id="nav-guides-1">
|
|
154
153
|
<a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="This guide explains how to configure and use the built-in authentication feature in @knowcode/doc-builder to protect your documentation with basic..."><i class="fas fa-file-alt"></i> Authentication Guide</a>
|
|
154
|
+
<a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
|
|
155
155
|
<a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
|
|
156
156
|
<a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="fas fa-file-alt"></i> Seo Guide</a>
|
|
157
157
|
<a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a></div></div>
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"name": "Knowcode Ltd",
|
|
59
59
|
"url": "https://knowcode.tech"
|
|
60
60
|
},
|
|
61
|
-
"datePublished": "2025-07-
|
|
62
|
-
"dateModified": "2025-07-
|
|
61
|
+
"datePublished": "2025-07-22T06:01:14.306Z",
|
|
62
|
+
"dateModified": "2025-07-22T06:01:14.306Z",
|
|
63
63
|
"mainEntityOfPage": {
|
|
64
64
|
"@type": "WebPage",
|
|
65
65
|
"@id": "https://doc-builder-delta.vercel.app/vercel-first-time-setup-guide.html"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
<div class="header-actions">
|
|
94
94
|
<div class="deployment-info">
|
|
95
|
-
<span class="deployment-date" title="Built with doc-builder v1.5.
|
|
95
|
+
<span class="deployment-date" title="Built with doc-builder v1.5.2">Last updated: Jul 22, 2025, 06:01 AM UTC</span>
|
|
96
96
|
</div>
|
|
97
97
|
|
|
98
98
|
|
|
@@ -142,7 +142,6 @@
|
|
|
142
142
|
</a>
|
|
143
143
|
<div class="nav-content" >
|
|
144
144
|
<a href="/README.html" class="nav-item" data-tooltip="@knowcode/doc-builder."><i class="fas fa-file-alt"></i> Overview</a>
|
|
145
|
-
<a href="/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
|
|
146
145
|
<a href="/documentation-index.html" class="nav-item" data-tooltip="This directory contains additional documentation for the @knowcode/doc-builder project, organized by topic and purpose."><i class="fas fa-file-alt"></i> Documentation Index</a>
|
|
147
146
|
<a href="/vercel-cli-setup-guide.html" class="nav-item" data-tooltip="This guide provides comprehensive instructions for installing and configuring the Vercel CLI across different operating systems and environments."><i class="fas fa-file-alt"></i> Vercel Cli Setup Guide</a>
|
|
148
147
|
<a href="/vercel-first-time-setup-guide.html" class="nav-item active" data-tooltip="This guide provides a detailed explanation of every prompt you'll encounter during the first-time Vercel setup process when using."><i class="fas fa-file-alt"></i> Vercel First Time Setup Guide</a></div></div>
|
|
@@ -152,6 +151,7 @@
|
|
|
152
151
|
</a>
|
|
153
152
|
<div class="nav-content collapsed" id="nav-guides-1">
|
|
154
153
|
<a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="This guide explains how to configure and use the built-in authentication feature in @knowcode/doc-builder to protect your documentation with basic..."><i class="fas fa-file-alt"></i> Authentication Guide</a>
|
|
154
|
+
<a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
|
|
155
155
|
<a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
|
|
156
156
|
<a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="fas fa-file-alt"></i> Seo Guide</a>
|
|
157
157
|
<a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a></div></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knowcode/doc-builder",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postinstall": "node scripts/setup.js || true",
|
|
11
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
+
"publish:npm": "./publish.sh",
|
|
13
|
+
"release": "./publish.sh"
|
|
12
14
|
},
|
|
13
15
|
"keywords": [
|
|
14
16
|
"documentation",
|
package/publish.sh
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Colors for output
|
|
4
|
+
RED='\033[0;31m'
|
|
5
|
+
GREEN='\033[0;32m'
|
|
6
|
+
YELLOW='\033[0;33m'
|
|
7
|
+
BLUE='\033[0;34m'
|
|
8
|
+
CYAN='\033[0;36m'
|
|
9
|
+
NC='\033[0m' # No Color
|
|
10
|
+
|
|
11
|
+
# Icons
|
|
12
|
+
CHECK="✓"
|
|
13
|
+
CROSS="✗"
|
|
14
|
+
ARROW="→"
|
|
15
|
+
INFO="ℹ"
|
|
16
|
+
WARN="⚠"
|
|
17
|
+
|
|
18
|
+
# Function to print colored output
|
|
19
|
+
print_info() {
|
|
20
|
+
echo -e "${BLUE}${INFO}${NC} $1"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
print_success() {
|
|
24
|
+
echo -e "${GREEN}${CHECK}${NC} $1"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
print_error() {
|
|
28
|
+
echo -e "${RED}${CROSS}${NC} $1"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
print_warning() {
|
|
32
|
+
echo -e "${YELLOW}${WARN}${NC} $1"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
print_step() {
|
|
36
|
+
echo -e "${CYAN}${ARROW}${NC} $1"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# Header
|
|
40
|
+
echo ""
|
|
41
|
+
echo -e "${BLUE}┌─────────────────────────────────────────┐${NC}"
|
|
42
|
+
echo -e "${BLUE}│ 📦 NPM Publishing Script │${NC}"
|
|
43
|
+
echo -e "${BLUE}│ @knowcode/doc-builder │${NC}"
|
|
44
|
+
echo -e "${BLUE}└─────────────────────────────────────────┘${NC}"
|
|
45
|
+
echo ""
|
|
46
|
+
|
|
47
|
+
# Check if we're in the right directory
|
|
48
|
+
if [ ! -f "package.json" ]; then
|
|
49
|
+
print_error "package.json not found! Are you in the project root?"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
# Get package info
|
|
54
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
55
|
+
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
56
|
+
|
|
57
|
+
print_info "Package: ${PACKAGE_NAME}"
|
|
58
|
+
print_info "Current version: ${CURRENT_VERSION}"
|
|
59
|
+
echo ""
|
|
60
|
+
|
|
61
|
+
# Check if user is logged into npm
|
|
62
|
+
print_step "Checking npm login status..."
|
|
63
|
+
if ! npm whoami &> /dev/null; then
|
|
64
|
+
print_error "You are not logged into npm!"
|
|
65
|
+
print_info "Please run: npm login"
|
|
66
|
+
exit 1
|
|
67
|
+
else
|
|
68
|
+
NPM_USER=$(npm whoami)
|
|
69
|
+
print_success "Logged in as: ${NPM_USER}"
|
|
70
|
+
fi
|
|
71
|
+
echo ""
|
|
72
|
+
|
|
73
|
+
# Check for uncommitted changes
|
|
74
|
+
print_step "Checking for uncommitted changes..."
|
|
75
|
+
if ! git diff-index --quiet HEAD --; then
|
|
76
|
+
print_warning "You have uncommitted changes!"
|
|
77
|
+
echo ""
|
|
78
|
+
git status --short
|
|
79
|
+
echo ""
|
|
80
|
+
read -p "Do you want to continue anyway? (y/N) " -n 1 -r
|
|
81
|
+
echo ""
|
|
82
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
83
|
+
print_info "Publishing cancelled."
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
else
|
|
87
|
+
print_success "Working directory is clean"
|
|
88
|
+
fi
|
|
89
|
+
echo ""
|
|
90
|
+
|
|
91
|
+
# Check if version exists on npm
|
|
92
|
+
print_step "Checking if version ${CURRENT_VERSION} is already published..."
|
|
93
|
+
if npm view "${PACKAGE_NAME}@${CURRENT_VERSION}" version &> /dev/null; then
|
|
94
|
+
print_error "Version ${CURRENT_VERSION} is already published!"
|
|
95
|
+
print_info "Please update the version in package.json first."
|
|
96
|
+
echo ""
|
|
97
|
+
|
|
98
|
+
# Show last few published versions
|
|
99
|
+
print_info "Recent versions:"
|
|
100
|
+
npm view "${PACKAGE_NAME}" versions --json | tail -5 | sed 's/,$//' | sed 's/^/ /'
|
|
101
|
+
echo ""
|
|
102
|
+
|
|
103
|
+
# Suggest next version
|
|
104
|
+
LATEST_VERSION=$(npm view "${PACKAGE_NAME}" version)
|
|
105
|
+
print_info "Latest published version: ${LATEST_VERSION}"
|
|
106
|
+
print_info "Suggested next versions:"
|
|
107
|
+
echo " - Patch: $(npx semver ${LATEST_VERSION} -i patch)"
|
|
108
|
+
echo " - Minor: $(npx semver ${LATEST_VERSION} -i minor)"
|
|
109
|
+
echo " - Major: $(npx semver ${LATEST_VERSION} -i major)"
|
|
110
|
+
exit 1
|
|
111
|
+
else
|
|
112
|
+
print_success "Version ${CURRENT_VERSION} is not yet published"
|
|
113
|
+
fi
|
|
114
|
+
echo ""
|
|
115
|
+
|
|
116
|
+
# Build the project
|
|
117
|
+
print_step "Building documentation..."
|
|
118
|
+
if node cli.js build > /dev/null 2>&1; then
|
|
119
|
+
print_success "Build completed successfully"
|
|
120
|
+
else
|
|
121
|
+
print_error "Build failed!"
|
|
122
|
+
print_info "Run 'node cli.js build' to see the error"
|
|
123
|
+
exit 1
|
|
124
|
+
fi
|
|
125
|
+
echo ""
|
|
126
|
+
|
|
127
|
+
# Run npm pack to preview
|
|
128
|
+
print_step "Creating package preview..."
|
|
129
|
+
PACK_FILE=$(npm pack --dry-run 2>&1 | grep -E "^[a-zA-Z0-9@/._-]+\.tgz$" | tail -1)
|
|
130
|
+
print_success "Package will be created as: ${PACK_FILE}"
|
|
131
|
+
|
|
132
|
+
# Show what will be published
|
|
133
|
+
print_info "Files to be included:"
|
|
134
|
+
npm pack --dry-run 2>&1 | grep -E "^npm notice.*[0-9]+B" | head -10 | sed 's/npm notice/ /'
|
|
135
|
+
TOTAL_FILES=$(npm pack --dry-run 2>&1 | grep -E "^npm notice total files:" | sed 's/npm notice total files://')
|
|
136
|
+
print_info "Total files:${TOTAL_FILES}"
|
|
137
|
+
echo ""
|
|
138
|
+
|
|
139
|
+
# Final confirmation
|
|
140
|
+
echo -e "${YELLOW}┌─────────────────────────────────────────┐${NC}"
|
|
141
|
+
echo -e "${YELLOW}│ READY TO PUBLISH │${NC}"
|
|
142
|
+
echo -e "${YELLOW}├─────────────────────────────────────────┤${NC}"
|
|
143
|
+
echo -e "${YELLOW}│${NC} Package: ${PACKAGE_NAME}"
|
|
144
|
+
echo -e "${YELLOW}│${NC} Version: ${CURRENT_VERSION}"
|
|
145
|
+
echo -e "${YELLOW}│${NC} User: ${NPM_USER}"
|
|
146
|
+
echo -e "${YELLOW}│${NC} Registry: https://registry.npmjs.org/"
|
|
147
|
+
echo -e "${YELLOW}└─────────────────────────────────────────┘${NC}"
|
|
148
|
+
echo ""
|
|
149
|
+
|
|
150
|
+
read -p "Do you want to publish to npm? (y/N) " -n 1 -r
|
|
151
|
+
echo ""
|
|
152
|
+
echo ""
|
|
153
|
+
|
|
154
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
155
|
+
print_warning "Publishing cancelled by user"
|
|
156
|
+
exit 0
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
# Publish to npm
|
|
160
|
+
print_step "Publishing to npm..."
|
|
161
|
+
echo ""
|
|
162
|
+
|
|
163
|
+
if npm publish; then
|
|
164
|
+
echo ""
|
|
165
|
+
print_success "Successfully published ${PACKAGE_NAME}@${CURRENT_VERSION}!"
|
|
166
|
+
echo ""
|
|
167
|
+
|
|
168
|
+
# Show post-publish info
|
|
169
|
+
echo -e "${GREEN}┌─────────────────────────────────────────┐${NC}"
|
|
170
|
+
echo -e "${GREEN}│ 🎉 PUBLISHED SUCCESSFULLY! │${NC}"
|
|
171
|
+
echo -e "${GREEN}└─────────────────────────────────────────┘${NC}"
|
|
172
|
+
echo ""
|
|
173
|
+
|
|
174
|
+
print_info "View on npm:"
|
|
175
|
+
echo " https://www.npmjs.com/package/${PACKAGE_NAME}"
|
|
176
|
+
echo ""
|
|
177
|
+
|
|
178
|
+
print_info "Install command:"
|
|
179
|
+
echo " npm install ${PACKAGE_NAME}@${CURRENT_VERSION}"
|
|
180
|
+
echo ""
|
|
181
|
+
|
|
182
|
+
print_info "Or use with npx:"
|
|
183
|
+
echo " npx ${PACKAGE_NAME}@latest"
|
|
184
|
+
echo ""
|
|
185
|
+
|
|
186
|
+
# Suggest next steps
|
|
187
|
+
print_info "Next steps:"
|
|
188
|
+
echo " 1. Create a git tag: git tag v${CURRENT_VERSION}"
|
|
189
|
+
echo " 2. Push the tag: git push origin v${CURRENT_VERSION}"
|
|
190
|
+
echo " 3. Create a GitHub release"
|
|
191
|
+
echo " 4. Update CHANGELOG.md for the next version"
|
|
192
|
+
echo ""
|
|
193
|
+
else
|
|
194
|
+
echo ""
|
|
195
|
+
print_error "Publishing failed!"
|
|
196
|
+
print_info "Check the error message above for details"
|
|
197
|
+
exit 1
|
|
198
|
+
fi
|
|
Binary file
|