@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.
- package/dist/diff/LionWebJsonDiff.d.ts.map +1 -1
- package/dist/diff/LionWebJsonDiff.js +18 -23
- package/dist/diff/LionWebJsonDiff.js.map +1 -1
- package/dist/diff/changes/ContainmentChange.d.ts +2 -2
- package/dist/diff/changes/ContainmentChange.d.ts.map +1 -1
- package/dist/diff/changes/ContainmentChange.js.map +1 -1
- package/dist/diff/changes/ReferenceChange.d.ts +3 -3
- package/dist/diff/changes/ReferenceChange.d.ts.map +1 -1
- package/dist/diff/changes/ReferenceChange.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/issues/LanguageIssues.d.ts +37 -13
- package/dist/issues/LanguageIssues.d.ts.map +1 -1
- package/dist/issues/LanguageIssues.js +49 -13
- package/dist/issues/LanguageIssues.js.map +1 -1
- package/dist/issues/ReferenceIssues.d.ts +6 -6
- package/dist/issues/ReferenceIssues.d.ts.map +1 -1
- package/dist/issues/ReferenceIssues.js +6 -6
- package/dist/issues/ReferenceIssues.js.map +1 -1
- package/dist/issues/SyntaxIssues.d.ts +9 -9
- package/dist/issues/SyntaxIssues.d.ts.map +1 -1
- package/dist/issues/SyntaxIssues.js +9 -9
- package/dist/issues/SyntaxIssues.js.map +1 -1
- package/dist/issues/ValidationIssue.d.ts +7 -1
- package/dist/issues/ValidationIssue.d.ts.map +1 -1
- package/dist/issues/ValidationIssue.js +9 -1
- package/dist/issues/ValidationIssue.js.map +1 -1
- package/dist/json/LionWebJson.d.ts +1 -14
- package/dist/json/LionWebJson.d.ts.map +1 -1
- package/dist/json/LionWebJson.js +4 -14
- package/dist/json/LionWebJson.js.map +1 -1
- package/dist/json/LionWebJsonChunkWrapper.d.ts +20 -8
- package/dist/json/LionWebJsonChunkWrapper.d.ts.map +1 -1
- package/dist/json/LionWebJsonChunkWrapper.js +50 -22
- package/dist/json/LionWebJsonChunkWrapper.js.map +1 -1
- package/dist/json/M3definitions.d.ts +176 -0
- package/dist/json/M3definitions.d.ts.map +1 -0
- package/dist/json/M3definitions.js +174 -0
- package/dist/json/M3definitions.js.map +1 -0
- package/dist/json/NodeUtils.d.ts +3 -9
- package/dist/json/NodeUtils.d.ts.map +1 -1
- package/dist/json/NodeUtils.js +18 -31
- package/dist/json/NodeUtils.js.map +1 -1
- package/dist/json/index.d.ts +1 -2
- package/dist/json/index.d.ts.map +1 -1
- package/dist/json/index.js +1 -2
- package/dist/json/index.js.map +1 -1
- package/dist/languages/CompositeLionWebLanguageWrapper.d.ts +24 -0
- package/dist/languages/CompositeLionWebLanguageWrapper.d.ts.map +1 -0
- package/dist/languages/CompositeLionWebLanguageWrapper.js +56 -0
- package/dist/languages/CompositeLionWebLanguageWrapper.js.map +1 -0
- package/dist/languages/LanguageRegistry.d.ts +19 -0
- package/dist/languages/LanguageRegistry.d.ts.map +1 -0
- package/dist/languages/LanguageRegistry.js +37 -0
- package/dist/languages/LanguageRegistry.js.map +1 -0
- package/dist/languages/LanguageUtils.d.ts +35 -0
- package/dist/languages/LanguageUtils.d.ts.map +1 -0
- package/dist/languages/LanguageUtils.js +52 -0
- package/dist/languages/LanguageUtils.js.map +1 -0
- package/dist/languages/LionCore-M3.json +2356 -0
- package/{src/json/std-builtins-copy.json → dist/languages/LionCore-builtins.json} +57 -52
- package/dist/languages/LionWebLanguageWrapper.d.ts +31 -0
- package/dist/languages/LionWebLanguageWrapper.d.ts.map +1 -0
- package/dist/languages/LionWebLanguageWrapper.js +69 -0
- package/dist/languages/LionWebLanguageWrapper.js.map +1 -0
- package/dist/languages/MetaPointerMap.d.ts +11 -0
- package/dist/languages/MetaPointerMap.d.ts.map +1 -0
- package/dist/languages/MetaPointerMap.js +39 -0
- package/dist/languages/MetaPointerMap.js.map +1 -0
- package/dist/languages/index.d.ts +3 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +3 -0
- package/dist/languages/index.js.map +1 -0
- package/dist/runners/FileUtils.d.ts +4 -4
- package/dist/runners/FileUtils.d.ts.map +1 -1
- package/dist/runners/FileUtils.js +8 -32
- package/dist/runners/FileUtils.js.map +1 -1
- package/dist/runners/RunCheckFolder.js +3 -1
- package/dist/runners/RunCheckFolder.js.map +1 -1
- package/dist/runners/RunCheckFolderWithLanguage.js +7 -3
- package/dist/runners/RunCheckFolderWithLanguage.js.map +1 -1
- package/dist/runners/RunCheckOneFile.js +3 -1
- package/dist/runners/RunCheckOneFile.js.map +1 -1
- package/dist/runners/RunCheckOneFileWithLanguage.js +12 -3
- package/dist/runners/RunCheckOneFileWithLanguage.js.map +1 -1
- package/dist/runners/Utils.d.ts.map +1 -1
- package/dist/runners/Utils.js +0 -1
- package/dist/runners/Utils.js.map +1 -1
- package/dist/util/graphs.d.ts +18 -0
- package/dist/util/graphs.d.ts.map +1 -0
- package/dist/util/graphs.js +27 -0
- package/dist/util/graphs.js.map +1 -0
- package/dist/validators/LionWebLanguageReferenceValidator.d.ts +5 -4
- package/dist/validators/LionWebLanguageReferenceValidator.d.ts.map +1 -1
- package/dist/validators/LionWebLanguageReferenceValidator.js +96 -34
- package/dist/validators/LionWebLanguageReferenceValidator.js.map +1 -1
- package/dist/validators/LionWebLanguageValidator.d.ts +15 -3
- package/dist/validators/LionWebLanguageValidator.d.ts.map +1 -1
- package/dist/validators/LionWebLanguageValidator.js +54 -21
- package/dist/validators/LionWebLanguageValidator.js.map +1 -1
- package/dist/validators/LionWebReferenceValidator.d.ts.map +1 -1
- package/dist/validators/LionWebReferenceValidator.js +0 -5
- package/dist/validators/LionWebReferenceValidator.js.map +1 -1
- package/dist/validators/LionWebSyntaxValidator.d.ts +1 -1
- package/dist/validators/LionWebSyntaxValidator.js +1 -1
- package/dist/validators/LionWebValidator.d.ts +3 -3
- package/dist/validators/LionWebValidator.d.ts.map +1 -1
- package/dist/validators/LionWebValidator.js +5 -8
- package/dist/validators/LionWebValidator.js.map +1 -1
- package/package.json +5 -5
- package/src/diff/LionWebJsonDiff.ts +18 -23
- package/src/diff/changes/ContainmentChange.ts +1 -1
- package/src/diff/changes/ReferenceChange.ts +2 -2
- package/src/index.ts +2 -0
- package/src/issues/LanguageIssues.ts +49 -14
- package/src/issues/ReferenceIssues.ts +6 -6
- package/src/issues/SyntaxIssues.ts +9 -9
- package/src/issues/ValidationIssue.ts +12 -2
- package/src/json/LionCore_M3.json +2320 -0
- package/src/json/LionCore_builtins.json +231 -0
- package/src/json/LionWebJson.ts +5 -14
- package/src/json/LionWebJsonChunkWrapper.ts +59 -30
- package/src/json/M3definitions.ts +177 -0
- package/src/json/NodeUtils.ts +21 -39
- package/src/json/index.ts +1 -2
- package/src/languages/CompositeLionWebLanguageWrapper.ts +57 -0
- package/src/languages/LanguageRegistry.ts +44 -0
- package/src/languages/LanguageUtils.ts +61 -0
- package/src/languages/LionCore-M3.json +2356 -0
- package/src/languages/LionCore-builtins.json +372 -0
- package/src/languages/LionWebLanguageWrapper.ts +95 -0
- package/src/languages/MetaPointerMap.ts +40 -0
- package/src/languages/index.ts +2 -0
- package/src/runners/FileUtils.ts +9 -36
- package/src/runners/RunCheckFolder.ts +3 -1
- package/src/runners/RunCheckFolderWithLanguage.ts +7 -7
- package/src/runners/RunCheckOneFile.ts +3 -1
- package/src/runners/RunCheckOneFileWithLanguage.ts +12 -7
- package/src/runners/Utils.ts +0 -1
- package/src/tmp.json +574 -0
- package/src/tryout.js +21 -0
- package/src/util/graphs.ts +36 -0
- package/src/validators/LionWebLanguageReferenceValidator.ts +110 -48
- package/src/validators/LionWebLanguageValidator.ts +62 -21
- package/src/validators/LionWebReferenceValidator.ts +0 -5
- package/src/validators/LionWebSyntaxValidator.ts +2 -2
- package/src/validators/LionWebValidator.ts +5 -9
- package/structure.puml +25 -0
- package/dist/json/LanguageUtils.d.ts +0 -9
- package/dist/json/LanguageUtils.d.ts.map +0 -1
- package/dist/json/LanguageUtils.js +0 -30
- package/dist/json/LanguageUtils.js.map +0 -1
- package/dist/json/LionWebLanguageDefinition.d.ts +0 -48
- package/dist/json/LionWebLanguageDefinition.d.ts.map +0 -1
- package/dist/json/LionWebLanguageDefinition.js +0 -126
- package/dist/json/LionWebLanguageDefinition.js.map +0 -1
- package/src/json/LanguageUtils.ts +0 -52
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
+
}
|