J4.x

Setting Up Your Local Environment/fr: Difference between revisions

From Joomla! Documentation

Created page with "Ceci lancera d'autres suites de test JavaScript."
Created page with "PHP - fondamentalement le même que celui dont vous avez besoin pour exécuter un site Joomla, mais vous avez besoin de la version PHP CLI (interface en ligne de commande) (vo..."
Line 10: Line 10:


=== Outils nécessaires ===
=== Outils nécessaires ===
# PHP - basically the same as you need for running a Joomla Site, but you need the PHP CLI (command line interface) Version (see the [[S:MyLanguage/Configuring_a_LAMPP_server_for_PHP_development|Configuring a LAMPP server for PHP development]] page)
# PHP - fondamentalement le même que celui dont vous avez besoin pour exécuter un site Joomla, mais vous avez besoin de la version PHP CLI (interface en ligne de commande) (voir la page [[S:MyLanguage/Configuring_a_LAMPP_server_for_PHP_development|Configuration d'un serveur LAMPP pour le développement PHP]]).
# Composer - for managing Joomla's PHP Dependencies - for help installing Composer read the documentation at https://getcomposer.org/doc/00-intro.md
# Composer - for managing Joomla's PHP Dependencies - for help installing Composer read the documentation at https://getcomposer.org/doc/00-intro.md
# Node.js - for compiling Joomla's JavaScript and SASS files - for help installing Node.js please follow the instructions available on https://nodejs.org/en/
# Node.js - for compiling Joomla's JavaScript and SASS files - for help installing Node.js please follow the instructions available on https://nodejs.org/en/

Revision as of 11:15, 4 August 2018

Didacticiel
Comment paramétrer un environnement local pour Joomla 4
Joomla! 
4.x

Avec Joomla 4, nous avons changé le processus de développement, il n'est plus possible de cloner le dépôt et d'avoir une installation Joomla utilisable. Nous suivons ici les meilleures pratiques et avons mis en place un processus de construction pour le CMS.

Guide d'installation rapide

La configuration de environnement de développement dépend de votre système d'exploitation. Nous ne pouvons pas écrire de documentation pour tous les systèmes d'exploitation donc vous devriez pouvoir trouver des manuels sur votre moteur de recherche préféré.

Outils nécessaires

  1. PHP - fondamentalement le même que celui dont vous avez besoin pour exécuter un site Joomla, mais vous avez besoin de la version PHP CLI (interface en ligne de commande) (voir la page Configuration d'un serveur LAMPP pour le développement PHP).
  2. Composer - for managing Joomla's PHP Dependencies - for help installing Composer read the documentation at https://getcomposer.org/doc/00-intro.md
  3. Node.js - for compiling Joomla's JavaScript and SASS files - for help installing Node.js please follow the instructions available on https://nodejs.org/en/
  4. Git - for version management

Etapes pour paramétrer votre environnement local

  1. Cloner le dépôt
  2. run composer install from the root of the git repo (you can add --ignore-platform-reqs if you don't have the PHP-LDAP locally installed and you don't need it)
  3. run npm install from the root of the git repo

Guide d'installation un peu plus détaillé

Joomla is not different to many other web tools these days. It has a large PHP part and it has more and more JavaScript code. While PHP coding doesn't need so much preparation, JavaScript needs a lot tooling around. The main reason is that nobody writes code in a way that every browser understands, so the code needs transpiling from e.g. ES6 to a compatible version of JavaScript. The same is true for CSS, for Joomla we are using SASS and this will be converted to native CSS so that any browser understands it. As downside setting up a dev environment is a bit more complicated but the tooling make coding also more convenient. Thanks to watchers and browser auto reload you can see your change in real time.

PHP

It should be enough to run composer install as this will install PHP dependencies saved in the composer.lock file. You can do this as many times as you like, it will only install new packages when the composer.lock file is changed. Don't run composer update as this will update all packages to newer versions and update the composer.lock file.

Note: You may need to run composer install with the --ignore-platform-reqs option to ignore platform requirements specified in Composer, i.e. if you do not have PHP's LDAP extension installed.

Scripts Node/npm

Node.js comes with a package manager called NPM (in some way the same as Composer). NPM has a run command and we have prepared some scripts to make your life easier. You have to run the commands for the root of the repository.

npm run build:css

It will compile SASS files to CSS and also create the minified files.

npm run build:js

It will compile and transpile the JavaScript files to the correct format and create minified files

npm run watch:css

This is the same as the build:css command but will watch for changes and automatically build updated files.

npm run watch:js

This is the same as the build:js command but will watch for changes and automatically build updated files.

npm run lint:js

This will make a syntax check on JavaScript files.

test d'exécution npm

Ceci lancera d'autres suites de test JavaScript.