Skip to content

feat(api): add catalog mode option helpers#102

Open
swernerx wants to merge 1 commit into
mainfrom
codex/issue-54-catalog-mode-options
Open

feat(api): add catalog mode option helpers#102
swernerx wants to merge 1 commit into
mainfrom
codex/issue-54-catalog-mode-options

Conversation

@swernerx

Copy link
Copy Markdown
Member

Summary

  • Refs api: options surface — redundant semantics × plural_encoding pair and copy-pasted option structs #54.
  • Adds CatalogMode in ferrocat-po for the three valid high-level catalog combinations: ICU PO, ICU NDJSON, and Gettext PO.
  • Adds mode() and with_mode(...) helpers to UpdateCatalogOptions, UpdateCatalogFileOptions, CombineCatalogOptions, and ParseCatalogOptions so callers can keep storage format, semantics, and plural encoding synchronized.
  • Updates API docs to prefer CatalogMode for normal construction while keeping the existing explicit fields available.

Verification

  • cargo fmt --all --check
  • cargo check --workspace --all-targets --all-features --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo test --workspace --all-features --locked
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps --locked
  • cargo +1.93.0 check --workspace --all-targets --all-features --locked
  • cargo package -p ferrocat-icu -p ferrocat-po -p ferrocat --locked
  • pnpm build from docs/
  • git diff --check

Notes

  • This is a first API-design step, not the full option-struct refactor.
  • It intentionally does not close api: options surface — redundant semantics × plural_encoding pair and copy-pasted option structs #54; remaining work is removing or composing duplicated option fields once the safe construction path has landed.
  • CatalogMode is exported from ferrocat-po in this PR. The umbrella ferrocat reexport is left out so the existing package verification continues to work against the currently published lower-level crate during same-version release checks.

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.06%. Comparing base (9173e0e) to head (c90bc55).

Files with missing lines Patch % Lines
crates/ferrocat-po/src/api/types.rs 87.50% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
- Coverage   96.14%   96.06%   -0.09%     
==========================================
  Files          25       25              
  Lines        9904    10000      +96     
==========================================
+ Hits         9522     9606      +84     
- Misses        382      394      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

api: options surface — redundant semantics × plural_encoding pair and copy-pasted option structs

1 participant