dsh-plugin-core-demo 0.0.0-stage → 0.1.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/README.md CHANGED
@@ -1,3 +1,43 @@
1
- # Temporary Holding Version
1
+ # dsh-plugin-core-demo
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 在 **真实 DSH 宿主**里预览 `dsh-plugin-core` 的控件与业务组件的插件。
4
+
5
+ 它和库是完全分开的两个 npm 包(库是纯库,只有子路径导出;本包是插件):
6
+
7
+ | | 包 | 用途 |
8
+ |---|---|---|
9
+ | 库 | `dsh-plugin-core` | 各插件按子路径引用(`/ui` `/utils` `/design` …) |
10
+ | 插件 | `dsh-plugin-core-demo`(本包) | 装进 DSH,宿主内预览 |
11
+
12
+ ## 构建
13
+
14
+ ```bash
15
+ # 在仓库根先构建库(本包引用 ../../dist/)
16
+ pnpm run build
17
+ # 再构建本包 → dist/index.js(server 壳)+ dist/client.js(预览页 bundle)
18
+ pnpm run build:demo
19
+ ```
20
+
21
+ `dist/` 与 `src/` 一起入库:宿主安装插件时**不跑构建脚本**。
22
+
23
+ ## 发布与安装
24
+
25
+ **不要在本目录手跑 `npm publish`。** 本包与核心共用同一个 `vX.Y.Z` tag,由
26
+ `.github/workflows/demo-publish.yml` 自动发布;版本必须与根 `package.json` 完全一致
27
+ (`test/version-sync.test.mjs` 与 CI 都校验,不一致直接失败)。
28
+
29
+ ```bash
30
+ git tag v0.1.3 && git push origin v0.1.3 # 在仓库根:一次 tag 发库 + 本包
31
+ dsh plugin --profile web add dsh-plugin-core-demo
32
+ ```
33
+
34
+ 装好后:插件列表 → 本插件 → 设置页里的「组件预览」卡片 → 点开即整页预览;也可点侧栏图标。
35
+
36
+ ## 实现要点
37
+
38
+ - client 侧只导出 `apply`;依赖一律 `ctx.inject([...], cb)` 内等待(顶层导出 `inject` 会卡死宿主启动)。
39
+ - 三块注册(`sidebar.panellist` / `main` / `settings.plugin.item`)各自 `ctx.inject`、自成一块;
40
+ `settings.plugin.item` 与 `main` 的 key 必须 = 包名(宿主机制)。
41
+ - 变量前缀用本插件独有的 `dshpc`,**不占用 `--tdt-*`**(宿主里别的插件在用);
42
+ 展示代码里的 `--tdt-*` 由 `src/client/token-alias.ts` 那层别名接过去。
43
+ - 零运行时依赖:不引内部 `@deepseek-ai/*`,故不声明 schemastery Config。
@@ -0,0 +1,8 @@
1
+ # bundle 补丁:把本 npm 包作为插件插入宿主组合。
2
+ # 格式与 dsh-task-dispatch-table/cordis.patch.yml 一致(顶层 YAML 数组,条目 = loader patch 的 insert 列表)。
3
+ # id / name 必须与 package.json 的 name 逐字相同(宿主用它判定插件详情页)。
4
+ # 本插件无服务端配置项,故 config 为空对象。
5
+ - insert:
6
+ - id: dsh-plugin-core-demo
7
+ name: dsh-plugin-core-demo
8
+ config: {}