From 22c7b2a7c48eadaf8ee66a4cee1311f092a91c2f Mon Sep 17 00:00:00 2001 From: Pierre-Louis GONON Date: Tue, 9 Jul 2024 16:08:47 +0200 Subject: [PATCH] Update tools used for PoWA-Web development --- docs/components/powa-web/development.rst | 48 ++++++++++++++++-------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/docs/components/powa-web/development.rst b/docs/components/powa-web/development.rst index e0f4f70..305105a 100644 --- a/docs/components/powa-web/development.rst +++ b/docs/components/powa-web/development.rst @@ -17,27 +17,45 @@ Clone the repository: .. code:: bash git clone https://github.com/powa-team/powa-web/ - cd powa/ - make && sudo make install + cd powa-web/ -To run the application, use run_powa.py, which will run powa in debug mode. -That means the javascript files will not be minified, and will not be compiled -into one giant source file. +Then, create a Python3 virtualenv and install the project dependencies: +.. code:: bash + + python3 -m venv .venv --upgrade-deps + . .venv/bin/activate + pip install -r requirements.txt + +In case you want to contribute on the styles, first install the NodeJS dev dependencies: -CSS files are generated using `sass `. -Javascript files are splitted into AMD modules, which are managed by `requirejs -` and compiled using `grunt `. +.. code:: bash -These projects depend on NodeJS, and NPM, its package manager, so make sure you are able to install them on your -distribution. + npm ci -Install the development dependencies: +After installing the dependencies, you can start the ViteJS development server with: .. code:: bash - npm install -g grunt-cli - npm install . + npm run dev + +This command launches a local server at http://localhost:5173 with hot module replacement, +enabling real-time updates as you modify the project files. + +To run the application, use ``run_powa.py`` in the PoWA-Web project root, which will run PoWa in debug mode. + +.. code:: bash + + cd powa-web/ + ./run_powa.py + [I 240718 09:13:07 run_powa:11] Starting powa-web on http://127.0.0.1:8888/ + +If you don't already have a running instance of PoWA, you can easily deploy an environment +for PoWa web development using `powa-podman `_. +This project provides container images and compose files in its dev directory. + +Once you have cloned it, you can start the PoWA stack and specify your PoWA-Web development location. -Then, you can run ``grunt`` to update only the css files, or regenerate optimized -javascript builds with ``grunt dist``. +PoWA-Web uses `ViteJS` and `Vue 3` for a more integrated and performant +front-end development experience. + \ No newline at end of file