fastled 1.4.7__tar.gz → 1.4.8__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.
- {fastled-1.4.7 → fastled-1.4.8}/PKG-INFO +9 -28
- {fastled-1.4.7 → fastled-1.4.8}/README.md +7 -25
- {fastled-1.4.7 → fastled-1.4.8}/install +1 -1
- {fastled-1.4.7 → fastled-1.4.8}/pyproject.toml +1 -5
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/__init__.py +2 -4
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/__version__.py +1 -1
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/args.py +3 -5
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/client_server.py +4 -14
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/live_client.py +0 -3
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/open_browser.py +11 -14
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/parse_args.py +2 -2
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/playwright_browser.py +20 -66
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled.egg-info/PKG-INFO +9 -28
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled.egg-info/requires.txt +0 -2
- {fastled-1.4.7 → fastled-1.4.8}/tests/integration/test_playwright_integration.py +1 -7
- {fastled-1.4.7 → fastled-1.4.8}/.aiderignore +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.cursorrules +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.dockerignore +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/build_multi_docker_image.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/build_webpage.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/lint.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/publish_release.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/template_build_docker_image.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/test_build_exe.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/test_macos.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/test_ubuntu.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.github/workflows/test_win.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.gitignore +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.pylintrc +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.vscode/launch.json +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.vscode/settings.json +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/.vscode/tasks.json +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/DEBUGGER.md +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/Dockerfile +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/FAQ.md +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/LICENSE +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/MANIFEST.in +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/RELEASE.md +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/TODO.md +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/build_exe.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/build_local_docker.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/build_site.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/clean +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/compiler/debug.sh +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/compiler/run.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/demo/100dots.html +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/demo/demo_threejs.html +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/demo/micdemo.html +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/demo/mp3upload.html +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/docker-compose.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/entrypoint.sh +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/install_linux.sh +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/lint +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/requirements.docker.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/requirements.testing.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/setup.cfg +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/setup.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/__main__.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/app.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/assets/example.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/assets/localhost-key.pem +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/assets/localhost.pem +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/cli.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/cli_test.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/cli_test_interactive.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/compile_server.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/compile_server_impl.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/docker_manager.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/filewatcher.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/find_good_connection.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/keyboard.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/keyz.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/paths.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/print_filter.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/project_init.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/select_sketch_directory.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/server_flask.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/server_start.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/settings.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/site/build.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/site/examples.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/sketch.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/spinner.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/string_diff.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/test/can_run_local_docker_tests.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/test/examples.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/types.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/util.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/version.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/web_compile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled/zip_files.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled.egg-info/SOURCES.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled.egg-info/dependency_links.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled.egg-info/entry_points.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/src/fastled.egg-info/top_level.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/test +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/integration/test_build_examples.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/integration/test_examples.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/integration/test_libcompile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/html/index.html +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_api.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_bad_ino.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_banner_string.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_cli.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_cli_no_platformio.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_compile_server.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_debug_fetch_source_files.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_docker_linux_on_windows.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_embedded_data.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_filechanger.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_flask_headers.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_http_server.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_ino/bad/bad.ino +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_ino/embedded/wasm.ino +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_ino/wasm/wasm.ino +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_manual_api_invocation.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_no_platformio_compile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_project_init.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_server_and_client_seperatly.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_session_compile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_string_diff.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_string_diff_comprehensive.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_version.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/tests/unit/test_webcompile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/upload_package.sh +0 -0
- {fastled-1.4.7 → fastled-1.4.8}/vscode-plugin/readme +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.8
|
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
|
-
|
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
|
-
##
|
75
|
+
## App-like Browser Support
|
77
76
|
|
78
|
-
|
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
|
-
$
|
80
|
+
$ fastled --app my_sketch
|
82
81
|
```
|
83
82
|
|
84
|
-
|
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
|
-
-
|
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
|
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 `
|
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
|
-
##
|
46
|
+
## App-like Browser Support
|
47
47
|
|
48
|
-
|
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
|
-
$
|
51
|
+
$ fastled --app my_sketch
|
52
52
|
```
|
53
53
|
|
54
|
-
|
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
|
-
-
|
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
|
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 `
|
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.
|
@@ -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
|
|
@@ -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
|
-
|
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
|
-
|
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.
|
4
|
+
__version__ = "1.4.8"
|
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
|
-
|
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
|
-
|
88
|
+
app=args.app,
|
91
89
|
auto_update=not args.no_auto_updates,
|
92
90
|
update=args.update,
|
93
91
|
localhost=args.localhost,
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
97
|
+
app: bool = False,
|
105
98
|
) -> Process:
|
106
99
|
|
107
100
|
if port is not None and not is_port_free(port):
|
@@ -130,11 +123,15 @@ def spawn_http_server(
|
|
130
123
|
wait_for_server(port)
|
131
124
|
if open_browser:
|
132
125
|
url = f"http://localhost:{port}"
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
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"
|
@@ -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
|
-
"--
|
124
|
+
"--app",
|
125
125
|
action="store_true",
|
126
|
-
help="
|
126
|
+
help="Use Playwright app-like browser experience (will download browsers if needed)",
|
127
127
|
)
|
128
128
|
parser.add_argument(
|
129
129
|
"-u",
|
@@ -18,21 +18,6 @@ from typing import Any
|
|
18
18
|
PLAYWRIGHT_DIR = Path.home() / ".fastled" / "playwright"
|
19
19
|
PLAYWRIGHT_DIR.mkdir(parents=True, exist_ok=True)
|
20
20
|
|
21
|
-
try:
|
22
|
-
from playwright.async_api import Browser, Page, async_playwright
|
23
|
-
|
24
|
-
PLAYWRIGHT_AVAILABLE = True
|
25
|
-
except ImportError:
|
26
|
-
PLAYWRIGHT_AVAILABLE = False
|
27
|
-
async_playwright = None
|
28
|
-
Browser = None
|
29
|
-
Page = None
|
30
|
-
|
31
|
-
|
32
|
-
def is_playwright_available() -> bool:
|
33
|
-
"""Check if Playwright is available."""
|
34
|
-
return PLAYWRIGHT_AVAILABLE
|
35
|
-
|
36
21
|
|
37
22
|
def get_chromium_executable_path() -> str | None:
|
38
23
|
"""Get the path to the custom Chromium executable if it exists."""
|
@@ -73,10 +58,6 @@ class PlaywrightBrowser:
|
|
73
58
|
Args:
|
74
59
|
headless: Whether to run the browser in headless mode
|
75
60
|
"""
|
76
|
-
if not is_playwright_available():
|
77
|
-
raise ImportError(
|
78
|
-
"Playwright is not installed. Install with: pip install fastled[full]"
|
79
|
-
)
|
80
61
|
|
81
62
|
self.headless = headless
|
82
63
|
self.auto_resize = True # Always enable auto-resize
|
@@ -137,32 +118,28 @@ class PlaywrightBrowser:
|
|
137
118
|
async def start(self) -> None:
|
138
119
|
"""Start the Playwright browser."""
|
139
120
|
if self.browser is None:
|
140
|
-
if is_playwright_available():
|
141
|
-
from playwright.async_api import async_playwright
|
142
|
-
|
143
|
-
self.playwright = async_playwright()
|
144
|
-
playwright = await self.playwright.start()
|
145
|
-
|
146
|
-
# Get custom Chromium executable path if available
|
147
|
-
executable_path = get_chromium_executable_path()
|
148
|
-
launch_kwargs = {
|
149
|
-
"headless": self.headless,
|
150
|
-
"args": [
|
151
|
-
"--disable-dev-shm-usage",
|
152
|
-
"--disable-web-security",
|
153
|
-
"--allow-running-insecure-content",
|
154
|
-
],
|
155
|
-
}
|
156
121
|
|
157
|
-
|
158
|
-
launch_kwargs["executable_path"] = executable_path
|
159
|
-
print(
|
160
|
-
f"[PYTHON] Using custom Chromium executable: {executable_path}"
|
161
|
-
)
|
122
|
+
from playwright.async_api import async_playwright
|
162
123
|
|
163
|
-
|
164
|
-
|
165
|
-
|
124
|
+
self.playwright = async_playwright()
|
125
|
+
playwright = await self.playwright.start()
|
126
|
+
|
127
|
+
# Get custom Chromium executable path if available
|
128
|
+
executable_path = get_chromium_executable_path()
|
129
|
+
launch_kwargs = {
|
130
|
+
"headless": self.headless,
|
131
|
+
"args": [
|
132
|
+
"--disable-dev-shm-usage",
|
133
|
+
"--disable-web-security",
|
134
|
+
"--allow-running-insecure-content",
|
135
|
+
],
|
136
|
+
}
|
137
|
+
|
138
|
+
if executable_path:
|
139
|
+
launch_kwargs["executable_path"] = executable_path
|
140
|
+
print(f"[PYTHON] Using custom Chromium executable: {executable_path}")
|
141
|
+
|
142
|
+
self.browser = await playwright.chromium.launch(**launch_kwargs)
|
166
143
|
|
167
144
|
if self.page is None and self.browser is not None:
|
168
145
|
# Detect system device scale factor for natural browser behavior
|
@@ -378,15 +355,6 @@ def run_playwright_browser(url: str, headless: bool = False) -> None:
|
|
378
355
|
url: The URL to open
|
379
356
|
headless: Whether to run in headless mode
|
380
357
|
"""
|
381
|
-
if not is_playwright_available():
|
382
|
-
warnings.warn(
|
383
|
-
"Playwright is not installed. Install with: pip install fastled[full]. "
|
384
|
-
"Falling back to default browser."
|
385
|
-
)
|
386
|
-
import webbrowser
|
387
|
-
|
388
|
-
webbrowser.open(url)
|
389
|
-
return
|
390
358
|
|
391
359
|
async def main():
|
392
360
|
browser = None
|
@@ -452,16 +420,6 @@ class PlaywrightBrowserProxy:
|
|
452
420
|
url: The URL to open
|
453
421
|
headless: Whether to run in headless mode
|
454
422
|
"""
|
455
|
-
if not is_playwright_available():
|
456
|
-
warnings.warn(
|
457
|
-
"Playwright is not installed. Install with: pip install fastled[full]. "
|
458
|
-
"Falling back to default browser."
|
459
|
-
)
|
460
|
-
# Fall back to default browser
|
461
|
-
import webbrowser
|
462
|
-
|
463
|
-
webbrowser.open(url)
|
464
|
-
return
|
465
423
|
|
466
424
|
try:
|
467
425
|
# Run Playwright in a separate process to avoid blocking
|
@@ -538,8 +496,6 @@ def run_playwright_browser_persistent(url: str, headless: bool = False) -> None:
|
|
538
496
|
url: The URL to open
|
539
497
|
headless: Whether to run in headless mode
|
540
498
|
"""
|
541
|
-
if not is_playwright_available():
|
542
|
-
return
|
543
499
|
|
544
500
|
async def main():
|
545
501
|
browser = None
|
@@ -621,8 +577,6 @@ def install_playwright_browsers() -> bool:
|
|
621
577
|
Returns:
|
622
578
|
True if installation was successful or browsers were already installed
|
623
579
|
"""
|
624
|
-
if not PLAYWRIGHT_AVAILABLE:
|
625
|
-
return False
|
626
580
|
|
627
581
|
try:
|
628
582
|
import os
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.8
|
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
|
-
|
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
|
-
##
|
75
|
+
## App-like Browser Support
|
77
76
|
|
78
|
-
|
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
|
-
$
|
80
|
+
$ fastled --app my_sketch
|
82
81
|
```
|
83
82
|
|
84
|
-
|
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
|
-
-
|
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
|
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 `
|
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.
|
@@ -5,18 +5,12 @@ Unit tests for Playwright integration.
|
|
5
5
|
import unittest
|
6
6
|
from unittest.mock import MagicMock, patch
|
7
7
|
|
8
|
-
from fastled.playwright_browser import
|
8
|
+
from fastled.playwright_browser import open_with_playwright
|
9
9
|
|
10
10
|
|
11
11
|
class PlaywrightIntegrationTester(unittest.TestCase):
|
12
12
|
"""Test Playwright integration functionality."""
|
13
13
|
|
14
|
-
def test_playwright_availability_check(self):
|
15
|
-
"""Test that the Playwright availability check works correctly."""
|
16
|
-
# The availability check should return a boolean
|
17
|
-
result = is_playwright_available()
|
18
|
-
self.assertIsInstance(result, bool)
|
19
|
-
|
20
14
|
def test_open_with_playwright_fallback(self):
|
21
15
|
"""Test that open_with_playwright falls back to webbrowser when Playwright is not available."""
|
22
16
|
test_url = "http://localhost:8080"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|