pronovix / drupal-module-template
Module template for Drupal modules.
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 2
Type:project
Requires
- php: >= 7.1
Requires (Dev)
- composer/composer: ~1.7.0
- symfony/yaml: ^3.4 | ^4.0
This package is auto-updated.
Last update: 2020-06-30 01:21:26 UTC
README
Start development of a new module
Building a new module with Composer
$ composer create-project -s dev pronovix/drupal-module-template path/to/my_module
or
$ docker run --rm -it -v $PWD:/app --user $(id -u):$(id -g) composer create-project -s dev pronovix/drupal-module-template my_module
See the composer documentation for details.
Contributing to this template
- Spin up the containers inside the
.dev
folder withdocker-compose up -d
. - Open an interactive shell with
docker-compose exec php bash
and run any command that you need.
Test module creation from this template:
Run this inside the php
container:
$ COMPOSER_MIRROR_PATH_REPOS=1 composer create-project --repository='{"type": "path", "url": "/mnt/files/drupal_module"}' -s dev pronovix/drupal-module-template /path/in/container/my_module
Alternatively, you can use the official Composer image for the same, just run this command in the root of the template:
$ docker run --rm -it -v $PWD:/app -v /tmp:/tmp --user $(id -u):$(id -g) -e COMPOSER_MIRROR_PATH_REPOS=1 composer:1.7 create-project --repository='{"type": "path", "url": "/app"}' -s dev pronovix/drupal-module-template /tmp/my_module
(This will create a module from the template in the host system's /tmp/my_module
folder.)
Applying/updating template files on an existing module
- Follow the steps from "Building a new module with Composer". If your module's machine name is
foobar
use that as a parameter, likecomposer create-project -s dev pronovix/drupal-module-template foobar
. - Move the following folders and files from the created folder to your module's root:
.dev
docs
- Move or merge the content of any remaining files and folders.
- Pay more attention when you are merging the
composer.json
files, especially to therequire-dev
section which defines the correct versions of the testing related dependencies. - If you do not want to run tests on Travis CI then files that contains
travis
can be ignored.
Credits
Inspired by the OpenEuropa Drupal module template.