fastled 1.3.37__tar.gz → 1.3.39__tar.gz

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.
Files changed (127) hide show
  1. {fastled-1.3.37/src/fastled.egg-info → fastled-1.3.39}/PKG-INFO +41 -1
  2. fastled-1.3.37/PKG-INFO → fastled-1.3.39/README.md +38 -28
  3. {fastled-1.3.37 → fastled-1.3.39}/install +1 -1
  4. {fastled-1.3.37 → fastled-1.3.39}/pyproject.toml +5 -0
  5. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/__version__.py +1 -1
  6. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/args.py +10 -0
  7. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/client_server.py +21 -1
  8. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/open_browser.py +57 -8
  9. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/parse_args.py +15 -0
  10. fastled-1.3.39/src/fastled/playwright_browser.py +468 -0
  11. fastled-1.3.37/README.md → fastled-1.3.39/src/fastled.egg-info/PKG-INFO +68 -0
  12. {fastled-1.3.37 → fastled-1.3.39}/src/fastled.egg-info/SOURCES.txt +2 -0
  13. {fastled-1.3.37 → fastled-1.3.39}/src/fastled.egg-info/requires.txt +3 -0
  14. fastled-1.3.39/tests/integration/test_playwright_integration.py +119 -0
  15. {fastled-1.3.37 → fastled-1.3.39}/.aiderignore +0 -0
  16. {fastled-1.3.37 → fastled-1.3.39}/.cursorrules +0 -0
  17. {fastled-1.3.37 → fastled-1.3.39}/.dockerignore +0 -0
  18. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/build_multi_docker_image.yml +0 -0
  19. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/build_webpage.yml +0 -0
  20. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/lint.yml +0 -0
  21. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/publish_release.yml +0 -0
  22. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/template_build_docker_image.yml +0 -0
  23. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/test_build_exe.yml +0 -0
  24. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/test_macos.yml +0 -0
  25. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/test_ubuntu.yml +0 -0
  26. {fastled-1.3.37 → fastled-1.3.39}/.github/workflows/test_win.yml +0 -0
  27. {fastled-1.3.37 → fastled-1.3.39}/.gitignore +0 -0
  28. {fastled-1.3.37 → fastled-1.3.39}/.pylintrc +0 -0
  29. {fastled-1.3.37 → fastled-1.3.39}/.vscode/launch.json +0 -0
  30. {fastled-1.3.37 → fastled-1.3.39}/.vscode/settings.json +0 -0
  31. {fastled-1.3.37 → fastled-1.3.39}/.vscode/tasks.json +0 -0
  32. {fastled-1.3.37 → fastled-1.3.39}/DEBUGGER.md +0 -0
  33. {fastled-1.3.37 → fastled-1.3.39}/Dockerfile +0 -0
  34. {fastled-1.3.37 → fastled-1.3.39}/FAQ.md +0 -0
  35. {fastled-1.3.37 → fastled-1.3.39}/LICENSE +0 -0
  36. {fastled-1.3.37 → fastled-1.3.39}/MANIFEST.in +0 -0
  37. {fastled-1.3.37 → fastled-1.3.39}/RELEASE.md +0 -0
  38. {fastled-1.3.37 → fastled-1.3.39}/TODO.md +0 -0
  39. {fastled-1.3.37 → fastled-1.3.39}/build_exe.py +0 -0
  40. {fastled-1.3.37 → fastled-1.3.39}/build_local_docker.py +0 -0
  41. {fastled-1.3.37 → fastled-1.3.39}/build_site.py +0 -0
  42. {fastled-1.3.37 → fastled-1.3.39}/clean +0 -0
  43. {fastled-1.3.37 → fastled-1.3.39}/compiler/debug.sh +0 -0
  44. {fastled-1.3.37 → fastled-1.3.39}/compiler/run.py +0 -0
  45. {fastled-1.3.37 → fastled-1.3.39}/demo/100dots.html +0 -0
  46. {fastled-1.3.37 → fastled-1.3.39}/demo/demo_threejs.html +0 -0
  47. {fastled-1.3.37 → fastled-1.3.39}/demo/micdemo.html +0 -0
  48. {fastled-1.3.37 → fastled-1.3.39}/demo/mp3upload.html +0 -0
  49. {fastled-1.3.37 → fastled-1.3.39}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
  50. {fastled-1.3.37 → fastled-1.3.39}/docker-compose.yml +0 -0
  51. {fastled-1.3.37 → fastled-1.3.39}/entrypoint.sh +0 -0
  52. {fastled-1.3.37 → fastled-1.3.39}/install_linux.sh +0 -0
  53. {fastled-1.3.37 → fastled-1.3.39}/lint +0 -0
  54. {fastled-1.3.37 → fastled-1.3.39}/requirements.docker.txt +0 -0
  55. {fastled-1.3.37 → fastled-1.3.39}/requirements.testing.txt +0 -0
  56. {fastled-1.3.37 → fastled-1.3.39}/setup.cfg +0 -0
  57. {fastled-1.3.37 → fastled-1.3.39}/setup.py +0 -0
  58. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/__init__.py +0 -0
  59. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/__main__.py +0 -0
  60. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/app.py +0 -0
  61. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/assets/example.txt +0 -0
  62. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/assets/localhost-key.pem +0 -0
  63. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/assets/localhost.pem +0 -0
  64. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/cli.py +0 -0
  65. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/cli_test.py +0 -0
  66. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/cli_test_interactive.py +0 -0
  67. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/compile_server.py +0 -0
  68. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/compile_server_impl.py +0 -0
  69. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/docker_manager.py +0 -0
  70. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/filewatcher.py +0 -0
  71. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/keyboard.py +0 -0
  72. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/keyz.py +0 -0
  73. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/live_client.py +0 -0
  74. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/paths.py +0 -0
  75. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/print_filter.py +0 -0
  76. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/project_init.py +0 -0
  77. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/select_sketch_directory.py +0 -0
  78. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/server_flask.py +0 -0
  79. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/server_start.py +0 -0
  80. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/settings.py +0 -0
  81. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/site/build.py +0 -0
  82. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/site/examples.py +0 -0
  83. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/sketch.py +0 -0
  84. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/spinner.py +0 -0
  85. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/string_diff.py +0 -0
  86. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  87. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/test/examples.py +0 -0
  88. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/types.py +0 -0
  89. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/util.py +0 -0
  90. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/version.py +0 -0
  91. {fastled-1.3.37 → fastled-1.3.39}/src/fastled/web_compile.py +0 -0
  92. {fastled-1.3.37 → fastled-1.3.39}/src/fastled.egg-info/dependency_links.txt +0 -0
  93. {fastled-1.3.37 → fastled-1.3.39}/src/fastled.egg-info/entry_points.txt +0 -0
  94. {fastled-1.3.37 → fastled-1.3.39}/src/fastled.egg-info/top_level.txt +0 -0
  95. {fastled-1.3.37 → fastled-1.3.39}/test +0 -0
  96. {fastled-1.3.37 → fastled-1.3.39}/tests/integration/test_build_examples.py +0 -0
  97. {fastled-1.3.37 → fastled-1.3.39}/tests/integration/test_examples.py +0 -0
  98. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/html/index.html +0 -0
  99. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_api.py +0 -0
  100. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_bad_ino.py +0 -0
  101. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_banner_string.py +0 -0
  102. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_cli.py +0 -0
  103. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_cli_no_platformio.py +0 -0
  104. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_compile_server.py +0 -0
  105. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_debug_fetch_source_files.py +0 -0
  106. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_docker_linux_on_windows.py +0 -0
  107. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_embedded_data.py +0 -0
  108. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_filechanger.py +0 -0
  109. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_flask_headers.py +0 -0
  110. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_http_server.py +0 -0
  111. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_ino/bad/bad.ino +0 -0
  112. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  113. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
  114. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  115. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  116. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  117. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_manual_api_invocation.py +0 -0
  118. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_no_platformio_compile.py +0 -0
  119. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_project_init.py +0 -0
  120. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_server_and_client_seperatly.py +0 -0
  121. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_session_compile.py +0 -0
  122. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_string_diff.py +0 -0
  123. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_string_diff_comprehensive.py +0 -0
  124. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_version.py +0 -0
  125. {fastled-1.3.37 → fastled-1.3.39}/tests/unit/test_webcompile.py +0 -0
  126. {fastled-1.3.37 → fastled-1.3.39}/upload_package.sh +0 -0
  127. {fastled-1.3.37 → fastled-1.3.39}/vscode-plugin/readme +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.37
