Skip to content

Commit

Permalink
Merge branch 'main' into core-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman authored Oct 21, 2024
2 parents 3b5c56c + 241e70e commit 0df55fe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ DDEV integration for developing Drupal contrib projects. As a general philosophy
1. If you haven't already, [install Docker and DDEV](https://ddev.readthedocs.io/en/latest/users/install/)
2. `git clone` your contrib module
3. cd [contrib module directory]
4. Configure DDEV for Drupal using `ddev config --project-name=[contrib module] --project-type=drupal --docroot=web --php-version=8.2` or select these options when prompted using `ddev config`
- Remove underscores in the project name, or replace with hyphens.
4. Configure DDEV for Drupal using `ddev config --project-type=drupal --docroot=web --php-version=8.3 --project-name=[module]` or select these options when prompted using `ddev config`
- Remove underscores in the project name, or replace with hyphens. (DDEV will do this for you in v1.23.5+)
- See [Misc](#misc) for help on using alternate versions of Drupal core.
5. Run `ddev get ddev/ddev-drupal-contrib`
6. Run `ddev start`
7. Run `ddev poser`
8. Run `ddev symlink-project`
9. `ddev config --update` to detect expected Drupal and PHP versions.
10. `ddev restart`

## Update

Expand Down
4 changes: 2 additions & 2 deletions commands/web/eslint
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ if "$DDEV_DOCROOT/core/node_modules/.bin/eslint" --version >/dev/null ; then
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
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'"
echo "eslint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'"
exit 1
fi
7 changes: 7 additions & 0 deletions commands/web/expand-composer-json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@
export _WEB_ROOT=$DDEV_DOCROOT
cd "$DDEV_COMPOSER_ROOT" || exit
curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/expand_composer_json.php
if [[ ! -f composer.json ]]; then
echo "{}" > composer.json
_ddev_drupal_contrib_empty_composer=true
fi
php expand_composer_json.php "$DDEV_SITENAME"
rm -f expand_composer_json.php
if [ "$_ddev_drupal_contrib_empty_composer" = true ]; then
rm -f composer.json
fi
8 changes: 5 additions & 3 deletions commands/web/stylelint
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
## Example: "ddev stylelint"
## ExecRaw: true

if yarn --cwd "$DDEV_DOCROOT/core" stylelint --version >/dev/null ; then
yarn --color --cwd "$DDEV_DOCROOT/core" --config ./.stylelintrc.json stylelint ../modules/custom/**/*.css "$@"
if $DDEV_DOCROOT/core/node_modules/.bin/stylelint --version >/dev/null ; then
# Change directory to the project root folder
cd "$DDEV_DOCROOT/modules/custom/${DDEV_SITENAME//-/_}" || exit
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/stylelint" --color --config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" "./**/*.css" "$@"
else
echo "stylelint is not available. You may need to 'ddev yarn --cwd $DDEV_DOCROOT/core install'"
echo "stylelint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'"
exit 1
fi

0 comments on commit 0df55fe

Please sign in to comment.