fix(plugin): preserve package import paths - #3938
Open
yudin-s wants to merge 1 commit into
Open
Conversation
yudin-s
force-pushed
the
fix/preserve-package-imports
branch
from
May 29, 2026 08:49
0b79e65 to
dba96e4
Compare
yudin-s
marked this pull request as ready for review
May 29, 2026 09:55
|
whoah! hoped this would be simpler :) thanks for working on this! |
4 tasks
|
@yudin-s @kamilmysliwiec hi, is there an ETA for merging? thanks |
4 tasks
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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When the CLI plugin sees a DTO property typed from a workspace package import such as
@repro/shared/messages, TypeScript may resolve the type to the package physical output path. The generated_OPENAPI_METADATA_FACTORY()can then emit a filesystem-relativerequire()intopackages/shared/dist/..., which is not stable at runtime after the package is installed fromnode_modules.Issue Number: Fixes #3937
What is the new behavior?
The model visitor now preserves explicit package import specifiers for imported property/enum types before normalizing paths. Package-style references keep emitting package-based
require()calls, while relative and built-in/bare module behavior stays unchanged.A regression fixture covers a monorepo-style DTO importing an enum from
@repro/shared/messagesand asserts the emitted metadata usesrequire("@repro/shared/messages").ItemStatusinstead of a resolved sibling package path.Does this PR introduce a breaking change?
Other information
Docs were not updated because this is a CLI plugin code-generation bug fix with regression coverage.
Local validation:
Note: local install required restoring optional native packages for Vitest/oxlint on macOS; no package manifest or lockfile changes are included.