fastled 1.3.11__tar.gz → 1.3.13__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 (126) hide show
  1. fastled-1.3.13/Dockerfile +58 -0
  2. {fastled-1.3.11 → fastled-1.3.13}/PKG-INFO +4 -2
  3. {fastled-1.3.11 → fastled-1.3.13}/README.md +2 -0
  4. {fastled-1.3.11 → fastled-1.3.13}/clean +1 -0
  5. {fastled-1.3.11 → fastled-1.3.13}/compiler/run.py +7 -34
  6. {fastled-1.3.11 → fastled-1.3.13}/docker-compose.yml +1 -1
  7. {fastled-1.3.11/compiler → fastled-1.3.13}/entrypoint.sh +1 -4
  8. {fastled-1.3.11 → fastled-1.3.13}/pyproject.toml +1 -2
  9. {fastled-1.3.11 → fastled-1.3.13}/requirements.testing.txt +2 -1
  10. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/__version__.py +1 -1
  11. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/app.py +0 -6
  12. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/compile_server_impl.py +0 -16
  13. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/docker_manager.py +2 -2
  14. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/parse_args.py +8 -6
  15. {fastled-1.3.11 → fastled-1.3.13}/src/fastled.egg-info/PKG-INFO +4 -2
  16. {fastled-1.3.11 → fastled-1.3.13}/src/fastled.egg-info/SOURCES.txt +1 -11
  17. {fastled-1.3.11 → fastled-1.3.13}/src/fastled.egg-info/requires.txt +1 -1
  18. {fastled-1.3.11 → fastled-1.3.13}/test +2 -2
  19. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_version.py +3 -2
  20. fastled-1.3.11/Dockerfile +0 -85
  21. fastled-1.3.11/compiler/CMakeLists.txt +0 -139
  22. fastled-1.3.11/compiler/arduino-pre-process.sh +0 -3
  23. fastled-1.3.11/compiler/final_prewarm.sh +0 -26
  24. fastled-1.3.11/compiler/init_runtime.py +0 -112
  25. fastled-1.3.11/compiler/install-arduino-cli.sh +0 -41
  26. fastled-1.3.11/compiler/libcompile/CMakeLists.txt +0 -152
  27. fastled-1.3.11/compiler/prewarm.sh +0 -42
  28. fastled-1.3.11/compiler/process-ino.py +0 -138
  29. fastled-1.3.11/compiler/pyproject.toml +0 -22
  30. fastled-1.3.11/tests/unit/test_version_matches.py +0 -70
  31. {fastled-1.3.11 → fastled-1.3.13}/.aiderignore +0 -0
  32. {fastled-1.3.11 → fastled-1.3.13}/.dockerignore +0 -0
  33. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/build_multi_docker_image.yml +0 -0
  34. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/build_webpage.yml +0 -0
  35. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/lint.yml +0 -0
  36. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/publish_release.yml +0 -0
  37. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/template_build_docker_image.yml +0 -0
  38. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/test_build_exe.yml +0 -0
  39. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/test_macos.yml +0 -0
  40. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/test_ubuntu.yml +0 -0
  41. {fastled-1.3.11 → fastled-1.3.13}/.github/workflows/test_win.yml +0 -0
  42. {fastled-1.3.11 → fastled-1.3.13}/.gitignore +0 -0
  43. {fastled-1.3.11 → fastled-1.3.13}/.pylintrc +0 -0
  44. {fastled-1.3.11 → fastled-1.3.13}/.vscode/launch.json +0 -0
  45. {fastled-1.3.11 → fastled-1.3.13}/.vscode/settings.json +0 -0
  46. {fastled-1.3.11 → fastled-1.3.13}/.vscode/tasks.json +0 -0
  47. {fastled-1.3.11 → fastled-1.3.13}/LICENSE +0 -0
  48. {fastled-1.3.11 → fastled-1.3.13}/MANIFEST.in +0 -0
  49. {fastled-1.3.11 → fastled-1.3.13}/RELEASE.md +0 -0
  50. {fastled-1.3.11 → fastled-1.3.13}/TODO.md +0 -0
  51. {fastled-1.3.11 → fastled-1.3.13}/build_exe.py +0 -0
  52. {fastled-1.3.11 → fastled-1.3.13}/build_local_docker.py +0 -0
  53. {fastled-1.3.11 → fastled-1.3.13}/build_site.py +0 -0
  54. {fastled-1.3.11 → fastled-1.3.13}/compiler/debug.sh +0 -0
  55. {fastled-1.3.11 → fastled-1.3.13}/demo/100dots.html +0 -0
  56. {fastled-1.3.11 → fastled-1.3.13}/demo/demo_threejs.html +0 -0
  57. {fastled-1.3.11 → fastled-1.3.13}/demo/micdemo.html +0 -0
  58. {fastled-1.3.11 → fastled-1.3.13}/demo/mp3upload.html +0 -0
  59. {fastled-1.3.11 → fastled-1.3.13}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
  60. {fastled-1.3.11 → fastled-1.3.13}/install +0 -0
  61. {fastled-1.3.11 → fastled-1.3.13}/install_linux.sh +0 -0
  62. {fastled-1.3.11 → fastled-1.3.13}/lint +0 -0
  63. {fastled-1.3.11 → fastled-1.3.13}/setup.cfg +0 -0
  64. {fastled-1.3.11 → fastled-1.3.13}/setup.py +0 -0
  65. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/__init__.py +0 -0
  66. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/args.py +0 -0
  67. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/assets/example.txt +0 -0
  68. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/assets/localhost-key.pem +0 -0
  69. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/assets/localhost.pem +0 -0
  70. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/cli.py +0 -0
  71. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/cli_test.py +0 -0
  72. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/cli_test_interactive.py +0 -0
  73. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/client_server.py +0 -0
  74. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/compile_server.py +0 -0
  75. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/filewatcher.py +0 -0
  76. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/keyboard.py +0 -0
  77. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/keyz.py +0 -0
  78. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/live_client.py +0 -0
  79. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/open_browser.py +0 -0
  80. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/paths.py +0 -0
  81. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/print_filter.py +0 -0
  82. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/project_init.py +0 -0
  83. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/select_sketch_directory.py +0 -0
  84. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/server_flask.py +0 -0
  85. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/server_start.py +0 -0
  86. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/settings.py +0 -0
  87. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/site/build.py +0 -0
  88. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/site/examples.py +0 -0
  89. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/sketch.py +0 -0
  90. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/spinner.py +0 -0
  91. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/string_diff.py +0 -0
  92. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  93. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/test/examples.py +0 -0
  94. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/types.py +0 -0
  95. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/util.py +0 -0
  96. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/version.py +0 -0
  97. {fastled-1.3.11 → fastled-1.3.13}/src/fastled/web_compile.py +0 -0
  98. {fastled-1.3.11 → fastled-1.3.13}/src/fastled.egg-info/dependency_links.txt +0 -0
  99. {fastled-1.3.11 → fastled-1.3.13}/src/fastled.egg-info/entry_points.txt +0 -0
  100. {fastled-1.3.11 → fastled-1.3.13}/src/fastled.egg-info/top_level.txt +0 -0
  101. {fastled-1.3.11 → fastled-1.3.13}/tests/integration/test_build_examples.py +0 -0
  102. {fastled-1.3.11 → fastled-1.3.13}/tests/integration/test_examples.py +0 -0
  103. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/html/index.html +0 -0
  104. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_api.py +0 -0
  105. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_bad_ino.py +0 -0
  106. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_cli.py +0 -0
  107. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_compile_server.py +0 -0
  108. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_debug_fetch_source_files.py +0 -0
  109. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_docker_linux_on_windows.py +0 -0
  110. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_embedded_data.py +0 -0
  111. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_experimental_cpp_filter.py +0 -0
  112. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_filechanger.py +0 -0
  113. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_http_server.py +0 -0
  114. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_ino/bad/bad.ino +0 -0
  115. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  116. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
  117. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  118. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  119. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  120. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_print_filter.py +0 -0
  121. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_project_init.py +0 -0
  122. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_server_and_client_seperatly.py +0 -0
  123. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_string_diff.py +0 -0
  124. {fastled-1.3.11 → fastled-1.3.13}/tests/unit/test_webcompile.py +0 -0
  125. {fastled-1.3.11 → fastled-1.3.13}/upload_package.sh +0 -0
  126. {fastled-1.3.11 → fastled-1.3.13}/vscode-plugin/readme +0 -0
