@keymanapp/kmc-model 18.0.7-alpha → 18.0.9-alpha
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
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Keyman Developer - kmc-model
|
|
2
|
+
|
|
3
|
+
This package compiles .model.ts lexical models into .model.js files. It can be
|
|
4
|
+
used from the command line with
|
|
5
|
+
[@keymanapp/kmc](https://npmjs.com/package/@keymanapp/kmc).
|
|
6
|
+
|
|
7
|
+
* [API Reference](https://help.keyman.com/developer/current-version/reference/api/kmc-model)
|
|
@@ -4,40 +4,40 @@ export declare class ModelCompilerMessageContext {
|
|
|
4
4
|
static filename: string;
|
|
5
5
|
}
|
|
6
6
|
export declare class ModelCompilerMessages {
|
|
7
|
+
static FATAL_UnexpectedException: number;
|
|
7
8
|
static Fatal_UnexpectedException: (o: {
|
|
8
9
|
e: any;
|
|
9
10
|
}) => CompilerEvent;
|
|
10
|
-
static
|
|
11
|
+
static HINT_MixedNormalizationForms: number;
|
|
11
12
|
static Hint_MixedNormalizationForms: (o: {
|
|
12
13
|
wordform: string;
|
|
13
14
|
}) => CompilerEvent;
|
|
14
|
-
static
|
|
15
|
+
static HINT_DuplicateWordInSameFile: number;
|
|
15
16
|
static Hint_DuplicateWordInSameFile: (o: {
|
|
16
17
|
wordform: string;
|
|
17
18
|
}) => CompilerEvent;
|
|
18
|
-
static
|
|
19
|
+
static ERROR_UnimplementedModelFormat: number;
|
|
19
20
|
static Error_UnimplementedModelFormat: (o: {
|
|
20
21
|
format: string;
|
|
21
22
|
}) => CompilerEvent;
|
|
22
|
-
static
|
|
23
|
+
static ERROR_UnknownModelFormat: number;
|
|
23
24
|
static Error_UnknownModelFormat: (o: {
|
|
24
25
|
format: string;
|
|
25
26
|
}) => CompilerEvent;
|
|
26
|
-
static ERROR_UnknownModelFormat: number;
|
|
27
|
-
static Error_NoDefaultExport: () => CompilerEvent;
|
|
28
27
|
static ERROR_NoDefaultExport: number;
|
|
29
|
-
static
|
|
28
|
+
static Error_NoDefaultExport: () => CompilerEvent;
|
|
30
29
|
static ERROR_SearchTermToKeyMustBeExplicitlySpecified: number;
|
|
31
|
-
static
|
|
30
|
+
static Error_SearchTermToKeyMustBeExplicitlySpecified: () => CompilerEvent;
|
|
32
31
|
static ERROR_UTF16BEUnsupported: number;
|
|
32
|
+
static Error_UTF16BEUnsupported: () => CompilerEvent;
|
|
33
|
+
static ERROR_UnknownWordBreaker: number;
|
|
33
34
|
static Error_UnknownWordBreaker: (o: {
|
|
34
35
|
spec: string;
|
|
35
36
|
}) => CompilerEvent;
|
|
36
|
-
static
|
|
37
|
+
static ERROR_UnsupportedScriptOverride: number;
|
|
37
38
|
static Error_UnsupportedScriptOverride: (o: {
|
|
38
39
|
option: string;
|
|
39
40
|
}) => CompilerEvent;
|
|
40
|
-
static ERROR_UnsupportedScriptOverride: number;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* A ModelCompilerError should be thrown when an unrecoverable error occurs that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-compiler-messages.d.ts","sourceRoot":"","sources":["../../src/model-compiler-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,aAAa,
|
|
1
|
+
{"version":3,"file":"model-compiler-messages.d.ts","sourceRoot":"","sources":["../../src/model-compiler-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,aAAa,EAAoF,MAAM,yBAAyB,CAAC;AAqBzL,qBAAa,2BAA2B;IAEtC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,qBAAqB;IAEhC,MAAM,CAAC,yBAAyB,SAAqB;IACrD,MAAM,CAAC,yBAAyB,MAAM;QAAC,CAAC,EAAE,GAAG,CAAA;KAAC,mBAAuE;IAErH,MAAM,CAAC,4BAA4B,SAAoB;IACvD,MAAM,CAAC,4BAA4B,MAAM;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,mBACuB;IAElF,MAAM,CAAC,4BAA4B,SAAoB;IACvD,MAAM,CAAC,4BAA4B,MAAM;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,mBACiB;IAE5E,MAAM,CAAC,8BAA8B,SAAqB;IAC1D,MAAM,CAAC,8BAA8B,MAAM;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,mBACT;IAElD,MAAM,CAAC,wBAAwB,SAAqB;IACpD,MAAM,CAAC,wBAAwB,MAAM;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,mBACH;IAElD,MAAM,CAAC,qBAAqB,SAAqB;IACjD,MAAM,CAAC,qBAAqB,sBACwE;IAEpG,MAAM,CAAC,8CAA8C,SAAqB;IAC1E,MAAM,CAAC,8CAA8C,sBACH;IAElD,MAAM,CAAC,wBAAwB,SAAqB;IACpD,MAAM,CAAC,wBAAwB,sBAAqE;IAEpG,MAAM,CAAC,wBAAwB,SAAqB;IACpD,MAAM,CAAC,wBAAwB,MAAM;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,mBACR;IAE1C,MAAM,CAAC,+BAA+B,SAAqB;IAC3D,MAAM,CAAC,+BAA+B,MAAM;QAAC,MAAM,EAAC,MAAM,CAAA;KAAC,mBACR;CACpD;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IACxB,KAAK,EAAE,aAAa;gBAApB,KAAK,EAAE,aAAa;CAGxC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
-
import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec } from "@keymanapp/common-types";
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b8cb416f-2af7-5482-9b22-3e8c6fc1d39e")}catch(e){}}();
|
|
2
|
+
import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec, CompilerMessageDef as def, CompilerMessageSpecWithException } from "@keymanapp/common-types";
|
|
3
3
|
const Namespace = CompilerErrorNamespace.ModelCompiler;
|
|
4
4
|
// const SevInfo = CompilerErrorSeverity.Info | Namespace;
|
|
5
5
|
const SevHint = CompilerErrorSeverity.Hint | Namespace;
|
|
6
6
|
// const SevWarn = CompilerErrorSeverity.Warn | Namespace;
|
|
7
7
|
const SevError = CompilerErrorSeverity.Error | Namespace;
|
|
8
8
|
const SevFatal = CompilerErrorSeverity.Fatal | Namespace;
|
|
9
|
-
const m = (code, message
|
|
10
|
-
...CompilerMessageSpec(code, message
|
|
9
|
+
const m = (code, message) => ({
|
|
10
|
+
...CompilerMessageSpec(code, message),
|
|
11
|
+
line: ModelCompilerMessageContext.line,
|
|
12
|
+
filename: ModelCompilerMessageContext.filename,
|
|
13
|
+
});
|
|
14
|
+
const m_e = (code, message, exceptionVar) => ({
|
|
15
|
+
...CompilerMessageSpecWithException(code, message, exceptionVar),
|
|
11
16
|
line: ModelCompilerMessageContext.line,
|
|
12
17
|
filename: ModelCompilerMessageContext.filename,
|
|
13
18
|
});
|
|
@@ -17,26 +22,26 @@ export class ModelCompilerMessageContext {
|
|
|
17
22
|
static filename;
|
|
18
23
|
}
|
|
19
24
|
export class ModelCompilerMessages {
|
|
20
|
-
static Fatal_UnexpectedException = (o) => m(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error');
|
|
21
25
|
static FATAL_UnexpectedException = SevFatal | 0x0001;
|
|
22
|
-
static
|
|
26
|
+
static Fatal_UnexpectedException = (o) => m_e(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error');
|
|
23
27
|
static HINT_MixedNormalizationForms = SevHint | 0x0002;
|
|
24
|
-
static
|
|
28
|
+
static Hint_MixedNormalizationForms = (o) => m(this.HINT_MixedNormalizationForms, `“${def(o.wordform)}” is not in Unicode NFC. Automatically converting to NFC.`);
|
|
25
29
|
static HINT_DuplicateWordInSameFile = SevHint | 0x0003;
|
|
26
|
-
static
|
|
30
|
+
static Hint_DuplicateWordInSameFile = (o) => m(this.HINT_DuplicateWordInSameFile, `duplicate word “${def(o.wordform)}” found in same file; summing counts`);
|
|
27
31
|
static ERROR_UnimplementedModelFormat = SevError | 0x0004;
|
|
28
|
-
static
|
|
32
|
+
static Error_UnimplementedModelFormat = (o) => m(this.ERROR_UnimplementedModelFormat, `Unimplemented model format: ${def(o.format)}`);
|
|
29
33
|
static ERROR_UnknownModelFormat = SevError | 0x0005;
|
|
30
|
-
static
|
|
34
|
+
static Error_UnknownModelFormat = (o) => m(this.ERROR_UnknownModelFormat, `Unimplemented model format: ${def(o.format)}`);
|
|
31
35
|
static ERROR_NoDefaultExport = SevError | 0x0006;
|
|
32
|
-
static
|
|
36
|
+
static Error_NoDefaultExport = () => m(this.ERROR_NoDefaultExport, `Model source does have a default export. Did you remember to write \`export default source;\`?`);
|
|
33
37
|
static ERROR_SearchTermToKeyMustBeExplicitlySpecified = SevError | 0x0007;
|
|
34
|
-
static
|
|
38
|
+
static Error_SearchTermToKeyMustBeExplicitlySpecified = () => m(this.ERROR_SearchTermToKeyMustBeExplicitlySpecified, "searchTermToKey must be explicitly specified");
|
|
35
39
|
static ERROR_UTF16BEUnsupported = SevError | 0x0008;
|
|
36
|
-
static
|
|
40
|
+
static Error_UTF16BEUnsupported = () => m(this.ERROR_UTF16BEUnsupported, 'UTF-16BE is unsupported');
|
|
37
41
|
static ERROR_UnknownWordBreaker = SevError | 0x0009;
|
|
38
|
-
static
|
|
42
|
+
static Error_UnknownWordBreaker = (o) => m(this.ERROR_UnknownWordBreaker, `Unknown word breaker: ${def(o.spec)}`);
|
|
39
43
|
static ERROR_UnsupportedScriptOverride = SevError | 0x000A;
|
|
44
|
+
static Error_UnsupportedScriptOverride = (o) => m(this.ERROR_UnsupportedScriptOverride, `Unsupported script override: ${def(o.option)}`);
|
|
40
45
|
}
|
|
41
46
|
;
|
|
42
47
|
/**
|
|
@@ -51,5 +56,5 @@ export class ModelCompilerError extends Error {
|
|
|
51
56
|
this.event = event;
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
|
-
//# debugId=
|
|
59
|
+
//# debugId=b8cb416f-2af7-5482-9b22-3e8c6fc1d39e
|
|
55
60
|
//# sourceMappingURL=model-compiler-messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"b8cb416f-2af7-5482-9b22-3e8c6fc1d39e","file":"model-compiler-messages.js","mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAiB,mBAAmB,EAAE,kBAAkB,IAAI,GAAG,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAEzL,MAAM,SAAS,GAAG,sBAAsB,CAAC,aAAa,CAAC;AACvD,0DAA0D;AAC1D,MAAM,OAAO,GAAG,qBAAqB,CAAC,IAAI,GAAG,SAAS,CAAC;AACvD,0DAA0D;AAC1D,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,GAAG,SAAS,CAAC;AACzD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,GAAG,SAAS,CAAC;AAEzD,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,OAAe,EAAkB,EAAE,CAAC,CAAC;IAC5D,GAAG,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC;IACrC,IAAI,EAAE,2BAA2B,CAAC,IAAI;IACtC,QAAQ,EAAE,2BAA2B,CAAC,QAAQ;CAC/C,CAAC,CAAC;AAEH,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,YAAiB,EAAkB,EAAE,CAAC,CAAC;IACjF,GAAG,gCAAgC,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,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AK,CAAe;IAEvC,CAAC;CACF","names":[],"sourceRoot":"","sources":["../../src/model-compiler-messages.ts"],"version":3}
|
package/package.json
CHANGED
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"url": "https://github.com/keymanapp/keyman/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@keymanapp/common-types": "18.0.
|
|
34
|
-
"@keymanapp/keyman-version": "18.0.
|
|
35
|
-
"@keymanapp/models-types": "18.0.
|
|
33
|
+
"@keymanapp/common-types": "18.0.9-alpha",
|
|
34
|
+
"@keymanapp/keyman-version": "18.0.9-alpha",
|
|
35
|
+
"@keymanapp/models-types": "18.0.9-alpha",
|
|
36
36
|
"typescript": "^4.9.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@keymanapp/developer-test-helpers": "18.0.
|
|
39
|
+
"@keymanapp/developer-test-helpers": "18.0.9-alpha",
|
|
40
40
|
"@types/chai": "^4.1.7",
|
|
41
41
|
"@types/mocha": "^5.2.7",
|
|
42
42
|
"@types/node": "^20.4.1",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"type": "git",
|
|
70
70
|
"url": "git+https://github.com/keymanapp/keyman.git"
|
|
71
71
|
},
|
|
72
|
-
"version": "18.0.
|
|
72
|
+
"version": "18.0.9-alpha"
|
|
73
73
|
}
|