diff --git a/.ddev/config.yaml b/.ddev/config.yaml index be9e6337..79bdb0d5 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -15,7 +15,7 @@ database: hooks: post-start: - exec: | - [[ -d frontend ]] || git clone ${FRONTEND_REPOSITORY:-https://github.com/drunomics/lupus-decoupled-nuxt3-demo} --branch=${FRONTEND_BRANCH:-main} frontend + [[ -d frontend ]] || git clone ${FRONTEND_REPOSITORY:-https://github.com/drunomics/lupus-decoupled-nuxt3-demo-shadcn.git} --branch=${FRONTEND_BRANCH:-main} frontend cd frontend && npm i set -x pm2 start "npm run dev" @@ -25,7 +25,7 @@ web_environment: - NUXT_HOST=0.0.0.0 - NUXT_PORT=3000 - PHAPP_ENV_MODE=development -nodejs_version: "18" +nodejs_version: "22" corepack_enable: false web_extra_exposed_ports: - name: lupus-nuxt @@ -38,14 +38,13 @@ web_extra_exposed_ports: # name: # Name of the project, automatically provides # http://projectname.ddev.site and https://projectname.ddev.site -# type: # backdrop, craftcms, django4, drupal, drupal6, drupal7, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress +# type: # backdrop, cakephp, craftcms, drupal, drupal6, drupal7, drupal8, drupal9, drupal10, drupal11, laravel, magento, magento2, php, shopware6, silverstripe, symfony, typo3, wordpress # See https://ddev.readthedocs.io/en/stable/users/quickstart/ for more # information on the different project types -# "drupal" covers recent Drupal 8+ # docroot: # Relative path to the directory containing index.php. -# php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" +# php_version: "8.3" # PHP version to use, "5.6" through "8.4" # You can explicitly specify the webimage but this # is not recommended, as the images are often closely tied to DDEV's' behavior, @@ -58,7 +57,7 @@ web_extra_exposed_ports: # version: # database version, like "10.11" or "8.0" # MariaDB versions can be 5.5-10.8, 10.11, and 11.4. # MySQL versions can be 5.5-8.0. -# PostgreSQL versions can be 9-16. +# PostgreSQL versions can be 9-17. # router_http_port: # Port to be used for http (defaults to global configuration, usually 80) # router_https_port: # Port for https (defaults to global configuration, usually 443) @@ -73,9 +72,11 @@ web_extra_exposed_ports: # "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better, # as leaving Xhprof enabled all the time is a big performance hit. -# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn +# webserver_type: nginx-fpm or apache-fpm # timezone: Europe/Berlin +# If timezone is unset, DDEV will attempt to derive it from the host system timezone +# using the $TZ environment variable or the /etc/localtime symlink. # This is the timezone used in the containers and by PHP; # it can be set to any valid timezone, # see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones @@ -95,9 +96,9 @@ web_extra_exposed_ports: # - preview # - snapshot # Alternatively, an explicit Composer version may be specified, for example "2.2.18". -# To reinstall Composer after the image was built, run "ddev debug refresh". +# To reinstall Composer after the image was built, run "ddev debug rebuild". -# nodejs_version: "20" +# nodejs_version: "22" # change from the default system Node.js version to any other version. # See https://ddev.readthedocs.io/en/stable/users/configuration/config/#nodejs_version for more information # and https://www.npmjs.com/package/n#specifying-nodejs-versions for the full documentation, @@ -223,8 +224,8 @@ web_extra_exposed_ports: # You can inject environment variables into the web container with: # web_environment: -# - SOMEENV=somevalue -# - SOMEOTHERENV=someothervalue +# - SOMEENV=somevalue +# - SOMEOTHERENV=someothervalue # no_project_mount: false # (Experimental) If true, DDEV will not mount the project into the web container; diff --git a/.gitpod.yml b/.gitpod.yml index 68f01ed6..336dd76c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -15,7 +15,7 @@ tasks: [[ -z $CUSTOM_ELEMENTS_VERSION ]] || ddev composer require drupal/custom_elements:$CUSTOM_ELEMENTS_VERSION --no-update ddev composer install ddev drush si -y --site-name='lupus decoupled' standard - ddev drush en lupus_decoupled, services_env_parameter -y + ddev drush recipe ../recipes/lupus_decoupled_recipe -y # Configure lupus-decoupled frontend base URL ddev drush config:set lupus_decoupled_ce_api.settings frontend_base_url $(gp url 3000) -y echo "[NOTE] Setting default admin password for easy testing: lupus123" diff --git a/README.md b/README.md index 5027b1b6..7f25349d 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,15 @@ Optionally, customize the project: To spin up the project locally run: + # (Optional) For an automated frontend login, set a shared parent domain: + ddev config --web-environment-add="DRUPAL_SERVICE_session__storage__options___cookie_domain=.ddev.site" + ddev start ddev composer install ddev drush site-install -y --account-pass=admin --site-name='lupus_decoupled' standard - ddev drush pm-enable lupus_decoupled, services_env_parameter -y - # Configure lupus-decoupled frontend base URL - ddev drush config:set lupus_decoupled_ce_api.settings frontend_base_url https://lupus-nuxt.ddev.site -y - # Login and get started adding some test-nodes + ddev drush recipe ../recipes/lupus_decoupled_recipe + ddev drush cr + # Login and get started ddev drush upwd admin somepass ddev launch /user/login diff --git a/composer.json b/composer.json index 11d82e73..efde01bc 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "drupal/lupus-decoupled-project", - "description": "Project template for Lupus Decouplted Drupal projects", + "description": "Project template for Lupus Decoupled Drupal projects", "type": "project", "license": "GPL-2.0-or-later", "homepage": "https://www.drupal.org/project/drupal", @@ -15,14 +15,15 @@ } ], "require": { - "composer/installers": "^1.9", + "composer/installers": "^2.3", "cweagans/composer-patches": "^1.7", - "drupal/core-composer-scaffold": "^11", - "drupal/core-project-message": "^11", - "drupal/core-recommended": "^11", - "drupal/lupus_decoupled": "1.x-dev", - "drupal/rest_log": "^2.3", + "drupal/core-composer-scaffold": "^11.1", + "drupal/core-project-message": "^11.1", + "drupal/core-recommended": "^11.1", + "drupal/drupal_cms_starter": "^1.0@RC", + "drupal/lupus_decoupled_recipe": "1.0.x-dev", "drupal/responsive_preview": "^2.2", + "drupal/rest_log": "^2.3", "drupal/schema_metatag": "^3.0", "drupal/services_env_parameter": "^1.3", "drush/drush": "^13" @@ -40,11 +41,11 @@ "allow-plugins": { "composer/installers": true, "cweagans/composer-patches": true, + "dealerdirect/phpcodesniffer-composer-installer": true, "drupal/core-composer-scaffold": true, "drupal/core-project-message": true, "php-http/discovery": true, "phpstan/extension-installer": true, - "dealerdirect/phpcodesniffer-composer-installer": true, "tbachert/spi": true } }, @@ -60,6 +61,9 @@ } }, "installer-paths": { + "recipes/lupus_decoupled_recipe_base": [ + "drupal/lupus_decoupled_recipe" + ], "web/core": [ "type:drupal-core" ], @@ -69,6 +73,9 @@ "web/modules/contrib/{$name}": [ "type:drupal-module" ], + "recipes/{$name}": [ + "type:drupal-recipe" + ], "web/profiles/contrib/{$name}": [ "type:drupal-profile" ], diff --git a/recipes/.gitignore b/recipes/.gitignore new file mode 100644 index 00000000..71dfd5ba --- /dev/null +++ b/recipes/.gitignore @@ -0,0 +1 @@ +README.txt diff --git a/recipes/lupus_decoupled_recipe/README.md b/recipes/lupus_decoupled_recipe/README.md new file mode 100644 index 00000000..66932213 --- /dev/null +++ b/recipes/lupus_decoupled_recipe/README.md @@ -0,0 +1,7 @@ +# Lupus Decoupled Drupal Project Recipe + +A Drupal recipe to setup a base Lupus Decoupled Drupal project. + +- [Lupus Decoupled Drupal Recipe](https://www.drupal.org/project/lupus_decoupled_recipe/): Sets up a decoupled Drupal architecture with Lupus Decoupled Drupal. +- [Drupal CMS Starter](https://www.drupal.org/project/drupal_cms_starter): Provides a starter configuration for Drupal CMS setups. +- `services_env_parameter`: Manages environment-specific settings via environment variables. diff --git a/recipes/lupus_decoupled_recipe/recipe.yml b/recipes/lupus_decoupled_recipe/recipe.yml new file mode 100644 index 00000000..3bc81fc6 --- /dev/null +++ b/recipes/lupus_decoupled_recipe/recipe.yml @@ -0,0 +1,17 @@ +name: Lupus Decoupled Drupal Project +type: Lupus Decoupled Drupal +description: A recipe to setup a Lupus Decoupled Drupal project. +recipes: + - drupal_cms_starter + - lupus_decoupled_recipe_base +install: + - services_env_parameter +config: + # If the config we're importing already exists, we don't really care + # what it looks like. + strict: false + actions: + # We don't support antibot yet, thus we need to disable it by default. + antibot.settings: + simpleConfigUpdate: + form_ids: []