Tired of building module from scratch every time?
Not satisfied with the PrestaShop generator?
Want an up-to-date bedrock to start with?
Consider cloning this repository and start from kjmodulebedrock!
You can use it freely to develop and sell your own modules.
- Code quality checking with GitHub Actions (CI/CD) and GrumPHP (Local).
- Assets compilation with Webpack
- Multistore configuration form
Get started
git clone https://github.com/Kaudaj/kjmodulebedrock.git
# Then create your own module from it
cp -R kjmodulebedrock yourmodule
cd yourmodule
rm -rf .git
git init
composer install
cd _dev
npm install
Recommended: Automate the process
Here is a bash script to create a new module from kjmodulebedrock.
It uses fop:module:rename
command from fop_console
project to automate the "search/replace occurences" process. It will also link the local repository to your GitHub remote one if it exists.
It's highly recommended to create an alias for the create-new-module
script in order to use it in all your PrestaShop projects. The instructions are available in this gist. Replace <your-command>
by /path/to/create-new-module.sh
and your-alias
with whatever you want.
Make sure you are at the root of your PrestaShop environment and run the script like this:
your-alias PREFIX,ModuleClassName
# Example
ps-new-module KJ,MyModule
tests/php/.phpstan_bootstrap_config.php
For GrumPHP: Set PrestaShop installation path for PHPStan task.
Replace default path with the root path of a stable PrestaShop environment.
Here are some useful commands you could need during your development workflow:
composer grum
Run GrumPHP tasks suite.composer header-stamp
Add license headers to files.composer autoindex
Add index files in directories.composer dumpautoload -a
Update the autoloader when you add new classes in a classmap package (src
andtests
folder here).npm run watch
(in_dev
folder) Watch for changes in_dev
folder and build automatically the assets inviews/dist
folder. It's recommended to run it in background, in a dedicated terminal.
PrestaShop | >=1.7.8.0 |
PHP | >=7.1 for production and >=7.3 for development |
Multishop | ✔️ |
You can report issues in this very repository.
As it is an open source project, everyone is welcome and even encouraged to contribute with their own improvements!
To contribute in the best way possible, you want to follow the PrestaShop contribution guidelines.
Feel free to contact us by email at [email protected].