quickstart.rst 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. .. _devquickstart:
  2. ======================
  3. Development Quickstart
  4. ======================
  5. .. _npm: https://www.npmjs.com/
  6. .. _Node.js: https://nodejs.org/
  7. .. _eslint: https://eslint.org/
  8. .. _stylelint: https://stylelint.io/
  9. .. sidebar:: further read
  10. - :ref:`makefile`
  11. - :ref:`buildhosts`
  12. SearXNG loves developers; Developers do not need to worry about tool chains, the
  13. usual developer tasks can be comfortably executed via :ref:`make <makefile>`.
  14. Don't hesitate, just clone SearXNG's sources and start hacking right now ..
  15. .. code:: bash
  16. git clone https://github.com/searxng/searxng.git searxng
  17. Here is how a minimal workflow looks like:
  18. 1. *start* hacking
  19. 2. *run* your code: :ref:`make run`
  20. 3. *format & test* your code: :ref:`make format.python` and :ref:`make test`
  21. If you think at some point something fails, go back to *start*. Otherwise,
  22. choose a meaningful commit message and we are happy to receive your pull
  23. request. To not end in *wild west* we have some directives, please pay attention
  24. to our ":ref:`how to contribute`" guideline.
  25. .. sidebar:: further read
  26. - :ref:`make nvm`
  27. - :ref:`make themes`
  28. If you implement themes, you will need to setup a :ref:`Node.js environment
  29. <make node.env>`. Before you call *make run* (2.), you need to compile the
  30. modified styles and JavaScript: ``make node.clean themes.all``. If eslint_ or
  31. stylelint_ report some issues, try ``make themes.fix``.
  32. Alternatively you can also compile selective the theme you have modified,
  33. e.g. the *simple* theme.
  34. .. code:: bash
  35. make themes.simple
  36. .. tip::
  37. To get live builds while modifying CSS & JS use: ``LIVE_THEME=simple make run``
  38. .. sidebar:: further read
  39. - :ref:`make static.build`
  40. If you finished your *tests* you can start to commit your changes. To separate
  41. the modified source code from the build products first run:
  42. .. code:: bash
  43. make static.build.restore
  44. This will restore the old build products and only your changes of the code
  45. remain in the working tree which can now be added & committed. When all sources
  46. are committed, you can commit the build products simply by:
  47. .. code:: bash
  48. make static.build.commit
  49. Committing the build products should be the last step, just before you send us
  50. your PR. There is also a make target to rewind this last build commit:
  51. .. code:: bash
  52. make static.build.drop