Repository navigation
Releases: labd/intl-extractor
Release list
v2.5.0
Minor Changes
-
3ad1490: Expose the extractor as a library, not just a CLI.
- Declare an
exportsmap, so@labdigital/intl-extractorcan be imported.dist/index.jswas already built and shipped; nothing referenced it. - Add
buildLabels({ input, source, fallback, onFile }), which returns the label tree without touching the output file.processFilesbecomes the read-merge-write wrapper around it. - Add a
fallbackoption for labels with no value in the source. It receives the full key path and defaults to the label name, so existing behaviour is unchanged.
Two fixes while in there:
processFilesdid notawaitits write, and its "no existing source file" branch was unreachable because the read threw first. - Declare an
v2.4.0
Minor Changes
- 310a1ec: Use the
@typescript/typescript6compatibility package for AST parsing instead of the consumer'stypescriptpeer dependency. TypeScript 7.0 ships without the classic JavaScript API (ts.createSourceFile,ts.ScriptTarget, theis*node guards), so extraction broke when consumers upgraded. Bundling the stable TS 6.0 API decouples the extractor from the consumer's compiler version and drops thetypescriptpeer dependency.
v2.3.0
Minor Changes
- 21043fb: Allow useTransltions and getTranslations usage without passing a namespace
Patch Changes
- 7543efa: Bump Vitest to mitigate CVE-2026-47429
v2.2.0
Minor Changes
- f4a755a: add trusted packages provenance and minimum age of updated to 20160, update pnpm 10.4.1 -> 10.24.0
v2.1.0
v2.0.1
v2.0.0
Major Changes
-
9e5046e: Watch mode and updated workflows
Watch mode
This release adds watch mode using
@parcel/watcher(optional dependency). Use--watchor-wcli flag to run.
Note: This is a simple implementation that just reprocesses all files once there's an update.Breaking change: Only one input directory is allowed instead of multiple, this is so we do not have to run multiple watchers for each input directory.
Other
- Update to pnpm 10
- Use corepack
- Use unified release workflow for Lab Digital packages
v1.1.0
Minor Changes
-
910977f: Support for translation property accessors
Adds support for extracting labels from property accessors (e.g.
t.rich()ort.html()).
v1.0.0
Major Changes
-
49b4b35: Output labels to a single json file
What changed
Instead of creating individual
<File>.labels.jsonfiles for each TypeScript file it will now output a single JSON file containing all the namespaces and labels.
It conforms to hownext-intlworks and removes the inbetween step since we can automate with this tool.Next to this the argument for passing directories has changed from
--sourceto--inputas it's confusing withsource.jsonotherwise.Why
Individual
*.labels.jsonfiles 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 ofuseTranslationsandgetTranslationsand 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
- Make sure your output JSON file is completely up to date
- Update the extractor
- Use
--inputinstead of--sourcefor input files - Run extractor
- Remove all
*.labels.jsonfiles from your project :)
v0.0.2
Patch Changes
- a850cca: Handle nested scopes better