3
+ Version: 1.3.39
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -22,6 +22,8 @@ Requires-Dist: Flask>=3.0.0
22
22
  Requires-Dist: flask-cors>=4.0.0
23
23
  Requires-Dist: livereload
24
24
  Requires-Dist: disklru>=2.0.4
25
+ Provides-Extra: full
26
+ Requires-Dist: playwright>=1.40.0; extra == "full"
25
27
  Dynamic: home-page
26
28
  Dynamic: license-file
27
29
  Dynamic: maintainer
@@ -71,7 +73,33 @@ $ cd mysketchdirectory
71
73
  $ fastled
72
74
  ```
73
75
 
76
+ ## Playwright Browser Support
74
77
 
78
+ For enhanced browser control and automation capabilities, you can install the full version with Playwright support:
79
+
80
+ ```bash
81
+ $ pip install fastled[full]
82
+ ```
83
+
84
+ This enables the `--playwright` flag which opens your compiled sketch in a Playwright-controlled browser instead of your system's default browser:
85
+
86
+ ```bash
87
+ $ fastled my_sketch --playwright
88
+ ```
89
+
90
+ The Playwright browser provides better automation capabilities and is especially useful for:
91
+ - Automated testing of your LED sketches
92
+ - Consistent cross-platform browser behavior
93
+ - Advanced debugging and development workflows
94
+ - Persistent browser sessions that stay open until the FastLED process exits
95
+
96
+ **Key Benefits:**
97
+ - The Playwright browser remains open throughout your development session
98
+ - Automatic cleanup when the FastLED process exits
99
+ - Better control over browser behavior and automation capabilities
100
+ - Consistent behavior across different platforms
101
+
102
+ If Playwright is not installed and you use the `--playwright` flag, the system will gracefully fall back to your default browser.
75
103
 
76
104
  # Install
77
105
 
@@ -81,14 +109,26 @@ This is a python app, so any python package manager will work. We also provide p
81
109
 
82
110
  `pip install fastled`
83
111
 
112
+ ### Pip with Playwright Support
113
+
114
+ `pip install fastled[full]`
115
+
84
116
  ### UV
85
117
 
86
118
  `uv pip install fastled --system`
87
119
 
120
+ ### UV with Playwright Support
121
+
122
+ `uv pip install "fastled[full]" --system`
123
+
88
124
  ### Pipx
89
125
 
90
126
  `pipx install fastled`
91
127
 
128
+ ### Pipx with Playwright Support
129
+
130
+ `pipx install "fastled[full]"`
131
+
92
132
  ### Executables
93
133
 
94
134
  * Windows: https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-windows-x64.zip
@@ -1,31 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: fastled
3
- Version: 1.3.37
4
- Summary: FastLED Wasm Compiler
5
- Home-page: https://github.com/zackees/fastled-wasm
6
- Maintainer: Zachary Vorhies
7
- License: BSD 3-Clause License
8
- Keywords: template-python-cmd
9
- Classifier: Programming Language :: Python :: 3
10
- Requires-Python: >=3.10
11
- Description-Content-Type: text/markdown
12
- License-File: LICENSE
13
- Requires-Dist: httpx>=0.28.1
14
- Requires-Dist: watchdog>=6.0.0
15
- Requires-Dist: docker>=7.1.0
16
- Requires-Dist: filelock>=3.16.1
17
- Requires-Dist: appdirs>=1.4.4
18
- Requires-Dist: rapidfuzz>=3.10.1
19
- Requires-Dist: progress>=1.6
20
- Requires-Dist: watchfiles>=1.0.5
21
- Requires-Dist: Flask>=3.0.0
22
- Requires-Dist: flask-cors>=4.0.0
23
- Requires-Dist: livereload
24
- Requires-Dist: disklru>=2.0.4
25
- Dynamic: home-page
26
- Dynamic: license-file
27
- Dynamic: maintainer
28
-
29
1
  # FastLED Wasm compiler
30
2
 
31
3
  [![Linting](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)
@@ -71,7 +43,33 @@ $ cd mysketchdirectory
71
43
  $ fastled
72
44
  ```
