From e64d91c0f67b420da7d3dd913babf21f202a889b Mon Sep 17 00:00:00 2001 From: Private Maker Date: Sun, 17 Sep 2023 21:42:20 +0000 Subject: [PATCH 1/2] add 'Working with ... code' docs from server/README Signed-off-by: Private Maker --- developer_manual/core/code-back-end.rst | 13 ++++ developer_manual/core/code-front-end.rst | 76 ++++++++++++++++++++++++ developer_manual/core/index.rst | 2 + 3 files changed, 91 insertions(+) create mode 100644 developer_manual/core/code-back-end.rst create mode 100644 developer_manual/core/code-front-end.rst diff --git a/developer_manual/core/code-back-end.rst b/developer_manual/core/code-back-end.rst new file mode 100644 index 000000000..af04c7d0e --- /dev/null +++ b/developer_manual/core/code-back-end.rst @@ -0,0 +1,13 @@ +============= +Back-end code +============= + +When changing back-end PHP code, in general, no additional steps are needed before checking in. + +However, if new files were created, you will need to run the following command to update the autoloader files: + +.. code-block:: console + + build/autoloaderchecker.sh + +After that, please also include the autoloader file changes in your commits. diff --git a/developer_manual/core/code-front-end.rst b/developer_manual/core/code-front-end.rst new file mode 100644 index 000000000..4043c253a --- /dev/null +++ b/developer_manual/core/code-front-end.rst @@ -0,0 +1,76 @@ +============== +Front-end code +============== + +Building Vue components and scripts +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We are moving more and more toward using Vue.js in the front-end, starting with Settings. For building the code on changes, use these terminal commands in the root folder: + +.. code-block:: console + + # install dependencies + make dev-setup + + # build for development + make build-js + + # build for development and watch edits + make watch-js + + # build for production with minification + make build-js-production + + +Building styles +^^^^^^^^^^^^^^^ + +Styles are written in SCSS and compiled to css. + +.. code-block:: console + + # install dependencies + make dev-setup + + # compile style sheets + npm run sass + + # compile style sheets and watch edits + npm run sass:watch + + +Committing changes +^^^^^^^^^^^^^^^^^^ + +**When making changes, also commit the compiled files!** + +We still use Handlebars templates in some places in Files and Settings. We will replace these step-by-step with Vue.js, but in the meantime, you need to compile them separately. + +If you don’t have Handlebars installed yet, you can do it with this terminal command: + +.. code-block:: console + + sudo npm install -g handlebars + +Then inside the root folder of your local Nextcloud development installation, run this command in the terminal every time you changed a ``.handlebars`` file to compile it: + +.. code-block:: console + + ./build/compile-handlebars-templates.sh + +Before checking in JS changes, make sure to also build for production: + +.. code-block:: console + + make build-js-production + + +Then add the compiled files for committing. + +To save some time, to only rebuild for a specific app, use the following and replace the module with the app name: + +.. code-block:: console + + MODULE=user_status make build-js-production + +Please note that if you used ``make build-js`` or ``make watch-js`` before, you'll notice that a lot of files were marked as changed, so might need to clear the workspace first. diff --git a/developer_manual/core/index.rst b/developer_manual/core/index.rst index d7031c5ff..37bd251c1 100644 --- a/developer_manual/core/index.rst +++ b/developer_manual/core/index.rst @@ -9,6 +9,8 @@ Please make sure you have set up a :ref:`devenv`. .. toctree:: :maxdepth: 2 + code-front-end + code-back-end static-analysis unit-testing externalapi From 60eca39660c41cfa28d3ad95a944299081df23fe Mon Sep 17 00:00:00 2001 From: Private Maker <49612519+privatemaker@users.noreply.github.com> Date: Tue, 19 Sep 2023 22:15:37 +0200 Subject: [PATCH 2/2] Update developer_manual/core/code-front-end.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: John Molakvoæ Signed-off-by: Private Maker <49612519+privatemaker@users.noreply.github.com> --- developer_manual/core/code-front-end.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/developer_manual/core/code-front-end.rst b/developer_manual/core/code-front-end.rst index 4043c253a..d8139f1c6 100644 --- a/developer_manual/core/code-front-end.rst +++ b/developer_manual/core/code-front-end.rst @@ -10,16 +10,16 @@ We are moving more and more toward using Vue.js in the front-end, starting with .. code-block:: console # install dependencies - make dev-setup + npm install # build for development - make build-js + npm run dev # build for development and watch edits - make watch-js + npm run watch # build for production with minification - make build-js-production + npm run build Building styles