@cardenelabs/dragon 0.39.0 → 0.41.0
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 +39 -1
- package/dist/cli.cjs +1921 -429
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1926 -434
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +1718 -353
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +1 -1
- package/dist/export.d.ts +1 -1
- package/dist/export.js +1723 -358
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +1835 -342
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -15
- package/dist/index.d.ts +5 -15
- package/dist/index.js +1836 -342
- package/dist/index.js.map +1 -1
- package/dist/{ink-Cg-v6XSG.d.cts → ink-B_7OXxtb.d.cts} +27 -2
- package/dist/{ink-Cg-v6XSG.d.ts → ink-B_7OXxtb.d.ts} +27 -2
- package/dist/node.cjs +2946 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +9 -0
- package/dist/node.d.ts +9 -0
- package/dist/node.js +2944 -0
- package/dist/node.js.map +1 -0
- package/dist/player.global.js +2 -2
- package/package.json +11 -1
- package/src/field-messages.ts +8 -0
- package/src/index.ts +5 -2
- package/src/layout/git.ts +728 -0
- package/src/look/values.ts +40 -1
- package/src/messages.ts +47 -4
- package/src/node.ts +23 -0
- package/src/parser.ts +142 -7
- package/src/printer.ts +16 -4
- package/src/render/git.ts +161 -0
- package/src/render/parts.ts +1 -1
- package/src/render/svg.ts +26 -1
- package/src/schema.ts +47 -13
- package/src/schemas/diagram.schema.json +75 -8
- package/src/schemas/validate-diagram.js +1 -1
- package/src/timeline.ts +18 -3
- package/src/version.ts +1 -20
- package/src/words.ts +19 -3
package/README.md
CHANGED
|
@@ -45,6 +45,8 @@ const player = mountDiagram(host, parsed.diagram);
|
|
|
45
45
|
字の入口は、同梱の 2 つの字 (Noto Sans JP と JetBrains Mono) の CSS を読み込むだけで、何も出さない。
|
|
46
46
|
図は同梱の字で測った字の幅で組むため、読み込まないと端末の字で描かれ、札から字がはみ出すことがある。
|
|
47
47
|
CSS と字の file は、束ねる道具 (Vite など) が頁へ運ぶ。
|
|
48
|
+
この入口は Node の組み込みの module を読まないため、Next.js の Turbopack のように頁を束ねる道具でもそのまま読める。
|
|
49
|
+
原本の file を今の版へ移す `migrateFile` は、Node でだけ動く入口 `@cardenelabs/dragon/node` から引く。
|
|
48
50
|
|
|
49
51
|
`mountDiagram` が返す `player` で段を動かす (`next`、`prev`、`play`、`pause`、`destroy`)。
|
|
50
52
|
3 つめの引数には色味や段が替わった時に呼ぶ関数などの設定 (`PlayerOptions`) を渡す。
|
|
@@ -58,7 +60,7 @@ CSS と字の file は、束ねる道具 (Vite など) が頁へ運ぶ。
|
|
|
58
60
|
3. 空白を含む名前と文は、行末か `[` の前に置く。`,` か `]` を含む値と、`[` を含む名前だけを `"` で囲む
|
|
59
61
|
4. 入れ子は `group … end` だけ。段は次の `step` までで、字下げは読みやすさのために付ける。`say` の続きの行だけは `say` より深く字下げする
|
|
60
62
|
|
|
61
|
-
行の頭の語は `sequence` `architecture` `state` `group` `end` `box` `strip` `step` `say` `code` `act` `note` `set` で、線の行は `名札 -> 名札` と書く。
|
|
63
|
+
行の頭の語は `sequence` `architecture` `state` `git` `group` `end` `box` `branch` `strip` `step` `say` `code` `commit` `act` `note` `set` で、線の行は `名札 -> 名札` と書く。
|
|
62
64
|
|
|
63
65
|
```dragon
|
|
64
66
|
architecture 注文を倉庫へ回す
|
|
@@ -114,6 +116,42 @@ step 届く
|
|
|
114
116
|
配達完了 -> finish: 注文を閉じる [tag: #1042]
|
|
115
117
|
```
|
|
116
118
|
|
|
119
|
+
### 枝分かれの図
|
|
120
|
+
|
|
121
|
+
`git` で始めると、git の枝に commit を積み、取り込むまでを段ごとに追う枝分かれの図になる。枝は `branch` の行で上から順に宣言し、枝ごとに帯が並ぶ。
|
|
122
|
+
段の中では `commit <名札> on <枝>` で枝の先に commit を積み、`copy <元>` で当て直しの commit を、`merge <枝>` で merge commit を作る。`hash` と `note` で丸の外に hash と一言を添える。
|
|
123
|
+
`<枝> from <commit>` で枝を切り、`<札> -> <commit>` で commit を作らずに枝の札か `HEAD` を動かす。どの札からも辿れなくなった commit は点線の丸に変わる。
|
|
124
|
+
|
|
125
|
+
```dragon
|
|
126
|
+
git fix は merge commit で、feature は当て直して取り込む
|
|
127
|
+
|
|
128
|
+
branch main [note: 取り込む先]
|
|
129
|
+
branch feature [note: 作業の枝]
|
|
130
|
+
branch fix [note: 直しの枝]
|
|
131
|
+
|
|
132
|
+
step 枝を切る
|
|
133
|
+
say main の A から fix と feature を切り、それぞれに commit を積む。
|
|
134
|
+
commit A on main [hash: 3fa0c19, note: 最初の形]
|
|
135
|
+
fix from A
|
|
136
|
+
commit F on fix [hash: 9b2e4d1, note: 誤字を直す]
|
|
137
|
+
feature from A
|
|
138
|
+
commit C on feature [hash: c41d0e5, note: 検索を足す]
|
|
139
|
+
|
|
140
|
+
step merge commit で取り込む
|
|
141
|
+
say fix を merge commit M で main へ取り込む。M は A と F の 2 つを親に持つ。
|
|
142
|
+
commit M on main merge fix [hash: 7d3a5e2, note: fix を取り込む]
|
|
143
|
+
|
|
144
|
+
step 当て直す
|
|
145
|
+
say HEAD を M へ動かして枝から離し、C を M の先へ写して C' を作る。
|
|
146
|
+
HEAD -> M
|
|
147
|
+
commit C' on main copy C [hash: a90c6b4, note: 検索を足す]
|
|
148
|
+
|
|
149
|
+
step 早送りする
|
|
150
|
+
say feature を C' へ動かし、main も C' まで進める。元の C はどの枝からも辿れなくなる。
|
|
151
|
+
feature -> C'
|
|
152
|
+
main -> C'
|
|
153
|
+
```
|
|
154
|
+
|
|
117
155
|
## 書き出し
|
|
118
156
|
|
|
119
157
|
書き出しは画面なしの Chromium で、頁と同じ描画を時刻を止めて 1 コマずつ撮る。
|