sketchi 0.20.0 → 0.21.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 CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p align="center">
8
8
  <strong>Typed, deterministic diagrams from your terminal.</strong><br />
9
- Create, inspect, revise, and export local flowcharts, mindmaps, sequence diagrams, timelines, charts, state machines, Gantt charts, and ER diagrams—or turn one prompt into validated, editable Excalidraw.
9
+ Create, inspect, revise, and export local flowcharts, mindmaps, sequence diagrams, timelines, charts, state machines, Gantt charts, ER diagrams, and class diagrams—or turn one prompt into validated, editable Excalidraw.
10
10
  </p>
11
11
 
12
12
  <p align="center">
@@ -53,7 +53,7 @@ sketchi generate --prompt "Map release approval with pass and revise branches"
53
53
 
54
54
  With no `--prompt`, Sketchi opens a short wizard only when both standard input
55
55
  and standard output are human terminals, output is text, and CI is absent. It
56
- asks for prompt text, flowchart (the default), mind map, sequence diagram, timeline, chart, state machine, Gantt chart, or ER diagram, and where to save the
56
+ asks for prompt text, flowchart (the default), mind map, sequence diagram, timeline, chart, state machine, Gantt chart, ER diagram, or class diagram, and where to save the
57
57
  PNG. The choices are the current directory, a `diagrams/` folder under exactly
58
58
  the directory where Sketchi was run, or a custom path with the same semantics as
59
59
  `--dest`. Sketchi does not inspect Git, and it creates `diagrams/` only after
@@ -64,7 +64,7 @@ that wizard question. Explicit `--format png` may proceed; another format or
64
64
  Scripts, pipes, redirected streams, CI, and `--output json` never prompt or
65
65
  block. They must pass `--prompt`; omitting it retains the deterministic usage
66
66
  error. Passing `--prompt` is always direct and noninteractive.
67
- `--type` accepts only flowchart, mindmap, sequence, timeline, chart, state-machine, gantt, or er and is authoritative.
67
+ `--type` accepts only flowchart, mindmap, sequence, timeline, chart, state-machine, gantt, er, or class and is authoritative.
68
68
  Without it, the generation model selects one of those from the request; a
69
69
  request for any other kind of diagram returns a typed unsupported-type error
70
70
  instead of being coerced into a supported one.
@@ -103,7 +103,7 @@ The endpoint defaults to
103
103
  `https://playground.sketchi.app/api/v1/canvases/create`; use `--endpoint URL` or
104
104
  `SKETCHI_CANVAS_ENDPOINT` only for preview and local testing. The existing
105
105
  `create` command remains the separate, strictly offline command for accepted
106
- flowchart, mindmap, sequence, timeline, chart, state-machine, gantt, and er documents.
106
+ flowchart, mindmap, sequence, timeline, chart, state-machine, gantt, er, and class documents.
107
107
 
108
108
  ## Create and work with a diagram offline
109
109
 
@@ -328,3 +328,5 @@ Native state machines: use `buildStateMachine` (Code Mode) or `generate --type s
328
328
  Native Gantt charts: use `buildGantt` (Code Mode) or `generate --type gantt` (CLI). Supply tasks with unique ids, labels, a `start` day (`YYYY-MM-DD`) and either `end` (last day, inclusive) or `duration` (calendar days); `milestone: true` draws a diamond. Optional `dependsOn` (finish-to-start predecessor ids), `phase` on every task (`phases` sets their order), `progress` (percent) and `today`. The renderer draws a to-scale date axis with day, week, month, quarter or year ticks, one row per task under phase headers, a date column, and dependency arrows routed clear of every bar and label. Never supply coordinates.
329
329
 
330
330
  Native ER diagrams: use `buildErDiagram` (Code Mode) or `generate --type er` (CLI). Supply entities with unique ids (no dots) and fields written `"name type markers"` (`"id uuid PK"`, `"customer_id uuid FK"`, `"email text UK"`, `"note text?"` for nullable), and relationships whose `from` and `to` name `entity.field` or an entity, each end with a cardinality (`one`, `zero-or-one`, `many`, `one-or-many` or `zero-or-many`) and an optional label. The renderer draws each entity as a table and each relationship as an orthogonal line between the rows it joins, with crow's-foot ends; it owns every coordinate.
331
+
332
+ Native class diagrams: use `buildClassDiagram` (Code Mode) or `generate --type class` (CLI). Supply classes with unique ids (no colons or spaces), an optional `kind` (`abstract`, `interface` or `enum`) and members written as UML does (`"- radius: double"`, `"+ area(): double {abstract}"`), and relationships with a `kind`: `inheritance` or `realization` (`from` extends or implements `to`), `composition` or `aggregation` (`from` is the whole), `association` (`navigable: true` adds an arrow) or `dependency` (`from` uses `to`). Associations, compositions and aggregations take multiplicities and roles at each end. The renderer draws three-compartment boxes with superclasses above their subclasses and each relationship's UML head; it owns every coordinate.