@@ -0,0 +1,58 @@
1
+
2
+ # The only reason we use docker is because of the fastled-wasm-compiler.
3
+ FROM niteris/fastled-wasm-compiler:latest
4
+
5
+
6
+ COPY requirements.testing.txt /install/requirements.txt
7
+ # Extract fastled-wasm-server version from requirements.txt
8
+ RUN \
9
+ grep -oP '(?<=fastled-wasm-server[<>=!]=?)[^ \n#]+' /install/requirements.txt > /install/version.txt && \
10
+ cat /install/version.txt > /install/requirements.txt && \
11
+ uv pip install --system -r /install/requirements.txt --refresh || \
12
+ uv pip install --system -r /install/requirements.txt --refresh || \
13
+ uv pip install --system -r /install/requirements.txt --refresh
14
+
15
+ # FIRST PRE-WARM CYCLE and initial setup: Download the fastled repo from the github and pre-warm the cache with a compilation.
16
+ # This is by far the most expensive part of the build, because platformio needs to download initial tools. This
17
+ # pre-warm cycle is "sticky" and tends to stay in the cache for a long time since docker is very relaxed about
18
+ # invalidating cache layers that clone a github repo.
19
+
20
+ ARG FASTLED_BUILD_DAY=echo $(date +'%Y-%m-%d')
21
+ ENV FASTLED_BUILD_DAY=${FASTLED_BUILD_DAY}
22
+
23
+
24
+ WORKDIR /js
25
+
26
+
27
+ RUN mkdir -p /js/compiler
28
+
29
+
30
+ # COPY compiler/*.py /js/compiler
31
+ COPY entrypoint.sh /entrypoint.sh
32
+ COPY compiler/run.py /js/run.py
33
+ COPY compiler/debug.sh /js/debug.sh
34
+
35
+ # COPY compiler/entrypoint.sh /entrypoint.sh
36
+ # RUN chmod +x /entrypoint.sh && dos2unix /entrypoint.sh
37
+
38
+ RUN cd /js && chmod +x debug.sh && dos2unix *.sh
39
+ RUN chmod +x /entrypoint.sh && dos2unix /entrypoint.sh
40
+
41
+ # RSYNC DISABLED FOR NOW
42
+ # now sync local to the source directory.
43
+ # RUN rsync -av /host/fastled/ /js/fastled/ && rm -rf /host/fastled
44
+
45
+ # RUN python /js/init_runtime.py || true
46
+
47
+
48
+ # SECOND PRE-WARM CYCLE: Copy the fastled repo from the host machine and pre-warm the cache with that compilation. This will
49
+ # be much quicker than the first pre-warm cycle.
50
+ # RUN /js/prewarm.sh --force > /logs/prewarm.log.2 || true
51
+
52
+ # Now timestamp the image and store it at the end of the build.
53
+ RUN date > /image_timestamp.txt
54
+
55
+ ENTRYPOINT ["/entrypoint.sh"]
56
+ CMD ["python", "/js/run.py", "server"]
57
+
58
+ # CMD ["/bin/bash", "/entrypoint.sh"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.11
3
+ Version: 1.3.13
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -20,7 +20,7 @@ Requires-Dist: progress>=1.6
20
20
  Requires-Dist: watchfiles>=1.0.5
