Skip to content

Add unitPreference to PlatformConfig#607

Merged
seveibar merged 1 commit intomainfrom
codex/add-unitpreference-to-platformconfig
Mar 3, 2026
Merged

Add unitPreference to PlatformConfig#607
seveibar merged 1 commit intomainfrom
codex/add-unitpreference-to-platformconfig

Conversation

@seveibar
Copy link
Contributor

@seveibar seveibar commented Mar 3, 2026

Motivation

  • Provide a platform-wide preference for measurement units so consumers can opt into "mm" | "in" | "mil" formatting where applicable.

Description

  • Added an optional unitPreference?: "mm" | "in" | "mil" property to the PlatformConfig TypeScript interface in lib/platformConfig.ts.
  • Added Zod validation for the new property via unitPreference: z.enum(["mm","in","mil"]).optional() in the platformConfig schema.
  • Added tests/platformConfig.unitPreference.test.ts to assert accepted values and to reject unsupported values.
  • Regenerated documentation artifacts so the new field appears in README.md and generated/PROPS_OVERVIEW.md.

Testing

  • Ran bun test tests/platformConfig.unitPreference.test.ts which passed (2 tests, 0 failures).
  • Ran generation scripts bun scripts/generate-component-types.ts, bun scripts/generate-manual-edits-docs.ts, bun scripts/generate-readme-docs.ts, and bun scripts/generate-props-overview.ts which completed successfully.
  • Ran typecheck with bunx tsc --noEmit which completed without errors.
  • Ran formatting with bun run format which completed successfully.

Codex Task

@seveibar seveibar merged commit e622c34 into main Mar 3, 2026
4 checks passed
@seveibar seveibar deleted the codex/add-unitpreference-to-platformconfig branch March 3, 2026 04:49
@tscircuitbot
Copy link
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants