fix: correct export paths when sources are emitted to src/generated#3905
Open
fix: correct export paths when sources are emitted to src/generated#3905
src/generated#3905Conversation
…ists Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/43b3fac0-b4e7-4a56-998d-1836549dceb5 Co-authored-by: v-jiaodi <[email protected]>
…y client exports Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/43b3fac0-b4e7-4a56-998d-1836549dceb5 Co-authored-by: v-jiaodi <[email protected]>
Copilot
AI
changed the title
[WIP] Fix emitter output references in generated code
fix: correct export paths when sources are emitted to Apr 10, 2026
src/generated
Member
JialinHuang803
approved these changes
Apr 20, 2026
JialinHuang803
requested changes
Apr 20, 2026
Member
JialinHuang803
left a comment
There was a problem hiding this comment.
Could you help check if emitTests.ts should be updated?
Contributor
Author
The hardcoded paths in In the customization scenario (
Tests should always import through the public API ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

When the emitter detects an existing
src/generatedfolder and correctly routes generated sources there, the export entries inwarp.config.ymlandpackage.jsonwere still hardcoded to./src/— causing broken subpath references as shown in the screenshot above.Changes
buildProjectFiles.tsSdkContextimport to the local../utils/interfaces.jsversion (which carriesgenerationPathDetail)getSourceRootPrefix()helper that derives the correct relative prefix (e.g../srcor./src/generated) by callingpath.relative(rootDir, sourceRoot)against the actual modular sources directorygetModuleExportsandbuildExportsForMultiClienteverywhere./src/was previously hardcodedThe prefix falls back to
./srcwhengenerationPathDetailis unavailable or the source root is outside the project root, preserving existing behaviour for all non-customised packages.