@g1cloud/entity-modeler-next

中文文档
5.5.4发布于 2026/11/12LicenseRef-LICENSETypeScriptESM + CJS近 30 天下载 3064

Vue 3 visual entity-modeling / class-diagram editor

原始使用文档
文档目录5 节
  1. Stack
  2. Install
  3. Usage
  4. Structure
  5. Scripts

entity-modeler-next

Vue 3 visual entity-modeling / class-diagram editor. Distributed as a library package (@g1cloud/entity-modeler-next) and embedded in bluework4-tool (Nuxt/Vue/Mongo).

Stack

TypeScript · Vue 3 · Vue Flow · Pinia (opt-in) · Vite (library mode) · Vitest · views built on @g1cloud/open-bluesea-core (BS) components

Install

pnpm add @g1cloud/entity-modeler-next

Requires the peer dependencies vue ^3.5.0 and @g1cloud/bluesea >=5.0.0-beta.31 <6.0.0 (installed by the host).

Usage

import { EntityModeler } from '@g1cloud/entity-modeler-next'
import '@g1cloud/entity-modeler-next/style.css'  // required — components render unstyled without it

Structure

src/
  core/      logical/layout types (separated) · resolve (consistency) · routing · autolayout · propagation · validation · type catalogs. Framework-agnostic
  command/   Command (do/undo) · CommandStack · op/opSync (semantic op emit + CAS concurrency)
  editor/    reactive controller (composable wrapping CommandStack, EDITOR inject key) + axis modules split out of it
             (commandPlans · clipboardImport · hostSync · selection — each takes a minimal injected context)
  view/      Vue Flow components (DiagramCanvas · EntityNode · GroupNode · AssociationEdge · PropertyPanel · ValidationPanel, etc.)
             plus composables (useAttributeEditing · useResizableWidth · useTreeCollapse) and pure helpers
  adapter/   storage-schema mapping (persisted v1/v2 · fromPersisted/toPersisted/toPersistedV2 round-trip)
  agent/     natural-language → op track (symbolicOp · resolver · schema · buildAgentBatch)
  dev/       demo harness (excluded from the library build)

Core design: layout references the logical model by modelId (one-way). The logical model carries no geo/waypoint/style.

Scripts

pnpm dev            # demo harness dev server (src/dev)
pnpm test           # Vitest (unit)
pnpm test:coverage  # Vitest + v8 coverage report (no threshold — report only)
pnpm typecheck      # vue-tsc --noEmit
pnpm build          # library build (dist/)
pnpm verify         # headless GUI probe suite (scripts/verify-*.mjs) — boots the dev harness once, runs all probes
pnpm verify:floor    # raise the per-probe assertion-count floor to current (never lowers)
pnpm check          # CI gate: test && build

check is the entry point CI calls; verify runs the browser probes and is kept separate because it needs a dev server and takes ~100s.

verify also enforces a per-probe assertion-count floor (scripts/probe-assertion-floor.json): a probe whose executed-assertion total drops below its floor fails even if every remaining assertion passes — deleting an ok() would otherwise shrink the denominator too and pass as 0/0. Adding assertions needs no bookkeeping; only a deliberate reduction requires editing the JSON by hand, and that diff is the review signal.

版本与发布记录

@g1cloud/entity-modeler-next 共发布 165 个版本,首次发布于 2026/06/30;过去 12 个月发布了 165 个版本。

版本发布日期距今
5.5.4latest2026/11/123 天前
5.5.32026/11/123 天前
5.5.22026/11/114 天前
5.5.12026/11/078 天前
5.5.02026/11/069 天前
5.4.02026/11/0510 天前

其他发布通道:alpha → 5.0.0-alpha.27,beta → 5.0.0-beta.53。

关于 @g1cloud/entity-modeler-next 的常见问题

@g1cloud/entity-modeler-next 是什么?

Vue 3 visual entity-modeling / class-diagram editor

如何安装 @g1cloud/entity-modeler-next?

在项目目录运行 npm install @g1cloud/entity-modeler-next,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.0)、@g1cloud/bluesea(>=5.0.0-beta.31 <6.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@g1cloud/entity-modeler-next 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@g1cloud/entity-modeler-next 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@g1cloud/entity-modeler-next 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >= 24.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@g1cloud/entity-modeler-next 可以商用吗?

@g1cloud/entity-modeler-next 使用 LicenseRef-LICENSE 许可。声明的许可为 LicenseRef-LICENSE,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@g1cloud/entity-modeler-next 的下载量有多少?

根据 npm 官方下载统计,@g1cloud/entity-modeler-next 在 2026/10/16 – 2026/11/14 这 30 天内被下载 3,064 次,日均约 102 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@g1cloud/entity-modeler-next 还在维护吗?

最新版本 5.5.4 发布于 2026/11/12(3 天前);至今共发布 165 个版本,其中过去 12 个月发布了 165 个;首次发布于 2026/06/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。