@tenzir/codemirror-lang-tql 0.3.2 → 0.4.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/index.cjs +94 -17
- package/dist/index.js +95 -18
- package/output.js +426 -284
- package/package.json +5 -4
- package/scripts/index.js +18 -5
package/package.json
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.4.1",
|
|
11
11
|
"description": "Tenzir Query Language (TQL) support for CodeMirror",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "lezer-generator src/
|
|
14
|
-
"build-debug": "lezer-generator src/
|
|
13
|
+
"build": "lezer-generator src/tql.grammar -o src/parser && rollup -c",
|
|
14
|
+
"build-debug": "lezer-generator src/tql.grammar --names -o src/parser && rollup -c",
|
|
15
15
|
"test": "mocha test/test.js"
|
|
16
16
|
},
|
|
17
17
|
"type": "module",
|
|
@@ -39,5 +39,6 @@
|
|
|
39
39
|
"rollup-plugin-ts": "^3.0.2",
|
|
40
40
|
"typescript": "^4.3.4"
|
|
41
41
|
},
|
|
42
|
-
"license": "MIT"
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
43
44
|
}
|
package/scripts/index.js
CHANGED
|
@@ -31,12 +31,27 @@ const processFile = async (filePath) => {
|
|
|
31
31
|
let detail = undefined;
|
|
32
32
|
let infoArr = [];
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
let i = 0;
|
|
35
|
+
while (i < lines.length) {
|
|
36
|
+
if (lines[i].startsWith("---")) {
|
|
37
|
+
i++;
|
|
38
|
+
while (!lines[i].startsWith("---")) {
|
|
39
|
+
i++;
|
|
40
|
+
}
|
|
41
|
+
i++;
|
|
42
|
+
} else if (lines[i].trim() === "" || lines[i].startsWith("#")) {
|
|
43
|
+
i++;
|
|
44
|
+
} else {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
while (i < lines.length) {
|
|
35
49
|
if (detail == undefined && lines[i].trim() !== "") {
|
|
36
50
|
detail = lines[i];
|
|
37
51
|
} else if (detail != null) {
|
|
38
52
|
infoArr.push(lines[i]);
|
|
39
53
|
}
|
|
54
|
+
i++;
|
|
40
55
|
}
|
|
41
56
|
let info = infoArr.join("\n");
|
|
42
57
|
|
|
@@ -74,9 +89,7 @@ const processDirectory = async (directoryPath, outputPath) => {
|
|
|
74
89
|
// ignore files that are not inside sources, transformations, or sinks subdirectories
|
|
75
90
|
// TODO: this is a hacky way to do this, but it works for now
|
|
76
91
|
if (
|
|
77
|
-
!file.includes("
|
|
78
|
-
!file.includes("transformations") &&
|
|
79
|
-
!file.includes("sinks")
|
|
92
|
+
!file.includes("/operators/")
|
|
80
93
|
) {
|
|
81
94
|
continue;
|
|
82
95
|
}
|
|
@@ -92,7 +105,7 @@ const processDirectory = async (directoryPath, outputPath) => {
|
|
|
92
105
|
|
|
93
106
|
await writeFile(
|
|
94
107
|
outputPath,
|
|
95
|
-
`export const data = ${JSON.stringify(output)};`,
|
|
108
|
+
`export const data = ${JSON.stringify(output, undefined, 2)};`,
|
|
96
109
|
"utf8",
|
|
97
110
|
);
|
|
98
111
|
} catch (err) {
|