Skip to content

feat(cli): replace deprecated generator aliases during fern generator upgrade#12327

Closed
iamnamananand996 wants to merge 3 commits intomainfrom
devin/1770979547-upgrade-replace-deprecated-alias
Closed

feat(cli): replace deprecated generator aliases during fern generator upgrade#12327
iamnamananand996 wants to merge 3 commits intomainfrom
devin/1770979547-upgrade-replace-deprecated-alias

Conversation

@iamnamananand996
Copy link
Copy Markdown
Contributor

@iamnamananand996 iamnamananand996 commented Feb 13, 2026

Description

Refs: User request from @iamnamananand996

fern generator upgrade now automatically replaces deprecated generator aliases (e.g. fern-typescript-node-sdk) with their canonical names (e.g. fern-typescript-sdk) in generators.yml. Previously, normalizeGeneratorName resolved aliases internally for version lookups but never wrote the canonical name back to the YAML file.

Link to Devin run

Changes Made

  • upgradeGenerator.ts: After normalizing a generator name, compare the original (with org prefix) to the normalized result. If they differ (i.e. it's a deprecated alias), update the name field in the YAML. Preserves the user's format convention — if they used shorthand (fern-typescript-node-sdk), the replacement is also shorthand (fern-typescript-sdk); if they used the full form (fernapi/...), the replacement uses the full form.
  • When the version is already latest but the name is a deprecated alias, the alias replacement is still applied and reported as an upgrade (rather than silently skipped as "already up to date").
  • Updated CLI output to show alias renames: fern-typescript-node-sdk → fern-typescript-sdk: 1.0.0 → 1.5.0 or fern-typescript-node-sdk → fern-typescript-sdk: 2.0.0 (alias updated) when only the name changed.
  • skippedMajorUpgrades messages also use the replaced canonical name for consistency.
  • Added previousName optional field to AppliedUpgrade interface to track renames.
  • Added new 3.77.0 entry to CLI versions.yml.

Testing

  • Unit tests added — 3 new cases: alias replacement with version upgrade, shorthand format preservation, alias-only update when version is already latest
  • All 7 existing + new tests pass
  • Biome lint passes
  • Local CLI build + manual test against a fixture with fern-typescript-node-sdk confirmed the alias is replaced in generators.yml and output shows fern-typescript-node-sdk → fern-typescript-sdk: 0.39.3 → 0.51.7

Review Checklist

  • When latestVersion is null (e.g. API lookup fails), the alias name replacement is still written to the YAML (generator.set("name", ...) on L162) but no appliedUpgrade entry is recorded — verify this silent-rename-on-failure behavior is acceptable
  • Confirm the new output formatting looks correct for all combinations (alias+version change, alias-only, version-only, no change)

… upgrade

Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration Bot and others added 2 commits February 13, 2026 10:55
Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 25 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the Stale This PR hasn't has any commits or comments in 25 days or more. label Mar 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR was closed because it has been inactive for 5 days after being marked stale.

@github-actions github-actions Bot closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale This PR hasn't has any commits or comments in 25 days or more.

Development

Successfully merging this pull request may close these issues.

1 participant