Skip to content

feat(typescript): add customSubpathExports configuration option#11825

Closed
jsklan wants to merge 3 commits intomainfrom
devin/1769545333-custom-subpath-exports
Closed

feat(typescript): add customSubpathExports configuration option#11825
jsklan wants to merge 3 commits intomainfrom
devin/1769545333-custom-subpath-exports

Conversation

@jsklan
Copy link
Copy Markdown
Contributor

@jsklan jsklan commented Jan 27, 2026

Description

Refs: Request from judah@buildwithfern.com (@jsklan)

Adds a new customSubpathExports configuration option for the TypeScript SDK generator. This allows SDK maintainers to define custom subpath exports in the generated package.json, enabling modular packages where optional features can be imported via subpaths (e.g., import { BedrockClient } from 'cohere-ai/aws').

Link to Devin run: https://app.devin.ai/sessions/63cecf1472274d33b8facb2cc909c130

Changes Made

  • Added Zod schema for customSubpathExports in TypescriptCustomConfigSchema.ts supporting both simple string exports and complex conditional exports with types/import/require/default
  • Added type definition to SdkCustomConfig.ts and parsing in SdkGeneratorCli.ts
  • Passed config through SdkGenerator.Config to TypescriptProject hierarchy
  • Modified SimpleTypescriptProject.generatePackageJson() to merge custom exports after the main "." export and before "./package.json"
  • Added seed test fixture exhaustive/custom-subpath-exports demonstrating the feature
  • Updated versions.yml with changelog entry for version 3.46.0

Testing

  • Seed test exhaustive:custom-subpath-exports passes
  • TypeScript compilation passes
  • Verified generated package.json contains merged exports in correct order

Human Review Checklist

  • Verify the Zod schema handles all expected input formats (simple strings, nested objects)
  • Confirm BundledTypescriptProject doesn't need this feature (currently only SimpleTypescriptProject supports it)
  • Check the generated package.json exports order is correct: . → custom exports → ./package.json

Co-Authored-By: judah@buildwithfern.com <jsklan.development@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

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