bunmicro 0.8.1 → 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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.3] - 2026-06-02
4
+ - Fixed Linux failed to parse php.yaml crashes the whole program
5
+ - Fixed Linux espeak-ng args passing
6
+
7
+ ## [0.8.2] - 2026-06-02
8
+ - Fixed Windows TTS function
9
+ - Added ttslang for Windows
10
+
3
11
  ## [0.8.1] - 2026-06-02
4
12
  - Added help for prompts and actions in readme
5
13
  - Added more install guides in readme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunmicro",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "Bun JavaScript rewrite of the micro editor originally in Golang",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -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
- const source = Bun.YAML.parse(await file.text());
49
- const header = headers.get(file.name) ?? parseHeaderYaml(source);
50
- definitions.push(new SyntaxDefinition(header, source));
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
@@ -3863,6 +3863,16 @@ class App {
3863
3863
  this.message = `TTS_PITCH = ${tpv}`;
3864
3864
  break;
3865
3865
  }
3866
+ case "ttslang": {
3867
+ if (cmdArgs.length === 0) {
3868
+ this.message = `TTS_LANG = ${Bun.env.TTS_LANG ?? "zh-TW"}`;
3869
+ break;
3870
+ }
3871
+
3872
+ Bun.env.TTS_LANG = String(cmdArgs[0]);
3873
+ this.message = `TTS_LANG = ${Bun.env.TTS_LANG}`;
3874
+ break;
3875
+ }
3866
3876
  case "help": {
3867
3877
  const helpsplit = this.context?.config?.globalSettings?.helpsplit ?? "hsplit";
3868
3878
  let helpHsplit = helpsplit !== "vsplit";
@@ -4410,7 +4420,7 @@ function ansiMagenta(text) { return ansiWrap("95", text); }
4410
4420
 
4411
4421
  const COMMAND_NAMES = [
4412
4422
  "set", "setlocal", "show", "get", "open", "open!", "save", "quit", "q", "exit", "goto", "comment", "find", "replace", "replaceall",
4413
- "cd", "pwd", "tab", "run", "vsplit", "hsplit", "term", "tts", "ttsspeed", "ttspitch", "reopen", "theme", "toggle", "tog",
4423
+ "cd", "pwd", "tab", "run", "vsplit", "hsplit", "term", "tts", "ttsspeed", "ttspitch", "ttslang", "reopen", "theme", "toggle", "tog",
4414
4424
  "togglelocal", "reset", "jump", "tabmove", "tabswitch", "textfilter", "bind", "unbind", "reload", "lintlog", "act", "action", "raw",
4415
4425
  "help", "plugin", "showkey", "memusage", "retab", "eval",
4416
4426
  ];
@@ -4849,6 +4859,9 @@ function detectTtsCmd() {
4849
4859
  const speed = parseFloat(Bun.env.TTS_SPEED) || 1.5;
4850
4860
  Bun.env.TTS_PITCH = String(pitch);
4851
4861
  Bun.env.TTS_SPEED = String(speed);
4862
+
4863
+ const lang = Bun.env.TTS_LANG || 'zh-TW'
4864
+ Bun.env.TTS_LANG = lang ;
4852
4865
 
4853
4866
  if (platform === "android") {
4854
4867
  if (runSync(["sh", "-c", "command -v termux-tts-speak"], { stdout: "ignore", stderr: "ignore" }).ok)
@@ -4878,19 +4891,19 @@ function detectTtsCmd() {
4878
4891
  `$s = New-Object System.Speech.Synthesis.SpeechSynthesizer; $s.Rate = ${rate}; ` +
4879
4892
  `$t = [Console]::In.ReadToEnd(); ` +
4880
4893
  `$x = [System.Security.SecurityElement]::Escape($t); ` +
4881
- `$s.SpeakSsml('<speak version=""1.0"" xmlns=""http://www.w3.org/2001/10/synthesis""><prosody pitch=""${pitchAttr}"">' + $x + '</prosody></speak>')`;
4894
+ `$s.SpeakSsml('<speak xml:lang="${lang}" version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"><prosody pitch="${pitchAttr}">' + $x + '</prosody></speak>')`;
4882
4895
  return { cmd: [shell, "-NoProfile", "-Command", psCmd], via: "stdin" };
4883
4896
  }
4884
4897
  }
4885
4898
  }
4886
4899
 
4887
4900
  // Linux / Android fallback: espeak-ng / espeak
4888
- // --speed=<wpm> (175 = normal), --pitch=<n> (0-99, 50 = normal)
4901
+ // Speed: -s <wpm> (175 = normal), Pitch: -p <n> (0-99, 50 = normal)
4889
4902
  for (const bin of ["espeak-ng", "espeak"]) {
4890
4903
  if (runSync(["sh", "-c", `command -v ${bin}`], { stdout: "ignore", stderr: "ignore" }).ok) {
4891
4904
  const spd = Math.round(175 * speed);
4892
4905
  const pit = Math.max(0, Math.min(99, Math.round(50 * pitch)));
4893
- return { cmd: [bin, `--speed=${spd}`, `--pitch=${pit}`], via: "arg" };
4906
+ return { cmd: [bin, '-s', spd, '-p', pit], via: "arg" };
4894
4907
  }
4895
4908
  }
4896
4909