Open JulesKhong opened 9 months ago
I'm interested in helping with this, but will need guidance on what to do!
p: login
Create the new project, based off of the Pantheon Build tools:
COMPOSER_MEMORY_LIMIT=-1 terminus build:project:create --team='ThinkShout' --org='thinkshout' --visibility='private' d9 YOURSITENAME
.COMPOSER_MEMORY_LIMIT=-1 terminus build:project:create --team='ThinkShout' --org='thinkshout' --visibility='private' wp test-base-script
.There are a handful of things we always do on sites. This set of instructions takes care of that.
git clone test-base-script
.circleci/config.yml
file. Update the default branch from "master" to "main" by adding this line: "DEFAULT_BRANCH: main" under "TERM: dumb".circleci/config.yml
file.composer require thinkshout/drupal-integrations
.ci/build/.gitignore
. We want to commit this file.web/sites/default/settings.php
file and run composer install
to pull in the settings.php file from https://github.com/thinkshout/drupal-integrations/blob/main/assets/web/sites/default/settings.phpchmod 755 .ci/build/multidev-save
.gitignore
file, uncomment the line to ignore .idea files /.idea/
, or add it to the bottom of your root .gitignore
file. composer require --dev drupal/config_suite drupal/field_tools drupal/stage_file_proxy zaporylie/composer-drupal-optimizations
composer require drupal/admin_toolbar drupal/config_split drupal/editor_advanced_link drupal/email_registration drupal/fast_404 drupal/field_group drupal/honeypot drupal/inline_entity_form drupal/menu_block drupal/metatag drupal/pathauto drupal/redirect drupal/redis drupal/simple_sitemap drupal/smart_trim drush/drush drupal/allowed_formats drupal/file_delete drupal/webp drupal/pantheon_advanced_page_cache
--extensions=php,module,inc,install,test,profile,theme,info
composer.json
file into a duplicate "code-sniff-fix" section, and change all phpcs to phpcbf example from Drupal:
"code-sniff-fix": [
".\/vendor\/bin\/phpcbf --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info --ignore=node_modules,bower_components,vendor .\/web\/modules\/custom",
".\/vendor\/bin\/phpcbf --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info --ignore=node_modules,bower_components,vendor .\/web\/themes\/custom",
".\/vendor\/bin\/phpcbf --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info --ignore=node_modules,bower_components,vendor .\/web\/modules\/custom",
".\/vendor\/bin\/phpcbf --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info --ignore=node_modules,bower_components,vendor .\/web\/themes\/custom"
]
.ci/test/visual-regression/backstopConfig.js update a few settings:
delay: 5000, and
asyncCompareLimit: 10`..ci/test/visual-regression/run
delete the piece starting with # Always run visual tests if "[vr]" is in the last commit message
and ending right before # Ping the multidev environment to wake it from sleep
-- this code keeps VR tests from running at weird times.TERMINUS_SITE=test-base-script
DB_NAME=test-base-script
DB_USER=root
DB_PASSWORD=root
DB_HOST=localhost
WP_HOME=https://web.test-base-script.localhost/
# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='generateme'
SECURE_AUTH_KEY='generateme'
LOGGED_IN_KEY='generateme'
NONCE_KEY='generateme'
AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'
terminus wp test-base-script.live-- user update 1 --user_pass="some-generated-password"
To get Circle to behave the way we want it, it's helpful to set some options in the Circle project that Pantheon created as part of the script you ran above.
cd ~/Sites/YOURSITE/web/themes/custom
git clone https://github.com/thinkshout/ts_motif
rm -rf ts_motif/.git
web/themes/custom/ts_motif/templates/_includes/styleguide.html.twig
to customize your styleguide based on the designs. Or hand this off as a ticket for a front-end person to do later.~/sites/YOURSITE/web/wp-content/themes/
custom/
mv thinkwp-starter-theme-master ts_YOURSITE
, cd ts_YOURSITE
./update_theme_name.sh ts_YOURSITE
npm install
Instead of committing our css files directly to our repo, we are compiling them with node on circle. To do that, add the following to your ".circleci/config" file.
persist_to_workspace
step that already exists: (Note that the image here is for node 16. You can update it to whatever version of node you'd like your site to be running):- run:
name: Install n and switch to 16
command: npm install -g n && n 16
- run:
name: Compile the theme
command: cd web/themes/custom/your_theme && npm ci
- run:
name: Format code
command: cd web/themes/custom/your_theme && npm run theme.bundle.prod
- persist_to_workspace:
root: .
paths:
- bash_env.txt
- web/themes/custom/your_theme
[ ] If your "deploy_to_pantheon" job doesn't have a "name: sync build artifact" step, add one right before "# Deploy to Pantheon". This syncs the compiled node directory to Pantheon:
# Rsync the build artifact pieces web directory
- run:
name: sync build artifact
command: rsync -rz /tmp/web .
[ ] Check your ".gitignores". If your theme is gitignoring items that need to be built on Pantheon, you'll need to move those to the site's root .gitignore, placing them above the cut line # :::::::::::::::::::::: cut ::::::::::::::::::::::"
. This will keep these out of github, but commit them to Pantheon. Usually this is just your theme's "dist" folder.
You should already have a lot of the items in place to use config_suite, but to get things properly set up do the following:
drush en config_split config_suite
Description
Base tokens, tailwind components, components and blocks will live in two places: base Drupal theme and base WP theme. Are there pieces that could be shared, and put into another repo? Are there ways to make these more maintainable
Dev
We have a base build in the WP base theme, but it also needs to live in FORUM and Drupal soon for some upcoming work. Do we have a separate repo? Is there a smart way to pull in directories based on whether you’re in WP or Drupal? How do we make maintaining the base build and adding to it as streamlined as possible?
SHARED FILES/DIRECTORIES: In the BASE BUILD theme for Drupal and WP
Tokens:https://github.com/thinkshout/thinkwp-starter-theme/tree/main/tokens
Assets: https://github.com/thinkshout/thinkwp-starter-theme/tree/main/assets (css/js)
Views > Cards https://github.com/thinkshout/thinkwp-starter-theme/tree/low-code-base-theme/views/cards
Views > Btns https://github.com/thinkshout/thinkwp-starter-theme/tree/low-code-base-theme/views/btns
Views > Blocks (exact same except where we define field values) https://github.com/thinkshout/thinkwp-starter-theme/tree/low-code-base-theme/views/blocks
Views > _styleguide_sections https://github.com/thinkshout/thinkwp-starter-theme/tree/low-code-base-theme/views/_styleguide_sections
tailwind.config.js https://github.com/thinkshout/thinkwp-starter-theme/blob/low-code-base-theme/tailwind.config.js
style dictionary: https://github.com/thinkshout/thinkwp-starter-theme/blob/low-code-base-theme/style-dictionary.config.js
Style guide page: https://github.com/thinkshout/thinkwp-starter-theme/blob/low-code-base-theme/views/pages/page-style-guide.twig
Things that are different: field data values on the views/block/* directories for each block. Do we have a WP one and a Drupal one and you delete the ones not in use? (edited)