bmad-method 6.11.1-next.26 → 6.11.1-next.27

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "bmad-method",
4
- "version": "6.11.1-next.26",
4
+ "version": "6.11.1-next.27",
5
5
  "description": "Breakthrough Method of Agile AI-driven Development",
6
6
  "keywords": [
7
7
  "agile",
@@ -34,6 +34,14 @@ def extract_key(data, dotted_key: str):
34
34
  return current
35
35
 
36
36
 
37
+ def write_json_stdout(output) -> None:
38
+ """Pin stdout to UTF-8 — a Windows cp1252 default cannot encode emoji icons."""
39
+ reconfigure = getattr(sys.stdout, "reconfigure", None)
40
+ if reconfigure is not None:
41
+ reconfigure(encoding="utf-8")
42
+ sys.stdout.write(json.dumps(output, indent=2, ensure_ascii=False) + "\n")
43
+
44
+
37
45
  def main() -> int:
38
46
  parser = argparse.ArgumentParser(
39
47
  description="Resolve BMad central config using four-layer TOML merge."
@@ -66,7 +74,7 @@ def main() -> int:
66
74
  value = extract_key(merged, key)
67
75
  if value is not _MISSING:
68
76
  output[key] = value
69
- sys.stdout.write(json.dumps(output, indent=2, ensure_ascii=False) + "\n")
77
+ write_json_stdout(output)
70
78
  return 0
71
79
 
72
80
 
@@ -1,4 +1,5 @@
1
1
  import json
2
+ import os
2
3
  import shutil
3
4
  import subprocess
4
5
  import sys
@@ -74,6 +75,33 @@ class ResolveConfigCliTests(unittest.TestCase):
74
75
  self.assertNotEqual(result.returncode, 0)
75
76
  self.assertIn("failed to parse", result.stderr)
76
77
 
78
+ def test_writes_emoji_json_when_stdout_encoding_is_cp1252(self):
79
+ with tempfile.TemporaryDirectory() as temp_dir:
80
+ root = Path(temp_dir)
81
+ (root / "_bmad").mkdir(parents=True)
82
+ (root / "_bmad" / "config.toml").write_text(
83
+ '[agents]\nname = "Analyst"\nicon = "📊"\n',
84
+ encoding="utf-8",
85
+ )
86
+
87
+ env = os.environ.copy()
88
+ env["PYTHONIOENCODING"] = "cp1252"
89
+ result = subprocess.run(
90
+ [sys.executable, str(SCRIPT), "--project-root", str(root)],
91
+ stdout=subprocess.PIPE,
92
+ stderr=subprocess.PIPE,
93
+ env=env,
94
+ check=False,
95
+ )
96
+
97
+ stderr = result.stderr.decode("utf-8", errors="replace")
98
+ self.assertEqual(result.returncode, 0, msg=stderr)
99
+
100
+ output = result.stdout.decode("utf-8")
101
+ self.assertIn("📊", output)
102
+ resolved = json.loads(output)
103
+ self.assertEqual(resolved["agents"]["icon"], "📊")
104
+
77
105
  @staticmethod
78
106
  def _run(root: Path, *args: str) -> subprocess.CompletedProcess[str]:
79
107
  return subprocess.run(