21
21
  Requires-Dist: Flask>=3.0.0
22
22
  Requires-Dist: livereload
23
- Requires-Dist: fastled-wasm-server>=1.0.27
23
+ Requires-Dist: disklru>=2.0.4
24
24
  Dynamic: home-page
25
25
  Dynamic: license-file
26
26
  Dynamic: maintainer
@@ -389,12 +389,14 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
389
389
 
390
390
 
391
391
 
392
+
392
393
  live-server --https --port=8416 --host=localhost . --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser
393
394
 
394
395
 
395
396
  live-server --https --cert=src/fastled/assets/localhost.pem --key=src/fastled/assets/localhost-key.pem --port=5500
396
397
 
397
398
 
399
+
398
400
  ## Performance
399
401
 
400
402
  ```
@@ -362,12 +362,14 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
362
362
 
363
363
 
364
364
 
365
+
365
366
  live-server --https --port=8416 --host=localhost . --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser
366
367
 
367
368
 
368
369
  live-server --https --cert=src/fastled/assets/localhost.pem --key=src/fastled/assets/localhost-key.pem --port=5500
369
370
 
370
371
 
372
+
371
373
  ## Performance
372
374
 
373
375
  ```
@@ -19,3 +19,4 @@ find . -name "*.pyc" -exec rm -rf {} \;
19
19
  # remove all *.egg files
20
20
  find . -name "*.egg" -exec rm -rf {} \;
21
21
 
22
+ rm -f uv.lock
@@ -6,8 +6,8 @@ import warnings
6
6
  from pathlib import Path
7
7
  from typing import Tuple
8
8
 
9
- from fastled_wasm_server.code_sync import CodeSync
10
- from fastled_wasm_server.paths import VOLUME_MAPPED_SRC
9
+ from fastled_wasm_compiler.compiler import Compiler
10
+ from fastled_wasm_compiler.paths import VOLUME_MAPPED_SRC
11
11
 
12
12
  _PORT = os.environ.get("PORT", 80)
13
13
 
@@ -16,33 +16,6 @@ _CHOICES = ["compile", "server"]
16
16
  HERE = Path(__file__).parent
