Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 8, 2025

Description

Refs: Customer issue (Payabli)

Fixes an issue where package.json metadata (name, version, repository, private) was being lost during local TypeScript SDK generation when using non-self-hosted GitHub configuration with npm output. The customer's SDK went from having proper metadata to only having "name": "test-package".

Link to Devin run: https://app.devin.ai/sessions/18a5ef103b3e4a71a5a433cba9770f81
Requested by: Niels Swimberghe (@Swimburger)

Changes Made

  • Added a new code path in getPublishConfig to create a filesystem publishConfig with the publish target when a non-self-hosted github config has output info
  • Updated AbstractGeneratorCli.ts to fall back to publishConfig when constructNpmPackage returns undefined (e.g., in downloadFiles mode)
  • Added handling for filesystem publishConfig type in npmPackageInfoFromPublishConfig
  • Updated versions.yml for both CLI (3.4.6) and TypeScript SDK (3.37.2)

Root Cause

When running local generation (fern generate without mode flags), the output mode is downloadFiles. The getPublishConfig function was returning undefined for non-self-hosted github configs, even when they had output info with npm package details. This caused ir.publishConfig to be undefined, and the generator fell back to name: "test-package".

Human Review Checklist

  • Verify the logic change in AbstractGeneratorCli.ts doesn't break self-hosted SDK generation (the original code had a conditional based on ir.selfHosted that was removed)
  • Check if the new code path in getPublishConfig handles edge cases correctly (e.g., what if github is set but output is not npm?)
  • The npmPackageInfoFromPublishConfig only handles npm publish targets for filesystem config - verify this is intentional

Testing

  • Lint checks pass (pnpm run check)
  • All CI checks pass
  • Manual testing with customer's configuration
  • Unit tests added/updated

…eration

When using non-self-hosted GitHub configuration with npm output, the
package.json metadata (name, version, repository, private) was being
lost during local TypeScript SDK generation.

The issue was that getPublishConfig returned undefined for non-self-hosted
github configs, causing the generator to fall back to 'test-package' as
the package name.

This fix:
1. Updates getPublishConfig to create a filesystem publishConfig with
   the publish target for non-self-hosted github configs with output info
2. Updates the TypeScript generator to fall back to publishConfig when
   the output mode doesn't provide npm package info

Co-Authored-By: Niels Swimberghe <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 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

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants