-
Notifications
You must be signed in to change notification settings - Fork 13
Incorrect mapping resolution: an absolute to a relative path without the baseUrl parameter #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I was under the assumption that I haven't worked on this for a while, do you happen to have a suggestion for a fix? |
Related to [this](simonhaenisch#18) issue
Related issue: simonhaenisch#18
Related issue: simonhaenisch#18
I've tried making some changes. Ignore the orphan commits that reference this discussion, it's all my sloppiness. I updated the test configuration to support this case with the least changes, but in general, I was surprised that the plugin code is so convoluted and tested with just node's |
For example, it seems to me that at least the tests don't cover the case where the configuration in a submodule references files relative to its own location. In the case of this plugin's code, it's as if we changed the first path-alias to:
Compare with:
...which only works if you run the test with the In my case, I ran into this issue for a monorepo that starts a build by referencing scripts from package.json each subrepo have with npm workspaces, yarn2 workspaces, or pnpm workspaces with the The subrepo's build scripts runs tsc for each subrepo from within, which resolves abbreviations from its configuration relative to its own location in the subrepo as well. In this case, |
I understand that this sounds confusing, and you probably won't have the time to organize tests for it. I don't have enough time to help with this either. Furthermore, I have written this to provide clarity to myself and others if they encounter a similar issue. You should skip this reasoning, and you can close the problem, since everything is already working well for me. Thanks for the plugin. |
I added the monorepo example to a separate branch. You can see two new scripts in the root package.json
|
I mean, that passing "syntetic" tests from ./test/index.js doesn't guarantee a successful compilation against tsc. These are not full-fledged integration tests, at the same time there are no tests of separate functions like All this makes it difficult to add reliable support for new features, such as a missing |
Not sure what you mean, the actual implementation is less than 60 lines of code? 🤷🏻♂️
At the time I wrote a few tests just for myself so
Yeah, I'm not even sure what you mean by "configuration in a submodule" 😅 Thanks for the PR, will have a look when I find some time. |
Minimal repo to reproduce this issue
Project Structure
Code Snippets
Error Messages
❎
[1] [2]Explanation: Duplicated project root
❎
[1][2]absolute: false
in plugin configurationExplanation: Missing leading slash
✅ [1]
[2]"baseUrl": "./"
in typescirpt configurationThe text was updated successfully, but these errors were encountered: