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.
- {fastled-1.4.7 → fastled-1.4.9}/PKG-INFO +9 -28
- {fastled-1.4.7 → fastled-1.4.9}/README.md +7 -25
- {fastled-1.4.7 → fastled-1.4.9}/install +1 -1
- {fastled-1.4.7 → fastled-1.4.9}/pyproject.toml +1 -5
- fastled-1.4.9/requirements.docker.txt +1 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/__init__.py +2 -4
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/__version__.py +1 -1
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/args.py +3 -5
- fastled-1.4.9/src/fastled/chrome_extension_downloader.py +207 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/client_server.py +4 -14
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/live_client.py +0 -3
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/open_browser.py +17 -15
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/parse_args.py +2 -2
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/playwright_browser.py +267 -216
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/PKG-INFO +9 -28
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/SOURCES.txt +1 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/requires.txt +0 -2
- {fastled-1.4.7 → fastled-1.4.9}/tests/integration/test_playwright_integration.py +1 -7
- fastled-1.4.7/requirements.docker.txt +0 -1
- {fastled-1.4.7 → fastled-1.4.9}/.aiderignore +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.cursorrules +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.dockerignore +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/build_multi_docker_image.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/build_webpage.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/lint.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/publish_release.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/template_build_docker_image.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/test_build_exe.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/test_macos.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/test_ubuntu.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.github/workflows/test_win.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.gitignore +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.pylintrc +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.vscode/launch.json +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.vscode/settings.json +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/.vscode/tasks.json +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/DEBUGGER.md +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/Dockerfile +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/FAQ.md +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/LICENSE +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/MANIFEST.in +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/RELEASE.md +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/TODO.md +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/build_exe.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/build_local_docker.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/build_site.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/clean +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/compiler/debug.sh +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/compiler/run.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/demo/100dots.html +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/demo/demo_threejs.html +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/demo/micdemo.html +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/demo/mp3upload.html +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/docker-compose.yml +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/entrypoint.sh +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/install_linux.sh +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/lint +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/requirements.testing.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/setup.cfg +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/setup.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/__main__.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/app.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/assets/example.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/assets/localhost-key.pem +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/assets/localhost.pem +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/cli.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/cli_test.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/cli_test_interactive.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/compile_server.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/compile_server_impl.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/docker_manager.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/filewatcher.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/find_good_connection.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/keyboard.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/keyz.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/paths.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/print_filter.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/project_init.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/select_sketch_directory.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/server_flask.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/server_start.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/settings.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/site/build.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/site/examples.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/sketch.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/spinner.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/string_diff.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/test/can_run_local_docker_tests.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/test/examples.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/types.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/util.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/version.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/web_compile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled/zip_files.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/dependency_links.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/entry_points.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/src/fastled.egg-info/top_level.txt +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/test +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/integration/test_build_examples.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/integration/test_examples.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/integration/test_libcompile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/html/index.html +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_api.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_bad_ino.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_banner_string.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_cli.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_cli_no_platformio.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_compile_server.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_debug_fetch_source_files.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_docker_linux_on_windows.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_embedded_data.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_filechanger.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_flask_headers.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_http_server.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/bad/bad.ino +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/embedded/wasm.ino +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_ino/wasm/wasm.ino +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_manual_api_invocation.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_no_platformio_compile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_project_init.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_server_and_client_seperatly.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_session_compile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_string_diff.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_string_diff_comprehensive.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_version.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/tests/unit/test_webcompile.py +0 -0
- {fastled-1.4.7 → fastled-1.4.9}/upload_package.sh +0 -0
- {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.
|
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
|
-
|
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
|
|
@@ -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
|
-
|
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.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
|
-
|
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,
|
@@ -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
|
-
|
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,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
|
-
|
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"
|
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(
|
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
|
-
"--
|
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",
|