Keruald: Difference between revisions
(+phpcs.xml) |
|||
Line 41: | Line 41: | ||
To create a new library quux, we need a new empty manyrepo on DevCentral, a mirror on GitHub and to declare it on Packagist: | To create a new library quux, we need a new empty manyrepo on DevCentral, a mirror on GitHub and to declare it on Packagist: | ||
# Create an empty folder in the monorepo repository with the name of the package, here <code>mkdir quux</code> | |||
# Regenerate shared files with <code>make clean all</code> (you need Python and Jinja2): that will add your repository to files like phpcs.xml | |||
# Create on DevCentral a new repository with a callsign starting by K for Keruald like KQUUX, and "quux" as shortname | # Create on DevCentral a new repository with a callsign starting by K for Keruald like KQUUX, and "quux" as shortname | ||
# Create on GitHub a new repository called keruald/quux | # Create on GitHub a new repository called keruald/quux |
Revision as of 22:45, 20 February 2022
Keruald is a set of libraries to build PHP applications.
Libraries
Package name | Description |
---|---|
keruald/omnitools | General purpose library |
keruald/globalfunctions | Wrapper to replace our old old sites "core.php" by calls to omnitools |
keruald/commands | Create simple CLI application |
keruald/report | Reporting library |
keruald/health | Site health check |
keruald/dockerhub | Docker Hub, managing payload signatures |
keruald/mailgun | Mailgun API client |
keruald/database | Database abstraction layer |
keruald/broker | Wrapper around brokers like RabbitMQ |
Developer guide
Contribution workflow
You'll find the general contribution guide at How to contribute code. Here some pointers specific for Keruald libraries.
We use a monorepo: clone the rKERUALD repository on DevCentral, you'll find your library as a direct subdirectory on it.
Each subdirectory matches:
- a resource folder, not included in packages, if starting by an underscore _ or a dot .
- a name of a package if starting by a letter, e.g. keruald/commands for commands/
How to create a new library?
To create a new library quux, we need a new empty manyrepo on DevCentral, a mirror on GitHub and to declare it on Packagist:
- Create an empty folder in the monorepo repository with the name of the package, here
mkdir quux
- Regenerate shared files with
make clean all
(you need Python and Jinja2): that will add your repository to files like phpcs.xml - Create on DevCentral a new repository with a callsign starting by K for Keruald like KQUUX, and "quux" as shortname
- Create on GitHub a new repository called keruald/quux
- Publish on packagist
If the shortname is already taken on DevCentral, it's time to create a new task to provide a map of subdirectory/package repository.
Don't commit anything in newly created repos but contribute as usual by creating quux/ subdirectory in the monorepo
Annex A. IDE configuration
PhpStorm
Clone the monorepo on your drive, then open it in PhpStorm to generate an .idea folder.
- Edit keruald.iml with this modules content to declare the code namespaces: https://devcentral.nasqueron.org/P300
- For code style, you can use https://github.com/nasqueron/codestyle/blob/main/JetBrains/php-codestyle.xml