summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-11-14 18:10:14 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2021-11-16 23:31:11 +0100
commitdc1442a2d1dbca5007833b14e34aa7f407801706 (patch)
treece32f0f67ee80732789dd0c96c4a9115be5c4c35 /docs
parent646db5d4f942b4c4da4a62f38b159bd80b7f9db1 (diff)
[mod] Tools to install and maintain NVM versions manager for Node.js
[1] https://github.com/nvm-sh/nvm Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'docs')
-rw-r--r--docs/conf.py5
-rw-r--r--docs/dev/makefile.rst68
-rw-r--r--docs/dev/quickstart.rst33
3 files changed, 78 insertions, 28 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 4828679e..eb359890 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -43,7 +43,10 @@ searx.engines.load_engines(searx.settings['engines'])
jinja_contexts = {
'searx': {
'engines': searx.engines.engines,
- 'plugins': searx.plugins.plugins
+ 'plugins': searx.plugins.plugins,
+ 'version': {
+ 'node': os.getenv('NODE_MINIMUM_VERSION')
+ },
},
}
diff --git a/docs/dev/makefile.rst b/docs/dev/makefile.rst
index 6e563b1b..66def0b3 100644
--- a/docs/dev/makefile.rst
+++ b/docs/dev/makefile.rst
@@ -29,7 +29,7 @@ Calling the ``help`` target gives a first overview (``make help``):
.. _make install:
-Python Environment (``make install``)
+Python environment (``make install``)
=====================================
.. sidebar:: activate environment
@@ -112,6 +112,60 @@ from the YAML configuration:
- ``SEARXNG_BIND_ADDRESS`` from :ref:`server.bind_address <settings global server>`
- ``SEARXNG_PORT`` from :ref:`server.port <settings global server>`
+.. _make node.env:
+
+Node.js environment (``make node.env``)
+=======================================
+
+.. _Node.js: https://nodejs.org/
+.. _nvm: https://github.com/nvm-sh
+.. _npm: https://www.npmjs.com/
+
+.. jinja:: searx
+
+ Node.js_ version {{version.node}} or higher is required to build the themes.
+ If the requirement is not met, the build chain uses nvm_ (Node Version
+ Manager) to install latest LTS of Node.js_ locally: there is no need to
+ install nvm_ or npm_ on your system.
+
+Use ``make nvm.status`` to get the current status of you Node.js_ and nvm_ setup.
+
+Here is the output you will typically get on a Ubuntu 20.04 system which serves
+only a `no longer active <https://nodejs.org/en/about/releases/>`_ Release
+`Node.js v10.19.0 <https://packages.ubuntu.com/focal/nodejs>`_.
+
+::
+
+ $ make nvm.status
+ INFO: Node.js is installed at /usr/bin/node
+ INFO: Node.js is version v10.19.0
+ WARN: minimal Node.js version is 16.13.0
+ INFO: npm is installed at /usr/bin/npm
+ INFO: npm is version 6.14.4
+ WARN: NVM is not installed
+ INFO: to install NVM and Node.js (LTS) use: manage nvm install --lts
+
+To install you can also use :ref:`make nvm.nodejs`
+
+.. _make nvm.nodejs:
+
+``make nvm.nodejs``
+===================
+
+Install latest Node.js_ LTS locally (uses nvm_)::
+
+ $ make nvm.nodejs
+ INFO: install (update) NVM at /share/searxng/.nvm
+ INFO: clone: https://github.com/nvm-sh/nvm.git
+ ...
+ Downloading and installing node v16.13.0...
+ ...
+ INFO: Node.js is installed at searxng/.nvm/versions/node/v16.13.0/bin/node
+ INFO: Node.js is version v16.13.0
+ INFO: npm is installed at searxng/.nvm/versions/node/v16.13.0/bin/npm
+ INFO: npm is version 8.1.0
+ INFO: NVM is installed at searxng/.nvm
+
.. _make run:
``make run``
@@ -133,14 +187,16 @@ browser (:man:`xdg-open`)::
``make clean``
==============
-Drop all intermediate files, all builds, but keep sources untouched. Before
-calling ``make clean`` stop all processes using :ref:`make install`. ::
+Drops all intermediate files, all builds, but keep sources untouched. Before
+calling ``make clean`` stop all processes using the :ref:`make install` or
+:ref:`make node.env`. ::
$ make clean
CLEAN pyenv
- PYENV [virtualenv] drop ./local/py3
- CLEAN docs -- ./build/docs ./dist/docs
- CLEAN locally installed npm dependencies
+ PYENV [virtualenv] drop local/py3
+ CLEAN docs -- build/docs dist/docs
+ CLEAN themes -- locally installed npm dependencies
+ ...
CLEAN test stuff
CLEAN common files
diff --git a/docs/dev/quickstart.rst b/docs/dev/quickstart.rst
index fee09216..7e4ce8b6 100644
--- a/docs/dev/quickstart.rst
+++ b/docs/dev/quickstart.rst
@@ -5,6 +5,7 @@ Development Quickstart
======================
.. _npm: https://www.npmjs.com/
+.. _Node.js: https://nodejs.org/
SearXNG loves developers, just clone and start hacking. All the rest is done for
you simply by using :ref:`make <makefile>`.
@@ -24,37 +25,27 @@ choose a meaningful commit message and we are happy to receive your pull
request. To not end in *wild west* we have some directives, please pay attention
to our ":ref:`how to contribute`" guideline.
-If you implement themes, you will need to compile styles and JavaScript before
-*run*.
+If you implement themes, you will need to setup a :ref:`make node.env` once:
.. code:: sh
- make themes.all
-
-Don't forget to install npm_ first.
-
-.. tabs::
-
- .. group-tab:: Ubuntu / debian
-
- .. code:: sh
+ make node.env
- sudo -H apt-get install npm
+Before you call *make run* (2.), you need to compile the modified styles and
+JavaScript:
- .. group-tab:: Arch Linux
-
- .. code-block:: sh
-
- sudo -H pacman -S npm
+.. code:: sh
- .. group-tab:: Fedora / RHEL
+ make themes.all
- .. code-block:: sh
+Alternatively you can also compile selective the theme you have modified,
+e.g. the *simple* theme.
+.. code:: sh
- sudo -H dnf install npm
+ make themes.simple
If you finished your *tests* you can start to commit your changes. To separate
-the changed code from the build products first run:
+the modified source code from the build products first run:
.. code:: sh