Skip to content

Conversation

@longlho
Copy link
Member

@longlho longlho commented Jan 6, 2026

TL;DR

Add support for custom FormatJS CLI versions with a new example demonstrating how to use version 0.1.0.

What changed?

  • Enhanced the FormatJS CLI module extension to support custom binary versions
  • Added a new formatjs_repositories attribute to the toolchain() tag that accepts custom URLs and SHA256 checksums
  • Created a new example in examples/custom_version/ demonstrating how to use a custom FormatJS CLI version (0.1.0)
  • Removed version 0.1.0 from the built-in versions list to demonstrate the custom version feature
  • Added .lock files to linguist-generated in .gitattributes

How to test?

  1. Navigate to the custom version example:
cd examples/custom_version
  1. Build and test the example:
bazel build :messages
bazel test :test_extraction
bazel test :test_cli_version
  1. Examine the extracted messages:
cat bazel-bin/messages.json

Why make this change?

This change provides flexibility for users who need to:

  • Test unreleased or pre-release versions of FormatJS CLI
  • Use custom builds or patched versions
  • Support platforms not yet in the official releases
  • Pin to specific versions for compatibility reasons

The new API is inspired by the rules_nodejs pattern, making it familiar and easy to use for developers already working with Bazel JavaScript rules.

@longlho longlho marked this pull request as ready for review January 6, 2026 14:59
Copy link
Member Author

longlho commented Jan 6, 2026

@longlho longlho force-pushed the 01-06-fix_remove_rules_shell_dep branch 2 times, most recently from a31c4c8 to 0060039 Compare January 6, 2026 15:01
@longlho longlho force-pushed the 01-06-feat_allow_custom_formatjs_cli_toolchain branch from 261d692 to 15cca73 Compare January 6, 2026 15:01
@longlho longlho force-pushed the 01-06-fix_remove_rules_shell_dep branch from 0060039 to 8fe1051 Compare January 6, 2026 15:01
@longlho longlho force-pushed the 01-06-feat_allow_custom_formatjs_cli_toolchain branch from 15cca73 to 6a39099 Compare January 6, 2026 15:01
@longlho longlho changed the base branch from 01-06-fix_remove_rules_shell_dep to graphite-base/24 January 6, 2026 15:04
@longlho longlho force-pushed the 01-06-feat_allow_custom_formatjs_cli_toolchain branch from 6a39099 to 4e49c75 Compare January 6, 2026 15:04
@graphite-app graphite-app bot changed the base branch from graphite-base/24 to main January 6, 2026 15:04
@longlho longlho force-pushed the 01-06-feat_allow_custom_formatjs_cli_toolchain branch from 4e49c75 to e222796 Compare January 6, 2026 15:05
@longlho longlho merged commit 6fb66f6 into main Jan 6, 2026
9 checks passed
Copy link
Member Author

longlho commented Jan 6, 2026

Merge activity

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