Skip to content

Migrate cli push to glob promise API (fixes silent no-op on glob v9+) - #247

Open
deathbird wants to merge 1 commit into
masterfrom
fix/cli-glob-v9-promise-api
Open

Migrate cli push to glob promise API (fixes silent no-op on glob v9+)#247
deathbird wants to merge 1 commit into
masterfrom
fix/cli-glob-v9-promise-api

Conversation

@deathbird

Copy link
Copy Markdown
Contributor

What

Migrates txjs-cli push from glob's removed v8 callback API to the promise API, bumps glob ^8.1.0^10.5.0, and sorts glob results.

Why

When a workspace resolves glob ≥9 (e.g. a security tool force-upgrading past the deprecated glob@8 line), the old callback never fires, the await never settles, and push exits 0 having uploaded nothing — a silent failure that keeps CI green while no strings reach Transifex. Reproduced on glob 11: prints "Parsing all files…" then exits 0.

Notes

  • glob@8.1.0 was not affected by CVE-2025-64756 (that advisory covers glob's CLI in >=10.2.0 <10.5.0 / >=11.0.0 <11.1.0; this uses the library API). Real motivation is glob v9+ compatibility + dropping deprecated glob@8.
  • glob v9+ dropped default sorting; .sort() restores deterministic payload order (mergePayload is last-write-wins on developer_comment/character_limit).
  • Pin ^10.5.0, not a current major: glob 13 requires Node ≥18, conflicting with this package's engines.node: ">=16.0.0".
  • Supersedes Update glob to v10.5 to fix CVE-2025-64756 #239 (community PR by @guaycuru, credited as co-author); adds the sort fix and corrected rationale.
  • Follow-ups (separate PRs): exit codes on the bail-out paths, node_modules ignore, --purge safety when files fail to parse, and a regression test for glob ordering.

🤖 Generated with Claude Code

The push command wrapped glob's v8 callback API in a Promise. glob v9
removed the callback API, so when a workspace resolves glob >=9 (e.g. a
security tool force-upgrading past the deprecated glob@8 line), the
callback never fires, the await never settles, and `txjs-cli push` exits
0 having parsed and uploaded nothing -- a silent push failure that keeps
CI green while no strings reach Transifex.

Switch to `await glob(filePattern)` (works on glob v9-v11) and bump the
dependency from the deprecated ^8.1.0 to ^10.5.0.

glob v9+ also dropped default alphabetical sorting of results, which the
push pipeline relies on: mergePayload is last-write-wins for
developer_comment/character_limit and order-preserving for
occurrences/tags, so unsorted results make the uploaded payload depend on
filesystem order. Sort the results to restore deterministic output.

Note: glob@8.1.0 was not itself affected by CVE-2025-64756; that
advisory covers glob's CLI (-c/--cmd) in ranges >=10.2.0 <10.5.0 and
>=11.0.0 <11.1.0, which this library-API usage never touches. The real
motivation is glob v9+ compatibility and dropping the deprecated glob@8.

Co-authored-by: Felipe Guaycuru <guaycuru@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KCnNk8wHfxAovnhYmVEBe2
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.

1 participant