73
45
 
46
+ ## Playwright Browser Support
47
+
48
+ For enhanced browser control and automation capabilities, you can install the full version with Playwright support:
49
+
50
+ ```bash
51
+ $ pip install fastled[full]
52
+ ```
53
+
54
+ This enables the `--playwright` flag which opens your compiled sketch in a Playwright-controlled browser instead of your system's default browser:
55
+
56
+ ```bash
57
+ $ fastled my_sketch --playwright
58
+ ```
74
59
 
60
+ The Playwright browser provides better automation capabilities and is especially useful for:
61
+ - Automated testing of your LED sketches
62
+ - Consistent cross-platform browser behavior
63
+ - Advanced debugging and development workflows
64
+ - Persistent browser sessions that stay open until the FastLED process exits
65
+
66
+ **Key Benefits:**
67
+ - The Playwright browser remains open throughout your development session
68
+ - Automatic cleanup when the FastLED process exits
69
+ - Better control over browser behavior and automation capabilities
70
+ - Consistent behavior across different platforms
71
+
72
+ If Playwright is not installed and you use the `--playwright` flag, the system will gracefully fall back to your default browser.
75
73
 
76
74
  # Install
77
75
 
@@ -81,14 +79,26 @@ This is a python app, so any python package manager will work. We also provide p
81
79
 
