bunmicro 0.8.1 → 0.8.2

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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.2] - 2026-06-02
4
+ - Fixed Windows TTS function
5
+ - Added ttslang for Windows
6
+
3
7
  ## [0.8.1] - 2026-06-02
4
8
  - Added help for prompts and actions in readme
5
9
  - 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.2",
4
4
  "description": "Bun JavaScript rewrite of the micro editor originally in Golang",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
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,7 +4891,7 @@ 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
  }