-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(changesets): set up major release changeset for updated extractor
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
"@labdigital/intl-extractor": major | ||
--- | ||
|
||
Output labels to a single json file | ||
|
||
## What changed | ||
Instead of creating individual `<File>.labels.json` files for each TypeScript file it will now output a single JSON file containing all the namespaces and labels. | ||
It conforms to how `next-intl` works and removes the inbetween step since we can automate with this tool. | ||
|
||
Next to this the argument for passing directories has changed from `--source` to `--input` as it's confusing with `source.json` otherwise. | ||
|
||
## Why | ||
Individual `*.labels.json` files were helpful to colocate labels and merge them to the single required JSON file. But now that we have this extractor we can just check all usages of `useTranslations` and `getTranslations` and merge them directly. | ||
|
||
Also the original implementation took file names as input instead of the used namespaces which led to unused labels and no support for multiple namespaces in one file. | ||
|
||
## How to update | ||
1. Make sure your output JSON file is completely up to date | ||
2. Update the extractor | ||
3. Use `--input` instead of `--source` for input files | ||
4. Run extractor | ||
5. Remove all `*.labels.json` files from your project :) | ||
|
||
|