palantirnet / drupal-skeleton
A Drupal 10 project template.
Installs: 1 358
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 27
Forks: 3
Open Issues: 11
Type:project
Requires
- composer/installers: ^1.9
- drupal/admin_toolbar: ^3.0
- drupal/config_split: ^1.7
- drupal/core-composer-scaffold: ^9
- drupal/core-recommended: ^9
- drupal/devel: >=4.1
- drupal/workbench: ^1.3
- drupal/workbench_tabs: ^1.5
Requires (Dev)
- drupal/core-dev: ^9
- drupal/drupal-extension: ^4.1.0
- palantirnet/the-build: ^4@alpha
Suggests
- cweagans/composer-patches: Try ^1.7. Apply patches to packages, especially Drupal.org contrib.
- drupal/admin_toolbar: Transforms the default Drupal Toolbar into a drop-down menu.
- drupal/config_ignore: Exclude configuration to be exported to the configuration set.
- drupal/environment_indicator: Adds a configurable color bar to each one of your environments to help identify which environment you are currently working in.
- drupal/stage_file_proxy: A solution for getting production files on a development server on demand (add to your development config_split).
- drupal/twig_xdebug: Enables use of Xdebug breakpoints with Twig templates (add to your development config_split).
Conflicts
- dev-develop
- 3.1.0
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5
- 1.4
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.0
- 0.0.x-dev
- dev-dev-35-chrome-testing-config
- dev-drupal11
- dev-misc-readme-updates
- dev-composer-remove-contrib
- dev-hosting-settings-vs-custom-settings-order
- dev-drupal9
- dev-devops-improvements-phpsniffers
- dev-patch-chmod-8.8
- dev-ddev
- dev-default-content
- dev-drupal7
This package is auto-updated.
Last update: 2024-10-18 19:11:59 UTC
README
This is a template for starting Drupal projects using the composer create-project
command.
Quick start
This "quick start" section will show you how to set up a local server accessible at http://example.local
with Drupal ready to install.
Preface
You should have the development dependencies installed on your Mac before you begin. These dependencies are not project-specific, and you may have some or all of them already installed. If you don't, find a location with good internet and set aside at least an hour to complete this step.
The development dependencies are:
- PHP 8.3+
- Check your PHP version from the command line using
php --version
- Check your PHP version from the command line using
- Mac only: XCode command line tools
- Composer
- Docker
- DDev Local
On Macs, Docker and ddev can be installed with homebrew:
brew install docker --cask
brew install ddev
Once you have your dependencies installed, setting up this skeleton will take at least another hour, depending on your internet connection.
Some of the commands below will prompt you for a response, with the default answer in brackets. For this quick start, hit return to accept each default answer:
Enter a short name for your project [example] :
Steps
-
Create a new Drupal 10 project called "example" based on this template:
composer create-project palantirnet/drupal-skeleton example dev-develop --no-interaction
-
Go into your new project directory and update the ddev configuration in
.ddev/config.yml
:# Update to match your project name. Using "drupal-skeleton" would make the site # accessible at 'drupal-skeleton.ddev.site'. name: drupal-skeleton # Use 'docroot' for Acquia, or 'web' for Pantheon or Platform.sh. docroot: web
-
From inside the ddev environment, run the script from
palantirnet/the-build
to set up the default Drupal variables and install Drupal:ddev start ddev ssh vendor/bin/the-build-installer
-
In your web browser, visit http://example.ddev.site
-
Optional: While you are logged into the ddev environment, you can run Drush commands like
drush status
.
Extra Credit
- Replace this
README.md
withREADME.dist.md
, then customize for your project - Update the project name in the
composer.json
file, then runcomposer update --lock
- Initialize a git repository and commit your work
- Access your database via phpMyAdmin
- URL: https://example.ddev.site:8037
- Username:
drupal
- Password:
drupal
- View email sent by your development site at https://example.ddev.site:8026
- Connect to your Solr server in Drupal with the
search_api_solr
module:- HTTP Protocol:
http
- Solr host:
solr
- Solr port:
8983
- Solr path:
/
- Solr core:
dev
- View the Solr admin interface: https://example.ddev.site:8983
- HTTP Protocol:
Note: Make sure your project directory is in the right place / named correctly, because renaming or moving the project directory (e.g. example/
) after starting can break your ddev setup.
Full Project Setup
Create a project with a custom name
Use composer to create a new project based on this skeleton, replacing PROJECTNAME
with the short name for your project:
composer create-project palantirnet/drupal-skeleton PROJECTNAME dev-develop --no-interaction
Update your documentation
Update the README
:
- Remove the
README.md
- Rename the
README.dist.md
toREADME.md
- Edit as you like
Project-specific documentation at docs/technical_approach.md
- Add
deployment.md
for deployment instructions
Update the LICENSE.txt
:
- Remove or replace this file with the appropriate license for your project. (The existing license applies to the Drupal Skeleton template only.)
Update the composer.json
:
- Change the
name
frompalantirnet/drupal-skeleton
topalantirnet/PROJECTNAME
- Update the
description
with a brief description of your project. - Update the
license
property based on how your work will be licensed - Update the lock file so composer doesn't complain:
composer update --lock
Update the package.json
:
- Change the
name
frompalantirnet--drupal-skeleton
topalantirnet--PROJECTNAME
(see package.json name requirements) - Update the
description
with a brief description of your project.
Configure your ddev development environment
Go into your new project directory and update the ddev configuration in .ddev/config.yml
.
Run the installers
From inside ddev, run the script from palantirnet/the-build
to set up a base Drupal installation:
ddev start
ddev ssh
vendor/bin/the-build-installer
Commit your work to git
Initialize a git repository and commit your work to the develop
branch:
git init
git checkout -b develop
git commit --allow-empty -m "Initial commit."
git add --all
git commit -m "Add the skeleton."
Create an empty repository on GitHub for your work. Then, push your work up to the repository:
git remote add origin git@github.com:palantirnet/PROJECTNAME.git
git push -u origin develop
Manage your ddev environment
- Start ddev:
ddev start
- Log in:
ddev ssh
- Log out (just like you would from any other ssh session):
exit
- Shut down ddev:
ddev stop
- Find information about your ddev environment:
ddev describe
- See also the ddev documentation
Replace "the-build" with [something else]
If you're allergic to phing and Benadryl isn't helping, you can also remove the-build:
-
composer remove --dev palantirnet/the-build
-
rm -r .the-build
-
rm build.xml
-
This will remove drush, coder, and phpmd -- if you want those dependencies, you'll need to add them back to your project:
composer require --dev drush/drush drupal/coder phpmd/phpmd
-
Install your build tooling of choice... or nothing at all...
-
Update your project's README
See also: Documentation on using the-build
Install Drupal from the command line
When using drush or phing to manage your Drupal site, you will need to log into the ddev environment (ddev ssh
).
If you've run vendor/bin/the-build-installer
from within ddev, Drupal will be installed and the initial config exported to config/sites/default/
.
You can use the phing scripts provided by palantirnet/the-build
to reinstall the site from config at any time:
vendor/bin/phing install
Or, you can use drush directly:
drush site-install --existing-config
Manage your configuration in code
In Drupal development, all (or most) Drupal configuration should be exported and treated as part of the codebase. We use Drupal's "install from config" installer option to allow us to use the exported configuration as the basis for a repeatable, automation-friendly build and install process. We also use config_split to manage environment-specific configuration.
-
Log into Drupal in your browser and do some basic config customizations:
- Set the site timezone
- Disable per-user timezones
- Disable user account creation
- Remove unnecessary content types
- Set the admin email address (your development environment will trap all emails)
- Turn the Cron interval down to "never"
- Uninstall unnecessary modules (e.g. Search, History, Comment)
-
Export your config:
drush cex -y
-
You should have a ton of new
*.yml
files inconfig/sites/default/
. Add them, and this config change, to git:git add config/ git ci -m "Initial Drupal configuration." git push
-
Reinstall your site and verify that your config is ready to go:
vendor/bin/phing install
More information
- Site build and install process: palantirnet/the-build
Copyright 2016 - 2021 Palantir.net, Inc.