diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2025-02-05 16:49:06 +0100 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2025-02-28 12:27:41 +0100 |
| commit | 2bf77f5d2db2a33828beff402f7f18443204595d (patch) | |
| tree | 2912f667471afb9d0fc150a65f6c364269ae7d65 /utils/lib_sxng_themes.sh | |
| parent | 1a3543d4b279fa926de1d89c1923581869691a22 (diff) | |
[web-client] integrate the migrated theme in the development workflows
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/lib_sxng_themes.sh')
| -rwxr-xr-x | utils/lib_sxng_themes.sh | 78 |
1 files changed, 7 insertions, 71 deletions
diff --git a/utils/lib_sxng_themes.sh b/utils/lib_sxng_themes.sh index 059f9c86f..23faf0e4b 100755 --- a/utils/lib_sxng_themes.sh +++ b/utils/lib_sxng_themes.sh @@ -1,100 +1,36 @@ #!/usr/bin/env bash # SPDX-License-Identifier: AGPL-3.0-or-later -declare _Blue -declare _creset - themes.help(){ cat <<EOF themes.: all : test & build all themes test : test all themes fix : fix JS & CSS (LESS) - live : to get live builds of CSS & JS use: LIVE_THEME=simple make run - simple.: test & build simple theme .. - pygments: build pygment's LESS files for simple theme - test : test simple theme - fix : fix JS & CSS (LESS) of the simple theme EOF } themes.all() { ( set -e - node.env - themes.simple + build_msg SIMPLE "theme: run build" + vite.simple.build ) dump_return $? } themes.fix() { ( set -e - node.env - themes.simple.fix + build_msg SIMPLE "theme: fix" + vite.simple.fix ) dump_return $? } themes.test() { ( set -e - node.env - themes.simple.test - ) - dump_return $? -} - -themes.live() { - local LIVE_THEME="${LIVE_THEME:-${1}}" - case "${LIVE_THEME}" in - simple) - theme="searx/static/themes/${LIVE_THEME}" - ;; - '') - die 42 "missing theme argument" - ;; - *) - die 42 "unknown theme '${LIVE_THEME}' // [simple]'" - ;; - esac - build_msg SIMPLE "theme: $1 (live build)" - node.env - themes.simple.pygments - cd "${theme}" - { - npm run watch - } # 2>&1 \ - # | prefix_stdout "${_Blue}THEME ${1} ${_creset} " \ - # | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |' -} - -themes.simple() { - ( set -e - themes.simple.pygments - build_msg SIMPLE "theme: run build" - # "run build" includes tests from eslint and stylelint - npm --prefix searx/static/themes/simple run build + # we run a build to test (in CI) + build_msg SIMPLE "theme: run build (to test)" + vite.simple.build ) dump_return $? } - -themes.simple.pygments() { - build_msg PYGMENTS "searxng_extra/update/update_pygments.py" - pyenv.cmd python searxng_extra/update/update_pygments.py \ - | prefix_stdout "${_Blue}PYGMENTS ${_creset} " - if [ "${PIPESTATUS[0]}" -ne "0" ]; then - build_msg PYGMENTS "building LESS files for pygments failed" - return 1 - fi - return 0 -} - -themes.simple.fix() { - build_msg SIMPLE "theme: fix" - npm --prefix searx/static/themes/simple run fix - dump_return $? -} - -themes.simple.test() { - build_msg SIMPLE "theme: run test" - npm --prefix searx/static/themes/simple run test - dump_return $? -} |