82
80
  `pip install fastled`
83
81
 
82
+ ### Pip with Playwright Support
83
+
84
+ `pip install fastled[full]`
85
+
84
86
  ### UV
85
87
 
86
88
  `uv pip install fastled --system`
87
89
 
90
+ ### UV with Playwright Support
91
+
92
+ `uv pip install "fastled[full]" --system`
93
+
88
94
  ### Pipx
89
95
 
90
96
  `pipx install fastled`
91
97
 
98
+ ### Pipx with Playwright Support
99
+
100
+ `pipx install "fastled[full]"`
101
+
92
102
  ### Executables
93
103
 
94
104
  * Windows: https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-windows-x64.zip
@@ -17,7 +17,7 @@ if ! command -v uv &> /dev/null; then
17
17
  fi
18
18
 
19
19
  uv venv --python 3.11 --seed
20
- uv pip install -e .
20
+ uv pip install -e .[full]
21
21
 
22
22
  uv run pip install -r requirements.testing.txt
23
23
  uv run pip install -r requirements.docker.txt
@@ -29,6 +29,11 @@ dependencies = [
29
29
 
30
30
  dynamic = ["version"]
31
31
 
32
+ [project.optional-dependencies]
33
+ full = [
34
+ "playwright>=1.40.0",
35
+ ]
36
+
32
37
  [tool.setuptools]
33
38
  package-dir = {"" = "src"}
34
39
 
@@ -1,6 +1,6 @@
1
1
  # IMPORTANT! There's a bug in github which will REJECT any version update
2
2
  # that has any other change in the repo. Please bump the version as the
3
3
  # ONLY change in a commit, or else the pypi update and the release will fail.
4
- __version__ = "1.3.37"
4
+ __version__ = "1.3.39"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
@@ -23,6 +23,8 @@ class Args:
23
23
  quick: bool
24
24
  release: bool
25
25
  ram_disk_size: str # suffixed liked "25mb" or "1gb"
26
+ playwright: bool = False # Use Playwright browser instead of system default
27
+ no_playwright_auto_resize: bool = False # Disable Playwright auto-resize
26
28
  clear = False # Force the last running container to be removed. Useful for benchmarking.
27
29
 
28
30
  @staticmethod
@@ -66,6 +68,12 @@ class Args:
66
68
  assert isinstance(
67
69
  args.release, bool
68
70
  ), f"expected bool, got {type(args.release)}"
71
+ assert isinstance(
72
+ args.playwright, bool
73
+ ), f"expected bool, got {type(args.playwright)}"
74
+ assert isinstance(
75
+ args.no_playwright_auto_resize, bool
76
+ ), f"expected bool, got {type(args.no_playwright_auto_resize)}"
69
77
 
70
78
  init: bool | str = False
71
79
  if args.init is None:
@@ -93,4 +101,6 @@ class Args:
93
101
  quick=args.quick,
94
102
  release=args.release,
95
103
  ram_disk_size=args.ram_disk_size,
104
+ playwright=args.playwright,
105
+ no_playwright_auto_resize=args.no_playwright_auto_resize,
96
106
  )
