fastled 1.4.7__tar.gz → 1.4.9__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 (132) hide show
  1. {fastled-1.4.7 → fastled-1.4.9}/PKG-INFO +9 -28
  2. {fastled-1.4.7 → fastled-1.4.9}/README.md +7 -25
  3. {fastled-1.4.7 → fastled-1.4.9}/install +1 -1
  4. {fastled-1.4.7 → fastled-1.4.9}/pyproject.toml +1 -5
  5. fastled-1.4.9/requirements.docker.txt +1 -0
  6. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/__init__.py +2 -4
  7. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/__version__.py +1 -1
  8. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/args.py +3 -5
  9. fastled-1.4.9/src/fastled/chrome_extension_downloader.py +207 -0
  10. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/client_server.py +4 -14
  11. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/live_client.py +0 -3
  12. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/open_browser.py +17 -15
  13. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/parse_args.py +2 -2
  14. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/playwright_browser.py +267 -216
  15. {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/PKG-INFO +9 -28
  16. {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/SOURCES.txt +1 -0
  17. {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/requires.txt +0 -2
  18. {fastled-1.4.7 → fastled-1.4.9}/tests/integration/test_playwright_integration.py +1 -7
  19. fastled-1.4.7/requirements.docker.txt +0 -1
  20. {fastled-1.4.7 → fastled-1.4.9}/.aiderignore +0 -0
  21. {fastled-1.4.7 → fastled-1.4.9}/.cursorrules +0 -0
  22. {fastled-1.4.7 → fastled-1.4.9}/.dockerignore +0 -0
  23. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/build_multi_docker_image.yml +0 -0
  24. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/build_webpage.yml +0 -0
  25. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/lint.yml +0 -0
  26. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/publish_release.yml +0 -0
  27. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/template_build_docker_image.yml +0 -0
  28. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/test_build_exe.yml +0 -0
  29. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/test_macos.yml +0 -0
  30. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/test_ubuntu.yml +0 -0
  31. {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/test_win.yml +0 -0
  32. {fastled-1.4.7 → fastled-1.4.9}/.gitignore +0 -0
  33. {fastled-1.4.7 → fastled-1.4.9}/.pylintrc +0 -0
  34. {fastled-1.4.7 → fastled-1.4.9}/.vscode/launch.json +0 -0
  35. {fastled-1.4.7 → fastled-1.4.9}/.vscode/settings.json +0 -0
  36. {fastled-1.4.7 → fastled-1.4.9}/.vscode/tasks.json +0 -0
  37. {fastled-1.4.7 → fastled-1.4.9}/DEBUGGER.md +0 -0
  38. {fastled-1.4.7 → fastled-1.4.9}/Dockerfile +0 -0
  39. {fastled-1.4.7 → fastled-1.4.9}/FAQ.md +0 -0
  40. {fastled-1.4.7 → fastled-1.4.9}/LICENSE +0 -0
  41. {fastled-1.4.7 → fastled-1.4.9}/MANIFEST.in +0 -0
  42. {fastled-1.4.7 → fastled-1.4.9}/RELEASE.md +0 -0
  43. {fastled-1.4.7 → fastled-1.4.9}/TODO.md +0 -0
  44. {fastled-1.4.7 → fastled-1.4.9}/build_exe.py +0 -0
  45. {fastled-1.4.7 → fastled-1.4.9}/build_local_docker.py +0 -0
  46. {fastled-1.4.7 → fastled-1.4.9}/build_site.py +0 -0
  47. {fastled-1.4.7 → fastled-1.4.9}/clean +0 -0
  48. {fastled-1.4.7 → fastled-1.4.9}/compiler/debug.sh +0 -0
  49. {fastled-1.4.7 → fastled-1.4.9}/compiler/run.py +0 -0
  50. {fastled-1.4.7 → fastled-1.4.9}/demo/100dots.html +0 -0
  51. {fastled-1.4.7 → fastled-1.4.9}/demo/demo_threejs.html +0 -0
  52. {fastled-1.4.7 → fastled-1.4.9}/demo/micdemo.html +0 -0
  53. {fastled-1.4.7 → fastled-1.4.9}/demo/mp3upload.html +0 -0
  54. {fastled-1.4.7 → fastled-1.4.9}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
  55. {fastled-1.4.7 → fastled-1.4.9}/docker-compose.yml +0 -0
  56. {fastled-1.4.7 → fastled-1.4.9}/entrypoint.sh +0 -0
  57. {fastled-1.4.7 → fastled-1.4.9}/install_linux.sh +0 -0
  58. {fastled-1.4.7 → fastled-1.4.9}/lint +0 -0
  59. {fastled-1.4.7 → fastled-1.4.9}/requirements.testing.txt +0 -0
  60. {fastled-1.4.7 → fastled-1.4.9}/setup.cfg +0 -0
  61. {fastled-1.4.7 → fastled-1.4.9}/setup.py +0 -0
  62. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/__main__.py +0 -0
  63. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/app.py +0 -0
  64. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/assets/example.txt +0 -0
  65. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/assets/localhost-key.pem +0 -0
  66. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/assets/localhost.pem +0 -0
  67. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/cli.py +0 -0
  68. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/cli_test.py +0 -0
  69. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/cli_test_interactive.py +0 -0
  70. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/compile_server.py +0 -0
  71. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/compile_server_impl.py +0 -0
  72. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/docker_manager.py +0 -0
  73. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/filewatcher.py +0 -0
  74. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/find_good_connection.py +0 -0
  75. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/keyboard.py +0 -0
  76. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/keyz.py +0 -0
  77. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/paths.py +0 -0
  78. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/print_filter.py +0 -0
  79. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/project_init.py +0 -0
  80. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/select_sketch_directory.py +0 -0
  81. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/server_flask.py +0 -0
  82. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/server_start.py +0 -0
  83. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/settings.py +0 -0
  84. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/site/build.py +0 -0
  85. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/site/examples.py +0 -0
  86. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/sketch.py +0 -0
  87. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/spinner.py +0 -0
  88. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/string_diff.py +0 -0
  89. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  90. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/test/examples.py +0 -0
  91. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/types.py +0 -0
  92. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/util.py +0 -0
  93. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/version.py +0 -0
  94. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/web_compile.py +0 -0
  95. {fastled-1.4.7 → fastled-1.4.9}/src/fastled/zip_files.py +0 -0
  96. {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/dependency_links.txt +0 -0
  97. {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/entry_points.txt +0 -0
  98. {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/top_level.txt +0 -0
  99. {fastled-1.4.7 → fastled-1.4.9}/test +0 -0
  100. {fastled-1.4.7 → fastled-1.4.9}/tests/integration/test_build_examples.py +0 -0
  101. {fastled-1.4.7 → fastled-1.4.9}/tests/integration/test_examples.py +0 -0
  102. {fastled-1.4.7 → fastled-1.4.9}/tests/integration/test_libcompile.py +0 -0
  103. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/html/index.html +0 -0
  104. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_api.py +0 -0
  105. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_bad_ino.py +0 -0
  106. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_banner_string.py +0 -0
  107. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_cli.py +0 -0
  108. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_cli_no_platformio.py +0 -0
  109. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_compile_server.py +0 -0
  110. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_debug_fetch_source_files.py +0 -0
  111. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_docker_linux_on_windows.py +0 -0
  112. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_embedded_data.py +0 -0
  113. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_filechanger.py +0 -0
  114. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_flask_headers.py +0 -0
  115. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_http_server.py +0 -0
  116. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/bad/bad.ino +0 -0
  117. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  118. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
  119. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  120. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  121. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  122. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_manual_api_invocation.py +0 -0
  123. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_no_platformio_compile.py +0 -0
  124. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_project_init.py +0 -0
  125. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_server_and_client_seperatly.py +0 -0
  126. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_session_compile.py +0 -0
  127. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_string_diff.py +0 -0
  128. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_string_diff_comprehensive.py +0 -0
  129. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_version.py +0 -0
  130. {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_webcompile.py +0 -0
  131. {fastled-1.4.7 → fastled-1.4.9}/upload_package.sh +0 -0
  132. {fastled-1.4.7 → fastled-1.4.9}/vscode-plugin/readme +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.4.7
3
+ Version: 1.4.9
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -22,8 +22,7 @@ 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
+ Requires-Dist: playwright>=1.40.0
27
26
  Dynamic: home-page
28
27
  Dynamic: license-file
29
28
  Dynamic: maintainer
@@ -73,34 +72,28 @@ $ cd mysketchdirectory
73
72
  $ fastled
74
73
  ```
75
74
 
76
- ## Playwright Browser Support
75
+ ## App-like Browser Support
77
76
 
78
- For enhanced browser control and automation capabilities, you can install the full version with Playwright support:
77
+ FastLED includes Playwright for enhanced browser control and automation capabilities. To use the app-like browser experience, use the `--app` flag:
79
78
 
80
79
  ```bash
81
- $ pip install fastled[full]
80
+ $ fastled --app my_sketch
82
81
  ```
83
82
 
84
- When installed, FastLED will automatically use Playwright to open your compiled sketch in a controlled browser environment instead of your system's default browser:
85
-
86
- ```bash
87
- $ fastled my_sketch
88
- ```
89
-
90
- The Playwright browser provides better automation capabilities and is especially useful for:
83
+ The `--app` flag provides better automation capabilities and is especially useful for:
91
84
  - Automated testing of your LED sketches
92
85
  - Consistent cross-platform browser behavior
93
86
  - Advanced debugging and development workflows
94
87
  - Persistent browser sessions that stay open until the FastLED process exits
95
88
 
96
89
  **Key Benefits:**
97
- - Automatically enabled when `fastled[full]` is installed - no additional flags needed
90
+ - Triggered by the `--app` flag - automatically downloads browsers if needed
98
91
  - The Playwright browser remains open throughout your development session
99
92
  - Automatic cleanup when the FastLED process exits
100
93
  - Better control over browser behavior and automation capabilities
101
94
  - Consistent behavior across different platforms
102
95
 
103
- If Playwright is not installed, the system will gracefully fall back to your default browser.
96
+ If you don't use the `--app` flag, the system will use your default browser.
104
97
 
105
98
  # Install
106
99
 
@@ -110,26 +103,14 @@ This is a python app, so any python package manager will work. We also provide p
110
103
 
111
104
  `pip install fastled`
112
105
 
113
- ### Pip with Playwright Support
114
-
115
- `pip install fastled[full]`
116
-
117
106
  ### UV
118
107
 
119
108
  `uv pip install fastled --system`
120
109
 
121
- ### UV with Playwright Support
122
-
123
- `uv pip install "fastled[full]" --system`
124
-
125
110
  ### Pipx
126
111
 
127
112
  `pipx install fastled`
128
113
 
129
- ### Pipx with Playwright Support
130
-
131
- `pipx install "fastled[full]"`
132
-
133
114
  ### Executables
134
115
 
135
116
  * Windows: https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-windows-x64.zip
@@ -371,7 +352,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
371
352
 
372
353
 
373
354
  # Revisions
374
- * 1.4.00 - Browser now uses playwright when `pip install fastled[full]` is used. Much better app like experience.
355
+ * 1.4.00 - Browser now uses playwright when `--app` flag is used. Much better app like experience.
375
356
  * 1.2.31 - Bunch of fixes and ease of use while compiling code in the repo.
376
357
  * 1.2.22 - Prefer to use `live-server` from npm. If npm exists on the system then do a background install of `live-server` for next run.
377
358
  * 1.2.20 - Fixed up path issue for web browser launch for hot reload.
@@ -43,34 +43,28 @@ $ cd mysketchdirectory
43
43
  $ fastled
44
44
  ```
45
45
 
46
- ## Playwright Browser Support
46
+ ## App-like Browser Support
47
47
 
48
- For enhanced browser control and automation capabilities, you can install the full version with Playwright support:
48
+ FastLED includes Playwright for enhanced browser control and automation capabilities. To use the app-like browser experience, use the `--app` flag:
49
49
 
50
50
  ```bash
51
- $ pip install fastled[full]
51
+ $ fastled --app my_sketch
52
52
  ```
53
53
 
54
- When installed, FastLED will automatically use Playwright to open your compiled sketch in a controlled browser environment instead of your system's default browser:
55
-
56
- ```bash
57
- $ fastled my_sketch
58
- ```
59
-
60
- The Playwright browser provides better automation capabilities and is especially useful for:
54
+ The `--app` flag provides better automation capabilities and is especially useful for:
61
55
  - Automated testing of your LED sketches
62
56
  - Consistent cross-platform browser behavior
63
57
  - Advanced debugging and development workflows
64
58
  - Persistent browser sessions that stay open until the FastLED process exits
65
59
 
66
60
  **Key Benefits:**
67
- - Automatically enabled when `fastled[full]` is installed - no additional flags needed
61
+ - Triggered by the `--app` flag - automatically downloads browsers if needed
68
62
  - The Playwright browser remains open throughout your development session
69
63
  - Automatic cleanup when the FastLED process exits
70
64
  - Better control over browser behavior and automation capabilities
71
65
  - Consistent behavior across different platforms
72
66
 
73
- If Playwright is not installed, the system will gracefully fall back to your default browser.
67
+ If you don't use the `--app` flag, the system will use your default browser.
74
68
 
75
69
  # Install
76
70
 
@@ -80,26 +74,14 @@ This is a python app, so any python package manager will work. We also provide p
80
74
 
81
75
  `pip install fastled`
82
76
 
83
- ### Pip with Playwright Support
84
-
85
- `pip install fastled[full]`
86
-
87
77
  ### UV
88
78
 
89
79
  `uv pip install fastled --system`
90
80
 
91
- ### UV with Playwright Support
92
-
93
- `uv pip install "fastled[full]" --system`
94
-
95
81
  ### Pipx
96
82
 
97
83
  `pipx install fastled`
98
84
 
99
- ### Pipx with Playwright Support
100
-
101
- `pipx install "fastled[full]"`
102
-
103
85
  ### Executables
104
86
 
105
87
  * Windows: https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-windows-x64.zip
@@ -341,7 +323,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
341
323
 
342
324
 
343
325
  # Revisions
344
- * 1.4.00 - Browser now uses playwright when `pip install fastled[full]` is used. Much better app like experience.
326
+ * 1.4.00 - Browser now uses playwright when `--app` flag is used. Much better app like experience.
345
327
  * 1.2.31 - Bunch of fixes and ease of use while compiling code in the repo.
346
328
  * 1.2.22 - Prefer to use `live-server` from npm. If npm exists on the system then do a background install of `live-server` for next run.
347
329
  * 1.2.20 - Fixed up path issue for web browser launch for hot reload.
@@ -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 .[full]
20
+ uv pip install -e .
21
21
 
22
22
  uv run pip install -r requirements.testing.txt
23
23
  uv run pip install -r requirements.docker.txt
@@ -25,15 +25,11 @@ dependencies = [
25
25
  "flask-cors>=4.0.0",
26
26
  "livereload",
27
27
  "disklru>=2.0.4",
28
+ "playwright>=1.40.0",
28
29
  ]
29
30
 
30
31
  dynamic = ["version"]
31
32
 
32
- [project.optional-dependencies]
33
- full = [
34
- "playwright>=1.40.0",
35
- ]
36
-
37
33
  [tool.setuptools]
38
34
  package-dir = {"" = "src"}
39
35
 
@@ -0,0 +1 @@
1
+ fastled-wasm-server>=1.1.18
@@ -81,7 +81,6 @@ class Api:
81
81
  int | None
82
82
  ) = None, # None means auto select a free port. -1 means no server.
83
83
  no_platformio: bool = False,
84
- no_playwright: bool = False,
85
84
  ) -> LiveClient:
86
85
  return LiveClient(
87
86
  sketch_directory=sketch_directory,
@@ -94,7 +93,6 @@ class Api:
94
93
  profile=profile,
95
94
  http_port=http_port,
96
95
  no_platformio=no_platformio,
97
- no_playwright=no_playwright,
98
96
  )
99
97
 
100
98
  @staticmethod
@@ -219,7 +217,7 @@ class Test:
219
217
  port: int | None = None,
220
218
  compile_server_port: int | None = None,
221
219
  open_browser: bool = True,
222
- no_playwright: bool = False,
220
+ app: bool = False,
223
221
  ) -> Process:
224
222
  from fastled.open_browser import spawn_http_server
225
223
 
@@ -231,7 +229,7 @@ class Test:
231
229
  port=port,
232
230
  compile_server_port=compile_server_port,
233
231
  open_browser=open_browser,
234
- no_playwright=no_playwright,
232
+ app=app,
235
233
  )
236
234
  return proc
237
235
 
@@ -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.4.7"
4
+ __version__ = "1.4.9"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
@@ -13,7 +13,7 @@ class Args:
13
13
  profile: bool
14
14
  force_compile: bool
15
15
  no_platformio: bool
16
- no_playwright: bool
16
+ app: bool # New flag to trigger Playwright browser with browser download if needed
17
17
  auto_update: bool | None
18
18
  update: bool
19
19
  localhost: bool
@@ -52,9 +52,7 @@ class Args:
52
52
  assert isinstance(
53
53
  args.no_platformio, bool
54
54
  ), f"expected bool, got {type(args.no_platformio)}"
55
- assert isinstance(
56
- args.no_playwright, bool
57
- ), f"expected bool, got {type(args.no_playwright)}"
55
+ assert isinstance(args.app, bool), f"expected bool, got {type(args.app)}"
58
56
  assert isinstance(
59
57
  args.no_auto_updates, bool | None
60
58
  ), f"expected bool | None, got {type(args.no_auto_updates)}"
@@ -87,7 +85,7 @@ class Args:
87
85
  profile=args.profile,
88
86
  force_compile=args.force_compile,
89
87
  no_platformio=args.no_platformio,
90
- no_playwright=args.no_playwright,
88
+ app=args.app,
91
89
  auto_update=not args.no_auto_updates,
92
90
  update=args.update,
93
91
  localhost=args.localhost,
@@ -0,0 +1,207 @@
1
+ """
2
+ Chrome extension downloader utility for FastLED WASM compiler.
3
+
4
+ This module provides functionality to download Chrome extensions from the
5
+ Chrome Web Store and prepare them for use with Playwright browser.
6
+ """
7
+
8
+ import os
9
+ import re
10
+ import shutil
11
+ import tempfile
12
+ import warnings
13
+ import zipfile
14
+ from pathlib import Path
15
+
16
+ import httpx
17
+
18
+
19
+ class ChromeExtensionDownloader:
20
+ """Downloads Chrome extensions from the Chrome Web Store."""
21
+
22
+ # Chrome Web Store CRX download URL
23
+ CRX_URL = "https://clients2.google.com/service/update2/crx?response=redirect&prodversion=114.0&acceptformat=crx2,crx3&x=id%3D{extension_id}%26uc"
24
+
25
+ # Modern user agent string
26
+ USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
27
+
28
+ def __init__(self, cache_dir: Path | None = None):
29
+ """Initialize the Chrome extension downloader.
30
+
31
+ Args:
32
+ cache_dir: Directory to store downloaded extensions.
33
+ Defaults to ~/.fastled/chrome-extensions
34
+ """
35
+ if cache_dir is None:
36
+ cache_dir = Path.home() / ".fastled" / "chrome-extensions"
37
+
38
+ self.cache_dir = Path(cache_dir)
39
+ self.cache_dir.mkdir(parents=True, exist_ok=True)
40
+
41
+ self.headers = {
42
+ "User-Agent": self.USER_AGENT,
43
+ "Referer": "https://chrome.google.com",
44
+ }
45
+
46
+ def extract_extension_id(self, url: str) -> str:
47
+ """Extract extension ID from Chrome Web Store URL.
48
+
49
+ Args:
50
+ url: Chrome Web Store URL
51
+
52
+ Returns:
53
+ Extension ID string
54
+
55
+ Raises:
56
+ ValueError: If URL is not a valid Chrome Web Store URL
57
+ """
58
+ # Match new Chrome Web Store URLs (chromewebstore.google.com)
59
+ new_pattern = r"chromewebstore\.google\.com/detail/[^/]+/([a-z]{32})"
60
+ match = re.search(new_pattern, url)
61
+
62
+ if match:
63
+ return match.group(1)
64
+
65
+ # Match old Chrome Web Store URLs (chrome.google.com/webstore)
66
+ old_pattern = r"chrome\.google\.com/webstore/detail/[^/]+/([a-z]{32})"
67
+ match = re.search(old_pattern, url)
68
+
69
+ if match:
70
+ return match.group(1)
71
+
72
+ # Try direct extension ID
73
+ if re.match(r"^[a-z]{32}$", url):
74
+ return url
75
+
76
+ raise ValueError(f"Invalid Chrome Web Store URL or extension ID: {url}")
77
+
78
+ def download_crx(self, extension_id: str) -> bytes:
79
+ """Download CRX file from Chrome Web Store.
80
+
81
+ Args:
82
+ extension_id: Chrome extension ID
83
+
84
+ Returns:
85
+ CRX file content as bytes
86
+
87
+ Raises:
88
+ httpx.RequestError: If download fails
89
+ """
90
+ download_url = self.CRX_URL.format(extension_id=extension_id)
91
+
92
+ with httpx.Client(follow_redirects=True) as client:
93
+ response = client.get(download_url, headers=self.headers)
94
+ response.raise_for_status()
95
+
96
+ return response.content
97
+
98
+ def extract_crx_to_directory(self, crx_content: bytes, extract_dir: Path) -> None:
99
+ """Extract CRX file content to a directory.
100
+
101
+ CRX files are essentially ZIP files with a header that needs to be removed.
102
+
103
+ Args:
104
+ crx_content: CRX file content as bytes
105
+ extract_dir: Directory to extract the extension to
106
+ """
107
+ # CRX files have a header before the ZIP content
108
+ # We need to find the ZIP header (starts with 'PK')
109
+ zip_start = crx_content.find(b"PK\x03\x04")
110
+ if zip_start == -1:
111
+ zip_start = crx_content.find(b"PK\x05\x06") # Empty ZIP
112
+
113
+ if zip_start == -1:
114
+ raise ValueError("Could not find ZIP header in CRX file")
115
+
116
+ # Extract the ZIP portion
117
+ zip_content = crx_content[zip_start:]
118
+
119
+ # Create temporary file to extract from
120
+ with tempfile.NamedTemporaryFile(suffix=".zip", delete=False) as temp_zip:
121
+ temp_zip.write(zip_content)
122
+ temp_zip_path = temp_zip.name
123
+
124
+ try:
125
+ # Extract the ZIP file
126
+ extract_dir.mkdir(parents=True, exist_ok=True)
127
+ with zipfile.ZipFile(temp_zip_path, "r") as zip_ref:
128
+ zip_ref.extractall(extract_dir)
129
+ finally:
130
+ # Clean up temporary file
131
+ os.unlink(temp_zip_path)
132
+
133
+ def get_extension_path(
134
+ self, url_or_id: str, extension_name: str | None = None
135
+ ) -> Path:
136
+ """Download and extract Chrome extension, returning the path to the extracted directory.
137
+
138
+ Args:
139
+ url_or_id: Chrome Web Store URL or extension ID
140
+ extension_name: Optional name for the extension directory
141
+
142
+ Returns:
143
+ Path to the extracted extension directory
144
+ """
145
+ extension_id = self.extract_extension_id(url_or_id)
146
+
147
+ if extension_name is None:
148
+ extension_name = extension_id
149
+
150
+ extension_dir = self.cache_dir / extension_name
151
+
152
+ # Check if extension is already downloaded and extracted
153
+ if extension_dir.exists() and (extension_dir / "manifest.json").exists():
154
+ print(f"✅ Chrome extension already cached: {extension_dir}")
155
+ return extension_dir
156
+
157
+ print(f"🔽 Downloading Chrome extension {extension_id}...")
158
+
159
+ try:
160
+ # Download the CRX file
161
+ crx_content = self.download_crx(extension_id)
162
+
163
+ # Clean up existing directory if it exists
164
+ if extension_dir.exists():
165
+ shutil.rmtree(extension_dir)
166
+
167
+ # Extract the CRX file
168
+ self.extract_crx_to_directory(crx_content, extension_dir)
169
+
170
+ # Verify extraction worked
171
+ if not (extension_dir / "manifest.json").exists():
172
+ raise ValueError("Extension extraction failed - no manifest.json found")
173
+
174
+ print(f"✅ Chrome extension downloaded and extracted: {extension_dir}")
175
+ return extension_dir
176
+
177
+ except Exception as e:
178
+ warnings.warn(f"Failed to download Chrome extension {extension_id}: {e}")
179
+ if extension_dir.exists():
180
+ shutil.rmtree(extension_dir)
181
+ raise
182
+
183
+
184
+ def download_cpp_devtools_extension() -> Path | None:
185
+ """Download the C++ DevTools Support (DWARF) extension.
186
+
187
+ Returns:
188
+ Path to the extracted extension directory, or None if download failed
189
+ """
190
+ # C++ DevTools Support (DWARF) extension
191
+ extension_url = "https://chromewebstore.google.com/detail/cc++-devtools-support-dwa/pdcpmagijalfljmkmjngeonclgbbannb"
192
+
193
+ try:
194
+ downloader = ChromeExtensionDownloader()
195
+ return downloader.get_extension_path(extension_url, "cpp-devtools-support")
196
+ except Exception as e:
197
+ warnings.warn(f"Failed to download C++ DevTools Support extension: {e}")
198
+ return None
199
+
200
+
201
+ if __name__ == "__main__":
202
+ # Test the downloader with the C++ DevTools Support extension
203
+ extension_path = download_cpp_devtools_extension()
204
+ if extension_path:
205
+ print(f"Extension downloaded to: {extension_path}")
206
+ else:
207
+ print("Failed to download extension")
@@ -25,16 +25,6 @@ from fastled.web_compile import (
25
25
  )
26
26
 
27
27
 
28
- def _always_false() -> bool:
29
- return False
30
-
31
-
32
- try:
33
- from fastled.playwright_browser import is_playwright_available
34
- except ImportError:
35
- is_playwright_available = _always_false
36
-
37
-
38
28
  def _create_error_html(error_message: str) -> str:
39
29
  return f"""<!DOCTYPE html>
40
30
  <html>
@@ -277,7 +267,7 @@ def run_client(
277
267
  ) = None, # None means auto select a free port, http_port < 0 means no server.
278
268
  clear: bool = False,
279
269
  no_platformio: bool = False,
280
- no_playwright: bool = False,
270
+ app: bool = False, # Use app-like browser experience
281
271
  ) -> int:
282
272
  has_checked_newer_version_yet = False
283
273
  compile_server: CompileServer | None = None
@@ -365,7 +355,7 @@ def run_client(
365
355
  port=http_port,
366
356
  compile_server_port=port,
367
357
  open_browser=open_web_browser,
368
- no_playwright=no_playwright,
358
+ app=app,
369
359
  )
370
360
  else:
371
361
  print("\nCompilation successful.")
@@ -531,7 +521,7 @@ def run_client_server(args: Args) -> int:
531
521
  open_web_browser = not just_compile and not interactive
532
522
  build_mode: BuildMode = BuildMode.from_args(args)
533
523
  no_platformio = bool(args.no_platformio)
534
- no_playwright = bool(args.no_playwright)
524
+ app = bool(args.app)
535
525
 
536
526
  if not force_compile and not looks_like_sketch_directory(directory):
537
527
  # if there is only one directory in the sketch directory, use that
@@ -594,7 +584,7 @@ def run_client_server(args: Args) -> int:
594
584
  profile=profile,
595
585
  clear=args.clear,
596
586
  no_platformio=no_platformio,
597
- no_playwright=no_playwright,
587
+ app=app,
598
588
  )
599
589
  except KeyboardInterrupt:
600
590
  return 1
@@ -23,7 +23,6 @@ class LiveClient:
23
23
  build_mode: BuildMode = BuildMode.QUICK,
24
24
  profile: bool = False,
25
25
  no_platformio: bool = False,
26
- no_playwright: bool = False,
27
26
  ) -> None:
28
27
  self.sketch_directory = sketch_directory
29
28
  self.host = host
@@ -37,7 +36,6 @@ class LiveClient:
37
36
  self.thread: threading.Thread | None = None
38
37
  self.auto_updates = auto_updates
39
38
  self.no_platformio = no_platformio
40
- self.no_playwright = no_playwright
41
39
  if auto_start:
42
40
  self.start()
43
41
  if self.auto_updates is False:
@@ -57,7 +55,6 @@ class LiveClient:
57
55
  shutdown=self.shutdown,
58
56
  http_port=self.http_port,
59
57
  no_platformio=self.no_platformio,
60
- no_playwright=self.no_playwright,
61
58
  )
62
59
  return rtn
63
60
 
@@ -6,16 +6,9 @@ import weakref
6
6
  from multiprocessing import Process
7
7
  from pathlib import Path
8
8
 
9
+ from fastled.playwright_browser import open_with_playwright
9
10
  from fastled.server_flask import run_flask_in_thread
10
11
 
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
12
  # Global reference to keep Playwright browser alive
20
13
  _playwright_browser_proxy = None
21
14
 
@@ -101,7 +94,7 @@ def spawn_http_server(
101
94
  compile_server_port: int,
102
95
  port: int | None = None,
103
96
  open_browser: bool = True,
104
- no_playwright: bool = False,
97
+ app: bool = False,
105
98
  ) -> Process:
106
99
 
107
100
  if port is not None and not is_port_free(port):
@@ -130,17 +123,26 @@ def spawn_http_server(
130
123
  wait_for_server(port)
131
124
  if open_browser:
132
125
  url = f"http://localhost:{port}"
133
- if (
134
- PLAYWRIGHT_AVAILABLE
135
- and open_with_playwright is not None
136
- and not no_playwright
137
- ):
126
+ should_use_playwright = app
127
+
128
+ if should_use_playwright:
129
+ if app:
130
+ # For --app mode, try to install browsers if needed
131
+ from fastled.playwright_browser import install_playwright_browsers
132
+
133
+ install_playwright_browsers()
134
+
138
135
  print(f"Opening FastLED sketch in Playwright browser: {url}")
139
136
  print(
140
137
  "Auto-resize enabled: Browser window will automatically adjust to content size"
141
138
  )
139
+ print(
140
+ "🔧 C++ DevTools Support extension will be loaded for DWARF debugging"
141
+ )
142
142
  global _playwright_browser_proxy
143
- _playwright_browser_proxy = open_with_playwright(url)
143
+ _playwright_browser_proxy = open_with_playwright(
144
+ url, enable_extensions=True
145
+ )
144
146
  else:
145
147
  print(f"Opening browser to {url}")
146
148
  import webbrowser
@@ -121,9 +121,9 @@ def parse_args() -> Args:
121
121
  help="Bypass PlatformIO constraints by using local Docker compilation with custom build environment",
122
122
  )
123
123
  parser.add_argument(
124
- "--no-playwright",
124
+ "--app",
125
125
  action="store_true",
126
- help="Disable Playwright browser and use default system browser instead",
126
+ help="Use Playwright app-like browser experience (will download browsers if needed)",
127
127
  )
128
128
  parser.add_argument(
129
129
  "-u",