24 lines
1.9 KiB
Markdown
24 lines
1.9 KiB
Markdown
## KriFrontCommon Consumer Contract
|
|
|
|
### Package Usage
|
|
|
|
- Consume this contract through the published `@kri/common` package and only through entry points declared in its `package.json` `exports` map.
|
|
- Use the package root for runtime-neutral object, URL, date, string, and shared type utilities.
|
|
- Use a focused subpath such as `@kri/common/http`, `@kri/common/browser`, `@kri/common/server`, `@kri/common/security`, `@kri/common/hooks`, `@kri/common/query`, `@kri/common/config`, `@kri/common/jotai`, or `@kri/common/noti-hub` for the corresponding capability.
|
|
- Do not import from `@kri/common/src/*`, `@kri/common/dist/*`, or another undeclared deep path.
|
|
- Do not copy or fork a shared utility locally merely to avoid using an available public entry point. Propose a backward-compatible library addition when the shared contract is genuinely missing.
|
|
|
|
### Runtime and Optional Integrations
|
|
|
|
- Keep browser, server, and runtime-neutral imports on their intended side of the application boundary.
|
|
- A consumer that uses React hooks, TanStack Query, or Jotai integrations must provide the compatible optional peer dependency required by its selected entry point.
|
|
- Preserve the project's established HTTP client, authentication, error-policy, query-client, storage, and environment conventions when adopting a shared helper.
|
|
- Validate external data at runtime; a shared TypeScript type alone does not validate an API response or persisted value.
|
|
- Prefer named public exports and retain the consumer project's current module system and bundler conventions.
|
|
|
|
### Change Safety
|
|
|
|
- Pin or constrain the package version according to the consumer repository's dependency policy and commit its lockfile changes.
|
|
- Review release notes and the actual affected API before upgrading. Run the consumer's focused type-check, test, and build commands after an upgrade.
|
|
- Do not modify KriFrontCommon or another consumer repository unless it is explicitly included in the approved task scope.
|