@composy/store-vue 0.0.1 → 0.0.2
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/CHANGELOG.md +59 -0
- package/README.md +169 -154
- package/dist/index.js +151 -53
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +242 -170
- package/dist/index.min.js.map +1 -1
- package/es/.dts-output-manifest.json +1 -0
- package/es/.dts.tsbuildinfo +1 -0
- package/es/composables/defineSetupStore.d.ts +0 -1
- package/es/composables/defineSetupStore.d.ts.map +1 -1
- package/es/composables/defineSetupStore.js +1 -1
- package/es/composables/defineSetupStore.js.map +1 -1
- package/es/composables/index.d.ts +8 -9
- package/es/composables/index.d.ts.map +1 -1
- package/es/composables/index.js +1 -1
- package/es/composables/useFormStore.d.ts +0 -1
- package/es/composables/useFormStore.d.ts.map +1 -1
- package/es/composables/useFormStore.js +1 -1
- package/es/composables/useFormStore.js.map +1 -1
- package/es/composables/useOptimistic.d.ts +1 -52
- package/es/composables/useOptimistic.d.ts.map +1 -1
- package/es/composables/useOptimistic.js +35 -20
- package/es/composables/useOptimistic.js.map +1 -1
- package/es/composables/usePersist.d.ts +0 -1
- package/es/composables/usePersist.d.ts.map +1 -1
- package/es/composables/usePersist.js +16 -7
- package/es/composables/usePersist.js.map +1 -1
- package/es/composables/usePersistedState.d.ts +0 -1
- package/es/composables/usePersistedState.d.ts.map +1 -1
- package/es/composables/usePersistedState.js +16 -3
- package/es/composables/usePersistedState.js.map +1 -1
- package/es/composables/useSharedState.d.ts +0 -1
- package/es/composables/useSharedState.d.ts.map +1 -1
- package/es/composables/useSharedState.js +25 -8
- package/es/composables/useSharedState.js.map +1 -1
- package/es/composables/useStore.d.ts +0 -1
- package/es/composables/useStore.js +1 -1
- package/es/composables/useStore.js.map +1 -1
- package/es/composables/useStoreDevtools.d.ts +0 -1
- package/es/composables/useStoreDevtools.d.ts.map +1 -1
- package/es/composables/useStoreDevtools.js +1 -1
- package/es/composables/useStoreDevtools.js.map +1 -1
- package/es/composables/useStoreSnapshot.d.ts +0 -1
- package/es/composables/useStoreSnapshot.d.ts.map +1 -1
- package/es/composables/useStoreSnapshot.js +18 -8
- package/es/composables/useStoreSnapshot.js.map +1 -1
- package/es/composables/useSubscribe.d.ts +0 -1
- package/es/composables/useSubscribe.d.ts.map +1 -1
- package/es/composables/useSubscribe.js +1 -1
- package/es/composables/useSubscribe.js.map +1 -1
- package/es/context/injection-keys.d.ts +0 -1
- package/es/context/injection-keys.d.ts.map +1 -1
- package/es/context/injection-keys.js +1 -1
- package/es/context/injection-keys.js.map +1 -1
- package/es/index.d.ts +1 -2
- package/es/index.js +2 -2
- package/es/index.js.map +1 -1
- package/es/plugins/engine-plugin.d.ts +1 -2
- package/es/plugins/engine-plugin.d.ts.map +1 -1
- package/es/plugins/engine-plugin.js +2 -2
- package/es/plugins/engine-plugin.js.map +1 -1
- package/es/plugins/enhanced-persist-plugin.d.ts +0 -1
- package/es/plugins/enhanced-persist-plugin.js +1 -1
- package/es/plugins/index.d.ts +0 -1
- package/es/plugins/index.js +1 -1
- package/es/plugins/pinia-plugin.d.ts +0 -1
- package/es/plugins/pinia-plugin.d.ts.map +1 -1
- package/es/plugins/pinia-plugin.js +24 -6
- package/es/plugins/pinia-plugin.js.map +1 -1
- package/es/plugins/registry-plugin.d.ts +0 -1
- package/es/plugins/registry-plugin.js +1 -1
- package/es/plugins/vue-plugin.d.ts +0 -1
- package/es/plugins/vue-plugin.d.ts.map +1 -1
- package/es/plugins/vue-plugin.js +1 -1
- package/es/plugins/vue-plugin.js.map +1 -1
- package/es/runtime/install-store-app.d.ts +0 -1
- package/es/runtime/install-store-app.js +1 -1
- package/es/runtime/install-store-app.js.map +1 -1
- package/es/runtime/store-plugin-options.d.ts +0 -1
- package/es/runtime/store-plugin-options.js +1 -1
- package/es/runtime/store-plugin-options.js.map +1 -1
- package/es/runtime/store-registry.d.ts +0 -1
- package/es/runtime/store-registry.d.ts.map +1 -1
- package/es/runtime/store-registry.js +14 -4
- package/es/runtime/store-registry.js.map +1 -1
- package/es/runtime/store-runtime.d.ts +1 -2
- package/es/runtime/store-runtime.d.ts.map +1 -1
- package/es/runtime/store-runtime.js +8 -2
- package/es/runtime/store-runtime.js.map +1 -1
- package/es/types.d.ts +2 -1
- package/es/types.d.ts.map +1 -1
- package/es/types.js +1 -1
- package/esm/composables/defineSetupStore.d.ts.map +1 -1
- package/esm/composables/defineSetupStore.js +1 -1
- package/esm/composables/defineSetupStore.js.map +1 -1
- package/esm/composables/index.d.ts +8 -8
- package/esm/composables/index.d.ts.map +1 -1
- package/esm/composables/index.js +1 -1
- package/esm/composables/useFormStore.d.ts.map +1 -1
- package/esm/composables/useFormStore.js +1 -1
- package/esm/composables/useFormStore.js.map +1 -1
- package/esm/composables/useOptimistic.d.ts +1 -51
- package/esm/composables/useOptimistic.d.ts.map +1 -1
- package/esm/composables/useOptimistic.js +35 -20
- package/esm/composables/useOptimistic.js.map +1 -1
- package/esm/composables/usePersist.d.ts.map +1 -1
- package/esm/composables/usePersist.js +16 -7
- package/esm/composables/usePersist.js.map +1 -1
- package/esm/composables/usePersistedState.d.ts.map +1 -1
- package/esm/composables/usePersistedState.js +16 -3
- package/esm/composables/usePersistedState.js.map +1 -1
- package/esm/composables/useSharedState.d.ts.map +1 -1
- package/esm/composables/useSharedState.js +25 -8
- package/esm/composables/useSharedState.js.map +1 -1
- package/esm/composables/useStore.js +1 -1
- package/esm/composables/useStore.js.map +1 -1
- package/esm/composables/useStoreDevtools.d.ts.map +1 -1
- package/esm/composables/useStoreDevtools.js +1 -1
- package/esm/composables/useStoreDevtools.js.map +1 -1
- package/esm/composables/useStoreSnapshot.d.ts.map +1 -1
- package/esm/composables/useStoreSnapshot.js +18 -8
- package/esm/composables/useStoreSnapshot.js.map +1 -1
- package/esm/composables/useSubscribe.d.ts.map +1 -1
- package/esm/composables/useSubscribe.js +1 -1
- package/esm/composables/useSubscribe.js.map +1 -1
- package/esm/context/injection-keys.d.ts.map +1 -1
- package/esm/context/injection-keys.js +1 -1
- package/esm/context/injection-keys.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/plugins/engine-plugin.d.ts +1 -1
- package/esm/plugins/engine-plugin.d.ts.map +1 -1
- package/esm/plugins/engine-plugin.js +2 -2
- package/esm/plugins/engine-plugin.js.map +1 -1
- package/esm/plugins/enhanced-persist-plugin.js +1 -1
- package/esm/plugins/index.js +1 -1
- package/esm/plugins/pinia-plugin.d.ts.map +1 -1
- package/esm/plugins/pinia-plugin.js +24 -6
- package/esm/plugins/pinia-plugin.js.map +1 -1
- package/esm/plugins/registry-plugin.js +1 -1
- package/esm/plugins/vue-plugin.d.ts.map +1 -1
- package/esm/plugins/vue-plugin.js +1 -1
- package/esm/plugins/vue-plugin.js.map +1 -1
- package/esm/runtime/install-store-app.js +1 -1
- package/esm/runtime/install-store-app.js.map +1 -1
- package/esm/runtime/store-plugin-options.js +1 -1
- package/esm/runtime/store-plugin-options.js.map +1 -1
- package/esm/runtime/store-registry.d.ts.map +1 -1
- package/esm/runtime/store-registry.js +14 -4
- package/esm/runtime/store-registry.js.map +1 -1
- package/esm/runtime/store-runtime.d.ts +1 -1
- package/esm/runtime/store-runtime.d.ts.map +1 -1
- package/esm/runtime/store-runtime.js +8 -2
- package/esm/runtime/store-runtime.js.map +1 -1
- package/esm/types.d.ts +2 -0
- package/esm/types.d.ts.map +1 -1
- package/esm/types.js +1 -1
- package/lib/composables/defineSetupStore.cjs +1 -1
- package/lib/composables/defineSetupStore.cjs.map +1 -1
- package/lib/composables/{defineSetupStore.d.ts → defineSetupStore.d.cts} +0 -1
- package/lib/composables/defineSetupStore.d.cts.map +1 -0
- package/lib/composables/index.cjs +1 -1
- package/lib/composables/{index.d.ts → index.d.cts} +8 -9
- package/lib/composables/index.d.cts.map +1 -0
- package/lib/composables/useFormStore.cjs +1 -1
- package/lib/composables/useFormStore.cjs.map +1 -1
- package/lib/composables/{useFormStore.d.ts → useFormStore.d.cts} +0 -1
- package/lib/composables/useFormStore.d.cts.map +1 -0
- package/lib/composables/useOptimistic.cjs +35 -20
- package/lib/composables/useOptimistic.cjs.map +1 -1
- package/lib/composables/useOptimistic.d.cts +16 -0
- package/lib/composables/useOptimistic.d.cts.map +1 -0
- package/lib/composables/usePersist.cjs +16 -7
- package/lib/composables/usePersist.cjs.map +1 -1
- package/lib/composables/{usePersist.d.ts → usePersist.d.cts} +0 -1
- package/lib/composables/usePersist.d.cts.map +1 -0
- package/lib/composables/usePersistedState.cjs +16 -3
- package/lib/composables/usePersistedState.cjs.map +1 -1
- package/lib/composables/{usePersistedState.d.ts → usePersistedState.d.cts} +0 -1
- package/lib/composables/usePersistedState.d.cts.map +1 -0
- package/lib/composables/useSharedState.cjs +24 -7
- package/lib/composables/useSharedState.cjs.map +1 -1
- package/lib/composables/{useSharedState.d.ts → useSharedState.d.cts} +0 -1
- package/lib/composables/useSharedState.d.cts.map +1 -0
- package/lib/composables/useStore.cjs +1 -1
- package/lib/composables/useStore.cjs.map +1 -1
- package/lib/composables/{useStore.d.ts → useStore.d.cts} +0 -1
- package/lib/composables/useStore.d.cts.map +1 -0
- package/lib/composables/useStoreDevtools.cjs +1 -1
- package/lib/composables/useStoreDevtools.cjs.map +1 -1
- package/lib/composables/{useStoreDevtools.d.ts → useStoreDevtools.d.cts} +0 -1
- package/lib/composables/useStoreDevtools.d.cts.map +1 -0
- package/lib/composables/useStoreSnapshot.cjs +18 -8
- package/lib/composables/useStoreSnapshot.cjs.map +1 -1
- package/lib/composables/{useStoreSnapshot.d.ts → useStoreSnapshot.d.cts} +0 -1
- package/lib/composables/useStoreSnapshot.d.cts.map +1 -0
- package/lib/composables/useSubscribe.cjs +1 -1
- package/lib/composables/useSubscribe.cjs.map +1 -1
- package/lib/composables/{useSubscribe.d.ts → useSubscribe.d.cts} +0 -1
- package/lib/composables/useSubscribe.d.cts.map +1 -0
- package/lib/context/injection-keys.cjs +1 -1
- package/lib/context/injection-keys.cjs.map +1 -1
- package/lib/context/{injection-keys.d.ts → injection-keys.d.cts} +0 -1
- package/lib/context/injection-keys.d.cts.map +1 -0
- package/lib/index.cjs +2 -2
- package/lib/index.cjs.map +1 -1
- package/lib/{index.d.ts → index.d.cts} +1 -2
- package/lib/index.d.cts.map +1 -0
- package/lib/plugins/engine-plugin.cjs +2 -2
- package/lib/plugins/engine-plugin.cjs.map +1 -1
- package/lib/plugins/{engine-plugin.d.ts → engine-plugin.d.cts} +1 -2
- package/lib/plugins/engine-plugin.d.cts.map +1 -0
- package/lib/plugins/enhanced-persist-plugin.cjs +1 -1
- package/lib/plugins/{enhanced-persist-plugin.d.ts → enhanced-persist-plugin.d.cts} +0 -1
- package/lib/plugins/enhanced-persist-plugin.d.cts.map +1 -0
- package/lib/plugins/index.cjs +1 -1
- package/lib/plugins/{index.d.ts → index.d.cts} +0 -1
- package/lib/plugins/index.d.cts.map +1 -0
- package/lib/plugins/pinia-plugin.cjs +24 -6
- package/lib/plugins/pinia-plugin.cjs.map +1 -1
- package/lib/plugins/{pinia-plugin.d.ts → pinia-plugin.d.cts} +0 -1
- package/lib/plugins/pinia-plugin.d.cts.map +1 -0
- package/lib/plugins/registry-plugin.cjs +1 -1
- package/lib/plugins/{registry-plugin.d.ts → registry-plugin.d.cts} +0 -1
- package/lib/plugins/registry-plugin.d.cts.map +1 -0
- package/lib/plugins/vue-plugin.cjs +1 -1
- package/lib/plugins/vue-plugin.cjs.map +1 -1
- package/lib/plugins/{vue-plugin.d.ts → vue-plugin.d.cts} +0 -1
- package/lib/plugins/vue-plugin.d.cts.map +1 -0
- package/lib/runtime/install-store-app.cjs +1 -1
- package/lib/runtime/install-store-app.cjs.map +1 -1
- package/lib/runtime/{install-store-app.d.ts → install-store-app.d.cts} +0 -1
- package/lib/runtime/install-store-app.d.cts.map +1 -0
- package/lib/runtime/store-plugin-options.cjs +1 -1
- package/lib/runtime/store-plugin-options.cjs.map +1 -1
- package/lib/runtime/{store-plugin-options.d.ts → store-plugin-options.d.cts} +0 -1
- package/lib/runtime/store-plugin-options.d.cts.map +1 -0
- package/lib/runtime/store-registry.cjs +14 -4
- package/lib/runtime/store-registry.cjs.map +1 -1
- package/lib/runtime/{store-registry.d.ts → store-registry.d.cts} +0 -1
- package/lib/runtime/store-registry.d.cts.map +1 -0
- package/lib/runtime/store-runtime.cjs +8 -2
- package/lib/runtime/store-runtime.cjs.map +1 -1
- package/lib/runtime/{store-runtime.d.ts → store-runtime.d.cts} +1 -2
- package/lib/runtime/store-runtime.d.cts.map +1 -0
- package/lib/types.cjs +1 -1
- package/lib/{types.d.ts → types.d.cts} +2 -1
- package/lib/types.d.cts.map +1 -0
- package/package.json +19 -16
- package/lib/composables/useOptimistic.d.ts +0 -67
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.2] - 2026-10-12
|
|
4
|
+
|
|
5
|
+
### ✨ 新功能
|
|
6
|
+
|
|
7
|
+
- **store**: 优化核心类型定义与基础实现,完善文档及示例 ([1a4771d](https://gitee.com/ldesign-v1/ldesign-store/commit/1a4771ddfb2802408500d13d4824f40b1290812d)) - @swimly
|
|
8
|
+
- **store**: 添加 LDesign 项目配置及 Store 优化实施规范 ([7c2671e](https://gitee.com/ldesign-v1/ldesign-store/commit/7c2671e5cef66284d3acdd84297472afeea0b5e0)) - @swimly
|
|
9
|
+
- **store**: 添加文档与示例,优化 usePersistedState 并补充运行时测试 ([9ac19c9](https://gitee.com/ldesign-v1/ldesign-store/commit/9ac19c959b36103b08ce7ce427834cc16d0cb2a0)) - @swimly
|
|
10
|
+
- **store**: 完善构建配置并暴露 getters 和 actions 运行时属性 ([8545317](https://gitee.com/ldesign-v1/ldesign-store/commit/854531704d5a9ec9222eee40d445112722f2e698)) - @swimly
|
|
11
|
+
- auto-generated playground + README for store sub-packages ([90e109c](https://gitee.com/ldesign-v1/ldesign-store/commit/90e109c10b911656a6ed2322b2815bf83baaea2f)) - @swimly
|
|
12
|
+
- add playground for store\packages\vue ([711b15a](https://gitee.com/ldesign-v1/ldesign-store/commit/711b15ad5dee7299358755f7d5b79cae93226769)) - @swimly
|
|
13
|
+
- 新增 Vue 插件、工具函数与 Playground 示例 ([4df6602](https://gitee.com/ldesign-v1/ldesign-store/commit/4df6602a2800b3698e6bc5c7036a140958a0504c)) - @swimly
|
|
14
|
+
- 新增工具类型、错误处理和快照功能 ([6219701](https://gitee.com/ldesign-v1/ldesign-store/commit/6219701e7327f26794df8264cbd70c3037618080)) - @swimly
|
|
15
|
+
- **vue**: 新增持久化状态管理和增强版持久化插件 ([17fcaf6](https://gitee.com/ldesign-v1/ldesign-store/commit/17fcaf6e7a3334e54056e72296fb6e8aa8663fb1)) - @swimly
|
|
16
|
+
|
|
17
|
+
### ♻️ 代码重构
|
|
18
|
+
|
|
19
|
+
- 重构项目配置与代码结构,优化类型系统与功能 ([64e29ac](https://gitee.com/ldesign-v1/ldesign-store/commit/64e29ac61444ffff1e6e792bbe9a9501227e376b)) - @swimly
|
|
20
|
+
- **vue**: 重构运行时架构并统一持久化实现 ([c9a66e3](https://gitee.com/ldesign-v1/ldesign-store/commit/c9a66e3e563780a4f46879387faaa9f8b1408709)) - @swimly
|
|
21
|
+
- 移除文档系统和playground,标准化构建配置 ([9ae1c1b](https://gitee.com/ldesign-v1/ldesign-store/commit/9ae1c1b150aa765fae43e3599d338691a9a01345)) - @swimly
|
|
22
|
+
- **core**: 重构核心模块结构并优化类型定义 ([20a3436](https://gitee.com/ldesign-v1/ldesign-store/commit/20a343674d6f5117089729acd0732a64ad0d21b8)) - @swimly
|
|
23
|
+
- **build**: 移除umd格式并更新构建配置 ([c02dc47](https://gitee.com/ldesign-v1/ldesign-store/commit/c02dc47d00a56a6ed22b7391777953053ad6c740)) - @swimly
|
|
24
|
+
|
|
25
|
+
### 📦 构建系统
|
|
26
|
+
|
|
27
|
+
- add rolldown bundler config for vue and core packages ([2a1f932](https://gitee.com/ldesign-v1/ldesign-store/commit/2a1f932a150c946b8c453a25527c4de1353c5d0a)) - @swimly
|
|
28
|
+
- 升级项目所有依赖至兼容最新版本 ([2bf6f05](https://gitee.com/ldesign-v1/ldesign-store/commit/2bf6f05ca266c410d2df4d5ec1ccea5840654492)) - @swimly
|
|
29
|
+
- **deps**: 修复并完善依赖包版本配置 ([a327dd4](https://gitee.com/ldesign-v1/ldesign-store/commit/a327dd43f03a16a1f00cc79f89cfae7fe94e624d)) - @swimly
|
|
30
|
+
- **vue**: 添加vue包下的rollup构建缓存文件 ([12d429a](https://gitee.com/ldesign-v1/ldesign-store/commit/12d429a7d1edc901d9744b60d2e56f623a60ae55)) - @swimly
|
|
31
|
+
- 重构构建配置与修复类型检查问题 ([2ef2c0b](https://gitee.com/ldesign-v1/ldesign-store/commit/2ef2c0b74779cf4911cb61954bfce8523b9b5725)) - @swimly
|
|
32
|
+
- 标准化构建配置并调整输出目录结构 ([33c101e](https://gitee.com/ldesign-v1/ldesign-store/commit/33c101ee476820b3a3de8be1be354169ba4e90b5)) - @swimly
|
|
33
|
+
- **vue**: 添加 libraryType 配置并扩展 core 包导出 ([980c3e8](https://gitee.com/ldesign-v1/ldesign-store/commit/980c3e87ce3be2b73f2d74073e702da3ce79b8f8)) - @swimly
|
|
34
|
+
|
|
35
|
+
### 🔧 其他
|
|
36
|
+
|
|
37
|
+
- 更新项目配置与依赖版本 ([a98d95c](https://gitee.com/ldesign-v1/ldesign-store/commit/a98d95c2cf6fc17d601dcdfc34940dca631426f3)) - @swimly
|
|
38
|
+
- 更新 core 和 vue 包的依赖版本 ([8e29acd](https://gitee.com/ldesign-v1/ldesign-store/commit/8e29acdad154447e140c7475313ff947265ffef2)) - @swimly
|
|
39
|
+
- update store (26 files) ([b8cccd2](https://gitee.com/ldesign-v1/ldesign-store/commit/b8cccd20cd665d78968b104c030aacf01f33f2a8)) - @swimly
|
|
40
|
+
- normalize versions, clean artifacts, update gitignore ([7b373ed](https://gitee.com/ldesign-v1/ldesign-store/commit/7b373ed6f54f1afc004ae7ac3ebc33fea062a22b)) - @swimly
|
|
41
|
+
- update - docs(core): 新增@ldesign/store-core优化任务æ ([a486937](https://gitee.com/ldesign-v1/ldesign-store/commit/a486937b0c0939cad23dcfcb675dd2aa450171cd)) - @swimly
|
|
42
|
+
- 批量更新 - 规范 .gitignore 清理源码 ([d4fc64e](https://gitee.com/ldesign-v1/ldesign-store/commit/d4fc64ebb656fa8ef03adc319b41becaa453fd00)) - @swimly
|
|
43
|
+
- unified build config and structure ([e41794e](https://gitee.com/ldesign-v1/ldesign-store/commit/e41794e94409cf358de7568b812794d44b656813)) - @swimly
|
|
44
|
+
- 统一配置 ESLint、Prettier 和测试脚本 ([de95488](https://gitee.com/ldesign-v1/ldesign-store/commit/de95488a91bbe087badc21feabf9f54a22ee5459)) - @swimly
|
|
45
|
+
- 统一代码规范配置并更新测试工具 ([7ecaf03](https://gitee.com/ldesign-v1/ldesign-store/commit/7ecaf03f7bd22ae43b9d0775f8439a583f548829)) - @swimly
|
|
46
|
+
- 更新依赖版本至固定版本并移除冗余插件 ([fd11677](https://gitee.com/ldesign-v1/ldesign-store/commit/fd116777c7ca95a0d29ea1e05d6c4e7513584a33)) - @swimly
|
|
47
|
+
- batch commit submodule changes ([b2bb508](https://gitee.com/ldesign-v1/ldesign-store/commit/b2bb508085b6eac2b9e748a89b46470964382b6d)) - @swimly
|
|
48
|
+
- set versions to 0.0.1 and pin @ldesign deps ([b4219a7](https://gitee.com/ldesign-v1/ldesign-store/commit/b4219a727eeaf842199869cb9b40c702010bbb2f)) - @swimly
|
|
49
|
+
- 更新多个子模块至最新提交并重构lottie库依赖配置 ([792a7ec](https://gitee.com/ldesign-v1/ldesign-store/commit/792a7eca24e6f9825ad37fb70926b1562c17ae52)) - @swimly
|
|
50
|
+
- 移除多余的空行并删除vue示例的README文件 ([37c15f7](https://gitee.com/ldesign-v1/ldesign-store/commit/37c15f7d7df4acafdc3307a6417e468c503bfa0f)) - @swimly
|
|
51
|
+
|
|
52
|
+
### 👥 Contributors
|
|
53
|
+
|
|
54
|
+
swimly, swimly
|
|
55
|
+
|
|
56
|
+
### 📊 Statistics
|
|
57
|
+
|
|
58
|
+
- Total Commits: **35**
|
|
59
|
+
- Contributors: **2**
|
package/README.md
CHANGED
|
@@ -1,154 +1,169 @@
|
|
|
1
|
-
# @composy/store-vue
|
|
2
|
-
|
|
3
|
-
`@composy/store-vue` 是 `packages/store` 的 Vue 3 适配层。
|
|
4
|
-
|
|
5
|
-
它保留现有定位不变:
|
|
6
|
-
|
|
7
|
-
- 基于 Pinia 提供 Vue 侧接入能力
|
|
8
|
-
- 提供一组围绕 Store 的 composables
|
|
9
|
-
- 提供持久化、注册表和调试相关插件能力
|
|
10
|
-
- 同时支持原生 Vue Plugin 用法和 `@composy/engine-core` plugin 用法
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
├─
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- `runtime/store-
|
|
31
|
-
-
|
|
32
|
-
- `runtime/
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- `
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- `
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- `
|
|
105
|
-
-
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
1
|
+
# @composy/store-vue
|
|
2
|
+
|
|
3
|
+
`@composy/store-vue` 是 `packages/store` 的 Vue 3 适配层。
|
|
4
|
+
|
|
5
|
+
它保留现有定位不变:
|
|
6
|
+
|
|
7
|
+
- 基于 Pinia 提供 Vue 侧接入能力
|
|
8
|
+
- 提供一组围绕 Store 的 composables
|
|
9
|
+
- 提供持久化、注册表和调试相关插件能力
|
|
10
|
+
- 同时支持原生 Vue Plugin 用法和 `@composy/engine-core` plugin 用法
|
|
11
|
+
|
|
12
|
+
Registry lifecycle is explicit: `unregister()` and `clear()` restore any `$dispose` patches they
|
|
13
|
+
installed. Registering a different Pinia store with an existing ID first removes the old entry, so
|
|
14
|
+
disposing the old instance cannot remove the replacement.
|
|
15
|
+
|
|
16
|
+
## 目录结构
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
src/
|
|
20
|
+
├─ composables/ # Vue 侧组合式 API
|
|
21
|
+
├─ context/ # 注入 key
|
|
22
|
+
├─ plugins/ # 对外公开的插件入口与兼容导出
|
|
23
|
+
├─ runtime/ # 运行时、注册表、安装链
|
|
24
|
+
├─ index.ts # 包入口
|
|
25
|
+
└─ types.ts # Vue 侧公开类型
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
当前实现中,真正的安装与生命周期逻辑已经收敛到 `runtime/`:
|
|
29
|
+
|
|
30
|
+
- `runtime/store-plugin-options.ts`
|
|
31
|
+
- 统一运行时配置和默认值
|
|
32
|
+
- `runtime/store-registry.ts`
|
|
33
|
+
- 统一 Store 注册、查询、批量重置和运行时 API
|
|
34
|
+
- `runtime/store-runtime.ts`
|
|
35
|
+
- 统一创建 Pinia、注册 registry、挂接 persist plugin
|
|
36
|
+
- `runtime/install-store-app.ts`
|
|
37
|
+
- 统一把 runtime 安装到 Vue app,并处理 `provide`、`globalProperties` 和卸载清理
|
|
38
|
+
|
|
39
|
+
Pinia 不提供移除已安装插件的 API。runtime
|
|
40
|
+
dispose 会停用它安装的 registry 和持久化插件,避免同一 Pinia 后续创建的 Store 被旧 runtime 再次捕获;Pinia 仍拥有现有 Store,如需销毁实例请调用其
|
|
41
|
+
`$dispose()`。
|
|
42
|
+
|
|
43
|
+
`plugins/` 只保留明确职责的公开入口:
|
|
44
|
+
|
|
45
|
+
- `vue-plugin.ts`
|
|
46
|
+
- 原生 Vue Plugin 入口
|
|
47
|
+
- `engine-plugin.ts`
|
|
48
|
+
- `@composy/engine-core` plugin 入口,内部委托 `@composy/store-core/engine` 的
|
|
49
|
+
`createStoreEngineBridge()`
|
|
50
|
+
- `pinia-plugin.ts`
|
|
51
|
+
- 持久化插件与控制器
|
|
52
|
+
- `registry-plugin.ts`
|
|
53
|
+
- registry 能力导出
|
|
54
|
+
- `enhanced-persist-plugin.ts`
|
|
55
|
+
- 旧子路径兼容导出
|
|
56
|
+
|
|
57
|
+
## 推荐用法
|
|
58
|
+
|
|
59
|
+
### 原生 Vue Plugin
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { createStoreVuePlugin, defineStore } from '@composy/store-vue'
|
|
63
|
+
import { createApp } from 'vue'
|
|
64
|
+
import App from './App.vue'
|
|
65
|
+
|
|
66
|
+
const app = createApp(App)
|
|
67
|
+
|
|
68
|
+
app.use(
|
|
69
|
+
createStoreVuePlugin({
|
|
70
|
+
persist: true,
|
|
71
|
+
persistOptions: {
|
|
72
|
+
keyPrefix: 'demo:',
|
|
73
|
+
syncTabs: true,
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
app.mount('#app')
|
|
79
|
+
|
|
80
|
+
export const useCounterStore = defineStore('counter', {
|
|
81
|
+
state: () => ({
|
|
82
|
+
count: 0,
|
|
83
|
+
}),
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `@composy/engine-core` Plugin
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { createStoreEnginePlugin } from '@composy/store-vue'
|
|
91
|
+
|
|
92
|
+
export const storePlugin = createStoreEnginePlugin({
|
|
93
|
+
name: 'store',
|
|
94
|
+
version: '1.0.0',
|
|
95
|
+
persist: true,
|
|
96
|
+
provide: true,
|
|
97
|
+
globalProperties: true,
|
|
98
|
+
})
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
设计要点:
|
|
102
|
+
|
|
103
|
+
- 如果 engine 已拿到 Vue app,插件会直接复用同一条 runtime 安装链。
|
|
104
|
+
- 如果 app 还没创建,插件会先准备 runtime,再在 `app:created` 时接入。
|
|
105
|
+
- 如果外部 app 已安装过 store runtime,engine
|
|
106
|
+
plugin 会复用已有 runtime,而不是重复创建第二套 Pinia/registry。
|
|
107
|
+
- engine state/API/container/events 的同步逻辑由 core bridge 统一处理,Vue 包只传入
|
|
108
|
+
`createStoreRuntime()`、`installStoreRuntime()` 和 Vue App 识别函数。
|
|
109
|
+
|
|
110
|
+
## 持久化能力
|
|
111
|
+
|
|
112
|
+
`createPersistPlugin()` 和 `createEnhancedPersistPlugin()` 现在共享同一套实现,统一支持:
|
|
113
|
+
|
|
114
|
+
- `paths`
|
|
115
|
+
- `excludePaths`
|
|
116
|
+
- `debounce`
|
|
117
|
+
- `syncTabs`
|
|
118
|
+
- `ttl`
|
|
119
|
+
- `serializer.serialize`
|
|
120
|
+
- `serializer.deserialize`
|
|
121
|
+
|
|
122
|
+
示例:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { defineStore } from 'pinia'
|
|
126
|
+
|
|
127
|
+
export const useUserStore = defineStore('user', {
|
|
128
|
+
state: () => ({
|
|
129
|
+
profile: null,
|
|
130
|
+
token: '',
|
|
131
|
+
session: {
|
|
132
|
+
lastSeenAt: 0,
|
|
133
|
+
},
|
|
134
|
+
}),
|
|
135
|
+
persist: {
|
|
136
|
+
paths: ['profile', 'token'],
|
|
137
|
+
excludePaths: ['session.lastSeenAt'],
|
|
138
|
+
syncTabs: true,
|
|
139
|
+
ttl: 1000 * 60 * 60 * 24,
|
|
140
|
+
},
|
|
141
|
+
})
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## 本轮整理结果
|
|
145
|
+
|
|
146
|
+
- 原生 Vue Plugin 和 engine plugin 已统一复用同一条 runtime/install 链
|
|
147
|
+
- engine plugin 已收口为 core bridge 的 Vue 薄封装,不再复制 engine state/API 生命周期逻辑
|
|
148
|
+
- registry、persist、Pinia 安装和 app 卸载清理都集中在 `runtime/`
|
|
149
|
+
- `plugins/` 目录不再承载重复 runtime 逻辑,只保留公开入口和兼容层
|
|
150
|
+
- `useFormStore`、`useStoreDevtools`、`usePersistedState`
|
|
151
|
+
等 composable 的实现更清晰,避免继续堆叠历史写法
|
|
152
|
+
- 持久化、Store registry 的 `$dispose` 补丁逻辑支持重复挂载/运行时重建;disposed
|
|
153
|
+
runtime 留在 Pinia 插件列表中的回调会变为 no-op,避免旧 registry 重新持有后续 Store
|
|
154
|
+
|
|
155
|
+
## 开发校验
|
|
156
|
+
|
|
157
|
+
当前包建议优先使用:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
pnpm -C packages/store/packages/vue run lint:check
|
|
161
|
+
pnpm -C packages/store/packages/vue run type-check
|
|
162
|
+
pnpm -C packages/store/packages/vue run test:run
|
|
163
|
+
pnpm -C packages/store/packages/vue run build
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
完整构建后必须同时存在 `dist`、`es`、`esm`、`lib` 四类产物目录。
|
|
167
|
+
|
|
168
|
+
Build, ESLint and TypeScript settings are maintained in `.ldesign/`; package-root `tsconfig.json`,
|
|
169
|
+
`tsconfig.typecheck.json` and `eslint.config.js` are compatibility entry points.
|