bmad-method 6.7.1-next.2 → 6.7.1-next.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/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.7.1-next.2",
4
+ "version": "6.7.1-next.3",
5
5
  "description": "Breakthrough Method of Agile AI-driven Development",
6
6
  "keywords": [
7
7
  "agile",
@@ -177,6 +177,14 @@ def extract_key(data, dotted_key: str):
177
177
  return current
178
178
 
179
179
 
180
+ def write_json_stdout(output):
181
+ """Write JSON as UTF-8 so Windows cp1252 stdout can carry emoji icons."""
182
+ reconfigure = getattr(sys.stdout, "reconfigure", None)
183
+ if reconfigure is not None:
184
+ reconfigure(encoding="utf-8")
185
+ sys.stdout.write(json.dumps(output, indent=2, ensure_ascii=False) + "\n")
186
+
187
+
180
188
  def main():
181
189
  parser = argparse.ArgumentParser(
182
190
  description="Resolve customization for a BMad skill using three-layer TOML merge.",
@@ -223,7 +231,7 @@ def main():
223
231
  else:
224
232
  output = merged
225
233
 
226
- sys.stdout.write(json.dumps(output, indent=2, ensure_ascii=False) + "\n")
234
+ write_json_stdout(output)
227
235
 
228
236
 
229
237
  if __name__ == "__main__":
@@ -0,0 +1,50 @@
1
+ import json
2
+ import os
3
+ import subprocess
4
+ import sys
5
+ import tempfile
6
+ import unittest
7
+ from pathlib import Path
8
+
9
+
10
+ SCRIPT = Path(__file__).resolve().parents[1] / "resolve_customization.py"
11
+
12
+
13
+ class ResolveCustomizationStdoutTests(unittest.TestCase):
14
+ def test_writes_emoji_json_when_stdout_encoding_is_cp1252(self):
15
+ with tempfile.TemporaryDirectory() as temp_dir:
16
+ skill_dir = Path(temp_dir) / "emoji-agent"
17
+ skill_dir.mkdir()
18
+ (skill_dir / "customize.toml").write_text(
19
+ '[agent]\nname = "Emoji Agent"\nicon = "🧭"\n',
20
+ encoding="utf-8",
21
+ )
22
+
23
+ env = os.environ.copy()
24
+ env["PYTHONIOENCODING"] = "cp1252"
25
+ result = subprocess.run(
26
+ [
27
+ sys.executable,
28
+ str(SCRIPT),
29
+ "--skill",
30
+ str(skill_dir),
31
+ "--key",
32
+ "agent",
33
+ ],
34
+ stdout=subprocess.PIPE,
35
+ stderr=subprocess.PIPE,
36
+ env=env,
37
+ check=False,
38
+ )
39
+
40
+ stderr = result.stderr.decode("utf-8", errors="replace")
41
+ self.assertEqual(result.returncode, 0, msg=stderr)
42
+
43
+ output = result.stdout.decode("utf-8")
44
+ self.assertIn("🧭", output)
45
+ resolved = json.loads(output)
46
+ self.assertEqual(resolved["agent"]["icon"], "🧭")
47
+
48
+
49
+ if __name__ == "__main__":
50
+ unittest.main()