Skip to content

fix(localize): add all TypeScript types to the root level tsconfig#48446

Closed
alan-agius4 wants to merge 1 commit intoangular:mainfrom
alan-agius4:ng-add-localize-ide-fix
Closed

fix(localize): add all TypeScript types to the root level tsconfig#48446
alan-agius4 wants to merge 1 commit intoangular:mainfrom
alan-agius4:ng-add-localize-ide-fix

Conversation

@alan-agius4
Copy link
Copy Markdown
Contributor

With this change we add all types from the builders tsconfig file to the root level tsconfig when running ng add @angular/localize. This is needed as by adding @angular/localize type to the root level tsconfig we exclude all other types in @types from being included in the IDE tsconfig which results in bad DX.

More information on how the types option works can be found here: https://www.typescriptlang.org/tsconfig#types

Closes #48434

@alan-agius4 alan-agius4 marked this pull request as ready for review December 12, 2022 09:56
@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 12, 2022
@pullapprove pullapprove bot requested a review from AndrewKushnir December 12, 2022 09:56
@alan-agius4
Copy link
Copy Markdown
Contributor Author

Another option would be to use typeRoots. But this might cause problems where node_modules does not exists such as Yarn PNP.

"typeRoots": ["./node_modules/@types", "./node_modules/@angular/localize/"]

@alan-agius4 alan-agius4 added the area: i18n Issues related to localization and internationalization label Dec 12, 2022
@ngbot ngbot bot added this to the Backlog milestone Dec 12, 2022
With this change we add all types from the builders tsconfig file to the root level tsconfig when running `ng add @angular/localize`. This is needed as by adding `@angular/localize` type to the root level tsconfig we exclude all other types in `@types` from being included in the IDE tsconfig which results in bad DX.

More information on how the `types` option works can be found here: https://www.typescriptlang.org/tsconfig#types

Closes angular#48434
@alan-agius4 alan-agius4 force-pushed the ng-add-localize-ide-fix branch from 36eab70 to 508e73c Compare December 12, 2022 13:17
@alan-agius4 alan-agius4 added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Dec 12, 2022
Copy link
Copy Markdown
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this PR, the changes look good to me 👍

@clydin could you please take a look as well (you may have more context on ng add schematics)?

@AndrewKushnir AndrewKushnir requested a review from clydin December 13, 2022 04:57
@alan-agius4 alan-agius4 added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews state: blocked and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 14, 2022
@alan-agius4
Copy link
Copy Markdown
Contributor Author

Superseded by #48502

@alan-agius4 alan-agius4 deleted the ng-add-localize-ide-fix branch December 15, 2022 08:28
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: i18n Issues related to localization and internationalization state: blocked target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

installing @angular/localize broke jasmine/types

3 participants