summaryrefslogtreecommitdiff
path: root/utils/lib_sxng_vite.sh
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-02-05 16:49:06 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-02-28 12:27:41 +0100
commit2bf77f5d2db2a33828beff402f7f18443204595d (patch)
tree2912f667471afb9d0fc150a65f6c364269ae7d65 /utils/lib_sxng_vite.sh
parent1a3543d4b279fa926de1d89c1923581869691a22 (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_vite.sh')
-rw-r--r--utils/lib_sxng_vite.sh49
1 files changed, 34 insertions, 15 deletions
diff --git a/utils/lib_sxng_vite.sh b/utils/lib_sxng_vite.sh
index d188fe503..7eb670fba 100644
--- a/utils/lib_sxng_vite.sh
+++ b/utils/lib_sxng_vite.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: AGPL-3.0-or-later
+declare _Blue
+declare _creset
vite.help(){
cat <<EOF
@@ -12,25 +14,24 @@ EOF
}
VITE_SIMPLE_THEME="${REPO_ROOT}/client/simple"
-VITE_SIMPLE_DIST="${REPO_ROOT}/searx/static/themes/simple"
-vite.simple.dev() {
-
- ( set -e
- build_msg SIMPLE "start server for FE development of: ${VITE_SIMPLE_THEME}"
- pushd "${VITE_SIMPLE_THEME}"
- npm install
- npm exec -- vite
- popd &> /dev/null
- )
-
-}
+# ToDo: vite server is not implemented yet / will be done in a follow up PR
+#
+# vite.simple.dev() {
+# ( set -e
+# build_msg SIMPLE "start server for FE development of: ${VITE_SIMPLE_THEME}"
+# pushd "${VITE_SIMPLE_THEME}"
+# npm install
+# npm exec -- vite
+# popd &> /dev/null
+# )
+# }
vite.simple.build() {
-
- # build static files of the simple theme
-
( set -e
+ templates.simple.pygments
+
+ node.env
build_msg SIMPLE "run build of theme from: ${VITE_SIMPLE_THEME}"
pushd "${VITE_SIMPLE_THEME}"
@@ -38,6 +39,24 @@ vite.simple.build() {
npm run fix
npm run icons.html
npm run build
+ popd &> /dev/null
+ )
+}
+vite.simple.fix() {
+ ( set -e
+ node.env
+ npm --prefix client/simple run fix
)
}
+
+templates.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
+}