@@ -1,4 +1,5 @@
1
1
  import shutil
2
+ import sys
2
3
  import tempfile
3
4
  import threading
4
5
  import time
@@ -67,7 +68,20 @@ def TEST_BEFORE_COMPILE(url) -> None:
67
68
  def _chunked_print(stdout: str) -> None:
68
69
  lines = stdout.splitlines()
69
70
  for line in lines:
70
- print(line)
71
+ try:
72
+ print(line)
73
+ except UnicodeEncodeError:
74
+ # On Windows, the console may not support Unicode characters
75
+ # Try to encode the line with the console's encoding and replace problematic characters
76
+ try:
77
+ console_encoding = sys.stdout.encoding or "utf-8"
78
+ encoded_line = line.encode(console_encoding, errors="replace").decode(
79
+ console_encoding
80
+ )
81
+ print(encoded_line)
82
+ except Exception:
83
+ # If all else fails, just print the line without problematic characters
84
+ print(line.encode("ascii", errors="replace").decode("ascii"))
71
85
 
72
86
 
73
87
  def _run_web_compiler(
@@ -244,6 +258,8 @@ def run_client(
244
258
  ) = None, # None means auto select a free port, http_port < 0 means no server.
245
259
  clear: bool = False,
246
260
  no_platformio: bool = False,
261
+ use_playwright: bool = False,
262
+ playwright_auto_resize: bool = True,
247
263
  ) -> int:
248
264
  has_checked_newer_version_yet = False
249
265
  compile_server: CompileServer | None = None
@@ -324,6 +340,8 @@ def run_client(
324
340
  port=http_port,
325
341
  compile_server_port=port,
326
342
  open_browser=open_web_browser,
343
+ use_playwright=use_playwright,
344
+ playwright_auto_resize=playwright_auto_resize,
327
345
  )
328
346
  else:
329
347
  print("\nCompilation successful.")
@@ -546,6 +564,8 @@ def run_client_server(args: Args) -> int:
546
564
  profile=profile,
547
565
  clear=args.clear,
548
566
  no_platformio=no_platformio,
567
+ use_playwright=args.playwright,
568
+ playwright_auto_resize=not args.no_playwright_auto_resize,
549
569
  )
550
570
  except KeyboardInterrupt:
551
571
  return 1
@@ -8,6 +8,29 @@ from pathlib import Path
8
8
 
9
9
  from fastled.server_flask import run_flask_in_thread
10
10
 
11
+ try:
12
+ from fastled.playwright_browser import is_playwright_available, open_with_playwright
13
+
14
+ PLAYWRIGHT_AVAILABLE = is_playwright_available()
15
+ except ImportError:
16
+ PLAYWRIGHT_AVAILABLE = False
17
+ open_with_playwright = None
18
+
19
+ # Global reference to keep Playwright browser alive
20
+ _playwright_browser_proxy = None
21
+
22
+
23
+ def cleanup_playwright_browser() -> None:
24
+ """Clean up the Playwright browser on exit."""
25
+ global _playwright_browser_proxy
26
+ if _playwright_browser_proxy:
27
+ _playwright_browser_proxy.close()
28
+ _playwright_browser_proxy = None
29
+
30
+
31
+ # Register cleanup function
32
+ atexit.register(cleanup_playwright_browser)
33
+
11
34
  DEFAULT_PORT = 8089 # different than live version.
