@violetflux/kerros 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -286,7 +286,7 @@ Kerros uses the official `use-sync-external-store` shim for React 17 and prefers
286
286
 
287
287
  ## ESLint guardrails
288
288
 
289
- Install the separate type-aware plugin for the safest default usage:
289
+ Install the lightweight plugin for file-local Kerros conventions:
290
290
 
291
291
  ```sh
292
292
  npm install --save-dev @violetflux/eslint-plugin-kerros @typescript-eslint/parser
@@ -295,12 +295,12 @@ npm install --save-dev @violetflux/eslint-plugin-kerros @typescript-eslint/parse
295
295
  ```js
296
296
  import kerros from '@violetflux/eslint-plugin-kerros'
297
297
 
298
- export default [kerros.configs.recommendedTypeChecked]
298
+ export default [kerros.configs.recommended]
299
299
  ```
300
300
 
301
- `recommendedTypeChecked` enables all 16 rules as errors and uses TypeScript `projectService`. Very large repositories may use `kerros.configs.fastTypeChecked`, which keeps type-aware Store recognition but disables the most expensive whole-program and deep analyses. See the [measured ESLint benchmark](https://github.com/violetflux/kerros/blob/main/benchmarks/eslint/RESULTS.md); the fast profile is a tradeoff, not an untyped fallback. The plugin analyzes complete TS/TSX files, not incomplete Markdown snippets.
301
+ `recommended` is the plugin's only preset and does not enable TypeScript `projectService`. It recognizes direct `createStore` and `bindStore` imports, including local aliases and namespace imports, then checks the Store bindings and Hook calls created in the same file. Cross-file re-exports, wrappers, and imported Store Hooks are intentionally outside this lightweight boundary. See the [measured ESLint benchmark](https://github.com/violetflux/kerros/blob/main/benchmarks/eslint/RESULTS.md).
302
302
 
303
- `no-broad-store-access` rejects enumeration, serialization, and spreading of a complete selector-free Store snapshot. Nested object fields and intentional complete adapters inside `createStore` models are allowed by default; stricter projects can enable `includeObjectFields` and `includeStoreModels` in the rule options.
303
+ The six included rules cover factory scope, model and binding names, selector parameter names, whole-Store selectors, and broad access to file-local selector-free snapshots. The plugin favors bounded memory and predictable diagnostics over cross-file inference.
304
304
 
305
305
  For maintainers, npm Trusted Publisher entries must be configured for both `@violetflux/kerros` and `@violetflux/eslint-plugin-kerros`. That npm-side configuration is the only release step outside this repository; CI checks and publishes the runtime first, then the plugin.
306
306
 
package/README.zh-CN.md CHANGED
@@ -278,7 +278,7 @@ React 17 使用官方 `use-sync-external-store` shim;React 18 和 19 可用时
278
278
 
279
279
  ## ESLint 防护规则
280
280
 
281
- 建议安装独立的类型感知插件,并默认使用最严格配置:
281
+ 建议安装轻量插件,检查当前文件内的 Kerros 约束:
282
282
 
283
283
  ```sh
284
284
  npm install --save-dev @violetflux/eslint-plugin-kerros @typescript-eslint/parser
@@ -287,12 +287,12 @@ npm install --save-dev @violetflux/eslint-plugin-kerros @typescript-eslint/parse
287
287
  ```js
288
288
  import kerros from '@violetflux/eslint-plugin-kerros'
289
289
 
290
- export default [kerros.configs.recommendedTypeChecked]
290
+ export default [kerros.configs.recommended]
291
291
  ```
292
292
 
293
- `recommendedTypeChecked` 把全部 16 条规则设为 error,并启用 TypeScript `projectService`。超大型仓库可改用 `kerros.configs.fastTypeChecked`:它仍然通过类型识别真实 Kerros Hook,只关闭最昂贵的全程序与深层分析。请参考[真实 ESLint 压测](https://github.com/violetflux/kerros/blob/main/benchmarks/eslint/RESULTS.md);fast 是性能取舍,不是不可靠的命名降级。插件首版只分析完整 TS/TSX 文件,不分析不完整 Markdown 代码块。
293
+ `recommended` 是插件唯一的预设,不启用 TypeScript `projectService`。它识别直接导入的 `createStore`、`bindStore`、本地别名和 namespace 导入,并检查同一文件内生成的 Store 绑定与 Hook 调用。跨文件转导出、包装函数和从其他文件导入的 Store Hook 有意留在轻量边界之外。请参考[真实 ESLint 压测](https://github.com/violetflux/kerros/blob/main/benchmarks/eslint/RESULTS.md)
294
294
 
295
- `no-broad-store-access` 会禁止枚举、序列化或展开完整的无 selector Store 快照,默认允许操作嵌套对象字段,也允许在 `createStore` model 内有意代理完整 Store。需要收紧的项目可以在规则选项中启用 `includeObjectFields` 和 `includeStoreModels`。
295
+ 预设包含六条规则,覆盖工厂作用域、Model 与绑定命名、selector 参数名、返回完整 Store,以及对当前文件无 selector 快照的宽泛访问。插件优先保证内存有界和诊断稳定,不追踪跨文件类型身份。
296
296
 
297
297
  维护者还需要分别为 `@violetflux/kerros` 和 `@violetflux/eslint-plugin-kerros` 配置 npm Trusted Publisher。这是唯一的仓库外发布步骤;仓库内工作流会先检查并发布运行库,再发布插件。
298
298
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@violetflux/kerros",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Hook-native state sharing for React with automatic access tracking and focused selectors.",
5
5
  "keywords": [
6
6
  "react",