Initial Drupal 11 with DDEV setup
This commit is contained in:
22
web/modules/contrib/devel/.ddev/commands/web/eslint
Executable file
22
web/modules/contrib/devel/.ddev/commands/web/eslint
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Run eslint inside the web container
|
||||
## Usage: eslint [flags] [args]
|
||||
## Example: "ddev eslint"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
if "$DDEV_DOCROOT/core/node_modules/.bin/eslint" --version >/dev/null ; then
|
||||
# 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/$DRUPAL_PROJECTS_PATH/${DDEV_SITENAME//-/_}" || exit
|
||||
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/eslint" --config="../../../core/.eslintrc.passing.json" --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 exec \"cd $DDEV_DOCROOT/core && yarn install\"'"
|
||||
exit 1
|
||||
fi
|
||||
24
web/modules/contrib/devel/.ddev/commands/web/expand-composer-json
Executable file
24
web/modules/contrib/devel/.ddev/commands/web/expand-composer-json
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Add Drupal core and other needed dependencies.
|
||||
## Usage: expand-composer-json [flags] [PROJECT_NAME]
|
||||
## Example: "ddev expand-composer-json ctools"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
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
|
||||
_ddev_drupal_contrib_empty_composer=false
|
||||
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
|
||||
12
web/modules/contrib/devel/.ddev/commands/web/nightwatch
Executable file
12
web/modules/contrib/devel/.ddev/commands/web/nightwatch
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Run nightwatch inside the web container
|
||||
## Usage: nightwatch [flags] [args]
|
||||
## Example: "ddev nightwatch"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
yarn --cwd "$DDEV_DOCROOT/core" test:nightwatch "$DDEV_APPROOT/$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/" "$@"
|
||||
17
web/modules/contrib/devel/.ddev/commands/web/phpcbf
Executable file
17
web/modules/contrib/devel/.ddev/commands/web/phpcbf
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Run phpcbf inside the web container
|
||||
## Usage: phpcbf [flags] [args]
|
||||
## Example: "ddev phpcbf" or "ddev phpcbf -n"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
if ! command -v phpcbf >/dev/null; then
|
||||
echo "phpcbf is not available. You may need to 'ddev composer install'"
|
||||
exit 1
|
||||
fi
|
||||
test -e phpcs.xml.dist || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpcs.xml.dist
|
||||
phpcbf -s --report-full --report-summary --report-source $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH "$@"
|
||||
17
web/modules/contrib/devel/.ddev/commands/web/phpcs
Executable file
17
web/modules/contrib/devel/.ddev/commands/web/phpcs
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Run phpcs inside the web container
|
||||
## Usage: phpcs [flags] [args]
|
||||
## Example: "ddev phpcs" or "ddev phpcs -n"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
if ! command -v phpcs >/dev/null; then
|
||||
echo "phpcs is not available. You may need to 'ddev composer install'"
|
||||
exit 1
|
||||
fi
|
||||
test -e phpcs.xml.dist || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpcs.xml.dist
|
||||
phpcs -s --report-full --report-summary --report-source $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH --ignore=*/.ddev/* "$@"
|
||||
27
web/modules/contrib/devel/.ddev/commands/web/phpstan
Executable file
27
web/modules/contrib/devel/.ddev/commands/web/phpstan
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Run phpstan inside the web container
|
||||
## Usage: phpstan [flags] [args]
|
||||
## Example: "ddev phpstan" or "ddev phpstan -n"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
if ! command -v phpstan >/dev/null; then
|
||||
echo "phpstan is not available. You may need to 'ddev poser'"
|
||||
exit 1
|
||||
fi
|
||||
test -e phpstan.neon || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpstan.neon
|
||||
# See https://git.drupalcode.org/project/gitlab_templates/-/commit/a107b7f1f79af12e0b09f70be47b68e3f69b4504
|
||||
sed -i 's/BASELINE_PLACEHOLDER/phpstan-baseline.neon/g' phpstan.neon
|
||||
# Add an empty baseline file to ensure it exists.
|
||||
test -e phpstan-baseline.neon || touch phpstan-baseline.neon
|
||||
|
||||
EXTENSION_DIRECTORY=$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/${DDEV_SITENAME//-/_}
|
||||
cd "$EXTENSION_DIRECTORY" || exit 1
|
||||
# Ensure PHPStan configuration is symlinked from project root.
|
||||
ln -s $DDEV_DOCROOT/phpstan.neon 2>/dev/null || true
|
||||
ln -s $DDEV_DOCROOT/phpstan-baseline.neon 2>/dev/null || true
|
||||
phpstan analyze . "$@"
|
||||
24
web/modules/contrib/devel/.ddev/commands/web/phpunit
Executable file
24
web/modules/contrib/devel/.ddev/commands/web/phpunit
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Run phpunit inside the web container
|
||||
## Usage: phpunit [flags] [args]
|
||||
## Example: "ddev phpunit" or "ddev phpunit --stop-on-failure"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
if ! command -v phpunit >/dev/null; then
|
||||
echo "phpunit is not available. You may need to 'ddev composer install'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# CHECK for local config.
|
||||
if [ -f "phpunit.xml" ]; then
|
||||
# Defer to local config
|
||||
phpunit "$@"
|
||||
else
|
||||
# Bootstrap Drupal tests and run all custom module tests.
|
||||
phpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH "$@"
|
||||
fi
|
||||
17
web/modules/contrib/devel/.ddev/commands/web/poser
Executable file
17
web/modules/contrib/devel/.ddev/commands/web/poser
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Expand composer.json and run composer install.
|
||||
## Usage: poser [flags] [args]
|
||||
## Example: "ddev poser" or "ddev poser --prefer-source"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
export COMPOSER=composer.contrib.json
|
||||
.ddev/commands/web/expand-composer-json
|
||||
composer install "$@"
|
||||
# The -f flag suppresses errors if lock file does not exist.
|
||||
rm -f composer.contrib.json composer.contrib.lock
|
||||
touch $DDEV_DOCROOT/core/.env
|
||||
19
web/modules/contrib/devel/.ddev/commands/web/stylelint
Executable file
19
web/modules/contrib/devel/.ddev/commands/web/stylelint
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Run stylelint inside the web container
|
||||
## Usage: stylelint [flags] [args]
|
||||
## Example: "ddev stylelint"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
if $DDEV_DOCROOT/core/node_modules/.bin/stylelint --version >/dev/null ; then
|
||||
# Change directory to the project root folder
|
||||
cd "$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/${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 exec \"cd $DDEV_DOCROOT/core && yarn install\"'"
|
||||
exit 1
|
||||
fi
|
||||
20
web/modules/contrib/devel/.ddev/commands/web/symlink-project
Executable file
20
web/modules/contrib/devel/.ddev/commands/web/symlink-project
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#ddev-generated
|
||||
## Command provided by https://github.com/ddev/ddev-drupal-contrib
|
||||
## Description: Symlink project files into the configured location (defaults to `web/modules/custom/[PROJECT_NAME]`)
|
||||
## Usage: symlink-project [flags] [args]
|
||||
## Example: "ddev symlink-project"
|
||||
## ExecRaw: true
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
export _WEB_ROOT=$DDEV_DOCROOT
|
||||
#todo use more dynamic ref.
|
||||
cd "$DDEV_COMPOSER_ROOT" || exit
|
||||
curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/symlink_project.php
|
||||
|
||||
# Symlink name using underscores.
|
||||
# @see https://www.drupal.org/docs/develop/creating-modules/naming-and-placing-your-drupal-module
|
||||
php symlink_project.php "${DDEV_SITENAME//-/_}"
|
||||
rm -f symlink_project.php
|
||||
Reference in New Issue
Block a user