Skip to content

feat(blog): add Refactron npm package announcement post#133

Merged
omsherikar merged 2 commits intomainfrom
feat/blog-system-sitemap-automation
Apr 5, 2026
Merged

feat(blog): add Refactron npm package announcement post#133
omsherikar merged 2 commits intomainfrom
feat/blog-system-sitemap-automation

Conversation

@omsherikar
Copy link
Copy Markdown
Collaborator

@omsherikar omsherikar commented Apr 5, 2026

Summary by CodeRabbit

  • New Features

    • Dismissible announcement banner shown site-wide.
    • Install command toggle in the hero with auto-cycling and copy-for-active-installer.
    • New icon used for posts about releases/packages; navigation and layout adapt when the banner is visible.
  • Documentation

    • Added blog post announcing Refactron as a Node.js package and updated sitemap entry.

Covers v2.0 TypeScript rewrite, npm distribution, blast radius analysis,
temporal safety intelligence from git history, and multi-language support.
Copilot AI review requested due to automatic review settings April 5, 2026 19:42
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
refactron Ready Ready Preview, Comment Apr 5, 2026 8:10pm

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 4838e15.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@github-actions github-actions bot added the type:refactor Code refactoring label Apr 5, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Adds a new blog post entry and sitemap URL, introduces an announcement banner component and hook integrated into PageLayout and NavigationBar, updates HeroSection to cycle installer commands with copy/animation behavior, and adds industry-aware icons for blog components.

Changes

Cohort / File(s) Summary
New Blog Post & Sitemap
src/data/posts.ts, public/sitemap.xml
Added refactron-is-now-a-nodejs-package blog post entry (metadata, summary/body) and registered its URL in the sitemap (changefreq=monthly, priority=0.8).
Announcement Banner
src/components/AnnouncementBanner.tsx, src/components/PageLayout.tsx
New AnnouncementBanner component and useAnnouncementBanner hook; PageLayout integrates the hook, conditionally renders the banner, and forwards dismiss to NavigationBar.
Navigation bar integration
src/components/NavigationBar.tsx, src/components/PageLayout.tsx
Added bannerVisible?: boolean prop; header top offset becomes conditional (top-9 when banner visible, else top-0) and PageLayout now passes banner visibility.
Hero Section UI/Behavior
src/components/HeroSection.tsx
Reworked installer CTA to support multiple installers, auto-cycle active installer every 3s, toggle to advance/reset cycle, animated crossfade of command text, and copy behavior tied to active command.
Blog icons
src/components/BlogPage.tsx, src/components/BlogPostPage.tsx
Added industry keyword detection for release/package and return a new inline SVG icon for those posts.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant U as User
    participant PL as PageLayout
    participant HB as useAnnouncementBanner
    participant AB as AnnouncementBanner
    participant NB as NavigationBar
    participant SS as sessionStorage

    U->>PL: Load page
    PL->>HB: call useAnnouncementBanner()
    HB->>SS: read dismissal key
    SS-->>HB: dismissal state
    alt not dismissed & enabled
        HB-->>PL: { visible: true, dismiss() }
        PL->>AB: render AnnouncementBanner (onDismiss=dismiss)
        PL->>NB: render NavigationBar(bannerVisible=true)
        U->>AB: click CTA / close
        AB->>HB: call dismiss()
        HB->>SS: write dismissal key
        HB-->>PL: visible=false
        PL->>NB: update NavigationBar(bannerVisible=false)
    else dismissed or disabled
        HB-->>PL: { visible: false }
        PL->>NB: render NavigationBar(bannerVisible=false)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

type:feature

Poem

🐰 I hopped a note across the site,
A shiny post, a banner bright.
Installers flip, icons take flight —
Sitemap sings into the night. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a blog post announcing Refactron as an npm package, which is reflected across the sitemap, posts data, and UI components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/blog-system-sitemap-automation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

👋 Thanks for opening this pull request! A maintainer will review it soon. Please make sure all CI checks pass.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new marketing/blog announcement post for the Refactron npm package release and updates SEO sitemap coverage so the new post URL is discoverable.

Changes:

  • Added a new blog post entry (refactron-is-now-a-nodejs-package) to the in-repo post registry.
  • Updated public/sitemap.xml to include the new blog post URL.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/data/posts.ts Adds the new npm package announcement post content and metadata (slug/title/tags/body).
