Skip to content

Commit

Permalink
Merge pull request #26 from palantirnet/10-3
Browse files Browse the repository at this point in the history
10 3
  • Loading branch information
byrond authored Dec 6, 2024
2 parents a97df61 + 6a07c0c commit 35fa8e7
Show file tree
Hide file tree
Showing 14 changed files with 913 additions and 876 deletions.
2 changes: 1 addition & 1 deletion .ddev/commands/web/check
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ vendor/bin/phpcbf web/modules/contrib/$1 --standard="Drupal,DrupalPractice" -p -
echo "-------------"
echo "Running PHPCS"
echo "-------------"
vendor/bin/phpcs web/modules/contrib/$1 --standard="Drupal,DrupalPractice" -p --colors --extensions="php,module,inc,install,test,profile,theme,info,yml"
vendor/bin/phpcs web/modules/contrib/$1
# Run phpversion
"$COMMAND_DIR"/compat $1
exit
Expand Down
4 changes: 2 additions & 2 deletions .ddev/commands/web/compat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
help() {
echo "Usage: compat MODULE_NAME [-v VERSION]"
echo "Options:"
echo " -v Specify a PHP version to test against. Defaults to PHP 8.2."
echo " -v Specify a PHP version to test against. Defaults to PHP 8.3."
exit
}

Expand Down Expand Up @@ -41,7 +41,7 @@ do
esac
done

PHP_VERSION="8.2"
PHP_VERSION="8.3"

while getopts $FLAGS opt
do
Expand Down
33 changes: 33 additions & 0 deletions .ddev/commands/web/cspell
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

## Description: Run cspell on a specific module.
## Usage: cspell MODULE_NAME
## Example: "ddev cspell admin_toolbar"

