Open JelleBruisten opened 1 year ago
Run & review this pull request in StackBlitz Codeflow.
Hi, any reason why this hasn't been merged? I was wondering why some keys on my project weren't being extracted. Turns out, a lot weren't because of this. Applied it locally and works fine...
I'll try to review this week 👍
… name and project name are different
prior to this change we would look for
**/<projectName>
however this does not work when we have a folder structure like:/libs/ui/my-button
where the project name would beui-my-button
causing the keys not to be detected this change would look for all project.json files and look for the correct project.json by comparing the name property withinPR 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?
Currently when having a folder structure where the project name does not match the folder name transloco-key-manager is unable to find the source root.
for example if we would have libs/booking/ui/button when looking for a project with the name
booking-ui-button
transloco won't find the source root of this project causing the error:Issue Number: N/A
What is the new behavior?
with the changes in this PR we look for all
project.json
and compare thename
property to find out if it is the correct config file.this enables us to have folder structures like /booking/ui/button /booking/ui/card /invoicing/ui/button
And before when running
npx transloco-keys-manager extract --project=button
it would match one of these libraries but never the other. This change would also make this possible where everything is correctly matched based on the project name that is specified in project.json ( project name should still be unique in each workspace elsenx
will not work correctly either ).Does this PR introduce a breaking change?