public/sitemap.xml Adds the new blog URL so it’s included in the main domain sitemap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@public/sitemap.xml`:
- Line 1: The sitemap was manually edited but is auto-generated by
scripts/generate-sitemap.js (invoked via package.json prebuild), so revert
changes in public/sitemap.xml and let the generator recreate it; ensure the new
blog post exists in src/data/posts.ts with the correct slug (e.g.,
"refactron-is-now-a-nodejs-package"), then run node scripts/generate-sitemap.js
and commit the regenerated public/sitemap.xml instead of manual edits.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92559cda-a7e9-4d1b-a8d8-175070777f8a

📥 Commits

Reviewing files that changed from the base of the PR and between 7ee5033 and c57d259.

📒 Files selected for processing (2)
  • public/sitemap.xml
  • src/data/posts.ts

@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://refactron.dev/</loc><changefreq>weekly</changefreq><priority>1.0</priority></url><url><loc>https://refactron.dev/blog</loc><changefreq>weekly</changefreq><priority>0.9</priority></url><url><loc>https://refactron.dev/about</loc><changefreq>monthly</changefreq><priority>0.6</priority></url><url><loc>https://refactron.dev/changelog</loc><changefreq>weekly</changefreq><priority>0.7</priority></url><url><loc>https://refactron.dev/security</loc><changefreq>monthly</changefreq><priority>0.5</priority></url><url><loc>https://refactron.dev/privacy-policy</loc><changefreq>yearly</changefreq><priority>0.3</priority></url><url><loc>https://refactron.dev/terms-of-service</loc><changefreq>yearly</changefreq><priority>0.3</priority></url><url><loc>https://refactron.dev/blog/i-ran-refactron-on-djangos-codebase</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/refactron-vs-cursor-vs-codeant</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/why-we-built-verification-engine-first</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/legacy-code-ai-refactoring</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/refactron-on-requests-library</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/real-cost-of-not-refactoring</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/refactron-on-fastapi</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/how-to-safely-refactor-python-code-you-didnt-write</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/why-refactron-runs-locally</loc><changefreq>monthly</changefreq><priority>0.8</priority></url></urlset> No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://refactron.dev/</loc><changefreq>weekly</changefreq><priority>1.0</priority></url><url><loc>https://refactron.dev/blog</loc><changefreq>weekly</changefreq><priority>0.9</priority></url><url><loc>https://refactron.dev/about</loc><changefreq>monthly</changefreq><priority>0.6</priority></url><url><loc>https://refactron.dev/changelog</loc><changefreq>weekly</changefreq><priority>0.7</priority></url><url><loc>https://refactron.dev/security</loc><changefreq>monthly</changefreq><priority>0.5</priority></url><url><loc>https://refactron.dev/privacy-policy</loc><changefreq>yearly</changefreq><priority>0.3</priority></url><url><loc>https://refactron.dev/terms-of-service</loc><changefreq>yearly</changefreq><priority>0.3</priority></url><url><loc>https://refactron.dev/blog/i-ran-refactron-on-djangos-codebase</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/refactron-vs-cursor-vs-codeant</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/why-we-built-verification-engine-first</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/legacy-code-ai-refactoring</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/refactron-on-requests-library</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/real-cost-of-not-refactoring</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/refactron-on-fastapi</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/how-to-safely-refactor-python-code-you-didnt-write</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/why-refactron-runs-locally</loc><changefreq>monthly</changefreq><priority>0.8</priority></url><url><loc>https://refactron.dev/blog/refactron-is-now-a-nodejs-package</loc><changefreq>monthly</changefreq><priority>0.8</priority></url></urlset> No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid manual edits to auto-generated sitemap.xml.

This sitemap file is automatically generated by scripts/generate-sitemap.js during the build process (see package.json line 48: "prebuild": "node scripts/generate-sitemap.js"). The script extracts all blog post slugs from src/data/posts.ts and regenerates the entire sitemap file from scratch, which will overwrite any manual changes.

Since you've already added the blog post to src/data/posts.ts, the sitemap entry will be automatically generated on the next build. This manual edit is unnecessary and will be lost.

🔄 Recommended workflow

Instead of manually editing public/sitemap.xml, regenerate it using the automated script:

# Remove the manual edit to sitemap.xml and regenerate it
node scripts/generate-sitemap.js

This ensures consistency between src/data/posts.ts and the sitemap, and avoids the confusion of manual edits being overwritten during builds.

Run the following script to verify that the sitemap generation script will include the new blog post:

#!/bin/bash
# Description: Verify that the sitemap generation script correctly includes the new blog post slug

# Check if the slug exists in posts.ts
echo "=== Checking for new blog post slug in posts.ts ==="
rg -n "slug:\s*['\"]refactron-is-now-a-nodejs-package['\"]" src/data/posts.ts

# Run the sitemap generation script
echo -e "\n=== Running sitemap generation script ==="
node scripts/generate-sitemap.js

# Verify the new entry is in the generated sitemap
echo -e "\n=== Verifying new entry in generated sitemap ==="
cat public/sitemap.xml | grep -o '<loc>https://refactron.dev/blog/refactron-is-now-a-nodejs-package</loc>'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@public/sitemap.xml` at line 1, The sitemap was manually edited but is
auto-generated by scripts/generate-sitemap.js (invoked via package.json
prebuild), so revert changes in public/sitemap.xml and let the generator
recreate it; ensure the new blog post exists in src/data/posts.ts with the
correct slug (e.g., "refactron-is-now-a-nodejs-package"), then run node
scripts/generate-sitemap.js and commit the regenerated public/sitemap.xml
instead of manual edits.

- Fixed pink announcement banner above navbar, auto-dismisses on click
- Easy config block for toggling/updating announcements
- Hero install command cycles between pip and npm with fixed width
- Added Release industry with package SVG icon for npm post
@github-actions github-actions bot added the type:feature New feature label Apr 5, 2026
@omsherikar omsherikar merged commit a70113f into main Apr 5, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature type:refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants