Skip to content

Chore/package updates - #9

Merged
Mortefal merged 19 commits into
masterfrom
chore/package-updates
Sep 8, 2026
Merged

Mortefal merged 19 commits into
masterfrom
chore/package-updates

Conversation

@Mortefal

@Mortefal Mortefal commented Sep 7, 2026

Copy link
Copy Markdown

No description provided.

@Mortefal
Mortefal requested a review from a team September 7, 2026 16:34
Mortefal and others added 12 commits September 7, 2026 19:20
coverage.include is needed because v8 otherwise only reports files a test
imports, which hid src/index.ts entirely instead of showing it at 0%.

The chokidar contract tests wait on real OS file events, and macOS
occasionally takes far longer than usual to deliver one, failing the suite
about one run in five. Running the files one at a time helped but did not fix
it, so those tests also retry twice. A genuine chokidar regression never
delivers the event at all, so it still fails all three attempts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The six options were duplicated verbatim in build.ts and watch.ts, which is
how the help text for --ast and --lut drifted into claiming they only work
with formatjs. WatchOptions is now BuildOptions, since watch already passed
--timeZone through to the build despite the type saying otherwise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
husky 9 keeps sourcing _/husky.sh working as a deprecation shim, but running
the hook prints "husky - DEPRECATED" and asks for the two lines to be removed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@formatjs/cli-lib is only reachable as `import type { CompileOpts }`, and the
built lib/ never references it, so consumers were downloading it plus fs-extra,
fast-glob and a native binary for one type. json-stable-stringify is the
opposite case: compile-formatjs-bundle.ts imports it at runtime and it shipped
in lib/, but it was only resolvable through cli-lib's own dependency tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
typescript 7 is the native compiler and accepts node20/nodenext. The package
requires node 22.12 anyway, so target es2017 and module node16 were leaving
downlevelling on for engines that no longer need it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The key order in bundle_<locale>.json and lut.ts followed the order the
filesystem handed out directory entries in. That is sorted on APFS but
arbitrary on ext4, so the same messages could produce different files on a
laptop and in CI.

sortIntlFiles orders by normalized id, so the result is also the same on
Windows (\) and unix (/), and deliberately avoids localeCompare, whose
ordering depends on the ICU data of the machine running the build.

Verified against the 1268 message files in nybolig-nettsider: same key set,
same values, and bundle_<locale>.compiled.json is bit-identical since
json-stable-stringify already sorted that one. Only the order changes. A
consumer that gitignores the generated output and regenerates it on predev,
as nybolig-nettsider does, sees no difference at all; one that commits it
gets a one-time reordering.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
memfs and node both support readdirSync(dir, { recursive: true }), so the
hand-rolled recursion is no longer needed. The lstat check stays: a folder can
be named close_nb.txt, and filtering on the name alone would let it through.

Tests cover four levels of nesting, that folders are excluded, that a folder
named like a message file is excluded, and that an empty tree yields nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The script format writes javascript, which the AST compiler then tried to
JSON.parse, failing with "Unexpected token 'c', "const text"... is not valid
JSON". --ast still works with json, jsonlut and formatjs, which the tests pin
so the guard does not grow too wide.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The colour started with \x0b, a vertical tab, rather than \x1b. Terminals
printed a literal "[33m" and left WARN uncoloured. The other four levels were
already correct.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The format examples still used the pre-4.0.0 "/" id separator, and the option
descriptions repeated the "only availble with formatjs" claim. Neither the
naming convention for message files nor how to consume the generated output
was written down anywhere, so the README alone was not enough to use the
package.

Adds the file naming rules, what each generated file is for, how to wire
createIntlLUT up to createIntl, and how ICU constructs map to argument types.
Drops the stale "Breaking Changes" section, which described a previous release
and belongs in the changelog.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The package now requires node >= 22.12 and stops supporting node 20, which
commander 15 forces and the engines field enforces. That is what makes this
a major; the reordering of generated files is invisible to a consumer that
gitignores them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Mortefal
Mortefal force-pushed the chore/package-updates branch from f2980b7 to af38109 Compare September 7, 2026 17:58
@Mortefal
Mortefal merged commit 780b114 into master Sep 8, 2026
1 check passed
@Mortefal
Mortefal deleted the chore/package-updates branch September 8, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants