@lionweb/validation 0.6.1-beta.0 → 0.6.1-beta.1

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 (160) hide show
  1. package/dist/diff/LionWebJsonDiff.d.ts.map +1 -1
  2. package/dist/diff/LionWebJsonDiff.js +18 -23
  3. package/dist/diff/LionWebJsonDiff.js.map +1 -1
  4. package/dist/diff/changes/ContainmentChange.d.ts +2 -2
  5. package/dist/diff/changes/ContainmentChange.d.ts.map +1 -1
  6. package/dist/diff/changes/ContainmentChange.js.map +1 -1
  7. package/dist/diff/changes/ReferenceChange.d.ts +3 -3
  8. package/dist/diff/changes/ReferenceChange.d.ts.map +1 -1
  9. package/dist/diff/changes/ReferenceChange.js.map +1 -1
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/issues/LanguageIssues.d.ts +37 -13
  15. package/dist/issues/LanguageIssues.d.ts.map +1 -1
  16. package/dist/issues/LanguageIssues.js +49 -13
  17. package/dist/issues/LanguageIssues.js.map +1 -1
  18. package/dist/issues/ReferenceIssues.d.ts +6 -6
  19. package/dist/issues/ReferenceIssues.d.ts.map +1 -1
  20. package/dist/issues/ReferenceIssues.js +6 -6
  21. package/dist/issues/ReferenceIssues.js.map +1 -1
  22. package/dist/issues/SyntaxIssues.d.ts +9 -9
  23. package/dist/issues/SyntaxIssues.d.ts.map +1 -1
  24. package/dist/issues/SyntaxIssues.js +9 -9
  25. package/dist/issues/SyntaxIssues.js.map +1 -1
  26. package/dist/issues/ValidationIssue.d.ts +7 -1
  27. package/dist/issues/ValidationIssue.d.ts.map +1 -1
  28. package/dist/issues/ValidationIssue.js +9 -1
  29. package/dist/issues/ValidationIssue.js.map +1 -1
  30. package/dist/json/LionWebJson.d.ts +1 -14
  31. package/dist/json/LionWebJson.d.ts.map +1 -1
  32. package/dist/json/LionWebJson.js +4 -14
  33. package/dist/json/LionWebJson.js.map +1 -1
  34. package/dist/json/LionWebJsonChunkWrapper.d.ts +20 -8
  35. package/dist/json/LionWebJsonChunkWrapper.d.ts.map +1 -1
  36. package/dist/json/LionWebJsonChunkWrapper.js +50 -22
  37. package/dist/json/LionWebJsonChunkWrapper.js.map +1 -1
  38. package/dist/json/M3definitions.d.ts +176 -0
  39. package/dist/json/M3definitions.d.ts.map +1 -0
  40. package/dist/json/M3definitions.js +174 -0
  41. package/dist/json/M3definitions.js.map +1 -0
  42. package/dist/json/NodeUtils.d.ts +3 -9
  43. package/dist/json/NodeUtils.d.ts.map +1 -1
  44. package/dist/json/NodeUtils.js +18 -31
  45. package/dist/json/NodeUtils.js.map +1 -1
  46. package/dist/json/index.d.ts +1 -2
  47. package/dist/json/index.d.ts.map +1 -1
  48. package/dist/json/index.js +1 -2
  49. package/dist/json/index.js.map +1 -1
  50. package/dist/languages/CompositeLionWebLanguageWrapper.d.ts +24 -0
  51. package/dist/languages/CompositeLionWebLanguageWrapper.d.ts.map +1 -0
  52. package/dist/languages/CompositeLionWebLanguageWrapper.js +56 -0
  53. package/dist/languages/CompositeLionWebLanguageWrapper.js.map +1 -0
  54. package/dist/languages/LanguageRegistry.d.ts +19 -0
  55. package/dist/languages/LanguageRegistry.d.ts.map +1 -0
  56. package/dist/languages/LanguageRegistry.js +37 -0
  57. package/dist/languages/LanguageRegistry.js.map +1 -0
  58. package/dist/languages/LanguageUtils.d.ts +35 -0
  59. package/dist/languages/LanguageUtils.d.ts.map +1 -0
  60. package/dist/languages/LanguageUtils.js +52 -0
  61. package/dist/languages/LanguageUtils.js.map +1 -0
  62. package/dist/languages/LionCore-M3.json +2356 -0
  63. package/{src/json/std-builtins-copy.json → dist/languages/LionCore-builtins.json} +57 -52
  64. package/dist/languages/LionWebLanguageWrapper.d.ts +31 -0
  65. package/dist/languages/LionWebLanguageWrapper.d.ts.map +1 -0
  66. package/dist/languages/LionWebLanguageWrapper.js +69 -0
  67. package/dist/languages/LionWebLanguageWrapper.js.map +1 -0
  68. package/dist/languages/MetaPointerMap.d.ts +11 -0
  69. package/dist/languages/MetaPointerMap.d.ts.map +1 -0
  70. package/dist/languages/MetaPointerMap.js +39 -0
  71. package/dist/languages/MetaPointerMap.js.map +1 -0
  72. package/dist/languages/index.d.ts +3 -0
  73. package/dist/languages/index.d.ts.map +1 -0
  74. package/dist/languages/index.js +3 -0
  75. package/dist/languages/index.js.map +1 -0
  76. package/dist/runners/FileUtils.d.ts +4 -4
  77. package/dist/runners/FileUtils.d.ts.map +1 -1
  78. package/dist/runners/FileUtils.js +8 -32
  79. package/dist/runners/FileUtils.js.map +1 -1
  80. package/dist/runners/RunCheckFolder.js +3 -1
  81. package/dist/runners/RunCheckFolder.js.map +1 -1
  82. package/dist/runners/RunCheckFolderWithLanguage.js +7 -3
  83. package/dist/runners/RunCheckFolderWithLanguage.js.map +1 -1
  84. package/dist/runners/RunCheckOneFile.js +3 -1
  85. package/dist/runners/RunCheckOneFile.js.map +1 -1
  86. package/dist/runners/RunCheckOneFileWithLanguage.js +12 -3
  87. package/dist/runners/RunCheckOneFileWithLanguage.js.map +1 -1
  88. package/dist/runners/Utils.d.ts.map +1 -1
  89. package/dist/runners/Utils.js +0 -1
  90. package/dist/runners/Utils.js.map +1 -1
  91. package/dist/util/graphs.d.ts +18 -0
  92. package/dist/util/graphs.d.ts.map +1 -0
  93. package/dist/util/graphs.js +27 -0
  94. package/dist/util/graphs.js.map +1 -0
  95. package/dist/validators/LionWebLanguageReferenceValidator.d.ts +5 -4
  96. package/dist/validators/LionWebLanguageReferenceValidator.d.ts.map +1 -1
  97. package/dist/validators/LionWebLanguageReferenceValidator.js +96 -34
  98. package/dist/validators/LionWebLanguageReferenceValidator.js.map +1 -1
  99. package/dist/validators/LionWebLanguageValidator.d.ts +15 -3
  100. package/dist/validators/LionWebLanguageValidator.d.ts.map +1 -1
  101. package/dist/validators/LionWebLanguageValidator.js +54 -21
  102. package/dist/validators/LionWebLanguageValidator.js.map +1 -1
  103. package/dist/validators/LionWebReferenceValidator.d.ts.map +1 -1
  104. package/dist/validators/LionWebReferenceValidator.js +0 -5
  105. package/dist/validators/LionWebReferenceValidator.js.map +1 -1
  106. package/dist/validators/LionWebSyntaxValidator.d.ts +1 -1
  107. package/dist/validators/LionWebSyntaxValidator.js +1 -1
  108. package/dist/validators/LionWebValidator.d.ts +3 -3
  109. package/dist/validators/LionWebValidator.d.ts.map +1 -1
  110. package/dist/validators/LionWebValidator.js +5 -8
  111. package/dist/validators/LionWebValidator.js.map +1 -1
  112. package/package.json +5 -5
  113. package/src/diff/LionWebJsonDiff.ts +18 -23
  114. package/src/diff/changes/ContainmentChange.ts +1 -1
  115. package/src/diff/changes/ReferenceChange.ts +2 -2
  116. package/src/index.ts +2 -0
  117. package/src/issues/LanguageIssues.ts +49 -14
  118. package/src/issues/ReferenceIssues.ts +6 -6
  119. package/src/issues/SyntaxIssues.ts +9 -9
  120. package/src/issues/ValidationIssue.ts +12 -2
  121. package/src/json/LionCore_M3.json +2320 -0
  122. package/src/json/LionCore_builtins.json +231 -0
  123. package/src/json/LionWebJson.ts +5 -14
  124. package/src/json/LionWebJsonChunkWrapper.ts +59 -30
  125. package/src/json/M3definitions.ts +177 -0
  126. package/src/json/NodeUtils.ts +21 -39
  127. package/src/json/index.ts +1 -2
  128. package/src/languages/CompositeLionWebLanguageWrapper.ts +57 -0
  129. package/src/languages/LanguageRegistry.ts +44 -0
  130. package/src/languages/LanguageUtils.ts +61 -0
  131. package/src/languages/LionCore-M3.json +2356 -0
  132. package/src/languages/LionCore-builtins.json +372 -0
  133. package/src/languages/LionWebLanguageWrapper.ts +95 -0
  134. package/src/languages/MetaPointerMap.ts +40 -0
  135. package/src/languages/index.ts +2 -0
  136. package/src/runners/FileUtils.ts +9 -36
  137. package/src/runners/RunCheckFolder.ts +3 -1
  138. package/src/runners/RunCheckFolderWithLanguage.ts +7 -7
  139. package/src/runners/RunCheckOneFile.ts +3 -1
  140. package/src/runners/RunCheckOneFileWithLanguage.ts +12 -7
  141. package/src/runners/Utils.ts +0 -1
  142. package/src/tmp.json +574 -0
  143. package/src/tryout.js +21 -0
  144. package/src/util/graphs.ts +36 -0
  145. package/src/validators/LionWebLanguageReferenceValidator.ts +110 -48
  146. package/src/validators/LionWebLanguageValidator.ts +62 -21
  147. package/src/validators/LionWebReferenceValidator.ts +0 -5
  148. package/src/validators/LionWebSyntaxValidator.ts +2 -2
  149. package/src/validators/LionWebValidator.ts +5 -9
  150. package/structure.puml +25 -0
  151. package/dist/json/LanguageUtils.d.ts +0 -9
  152. package/dist/json/LanguageUtils.d.ts.map +0 -1
  153. package/dist/json/LanguageUtils.js +0 -30
  154. package/dist/json/LanguageUtils.js.map +0 -1
  155. package/dist/json/LionWebLanguageDefinition.d.ts +0 -48
  156. package/dist/json/LionWebLanguageDefinition.d.ts.map +0 -1
  157. package/dist/json/LionWebLanguageDefinition.js +0 -126
  158. package/dist/json/LionWebLanguageDefinition.js.map +0 -1
  159. package/src/json/LanguageUtils.ts +0 -52
  160. package/src/json/LionWebLanguageDefinition.ts +0 -144
