Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contrib development #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ database:
type: mariadb
version: "10.6"
performance_mode: none
hooks:
post-start:
- exec: mkdir -p repos
- exec: mkdir -p web/browser_output
- exec: chmod +w web/browser_output
use_dns_when_possible: true
composer_version: ""
web_environment: []
corepack_enable: true
hooks:
post-start:
- exec: "mkdir -p repos"
- exec: "mkdir -p web/browser_output"
- exec: "chmod +w web/browser_output"
ddev_version_constraint: '>= 1.23'

# Key features of DDEV's config.yaml:

Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

- Drupal 11.x support
- ARM-architechture support Selenium-Chrome image.
- [joachim-n/drupal-project-contrib-development](https://github.com/joachim-n/drupal-core-development-project) for easier contrib development
- Simpler setup
- VSCode support

Expand All @@ -13,15 +12,18 @@
- Install [DDEV](https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/)
- `ddev start`
- Replace `MODULE_NAME` on following with name of your contrib module (use admin_toolbar).
- `mkdir -p repos; cd repos`
- `git clone [email protected]:project/MODULE_NAME`
- `cd ..`
- `ddev composer install`

### Alternative way to include new modules.
### Adding new modules:

This is work-a-round until following issues are resolved:
- https://github.com/joachim-n/drupal-core-development-project/issues/14
- https://github.com/joachim-n/drupal-core-development-project/pull/28


- `ddev composer require drupal/MODULE_NAME`
- `ddev composer drupal-contrib:switch-clone MODULE_NAME`
- `cd web/modules/contrib; rm -rf MODULE_NAME`
- `git clone [email protected]:project/MODULE_NAME`

## PHPStan

Expand Down Expand Up @@ -64,6 +66,7 @@ ddev eslint web/modules/contrib/MODULE_NAME --fix

## Run PHPUnit tests

- `ddev phpunit web/modules/contrib/MODULE_NAME`
- `ddev phpunit --debug web/modules/contrib/MODULE_NAME`
- `ddev phpunit --group MODULE_NAME`

Expand Down
10 changes: 0 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
"license": "GPL-2.0-or-later",
"homepage": "https://github.com/mstrelan/ddev-phpunit-demo",
"repositories": {
"admin_toolbar": {
"type": "path",
"url": "repos/admin_toolbar",
"options": {
"versions": {
"drupal/admin_toolbar": "3.5.0"
}
}
},
"0": {
"type": "composer",
"url": "https://packages.drupal.org/8"
Expand All @@ -27,7 +18,6 @@
"drupal/core-recommended": "^11",
"drupal/devel": "^5.2",
"drush/drush": "^13.0",
"joachim-n/drupal-project-contrib-development": "dev-main",
"weitzman/drupal-test-traits": "^2"
},
"conflict": {
Expand Down
97 changes: 47 additions & 50 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<!-- Example SIMPLETEST_BASE_URL value: http://localhost -->
<env name="SIMPLETEST_BASE_URL" value="http://ddev-phpunit-demo.ddev.site"/>
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix -->
<env name="SIMPLETEST_DB" value="sqlite://localhost/sites/simpletest/db.sqlite"/>
<env name="SIMPLETEST_DB" value="mysql://db:db@db/db"/>
<!--<env name="SIMPLETEST_DB" value="sqlite://localhost/sites/simpletest/db.sqlite"/>-->
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output -->
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/var/www/html/web/browser_output"/>
<!-- <env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/var/www/html/web/sites/simpletest/browser_output"/> -->
Expand Down