summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorIvan Gabaldon <igabaldon@inetol.net>2025-06-28 09:55:15 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-07-03 17:35:05 +0200
commita947d5b3cff32104ee009113226feab45439dbdd (patch)
treebcb49118b7400509f97852382fee2fd2ea7efcf5 /utils
parent0cbb4f74ccff4aba15d9f2619f30bf77361f441c (diff)
[mod] theme/simple: improve fmt/lint tech
This is one of various PR to refactor the simple theme internally. Replace eslint tool with Biome. I have been using this for quite some time, and it will help us to have more consistent and valid code without extending on other third party plugins. Removes unused dependencies.
Diffstat (limited to 'utils')
-rwxr-xr-xutils/lib_sxng_static.sh3
-rwxr-xr-xutils/lib_sxng_themes.sh23
-rw-r--r--utils/lib_sxng_vite.sh11
3 files changed, 31 insertions, 6 deletions
diff --git a/utils/lib_sxng_static.sh b/utils/lib_sxng_static.sh
index b10af3b40..43af38d0f 100755
--- a/utils/lib_sxng_static.sh
+++ b/utils/lib_sxng_static.sh
@@ -98,7 +98,8 @@ static.build.commit() {
( set -e
# fix & build the themes
- themes.fix
+ themes.fix
+ themes.lint
themes.all
# add build files
diff --git a/utils/lib_sxng_themes.sh b/utils/lib_sxng_themes.sh
index 23faf0e4b..542ac265d 100755
--- a/utils/lib_sxng_themes.sh
+++ b/utils/lib_sxng_themes.sh
@@ -5,14 +5,23 @@ themes.help(){
cat <<EOF
themes.:
all : test & build all themes
+ simple : test & build simple theme
+ lint : lint JS & CSS (LESS) files
+ fix : fix JS & CSS (LESS) files
test : test all themes
- fix : fix JS & CSS (LESS)
EOF
}
themes.all() {
( set -e
- build_msg SIMPLE "theme: run build"
+ vite.simple.build
+ )
+ dump_return $?
+}
+
+themes.simple() {
+ ( set -e
+ build_msg SIMPLE "theme: run build (simple)"
vite.simple.build
)
dump_return $?
@@ -20,12 +29,20 @@ themes.all() {
themes.fix() {
( set -e
- build_msg SIMPLE "theme: fix"
+ build_msg SIMPLE "theme: fix (all themes)"
vite.simple.fix
)
dump_return $?
}
+themes.lint() {
+ ( set -e
+ build_msg SIMPLE "theme: lint (all themes)"
+ vite.simple.lint
+ )
+ dump_return $?
+}
+
themes.test() {
( set -e
# we run a build to test (in CI)
diff --git a/utils/lib_sxng_vite.sh b/utils/lib_sxng_vite.sh
index 7eb670fba..bb6a881cc 100644
--- a/utils/lib_sxng_vite.sh
+++ b/utils/lib_sxng_vite.sh
@@ -9,6 +9,8 @@ vite.help(){
vite.: .. to be done ..
simple.:
build: build static files of the simple theme
+ fix: run prettiers on simple theme
+ lint: run linters on simple theme
dev: start development server
EOF
}
@@ -36,8 +38,6 @@ vite.simple.build() {
pushd "${VITE_SIMPLE_THEME}"
npm install
- npm run fix
- npm run icons.html
npm run build
popd &> /dev/null
)
@@ -50,6 +50,13 @@ vite.simple.fix() {
)
}
+vite.simple.lint() {
+ ( set -e
+ node.env
+ npm --prefix client/simple run lint
+ )
+}
+
templates.simple.pygments() {
build_msg PYGMENTS "searxng_extra/update/update_pygments.py"
pyenv.cmd python searxng_extra/update/update_pygments.py \