sysml-diagram 0.10.15

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.
Files changed (121) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +164 -0
  3. package/out/main.js +189395 -0
  4. package/out/main.js.map +7 -0
  5. package/package.json +62 -0
  6. package/resources/sysml.dimension-table.json +1 -0
  7. package/resources/sysml.library/Domain Libraries/Analysis/.meta.json +10 -0
  8. package/resources/sysml.library/Domain Libraries/Analysis/.project.json +27 -0
  9. package/resources/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +34 -0
  10. package/resources/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +119 -0
  11. package/resources/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -0
  12. package/resources/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +171 -0
  13. package/resources/sysml.library/Domain Libraries/Cause and Effect/.meta.json +8 -0
  14. package/resources/sysml.library/Domain Libraries/Cause and Effect/.project.json +23 -0
  15. package/resources/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +83 -0
  16. package/resources/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -0
  17. package/resources/sysml.library/Domain Libraries/Geometry/.meta.json +8 -0
  18. package/resources/sysml.library/Domain Libraries/Geometry/.project.json +27 -0
  19. package/resources/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +899 -0
  20. package/resources/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +168 -0
  21. package/resources/sysml.library/Domain Libraries/Metadata/.meta.json +10 -0
  22. package/resources/sysml.library/Domain Libraries/Metadata/.project.json +19 -0
  23. package/resources/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +78 -0
  24. package/resources/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +143 -0
  25. package/resources/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +39 -0
  26. package/resources/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +100 -0
  27. package/resources/sysml.library/Domain Libraries/Quantities and Units/.meta.json +29 -0
  28. package/resources/sysml.library/Domain Libraries/Quantities and Units/.project.json +23 -0
  29. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -0
  30. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -0
  31. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
  32. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -0
  33. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
  34. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
  35. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
  36. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
  37. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -0
  38. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -0
  39. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -0
  40. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -0
  41. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -0
  42. package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
  43. package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -0
  44. package/resources/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -0
  45. package/resources/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -0
  46. package/resources/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -0
  47. package/resources/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -0
  48. package/resources/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +50 -0
  49. package/resources/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -0
  50. package/resources/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -0
  51. package/resources/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -0
  52. package/resources/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +8 -0
  53. package/resources/sysml.library/Domain Libraries/Requirement Derivation/.project.json +19 -0
  54. package/resources/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +63 -0
  55. package/resources/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +39 -0
  56. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +9 -0
  57. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +11 -0
  58. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +177 -0
  59. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -0
  60. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +64 -0
  61. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +23 -0
  62. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +15 -0
  63. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +80 -0
  64. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -0
  65. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -0
  66. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -0
  67. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +117 -0
  68. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +43 -0
  69. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -0
  70. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -0
  71. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +43 -0
  72. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +154 -0
  73. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -0
  74. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -0
  75. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +33 -0
  76. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +111 -0
  77. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -0
  78. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +35 -0
  79. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +273 -0
  80. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +22 -0
  81. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +15 -0
  82. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +95 -0
  83. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +156 -0
  84. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +135 -0
  85. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +190 -0
  86. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -0
  87. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +67 -0
  88. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +58 -0
  89. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -0
  90. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +161 -0
  91. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -0
  92. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +293 -0
  93. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +197 -0
  94. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +145 -0
  95. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +281 -0
  96. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +66 -0
  97. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +188 -0
  98. package/resources/sysml.library/LICENSE +277 -0
  99. package/resources/sysml.library/NOTICE.md +20 -0
  100. package/resources/sysml.library/Systems Library/Actions.sysml +557 -0
  101. package/resources/sysml.library/Systems Library/Allocations.sysml +29 -0
  102. package/resources/sysml.library/Systems Library/AnalysisCases.sysml +38 -0
  103. package/resources/sysml.library/Systems Library/Attributes.sysml +25 -0
  104. package/resources/sysml.library/Systems Library/Calculations.sysml +37 -0
  105. package/resources/sysml.library/Systems Library/Cases.sysml +71 -0
  106. package/resources/sysml.library/Systems Library/Connections.sysml +60 -0
  107. package/resources/sysml.library/Systems Library/Constraints.sysml +44 -0
  108. package/resources/sysml.library/Systems Library/Flows.sysml +126 -0
  109. package/resources/sysml.library/Systems Library/Interfaces.sysml +89 -0
  110. package/resources/sysml.library/Systems Library/Items.sysml +153 -0
  111. package/resources/sysml.library/Systems Library/Metadata.sysml +32 -0
  112. package/resources/sysml.library/Systems Library/Parts.sysml +81 -0
  113. package/resources/sysml.library/Systems Library/Ports.sysml +54 -0
  114. package/resources/sysml.library/Systems Library/Requirements.sysml +194 -0
  115. package/resources/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -0
  116. package/resources/sysml.library/Systems Library/States.sysml +103 -0
  117. package/resources/sysml.library/Systems Library/SysML.sysml +539 -0
  118. package/resources/sysml.library/Systems Library/UseCases.sysml +57 -0
  119. package/resources/sysml.library/Systems Library/VerificationCases.sysml +103 -0
  120. package/resources/sysml.library/Systems Library/Views.sysml +164 -0
  121. package/resources/sysml.library.index.json +1 -0
