@huanlin/dsh-plugin-aigc-canvas 0.1.6 → 0.1.8
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 +9 -7
- package/lib/client.js +3184 -3162
- package/lib/client.js.map +1 -1
- package/lib/context-types.d.ts +114 -120
- package/package.json +27 -31
- package/lib/invariant.d.ts +0 -15
- package/lib/invariant.js +0 -22
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="https://dshfind.com/zh/plugins/huanlinoto/dsh-plugin-aigc-canvas"><img src="https://dshfind.com/api/card/huanlinoto/dsh-plugin-aigc-canvas?lang=zh" alt="dsh-plugin-aigc-canvas card"></a>
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://dshfind.com/zh/plugins/huanlinoto/dsh-plugin-aigc-canvas"><img src="https://dshfind.com/api/card/huanlinoto/dsh-plugin-aigc-canvas?lang=zh" alt="dsh-plugin-aigc-canvas card"></a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# dsh-aigc-canvas
|
|
@@ -107,16 +107,19 @@ dsh plugin --profile web add link:D:\Projects\deepseek-harness\dsh-aigc-canvas
|
|
|
107
107
|
pnpm install # 安装开发依赖(schemastery、typescript、vitest、tsdown)
|
|
108
108
|
pnpm run typecheck # tsc --noEmit 类型检查
|
|
109
109
|
pnpm test # vitest run 单元测试(canvas-registry / tools / wire)
|
|
110
|
-
pnpm run build # tsdown 构建 → lib/index.js + lib/
|
|
110
|
+
pnpm run build # tsdown 构建 → lib/index.js + lib/client.js
|
|
111
111
|
pnpm watch # tsdown --watch(client bundle 热重建)
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
构建产物:
|
|
115
115
|
- `lib/index.js` — host 入口(cordis 插件,提供 `ctx.aigcCanvas` 服务 + 路由 + 工具)
|
|
116
|
-
- `lib/invariant.js` — 包级 invariant 伴生
|
|
117
116
|
- `lib/client.js` — 浏览器 bundle(`window.__ModuleLoader__.load` 闭包工厂,id = `@dsh-external/dsh-aigc-canvas`)
|
|
118
117
|
- `lib/index.d.ts` 等 — TypeScript 声明(由 `tsc -p tsconfig.json` 产出,不在 tsdown 流程内)
|
|
119
118
|
|
|
119
|
+
> **不发布 `./invariant`**:本插件无独立可分歧的运行时观察(路由全部处于 host webServer
|
|
120
|
+
> 信任围栏之下,元素表由 smoke spec 覆盖,client 视图是 host 状态的纯投影),按 DSH
|
|
121
|
+
> v0.1.2-rc.1 收紧后的 invariant 规则不再发布空 invariant 伴生,在此记录原因。
|
|
122
|
+
|
|
120
123
|
## 目录结构
|
|
121
124
|
|
|
122
125
|
```
|
|
@@ -125,7 +128,6 @@ dsh-aigc-canvas/
|
|
|
125
128
|
│ ├── index.ts # host 入口:apply + /aigc-canvas/api + /aigc-canvas/file + WS
|
|
126
129
|
│ ├── config.ts # Schemastery Config schema + resolveAigcConfig
|
|
127
130
|
│ ├── context-types.ts # cordis Context augmentation(结构化镜像)
|
|
128
|
-
│ ├── invariant.ts # 包级 invariant 伴生
|
|
129
131
|
│ ├── wire.ts # HTTP helpers + AigcError
|
|
130
132
|
│ ├── trust-fence.ts # Host 头信任围栏(从 better-sidebar 拷贝)
|
|
131
133
|
│ ├── canvas-registry.ts # 元素表 + 边 + 持久化(host-owned state)
|
|
@@ -184,7 +186,7 @@ dsh-aigc-canvas/
|
|
|
184
186
|
按 DSH 官方插件规范组织(参考 [dsh-external/turtle-ui](https://github.com/dsh-external/turtle-ui) 与 `plugin-development-guide.md`):
|
|
185
187
|
|
|
186
188
|
- **插件形态**: `export const name / inject / Config / apply`,无 default 导出
|
|
187
|
-
- **清单**: `types` + `exports`(`.` / `./
|
|
188
|
-
- **client 契约**: 仅导出 `apply`/`inject`(+ 类型);store 为 `CanvasStore` 工厂,实例归 `apply`
|
|
189
|
+
- **清单**: `types` + `exports`(`.` / `./client` / `./client/service` / `./package.json`)、`dsh.bundle.patch`、`peerDependencies`、`engines`、`files` 产物明细、`prepare`(消费者侧 `tsdown`,git 安装可用)
|
|
190
|
+
- **client 契约**: 仅导出 `apply`/`inject`(+ 类型);store 为 `CanvasStore` 工厂,实例归 `apply` 所有;client bundle 复刻官方 preset(externals = 平台模块表 + runtime/client 豁免、纯度门、CSS Modules 内联)
|
|
189
191
|
- **预构建 `lib/` 入库**: 含 `@deepseek-ai/*` private peer,必须预构建;`lib/` 不进 `.gitignore`;`github:` 安装开箱即用
|
|
190
192
|
- **零源码 patch**: 未修改 DSH checkout 任何文件
|