-
Notifications
You must be signed in to change notification settings - Fork 12k
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
fix(@schematics/angular): regression tsconfig.json #16708 #16709
Conversation
fix(@schematics/angular): regression tsconfig.json … Unverified 0e318ae Regression in tsconfig.json set `"outDir": "./dist/out-tsc"` for problems in VSCode TS(2307) when building library referred in tsconfig "paths" Closes: angular#16708
Currently the library schematic doesn't support adding a secondary entry-point and having deep imports is not recommanded. It's best if paths are more stricter when having a secondary entry-point instead of a wildcard. Instead of : ``` "lib/*": [ "dist/lib/*" ] ``` Users should configure: ``` "lib/secondary": [ "dist/lib/secondary" ] ``` This would allow a better DX experience when using auto imports in IDE's. Closes: #15952
Thanks for this. @clydin and myself looked at this and it seems that TS file watcher is not handling deletion well when excludes are involved. While checking this I also saw some change in behaviour which involved path mappings which seems that auto imports were no longer being suggested. Would you also mind to fix the following
"paths": {
"foo": [
"dist/foo/foo",
"dist/foo"
]
} instead of: "paths": {
"foo": [
"dist/foo"
]
} The first path will be used by TSC, while the second will be used by Webpack. |
@alan-agius4 Ok I'll update the code to add the second ref in the paths. |
@dmorosinotto, no need as the |
Well not exactly because if you pass a scoped name (like You'll have this output :
You can try to test it in this blitz that I suspect to be not exactly what you want, I think that this may be the correct one:
JFYI I tryed to create a library with @alan-agius4 Can you clarify me the real expected behavior? so I'll code the need changes, thanks! |
You are right the paths should be without Also the order of the below is important, as changing the order will result in a different behaviour. paths": {
"@my-scope/my-lib": [
"dist/my-scope/my-lib/my-scope-my-lib", -> used by the IDE to suggest correct imports.
"dist/my-scope/my-lib" -> used by the apps Webpack as otherwise the compilation will not succede because the above points to a dts file
]
} |
Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's. Closes angular#16709
Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's. Fix code lint. Closes angular#16709
Sorry @alan-agius4 I've done the code change directly online in GitHub and I've made a lint error (for whitespace) just fixed, but the real problems are the tests broken, can you help me with it? |
I’ll try to take a look in the coming days.
…On Mon, 20 Jan 2020 at 20:00, Daniele Morosinotto ***@***.***> wrote:
Sorry @alan-agius4 <https://github.com/alan-agius4> I've done the code
change directly online in GitHub and I've made a lint error (for
whitespace) just fixed, but the real problems are the tests broken, can you
help me with it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16709?email_source=notifications&email_token=AEF74WV6IR5PGYEOJ42PS2TQ6XYFHA5CNFSM4KI2M742YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJNRYEA#issuecomment-576396304>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEF74WSDLUHRFRZ6TOKHU6DQ6XYFHANCNFSM4KI2M74Q>
.
|
Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's. Fix test code to conform new behaviour. Closes angular#16709
@alan-agius4 no problem, I've done some further investigations looking and the Detail log and found the failing tests code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Caretaker note: kindly squash the commits.
* fix(@schematics/angular): regression tsconfig.json fix(@schematics/angular): regression tsconfig.json … Unverified 0e318ae Regression in tsconfig.json set `"outDir": "./dist/out-tsc"` for problems in VSCode TS(2307) when building library referred in tsconfig "paths" Closes: #16708 * fix(@schematics/angular): regression tsconfig.json Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's. Closes #16709 * fix(@schematics/angular): regression tsconfig.json Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's. Fix code lint. Closes #16709 * fix(@schematics/angular): regression tsconfig.json Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's. Fix test code to conform new behaviour. Closes #16709 (cherry picked from commit 3aacf41)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
fix(@schematics/angular): regression tsconfig.json …
Unverified
0e318ae
Regression in tsconfig.json set
"outDir": "./dist/out-tsc"
for problems in VSCode TS(2307) when building library referred in tsconfig "paths"Closes: #16708