@knowcode/doc-builder 1.9.5 → 1.9.7

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.
Files changed (45) hide show
  1. package/CLAUDE.md +23 -1
  2. package/doc-builder.config.js +1 -0
  3. package/html/README.html +43 -43
  4. package/html/documentation-index.html +43 -43
  5. package/html/guides/authentication-default-change.html +43 -43
  6. package/html/guides/authentication-guide.html +43 -43
  7. package/html/guides/claude-workflow-guide.html +43 -43
  8. package/html/guides/documentation-standards.html +44 -44
  9. package/html/guides/html-embedding-guide.html +43 -43
  10. package/html/guides/image-modal-guide.html +43 -43
  11. package/html/guides/phosphor-icons-guide.html +43 -43
  12. package/html/guides/private-directory-authentication-troubleshooting.html +43 -43
  13. package/html/guides/private-directory-authentication.html +43 -43
  14. package/html/guides/public-site-deployment.html +43 -43
  15. package/html/guides/search-engine-verification-guide.html +43 -43
  16. package/html/guides/seo-guide.html +43 -43
  17. package/html/guides/seo-optimization-guide.html +43 -43
  18. package/html/guides/troubleshooting-guide.html +43 -43
  19. package/html/guides/windows-setup-guide.html +43 -43
  20. package/html/image-modal-test.html +43 -43
  21. package/html/index.html +43 -43
  22. package/html/private/cache-control-anti-pattern.html +43 -43
  23. package/html/private/launch/README.html +43 -43
  24. package/html/private/launch/auth-cleanup-summary.html +43 -43
  25. package/html/private/launch/bubble-plugin-specification.html +43 -43
  26. package/html/private/launch/go-to-market-strategy.html +43 -43
  27. package/html/private/launch/launch-announcements.html +43 -43
  28. package/html/private/launch/vercel-deployment-auth-setup.html +43 -43
  29. package/html/private/next-steps-walkthrough.html +43 -43
  30. package/html/private/supabase-auth-implementation-completed.html +43 -43
  31. package/html/private/supabase-auth-implementation-plan.html +43 -43
  32. package/html/private/supabase-auth-integration-plan.html +43 -43
  33. package/html/private/supabase-auth-setup-guide.html +43 -43
  34. package/html/private/test-private-doc.html +43 -43
  35. package/html/private/user-management-tooling.html +43 -43
  36. package/html/prompts/markdown-document-standards.html +43 -43
  37. package/html/sitemap.xml +56 -50
  38. package/html/test-status.html +281 -0
  39. package/html/vercel-cli-setup-guide.html +43 -43
  40. package/html/vercel-first-time-setup-guide.html +43 -43
  41. package/lib/config.js +126 -3
  42. package/lib/core-builder.js +147 -28
  43. package/lib/emoji-mapper.js +16 -0
  44. package/package.json +4 -5
  45. package/publish.sh +0 -316
