wechen-agent-editor-v1 1.0.4 → 1.0.5
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 +31 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -21,6 +21,37 @@ npm install wechen-agent-editor-v1
|
|
|
21
21
|
- **npm 7+** 安装本包时,一般会 **自动安装缺失的 peer**;仍建议在宿主 `package.json` 中 **显式列出** 上述依赖及版本,便于与业务线对齐并避免重复副本。
|
|
22
22
|
- 版本范围以 **`peerDependencies`** 为准;建议 **React 18+**、**antd 5+**、**@xyflow/react 12+**。
|
|
23
23
|
|
|
24
|
+
### 宿主 `npm install wechen-agent-editor-v1` 报 `ERESOLVE`
|
|
25
|
+
|
|
26
|
+
若日志里冲突来自 **其它包**(例如 **`@ant-design/pro-chat` 与 `antd-style` 版本**、**`@ahooksjs/use-request` 与 React 18**),属于 **宿主项目原有依赖树** 与 npm 严格 peer 解析叠加,**不一定与本包 peer 声明有关**。
|
|
27
|
+
|
|
28
|
+
- **临时安装**:`npm install wechen-agent-editor-v1@<version> --legacy-peer-deps`(或在宿主项目根目录 `.npmrc` 写 **`legacy-peer-deps=true`**)。
|
|
29
|
+
- **根治**:在宿主侧 **升级 / 对齐** 冲突链上的包(如升级 `pro-chat`、或按官方说明统一 `antd-style` 大版本),再去掉 `--legacy-peer-deps`。
|
|
30
|
+
|
|
31
|
+
### Umi Max(`@umijs/max`)/ Ant Design Pro 类宿主适配清单
|
|
32
|
+
|
|
33
|
+
以下在本仓库 **无法替你改宿主 `package.json`**,但按此清单在 **业务前端仓库**(如 `iccp-frontend`)操作,可稳定接入 **`wechen-agent-editor-v1`**。
|
|
34
|
+
|
|
35
|
+
1. **在宿主 `dependencies` 中显式加入**(版本可按团队锁定微调,须满足本包 `peerDependencies`):
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"@xyflow/react": "^12.3.6",
|
|
40
|
+
"@monaco-editor/react": "^4.6.0",
|
|
41
|
+
"wechen-agent-editor-v1": "^1.0.4"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
宿主已声明的 **`react`、`react-dom`、`antd`、`monaco-editor`** 请保持 **单版本**;**`@monaco-editor/react` 与 `monaco-editor` 主版本** 请对照 [@monaco-editor/react 说明](https://github.com/suren-atoyan/monaco-react) 与当前 `monaco-editor` 一致。
|
|
46
|
+
|
|
47
|
+
2. **`npm install` 仍 `ERESOLVE`**:多为 **`@ant-design/pro-chat` 要求 `antd-style@^3`** 与宿主 **`antd-style@^4`**、或 **`ahooks` / `@ahooksjs/use-request` 与 React 18** 的已知冲突。处理顺序建议:**升级 `@ant-design/pro-chat` 到支持 `antd-style@4` 的版本** → 或调整 **`ahooks` / Umi 插件链** → 最后再在宿主根目录 **`.npmrc`** 增加 **`legacy-peer-deps=true`** 并记录技术债。
|
|
48
|
+
|
|
49
|
+
3. **Umi / MFSU**:若开发态 **Monaco 或 xyflow** 白屏、热更新异常,可在 **`.umirc.ts` / `config/config.ts`** 中尝试将 **`monaco-editor`、`@monaco-editor/react`** 加入 **`mfsu.exclude`**(以你项目 Umi 4 文档为准),或暂时关闭 MFSU 做对照。
|
|
50
|
+
|
|
51
|
+
4. **Monaco worker**:在 Umi 入口最早处完成 **worker 引导**(参考本仓库 `playground/src/monacoBootstrap.ts`),与是否使用 MFSU 无关。
|
|
52
|
+
|
|
53
|
+
5. **验证**:`npm ls react`、`npm ls @xyflow/react` 无双副本;`max dev` / `max build` 通过;页面内 **拖入 → 连线 → 右侧配置** 烟测。
|
|
54
|
+
|
|
24
55
|
### 排查:第一次从组件库拖入正常,之后无法连线 / 无法再拖 / 样式怪
|
|
25
56
|
|
|
26
57
|
1. **多份 React / 多份 @xyflow**(最常见):在宿主项目根目录执行 **`npm ls react`**、**`npm ls @xyflow/react`**,若出现 **多个版本** 或嵌套在 **`wechen-agent-editor-v1/node_modules` 下又一份**,请删除锁文件后重装,或在 **Vite** 中配置 **`resolve.dedupe: ['react', 'react-dom', '@xyflow/react']`**,或调整 **pnpm overrides / npm overrides** 强制单版本。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wechen-agent-editor-v1",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Wechen Agent:可执行的 AI 流程编排编辑器(React Flow),节点即模块、边即执行顺序;Monaco + Ant Design,面向 npm",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"antd",
|
|
15
15
|
"ai",
|
|
16
16
|
"flow-editor",
|
|
17
|
-
"low-code"
|
|
17
|
+
"low-code",
|
|
18
|
+
"umijs",
|
|
19
|
+
"umi"
|
|
18
20
|
],
|
|
19
21
|
"repository": {
|
|
20
22
|
"type": "git",
|
|
@@ -57,7 +59,7 @@
|
|
|
57
59
|
"registry:npmmirror": "npm config set registry https://registry.npmmirror.com/"
|
|
58
60
|
},
|
|
59
61
|
"peerDependencies": {
|
|
60
|
-
"@monaco-editor/react": "
|
|
62
|
+
"@monaco-editor/react": ">=4.6.0",
|
|
61
63
|
"@xyflow/react": ">=12.0.0",
|
|
62
64
|
"antd": ">=5.0.0",
|
|
63
65
|
"monaco-editor": ">=0.45.0",
|