if [ $# -eq 0 ]
then
echo "You must specify a module; e.g. 'ddev check admin_toolbar'"
exit
fi

if [ ! -d "web/modules/contrib/$1" ]
then
echo "The specified module [$1] does not exist in /web/modules/contrib."
exit
fi

cp /var/www/html/web/core/misc/cspell/drupal-dictionary.txt /var/www/html/web/core/misc/cspell/drupal-dictionary-bak.txt

# Append / replace core file web/core/misc/cspell/drupal-dictionary.txt
if [ -f "web/modules/contrib/$1/.cspell-project-words.txt" ]
then
echo "Copying cspell file"
paste -d "\n" /var/www/html/web/core/misc/cspell/drupal-dictionary.txt /var/www/html/web/modules/contrib/$1/.cspell-project-words.txt > /var/www/html/web/core/misc/cspell/drupal-dictionary-2.txt
cp /var/www/html/web/core/misc/cspell/drupal-dictionary-2.txt /var/www/html/web/core/misc/cspell/drupal-dictionary.txt
fi

cd /var/www/html/web/core

npx cspell --show-suggestions --show-context --no-progress "../modules/contrib/$1/**"

mv /var/www/html/web/core/misc/cspell/drupal-dictionary-bak.txt /var/www/html/web/core/misc/cspell/drupal-dictionary.txt
2 changes: 1 addition & 1 deletion .ddev/commands/web/md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ fi
echo "======================"
echo "Running PHPMD against: /web/modules/contrib/$1"
echo "======================"
vendor/bin/phpmd web/modules/contrib/$1 text phpmd.xml "php,inc,module,theme,profile,install,test"
vendor/bin/phpmd web/modules/contrib/$1 text phpmd.xml --suffixes "php,inc,module,theme,profile,install,test"
2 changes: 1 addition & 1 deletion .ddev/commands/web/sniff
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ vendor/bin/phpcbf web/modules/contrib/$1 --standard="Drupal,DrupalPractice" -p -
echo "-------------"
echo "Running PHPCS"
echo "-------------"
vendor/bin/phpcs web/modules/contrib/$1 --standard="Drupal,DrupalPractice" -p --colors --extensions="php,module,inc,install,test,profile,theme,info,yml"
vendor/bin/phpcs web/modules/contrib/$1
# Run phpversion
"$COMMAND_DIR"/compat $1
10 changes: 6 additions & 4 deletions .ddev/config.selenium-standalone-chrome.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ddev-generated
# Remove the line above if you don't want this file to be overwritten when you run
# ddev get drud/ddev-selenium-standalone-chrome
# ddev get ddev/ddev-selenium-standalone-chrome
#
# This file comes from https://github.com/drud/ddev-selenium-standalone-chrome
# This file comes from https://github.com/ddev/ddev-selenium-standalone-chrome
#
web_environment:
- BROWSERTEST_OUTPUT_DIRECTORY=/tmp
Expand All @@ -12,16 +12,18 @@ web_environment:
# Use disable-dev-shm-usage instead of setting shm_usage
# https://developers.google.com/web/tools/puppeteer/troubleshooting#tips
# The format of chromeOptions is defined at https://chromedriver.chromium.org/capabilities
- MINK_DRIVER_ARGS_WEBDRIVER=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
- MINK_DRIVER_ARGS_WEBDRIVER=[\"chrome\", {\"browserName\":\"chrome\",\"goog:chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
# Nightwatch
- DRUPAL_TEST_BASE_URL=http://web
- DRUPAL_TEST_DB_URL=mysql://db:db@db/db
- DRUPAL_TEST_WEBDRIVER_HOSTNAME=selenium-chrome
- DRUPAL_TEST_WEBDRIVER_PORT=4444
- DRUPAL_TEST_WEBDRIVER_PATH_PREFIX=/wd/hub
- DRUPAL_TEST_WEBDRIVER_CHROME_ARGS=--disable-gpu --headless --no-sandbox --disable-dev-shm-usage
- DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=false
- DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=../
- DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES=node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
- DRUPAL_NIGHTWATCH_OUTPUT=reports/nightwatch
# DTT
- DTT_BASE_URL=http://web
- DTT_MINK_DRIVER_ARGS=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
- DTT_MINK_DRIVER_ARGS=[\"chrome\", {\"browserName\":\"chrome\",\"goog:chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
2 changes: 1 addition & 1 deletion .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: drupal-10-development
type: drupal10
docroot: web
php_version: "8.2"
php_version: "8.3"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
Expand Down
14 changes: 7 additions & 7 deletions .ddev/docker-compose.selenium-chrome.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#ddev-generated
# Remove the line above if you don't want this file to be overwritten when you run
# ddev get drud/ddev-selenium-standalone-chrome
# ddev get ddev/ddev-selenium-standalone-chrome
#
# This file comes from https://github.com/drud/ddev-selenium-standalone-chrome
# This file comes from https://github.com/ddev/ddev-selenium-standalone-chrome
#
version: '3.6'
services:
selenium-chrome:
image: seleniarm/standalone-chromium:4.1.4-20220429
Expand All @@ -19,9 +18,10 @@ services:
- HTTP_EXPOSE=7910:7900
external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
#ports:
# VNC access for a traditional VNC client like macOS "Screen Sharing".
# - "5900:5900"
# To enable VNC access for traditional VNC clients like macOS "Screen Sharing",
# uncomment the following two lines.
#ports:
# - "5900:5900"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
Expand All @@ -30,4 +30,4 @@ services:

web:
links:
- selenium-chrome
- selenium-chrome
3 changes: 0 additions & 3 deletions .ddev/docker-compose.solr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
# change that usage throughout. It can be
# accessed at the URL: http://solr:8983/solr/dev (inside web container)
# or at http://myproject.ddev.site:8983/solr/dev (on the host)

version: '3.6'

services:
solr:
# Name of container using standard ddev convention
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ Use the `-o` flag to specify a different origin than drupal.org. The argument is

Note that this command will `delete` an existing copy of the module.

### ddev cspell

**Command:** `ddev cspell MODULE`

**Example:** `ddev cspell admin_toolbar`

The `cspell` command runs [CSpell](https://cspell.org/) using the core configuration. Any custom works defined in a module's `.cspell-project-words.txt` file will be added to the ruleset during the check and removed after it completes.

### ddev compat

**Command:** `ddev compat MODULE [-v VERSION]`
Expand All @@ -106,7 +114,7 @@ Note that this command will `delete` an existing copy of the module.

The `compat` command will run PHPCS against the selected module using the `PHPCompatibility` coding standard.

Use the `-v` flag to specify a PHP version to test. By default, the version is `8.2`.
Use the `-v` flag to specify a PHP version to test. By default, the version is `8.3`.

### ddev eslint

Expand Down Expand Up @@ -150,7 +158,7 @@ The `rector` command will run Drupal Rector updates against the selected module,

**Command:** `ddev remove MODULE`

**Example:** `ddev rector admin_toolbar`
**Example:** `ddev remove admin_toolbar`

The `ddev remove` command will uninstall a module and delete it from the `web/modules/contrib` directory.

Expand Down
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"composer/installers": "^2.0",
"drupal/admin_toolbar": "^3.4",
"drupal/config_inspector": "^2.1",
"drupal/core-composer-scaffold": "^10.1",
"drupal/core-project-message": "^10.1",
"drupal/core-recommended": "^10.2",
"drupal/core-composer-scaffold": "^10.3.0",
"drupal/core-project-message": "^10.3.0",
"drupal/core-recommended": "^10.3.0",
"drupal/devel": "^5.1",
"drupal/examples": "^4.0",
"drush/drush": "^12.4",
Expand Down Expand Up @@ -45,7 +45,7 @@
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
Expand All @@ -56,6 +56,12 @@
"dealerdirect/phpcodesniffer-composer-installer": true,
"zaporylie/composer-drupal-optimizations": true
},
"platform": {
"php": "8.3"
},
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"extra": {
Expand Down
Loading

0 comments on commit 35fa8e7

Please sign in to comment.