package/publish.sh DELETED
@@ -1,316 +0,0 @@
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
-
76
- # Count uncommitted changes excluding html directory
77
- UNCOMMITTED_COUNT=$(git diff-index HEAD -- | grep -v "^:.*html/" | wc -l | xargs)
78
- HTML_CHANGES=$(git diff-index HEAD -- | grep "^:.*html/" | wc -l | xargs)
79
-
80
- if [ "$UNCOMMITTED_COUNT" -gt 0 ] || [ "$HTML_CHANGES" -gt 0 ]; then
81
- if [ "$UNCOMMITTED_COUNT" -gt 0 ]; then
82
- print_warning "You have uncommitted changes!"
83
- echo ""
84
- git status --short | grep -v "^ M html/"
85
- echo ""
86
- fi
87
-
88
- if [ "$HTML_CHANGES" -gt 0 ]; then
89
- print_info "Generated HTML files have changed (${HTML_CHANGES} files)"
90
- echo ""
91
- read -p "Commit generated HTML files? (Y/n) " -n 1 -r
92
- echo ""
93
-
94
- if [[ ! $REPLY =~ ^[Nn]$ ]]; then
95
- print_step "Committing HTML files..."
96
- git add html/
97
- git commit -m "chore: update generated HTML files" > /dev/null
98
- print_success "HTML files committed"
99
- fi
100
- fi
101
-
102
- # Check again for non-HTML changes
103
- UNCOMMITTED_COUNT=$(git diff-index HEAD -- | grep -v "^:.*html/" | wc -l | xargs)
104
- if [ "$UNCOMMITTED_COUNT" -gt 0 ]; then
105
- echo ""
106
- read -p "Continue with uncommitted changes? (y/N) " -n 1 -r
107
- echo ""
108
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
109
- print_info "Publishing cancelled."
110
- exit 1
111
- fi
112
- fi
113
- else
114
- print_success "Working directory is clean"
115
- fi
116
- echo ""
117
-
118
- # Check if version exists on npm
119
- print_step "Checking if version ${CURRENT_VERSION} is already published..."
120
- if npm view "${PACKAGE_NAME}@${CURRENT_VERSION}" version &> /dev/null; then
121
- print_error "Version ${CURRENT_VERSION} is already published!"
122
- echo ""
123
-
124
- # Show last few published versions
125
- print_info "Recent versions:"
126
- npm view "${PACKAGE_NAME}" versions --json | tail -5 | sed 's/,$//' | sed 's/^/ /'
127
- echo ""
128
-
129
- # Suggest next version
130
- LATEST_VERSION=$(npm view "${PACKAGE_NAME}" version)
131
- print_info "Latest published version: ${LATEST_VERSION}"
132
-
133
- # Calculate next versions
134
- PATCH_VERSION=$(npx semver ${LATEST_VERSION} -i patch)
135
- MINOR_VERSION=$(npx semver ${LATEST_VERSION} -i minor)
136
- MAJOR_VERSION=$(npx semver ${LATEST_VERSION} -i major)
137
-
138
- print_info "Suggested next versions:"
139
- echo " 1) Patch: ${PATCH_VERSION} (bug fixes)"
140
- echo " 2) Minor: ${MINOR_VERSION} (new features)"
141
- echo " 3) Major: ${MAJOR_VERSION} (breaking changes)"
142
- echo ""
143
-
144
- # Ask user to choose
145
- read -p "Would you like to auto-increment the version? (1/2/3/N) " -n 1 -r
146
- echo ""
147
-
148
- case $REPLY in
149
- 1)
150
- NEW_VERSION=$PATCH_VERSION
151
- VERSION_TYPE="patch"
152
- ;;
153
- 2)
154
- NEW_VERSION=$MINOR_VERSION
155
- VERSION_TYPE="minor"
156
- ;;
157
- 3)
158
- NEW_VERSION=$MAJOR_VERSION
159
- VERSION_TYPE="major"
160
- ;;
161
- *)
162
- print_info "Please update the version in package.json manually."
163
- exit 1
164
- ;;
165
- esac
166
-
167
- print_step "Updating version to ${NEW_VERSION}..."
168
-
169
- # Update package.json
170
- npm version ${VERSION_TYPE} --no-git-tag-version > /dev/null
171
-
172
- # Update CHANGELOG.md if it exists
173
- if [ -f "CHANGELOG.md" ]; then
174
- print_step "Updating CHANGELOG.md..."
175
-
176
- # Create new changelog entry
177
- DATE=$(date +%Y-%m-%d)
178
- NEW_ENTRY="## [${NEW_VERSION}] - ${DATE}\n\n### Changed\n- \n\n"
179
-
180
- # Insert after the header (assuming standard changelog format)
181
- sed -i.bak "/^## \[/i\\
182
- ${NEW_ENTRY}" CHANGELOG.md
183
- rm CHANGELOG.md.bak
184
-
185
- print_warning "Please edit CHANGELOG.md to add your changes"
186
- print_info "Opening CHANGELOG.md in default editor..."
187
-
188
- # Open in default editor if available
189
- if command -v code &> /dev/null; then
190
- code CHANGELOG.md
191
- elif command -v nano &> /dev/null; then
192
- nano CHANGELOG.md
193
- elif command -v vim &> /dev/null; then
194
- vim CHANGELOG.md
195
- fi
196
-
197
- echo ""
198
- read -p "Press enter when you've updated the CHANGELOG..." -r
199
- echo ""
200
- fi
201
-
202
- # Commit the version bump
203
- print_step "Committing version bump..."
204
- git add package.json package-lock.json CHANGELOG.md 2>/dev/null
205
- git commit -m "chore: bump version to ${NEW_VERSION}" > /dev/null
206
- print_success "Version bumped to ${NEW_VERSION}"
207
-
208
- # Update current version for the rest of the script
209
- CURRENT_VERSION=$NEW_VERSION
210
- else
211
- print_success "Version ${CURRENT_VERSION} is not yet published"
212
- fi
213
- echo ""
214
-
215
- # Build the project
216
- print_step "Building documentation..."
217
- if node cli.js build > /dev/null 2>&1; then
218
- print_success "Build completed successfully"
219
- else
220
- print_error "Build failed!"
221
- print_info "Run 'node cli.js build' to see the error"
222
- exit 1
223
- fi
224
- echo ""
225
-
226
- # Run npm pack to preview
227
- print_step "Creating package preview..."
228
- PACK_FILE=$(npm pack --dry-run 2>&1 | grep -E "^[a-zA-Z0-9@/._-]+\.tgz$" | tail -1)
229
- print_success "Package will be created as: ${PACK_FILE}"
230
-
231
- # Show what will be published
232
- print_info "Files to be included:"
233
- npm pack --dry-run 2>&1 | grep -E "^npm notice.*[0-9]+B" | head -10 | sed 's/npm notice/ /'
234
- TOTAL_FILES=$(npm pack --dry-run 2>&1 | grep -E "^npm notice total files:" | sed 's/npm notice total files://')
235
- print_info "Total files:${TOTAL_FILES}"
236
- echo ""
237
-
238
- # Final confirmation
239
- echo -e "${YELLOW}┌─────────────────────────────────────────┐${NC}"
240
- echo -e "${YELLOW}│ READY TO PUBLISH │${NC}"
241
- echo -e "${YELLOW}├─────────────────────────────────────────┤${NC}"
242
- echo -e "${YELLOW}│${NC} Package: ${PACKAGE_NAME}"
243
- echo -e "${YELLOW}│${NC} Version: ${CURRENT_VERSION}"
244
- echo -e "${YELLOW}│${NC} User: ${NPM_USER}"
245
- echo -e "${YELLOW}│${NC} Registry: https://registry.npmjs.org/"
246
- echo -e "${YELLOW}└─────────────────────────────────────────┘${NC}"
247
- echo ""
248
-
249
- read -p "Do you want to publish to npm? (y/N) " -n 1 -r
250
- echo ""
251
- echo ""
252
-
253
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
254
- print_warning "Publishing cancelled by user"
255
- exit 0
256
- fi
257
-
258
- # Publish to npm
259
- print_step "Publishing to npm..."
260
- echo ""
261
-
262
- if npm publish; then
263
- echo ""
264
- print_success "Successfully published ${PACKAGE_NAME}@${CURRENT_VERSION}!"
265
- echo ""
266
-
267
- # Show post-publish info
268
- echo -e "${GREEN}┌─────────────────────────────────────────┐${NC}"
269
- echo -e "${GREEN}│ 🎉 PUBLISHED SUCCESSFULLY! │${NC}"
270
- echo -e "${GREEN}└─────────────────────────────────────────┘${NC}"
271
- echo ""
272
-
273
- print_info "View on npm:"
274
- echo " https://www.npmjs.com/package/${PACKAGE_NAME}"
275
- echo ""
276
-
277
- print_info "Install command:"
278
- echo " npm install ${PACKAGE_NAME}@${CURRENT_VERSION}"
279
- echo ""
280
-
281
- print_info "Or use with npx:"
282
- echo " npx ${PACKAGE_NAME}@latest"
283
- echo ""
284
-
285
- # Automatically create and push git tag
286
- print_step "Creating git tag v${CURRENT_VERSION}..."
287
- if git tag "v${CURRENT_VERSION}" 2>/dev/null; then
288
- print_success "Git tag created"
289
-
290
- echo ""
291
- read -p "Push tag to origin? (Y/n) " -n 1 -r
292
- echo ""
293
-
294
- if [[ ! $REPLY =~ ^[Nn]$ ]]; then
295
- print_step "Pushing tag to origin..."
296
- if git push origin "v${CURRENT_VERSION}"; then
297
- print_success "Tag pushed successfully"
298
- else
299
- print_warning "Failed to push tag. Run manually: git push origin v${CURRENT_VERSION}"
300
- fi
301
- fi
302
- else
303
- print_warning "Tag v${CURRENT_VERSION} already exists"
304
- fi
305
-
306
- echo ""
307
- print_info "Next steps:"
308
- echo " 1. Create a GitHub release at: https://github.com/knowcode/doc-builder/releases/new"
309
- echo " 2. Deploy example site: npx @knowcode/doc-builder@latest deploy"
310
- echo ""
311
- else
312
- echo ""
313
- print_error "Publishing failed!"
314
- print_info "Check the error message above for details"
315
- exit 1
316
- fi