Skip to content

Releases: labd/intl-extractor

v2.5.0

Choose a tag to compare

@github-actions github-actions released this 11 Aug 13:00
72e015d

Minor Changes

  • 3ad1490: Expose the extractor as a library, not just a CLI.

    • Declare an exports map, so @labdigital/intl-extractor can be imported. dist/index.js was already built and shipped; nothing referenced it.
    • Add buildLabels({ input, source, fallback, onFile }), which returns the label tree without touching the output file. processFiles becomes the read-merge-write wrapper around it.
    • Add a fallback option 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: processFiles did not await its write, and its "no existing source file" branch was unreachable because the read threw first.

v2.4.0

Choose a tag to compare

@github-actions github-actions released this 17 Jul 12:46

Minor Changes

  • 310a1ec: Use the @typescript/typescript6 compatibility package for AST parsing instead of the consumer's typescript peer dependency. TypeScript 7.0 ships without the classic JavaScript API (ts.createSourceFile, ts.ScriptTarget, the is* 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 the typescript peer dependency.

v2.3.0

Choose a tag to compare

@github-actions github-actions released this 16 Jun 09:26
6092fc3

Minor Changes

  • 21043fb: Allow useTransltions and getTranslations usage without passing a namespace

Patch Changes

v2.2.0

Choose a tag to compare

@github-actions github-actions released this 10 Dec 08:38
25e54b3

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

Choose a tag to compare

@github-actions github-actions released this 17 Jun 20:12

Minor Changes

  • 585f8c9: Support nested translation function keys

Patch Changes

  • f8148ae: Sort the output before writing to make it deterministic

v2.0.1

Choose a tag to compare

@github-actions github-actions released this 25 Feb 13:10

Patch Changes

  • 7a0b827: Handle literals for getTranslations() call
  • b101935: update dependencies

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 24 Feb 15:01
0e25a4f

Major Changes

  • 9e5046e: Watch mode and updated workflows

    Watch mode

    This release adds watch mode using @parcel/watcher (optional dependency). Use --watch or -w cli 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

Choose a tag to compare

@github-actions github-actions released this 03 Jul 09:15

Minor Changes

  • 910977f: Support for translation property accessors

    Adds support for extracting labels from property accessors (e.g. t.rich() or t.html()).

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 01 Jul 20:59

Major Changes

  • 49b4b35: 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 :)

v0.0.2

Choose a tag to compare

@github-actions github-actions released this 12 Apr 15:24

Patch Changes

  • a850cca: Handle nested scopes better