From 5b24a51566fd318dff82fc9b41d767efde43557c Mon Sep 17 00:00:00 2001 From: Ankur Mursalin Date: Wed, 19 Nov 2025 07:24:11 +0600 Subject: [PATCH 1/6] feat: update documentation --- docs/FRAMEWORK_AGNOSTIC_GUIDE.md | 14 ++++++------ docs/NPM_READY.md | 20 ++++++++--------- docs/WEB_SEARCH_IMPLEMENTATION_STATUS.md | 8 +++---- documentation/index.md | 28 ++++++++++++------------ 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/FRAMEWORK_AGNOSTIC_GUIDE.md b/docs/FRAMEWORK_AGNOSTIC_GUIDE.md index 16f612e..6022f43 100644 --- a/docs/FRAMEWORK_AGNOSTIC_GUIDE.md +++ b/docs/FRAMEWORK_AGNOSTIC_GUIDE.md @@ -639,10 +639,10 @@ jobs: ## Benefits -✅ **No Version Conflicts**: Uses project's own dependencies -✅ **Smaller Bundle**: No duplicate dependencies -✅ **Framework Agnostic**: Works with any framework or vanilla JS -✅ **Type Safe**: Full TypeScript support -✅ **Tree Shakeable**: Import only what you need -✅ **Future Proof**: Easy to add more framework adapters -✅ **Wide Node Support**: Works with Node 16-22 +- ✅ **No Version Conflicts**: Uses project's own dependencies +- ✅ **Smaller Bundle**: No duplicate dependencies +- ✅ **Framework Agnostic**: Works with any framework or vanilla JS +- ✅ **Type Safe**: Full TypeScript support +- ✅ **Tree Shakeable**: Import only what you need +- ✅ **Future Proof**: Easy to add more framework adapters +- ✅ **Wide Node Support**: Works with Node 16-22 diff --git a/docs/NPM_READY.md b/docs/NPM_READY.md index 349e6a7..8350fb5 100644 --- a/docs/NPM_READY.md +++ b/docs/NPM_READY.md @@ -156,16 +156,16 @@ See PUBLISH.md for detailed publishing instructions. ## Key Features -✅ **Framework Agnostic** - Works with React, Vue, Svelte, or vanilla JS -✅ **Multi-page PDFs** - Automatic page splitting with smart pagination -✅ **GoFullPage Approach** - Captures full content height, no viewport limits -✅ **TypeScript First** - Full type definitions included -✅ **Tree Shakeable** - Import only what you need -✅ **Zero Config** - Works out of the box with sensible defaults -✅ **Progress Tracking** - Real-time progress callbacks -✅ **Image Handling** - SVG conversion, optimization, background images -✅ **Table Support** - Smart table splitting with header repetition -✅ **Device Independent** - Same output on all devices +- ✅ **Framework Agnostic** - Works with React, Vue, Svelte, or vanilla JS +- ✅ **Multi-page PDFs** - Automatic page splitting with smart pagination +- ✅ **GoFullPage Approach** - Captures full content height, no viewport limits +- ✅ **TypeScript First** - Full type definitions included +- ✅ **Tree Shakeable** - Import only what you need +- ✅ **Zero Config** - Works out of the box with sensible defaults +- ✅ **Progress Tracking** - Real-time progress callbacks +- ✅ **Image Handling** - SVG conversion, optimization, background images +- ✅ **Table Support** - Smart table splitting with header repetition +- ✅ **Device Independent** - Same output on all devices ## Package Size diff --git a/docs/WEB_SEARCH_IMPLEMENTATION_STATUS.md b/docs/WEB_SEARCH_IMPLEMENTATION_STATUS.md index 92461ee..648e48a 100644 --- a/docs/WEB_SEARCH_IMPLEMENTATION_STATUS.md +++ b/docs/WEB_SEARCH_IMPLEMENTATION_STATUS.md @@ -388,10 +388,10 @@ imageOptions: { **Version 1.0.0 addresses ALL critical pain points** identified in web research: -✅ **Image Quality** - Completely solved with Phase 4 enhancements -✅ **Text Searchability** - Built-in from day 1 -✅ **Core Features** - All high-demand features implemented -✅ **Production Ready** - 50+ exports, full TypeScript, 4 framework adapters +- ✅ **Image Quality** - Completely solved with Phase 4 enhancements +- ✅ **Text Searchability** - Built-in from day 1 +- ✅ **Core Features** - All high-demand features implemented +- ✅ **Production Ready** - 50+ exports, full TypeScript, 4 framework adapters The library is **production-ready** and addresses the most common user complaints found in web research. Future enhancements (forms, multi-column, PDF/A) are lower priority features that can be added based on user demand. diff --git a/documentation/index.md b/documentation/index.md index 1820d9c..108f10e 100644 --- a/documentation/index.md +++ b/documentation/index.md @@ -90,20 +90,20 @@ function MyComponent() { ## Key Features at a Glance -✅ **Multi-page support** with smart pagination -✅ **Framework adapters** for React, Vue, Svelte -✅ **OKLCH color support** and Tailwind CSS compatibility -✅ **Image optimization** with SVG conversion & DPI control -✅ **Table pagination** with header repetition -✅ **Watermarks** (text and image) -✅ **Headers/Footers** with dynamic template variables -✅ **PDF Metadata** (title, author, subject, keywords) -✅ **PDF Security** (password protection & permissions) -✅ **PDF Preview** (real-time preview with live updates) -✅ **Media type emulation** (@media print support) -✅ **Full TypeScript support** -✅ **Progress tracking** -✅ **Batch generation** with PDF merging +- ✅ **Multi-page support** with smart pagination +- ✅ **Framework adapters** for React, Vue, Svelte +- ✅ **OKLCH color support** and Tailwind CSS compatibility +- ✅ **Image optimization** with SVG conversion & DPI control +- ✅ **Table pagination** with header repetition +- ✅ **Watermarks** (text and image) +- ✅ **Headers/Footers** with dynamic template variables +- ✅ **PDF Metadata** (title, author, subject, keywords) +- ✅ **PDF Security** (password protection & permissions) +- ✅ **PDF Preview** (real-time preview with live updates) +- ✅ **Media type emulation** (@media print support) +- ✅ **Full TypeScript support** +- ✅ **Progress tracking** +- ✅ **Batch generation** with PDF merging --- From 475e6e10790a869765d055975b0e6dd887b68dc5 Mon Sep 17 00:00:00 2001 From: Ankur Mursalin Date: Wed, 19 Nov 2025 07:35:59 +0600 Subject: [PATCH 2/6] feat: update publishing script and related doc --- .github/PUBLISHING.md | 6 ++- docs/SETUP_SUMMARY.md | 8 ++- scripts/README.md | 109 ++++++++++++++++++++++++++++++++++++--- scripts/publish-major.sh | 85 ++++++++++++++++++++++++++++++ scripts/publish-minor.sh | 75 +++++++++++++++++++++++++++ scripts/publish-patch.sh | 6 +-- 6 files changed, 277 insertions(+), 12 deletions(-) create mode 100755 scripts/publish-major.sh create mode 100755 scripts/publish-minor.sh diff --git a/.github/PUBLISHING.md b/.github/PUBLISHING.md index 4928884..5d26dfd 100644 --- a/.github/PUBLISHING.md +++ b/.github/PUBLISHING.md @@ -625,9 +625,13 @@ For common scenarios like needing to republish with fixes, use the helper script ```bash ./scripts/publish-patch.sh + +./scripts/publish-minor.sh + +./scripts/publish-major.sh ``` -This script handles: +These scripts handles: - Version bumping - Tag management - Committing and pushing diff --git a/docs/SETUP_SUMMARY.md b/docs/SETUP_SUMMARY.md index 429bc9c..54cd94c 100644 --- a/docs/SETUP_SUMMARY.md +++ b/docs/SETUP_SUMMARY.md @@ -33,10 +33,14 @@ Comprehensive publishing guide covering: ### 3. Helper Scripts -#### `scripts/publish-patch.sh` -Automated patch version publishing: +#### `scripts/publish-*.sh` +Automated version publishing: ```bash ./scripts/publish-patch.sh + +./scripts/publish-minor.sh + +./scripts/publish-major.sh ``` - Bumps version - Manages tags diff --git a/scripts/README.md b/scripts/README.md index 74d74f1..963abd0 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,15 +1,34 @@ # Publishing Scripts -Helper scripts for managing package releases. +Helper scripts for managing package releases following semantic versioning. + +## Overview + +Three scripts automate version bumping and publishing: +- **publish-patch.sh** - Bug fixes (1.0.0 → 1.0.1) +- **publish-minor.sh** - New features (1.0.5 → 1.1.0) +- **publish-major.sh** - Breaking changes (1.5.3 → 2.0.0) + +All scripts: +- Automatically calculate the new version +- Commit the version bump +- Clean up any existing tags (from previous failed attempts) +- Create and push new version tag +- Trigger GitHub Actions publish workflow + +**Making scripts executable:** +```bash +chmod +x scripts/publish-patch.sh scripts/publish-minor.sh scripts/publish-major.sh +``` ## publish-patch.sh -Automates the complete patch version release workflow. +Automates patch version releases for bug fixes and minor improvements. **What it does:** 1. Bumps patch version in package.json (e.g., 1.0.0 → 1.0.1) 2. Commits the version bump -3. Deletes old tag if it exists (both local and remote) +3. Deletes NEW version tag if it exists (from previous failed attempt) 4. Creates new version tag 5. Pushes everything to trigger GitHub Actions publish workflow @@ -21,8 +40,8 @@ Automates the complete patch version release workflow. **When to use:** - Publishing bug fixes - After making workflow/configuration changes -- When you need to republish after fixing issues -- Moving a tag to a newer commit +- Documentation updates +- Performance improvements without API changes **Prerequisites:** - All changes committed @@ -45,7 +64,7 @@ Continue? (y/n) y Step 1: Updating version to 1.0.1... Step 2: Committing version bump... -Step 3: Deleting old v1.0.0 tag if it exists... +Step 3: Deleting v1.0.1 tag if it exists (from previous failed attempt)... Step 4: Creating v1.0.1 tag... Step 5: Getting current branch... Step 6: Pushing to remote... @@ -53,6 +72,84 @@ Step 6: Pushing to remote... ✅ Done! ``` +## publish-minor.sh + +Automates minor version releases for new features. + +**What it does:** +1. Bumps minor version in package.json (e.g., 1.0.5 → 1.1.0) +2. Commits the version bump +3. Deletes NEW version tag if it exists (from previous failed attempt) +4. Creates new version tag +5. Pushes everything to trigger GitHub Actions publish workflow + +**Usage:** +```bash +./scripts/publish-minor.sh +``` + +**When to use:** +- Adding new features +- New framework adapters +- New configuration options +- Backwards-compatible API additions + +**Prerequisites:** +- All changes committed +- Clean working directory +- On the correct branch +- New features tested and documented + +**Example:** +``` +Current: 1.2.5 +New: 1.3.0 +``` + +## publish-major.sh + +Automates major version releases for breaking changes. + +**What it does:** +1. Bumps major version in package.json (e.g., 1.5.3 → 2.0.0) +2. Commits the version bump with BREAKING CHANGE notice +3. Deletes NEW version tag if it exists (from previous failed attempt) +4. Creates new version tag +5. Pushes everything to trigger GitHub Actions publish workflow + +**Usage:** +```bash +./scripts/publish-major.sh +``` + +**When to use:** +- Breaking API changes +- Removing deprecated features +- Major refactoring that affects public API +- Incompatible updates to dependencies + +**Prerequisites:** +- All changes committed +- Clean working directory +- **CHANGELOG.md updated with breaking changes** +- **Migration guide prepared** +- Breaking changes reviewed and documented + +**Example:** +``` +⚠️ WARNING: This is a MAJOR version bump! + +Current version: 1.5.3 +New version will be: 2.0.0 + +⚠️ This is a breaking change! Make sure you've: + - Updated CHANGELOG.md with breaking changes + - Updated migration guide + - Reviewed all breaking API changes + +Are you sure you want to continue? (y/n) +``` + ## verify-package.cjs Verifies package structure before publishing. diff --git a/scripts/publish-major.sh b/scripts/publish-major.sh new file mode 100755 index 0000000..1eda2cf --- /dev/null +++ b/scripts/publish-major.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# Script to publish a major version (e.g., 1.5.3 → 2.0.0) +# This handles the complete workflow including tag management + +set -e + +echo "===== Publishing Major Version =====" +echo "" +echo "⚠️ WARNING: This is a MAJOR version bump!" +echo "This indicates breaking changes and will reset minor/patch to 0." +echo "" +echo "This script will:" +echo "1. Bump major version in package.json (e.g., 1.5.3 → 2.0.0)" +echo "2. Commit the version bump" +echo "3. Delete old tag if it exists (local and remote)" +echo "4. Create new version tag" +echo "5. Push everything to trigger the GitHub Actions publish workflow" +echo "" + +# Get current version +CURRENT_VERSION=$(node -p "require('./package.json').version") +echo "Current version: $CURRENT_VERSION" + +# Calculate new version (major bump) +IFS='.' read -r -a version_parts <<< "$CURRENT_VERSION" +major="${version_parts[0]}" +new_major=$((major + 1)) +NEW_VERSION="$new_major.0.0" + +echo "New version will be: $NEW_VERSION" +echo "" +echo "⚠️ This is a breaking change! Make sure you've:" +echo " - Updated CHANGELOG.md with breaking changes" +echo " - Updated migration guide" +echo " - Reviewed all breaking API changes" +echo "" + +read -p "Are you sure you want to continue? (y/n) " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Cancelled." + exit 1 +fi + +echo "" +echo "Step 1: Updating version to $NEW_VERSION..." +pnpm version major --no-git-tag-version + +echo "Step 2: Committing version bump..." +git add package.json +git commit -m "chore: bump version to $NEW_VERSION + +BREAKING CHANGE: Major release with breaking changes. +See CHANGELOG.md for migration guide." + +echo "Step 3: Deleting v$NEW_VERSION tag if it exists (from previous failed attempt)..." +git tag -d "v$NEW_VERSION" 2>/dev/null || echo " (no local tag to delete)" +git push origin --delete "v$NEW_VERSION" 2>/dev/null || echo " (no remote tag to delete)" + +echo "Step 4: Creating v$NEW_VERSION tag..." +git tag "v$NEW_VERSION" + +echo "Step 5: Getting current branch..." +CURRENT_BRANCH=$(git branch --show-current) +echo " Current branch: $CURRENT_BRANCH" + +echo "Step 6: Pushing to remote..." +git push origin "$CURRENT_BRANCH" +git push origin "v$NEW_VERSION" + +echo "" +echo "✅ Done!" +echo "" +echo "Next steps:" +echo "1. Monitor GitHub Actions workflow:" +echo " https://github.com/Encryptioner/html-to-pdf-generator/actions" +echo "" +echo "2. Once published, verify on NPM:" +echo " https://www.npmjs.com/package/@encryptioner/html-to-pdf-generator" +echo "" +echo "3. Test installation:" +echo " npm install @encryptioner/html-to-pdf-generator@$NEW_VERSION" +echo "" +echo "4. Update documentation with migration guide" +echo "" diff --git a/scripts/publish-minor.sh b/scripts/publish-minor.sh new file mode 100755 index 0000000..1dcc357 --- /dev/null +++ b/scripts/publish-minor.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# Script to publish a minor version (e.g., 1.0.5 → 1.1.0) +# This handles the complete workflow including tag management + +set -e + +echo "===== Publishing Minor Version =====" +echo "" +echo "This script will:" +echo "1. Bump minor version in package.json (e.g., 1.0.5 → 1.1.0)" +echo "2. Commit the version bump" +echo "3. Delete old tag if it exists (local and remote)" +echo "4. Create new version tag" +echo "5. Push everything to trigger the GitHub Actions publish workflow" +echo "" + +# Get current version +CURRENT_VERSION=$(node -p "require('./package.json').version") +echo "Current version: $CURRENT_VERSION" + +# Calculate new version (minor bump) +IFS='.' read -r -a version_parts <<< "$CURRENT_VERSION" +major="${version_parts[0]}" +minor="${version_parts[1]}" +new_minor=$((minor + 1)) +NEW_VERSION="$major.$new_minor.0" + +echo "New version will be: $NEW_VERSION" +echo "" + +read -p "Continue? (y/n) " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Cancelled." + exit 1 +fi + +echo "" +echo "Step 1: Updating version to $NEW_VERSION..." +pnpm version minor --no-git-tag-version + +echo "Step 2: Committing version bump..." +git add package.json +git commit -m "chore: bump version to $NEW_VERSION + +Minor release with new features and improvements." + +echo "Step 3: Deleting v$NEW_VERSION tag if it exists (from previous failed attempt)..." +git tag -d "v$NEW_VERSION" 2>/dev/null || echo " (no local tag to delete)" +git push origin --delete "v$NEW_VERSION" 2>/dev/null || echo " (no remote tag to delete)" + +echo "Step 4: Creating v$NEW_VERSION tag..." +git tag "v$NEW_VERSION" + +echo "Step 5: Getting current branch..." +CURRENT_BRANCH=$(git branch --show-current) +echo " Current branch: $CURRENT_BRANCH" + +echo "Step 6: Pushing to remote..." +git push origin "$CURRENT_BRANCH" +git push origin "v$NEW_VERSION" + +echo "" +echo "✅ Done!" +echo "" +echo "Next steps:" +echo "1. Monitor GitHub Actions workflow:" +echo " https://github.com/Encryptioner/html-to-pdf-generator/actions" +echo "" +echo "2. Once published, verify on NPM:" +echo " https://www.npmjs.com/package/@encryptioner/html-to-pdf-generator" +echo "" +echo "3. Test installation:" +echo " npm install @encryptioner/html-to-pdf-generator@$NEW_VERSION" +echo "" diff --git a/scripts/publish-patch.sh b/scripts/publish-patch.sh index a7a350c..d08025f 100755 --- a/scripts/publish-patch.sh +++ b/scripts/publish-patch.sh @@ -46,9 +46,9 @@ git commit -m "chore: bump version to $NEW_VERSION Patch release with workflow fixes and improvements." -echo "Step 3: Deleting old v$CURRENT_VERSION tag if it exists..." -git tag -d "v$CURRENT_VERSION" 2>/dev/null || echo " (no local tag to delete)" -git push origin --delete "v$CURRENT_VERSION" 2>/dev/null || echo " (no remote tag to delete)" +echo "Step 3: Deleting v$NEW_VERSION tag if it exists (from previous failed attempt)..." +git tag -d "v$NEW_VERSION" 2>/dev/null || echo " (no local tag to delete)" +git push origin --delete "v$NEW_VERSION" 2>/dev/null || echo " (no remote tag to delete)" echo "Step 4: Creating v$NEW_VERSION tag..." git tag "v$NEW_VERSION" From 8be3c3e56a936b15d9c63bbcddf91242c4bc65c5 Mon Sep 17 00:00:00 2001 From: Ankur Mursalin Date: Wed, 19 Nov 2025 23:03:39 +0600 Subject: [PATCH 3/6] feat: update document structure in documentation index --- documentation/index.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/documentation/index.md b/documentation/index.md index 108f10e..f1d0070 100644 --- a/documentation/index.md +++ b/documentation/index.md @@ -114,8 +114,8 @@ documentation/ ├── index.md (you are here) │ ├── guides/ -│ ├── getting-started.md # Quick start tutorial -│ ├── installation.md # Installation guide +│ ├── getting-started.md # Quick start tutorial +│ ├── installation.md # Installation guide │ ├── react-guide.md # React integration │ ├── vue-guide.md # Vue integration │ ├── svelte-guide.md # Svelte integration @@ -125,13 +125,26 @@ documentation/ │ └── troubleshooting.md # Common issues │ ├── features/ +│ └── colors.md # Color support +│ └── images.md # Image support +│ └── page-breaks.md # Handling page break │ └── multi-page.md # Page splitting +│ └── tables.md # Table support │ ├── advanced/ +│ └── batch-generation.md # Combine multiple content items +│ └── headers-footers.md # Dynamic header/footer templates │ └── image-optimization.md # DPI control & print quality +│ └── metadata.md # Set document properties +│ └── preview.md # Real-time PDF preview with live updates +│ └── security.md # Password protection & permissions +│ └── url-to-pdf.md # Convert web pages to PDF +│ └── watermarks.md # Add text & image watermarks │ ├── api/ │ └── options.md # All options +| +├── tutorials/* # Tutorials for react, svelte, vue & vanilla JS │ └── examples/ ├── code-examples.md # Code samples From fcaa72793caca597ccb4fc73056a2e3fee443636 Mon Sep 17 00:00:00 2001 From: Ankur Mursalin Date: Thu, 20 Nov 2025 00:43:03 +0600 Subject: [PATCH 4/6] chore: bump version to 1.1.0 Minor release with new features and improvements. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e329775..a58e326 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@encryptioner/html-to-pdf-generator", - "version": "1.0.2", + "version": "1.1.0", "description": "Modern multi-page PDF generator from HTML content with smart pagination and styling support", "keywords": [ "pdf", From 7bf280f3afa75218158467462b56e7b0c80620db Mon Sep 17 00:00:00 2001 From: Ankur Mursalin Date: Thu, 20 Nov 2025 00:55:42 +0600 Subject: [PATCH 5/6] fix: bring back old version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a58e326..e329775 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@encryptioner/html-to-pdf-generator", - "version": "1.1.0", + "version": "1.0.2", "description": "Modern multi-page PDF generator from HTML content with smart pagination and styling support", "keywords": [ "pdf", From cda817d9e918174c441586a8ba6d6525d9daa3d2 Mon Sep 17 00:00:00 2001 From: Ankur Mursalin Date: Thu, 20 Nov 2025 00:55:59 +0600 Subject: [PATCH 6/6] chore: bump version to 1.0.3 Patch release with workflow fixes and improvements. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e329775..9ce0acd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@encryptioner/html-to-pdf-generator", - "version": "1.0.2", + "version": "1.0.3", "description": "Modern multi-page PDF generator from HTML content with smart pagination and styling support", "keywords": [ "pdf",