@@ -11,22 +11,22 @@ export abstract class Syntax_PropertyIssue extends ValidationIssue {
11
11
  }
12
12
 
13
13
  export class Syntax_PropertyMissingIssue extends Syntax_PropertyIssue {
14
- readonly id = "PropertyMissing"
14
+ readonly issueType = "PropertyMissing"
15
15
  protected msg = () => `Property "${this.property}" is missing`
16
16
  }
17
17
 
18
18
  export class Syntax_PropertyUnknownIssue extends Syntax_PropertyIssue {
19
- readonly id = "PropertyUnknown"
19
+ readonly issueType = "PropertyUnknown"
20
20
  protected msg = () => `Property "${this.property}" is not defined as a LionWeb property`
21
21
  }
22
22
 
23
23
  export class Syntax_PropertyNullIssue extends Syntax_PropertyIssue {
24
- readonly id = "PropertyNull"
24
+ readonly issueType = "PropertyNull"
25
25
  protected msg = () => `Property "${this.property}" is null, but it should have a value`
26
26
  }
27
27
 
28
28
  export class Syntax_PropertyTypeIssue extends Syntax_PropertyIssue {
29
- readonly id = "PropertyTypeIncorrect"
29
+ readonly issueType = "PropertyTypeIncorrect"
30
30
 
31
31
  constructor(
32
32
  context: JsonContext,
@@ -41,7 +41,7 @@ export class Syntax_PropertyTypeIssue extends Syntax_PropertyIssue {
41
41
  }
42
42
 
43
43
  export class Syntax_ArrayContainsNull_Issue extends Syntax_PropertyIssue {
44
- readonly id = "ArrayContainsNull"
44
+ readonly issueType = "ArrayContainsNull"
45
45
 
46
46
  constructor(
47
47
  context: JsonContext,
@@ -64,21 +64,21 @@ export abstract class Syntax_IncorrectFormat_Issue extends ValidationIssue {
64
64
  }
65
65
 
66
66
  export class Syntax_SerializationFormatVersion_Issue extends Syntax_IncorrectFormat_Issue {
67
- readonly id = "SerializationFormatVersion"
67
+ readonly issueType = "SerializationFormatVersion"
68
68
  protected msg = () => `SerializationFormatVersion "${this.value}" is not a number`
69
69
  }
70
70
 
71
71
  export class Syntax_VersionFormat_Issue extends Syntax_IncorrectFormat_Issue {
72
- readonly id = "VersionFormat"
72
+ readonly issueType = "VersionFormat"
73
73
  protected msg = () => `Version "${this.value}" is an empty string.`
74
74
  }
75
75
 
76
76
  export class Syntax_KeyFormat_Issue extends Syntax_IncorrectFormat_Issue {
77
- readonly id = "KeyFormat"
77
+ readonly issueType = "KeyFormat"
78
78
  protected msg = () => `Key "${this.value}" has incorrect format.`
79
79
  }
80
80
 
81
81
  export class Syntax_IdFormat_Issue extends Syntax_IncorrectFormat_Issue {
82
- readonly id = "IdFormat"
82
+ readonly issueType = "IdFormat"
83
83
  protected msg = () => `Id "${this.value}" has incorrect format.`
84
84
  }
@@ -1,7 +1,7 @@
1
1
  import { JsonContext } from "../json/JsonContext.js"
2
2
 
3
3
  export abstract class ValidationIssue {
4
- abstract readonly id: string
4
+ abstract readonly issueType: string
5
5
  context: JsonContext
6
6
 
7
7
  constructor(context: JsonContext) {
@@ -11,6 +11,16 @@ export abstract class ValidationIssue {
11
11
  protected abstract msg(): string
12
12
 
13
13
  public errorMsg(): string {
14
- return `${this.id}: ${this.msg()} at ${this.context.toString()} `
14
+ return `${this.issueType}: ${this.msg()} at ${this.context.toString()} `
15
15
  }
16
16
  }
17
+
18
+ export class GenericIssue extends ValidationIssue {
19
+ readonly issueType = "GenericIssue"
20
+
21
+ constructor(context: JsonContext, public text: string) {
22
+ super(context)
23
+ }
24
+
25
+ protected msg = () => this.text
26
+ }