@cardenelabs/cdl 0.40.11 → 0.40.12
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 +26 -1
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +3 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +3 -1
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/visual-validate.ts +19 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cardenelabs/cdl",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.12",
|
|
4
4
|
"description": "CDL (Chainome Diagram Language). Mermaid-like declarative DSL that compiles to animated SVG diagrams. Built for blockchain / Solidity flows, generic enough for sequence / flow / state / ER / topology diagrams.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "cardene777",
|
package/src/visual-validate.ts
CHANGED
|
@@ -3512,11 +3512,29 @@ function runAxes(
|
|
|
3512
3512
|
];
|
|
3513
3513
|
// ER / classDiagram の schema 宣言 (`email: string` / `total: number` 等) は実データでなく
|
|
3514
3514
|
// 型名を書く design、 Axis 37 の型判定対象外。 value が schema 型キーワードなら skip。
|
|
3515
|
+
//
|
|
3516
|
+
// **この一覧は印を持たない古い形のためだけに残す** (`#771`)。 `rows` を直接書いた形
|
|
3517
|
+
// (`.entity({ rows: ["id: PK"] })`) は行頭の印を持たないので、消すと丸ごと warn に落ちる。
|
|
3518
|
+
// 一方で **足しもしない** = 型名を手で並べると書き手が思い付いた名前が上限になり、
|
|
3519
|
+
// 抜けた名前 (実測 = `numeric`) が実データとして判定される。 新しい型名は下の印で通す。
|
|
3515
3520
|
const SCHEMA_KEYWORDS =
|
|
3516
3521
|
/^(string|number|boolean|text|enum|timestamp|date|datetime|json|blob|PK|FK|UUID|BIGINT|INT|FLOAT|VARCHAR|TEXT|DATETIME)$|^enum\(|^varchar\(/i;
|
|
3517
3522
|
for (const n of diag.nodes) {
|
|
3518
3523
|
if (!n.rows) continue;
|
|
3519
|
-
for (
|
|
3524
|
+
for (let i = 0; i < n.rows.length; i++) {
|
|
3525
|
+
const row = n.rows[i]!;
|
|
3526
|
+
/*
|
|
3527
|
+
* **行が列の宣言かどうかは、値の語ではなく行頭の印で決める** (`#771`)。
|
|
3528
|
+
*
|
|
3529
|
+
* 印 (`rowMarks`) は `er` / `classDiagram` が `columns` / `attributes` を受け取った時
|
|
3530
|
+
* だけ付く = 印がある行は、値の位置に **型の名前** が来ることを engine 自身が知っている。
|
|
3531
|
+
* 語の一覧で見分ける形は方言ごとに増える型名を追えない (`§ 導出可能記述は人手で書かない`)。
|
|
3532
|
+
*
|
|
3533
|
+
* Axis 4 (`row-format`) は箱の単位で外している (印を持つ箱では行の形式そのものを
|
|
3534
|
+
* 求めない)。 こちらは **行の単位** で外す = 印を持たない行が同じ箱に混ざった時、
|
|
3535
|
+
* その行の実データは従来どおり見る。 検知を落とさない側に倒す。
|
|
3536
|
+
*/
|
|
3537
|
+
if (n.rowMarks?.[i] != null) continue;
|
|
3520
3538
|
const m = row.match(/^([^:]+):\s*(.+)$/);
|
|
3521
3539
|
if (!m) continue;
|
|
3522
3540
|
const [, key, value] = m;
|