feat(docs): add bilingual package documentation site

This commit is contained in:
Maofeng
2026-09-20 15:53:28 +08:00
parent 60f6f1fb1a
commit dc80bd8ae0
111 changed files with 6531 additions and 0 deletions
@@ -0,0 +1,28 @@
---
title: Overview
description: Understand the role and boundaries of the Preferences package.
order: 1
toc:
- id: package-role
title: Package role
- id: capabilities
title: Capabilities
- id: design-boundary
title: Design boundary
---
## Package role {#package-role}
`@workspace/preferences` is a small React store for application preferences such as theme mode, navigation density, and compact layouts. It keeps the preference vocabulary owned by the consuming application.
## Capabilities {#capabilities}
- Extend the preference shape through TypeScript module augmentation.
- Hydrate a deterministic server snapshot with `useSyncExternalStore`.
- Persist typed `{ key, value }` updates through an application callback.
- Synchronize preferences with browser APIs through composable effects.
- Validate external updates from cookies, requests, forms, or message channels.
## Design boundary {#design-boundary}
The package does not define product-specific keys and does not select a persistence service. The application supplies its complete initial snapshot and decides how accepted changes are stored.