Skip to content

fix: pin figlet to 1.8.1 and harden banner against load failures#48

Merged
general-maximus-decimus merged 1 commit into
mainfrom
r/release.13.07.2026.figlet-dependency-fix
Jul 13, 2026
Merged

fix: pin figlet to 1.8.1 and harden banner against load failures#48
general-maximus-decimus merged 1 commit into
mainfrom
r/release.13.07.2026.figlet-dependency-fix

Conversation

@general-maximus-decimus

@general-maximus-decimus general-maximus-decimus commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

figlet 1.9.0+ ships a broken CommonJS build (import.meta.url → undefined), so require("figlet") threw on load and killed the CLI on every command. Our ^1.7.0 range let fresh installs pull 1.11.1

Fixed two ways:

  • Pinned figlet to exact 1.8.1 — no installer can reach the broken build.
  • banner.ts now loads figlet lazily inside showBanner() with a plain-text fallback, so a bad banner dependency can never crash the CLI again. (The existing try/catch in index.ts couldn't help — the old top-level require threw at import time, before any handler was reachable.)

@stalliondevx stalliondevx Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 StallionDevX AI Review

Quality Score: ██████████ 95/100

Verdict: approve

Summary

This pull request significantly improves the robustness of the CLI banner display by pinning the figlet dependency and implementing a graceful fallback mechanism. If figlet fails to render the banner, it now defaults to a plain wordmark instead of potentially crashing or showing an error, enhancing user experience. The changes are well-contained and address a potential point of failure effectively.

⚠️ Warning (1)

  • 🧹 Swallowing Error in Banner Fallbacksrc/utils/banner.ts:32
    The catch block for renderFigletBanner currently swallows any error without logging it. While the fallback to a plain wordmark is good for user experience, logging the error (e.g., at a debug or warning level) could be beneficial for diagnosing issues if the figlet banner consistently fails in certain environments.

Comment thread src/utils/banner.ts
@general-maximus-decimus
general-maximus-decimus merged commit d393005 into main Jul 13, 2026
4 checks passed
@stallion-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants