sfn-diagram 1.7.0 → 1.8.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 +24 -3
- package/dist/bin.js +7148 -2399
- package/dist/cfn.cjs +43 -1
- package/dist/cfn.d.cts +10 -4
- package/dist/cfn.d.ts +10 -4
- package/dist/cfn.js +43 -1
- package/dist/ci.cjs +2710 -1194
- package/dist/ci.d.cts +82 -7
- package/dist/ci.d.ts +82 -7
- package/dist/ci.js +2709 -1195
- package/dist/element-auto.cjs +3835 -1145
- package/dist/element-auto.js +3835 -1145
- package/dist/element.cjs +3835 -1145
- package/dist/element.d.cts +43 -6
- package/dist/element.d.ts +43 -6
- package/dist/element.js +3835 -1145
- package/dist/index.cjs +5020 -2486
- package/dist/index.d.cts +900 -84
- package/dist/index.d.ts +900 -84
- package/dist/index.js +5012 -2487
- package/dist/png.cjs +1936 -1261
- package/dist/png.d.cts +54 -6
- package/dist/png.d.ts +54 -6
- package/dist/png.js +1936 -1261
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -55,6 +55,26 @@ Prefer the command line:
|
|
|
55
55
|
npx sfn-diagram my-workflow.asl.json --format svg -o diagram.svg
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
Or render what is actually deployed, with `--from-aws`:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pnpm add @aws-sdk/client-sfn # optional peer, only needed for --from-aws
|
|
62
|
+
sfn-diagram --from-aws arn:aws:states:us-east-1:111122223333:stateMachine:Orders -o live.svg
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The region comes from the ARN and credentials from the AWS SDK's default chain, so
|
|
66
|
+
`AWS_PROFILE`, SSO and instance roles work as they do for the AWS CLI. The flag takes a
|
|
67
|
+
state machine, version or alias ARN — not a bare name — is repeatable with `--out-dir`,
|
|
68
|
+
and combines with `--diff` (whose baseline may itself be an ARN, for live-against-live
|
|
69
|
+
drift), `--execution` and `--check`. It needs the optional peer above, so it is
|
|
70
|
+
unavailable in the [standalone binary](https://sfn.yusufaf.dev/guides/cli/#standalone-binary).
|
|
71
|
+
See [Rendering a live state machine](https://sfn.yusufaf.dev/guides/cli/#rendering-a-live-state-machine).
|
|
72
|
+
|
|
73
|
+
It exits `0` on success, `1` when something goes wrong while running — including a failed
|
|
74
|
+
AWS call — and `2` when the invocation itself was wrong, so a CI job can tell a bad flag
|
|
75
|
+
from a bad definition. See
|
|
76
|
+
[Exit codes](https://sfn.yusufaf.dev/guides/cli/#exit-codes).
|
|
77
|
+
|
|
58
78
|
## Why sfn-diagram
|
|
59
79
|
|
|
60
80
|
There's no shortage of ways to look at a state machine — this is where sfn-diagram fits versus the other two most common options:
|
|
@@ -77,11 +97,12 @@ In short: reach for the AWS Console visualizer to eyeball a state machine you al
|
|
|
77
97
|
- **Full ASL Support**: All state types (Pass, Task, Choice, Wait, Succeed, Fail, Parallel, Map), both JSONPath and JSONata query languages, plus `Catch`/`Retry` rendering
|
|
78
98
|
- **Modern ASL**: Variables (`Assign`) shown per state, and Distributed Map rendered distinctly from an inline Map — including its `MaxConcurrency`, `ItemReader` source, and `ResultWriter` sink
|
|
79
99
|
- **Visual Diffing**: Compare two definitions and highlight added / modified / removed states — drives the PR-preview GitHub Action
|
|
80
|
-
- **
|
|
100
|
+
- **Linting**: `lintAsl()` returns every structural and semantic finding at once (unreachable states, dangling transitions, `End` with `Next`, JSONPath/JSONata field mixing, …); `sfn-diagram --check` fails CI on errors
|
|
101
|
+
- **Execution Overlays**: Paint a real execution's history onto the diagram — succeeded/failed/caught/not-reached states, the taken path, and per-state duration & retry counts. From a saved history file or live from an execution ARN, and `--follow` keeps re-rendering until the run finishes
|
|
81
102
|
- **Customizable Themes**: AWS light/dark themes plus custom theme support
|
|
82
103
|
- **Flexible Layouts**: Top-bottom, left-right, right-left, bottom-top
|
|
83
104
|
- **Type-Safe**: Full TypeScript support with comprehensive type definitions
|
|
84
|
-
- **AWS SDK Integration**: Direct integration with AWS Step Functions API
|
|
105
|
+
- **AWS SDK Integration**: Direct integration with AWS Step Functions API, from the API (`generateFromAwsResponse`) or the CLI (`--from-aws <arn>`)
|
|
85
106
|
- **Dual APIs**: Function-based and class-based interfaces
|
|
86
107
|
- **Runs Anywhere**: SVG and Mermaid generation has zero platform dependencies — works in Node, the browser, and edge runtimes
|
|
87
108
|
- **Collapse Large Diagrams**: Replace Parallel/Map containers with placeholder nodes before layout so huge diagrams stay readable, with a live toggle in the interactive HTML viewer. See the [configuration guide](https://sfn.yusufaf.dev/guides/configuration/) for `collapse` and every other option.
|
|
@@ -109,7 +130,7 @@ Full documentation lives at **[sfn.yusufaf.dev](https://sfn.yusufaf.dev)**.
|
|
|
109
130
|
|
|
110
131
|
- [Introduction](https://sfn.yusufaf.dev/introduction/) — what it does and how it compares
|
|
111
132
|
- [Quick start](https://sfn.yusufaf.dev/quick-start/) — your first diagram
|
|
112
|
-
- [Command line](https://sfn.yusufaf.dev/guides/cli/) — the `sfn-diagram` CLI, diffs, and execution overlays
|
|
133
|
+
- [Command line](https://sfn.yusufaf.dev/guides/cli/) — the `sfn-diagram` CLI, flags, exit codes, diffs, and execution overlays
|
|
113
134
|
- [Configuration](https://sfn.yusufaf.dev/guides/configuration/) — themes, layouts, edge styles, service icons
|
|
114
135
|
- [Examples](https://sfn.yusufaf.dev/guides/examples/) — complete worked examples
|
|
115
136
|
- [Use with your framework](https://sfn.yusufaf.dev/guides/frameworks/) — Next.js, Remix, SvelteKit, Astro
|