Skip to content

[ef-35] fix: skip npm similarity-blocked aliases gracefully#34

Merged
NiveditJain merged 2 commits into
mainfrom
ef-35
Apr 7, 2026
Merged

[ef-35] fix: skip npm similarity-blocked aliases gracefully#34
NiveditJain merged 2 commits into
mainfrom
ef-35

Conversation

@NiveditJain

Copy link
Copy Markdown
Member

Problem

The publish pipeline was crashing on failproof-ai with:

npm error 403 Package name too similar to existing package failproofai

npm blocks unscoped names that normalize to the same string as an existing package after stripping punctuation (failproof-aifailproofai). This caused the entire alias publish step to abort, leaving subsequent aliases unpublished.

Fix

  • Catch E403 "too similar" errors specifically and skip those packages with a warning instead of crashing — the remaining aliases that npm allows will still publish
  • Also silently skip packages already published at the current version (idempotent re-runs)
  • Any other unexpected error still fails the build

Blocked aliases (require npm support approval):
failproof-ai, fail-proof-ai, failproof_ai, fail_proof_ai, fail-proofai

Unaffected aliases (different enough to pass npm's check):
failproof, failprof, failprof-ai, failprofai, fail-prof-ai, failprof_ai, faliproof, faliproof-ai, faliproofai

  • Updates docs/package-aliases.md to mark blocked names as "pending npm support approval" with an explanation

Action needed (outside this PR)

Contact npm support at https://www.npmjs.com/support to request reservation of the 5 blocked names, citing anti-typosquatting / brand protection for the existing failproofai package.

Test plan

  • Merge + re-run publish workflow — build should succeed, skipped names logged as warnings
  • node scripts/publish-aliases.mjs --dry-run locally shows all 14 entries

🤖 Generated with Claude Code

…f crashing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 3c43164b-2027-4160-bade-80470d0fec55

📥 Commits

Reviewing files that changed from the base of the PR and between 91d7fc4 and 453deed.

📒 Files selected for processing (3)
  • docs/package-aliases.md
  • package.json
  • scripts/publish-aliases.mjs

📝 Walkthrough

Walkthrough

Version bump to 0.0.1-beta.9 combined with documentation of pending npm package registrations and enhanced error handling in the alias publishing script to capture and report publish failures as GitHub Actions warnings.

Changes

Cohort / File(s) Summary
Documentation & Version
docs/package-aliases.md, package.json
Documentation table extended with Status column tracking published vs. pending aliases; added explanation of npm's spam-prevention policy for normalized names. Package version incremented to beta.9.
Publish Script Error Handling
scripts/publish-aliases.mjs
Enhanced error handling: changed from inheriting stdio to piping output, wrapped publishing in try/catch to capture failures, categorizes errors by pattern (too similar, already published, npm errors), accumulates warnings, and reports them as GitHub Actions annotations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through npm's great hall,
Beta nine blooms—versioning calls!
Error traps spring with warnings galore,
Reserved names guarded from spam-squatter war! 📦✨


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NiveditJain NiveditJain merged commit 1e62086 into main Apr 7, 2026
8 checks passed
@NiveditJain NiveditJain deleted the ef-35 branch April 21, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant