@knowcode/doc-builder 1.5.2 → 1.5.4
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 +2 -1
- package/CHANGELOG.md +33 -0
- package/README.md +7 -30
- package/assets/css/notion-style.css +22 -2
- package/assets/js/main.js +53 -29
- package/cli.js +73 -0
- package/doc-builder.config.js +7 -1
- package/html/README.html +7 -3
- package/html/css/notion-style.css +22 -2
- package/html/documentation-index.html +7 -3
- package/html/guides/authentication-guide.html +7 -3
- package/html/guides/claude-workflow-guide.html +7 -3
- package/html/guides/documentation-standards.html +7 -3
- package/html/guides/google-site-verification-guide.html +338 -0
- package/html/guides/seo-guide.html +7 -3
- package/html/guides/troubleshooting-guide.html +7 -3
- package/html/index.html +7 -3
- package/html/js/main.js +53 -29
- package/html/sitemap.xml +19 -13
- package/html/vercel-cli-setup-guide.html +7 -3
- package/html/vercel-first-time-setup-guide.html +7 -3
- package/lib/core-builder.js +2 -1
- package/lib/seo.js +14 -1
- package/package.json +4 -2
- package/publish.sh +198 -0
package/html/sitemap.xml
CHANGED
|
@@ -2,79 +2,85 @@
|
|
|
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:56:56.811Z</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:56:56.811Z</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:56:56.811Z</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:56:56.811Z</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:56:56.811Z</lastmod>
|
|
30
30
|
<changefreq>monthly</changefreq>
|
|
31
31
|
<priority>0.8</priority>
|
|
32
32
|
</url>
|
|
33
33
|
<url>
|
|
34
34
|
<loc>https://doc-builder-delta.vercel.app/guides/claude-workflow-guide.html</loc>
|
|
35
|
-
<lastmod>2025-07-
|
|
35
|
+
<lastmod>2025-07-22T06:56:56.811Z</lastmod>
|
|
36
36
|
<changefreq>monthly</changefreq>
|
|
37
37
|
<priority>0.8</priority>
|
|
38
38
|
</url>
|
|
39
39
|
<url>
|
|
40
40
|
<loc>https://doc-builder-delta.vercel.app/guides/document-standards.html</loc>
|
|
41
|
-
<lastmod>2025-07-
|
|
41
|
+
<lastmod>2025-07-22T06:56:56.811Z</lastmod>
|
|
42
42
|
<changefreq>monthly</changefreq>
|
|
43
43
|
<priority>0.8</priority>
|
|
44
44
|
</url>
|
|
45
45
|
<url>
|
|
46
46
|
<loc>https://doc-builder-delta.vercel.app/guides/documentation-standards.html</loc>
|
|
47
|
-
<lastmod>2025-07-
|
|
47
|
+
<lastmod>2025-07-22T06:56:56.811Z</lastmod>
|
|
48
|
+
<changefreq>monthly</changefreq>
|
|
49
|
+
<priority>0.8</priority>
|
|
50
|
+
</url>
|
|
51
|
+
<url>
|
|
52
|
+
<loc>https://doc-builder-delta.vercel.app/guides/google-site-verification-guide.html</loc>
|
|
53
|
+
<lastmod>2025-07-22T06:56:56.811Z</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/seo-guide.html</loc>
|
|
53
|
-
<lastmod>2025-07-
|
|
59
|
+
<lastmod>2025-07-22T06:56:56.811Z</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/guides/troubleshooting-guide.html</loc>
|
|
59
|
-
<lastmod>2025-07-
|
|
65
|
+
<lastmod>2025-07-22T06:56:56.811Z</lastmod>
|
|
60
66
|
<changefreq>monthly</changefreq>
|
|
61
67
|
<priority>0.8</priority>
|
|
62
68
|
</url>
|
|
63
69
|
<url>
|
|
64
70
|
<loc>https://doc-builder-delta.vercel.app/index.html</loc>
|
|
65
|
-
<lastmod>2025-07-
|
|
71
|
+
<lastmod>2025-07-22T06:56:56.811Z</lastmod>
|
|
66
72
|
<changefreq>weekly</changefreq>
|
|
67
73
|
<priority>1.0</priority>
|
|
68
74
|
</url>
|
|
69
75
|
<url>
|
|
70
76
|
<loc>https://doc-builder-delta.vercel.app/vercel-cli-setup-guide.html</loc>
|
|
71
|
-
<lastmod>2025-07-
|
|
77
|
+
<lastmod>2025-07-22T06:56:56.811Z</lastmod>
|
|
72
78
|
<changefreq>monthly</changefreq>
|
|
73
79
|
<priority>0.8</priority>
|
|
74
80
|
</url>
|
|
75
81
|
<url>
|
|
76
82
|
<loc>https://doc-builder-delta.vercel.app/vercel-first-time-setup-guide.html</loc>
|
|
77
|
-
<lastmod>2025-07-
|
|
83
|
+
<lastmod>2025-07-22T06:56:56.811Z</lastmod>
|
|
78
84
|
<changefreq>monthly</changefreq>
|
|
79
85
|
<priority>0.8</priority>
|
|
80
86
|
</url>
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
<meta name="twitter:description" content="Vercel CLI Setup Guide.">
|
|
29
29
|
<meta name="twitter:image" content="https://doc-builder-delta.vercel.app/og-default.png">
|
|
30
30
|
|
|
31
|
+
<!-- Custom Meta Tags -->
|
|
32
|
+
<meta name="google-site-verification" content="FtzcDTf5BQ9K5EfnGazQkgU2U4FiN3ITzM7gHwqUAqQ">
|
|
33
|
+
|
|
31
34
|
<!-- Fonts -->
|
|
32
35
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
33
36
|
|
|
@@ -58,8 +61,8 @@
|
|
|
58
61
|
"name": "Knowcode Ltd",
|
|
59
62
|
"url": "https://knowcode.tech"
|
|
60
63
|
},
|
|
61
|
-
"datePublished": "2025-07-
|
|
62
|
-
"dateModified": "2025-07-
|
|
64
|
+
"datePublished": "2025-07-22T06:56:56.800Z",
|
|
65
|
+
"dateModified": "2025-07-22T06:56:56.800Z",
|
|
63
66
|
"mainEntityOfPage": {
|
|
64
67
|
"@type": "WebPage",
|
|
65
68
|
"@id": "https://doc-builder-delta.vercel.app/vercel-cli-setup-guide.html"
|
|
@@ -92,7 +95,7 @@
|
|
|
92
95
|
|
|
93
96
|
<div class="header-actions">
|
|
94
97
|
<div class="deployment-info">
|
|
95
|
-
<span class="deployment-date" title="Built with doc-builder v1.5.
|
|
98
|
+
<span class="deployment-date" title="Built with doc-builder v1.5.3">Last updated: Jul 22, 2025, 06:56 AM UTC</span>
|
|
96
99
|
</div>
|
|
97
100
|
|
|
98
101
|
|
|
@@ -153,6 +156,7 @@
|
|
|
153
156
|
<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
157
|
<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
158
|
<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>
|
|
159
|
+
<a href="/guides/google-site-verification-guide.html" class="nav-item" data-tooltip="Google Search Console verification allows you to: Monitor your site's performance in Google Search Submit sitemaps for better indexing View search..."><i class="fas fa-file-alt"></i> Google Site Verification Guide</a>
|
|
156
160
|
<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
161
|
<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>
|
|
158
162
|
</nav>
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
<meta name="twitter:description" content="Vercel First-Time Setup Guide - Complete Prompt-by-Prompt Walkthrough.">
|
|
29
29
|
<meta name="twitter:image" content="https://doc-builder-delta.vercel.app/og-default.png">
|
|
30
30
|
|
|
31
|
+
<!-- Custom Meta Tags -->
|
|
32
|
+
<meta name="google-site-verification" content="FtzcDTf5BQ9K5EfnGazQkgU2U4FiN3ITzM7gHwqUAqQ">
|
|
33
|
+
|
|
31
34
|
<!-- Fonts -->
|
|
32
35
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
33
36
|
|
|
@@ -58,8 +61,8 @@
|
|
|
58
61
|
"name": "Knowcode Ltd",
|
|
59
62
|
"url": "https://knowcode.tech"
|
|
60
63
|
},
|
|
61
|
-
"datePublished": "2025-07-
|
|
62
|
-
"dateModified": "2025-07-
|
|
64
|
+
"datePublished": "2025-07-22T06:56:56.803Z",
|
|
65
|
+
"dateModified": "2025-07-22T06:56:56.803Z",
|
|
63
66
|
"mainEntityOfPage": {
|
|
64
67
|
"@type": "WebPage",
|
|
65
68
|
"@id": "https://doc-builder-delta.vercel.app/vercel-first-time-setup-guide.html"
|
|
@@ -92,7 +95,7 @@
|
|
|
92
95
|
|
|
93
96
|
<div class="header-actions">
|
|
94
97
|
<div class="deployment-info">
|
|
95
|
-
<span class="deployment-date" title="Built with doc-builder v1.5.
|
|
98
|
+
<span class="deployment-date" title="Built with doc-builder v1.5.3">Last updated: Jul 22, 2025, 06:56 AM UTC</span>
|
|
96
99
|
</div>
|
|
97
100
|
|
|
98
101
|
|
|
@@ -153,6 +156,7 @@
|
|
|
153
156
|
<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
157
|
<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
158
|
<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>
|
|
159
|
+
<a href="/guides/google-site-verification-guide.html" class="nav-item" data-tooltip="Google Search Console verification allows you to: Monitor your site's performance in Google Search Submit sitemaps for better indexing View search..."><i class="fas fa-file-alt"></i> Google Site Verification Guide</a>
|
|
156
160
|
<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
161
|
<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>
|
|
158
162
|
</nav>
|
package/lib/core-builder.js
CHANGED
|
@@ -229,7 +229,8 @@ function generateHTML(title, content, navigation, currentPath = '', config = {},
|
|
|
229
229
|
ogImage: config.seo.ogImage,
|
|
230
230
|
siteName: siteName,
|
|
231
231
|
language: config.seo.language,
|
|
232
|
-
type: 'article'
|
|
232
|
+
type: 'article',
|
|
233
|
+
customMetaTags: config.seo.customMetaTags || []
|
|
233
234
|
});
|
|
234
235
|
|
|
235
236
|
// Generate JSON-LD
|
package/lib/seo.js
CHANGED
|
@@ -84,7 +84,8 @@ function generateMetaTags(options) {
|
|
|
84
84
|
ogImage,
|
|
85
85
|
siteName,
|
|
86
86
|
language = 'en-US',
|
|
87
|
-
type = 'article'
|
|
87
|
+
type = 'article',
|
|
88
|
+
customMetaTags = []
|
|
88
89
|
} = options;
|
|
89
90
|
|
|
90
91
|
const tags = [];
|
|
@@ -157,6 +158,18 @@ function generateMetaTags(options) {
|
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
|
|
161
|
+
// Add custom meta tags
|
|
162
|
+
if (customMetaTags && customMetaTags.length > 0) {
|
|
163
|
+
tags.push(` \n <!-- Custom Meta Tags -->`);
|
|
164
|
+
customMetaTags.forEach(tag => {
|
|
165
|
+
if (tag.name && tag.content) {
|
|
166
|
+
tags.push(` <meta name="${escapeHtml(tag.name)}" content="${escapeHtml(tag.content)}">`);
|
|
167
|
+
} else if (tag.property && tag.content) {
|
|
168
|
+
tags.push(` <meta property="${escapeHtml(tag.property)}" content="${escapeHtml(tag.content)}">`);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
160
173
|
return tags.join('\n');
|
|
161
174
|
}
|
|
162
175
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knowcode/doc-builder",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
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
|