fix(typescript): Prioritize outputSourceFiles over generateFullProject in local file mode #10759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes an issue where TypeScript SDK generation with
outputSourceFiles: truein local-file-system mode was incorrectly outputting files under asrc/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
downloadFilesoutput mode path to prioritizeoutputSourceFilesovershouldGenerateFullProjectoutputSourceFiles: trueis explicitly set, the generator now copies source files directly (viacopySrcTo) instead of copying the full project structure (viacopyProjectTo)Problem
When users configured their TypeScript SDK generator with:
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 beforeoutputSourceFiles(customConfig), causing the full project (including thesrc/folder) to be copied when the IR'spublishConfighadgenerateFullProject: 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
pnpm run check)exhaustive/local-filesfixture)Review Checklist
Important areas to review:
outputSourceFilesshould indeed take precedence overgenerateFullProjectfor local-file-system outputsgenerateFullProjecttook precedenceoutputSourceFiles: trueANDpublishConfig.generateFullProject: trueare set - is the new behavior correct?