Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Craft 5.x #213

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b28dea4
Update test images and DDEV config for Craft 5
AugustMiller Feb 20, 2024
bd19fdb
Update Craft, remove Typogrify
AugustMiller Feb 20, 2024
20399e5
DDEV: Use PHP 8.2
AugustMiller Feb 20, 2024
d1ac837
Update to Craft 5, switch to CKEditor and Twigpack
AugustMiller Feb 20, 2024
323d871
Correct manifest paths
AugustMiller Feb 20, 2024
348ff3a
Gatsby config
AugustMiller Feb 20, 2024
95e228f
More Gatsby config
AugustMiller Feb 21, 2024
36c6242
Update migration for Craft 5, fix `safeDown`
AugustMiller Feb 21, 2024
2eecff4
Replace AssetRev with Twigpack in Readme
AugustMiller Feb 22, 2024
5fcd415
Update schema permissions
AugustMiller Feb 22, 2024
a70a504
Gatsby GraphQL changes for Matrix entrification
AugustMiller Feb 22, 2024
74019d9
Bind all interfaces for DDEV
AugustMiller Feb 22, 2024
800f7bd
Rebuild assets
AugustMiller Feb 22, 2024
934dff7
Ignore VS Code config + license.key
AugustMiller Feb 22, 2024
9e78076
PHP 8.2 for test matrix and nginx image, Setup action update
AugustMiller Feb 22, 2024
f41a0d4
Remove assetrev from Project Config
AugustMiller Feb 22, 2024
ad3cf12
Remove Redactor from Project Config
AugustMiller Feb 22, 2024
42ef62a
Remove Gatsby from test workflow/action
AugustMiller Feb 22, 2024
33b48e8
New Twigpack remote
AugustMiller Feb 22, 2024
0dd33af
User settings
AugustMiller Feb 22, 2024
1a81210
Post-upgrade field cleanup
AugustMiller May 11, 2024
ac4661f
Update to Craft 5.1.2
AugustMiller May 11, 2024
49afde8
Bump schema version
AugustMiller Jul 12, 2024
4d6674c
Update Craft + schema version
AugustMiller Aug 12, 2024
bda998b
Update Craft
AugustMiller Nov 21, 2024
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
10 changes: 7 additions & 3 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: starter-blog
type: craftcms
docroot: web
php_version: "8.1"
php_version: "8.2"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
database:
type: mariadb
version: "10.4"
type: mysql
version: "8.0"
nfs_mount_enabled: false
mutagen_enabled: false
use_dns_when_possible: true
Expand Down Expand Up @@ -229,6 +229,10 @@ web_extra_exposed_ports:
container_port: 3000
http_port: 2999
https_port: 3000
- name: gatsby
container_port: 8000
http_port: 7999
https_port: 8000

#web_extra_daemons:
#- name: "http-1"
Expand Down
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ DISALLOW_ROBOTS=true

# Read about Gatsby preview + build hooks:
# -> https://www.gatsbyjs.com/docs/reference/cloud/build-and-preview-webhooks/
GATSBY_PREVIEW_TARGET="@web:8000/__refresh"
# GATSBY_BUILD_TARGET="https://webhook.gatsbyjs.com/hooks/data_source/publish/site-id"
GATSBY_REFRESH_URL="https://starter-blog.ddev.site:8000/__refresh"
GATSBY_PREVIEW_URL="https://starter-blog.ddev.site:8000"
GATSBY_BUILD_TARGET="https://webhook.gatsbyjs.com/hooks/data_source/publish/site-id"
2 changes: 0 additions & 2 deletions .github/workflows/.env-gatsby

This file was deleted.

26 changes: 8 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ permissions:
contents: read
jobs:
test:
name: Gatsby + Craft with PHP ${{ matrix.php-versions }} + ${{ matrix.db }}
name: Craft on PHP ${{ matrix.php-versions }} + ${{ matrix.db }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["8.0", "8.1"]
php-versions: ["8.2"]
db: ["mysql", "pgsql"]

services:
mysql:
image: mysql:5.7
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
Expand All @@ -30,7 +30,7 @@ jobs:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:12
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -39,7 +39,7 @@ jobs:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
nginx:
image: craftcms/nginx:8.0
image: craftcms/nginx:8.2
options: --volume ${{ github.workspace }}:/app --user www-data:www-data
ports:
- 80:8080
Expand All @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v2

- name: Setup PHP Action
uses: shivammathur/setup-php@2.5.0
uses: shivammathur/setup-php@2.29.0
with:
php-version: ${{ matrix.php-versions }}
extensions: bcmath, mbstring, intl, gd, imagick, zip, dom, pdo_mysql, pdo_pgsql, fileinfo
Expand All @@ -63,7 +63,7 @@ jobs:

- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress

- name: Add Docker database host aliases to build environment
run: sudo echo "127.0.0.1 nginx postgres mysql" | sudo tee -a /etc/hosts

Expand All @@ -76,21 +76,11 @@ jobs:
- name: Set Craft writable folder permissions
run: chmod -R 777 config storage web/cpresources

# This project is used for schema introspection, so we do need to know that the API is healthy:
- name: Ping GraphQL endpoint
run: |-
curl -s -X POST -H "Content-Type: application/json" --data '{ "query": "{ ping }" }' http://nginx/api

- name: Prepare Gatsby environment
run: cp .github/workflows/.env-gatsby headless-front-end/gatsby/.env

- name: Install Gatsby dependencies
run: npm install && npm install gatsby-cli
working-directory: headless-front-end/gatsby

- name: Build Gatsby site
run: npm run build
working-directory: headless-front-end/gatsby

- name: Upload Craft logs
uses: actions/upload-artifact@v2
if: failure()
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/.env
/.idea
/.vscode
/vendor
/node_modules
.DS_Store
*.code-workspace
*.code-workspace

/config/license.*
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,18 +323,19 @@ We hope you’ll give it a go, but if you prefer not to, then delete these folde
* `package.json`
* `package-lock.json`

In the `templates/layout/main.twig` find this:
In the `templates/_private/layout/index.twig` file, remove these lines, in the `<head>` and at the end of `<body>`, respectively:

```twig
{% set stylesheet = rev('main.css') %}
{% if stylesheet %}
<link rel="stylesheet" href="{{ rev('main.css') }}">
{% endif %}
{{ craft.twigpack.includeCssModule("main.css") }}

{# ... #}

{{ craft.twigpack.includeJsModule("main.js") }}
```

Replace it with a link to your own stylesheet.
with a `<link>` for your own stylesheet!

You can also safely uninstall and remove the Asset Rev plugin from the Control Panel (and delete the `config/assetrev.php` file).
You can also safely uninstall and remove the [Twigpack](https://plugins.craftcms.com/twigpack) plugin from the Control Panel (and delete the `config/twigpack.php` file).

### Setup

Expand Down
10 changes: 3 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
"type": "project",
"license": "0BSD",
"require": {
"clubstudioltd/craft-asset-rev": "^7.0.0",
"craftcms/cms": "^4.5.4",
"craftcms/cms": "^5.0.0",
"craftcms/gatsby-helper": "^2.0.0",
"craftcms/redactor": "^3.0.0",
"nystudio107/craft-typogrify": "^4.0.0",
"craftcms/ckeditor": "^4.0.0",
"nystudio107/craft-twigpack": "^5.0.0",
"vlucas/phpdotenv": "^5.4.0"
},
"autoload": {
Expand All @@ -19,9 +18,6 @@
"config": {
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "8.0.2"
},
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
Expand Down
Loading
Loading