From 7137d2893f33e9158e8563a21d9586119d175269 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 13:28:08 +0200 Subject: [mod] simple theme: remove src/less/ion.less This file is generated by webfont. * It is now generated as searx/static/themes/simple/ion.less * It is generated before the .less compilation. * .gitignore includes this file Add two new package depedencies: fontforge ttfautohint See utils/searx.sh --- manage | 1 + 1 file changed, 1 insertion(+) (limited to 'manage') diff --git a/manage b/manage index 5237e6e1b..d91904255 100755 --- a/manage +++ b/manage @@ -333,6 +333,7 @@ node.clean() { ./searx/static/themes/oscar/node_modules \ ./searx/static/themes/simple/package-lock.json \ ./searx/static/themes/simple/node_modules + ./searx/static/themes/simple/ion.less \ dump_return $? } -- cgit v1.2.3 From c01325688158fdde886e2ecb347d8d4d9707a84d Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 15:39:32 +0200 Subject: [mod] remove common grunt install Before this commit, there are 3 node_modules directory: * one in . * two others in ./searx/statics/themes/* This is no desirable: * it declares the npm depdenencies in the shell script. * dependabot can't updates theses dependencies. * this is a not standard way to build a package (two different locations for the dependencies). With this commit and the PR #150 there is one unique node_modules directory per theme. --- manage | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'manage') diff --git a/manage b/manage index d91904255..024fdf39a 100755 --- a/manage +++ b/manage @@ -13,7 +13,6 @@ source_dot_config PYOBJECTS="searx" PY_SETUP_EXTRAS='[test]' -NPM_PACKAGES="less@2.7 less-plugin-clean-css grunt-cli" GECKODRIVER_VERSION="v0.28.0" # SPHINXOPTS= @@ -296,39 +295,24 @@ gecko.driver() { } node.env() { - local err=0 - pushd "${REPO_ROOT}" &> /dev/null # shellcheck disable=SC2230 which npm &> /dev/null || die 1 'node.env - npm is not found!' ( set -e - # shellcheck disable=SC2030 - PATH="$(npm bin):$PATH" - export PATH - build_msg INSTALL "npm install $NPM_PACKAGES" - # shellcheck disable=SC2086 - npm install $NPM_PACKAGES - - cd "${REPO_ROOT}/searx/static/themes/oscar" - build_msg INSTALL "($(pwd)) npm install" - npm install + build_msg INSTALL "theme: oscar" + npm --prefix searx/static/themes/oscar install - build_msg INSTALL "($(pwd)) npm install" - cd "${REPO_ROOT}/searx/static/themes/simple" - npm install + build_msg INSTALL "theme: simple" + npm --prefix searx/static/themes/simple install ) - err=$? - popd &> /dev/null - dump_return "$err" + dump_return $? } node.clean() { build_msg CLEAN "locally installed npm dependencies" rm -rf \ - ./node_modules \ - ./package-lock.json \ ./searx/static/themes/oscar/package-lock.json \ ./searx/static/themes/oscar/node_modules \ ./searx/static/themes/simple/package-lock.json \ @@ -482,16 +466,14 @@ themes.all() { } themes.oscar() { - local gruntfile=searx/static/themes/oscar/gruntfile.js - build_msg GRUNT "${gruntfile}" - PATH="$(npm bin):$PATH" grunt --gruntfile "${gruntfile}" + build_msg GRUNT "theme: oscar" + npm --prefix searx/static/themes/oscar run build dump_return $? } themes.simple() { - local gruntfile=searx/static/themes/simple/gruntfile.js - build_msg GRUNT "${gruntfile}" - PATH="$(npm bin):$PATH" grunt --gruntfile "${gruntfile}" + build_msg GRUNT "theme: simple" + npm --prefix searx/static/themes/simple run build dump_return $? } -- cgit v1.2.3 From 14ba56fd1a9e82206f964a8830953a1b51eecbdd Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 15:51:43 +0200 Subject: [mod] make node.clean: call the "clean" script from the packages.json The dependencies and build process are described in the gruntfiles.js and packages.json files. It makes sense to move the clean up to these files too. --- manage | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'manage') diff --git a/manage b/manage index 024fdf39a..c042d8ebd 100755 --- a/manage +++ b/manage @@ -310,14 +310,11 @@ node.env() { } node.clean() { - build_msg CLEAN "locally installed npm dependencies" - rm -rf \ - ./searx/static/themes/oscar/package-lock.json \ - ./searx/static/themes/oscar/node_modules \ - ./searx/static/themes/simple/package-lock.json \ - ./searx/static/themes/simple/node_modules - ./searx/static/themes/simple/ion.less \ + ( set -e + npm --prefix searx/static/themes/oscar run clean + npm --prefix searx/static/themes/simple run clean + ) dump_return $? } -- cgit v1.2.3 From ae677cb64b4456ee336bc62484cbf022e9d6493f Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 16 Jun 2021 19:18:13 +0200 Subject: [enh] ./manage node.env - check build tools first The node.env build environment require npm, ttfautohint and fontforge installed in the OS. These tools can be installed by:: sudo -H ./utils/searx.sh install buildhost If one of the tools is not installed, the script node.env stops with a appropriate message. BTW: We ignore CentOS-7 as developer & build platform Signed-off-by: Markus Heiser --- manage | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'manage') diff --git a/manage b/manage index c042d8ebd..7019f429b 100755 --- a/manage +++ b/manage @@ -295,15 +295,18 @@ gecko.driver() { } node.env() { - # shellcheck disable=SC2230 - which npm &> /dev/null || die 1 'node.env - npm is not found!' + if ! required_commands npm fontforge ttfautohint; then + info_msg "to install build tools use::" + info_msg " sudo -H ./utils/searx.sh install buildhost" + die 1 "install needed build tools first" + fi ( set -e - build_msg INSTALL "theme: oscar" + build_msg INSTALL "searx/static/themes/oscar/package.json" npm --prefix searx/static/themes/oscar install - build_msg INSTALL "theme: simple" + build_msg INSTALL "searx/static/themes/simple/package.json" npm --prefix searx/static/themes/simple install ) dump_return $? -- cgit v1.2.3