- Each feature must be developed in a plugin.
- Plugins need to follow our naming convention:
- Name: FD Blabla Lala
- Plugin slug: fd-blabla-lala
- kebab-case
- Plugin root file: fd-blabla-lala.php
- kebab-case
- Author: FUNKE Digital GmbH (Heiko Mamerow, Alexander Merz), Patrick Schinkel, Christian Storm,
- Always FUNKE first; external developers second.
- The names are sorted alphabetically by surname.
- Namespace: Fd_Blabla_Lala;
- Capitalized_Snake_Case
- Use same namespace inside the plugin.
- No PHPCS errors are allowed. (Warnings are still ok.)
- If the plugin is developed with build process, then the package.json with the build script and package dependencies needs to be included.
Workflow
We bring new features with plugins to our website. We never touch the themes nor external plugins. We always rely on our own self-hosted plugins.
Development with submodules
npm scripts
Install the dependencies with npm install:
- in the root folder
- in the
plugins/fd-newspack-extensionfolder - in all other plugin folders you want to work on
Automatic browser reload after file change
This is a little helper for development. It watches for file changes and reloads the browser automatically.
- Configure browser-sync-config.js for your needs:
proxyadd the URL of your local development domain e.g.https://4players-fdpub-de-3.fdpub.vipdev.lndo.site
- Start the dev-env with
vip dev-env start --slug=fdpub - Run
npm run startThis will also start the server and the watcher. - Open your browser at
https://localhost:3000
Pro tip: If all your devices are in the same proper wifi network environment, you can also open the localhost address on your mobile. If you scroll in one device it will also scroll in the other device. Unfortunately the office wifi is not allowing this. ;-(
IntelliJ IDEA scripts
In the .run folder are some helper scripts for IntelliJ IDEA.
Got to Run -> Run and click on the script you want.
The script names are self-explaining:
vip dev-env startstarts the local development environmentvip dev-env syncsyncs from fdpub to localvip dev-env logsshows the logs of the local development environment in your terminal
Plugin Development with Sub-module
- Git pull, main repository of your cluster
- Delete the Plugin in this reposetory on which we want to work
- Add this plugin on which you want to work with as sub-module
composer u funke-pe/[Name of the plugin] --prefer-source
- Do your work or changes
- For commiting your changes in sub-module, go to sub-mudule folder
- cd plugins/[Name of the plugin]
- Do git activities in this sub-module folder.
- Later when you finish the changes of sub-module plugin, you need to make new release of the plugin
- you can add the new plugin version into the clustor repository.
- Delete the sub-module folder
- Change to the cluster repository root folder.
- Edit version number in the root composer json
- Start composer update (composer u).
- Add and commit the changes from the new plugin version into the cluster repositry.