2016-04-21 13:15:04 +02:00
|
|
|
.. _devquickstart:
|
|
|
|
|
2019-12-12 19:20:56 +01:00
|
|
|
======================
|
2016-02-01 21:28:13 +01:00
|
|
|
Development Quickstart
|
2019-12-12 19:20:56 +01:00
|
|
|
======================
|
2016-02-01 21:28:13 +01:00
|
|
|
|
2020-12-12 20:31:49 +01:00
|
|
|
.. _npm: https://www.npmjs.com/
|
2021-11-14 18:10:14 +01:00
|
|
|
.. _Node.js: https://nodejs.org/
|
2019-12-18 16:11:05 +01:00
|
|
|
|
2023-08-06 16:39:00 +02:00
|
|
|
|
|
|
|
.. sidebar:: further read
|
|
|
|
|
|
|
|
- :ref:`makefile`
|
|
|
|
- :ref:`buildhosts`
|
|
|
|
|
|
|
|
SearXNG loves developers; Developers do not need to worry about tool chains, the
|
|
|
|
usual developer tasks can be comfortably executed via :ref:`make <makefile>`.
|
|
|
|
|
|
|
|
Don't hesitate, just clone SearXNG's sources and start hacking right now ..
|
2016-02-01 21:28:13 +01:00
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. code:: bash
|
2016-02-01 21:28:13 +01:00
|
|
|
|
2021-11-18 18:27:26 +01:00
|
|
|
git clone https://github.com/searxng/searxng.git searxng
|
2016-02-01 21:28:13 +01:00
|
|
|
|
2020-12-12 20:31:49 +01:00
|
|
|
Here is how a minimal workflow looks like:
|
2019-12-12 19:20:56 +01:00
|
|
|
|
2020-12-12 20:31:49 +01:00
|
|
|
1. *start* hacking
|
|
|
|
2. *run* your code: :ref:`make run`
|
2023-08-06 16:39:00 +02:00
|
|
|
3. *format & test* your code: :ref:`make format.python` and :ref:`make test`
|
2016-02-01 21:28:13 +01:00
|
|
|
|
2020-12-12 20:31:49 +01:00
|
|
|
If you think at some point something fails, go back to *start*. Otherwise,
|
|
|
|
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.
|
2016-02-01 21:28:13 +01:00
|
|
|
|
2023-08-06 16:39:00 +02:00
|
|
|
.. sidebar:: further read
|
2016-02-01 21:28:13 +01:00
|
|
|
|
2023-08-06 16:39:00 +02:00
|
|
|
- :ref:`make nvm`
|
|
|
|
- :ref:`make themes`
|
2016-02-01 21:28:13 +01:00
|
|
|
|
2023-08-06 16:39:00 +02:00
|
|
|
If you implement themes, you will need to setup a :ref:`Node.js environment
|
|
|
|
<make node.env>`: ``make node.env``
|
2016-04-21 13:15:04 +02:00
|
|
|
|
2021-11-14 18:10:14 +01:00
|
|
|
Before you call *make run* (2.), you need to compile the modified styles and
|
2023-08-06 16:39:00 +02:00
|
|
|
JavaScript: ``make themes.all``
|
2019-12-12 19:20:56 +01:00
|
|
|
|
2021-11-14 18:10:14 +01:00
|
|
|
Alternatively you can also compile selective the theme you have modified,
|
|
|
|
e.g. the *simple* theme.
|
2021-12-29 21:28:25 +01:00
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. code:: bash
|
2019-12-18 16:11:05 +01:00
|
|
|
|
2021-11-14 18:10:14 +01:00
|
|
|
make themes.simple
|
2019-12-18 16:11:05 +01:00
|
|
|
|
2021-12-29 21:28:25 +01:00
|
|
|
.. tip::
|
|
|
|
|
|
|
|
To get live builds while modifying CSS & JS use: ``LIVE_THEME=simple make run``
|
|
|
|
|
2023-08-06 16:39:00 +02:00
|
|
|
.. sidebar:: further read
|
|
|
|
|
|
|
|
- :ref:`make static.build`
|
|
|
|
|
2021-06-26 13:10:56 +02:00
|
|
|
If you finished your *tests* you can start to commit your changes. To separate
|
2021-11-14 18:10:14 +01:00
|
|
|
the modified source code from the build products first run:
|
2021-06-26 13:10:56 +02:00
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. code:: bash
|
2021-06-26 13:10:56 +02:00
|
|
|
|
|
|
|
make static.build.restore
|
|
|
|
|
|
|
|
This will restore the old build products and only your changes of the code
|
2023-08-11 16:01:54 +02:00
|
|
|
remain in the working tree which can now be added & committed. When all sources
|
|
|
|
are committed, you can commit the build products simply by:
|
2021-06-26 13:10:56 +02:00
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. code:: bash
|
2021-06-26 13:10:56 +02:00
|
|
|
|
|
|
|
make static.build.commit
|
|
|
|
|
2023-08-11 16:01:54 +02:00
|
|
|
Committing the build products should be the last step, just before you send us
|
2021-06-26 13:10:56 +02:00
|
|
|
your PR. There is also a make target to rewind this last build commit:
|
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. code:: bash
|
2021-06-26 13:10:56 +02:00
|
|
|
|
|
|
|
make static.build.drop
|