17
17
 
18
18
 
19
- def _update_fastled() -> None:
20
- # NOT ENABLED YET
21
- if True:
22
- return
23
- is_render = os.environ.get("RENDER", "false") == "true"
24
- if not is_render:
25
- print("Skipping finalprewarm...")
26
- return
27
- git_path = "/git/fastled"
28
- fastled_path = "/js/fastled"
29
- subprocess.run(["git", "fetch", "origin"], cwd=git_path)
30
- subprocess.run(["git", "reset", "--hard", "origin/master"], cwd=git_path)
31
- subprocess.run(
32
- [
33
- "rsync",
34
- "-av",
35
- "--info=NAME",
36
- "--delete",
37
- f"{git_path}/",
38
- f"{fastled_path}/",
39
- "--exclude",
40
- ".git",
41
- ],
42
- cwd="/js",
43
- )
44
-
45
-
46
19
  def _parse_args() -> Tuple[argparse.Namespace, list[str]]:
47
20
  parser = argparse.ArgumentParser(
48
21
  description="Run compile.py with additional arguments"
@@ -102,16 +75,16 @@ def _run_compile(unknown_args: list[str]) -> int:
102
75
  def main() -> int:
103
76
  print("Running...")
104
77
  args, unknown_args = _parse_args()
105
- _update_fastled()
106
-
107
- code_sync = CodeSync(
78
+ compiler = Compiler(
108
79
  volume_mapped_src=VOLUME_MAPPED_SRC,
109
- rsync_dest=Path("/invalid/path"),
110
80
  )
111
- code_sync.sync_source_directory_if_volume_is_mapped()
81
+ compiler.update_src()
112
82
 
113
83
  try:
114
84
  if args.mode == "compile":
85
+ warnings.warn(
86
+ "The compile mode is deprecated and may fail. Use server mode instead."
87
+ )
115
88
  rtn = _run_compile(unknown_args)
116
89
  return rtn
117
90
  elif args.mode == "server":
@@ -7,4 +7,4 @@ services:
7
7
  - "8234:80"
8
8
  environment:
9
9
  - ENVIRONMENT=dev
10
- image: niteris/fastled-wasm:local
10
+ image: niteris/fastled-wasm:latest
@@ -4,12 +4,9 @@
4
4
  source /emsdk/emsdk_env.sh
5
5
  export PATH="$PATH:/emsdk/upstream/bin"
6
6
 
7
- # initialize runtime
8
- python init_runtime.py
9
-
10
7
  # only do the final prewarm if RUNTIME_PREWARM is set to "1"
11
8
  if [[ "${RUNTIME_PREWARM:-0}" == "1" ]]; then
12
- ./final_prewarm.sh
9
+ uv run -m fastled_wasm_compiler.cli_update_from_master
13
10
  fi
14
11
 
15
12
  # hand off to the main command
@@ -23,8 +23,7 @@ dependencies = [
23
23
  "watchfiles>=1.0.5",
24
24
  "Flask>=3.0.0",
25
25
  "livereload",
26
- ###### WASM SERVER ######
27
- "fastled-wasm-server>=1.0.27", # Enforced by unit test to match project <--> docker.
26
+ "disklru>=2.0.4",
28
27
  ]
29
28
 
30
29
  dynamic = ["version"]
@@ -5,4 +5,5 @@ pytest
5
5
  ruff
6
6
  pytest-xdist
7
7
  pyinstaller
8
- pyright
8
+ pyright
9
+ fastled-wasm-server>=1.0.55
@@ -1,6 +1,6 @@
1
1
  # IMPORTANT! There's a bug in github which will REJECT any version update
2
2
  # that has any other change in the repo. Please bump the version as the
3
3
  # ONLY change in a commit, or else the pypi update and the release will fail.
4
- __version__ = "1.3.11"
4
+ __version__ = "1.3.13"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
@@ -13,12 +13,6 @@ from fastled.filewatcher import file_watcher_set
13
13
  from fastled.parse_args import Args, parse_args
14
14
  from fastled.sketch import find_sketch_directories, looks_like_fastled_repo
15
15
 
16
- # from fastled.sketch import (
17
- # find_sketch_directories,
18
- # looks_like_fastled_repo,
19
- # looks_like_sketch_directory,
20
- # )
21
-
22
16
 
23
17
  def run_server(args: Args) -> int:
24
18
  interactive = args.interactive
@@ -249,22 +249,6 @@ class CompileServerImpl:
249
249
  # to allow for interactive compilation
250
250
  # interactive_sources = list(INTERACTIVE_SOURCES)
251
251
  interactive_sources: list[tuple[Path, str]] = []
252
- init_runtime_py = (
253
- Path(self.fastled_src_dir)
254
- / ".."
255
- / ".."
256
- / "fastled-wasm"
257
- / "compiler"
258
- / "init_runtime.py"
259
- )
260
- if init_runtime_py.exists():
261
- # fastled-wasm is in a sister directory, mapping this in to the container.
262
- mapping = (
263
- init_runtime_py,
264
- "/js/init_runtime.py",
265
- )
266
- interactive_sources.append(mapping)
267
-
268
252
  src_host: Path
269
253
  dst_container: str
270
254
  for src_host, dst_container in interactive_sources:
@@ -227,7 +227,7 @@ def set_force_remove_image_previous(new_value: str | None = None) -> None:
227
227
  if new_value is not None:
228
228
  os.environ["FASTLED_FORCE_CLEAR"] = new_value
229
229
  else:
230
- os.environ["FASTLED_FORCE_CLEAR"] == "1"
230
+ os.environ["FASTLED_FORCE_CLEAR"] = "1"
231
231
 
232
232
 
233
233
  def force_image_removal() -> bool:
@@ -653,7 +653,7 @@ class DockerManager:
653
653
  Example: {8080: 80} maps host port 8080 to container port 80
654
654
  """
655
655
  remove_previous = remove_previous or get_force_remove_image_previous()
656
- if remove_previous:
656
+ if get_force_remove_image_previous():
657
657
  # make a banner print
658
658
  print(
659
659
  "Force removing previous image due to FASTLED_FORCE_CLEAR environment variable."
@@ -157,7 +157,6 @@ def parse_args() -> Args:
157
157
  build_mode.add_argument(
158
158
  "--quick",
159
159
  action="store_true",
160
- default=True,
161
160
  help="Build in quick mode (default)",
162
161
  )
163
162
  build_mode.add_argument(
@@ -209,11 +208,14 @@ def parse_args() -> Args:
209
208
  fastled_dir: Path | None = _find_fastled_repo(cwd)
210
209
  is_fastled_dir: bool = fastled_dir is not None
211
210
 
212
- if is_fastled_dir:
213
- # if --quick, --debug, --release are not specified then default to --debug
214
- if not (args.debug or args.quick or args.release):
215
- args.debug = True
216
- print("Defaulting to --debug mode")
211
+ if not (args.debug or args.quick or args.release):
212
+ if is_fastled_dir:
213
+ # if --quick, --debug, --release are not specified then default to --debug
214
+ args.quick = True
215
+ print("Defaulting to --quick mode in fastled repo")
216
+ else:
217
+ args.quick = True
218
+ print("Defaulting to --quick mode")
217
219
 
218
220
  if args.build or args.interactive:
219
221
  if args.directory is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.11
3
+ Version: 1.3.13
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -20,7 +20,7 @@ Requires-Dist: progress>=1.6
20
20
  Requires-Dist: watchfiles>=1.0.5
21
21
  Requires-Dist: Flask>=3.0.0
22
22
  Requires-Dist: livereload
23
- Requires-Dist: fastled-wasm-server>=1.0.27
23
+ Requires-Dist: disklru>=2.0.4
24
24
  Dynamic: home-page
25
25
  Dynamic: license-file
26
26
  Dynamic: maintainer
@@ -389,12 +389,14 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
389
389
 
390
390
 
391
391
 
392
+
392
393
  live-server --https --port=8416 --host=localhost . --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser
393
394
 
394
395
 
395
396
  live-server --https --cert=src/fastled/assets/localhost.pem --key=src/fastled/assets/localhost-key.pem --port=5500
396
397
 
397
398
 
399
+
398
400
  ## Performance
399
401
 
400
402
  ```
@@ -13,6 +13,7 @@ build_local_docker.py
13
13
  build_site.py
14
14
  clean
15
15
  docker-compose.yml
16
+ entrypoint.sh
16
17
  install
17
18
  install_linux.sh
18
19
  lint
@@ -33,18 +34,8 @@ upload_package.sh
33
34
  .vscode/launch.json
34
35
  .vscode/settings.json
35
36
  .vscode/tasks.json
36
- compiler/CMakeLists.txt
37
- compiler/arduino-pre-process.sh
38
37
  compiler/debug.sh
39
- compiler/entrypoint.sh
40
- compiler/final_prewarm.sh
41
- compiler/init_runtime.py
42
- compiler/install-arduino-cli.sh
43
- compiler/prewarm.sh
44
- compiler/process-ino.py
45
- compiler/pyproject.toml
46
38
  compiler/run.py
47
- compiler/libcompile/CMakeLists.txt
48
39
  demo/100dots.html
49
40
  demo/demo_threejs.html
50
41
  demo/micdemo.html
@@ -111,7 +102,6 @@ tests/unit/test_project_init.py
111
102
  tests/unit/test_server_and_client_seperatly.py
112
103
  tests/unit/test_string_diff.py
113
104
  tests/unit/test_version.py
114
- tests/unit/test_version_matches.py
115
105
  tests/unit/test_webcompile.py
116
106
  tests/unit/html/index.html
117
107
  tests/unit/test_ino/bad/bad.ino
@@ -8,4 +8,4 @@ progress>=1.6
8
8
  watchfiles>=1.0.5
9
9
  Flask>=3.0.0
10
10
  livereload
11
- fastled-wasm-server>=1.0.27
11
+ disklru>=2.0.4
@@ -19,8 +19,8 @@ if [[ "$*" == *"--full"* ]]; then
19
19
  uv run build_local_docker.py
20
20
  fi
21
21
 
22
-
23
-
22
+ # If the test fails, then purge and try again
24
23
  pytest -x -v -s --durations=0 tests/unit "$@"
24
+
25
25
  # uv run pytest -n auto tests -v
26
26
 
@@ -16,10 +16,11 @@ class MainTester(unittest.TestCase):
16
16
  def test_command(self) -> None:
17
17
  """Test command line interface (CLI)."""
18
18
  stdout = subprocess.check_output(COMMAND, shell=True)
19
+ version_stdout = stdout.decode("utf-8").strip()
19
20
  self.assertEqual(
20
- stdout.decode("utf-8").strip(),
21
+ version_stdout,
21
22
  __version__,
22
- f"Version mismatch: {stdout.decode('utf-8').strip()} != {__version__}",
23
+ f"FastLED Version mismatch: {version_stdout} (tool output) != {__version__} (package version)",
23
24
  )
24
25
 
25
26
 
fastled-1.3.11/Dockerfile DELETED
@@ -1,85 +0,0 @@
1
-
2
- # The only reason we use docker is because of the fastled-wasm-compiler.
3
- FROM niteris/fastled-wasm-compiler:latest
4
-
5
-
6
- # Get the compiler requirements and install them.
7
- COPY compiler/pyproject.toml /install/pyproject.toml
8
- RUN uv pip install --system -r /install/pyproject.toml
9
-
10
- # FIRST PRE-WARM CYCLE and initial setup: Download the fastled repo from the github and pre-warm the cache with a compilation.
11
- # This is by far the most expensive part of the build, because platformio needs to download initial tools. This
12
- # pre-warm cycle is "sticky" and tends to stay in the cache for a long time since docker is very relaxed about
13
- # invalidating cache layers that clone a github repo.
14
-
15
- RUN echo "force update4"
16
- ARG FASTLED_BUILD_DAY=echo $(date +'%Y-%m-%d')
17
- ENV FASTLED_BUILD_DAY=${FASTLED_BUILD_DAY}
18
-
19
- # ARG FASTLED_VERSION=master
20
- # ENV FASTLED_VERSION=${FASTLED_VERSION}
21
- # RUN mkdir -p /js/fastled && \
22
- # rsync -a /git/fastled/ /js/fastled/ --exclude='.git'
23
-
24
- # Create symlinks for wasm platform files.
25
- COPY compiler/init_runtime.py /js/init_runtime.py
26
- #COPY compiler/prewarm.sh /js/prewarm.sh
27
-
28
- WORKDIR /js
29
-
30
- #ARG NO_PREWARM=0
31
- #ENV NO_PREWARM=${NO_PREWARM}
32
-
33
- #RUN python /js/init_runtime.py || true
34
-
35
-
36
- # First pre-warm cycle - always do it as part of the build.
37
- # RUN mkdir -p /logs
38
-
39
- # Force a build if the compiler flags change.
40
- #COPY compiler/CMakeLists.txt /trash/CMakeLists.txt
41
- #RUN rm -rf /trash
42
-
43
- #RUN chmod +x /js/prewarm.sh && \
44
- # cat /js/prewarm.sh >> /logs/prewarm.log.0
45
- #RUN /js/prewarm.sh --force >> /logs/prewarm.log.1 || true
46
-
47
-
48
-
49
- # # Copy the fastled repo from the host machine and prepare for pre-warm
50
- # # Make sure and delete files that have been removed so that we don't get
51
- # # duplicate symbols from stale files.
52
- # COPY *.json /host/fastled/
53
- # COPY src/*.* /host/fastled/src/
54
- # COPY examples /host/fastled/examples
55
- # COPY src/fx /host/fastled/src/fx
56
- # COPY src/fl /host/fastled/src/fl
57
- # COPY src/lib8tion /host/fastled/src/lib8tion
58
- # COPY src/third_party /host/fastled/src/third_party
59
- # COPY src/sensors /host/fastled/src/sensors
60
- # COPY src/platforms /host/fastled/src/platforms
61
-
62
- RUN echo "force update"
63
- COPY compiler /js/compiler
64
-
65
- COPY compiler/entrypoint.sh /entrypoint.sh
66
- RUN chmod +x /entrypoint.sh && dos2unix /entrypoint.sh
67
-
68
- # RSYNC DISABLED FOR NOW
69
- # now sync local to the source directory.
70
- # RUN rsync -av /host/fastled/ /js/fastled/ && rm -rf /host/fastled
71
-
72
- # RUN python /js/init_runtime.py || true
73
-
74
-
75
- # SECOND PRE-WARM CYCLE: Copy the fastled repo from the host machine and pre-warm the cache with that compilation. This will
76
- # be much quicker than the first pre-warm cycle.
77
- # RUN /js/prewarm.sh --force > /logs/prewarm.log.2 || true
78
-
79
- # Now timestamp the image and store it at the end of the build.
80
- RUN date > /image_timestamp.txt
81
-
82
- ENTRYPOINT ["/entrypoint.sh"]
83
- CMD ["python", "/js/run.py", "server"]
84
-
85
- # CMD ["/bin/bash", "/entrypoint.sh"]
@@ -1,139 +0,0 @@
1
- cmake_minimum_required(VERSION 3.10)
2
- project(FastLED_WASM)
3
-
4
- # Enable verbose makefile output for all compiled sources
5
- set(CMAKE_VERBOSE_MAKEFILE ON)
6
-
7
- # --- Set Emscripten as the Compiler ---
8
- set(CMAKE_C_COMPILER "emcc")
9
- set(CMAKE_CXX_COMPILER "em++")
10
- set(CMAKE_AR "emar")
11
- set(CMAKE_RANLIB "emranlib")
12
-
13
- # Use ccache as a compiler launcher (requires CMake 3.4 or newer)
14
- set(CMAKE_C_COMPILER_LAUNCHER "ccache")
15
- set(CMAKE_CXX_COMPILER_LAUNCHER "ccache")
16
-
17
- # --- Build Mode and Optimization Level ---
18
- if(NOT DEFINED ENV{BUILD_MODE})
19
- set(BUILD_MODE "QUICK")
20
- else()
21
- set(BUILD_MODE $ENV{BUILD_MODE})
22
- endif()
23
-
24
- if(BUILD_MODE STREQUAL "QUICK")
25
- set(OPT_LEVEL "-O0")
26
- elseif(BUILD_MODE STREQUAL "DEBUG")
27
- set(OPT_LEVEL "-Og")
28
- else() # RELEASE
29
- set(OPT_LEVEL "-Oz")
30
- endif()
31
-
32
- # --- Common Compiler and Linker Flags ---
33
- set(COMMON_COMPILE_FLAGS
34
- -DFASTLED_ENGINE_EVENTS_MAX_LISTENERS=50
35
- -DFASTLED_FORCE_NAMESPACE=1
36
- -DFASTLED_NO_FORCE_INLINE
37
- -DFASTLED_USE_PROGMEM=0
38
- -DDISABLE_EXCEPTION_CATCHING=1
39
- -fno-exceptions
40
- -fno-rtti
41
- -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0
42
- -std=gnu++17
43
- -fpermissive
44
- -fno-inline
45
- -Wno-constant-logical-operand
46
- -Wnon-c-typedef-for-linkage
47
- -Werror=bad-function-cast
48
- -Werror=cast-function-type
49
- -sUSE_PTHREADS=0 # Disable threading support
50
- ${OPT_LEVEL}
51
- )
52
-
53
- # (Optional: PROFILE flags can be added here if needed)
54
-
55
- set(COMMON_LINK_FLAGS
56
- -sALLOW_MEMORY_GROWTH=0
57
- -sDISABLE_EXCEPTION_CATCHING=1
58
- -sDISABLE_EXCEPTION_THROWING=0
59
- -sWASM_BIGINT
60
- --bind
61
- -DUSE_OFFSET_CONVERTER=0
62
- -sINITIAL_MEMORY=134217728
63
- -fuse-ld=lld
64
- --no-entry
65
- -sMODULARIZE=1
66
- )
67
-
68
- set(LIBRARY_LINK_FLAGS
69
- ${COMMON_LINK_FLAGS}
70
- )
71
-
72
- set(SKETCH_LINK_FLAGS
73
- ${COMMON_LINK_FLAGS}
74
- -sEXPORTED_RUNTIME_METHODS=['ccall','cwrap','stringToUTF8','lengthBytesUTF8']
75
- -sEXPORTED_FUNCTIONS=['_malloc','_free','_extern_setup','_extern_loop','_fastled_declare_files']
76
- -sEXPORT_NAME=fastled
77
- -o fastled.js
78
- )
79
-
80
- if(BUILD_MODE STREQUAL "DEBUG")
81
- list(APPEND COMMON_COMPILE_FLAGS
82
- -g3
83
- -fsanitize=address
84
- -fsanitize=undefined
85
- )
86
- set(DEBUG_LINK_FLAGS
87
- -gsource-map
88
- --emit-symbol-map
89
- -sSTACK_OVERFLOW_CHECK=2
90
- -ASSERTIONS=1
91
- )
92
- list(APPEND LIBRARY_LINK_FLAGS ${DEBUG_LINK_FLAGS})
93
- list(APPEND SKETCH_LINK_FLAGS ${DEBUG_LINK_FLAGS})
94
- endif()
95
-
96
- # --- FASTLED LIBRARY SETUP ---
97
- set(LIBFASTLED_PATH /precompiled/libfastled.a)
98
-
99
- if(EXISTS ${LIBFASTLED_PATH})
100
- message(STATUS "Found prebuilt libfastled.a at ${LIBFASTLED_PATH}, skipping build of FastLED library.")
101
- add_library(fastled STATIC IMPORTED)
102
- set_target_properties(fastled PROPERTIES IMPORTED_LOCATION ${LIBFASTLED_PATH})
103
- else()
104
- message(FATAL_ERROR "Did not find precompiled libfastled.a at ${LIBFASTLED_PATH}. Please build the library first.")
105
- endif()
106
-
107
- if(TARGET fastled)
108
- set_target_properties(fastled PROPERTIES
109
- CXX_STANDARD 17
110
- CXX_STANDARD_REQUIRED ON
111
- POSITION_INDEPENDENT_CODE ON
112
- )
113
- endif()
114
-
115
- # --- LIBRARY TARGET: sketch_lib ---
116
- file(GLOB_RECURSE ALL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
117
- message(STATUS "All sources: ${ALL_SOURCES}")
118
-
119
- add_library(sketch_lib STATIC ${ALL_SOURCES})
120
-
121
- target_compile_options(sketch_lib PRIVATE ${COMMON_COMPILE_FLAGS})
122
- target_compile_definitions(sketch_lib PRIVATE SKETCH_COMPILE)
123
- target_include_directories(sketch_lib PRIVATE
124
- ${CMAKE_CURRENT_SOURCE_DIR}/src
125
- "/precompiled/include"
126
- )
127
- set_target_properties(sketch_lib PROPERTIES
128
- CXX_STANDARD 17
129
- CXX_STANDARD_REQUIRED ON
130
- )
131
-
132
- # ── FINAL LINKING STEP: Produce fastled.js ──
133
- # This custom target invokes em++ to link the static library (sketch_lib)
134
- # with the precompiled libfastled.a into the final binary fastled.js.
135
- add_custom_target(final_wasm ALL
136
- COMMAND em++ ${SKETCH_LINK_FLAGS} -Wl,--whole-archive $<TARGET_FILE:sketch_lib> -Wl,--no-whole-archive /precompiled/libfastled.a
137
- DEPENDS sketch_lib fastled
138
- COMMENT "Linking final wasm binary to fastled.js"
139
- )
@@ -1,3 +0,0 @@
1
- #!/bin/bash
2
-
3
- arduino-cli compile --preprocess --fqbn arduino:avr:uno /pre-warm/Blink/Blink.ino
@@ -1,26 +0,0 @@
1
- #!/bin/bash
2
-
3
- if [ "$RENDER" != "true" ]; then
4
- echo "Skipping finalprewarm..."
5
- exit 0
6
- fi
7
-
8
- git_path=/git/fastled
9
- fastled_path=/js/fastled
10
-
11
- # update the fastled git repo
12
- cd $git_path
13
-
14
- git fetch origin
15
- git reset --hard origin/master
16
- # ["rsync", "-av", "--info=NAME", "--delete", f"{src}/", f"{dst}/"],
17
-
18
- cd /js
19
-
20
- rsync -av --info=NAME --delete "$git_path/" "$fastled_path/" --exclude ".git"
21
- # rsync -av --info=NAME --delete "$git_path/examples" "$fastled_path/src"
22
-
23
- # now print out all the files in the current directory
24
- ls -la
25
-
26
-