bunmicro 0.8.2 → 0.8.3
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/highlight/parser.js +9 -3
- package/src/index.js +2 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/highlight/parser.js
CHANGED
|
@@ -45,9 +45,15 @@ export async function loadSyntaxDefinitions(runtime) {
|
|
|
45
45
|
|
|
46
46
|
const definitions = [];
|
|
47
47
|
for (const file of runtime.list(1)) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
try{
|
|
49
|
+
const source = Bun.YAML.parse(await file.text());
|
|
50
|
+
const header = headers.get(file.name) ?? parseHeaderYaml(source);
|
|
51
|
+
definitions.push(new SyntaxDefinition(header, source));
|
|
52
|
+
}catch(e){
|
|
53
|
+
console.error("Failed to parse syntax yaml:",file.name)
|
|
54
|
+
console.error(" Will not highlight this kind of file")
|
|
55
|
+
console.error(" @ loadSyntaxDefinitions ")
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
return definitions;
|
|
53
59
|
}
|
package/src/index.js
CHANGED
|
@@ -4898,12 +4898,12 @@ function detectTtsCmd() {
|
|
|
4898
4898
|
}
|
|
4899
4899
|
|
|
4900
4900
|
// Linux / Android fallback: espeak-ng / espeak
|
|
4901
|
-
//
|
|
4901
|
+
// Speed: -s <wpm> (175 = normal), Pitch: -p <n> (0-99, 50 = normal)
|
|
4902
4902
|
for (const bin of ["espeak-ng", "espeak"]) {
|
|
4903
4903
|
if (runSync(["sh", "-c", `command -v ${bin}`], { stdout: "ignore", stderr: "ignore" }).ok) {
|
|
4904
4904
|
const spd = Math.round(175 * speed);
|
|
4905
4905
|
const pit = Math.max(0, Math.min(99, Math.round(50 * pitch)));
|
|
4906
|
-
return { cmd: [bin,
|
|
4906
|
+
return { cmd: [bin, '-s', spd, '-p', pit], via: "arg" };
|
|
4907
4907
|
}
|
|
4908
4908
|
}
|
|
4909
4909
|
|