proschi 0.1.0 → 0.3.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 +41 -3
- package/dist/cli.cjs +17445 -78
- package/dist/render.cjs +452 -0
- package/dist/server.cjs +17502 -161
- package/grammar/proschi.tmLanguage.json +159 -0
- package/package.json +12 -2
- package/schema/proschi-diagram.schema.json +710 -1
package/README.md
CHANGED
|
@@ -7,14 +7,52 @@ microservice architectures and the request flows that run through them.
|
|
|
7
7
|
```sh
|
|
8
8
|
npm install -g proschi
|
|
9
9
|
proschi check docs/ # validate every *.proschi file below docs/
|
|
10
|
+
proschi check --strict --openapi orders=specs/orders.yaml docs/ # also against an OpenAPI spec
|
|
10
11
|
proschi parse checkout.proschi # the parsed diagram as JSON
|
|
12
|
+
proschi fmt docs/ # format files in place (--check: only report, exit 1 for CI)
|
|
13
|
+
proschi render checkout.proschi --out diagrams # SVG diagrams (also --format md|html|hld-md|hld-html)
|
|
14
|
+
proschi test docs/ # run requirements and tests (exit 1 on a failure)
|
|
15
|
+
proschi analyze shortener.proschi # load, latency, availability and cost per node
|
|
11
16
|
proschi-language-server --stdio # for any editor with an LSP client
|
|
12
17
|
```
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
the editor reports.
|
|
19
|
+
The commands run the parser of the web editor, so they report exactly what
|
|
20
|
+
the editor reports. The language server also formats documents, with the same
|
|
21
|
+
formatter as `proschi fmt`. Setup for VS Code, IntelliJ, Neovim, Helix, Sublime Text
|
|
16
22
|
and CI: [docs/EDITORS.md](https://github.com/gvart/proschi/blob/main/docs/EDITORS.md).
|
|
17
23
|
|
|
24
|
+
`check` and the language server can also compare use case steps with the
|
|
25
|
+
OpenAPI 3.0/3.1 specs of the services they call (endpoints, status codes,
|
|
26
|
+
JSON payloads), mapped in a `proschi.json` or with `--openapi`: see
|
|
27
|
+
[Checking against OpenAPI](https://github.com/gvart/proschi/blob/main/docs/EDITORS.md#checking-against-openapi).
|
|
28
|
+
|
|
29
|
+
`test` runs the `requirements { … }` and `test "…" { … }` blocks of each file
|
|
30
|
+
against a capacity model of its `traffic { … }` (`--format text|github|json`);
|
|
31
|
+
`analyze` prints that model as a table (`--format text|json`). The language
|
|
32
|
+
server reports failing requirements and tests as warnings and adds load to
|
|
33
|
+
node hovers. The model and its default numbers:
|
|
34
|
+
[Simulation and tests](https://github.com/gvart/proschi/blob/main/docs/EDITORS.md#simulation-and-tests).
|
|
35
|
+
|
|
36
|
+
## Rendering
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
proschi render [--out <dir>] [--format svg|md|html|hld-md|hld-html] <file>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- `svg` (default): `architecture.svg`, plus `<usecase>--<scenario>.svg` with a
|
|
43
|
+
sequence diagram for every scenario
|
|
44
|
+
- `md`: `<file>.md` with Mermaid blocks (architecture and every scenario),
|
|
45
|
+
which GitHub and GitLab render natively
|
|
46
|
+
- `html`: `<file>.html`, a single self-contained page with all the SVGs and a
|
|
47
|
+
scenario list
|
|
48
|
+
|
|
49
|
+
`--out` defaults to the current directory; the written paths are printed.
|
|
50
|
+
Imports are followed as for `check`. A document with errors in any of its
|
|
51
|
+
files is not rendered (the errors are printed, exit code 1); warnings don't
|
|
52
|
+
stop it. The SVGs are self-contained, with a white background, and look like
|
|
53
|
+
the web editor's canvas (same layout, cards and icons). The renderer is a
|
|
54
|
+
separate bundle (`dist/render.cjs`), loaded only by `proschi render`.
|
|
55
|
+
|
|
18
56
|
Also in this package:
|
|
19
57
|
|
|
20
58
|
- `grammar/proschi.tmLanguage.json`: TextMate grammar for syntax highlighting
|
|
@@ -24,7 +62,7 @@ Also in this package:
|
|
|
24
62
|
|
|
25
63
|
```sh
|
|
26
64
|
npm ci
|
|
27
|
-
npm test # builds, then runs the tests (CLI, server over stdio, grammar, schema)
|
|
65
|
+
npm test # builds, then runs the tests (CLI, server over stdio, OpenAPI checks, grammar, schema)
|
|
28
66
|
npm run typecheck
|
|
29
67
|
npm run package:vscode # dist/proschi.vsix
|
|
30
68
|
```
|