12
35
  PYTHON_EXE = sys.executable
13
36
 
@@ -78,6 +101,8 @@ def spawn_http_server(
78
101
  compile_server_port: int,
79
102
  port: int | None = None,
80
103
  open_browser: bool = True,
104
+ use_playwright: bool = False,
105
+ playwright_auto_resize: bool = True,
81
106
  ) -> Process:
82
107
 
83
108
  if port is not None and not is_port_free(port):
@@ -105,14 +130,38 @@ def spawn_http_server(
105
130
 
106
131
  wait_for_server(port)
107
132
  if open_browser:
108
- print(f"Opening browser to http://localhost:{port}")
109
- import webbrowser
110
-
111
- webbrowser.open(
112
- url=f"http://localhost:{port}",
113
- new=1,
114
- autoraise=True,
115
- )
133
+ url = f"http://localhost:{port}"
134
+ if use_playwright and PLAYWRIGHT_AVAILABLE and open_with_playwright is not None:
135
+ print(f"Opening FastLED sketch in Playwright browser: {url}")
136
+ if playwright_auto_resize:
137
+ print(
138
+ "Auto-resize enabled: Browser window will automatically adjust to content size"
139
+ )
140
+ global _playwright_browser_proxy
141
+ _playwright_browser_proxy = open_with_playwright(
142
+ url, auto_resize=playwright_auto_resize
143
+ )
144
+ elif use_playwright and not PLAYWRIGHT_AVAILABLE:
145
+ print(
146
+ "Playwright requested but not available. Install with: pip install fastled[full]"
147
+ )
148
+ print(f"Falling back to system browser: {url}")
149
+ import webbrowser
150
+
151
+ webbrowser.open(
152
+ url=url,
153
+ new=1,
154
+ autoraise=True,
155
+ )
156
+ else:
157
+ print(f"Opening browser to {url}")
158
+ import webbrowser
159
+
160
+ webbrowser.open(
161
+ url=url,
162
+ new=1,
163
+ autoraise=True,
164
+ )
116
165
  return proc
117
166
 
118
167
 
@@ -35,12 +35,15 @@ FastLED WASM Compiler - Useful options:
35
35
  --profile Enable profiling the C++ build system
36
36
  --update Update the docker image for the wasm compiler
37
37
  --purge Remove all FastLED containers and images
38
+ --playwright Use Playwright browser (requires 'pip install fastled[full]')
39
+ --no-playwright-auto-resize Disable automatic window resizing in Playwright
38
40
  --version Show version information
39
41
  --help Show detailed help
40
42
  Examples:
41
43
  fastled (will auto detect the sketch directory and prompt you)
42
44
  fastled my_sketch
43
45
  fastled my_sketch --web (compiles using the web compiler only)
46
+ fastled my_sketch --playwright (opens in Playwright browser)
44
47
  fastled --init Blink (initializes a new sketch directory with the Blink example)
45
48
  fastled --server (runs the compiler server in the current directory)
46
49
 
@@ -158,6 +161,18 @@ def parse_args() -> Args:
158
161
  help="Remove all FastLED containers and images",
159
162
  )
160
163
 
164
+ parser.add_argument(
165
+ "--playwright",
166
+ action="store_true",
167
+ help="Use Playwright browser instead of system default (requires 'pip install fastled[full]')",
168
+ )
169
+
170
+ parser.add_argument(
171
+ "--no-playwright-auto-resize",
172
+ action="store_true",
173
+ help="Disable automatic window resizing in Playwright browser",
174
+ )
175
+
161
176
  build_mode = parser.add_mutually_exclusive_group()
162
177
  build_mode.add_argument("--debug", action="store_true", help="Build in debug mode")
163
178
  build_mode.add_argument(