on master help sign in
Makefile: add target node.env - download & install npm dependencies

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commitd471ec86dd72cfae80bdaf72b1ed266b1a8cada7 authorMarkus Heiser <markus.heiser@darmarit.de> dateWed 25 Mar 2020, 16:38 (7 years ago) parent2d12f22
5 files changed+27−6
.gitignore+2−1 Makefile+20−3 docs/dev/quickstart.rst+1−1 searx/static/themes/oscar/.gitignore+2−1 searx/static/themes/simple/.gitignore+2
.gitignore+2−1
@@ -15,7 +15,8 @@ setup.cfg
1515*/*.pyc
1616*~
1717
18−node_modules/
18+/node_modules
19+/package-lock.json
1920
2021.tx/
2122
Makefile+20−3
@@ -30,6 +30,7 @@ help:
3030 @echo ' project - re-build generic files of the searx project'
3131 @echo ' themes - re-build build the source of the themes'
3232 @echo ' docker - build Docker image'
33+ @echo ' node.env - download & install npm dependencies locally'
3334 @echo ''
3435 @$(MAKE) -s -f utils/makefile.include make-help
3536 @echo ''
@@ -42,7 +43,7 @@ PHONY += uninstall
4243uninstall: pyenvuninstall
4344
4445PHONY += clean
45−clean: pyclean
46+clean: pyclean node.clean
4647 $(call cmd,common_clean)
4748
4849PHONY += run
@@ -89,6 +90,22 @@ searx.brand:
8990 $(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py
9091 $(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py
9192
93+# node / npm
94+# ----------
95+
96+node.env:
97+ $(Q)./manage.sh npm_packages
98+
99+node.clean:
100+ $(Q)echo "CLEAN locally installed npm dependencies"
101+ $(Q)rm -rf \
102+ ./node_modules \
103+ ./package-lock.json \
104+ ./searx/static/themes/oscar/package-lock.json \
105+ ./searx/static/themes/oscar/node_modules \
106+ ./searx/static/themes/simple/package-lock.json \
107+ ./searx/static/themes/simple/node_modules
108+
92109# build themes
93110# ------------
94111
@@ -97,11 +114,11 @@ themes: themes.oscar themes.simple
97114
98115themes.oscar:
99116 $(Q)echo '[!] Grunt build : oscar theme'
100− $(Q)grunt --gruntfile "searx/static/themes/oscar/gruntfile.js"
117+ $(Q)PATH="$$(npm bin):$$PATH" grunt --gruntfile "searx/static/themes/oscar/gruntfile.js"
101118
102119themes.simple:
103120 $(Q)echo '[!] Grunt build : simple theme'
104− $(Q)grunt --gruntfile "searx/static/themes/simple/gruntfile.js"
121+ $(Q)PATH="$$(npm bin):$$PATH" grunt --gruntfile "searx/static/themes/simple/gruntfile.js"
105122
106123# docker
107124# ------
docs/dev/quickstart.rst+1−1
@@ -98,7 +98,7 @@ NodeJS, so first Node has to be installed.
9898.. code:: sh
9999
100100 sudo -H apt-get install nodejs
101− sudo -H npm install -g grunt-cli
101+ make node.env
102102
103103After installing grunt, the files can be built using the following command:
104104
searx/static/themes/oscar/.gitignore+2−1
@@ -1 +1,2 @@
1−node_modules/
1+/node_modules
2+/package-lock.json
searx/static/themes/simple/.gitignorenew file+2
@@ -0,0 +1,2 @@
1+/node_modules
2+/package-lock.json