@divvun/cg3 0.0.0-stage → 0.5.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.
- package/README.md +152 -2
- package/dist/COPYING +674 -0
- package/dist/binding.d.ts +3 -0
- package/dist/binding.js +7 -0
- package/dist/core.d.ts +37 -0
- package/dist/core.js +210 -0
- package/dist/errors.d.ts +38 -0
- package/dist/errors.js +65 -0
- package/dist/glue.d.ts +48 -0
- package/dist/glue.js +7 -0
- package/dist/grammar.d.ts +105 -0
- package/dist/grammar.js +67 -0
- package/dist/handle.d.ts +18 -0
- package/dist/handle.js +38 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +45 -0
- package/dist/logging.d.ts +24 -0
- package/dist/logging.js +36 -0
- package/dist/pkg/cg3_wasm.d.ts +83 -0
- package/dist/pkg/cg3_wasm.js +475 -0
- package/dist/pkg/cg3_wasm_bg.wasm +0 -0
- package/dist/pkg/cg3_wasm_bg.wasm.d.ts +15 -0
- package/dist/pkg/snippets/cg3-wasm-e617f80cd6086414/src/sink.js +19 -0
- package/package.json +28 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// The wrapper's sink for this module instance, an object with
|
|
2
|
+
// log(level, target, message) and panic(message). The panic hook and the
|
|
3
|
+
// tracing subscriber must be Send and Sync, so they cannot hold a JavaScript
|
|
4
|
+
// object; they call these functions, which hold it here instead. The generated
|
|
5
|
+
// glue imports this module once, so the package has one sink.
|
|
6
|
+
|
|
7
|
+
let sink = null;
|
|
8
|
+
|
|
9
|
+
export function installSink(value) {
|
|
10
|
+
sink = value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function sinkLog(level, target, message) {
|
|
14
|
+
if (sink !== null) sink.log(level, target, message);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function sinkPanic(message) {
|
|
18
|
+
if (sink !== null) sink.panic(message);
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@divvun/cg3",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "VISL CG-3 (Constraint Grammar) for JavaScript: runs compiled .cg3b grammars and gives the output vislcg3 gives, as WebAssembly for browsers, Web Workers, Deno, Node and Bun.",
|
|
5
|
+
"keywords": ["constraint-grammar", "cg3", "vislcg3", "divvun", "nlp", "linguistics", "webassembly"],
|
|
6
|
+
"license": "GPL-3.0-or-later",
|
|
7
|
+
"author": "UiT The Arctic University of Norway",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/divvun/cg3-rs.git",
|
|
11
|
+
"directory": "js/cg3"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/divvun/cg3-rs/tree/main/js/cg3#readme",
|
|
14
|
+
"bugs": "https://github.com/divvun/cg3-rs/issues",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": ["dist"],
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=20"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|