Skip to content
Merged
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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Commands
============
This project provides the following DDEV container commands.

- [ddev poser](https://github.com/ddev/ddev-drupal-contrib/blob/main/commands/web/poser). This edits composer.json so that `drupal/core-recommended` becomes a dev dependency. then, it runs `composer install`. It is perfectly acceptable to skip this command and edit the require-dev of composer.json by hand.
- [ddev poser](https://github.com/ddev/ddev-drupal-contrib/blob/main/commands/web/poser).
- Edits composer.json so that `drupal/core-recommended` becomes a dev dependency.
- Runs `composer install` AND `yarn install` so that dependencies are available.
- Note: it is perfectly acceptable to skip this command and edit the require-dev of composer.json by hand.
- [ddev symlink-project](https://github.com/ddev/ddev-drupal-contrib/blob/main/commands/web/symlink-project). This symlinks the top level files of your project into web/modules/custom so that Drupal finds your module. This command runs automatically on every `ddev start`. See codebase image below.
- `ddev phpunit`. Run phpunit tests on the web/modules/custom directory.
- `ddev nightwatch`. Run nightwatch tests on the web/modules/custom directory.
Expand Down
7 changes: 6 additions & 1 deletion commands/web/eslint
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
## ExecRaw: true

if "$DDEV_DOCROOT/core/node_modules/.bin/eslint" --version >/dev/null ; then
"$DDEV_DOCROOT/core/node_modules/.bin/eslint" --no-error-on-unmatched-pattern --ignore-pattern "*.es6.js" --config "$DDEV_DOCROOT/core/.eslintrc.legacy.json" --resolve-plugins-relative-to "$DDEV_DOCROOT/core" "$DDEV_DOCROOT/modules/custom/**/*.js"
# Configure prettier
test -e .prettierrc.json || ln -s $DDEV_DOCROOT/core/.prettierrc.json .
test -e .prettierignore || echo '*.yml' > .prettierignore
# Change directory to the project root folder
cd "$DDEV_DOCROOT/modules/custom/$DDEV_SITENAME" || exit
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/eslint" --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core --ext=.js,.yml . "$@"
else
echo "eslint is not available. You may need to 'ddev yarn --cwd $DDEV_DOCROOT/core install'"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion commands/web/phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ if ! command -v phpunit >/dev/null; then
echo "phpunit is not available. You may need to 'ddev composer install'"
exit 1
fi
phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --bootstrap web/core/tests/bootstrap.php --testdox web/modules/custom "$@"
phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox web/modules/custom "$@"
5 changes: 2 additions & 3 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ teardown() {
ddev yarn --cwd web/core install
ddev exec touch web/core/.env
ddev stylelint --version
# Awaiting resolution of eslint-plugin-prettier missing error https://drupal.slack.com/archives/CGKLP028K/p1682724930680409
# ddev eslint --version
}
ddev eslint --version
}