Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Description

Fixes an issue where TypeScript SDK generation with outputSourceFiles: true in local-file-system mode was incorrectly outputting files under a src/ folder instead of directly in the output path.

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

Changes Made

  • Reordered conditional checks in the downloadFiles output mode path to prioritize outputSourceFiles over shouldGenerateFullProject
  • When outputSourceFiles: true is explicitly set, the generator now copies source files directly (via copySrcTo) instead of copying the full project structure (via copyProjectTo)

Problem

When users configured their TypeScript SDK generator with:

output:
  location: local-file-system
  path: ../../../packages/fdr-sdk/src/client/generated
config:
  outputSourceFiles: true

Files were being generated under ../../../packages/fdr-sdk/src/client/generated/src/ instead of directly under ../../../packages/fdr-sdk/src/client/generated/.

This happened because shouldGenerateFullProject(ir) was checked before outputSourceFiles(customConfig), causing the full project (including the src/ folder) to be copied when the IR's publishConfig had generateFullProject: true.

Solution

The fix ensures that explicit user configuration (outputSourceFiles: true) takes precedence over IR-level configuration (publishConfig.generateFullProject). This matches user expectations: when they explicitly request source files, they should get source files directly without additional folder nesting.

Testing

  • Lint checks passed (pnpm run check)
  • Existing seed tests should validate this behavior (e.g., exhaustive/local-files fixture)
  • Manual testing recommended to verify the fix resolves the reported issue

Review Checklist

Important areas to review:

  1. Logic precedence: Verify that outputSourceFiles should indeed take precedence over generateFullProject for local-file-system outputs
  2. Backward compatibility: Check if any existing users rely on the old behavior where generateFullProject took precedence
  3. Test coverage: Verify existing seed tests cover this scenario and will catch regressions
  4. Edge cases: Consider scenarios where both outputSourceFiles: true AND publishConfig.generateFullProject: true are set - is the new behavior correct?

…t in local file mode

When outputSourceFiles is true in local-file-system output mode, the generator should output source files directly without wrapping them in a src folder. This fix reorders the conditional checks in the downloadFiles path to check outputSourceFiles before shouldGenerateFullProject, ensuring that the user's explicit configuration takes precedence.

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.

1 participant