Skip to content

Commit

Permalink
Merge branch 'release/2.2.10' into craft-webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed May 20, 2020
2 parents a1ece82 + 59c634d commit e6d37a6
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 19 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# nystudio107/craft Change Log

## 2.2.10 - 2020.05.20
### Added
* Added baked-in support for xdebug

### Changed
* Always do a `composer install` & `npm install` when starting up via `docker-compose up`

### Fixed
* Fixed tab handler not adding the class to the `<body>`

## 2.2.9 - 2020.04.14
### Added
* Added support for repo.repman.io Packagist proxy global CDN
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,28 @@ rm docker-config/webpack-dev-craft/package-lock.json
docker-compose up
```

To use Xdebug with VSCode install the [PHP Debug extension](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug ) and use the following configuration:
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9001,
"log": true,
"externalConsole": false,
"pathMappings": {
"/var/www/project/cms": "${workspaceRoot}/cms"
},
"ignore": ["**/vendor/**/*.php"]
}
]
}
```


Below is the entire intact, unmodified `README.md` from Pixel & Tonic's [craftcms/craft](https://github.com/craftcms/craft):

.....
Expand Down
3 changes: 3 additions & 0 deletions cms/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ GA_TRACKING_ID=

# FastCGI Cache Bust settings
FAST_CGI_CACHE_PATH=

# Xdebug Settings
DBGP_IDEKEY=phpstorm
4 changes: 2 additions & 2 deletions cms/templates/_boilerplate/_partials/tab-handler.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<script>
function handleFirstTab(e) {
if (e.keyCode === 9) {
document.documentElement.classList.add('user-is-tabbing');
document.body.classList.add('user-is-tabbing');
window.removeEventListener('keydown', handleFirstTab);
window.addEventListener('mousedown', handleMouseDownOnce);
}
}
function handleMouseDownOnce() {
document.documentElement.classList.remove('user-is-tabbing');
document.body.classList.remove('user-is-tabbing');
window.removeEventListener('mousedown', handleMouseDownOnce);
window.addEventListener('keydown', handleFirstTab);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "craftcms/craft",
"description": "nystudio107 Craft 3.4 CMS scaffolding project",
"version": "2.2.9",
"version": "2.2.10",
"keywords": [
"craft",
"cms",
Expand Down
3 changes: 3 additions & 0 deletions docker-config/php-dev-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@ RUN echo "upload_max_filesize = 10M" > /usr/local/etc/php/php.ini && \
echo "opcache.revalidate_freq = 0" >> /usr/local/etc/php/php.ini && \
echo "opcache.validate_timestamps = 1" >> /usr/local/etc/php/php.ini

# Copy the `xdebug.ini` file into place for xdebug
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

# Copy the `zzz-docker.conf` file into place for php-fpm
COPY ./zzz-docker.conf /usr/local/etc/php-fpm.d/zzz-docker.conf
7 changes: 7 additions & 0 deletions docker-config/php-dev-base/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=0
xdebug.remote_host=host.docker.internal
xdebug.remote_autostart=1
14 changes: 6 additions & 8 deletions docker-config/php-dev-craft/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,16 @@ RUN mkdir -p /var/www/project/cms/web/cpresources && \

WORKDIR /var/www/project/cms

# Force permissions, update Craft, and start php-fpm

# Do a `composer install` without running any Composer scripts
# - If `composer.lock` is present, it will install what is in the lock file
# - If `composer.lock` is missing, it will update to the latest dependencies
# and create the `composer.lock` file
# Force permissions, update Craft, and start php-fpm
CMD if [ ! -f "./composer.lock" ]; then \
composer install --no-scripts --optimize-autoloader --no-interaction; \
fi \
&& \
if [ ! -d ./vendor -o ! "$(ls -A ./vendor)" ]; then \
composer install --no-scripts --optimize-autoloader --no-interaction; \
fi \
# This automatic running adds to the startup overhead of `docker-compose up`
# but saves far more time in not having to deal with out of sync versions
# when working with teams or multiple environments
CMD composer install --no-scripts --optimize-autoloader --no-interaction \
&& \
chown -R www-data:www-data /var/www/project/cms/vendor \
&& \
Expand Down
14 changes: 6 additions & 8 deletions docker-config/webpack-dev-craft/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ FROM nystudio107/webpack-dev-base

WORKDIR /var/www/project/docker-config/webpack-dev-craft/

# Run our webpack build in debug mode

# We'd normally use `npm ci` here, but by using `install`:
# - If `package-lock.json` is present, it will install what is in the lock file
# - If `package-lock.json` is missing, it will update to the latest dependencies
# and create the `package-lock-json` file
# Run our webpack build in debug mode
CMD if [ ! -f "./package-lock.json" ]; then \
npm install; \
fi \
&& \
if [ ! -d "./node_modules" -o ! "$(ls -A ./node_modules)" ]; then \
npm install; \
fi \
# This automatic running adds to the startup overhead of `docker-compose up`
# but saves far more time in not having to deal with out of sync versions
# when working with teams or multiple environments
CMD npm install \
&& \
npm run debug

0 comments on commit e6d37a6

Please sign in to comment.