@diagrammo/dgmo 0.14.1 → 0.15.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/dist/auto.cjs +63 -8
- package/dist/auto.js +105 -709
- package/dist/auto.mjs +63 -8
- package/dist/cli.cjs +119 -119
- package/dist/editor.cjs +1 -0
- package/dist/editor.js +1 -0
- package/dist/highlight.cjs +1 -0
- package/dist/highlight.js +1 -0
- package/dist/index.cjs +549 -3450
- package/dist/index.d.cts +70 -4482
- package/dist/index.d.ts +70 -4482
- package/dist/index.js +546 -3206
- package/dist/internal.cjs +51722 -553
- package/dist/internal.d.cts +4535 -112
- package/dist/internal.d.ts +4535 -112
- package/dist/internal.js +51514 -548
- package/docs/language-reference.md +67 -17
- package/package.json +1 -11
- package/src/editor/keywords.ts +1 -0
- package/src/index.ts +197 -690
- package/src/infra/parser.ts +38 -6
- package/src/internal.ts +714 -8
- package/src/palettes/index.ts +39 -0
- package/src/render.ts +17 -1
- package/src/themes.ts +22 -0
- package/dist/pert.cjs +0 -325
- package/dist/pert.d.cts +0 -542
- package/dist/pert.d.ts +0 -542
- package/dist/pert.js +0 -294
|
@@ -482,22 +482,27 @@ parallel label
|
|
|
482
482
|
|
|
483
483
|
## 4. Infrastructure Diagrams
|
|
484
484
|
|
|
485
|
-
###
|
|
485
|
+
### 4.1 Declaration
|
|
486
486
|
|
|
487
487
|
```
|
|
488
488
|
infra [Title]
|
|
489
489
|
```
|
|
490
490
|
|
|
491
|
-
###
|
|
491
|
+
### 4.2 Nodes
|
|
492
492
|
|
|
493
493
|
```
|
|
494
494
|
NodeName
|
|
495
495
|
NodeName | key: value
|
|
496
|
+
NodeName as alias
|
|
497
|
+
"Node name with spaces or | reserved chars"
|
|
496
498
|
```
|
|
497
499
|
|
|
498
|
-
Nodes are plain names. Capabilities come from properties (see
|
|
500
|
+
Nodes are plain names. Capabilities come from properties (see §4.3), not type declarations.
|
|
501
|
+
|
|
502
|
+
- **Aliases** (§2A): `NodeName as alias` binds a short alias used by edges and group references. Alias must start with a letter/underscore and be ≤12 chars.
|
|
503
|
+
- **Quoted names**: wrap the label in double quotes when it contains spaces followed by reserved chars (`|`, `:`, `(`).
|
|
499
504
|
|
|
500
|
-
###
|
|
505
|
+
### 4.3 Node Properties (Indented, Space-Separated, NO Colon)
|
|
501
506
|
|
|
502
507
|
```
|
|
503
508
|
NodeName
|
|
@@ -519,12 +524,12 @@ Properties use a known schema with space-separated values:
|
|
|
519
524
|
| `ratelimit-rps` | Rate limiter | Max RPS passed through |
|
|
520
525
|
| `latency-ms` | Latency | Adds to path latency |
|
|
521
526
|
| `uptime` | Availability | Multiplied along path for SLO |
|
|
522
|
-
| `instances` | Horizontal scaling | Multiplies capacity |
|
|
527
|
+
| `instances` | Horizontal scaling | Multiplies capacity (number or `min-max` range) |
|
|
523
528
|
| `max-rps` | Capacity ceiling | Max RPS node handles |
|
|
524
529
|
| `cb-error-threshold` | Circuit breaker | Error rate trip threshold |
|
|
525
530
|
| `cb-latency-threshold-ms` | Circuit breaker | Latency trip threshold |
|
|
526
|
-
| `concurrency` | Concurrency limit | Max concurrent requests |
|
|
527
|
-
| `duration-ms` | Processing time | Time spent processing |
|
|
531
|
+
| `concurrency` | Concurrency limit | Max concurrent requests (serverless) |
|
|
532
|
+
| `duration-ms` | Processing time | Time spent processing (serverless) |
|
|
528
533
|
| `cold-start-ms` | Serverless | Cold start penalty |
|
|
529
534
|
| `buffer` | Queue | Buffer size |
|
|
530
535
|
| `drain-rate` | Queue | Consumption rate |
|
|
@@ -532,7 +537,9 @@ Properties use a known schema with space-separated values:
|
|
|
532
537
|
| `partitions` | Queue | Partition count |
|
|
533
538
|
| `description` | Display | Description text |
|
|
534
539
|
|
|
535
|
-
|
|
540
|
+
**Mutually exclusive:** `concurrency` ≠ `instances` ≠ `max-rps`; `buffer` ≠ `max-rps`. A node is serverless, traditional, or a queue — not two at once.
|
|
541
|
+
|
|
542
|
+
### 4.4 Connections
|
|
536
543
|
|
|
537
544
|
| Type | Syntax |
|
|
538
545
|
|------|--------|
|
|
@@ -543,35 +550,78 @@ Properties use a known schema with space-separated values:
|
|
|
543
550
|
|
|
544
551
|
- Connection metadata: `| split: 50%, fanout: 3` (colons in pipe metadata)
|
|
545
552
|
- Indented under source node
|
|
553
|
+
- Async edges (`~>`) render with a wiggle pattern
|
|
554
|
+
- Target may be a node id, an alias, or a group ref `[Group Name]`
|
|
546
555
|
|
|
547
|
-
###
|
|
556
|
+
### 4.5 Fanout
|
|
557
|
+
|
|
558
|
+
```
|
|
559
|
+
SearchAPI
|
|
560
|
+
-> SearchShards | fanout: 6
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
`fanout: N` multiplies the per-edge RPS delivered to the target by `N` (request amplification — scatter-gather, shard fanout, pub/sub).
|
|
564
|
+
|
|
565
|
+
- Effect: `target_rps = source_post_behavior_rps × fanout` (then split-distributed across declared targets)
|
|
566
|
+
- Combine with `split`: `-> Target | split: 50%, fanout: 3`
|
|
567
|
+
- `N` must be ≥ 1; sub-1 values are warned and clamped
|
|
568
|
+
- Sources with at least one `fanout > 1` outgoing edge gain the **Fan-Out** capability badge
|
|
569
|
+
- The legacy `xN` suffix (e.g. `... -> Target x5`) is removed — use `| fanout: N`
|
|
570
|
+
|
|
571
|
+
### 4.6 Groups
|
|
548
572
|
|
|
549
573
|
```
|
|
550
574
|
[Group Name]
|
|
551
|
-
[Group Name]
|
|
575
|
+
[Group Name] as alias
|
|
552
576
|
[Group Name] | key: value
|
|
553
577
|
```
|
|
554
578
|
|
|
555
|
-
Bracket syntax only.
|
|
579
|
+
- Bracket syntax only. Group coloring via tags.
|
|
580
|
+
- Optional `as <alias>` postfix and pipe metadata.
|
|
581
|
+
- **No nesting.** A group cannot contain another `[...]` group; only indented components.
|
|
582
|
+
- Group properties (indented under the bracket line):
|
|
583
|
+
- `instances N` or `instances N-M` — capacity multiplier on children (auto-scaling)
|
|
584
|
+
- `collapsed true` — start collapsed; renders as a single node showing the worst child health
|
|
556
585
|
|
|
557
|
-
###
|
|
586
|
+
### 4.7 Infra Options (Space-Separated, NO Colon)
|
|
558
587
|
|
|
559
588
|
- `direction-tb` (boolean; default is LR)
|
|
560
589
|
- `default-latency-ms N`
|
|
561
|
-
- `default-rps N`
|
|
590
|
+
- `default-rps N` — fallback edge RPS when no `rps` is declared on the edge node
|
|
562
591
|
- `default-uptime DECIMAL`
|
|
563
|
-
- `slo-availability DECIMAL`
|
|
564
|
-
- `slo-p90-latency-ms N`
|
|
592
|
+
- `slo-availability DECIMAL` — target availability for SLO compliance highlighting
|
|
593
|
+
- `slo-p90-latency-ms N` — target p90 for SLO compliance highlighting
|
|
594
|
+
- `slo-warning-margin DECIMAL` — margin below SLO that triggers warning state
|
|
565
595
|
- `animate` / `no-animate`
|
|
596
|
+
- `active-tag GroupName` / `active-tag none` — pre-select a tag filter on render
|
|
597
|
+
|
|
598
|
+
The universal options `solid-fill` and `no-title` also apply.
|
|
566
599
|
|
|
567
|
-
###
|
|
600
|
+
### 4.8 Edge Nodes
|
|
568
601
|
|
|
569
602
|
```
|
|
570
603
|
edge
|
|
571
604
|
internet
|
|
572
605
|
```
|
|
573
606
|
|
|
574
|
-
Special top-level entry points. `internet` only accepts `rps`
|
|
607
|
+
Special top-level entry points. Either name works; `internet` only accepts `rps` and the `description` is silently ignored on entry-point nodes.
|
|
608
|
+
|
|
609
|
+
### 4.9 Node Descriptions
|
|
610
|
+
|
|
611
|
+
```
|
|
612
|
+
API Gateway
|
|
613
|
+
description Handles routing and auth
|
|
614
|
+
description Supports rate limiting
|
|
615
|
+
latency-ms 50
|
|
616
|
+
max-rps 8000
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
- `description` keyword followed by text (NO colon)
|
|
620
|
+
- Multiple `description` lines accumulate into a multi-line description
|
|
621
|
+
- **Keywordless form:** indented prose lines that don't match a known property key or numeric value are treated as descriptions automatically
|
|
622
|
+
- Supports inline markdown: `**bold**`, `*italic*`, `` `code` ``, `[links](url)`
|
|
623
|
+
- `- bullet text` renders as `• bullet text`
|
|
624
|
+
- Descriptions are ignored on `edge` and `internet` nodes
|
|
575
625
|
|
|
576
626
|
---
|
|
577
627
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diagrammo/dgmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "DGMO diagram markup language — parser, renderer, and color system",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -56,16 +56,6 @@
|
|
|
56
56
|
"default": "./dist/internal.cjs"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
-
"./pert": {
|
|
60
|
-
"import": {
|
|
61
|
-
"types": "./dist/pert.d.ts",
|
|
62
|
-
"default": "./dist/pert.js"
|
|
63
|
-
},
|
|
64
|
-
"require": {
|
|
65
|
-
"types": "./dist/pert.d.cts",
|
|
66
|
-
"default": "./dist/pert.cjs"
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
59
|
"./auto": {
|
|
70
60
|
"import": {
|
|
71
61
|
"types": "./dist/auto.d.ts",
|