@linked.archi/la-gram-git 0.0.0-stage → 0.1.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.
Files changed (283) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +2 -0
  3. package/README.md +214 -2
  4. package/assets/arch-decision/arch-decision-metamodel.ttl +44 -0
  5. package/assets/arch-decision/arch-decision-onto.ttl +1566 -0
  6. package/assets/arch-decision/arch-decision-shapes.ttl +582 -0
  7. package/assets/arch-decision/arch-decision-tax.ttl +129 -0
  8. package/assets/arch-processes/arch-processes-metamodel.ttl +42 -0
  9. package/assets/arch-processes/arch-processes-tax.ttl +136 -0
  10. package/assets/arch-processes/archProcesses-shapes.ttl +189 -0
  11. package/assets/arch-processes/archProcesses.ttl +953 -0
  12. package/assets/archimate3/archimate3.2-element-shapes.ttl +379 -0
  13. package/assets/archimate3/archimate3.2-metamodel.ttl +205 -0
  14. package/assets/archimate3/archimate3.2-notation.ttl +1503 -0
  15. package/assets/archimate3/archimate3.2-onto.ttl +1579 -0
  16. package/assets/archimate3/archimate3.2-presentation-contexts.ttl +90 -0
  17. package/assets/archimate3/archimate3.2-principle-shapes.ttl +923 -0
  18. package/assets/archimate3/archimate3.2-questions.ttl +1125 -0
  19. package/assets/archimate3/archimate3.2-reference-data.ttl +74 -0
  20. package/assets/archimate3/archimate3.2-relationship-shapes.ttl +30956 -0
  21. package/assets/archimate3/archimate3.2-relationship-tables.ttl +5992 -0
  22. package/assets/archimate3/archimate3.2-tax.ttl +724 -0
  23. package/assets/archimate3/archimate3.2-viewpoint-shapes.ttl +59 -0
  24. package/assets/archimate3/archimate3.2-viewpoints.ttl +793 -0
  25. package/assets/archimate3/icons/and-junction.svg +3 -0
  26. package/assets/archimate3/icons/application-collaboration.svg +22 -0
  27. package/assets/archimate3/icons/application-component.svg +18 -0
  28. package/assets/archimate3/icons/application-event.svg +15 -0
  29. package/assets/archimate3/icons/application-function.svg +14 -0
  30. package/assets/archimate3/icons/application-interaction.svg +17 -0
  31. package/assets/archimate3/icons/application-interface.svg +16 -0
  32. package/assets/archimate3/icons/application-process.svg +14 -0
  33. package/assets/archimate3/icons/application-service.svg +14 -0
  34. package/assets/archimate3/icons/artifact.svg +16 -0
  35. package/assets/archimate3/icons/assessment.svg +17 -0
  36. package/assets/archimate3/icons/business-actor.svg +22 -0
  37. package/assets/archimate3/icons/business-collaboration.svg +21 -0
  38. package/assets/archimate3/icons/business-event.svg +15 -0
  39. package/assets/archimate3/icons/business-function.svg +14 -0
  40. package/assets/archimate3/icons/business-interaction.svg +18 -0
  41. package/assets/archimate3/icons/business-interface.svg +16 -0
  42. package/assets/archimate3/icons/business-object.svg +14 -0
  43. package/assets/archimate3/icons/business-process.svg +15 -0
  44. package/assets/archimate3/icons/business-role.svg +16 -0
  45. package/assets/archimate3/icons/business-service.svg +14 -0
  46. package/assets/archimate3/icons/capability.svg +40 -0
  47. package/assets/archimate3/icons/communication-network.svg +18 -0
  48. package/assets/archimate3/icons/constraint.svg +18 -0
  49. package/assets/archimate3/icons/contract.svg +13 -0
  50. package/assets/archimate3/icons/course-of-action.svg +20 -0
  51. package/assets/archimate3/icons/data-object.svg +14 -0
  52. package/assets/archimate3/icons/deliverable.svg +11 -0
  53. package/assets/archimate3/icons/device.svg +18 -0
  54. package/assets/archimate3/icons/distribution-network.svg +19 -0
  55. package/assets/archimate3/icons/driver.svg +24 -0
  56. package/assets/archimate3/icons/equipment.svg +31 -0
  57. package/assets/archimate3/icons/facility.svg +16 -0
  58. package/assets/archimate3/icons/gap.svg +22 -0
  59. package/assets/archimate3/icons/glyphs/activity.svg +3 -0
  60. package/assets/archimate3/icons/glyphs/actor.svg +14 -0
  61. package/assets/archimate3/icons/glyphs/application-component.svg +12 -0
  62. package/assets/archimate3/icons/glyphs/artifact.svg +9 -0
  63. package/assets/archimate3/icons/glyphs/assessment.svg +9 -0
  64. package/assets/archimate3/icons/glyphs/capability.svg +32 -0
  65. package/assets/archimate3/icons/glyphs/cloud-gear.svg +3 -0
  66. package/assets/archimate3/icons/glyphs/collaboration.svg +15 -0
  67. package/assets/archimate3/icons/glyphs/communication-network.svg +12 -0
  68. package/assets/archimate3/icons/glyphs/constraint.svg +10 -0
  69. package/assets/archimate3/icons/glyphs/contract.svg +5 -0
  70. package/assets/archimate3/icons/glyphs/course-of-action.svg +12 -0
  71. package/assets/archimate3/icons/glyphs/data-object.svg +4 -0
  72. package/assets/archimate3/icons/glyphs/deliverable.svg +3 -0
  73. package/assets/archimate3/icons/glyphs/device.svg +10 -0
  74. package/assets/archimate3/icons/glyphs/distribution-network.svg +11 -0
  75. package/assets/archimate3/icons/glyphs/driver.svg +16 -0
  76. package/assets/archimate3/icons/glyphs/equipment.svg +22 -0
  77. package/assets/archimate3/icons/glyphs/event.svg +6 -0
  78. package/assets/archimate3/icons/glyphs/facility.svg +7 -0
  79. package/assets/archimate3/icons/glyphs/function.svg +6 -0
  80. package/assets/archimate3/icons/glyphs/gap.svg +14 -0
  81. package/assets/archimate3/icons/glyphs/goal.svg +10 -0
  82. package/assets/archimate3/icons/glyphs/grouping.svg +4 -0
  83. package/assets/archimate3/icons/glyphs/interaction.svg +10 -0
  84. package/assets/archimate3/icons/glyphs/interface.svg +8 -0
  85. package/assets/archimate3/icons/glyphs/location.svg +6 -0
  86. package/assets/archimate3/icons/glyphs/material.svg +12 -0
  87. package/assets/archimate3/icons/glyphs/meaning.svg +3 -0
  88. package/assets/archimate3/icons/glyphs/node.svg +8 -0
  89. package/assets/archimate3/icons/glyphs/object.svg +4 -0
  90. package/assets/archimate3/icons/glyphs/outcome.svg +16 -0
  91. package/assets/archimate3/icons/glyphs/path.svg +10 -0
  92. package/assets/archimate3/icons/glyphs/person-silhouette.svg +3 -0
  93. package/assets/archimate3/icons/glyphs/plateau.svg +8 -0
  94. package/assets/archimate3/icons/glyphs/principle.svg +12 -0
  95. package/assets/archimate3/icons/glyphs/process.svg +6 -0
  96. package/assets/archimate3/icons/glyphs/product.svg +4 -0
  97. package/assets/archimate3/icons/glyphs/representation.svg +4 -0
  98. package/assets/archimate3/icons/glyphs/requirement.svg +6 -0
  99. package/assets/archimate3/icons/glyphs/resource.svg +14 -0
  100. package/assets/archimate3/icons/glyphs/role.svg +6 -0
  101. package/assets/archimate3/icons/glyphs/service.svg +6 -0
  102. package/assets/archimate3/icons/glyphs/stakeholder.svg +6 -0
  103. package/assets/archimate3/icons/glyphs/system-software.svg +14 -0
  104. package/assets/archimate3/icons/glyphs/value-stream.svg +3 -0
  105. package/assets/archimate3/icons/glyphs/value.svg +3 -0
  106. package/assets/archimate3/icons/glyphs/work-package.svg +4 -0
  107. package/assets/archimate3/icons/goal.svg +18 -0
  108. package/assets/archimate3/icons/grouping.svg +12 -0
  109. package/assets/archimate3/icons/implementation-event.svg +15 -0
  110. package/assets/archimate3/icons/location.svg +14 -0
  111. package/assets/archimate3/icons/material.svg +21 -0
  112. package/assets/archimate3/icons/meaning.svg +11 -0
  113. package/assets/archimate3/icons/node.svg +14 -0
  114. package/assets/archimate3/icons/or-junction.svg +3 -0
  115. package/assets/archimate3/icons/outcome.svg +25 -0
  116. package/assets/archimate3/icons/path.svg +18 -0
  117. package/assets/archimate3/icons/plateau.svg +16 -0
  118. package/assets/archimate3/icons/principle.svg +21 -0
  119. package/assets/archimate3/icons/product.svg +12 -0
  120. package/assets/archimate3/icons/representation.svg +12 -0
  121. package/assets/archimate3/icons/requirement.svg +14 -0
  122. package/assets/archimate3/icons/resource.svg +23 -0
  123. package/assets/archimate3/icons/stakeholder.svg +15 -0
  124. package/assets/archimate3/icons/system-software.svg +22 -0
  125. package/assets/archimate3/icons/technology-collaboration.svg +22 -0
  126. package/assets/archimate3/icons/technology-event.svg +15 -0
  127. package/assets/archimate3/icons/technology-function.svg +14 -0
  128. package/assets/archimate3/icons/technology-interaction.svg +18 -0
  129. package/assets/archimate3/icons/technology-interface.svg +16 -0
  130. package/assets/archimate3/icons/technology-process.svg +14 -0
  131. package/assets/archimate3/icons/technology-service.svg +14 -0
  132. package/assets/archimate3/icons/value-stream.svg +11 -0
  133. package/assets/archimate3/icons/value.svg +11 -0
  134. package/assets/archimate3/icons/work-package.svg +12 -0
  135. package/assets/archimate4/archimate4-element-shapes.ttl +404 -0
  136. package/assets/archimate4/archimate4-metamodel.ttl +179 -0
  137. package/assets/archimate4/archimate4-notation.ttl +1147 -0
  138. package/assets/archimate4/archimate4-onto.ttl +1559 -0
  139. package/assets/archimate4/archimate4-presentation-contexts.ttl +60 -0
  140. package/assets/archimate4/archimate4-principle-shapes.ttl +893 -0
  141. package/assets/archimate4/archimate4-questions.ttl +1224 -0
  142. package/assets/archimate4/archimate4-reference-data.ttl +56 -0
  143. package/assets/archimate4/archimate4-relationship-shapes.ttl +16920 -0
  144. package/assets/archimate4/archimate4-relationship-tables.ttl +3200 -0
  145. package/assets/archimate4/archimate4-tax.ttl +749 -0
  146. package/assets/archimate4/archimate4-viewpoint-shapes.ttl +55 -0
  147. package/assets/archimate4/archimate4-viewpoints.ttl +777 -0
  148. package/assets/archimate4/icons/and-junction.svg +3 -0
  149. package/assets/archimate4/icons/application-component.svg +18 -0
  150. package/assets/archimate4/icons/application-interface.svg +16 -0
  151. package/assets/archimate4/icons/artifact.svg +16 -0
  152. package/assets/archimate4/icons/assessment.svg +17 -0
  153. package/assets/archimate4/icons/business-actor.svg +22 -0
  154. package/assets/archimate4/icons/business-interface.svg +16 -0
  155. package/assets/archimate4/icons/business-object.svg +14 -0
  156. package/assets/archimate4/icons/capability.svg +40 -0
  157. package/assets/archimate4/icons/collaboration.svg +21 -0
  158. package/assets/archimate4/icons/communication-network.svg +18 -0
  159. package/assets/archimate4/icons/course-of-action.svg +20 -0
  160. package/assets/archimate4/icons/data-object.svg +14 -0
  161. package/assets/archimate4/icons/deliverable.svg +11 -0
  162. package/assets/archimate4/icons/device.svg +18 -0
  163. package/assets/archimate4/icons/distribution-network.svg +19 -0
  164. package/assets/archimate4/icons/driver.svg +24 -0
  165. package/assets/archimate4/icons/equipment.svg +31 -0
  166. package/assets/archimate4/icons/event.svg +15 -0
  167. package/assets/archimate4/icons/facility.svg +16 -0
  168. package/assets/archimate4/icons/function.svg +13 -0
  169. package/assets/archimate4/icons/glyphs/activity.svg +3 -0
  170. package/assets/archimate4/icons/glyphs/actor.svg +14 -0
  171. package/assets/archimate4/icons/glyphs/application-component.svg +12 -0
  172. package/assets/archimate4/icons/glyphs/artifact.svg +9 -0
  173. package/assets/archimate4/icons/glyphs/assessment.svg +9 -0
  174. package/assets/archimate4/icons/glyphs/capability.svg +32 -0
  175. package/assets/archimate4/icons/glyphs/cloud-gear.svg +3 -0
  176. package/assets/archimate4/icons/glyphs/collaboration.svg +15 -0
  177. package/assets/archimate4/icons/glyphs/communication-network.svg +12 -0
  178. package/assets/archimate4/icons/glyphs/constraint.svg +10 -0
  179. package/assets/archimate4/icons/glyphs/contract.svg +5 -0
  180. package/assets/archimate4/icons/glyphs/course-of-action.svg +12 -0
  181. package/assets/archimate4/icons/glyphs/data-object.svg +4 -0
  182. package/assets/archimate4/icons/glyphs/deliverable.svg +3 -0
  183. package/assets/archimate4/icons/glyphs/device.svg +10 -0
  184. package/assets/archimate4/icons/glyphs/distribution-network.svg +11 -0
  185. package/assets/archimate4/icons/glyphs/driver.svg +16 -0
  186. package/assets/archimate4/icons/glyphs/equipment.svg +22 -0
  187. package/assets/archimate4/icons/glyphs/event.svg +6 -0
  188. package/assets/archimate4/icons/glyphs/facility.svg +7 -0
  189. package/assets/archimate4/icons/glyphs/function.svg +6 -0
  190. package/assets/archimate4/icons/glyphs/gap.svg +14 -0
  191. package/assets/archimate4/icons/glyphs/goal.svg +10 -0
  192. package/assets/archimate4/icons/glyphs/grouping.svg +4 -0
  193. package/assets/archimate4/icons/glyphs/interaction.svg +10 -0
  194. package/assets/archimate4/icons/glyphs/interface.svg +8 -0
  195. package/assets/archimate4/icons/glyphs/location.svg +6 -0
  196. package/assets/archimate4/icons/glyphs/material.svg +12 -0
  197. package/assets/archimate4/icons/glyphs/meaning.svg +3 -0
  198. package/assets/archimate4/icons/glyphs/node.svg +8 -0
  199. package/assets/archimate4/icons/glyphs/object.svg +4 -0
  200. package/assets/archimate4/icons/glyphs/outcome.svg +16 -0
  201. package/assets/archimate4/icons/glyphs/path.svg +10 -0
  202. package/assets/archimate4/icons/glyphs/person-silhouette.svg +3 -0
  203. package/assets/archimate4/icons/glyphs/plateau.svg +8 -0
  204. package/assets/archimate4/icons/glyphs/principle.svg +12 -0
  205. package/assets/archimate4/icons/glyphs/process.svg +6 -0
  206. package/assets/archimate4/icons/glyphs/product.svg +4 -0
  207. package/assets/archimate4/icons/glyphs/representation.svg +4 -0
  208. package/assets/archimate4/icons/glyphs/requirement.svg +6 -0
  209. package/assets/archimate4/icons/glyphs/resource.svg +14 -0
  210. package/assets/archimate4/icons/glyphs/role.svg +6 -0
  211. package/assets/archimate4/icons/glyphs/service.svg +6 -0
  212. package/assets/archimate4/icons/glyphs/stakeholder.svg +6 -0
  213. package/assets/archimate4/icons/glyphs/system-software.svg +14 -0
  214. package/assets/archimate4/icons/glyphs/value-stream.svg +3 -0
  215. package/assets/archimate4/icons/glyphs/value.svg +3 -0
  216. package/assets/archimate4/icons/glyphs/work-package.svg +4 -0
  217. package/assets/archimate4/icons/goal.svg +18 -0
  218. package/assets/archimate4/icons/grouping.svg +12 -0
  219. package/assets/archimate4/icons/location.svg +14 -0
  220. package/assets/archimate4/icons/material.svg +21 -0
  221. package/assets/archimate4/icons/meaning.svg +11 -0
  222. package/assets/archimate4/icons/node.svg +14 -0
  223. package/assets/archimate4/icons/or-junction.svg +3 -0
  224. package/assets/archimate4/icons/outcome.svg +25 -0
  225. package/assets/archimate4/icons/path.svg +18 -0
  226. package/assets/archimate4/icons/plateau.svg +16 -0
  227. package/assets/archimate4/icons/principle.svg +21 -0
  228. package/assets/archimate4/icons/process.svg +15 -0
  229. package/assets/archimate4/icons/product.svg +12 -0
  230. package/assets/archimate4/icons/requirement.svg +14 -0
  231. package/assets/archimate4/icons/resource.svg +23 -0
  232. package/assets/archimate4/icons/role.svg +16 -0
  233. package/assets/archimate4/icons/service.svg +13 -0
  234. package/assets/archimate4/icons/stakeholder.svg +15 -0
  235. package/assets/archimate4/icons/system-software.svg +22 -0
  236. package/assets/archimate4/icons/technology-interface.svg +16 -0
  237. package/assets/archimate4/icons/value-stream.svg +11 -0
  238. package/assets/archimate4/icons/value.svg +11 -0
  239. package/assets/archimate4/icons/work-package.svg +12 -0
  240. package/assets/basic/basic-metamodel.ttl +100 -0
  241. package/assets/basic/basic-notation-bubble.ttl +175 -0
  242. package/assets/basic/basic-notation.ttl +172 -0
  243. package/assets/basic/basic-onto.ttl +171 -0
  244. package/assets/basic/basic-presentation-contexts.ttl +70 -0
  245. package/assets/basic/basic-tax.ttl +130 -0
  246. package/assets/basic/icons/aggregation.svg +7 -0
  247. package/assets/basic/icons/association.svg +6 -0
  248. package/assets/basic/icons/element.svg +5 -0
  249. package/assets/basic/icons/glyphs/aggregation.svg +6 -0
  250. package/assets/basic/icons/glyphs/association.svg +5 -0
  251. package/assets/basic/icons/glyphs/element.svg +5 -0
  252. package/assets/basic/icons/glyphs/relationship.svg +5 -0
  253. package/assets/basic/icons/relationship.svg +7 -0
  254. package/assets/basic/notation-bubble/icons/aggregation.svg +7 -0
  255. package/assets/basic/notation-bubble/icons/association.svg +6 -0
  256. package/assets/basic/notation-bubble/icons/element.svg +5 -0
  257. package/assets/basic/notation-bubble/icons/glyphs/aggregation.svg +6 -0
  258. package/assets/basic/notation-bubble/icons/glyphs/association.svg +5 -0
  259. package/assets/basic/notation-bubble/icons/glyphs/element.svg +5 -0
  260. package/assets/basic/notation-bubble/icons/glyphs/relationship.svg +5 -0
  261. package/assets/basic/notation-bubble/icons/relationship.svg +7 -0
  262. package/assets/catalog.ttl +7302 -0
  263. package/assets/core/core-notation.ttl +131 -0
  264. package/assets/core/core-onto.ttl +2811 -0
  265. package/assets/core/core-questions.ttl +957 -0
  266. package/assets/core/core-shapes.ttl +915 -0
  267. package/assets/core/core-vis-onto.ttl +1408 -0
  268. package/assets/core/core-vis-shapes.ttl +840 -0
  269. package/assets/core-vis/markers/circle-dot.svg +3 -0
  270. package/assets/core-vis/markers/closed-arrowhead.svg +3 -0
  271. package/assets/core-vis/markers/filled-diamond.svg +3 -0
  272. package/assets/core-vis/markers/half-arrowhead.svg +3 -0
  273. package/assets/core-vis/markers/hollow-arrowhead.svg +3 -0
  274. package/assets/core-vis/markers/hollow-diamond.svg +3 -0
  275. package/assets/core-vis/markers/open-arrowhead.svg +3 -0
  276. package/ci/README.md +126 -0
  277. package/ci/github/la-gram-git.yml +30 -0
  278. package/ci/gitlab/la-gram-git.gitlab-ci.yml +20 -0
  279. package/dist/637.js +51 -0
  280. package/dist/637.js.map +1 -0
  281. package/dist/la-gram-git.js +22936 -0
  282. package/dist/la-gram-git.js.map +1 -0
  283. package/package.json +31 -4
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
2
+ <circle cx="8.5" cy="6" r="3.5" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
2
+ <polygon points="1,1 11,6 1,11" fill="currentColor" stroke="currentColor" stroke-width="0.5"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
2
+ <polygon points="0.75,6 6,2.75 11.25,6 6,9.25" fill="currentColor" stroke="currentColor" stroke-width="0.5"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
2
+ <path d="M1 1L11 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
2
+ <polygon points="1,1 11,6 1,11" fill="#FFFFFF" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
2
+ <polygon points="0.75,6 6,2.75 11.25,6 6,9.25" fill="#FFFFFF" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
2
+ <path d="M1 1L11 6L1 11" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
3
+ </svg>
package/ci/README.md ADDED
@@ -0,0 +1,126 @@
1
+ # la-gram-git in CI
2
+
3
+ Two templates check the la-gram models a pull or merge request changes, and comment on the request with
4
+ its changes by element:
5
+
6
+ | File | For | Set up with |
7
+ |---|---|---|
8
+ | [`github/la-gram-git.yml`](github/la-gram-git.yml) | GitHub Actions | `npx @linked.archi/la-gram-git init github` |
9
+ | [`gitlab/la-gram-git.gitlab-ci.yml`](gitlab/la-gram-git.gitlab-ci.yml) | GitLab CI — gitlab.com and self-managed | `npx @linked.archi/la-gram-git init gitlab` |
10
+
11
+ `init` copies the template into the repository you run it in and overwrites nothing: on GitLab, a
12
+ repository that has a `.gitlab-ci.yml` gets `la-gram-git.gitlab-ci.yml` beside it, to include. You can copy
13
+ the files by hand as well. Commit the result, and open a request.
14
+
15
+ ## What the job does
16
+
17
+ 1. **`la-gram-git check --base <target branch>`** checks every model file in the repository: a file with a
18
+ model extension (`.ttl`, `.trig`, `.jsonld`, `.nq`, `.nt`, `.rdf`) and an `arch:Model` in it. Other RDF
19
+ files, such as vendored ontologies and shapes, are left alone. **The job fails** when a model file:
20
+ - does not parse;
21
+ - is not exactly as la-gram writes it (the output says which `la-gram-git fix` command rewrites it);
22
+ - refers to something it does not have — a relationship end, a view's node, a folder entry;
23
+ - has a SHACL violation that the change adds. Violations the file already had where the branch started
24
+ are listed, not failed, so an old model can be improved one request at a time.
25
+
26
+ Warnings and Info are counted, never failed. Findings of the shapes' SPARQL-based rules (ArchiMate's
27
+ principles, viewpoint conformance) are listed and do not fail the job for now. Each finding names the
28
+ IRI of its shape, which opens the shape's documentation. On GitHub each failure is also an annotation
29
+ on the file.
30
+ 2. **`la-gram-git diff <target branch> --comment`** writes the request's model changes by element as
31
+ Markdown — the concepts added, changed and removed, as la-gram's History tab words them — into the job's
32
+ log, and posts them as a comment on the request. On a later push it updates the same comment. It runs
33
+ whether or not the check passed, and a comment that cannot be made never fails the job.
34
+
35
+ The checks use the metamodels bundled with la-gram-git: ArchiMate 4.0 and 3.2, la-gram's basic metamodel and
36
+ Linked.Archi's core. A model declaring a metamodel the tool does not have is validated without it, and the
37
+ output says so.
38
+
39
+ ## GitHub Actions
40
+
41
+ The workflow runs on `pull_request`. It comments with the workflow's own `GITHUB_TOKEN`, which is why it
42
+ asks for `pull-requests: write`. A pull request from a fork gets a read-only token: its check runs, and its
43
+ diff goes to the job's log instead of a comment.
44
+
45
+ ## GitLab CI
46
+
47
+ The job runs in merge request pipelines (`$CI_PIPELINE_SOURCE == "merge_request_event"`). If the rest of your
48
+ pipeline runs on branch pushes, GitLab then runs both a branch pipeline and a merge request pipeline for
49
+ each push to a branch with an open request; GitLab's documentation on `workflow:rules` describes how to keep
50
+ one.
51
+
52
+ **The comment needs a token.** The job's own `CI_JOB_TOKEN` cannot comment on a merge request, so
53
+ la-gram-git reads one from the CI/CD variable `LA_GRAM_GIT_TOKEN`:
54
+
55
+ 1. Create a **project access token** (or a group access token, to share one across projects) with the role
56
+ **Reporter**, the scope **`api`**, and an expiry date.
57
+ 2. Add it under *Settings › CI/CD › Variables* as `LA_GRAM_GIT_TOKEN`, **masked**. Leave it unprotected:
58
+ merge request pipelines run on the request's branch, which is not protected, and a protected variable is
59
+ not given to them. Anyone who can run a pipeline in the project can therefore use it — which is why it
60
+ should have no more than Reporter and `api`.
61
+
62
+ Without the variable the job still checks, and the diff goes to the job's log. The token is sent only to
63
+ your GitLab's API (`CI_API_V4_URL`), in a header, and never written to the log.
64
+
65
+ **Self-managed GitLab** works the same way: la-gram-git reads the instance's API address from the job.
66
+ The template uses the `node:22` image from Docker Hub. If your runners cannot reach it, use a mirror, or
67
+ la-gram-git's own image (below).
68
+
69
+ ## Variations
70
+
71
+ - **Pin a version.** The templates run `@linked.archi/la-gram-git@0`, the newest 0.x release. Write
72
+ `@0.1.0` to pin one, and update it when you choose.
73
+ - **Your own shapes.** Add `--shapes <folder>` to the `check` line to validate against a folder of your
74
+ repository's or organisation's shapes (`.ttl`) as well as the metamodels'. Each file names its graph
75
+ with an `owl:Ontology`, as a shapes document does; one that does not is refused by name.
76
+ - **Only some files.** Name files or folders after the command: `check models/ --base …`.
77
+ - **The container image instead of npx.** It has la-gram-git installed, with Node.js and Git, so the job
78
+ downloads nothing more. On GitLab:
79
+
80
+ ```yaml
81
+ la-gram-git:
82
+ image: ghcr.io/linked-archi/la-gram-git:0
83
+ rules:
84
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
85
+ variables:
86
+ GIT_DEPTH: 0
87
+ script:
88
+ - git fetch --quiet origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
89
+ - la-gram-git check --base "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
90
+ after_script:
91
+ - la-gram-git diff "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" --comment
92
+ ```
93
+
94
+ On GitHub Actions, as the job's container. Keep the template's `on:` and `permissions:`:
95
+
96
+ ```yaml
97
+ jobs:
98
+ models:
99
+ runs-on: ubuntu-latest
100
+ container: ghcr.io/linked-archi/la-gram-git:0
101
+ steps:
102
+ - uses: actions/checkout@v4
103
+ with:
104
+ fetch-depth: 0
105
+ - name: Check the models
106
+ run: la-gram-git check --base "origin/${{ github.base_ref }}"
107
+ - name: Comment with their changes by element
108
+ if: always()
109
+ run: la-gram-git diff "origin/${{ github.base_ref }}" --comment
110
+ env:
111
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112
+ ```
113
+
114
+ Tags: each version (`0.1.0`), its major version (`0`) and `latest`, each for `linux/amd64` and
115
+ `linux/arm64`, so x86 and ARM runners take the image for their platform. Its tags, platforms, local use
116
+ and copying it into your own registry are described in
117
+ [the package's README](https://github.com/linked-archi/la-gram/blob/main/packages/la-gram-git/README.md#the-container-image).
118
+
119
+ ## Merging, not only checking
120
+
121
+ CI checks a merge; it does not do one. The host merges a request as text, and two changes to one model
122
+ file can conflict as text even when they changed different elements. la-gram itself merges by element
123
+ when it saves to Git, so most teams need nothing more. For people who merge with `git` on the command line,
124
+ `la-gram-git init merge-driver` sets up la-gram's merge in their clone. GitHub and gitlab.com cannot run a
125
+ merge driver when they merge a request; a self-managed GitLab can, configured by its administrator:
126
+ see [la-gram's merge driver on Gitaly](https://github.com/linked-archi/la-gram/blob/main/packages/la-gram-git/docs/gitaly.md).
@@ -0,0 +1,30 @@
1
+ # la-gram-git on GitHub Actions: checks the la-gram models a pull request
2
+ # changes, and comments with their changes by element.
3
+ # https://github.com/linked-archi/la-gram/tree/main/ci
4
+ # Copy to .github/workflows/la-gram-git.yml (`npx @linked.archi/la-gram-git init github` does).
5
+ name: la-gram models
6
+
7
+ on:
8
+ pull_request:
9
+
10
+ permissions:
11
+ contents: read
12
+ pull-requests: write # for the comment; a pull request from a fork gets none, and goes without
13
+
14
+ jobs:
15
+ models:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0 # the branch the change goes into, to compare with
21
+ - uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 22
24
+ - name: Check the models
25
+ run: npx --yes @linked.archi/la-gram-git@0 check --base "origin/${{ github.base_ref }}"
26
+ - name: Comment with their changes by element
27
+ if: always()
28
+ run: npx --yes @linked.archi/la-gram-git@0 diff "origin/${{ github.base_ref }}" --comment
29
+ env:
30
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,20 @@
1
+ # la-gram-git on GitLab CI (gitlab.com and self-managed): checks the la-gram
2
+ # models a merge request changes, and comments with their changes by element.
3
+ # https://github.com/linked-archi/la-gram/tree/main/ci
4
+ # Copy into .gitlab-ci.yml, or beside it and `include:` it
5
+ # (`npx @linked.archi/la-gram-git init gitlab` does).
6
+ #
7
+ # The comment needs a project or group access token (role Reporter, scope api)
8
+ # in a masked CI/CD variable named LA_GRAM_GIT_TOKEN: the job's own token cannot
9
+ # comment. Without it the changes are written to the job's log instead.
10
+ la-gram-git:
11
+ image: node:22
12
+ rules:
13
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
14
+ variables:
15
+ GIT_DEPTH: 0 # the branch the change goes into, to compare with
16
+ script:
17
+ - git fetch --quiet origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
18
+ - npx --yes @linked.archi/la-gram-git@0 check --base "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
19
+ after_script:
20
+ - npx --yes @linked.archi/la-gram-git@0 diff "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" --comment
package/dist/637.js ADDED
@@ -0,0 +1,51 @@
1
+ export const __webpack_esm_id__ = 637;
2
+ export const __webpack_esm_ids__ = [637];
3
+ export const __webpack_esm_modules__ = {
4
+
5
+ /***/ 637
6
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7
+
8
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
+ /* harmony export */ ElectronPlatformService: () => (/* binding */ ElectronPlatformService)
10
+ /* harmony export */ });
11
+ /* harmony import */ var _desktop_bridge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(971);
12
+
13
+ const TURTLE = [{ name: 'Turtle files', extensions: ['ttl'] }];
14
+ class ElectronPlatformService {
15
+ constructor(bridge) {
16
+ const found = bridge ?? (0,_desktop_bridge_js__WEBPACK_IMPORTED_MODULE_0__/* .desktopBridge */ .g)();
17
+ if (!found)
18
+ throw new Error('The desktop bridge (window.laGramDesktop) is not available');
19
+ this.bridge = found;
20
+ }
21
+ async readFile(path) {
22
+ const filePath = path ?? (await this.showOpenDialog());
23
+ if (!filePath) {
24
+ throw new Error('No file selected');
25
+ }
26
+ return this.bridge.readFile(filePath);
27
+ }
28
+ async writeFile(content, suggestedName) {
29
+ const filePath = await this.bridge.showSaveDialog(TURTLE, suggestedName);
30
+ if (!filePath) {
31
+ throw new Error('Save cancelled');
32
+ }
33
+ await this.bridge.writeFile(filePath, content);
34
+ }
35
+ async showOpenDialog(filters) {
36
+ return this.bridge.showOpenDialog(filters ?? TURTLE);
37
+ }
38
+ async showSaveDialog(filters) {
39
+ return this.bridge.showSaveDialog(filters ?? TURTLE);
40
+ }
41
+ isDesktop() {
42
+ return true;
43
+ }
44
+ }
45
+
46
+
47
+ /***/ }
48
+
49
+ };
50
+
51
+ //# sourceMappingURL=637.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist/637.js","mappings":";;;;;;;;;;;AAQwE;AAExE,MAAM,MAAM,GAAiB,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAEtE,MAAM,uBAAuB;IAGlC,YAAY,MAAsB;QAChC,MAAM,KAAK,GAAG,MAAM,IAAI,0EAAa,EAAE,CAAC;QACxC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAC1F,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,IAAa;QAC1B,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAe,EAAE,aAAsB;QACrD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAsB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,IAAI,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAsB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,IAAI,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sources":["webpack://la-gram/./src/platform/electron-platform-service.ts"],"sourcesContent":["/**\n * Electron desktop implementation of PlatformService.\n *\n * The renderer has no Node and no Electron modules (`electron-main.ts`): native\n * file dialogs and file access go through the preload bridge,\n * `window.laGramDesktop` (`desktop-bridge.ts`), to the main process.\n */\nimport type { PlatformService, FileFilter } from './interfaces.js';\nimport { desktopBridge, type DesktopBridge } from './desktop-bridge.js';\n\nconst TURTLE: FileFilter[] = [{ name: 'Turtle files', extensions: ['ttl'] }];\n\nexport class ElectronPlatformService implements PlatformService {\n private readonly bridge: DesktopBridge;\n\n constructor(bridge?: DesktopBridge) {\n const found = bridge ?? desktopBridge();\n if (!found) throw new Error('The desktop bridge (window.laGramDesktop) is not available');\n this.bridge = found;\n }\n\n async readFile(path?: string): Promise<{ content: string; name: string }> {\n const filePath = path ?? (await this.showOpenDialog());\n if (!filePath) {\n throw new Error('No file selected');\n }\n return this.bridge.readFile(filePath);\n }\n\n async writeFile(content: string, suggestedName?: string): Promise<void> {\n const filePath = await this.bridge.showSaveDialog(TURTLE, suggestedName);\n if (!filePath) {\n throw new Error('Save cancelled');\n }\n await this.bridge.writeFile(filePath, content);\n }\n\n async showOpenDialog(filters?: FileFilter[]): Promise<string | null> {\n return this.bridge.showOpenDialog(filters ?? TURTLE);\n }\n\n async showSaveDialog(filters?: FileFilter[]): Promise<string | null> {\n return this.bridge.showSaveDialog(filters ?? TURTLE);\n }\n\n isDesktop(): boolean {\n return true;\n }\n}\n"],"names":[],"sourceRoot":""}