package/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ SysML v2 Visual Studio Code Extension
2
+ Freeware License
3
+
4
+ Copyright (c) 2026 C. Ilie
5
+
6
+ Permission is granted to install and use this software free of charge.
7
+
8
+ The software is licensed, not sold.
9
+
10
+ You may:
11
+ - Use the software for personal purposes.
12
+ - Use the software for educational purposes.
13
+ - Use the software for commercial purposes.
14
+
15
+ You may not:
16
+ - Modify the software.
17
+ - Reverse engineer the software except where required by law.
18
+ - Redistribute the software.
19
+ - Sublicense the software.
20
+ - Sell the software.
21
+ - Create derivative works.
22
+
23
+ All intellectual property rights remain with the copyright holder.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
26
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
27
+ DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,164 @@
1
+ # sysml-diagram
2
+
3
+ Headless SysML v2 / KerML diagram export. Renders the same views the
4
+ [SysML v2 VS Code extension](https://marketplace.visualstudio.com/items?itemName=voidaliot.vscode-sysml-v2)
5
+ draws — General, Interconnection, Action Flow, State Transition, Sequence, Case,
6
+ Geometry, and the Grid table — from a terminal or a CI job. No VS Code, no
7
+ browser, no display server.
8
+
9
+ ```bash
10
+ npx sysml-diagram export --file models/vehicle.sysml --view gv --out docs/vehicle-gv.svg
11
+ ```
12
+
13
+ ```
14
+ docs/vehicle-gv.svg
15
+ ```
16
+
17
+ Written files go to stdout, one per line; model errors and warnings go to stderr
18
+ and set the exit code. Nothing else is printed, so the output pipes cleanly into
19
+ another command.
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ sysml-diagram export --file <model.sysml> [options]
25
+
26
+ --file <path> Model file to render (required).
27
+ --view <kind> gv | iv | afv | stv | sv | cv | gev | grv (default: project's).
28
+ --anchor <qname> Qualified name to anchor on (default: the file overview).
29
+ --out <path> Output path (default: <file-stem>.<view>.svg).
30
+ --all Render every view that has content for the anchor.
31
+ --out-dir <path> Output directory for --all (default: the working directory).
32
+ --theme <name> dark | light (default: dark).
33
+ --gv-mode <mode> General View presentation: group | tree (default: as saved).
34
+ --workspace <path> Project root holding .vscode/sysml/ (default: auto-detected).
35
+ --auto-layout Ignore the committed diagram layout and lay out fresh.
36
+ --strict Fail on warnings as well as errors.
37
+ --library <path> Standard-library directory (default: the bundled library).
38
+ ```
39
+
40
+ The OMG standard library ships with the package, so nothing else needs to be
41
+ installed or configured.
42
+
43
+ ## Examples
44
+
45
+ **Render one view.** The path of every file written is printed, relative to the
46
+ working directory:
47
+
48
+ ```console
49
+ $ sysml-diagram export --file models/vehicle.sysml --view iv --anchor Vehicle::Car --out docs/car-iv.svg
50
+ docs/car-iv.svg
51
+ ```
52
+
53
+ **Render every view that has content**, in one pass over the model:
54
+
55
+ ```console
56
+ $ sysml-diagram export --file models/vehicle.sysml --all --out-dir docs
57
+ docs/vehicle.gv.svg
58
+ docs/vehicle.iv.svg
59
+ docs/vehicle.sv.svg
60
+ docs/vehicle.grv.csv
61
+ ```
62
+
63
+ The Grid View is a table in the editor too, so it lands as CSV. Views with no
64
+ content for the anchor are skipped rather than written empty.
65
+
66
+ **A model with problems** still renders — you get the artifact *and* the failure,
67
+ which is what you want when a pipeline goes red:
68
+
69
+ ```console
70
+ $ sysml-diagram export --file models/vehicle.sysml --view gv --out docs/gv.svg ; echo "exit=$?"
71
+ models/vehicle.sysml:12:23: error [RES001]: Could not resolve reference to Element named 'Engien'.
72
+ docs/gv.svg
73
+ sysml-diagram: 1 error in models/vehicle.sysml.
74
+ exit=1
75
+ ```
76
+
77
+ Diagnostics are one line each, `file:line:col: severity [CODE]: message`, on
78
+ stderr — so `sysml-diagram … 2>/dev/null` leaves only the written paths. Only
79
+ errors and warnings are shown; for the advisory notices use
80
+ [`sysml-validate --all`](https://www.npmjs.com/package/sysml-validate).
81
+
82
+ **Feed the written paths to another tool**, since stdout is just the file list:
83
+
84
+ ```console
85
+ $ sysml-diagram export --file models/vehicle.sysml --all --out-dir docs | xargs -r ls -lh
86
+ ```
87
+
88
+ **Documentation build**: light theme, the General View's relation tree, into the
89
+ docs folder:
90
+
91
+ ```console
92
+ $ sysml-diagram export --file models/vehicle.sysml --view gv --gv-mode tree --theme light --out docs/architecture.svg
93
+ docs/architecture.svg
94
+ ```
95
+
96
+ **Snapshot every package** of a multi-file project:
97
+
98
+ ```console
99
+ $ for model in models/*.sysml; do sysml-diagram export --file "$model" --all --out-dir docs/diagrams; done
100
+ ```
101
+
102
+ ## Your project's configuration is honoured
103
+
104
+ The CLI reads the same two files the editor writes, so a rendered diagram is the
105
+ diagram your team arranged — not a fresh automatic layout of the same model:
106
+
107
+ - **`.vscode/sysml/project.json`** — project-scoped `sysml.preview.diagrams.*`
108
+ settings: default view, port labels, multiplicities, connector line style,
109
+ connect-point spacing, Case View subject boundary.
110
+ - **`.vscode/sysml/diagrams/<source>.json`** — the per-anchor, per-view side-car:
111
+ node positions and sizes, port placements, connector waypoints and docking
112
+ anchors, layout direction, General View mode and quick filters, Interconnection
113
+ View compartment collapse, Grid preset and column order.
114
+
115
+ Precedence is the editor's, with the command line on top:
116
+ manifest default → `project.json` → saved per-view state → CLI flag.
117
+
118
+ The project root is the nearest ancestor holding `.vscode/sysml/` (else the
119
+ repository root); `--workspace` names it explicitly, and `--auto-layout` ignores
120
+ the committed geometry.
121
+
122
+ Output is a self-contained vector SVG: its own stylesheet, its own marker
123
+ definitions, embedded theme colours, no external references, and well-formed
124
+ XML. The Grid View is a table in the editor as well, so `--view grv` writes CSV.
125
+
126
+ ## Exit codes
127
+
128
+ | Code | Meaning |
129
+ |---|---|
130
+ | `0` | every requested diagram was written and the model has no blocking diagnostics |
131
+ | `1` | the model reported errors (or warnings under `--strict`), or nothing could be rendered |
132
+ | `2` | the command line or the environment was wrong (bad flag, unreadable file) |
133
+
134
+ Diagnostics go to stderr in `file:line:col: severity [CODE]: message` form;
135
+ written paths go to stdout.
136
+
137
+ ## GitHub Actions
138
+
139
+ Render diagrams into build artifacts, or fail the build when the model breaks:
140
+
141
+ ```yaml
142
+ - uses: actions/setup-node@v4
143
+ with: { node-version: 20 }
144
+
145
+ - name: Render diagrams
146
+ run: npx sysml-diagram export --file model.sysml --all --out-dir docs/diagrams
147
+
148
+ - name: Fail if the committed diagrams are stale
149
+ run: git diff --exit-code docs/diagrams
150
+
151
+ - uses: actions/upload-artifact@v4
152
+ with:
153
+ name: diagrams
154
+ path: docs/diagrams
155
+ ```
156
+
157
+ `sysml-diagram` writes the diagram even when the model has errors, and still
158
+ exits `1` — so the artifact is there to look at when the gate fails.
159
+
160
+ ## License
161
+
162
+ The CLI uses the extension's Freeware License (see `LICENSE`). The vendored OMG
163
+ standard library under `resources/sysml.library` keeps its upstream OMG
164
+ LICENSE / LICENSE-GPL terms; see that directory's `NOTICE.md`.