proschi 0.1.0 → 0.2.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
@@ -7,14 +7,43 @@ 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)
11
14
  proschi-language-server --stdio # for any editor with an LSP client
12
15
  ```
13
16
 
14
- Both commands run the parser of the web editor, so they report exactly what
15
- the editor reports. Setup for VS Code, IntelliJ, Neovim, Helix, Sublime Text
17
+ The commands run the parser of the web editor, so they report exactly what
18
+ the editor reports. The language server also formats documents, with the same
19
+ formatter as `proschi fmt`. Setup for VS Code, IntelliJ, Neovim, Helix, Sublime Text
16
20
  and CI: [docs/EDITORS.md](https://github.com/gvart/proschi/blob/main/docs/EDITORS.md).
17
21
 
22
+ `check` and the language server can also compare use case steps with the
23
+ OpenAPI 3.0/3.1 specs of the services they call (endpoints, status codes,
24
+ JSON payloads), mapped in a `proschi.json` or with `--openapi`: see
25
+ [Checking against OpenAPI](https://github.com/gvart/proschi/blob/main/docs/EDITORS.md#checking-against-openapi).
26
+
27
+ ## Rendering
28
+
29
+ ```
30
+ proschi render [--out <dir>] [--format svg|md|html] <file>
31
+ ```
32
+
33
+ - `svg` (default): `architecture.svg`, plus `<usecase>--<scenario>.svg` with a
34
+ sequence diagram for every scenario
35
+ - `md`: `<file>.md` with Mermaid blocks (architecture and every scenario),
36
+ which GitHub and GitLab render natively
37
+ - `html`: `<file>.html`, a single self-contained page with all the SVGs and a
38
+ scenario list
39
+
40
+ `--out` defaults to the current directory; the written paths are printed.
41
+ Imports are followed as for `check`. A document with errors in any of its
42
+ files is not rendered (the errors are printed, exit code 1); warnings don't
43
+ stop it. The SVGs are self-contained, with a white background, and look like
44
+ the web editor's canvas (same layout, cards and icons). The renderer is a
45
+ separate bundle (`dist/render.cjs`), loaded only by `proschi render`.
46
+
18
47
  Also in this package:
19
48
 
20
49
  - `grammar/proschi.tmLanguage.json`: TextMate grammar for syntax highlighting
@@ -24,7 +53,7 @@ Also in this package:
24
53
 
25
54
  ```sh
26
55
  npm ci
27
- npm test # builds, then runs the tests (CLI, server over stdio, grammar, schema)
56
+ npm test # builds, then runs the tests (CLI, server over stdio, OpenAPI checks, grammar, schema)
28
57
  npm run typecheck
29
58
  npm run package:vscode # dist/proschi.vsix
30
59
  ```