diff --git a/.circleci/config.yml b/.circleci/config.yml index 58065a82..75f122ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,22 +1,175 @@ version: 2.1 -jobs: - standards: + +commands: + install_dependencies: + description: "Install development dependencies." + steps: + - run: composer install + - run: npm ci + mkdir_artifacts: + description: "Make Artifacts directory" + steps: + - run: + command: | + [ ! -d "/tmp/artifacts" ] && mkdir /tmp/artifacts &>/dev/null + +executors: + base: + docker: + - image: circleci/buildpack-deps:latest + working_directory: /tmp + php_node: docker: - image: circleci/php:7.3.3-stretch-node-browsers + working_directory: /tmp/theme + python: + docker: + - image: circleci/python:3.7-stretch + working_directory: /tmp + +jobs: + checkout: + executor: base + steps: + - checkout: + path: theme + - persist_to_workspace: + root: /tmp + paths: + - theme + + standards: + executor: php_node steps: - - checkout - - install-dependencies + - attach_workspace: + at: /tmp + - install_dependencies - run: composer phpcs - run: npm run lint:css - run: npm run lint:js -commands: - install-dependencies: - description: "Install development dependencies." + + bundle: + executor: php_node steps: - - run: composer install + - attach_workspace: + at: /tmp - run: npm ci + - run: npm run zip + - mkdir_artifacts + - run: mv ./*.zip /tmp/artifacts/. + - persist_to_workspace: + root: /tmp + paths: + - artifacts + - theme + - store_artifacts: + path: /tmp/artifacts/ + + create_data_file: + executor: php_node + steps: + - attach_workspace: + at: /tmp + - run: npm run prep:piservice /tmp/artifacts + - persist_to_workspace: + root: /tmp + paths: + - artifacts + + deploy_s3: + executor: python + steps: + - attach_workspace: + at: /tmp + - aws-s3/sync: + from: "/tmp/artifacts/" + to: "s3://update.atomicblocks.com/themes/${S3_PATH}/" + + deploy_sp_staging: + executor: python + steps: + - add_ssh_keys: + fingerprints: + - "f2:c5:53:4d:39:eb:ba:72:06:4d:fc:48:7c:5a:0f:df" + - attach_workspace: + at: /tmp + - run: + command: | + ARTIFACT_FILE=find /tmp/artifacts -type f -name *.zip -printf "%f\n" + DEST_PATH=home/wpe-user/sites/${STAGING_INSTALL_NAME}/wp-content/uploads/member-access/${ARTIFACT_FILE} + DEST_HOST=${STAGING_INSTALL_NAME}@${STAGING_INSTALL_NAME}.ssh.wpengine.net + scp /tmp/artifacts/${ARTIFACT_FILE} ${DEST_HOST}/${DEST_PATH} + + deploy_sp_prod: + executor: python + steps: + - add_ssh_keys: + fingerprints: + - "f2:c5:53:4d:39:eb:ba:72:06:4d:fc:48:7c:5a:0f:df" + - attach_workspace: + at: /tmp + - run: + command: | + ARTIFACT_FILE=find /tmp/artifacts -type f -name *.zip -printf "%f\n" + DEST_PATH=home/wpe-user/sites/${PROD_INSTALL_NAME}/wp-content/uploads/member-access/${ARTIFACT_FILE} + DEST_HOST=${PROD_INSTALL_NAME}@${PROD_INSTALL_NAME}.ssh.wpengine.net + scp /tmp/artifacts/${ARTIFACT_FILE} ${DEST_HOST}/${DEST_PATH} + workflows: version: 2 check-standards: jobs: - - standards + - checkout: + filters: + tags: + only: /.*/ + - standards: + filters: + tags: + only: /.*/ + requires: + - checkout + - bundle: + requires: + - standards + filters: + tags: + only: /.*/ + branches: + only: master + - create_data_file: + requires: + - bundle + filters: + tags: + only: /.*/ + branches: + only: master + - deploy_s3: + requires: + - create_data_file + filters: + tags: + only: /.*/ + branches: + only: master + - deploy_sp_staging: + requires: + - create_data_file + filters: + tags: + only: /.*/ + branches: + only: master + - deploy_sp_prod: + requires: + - create_data_file + - deploy_sp_staging + filters: + tags: + only: /.*/ + branches: + only: master + +orbs: + aws-s3: circleci/aws-s3@1.0.0 diff --git a/.editorconfig b/.editorconfig index 7cf0864c..3f197222 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,3 +15,6 @@ indent_style = tab [*.md] trim_trailing_whitespace = false + +[*.yml] +indent_style = space diff --git a/.gitignore b/.gitignore index f6dbd9c7..f6f59543 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,8 @@ /phpcs.xml node_modules/ vendor/ + +# Artifacts +process.yml +*.zip +*.*.json diff --git a/.scripts/makePIServiceData.js b/.scripts/makePIServiceData.js new file mode 100644 index 00000000..a318116d --- /dev/null +++ b/.scripts/makePIServiceData.js @@ -0,0 +1,59 @@ +#!/usr/bin/env node +/** + * Create a JSON file to be consumed by the Product Info Service + * + * @TODO Accept a destination file path via CLI arguments + * @TODO Maybe convert "tags" value to an array? + */ +const fs = require('fs'); + +/** + * Run the script + */ +const runScript = function() { + // Set the destination path + const destPath = getDestPath(process.argv[2]); + + // Declare empty data object + let data = {}; + + // Get array of "theme" keys from process.env.npm_package_theme_* + const keys = Object.keys(process.env).filter(key => key.match(/npm_package_theme_.+/)); + + // Iterate through keys and populate the data object + // Note: this isn't using a map because we want the output to be an object, not an array + keys.forEach(envKey => { + key = envKey.match(/npm_package_theme_(.+)/)[1]; // strip npm_package_theme_ from key + data[key] = process.env[envKey]; // Save to data object + }); + + // Write data object to a JSON file + const filePath = `${destPath}/${data.textdomain}.${data.version}.json`; + fs.writeFileSync(filePath, JSON.stringify(data)); +} + +/** + * Get destination path + * + * @param {string} path + * + * @return {string} + */ +const getDestPath = function(path) { + const defaultPath = process.cwd(); + + // Return default if a path wasn't provided + if( ! path || ! path.length){ + return defaultPath; + } + + // Return default if the provided path doesn't exist + if (!fs.existsSync(path)) { + return defaultPath; + } + + return path; +} + +// Run the script +runScript(); diff --git a/CHANGELOG.md b/CHANGELOG.md index bbc9b8ba..f33cc77a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Genesis Sample Theme Changelog +## [3.3.0] - 2020-04-07 +Requires WordPress 5.4 or higher. + +### Added +* CSS to adjust left padding for WordPress 5.4 Social Icons. +* Editor styles to ensure theme colors work for inline text colors. +* Editor styles for WordPress 5.4 compatibility, including link color, buttons, headings, and lists. + +### Changed +* Updated one-click theme setup content to include WordPress 5.4 button markup. +* Update developer dependencies. ([GitHub version](https://github.com/studiopress/genesis-sample/) only.) + +### Removed +* Unused `light` heading class. + ## [3.2.0] - 2019-11-13 ### Added @@ -17,7 +32,7 @@ * CSS for tables for better consistency between editor and front end and to allow for new WordPress 5.3 settings. * Allow footer widgets to be displayed on the landing page template. * Set imported landing page meta to hide footer widgets. Requires Genesis 3.2 or higher. -* Update homepage content import to use Atomic Blocks Adanced Columns block. +* Update homepage content import to use Atomic Blocks Advanced Columns block. * Update the phpcs config to exclude a PHP short array rule intended only for WordPress core. ### Fixed @@ -87,7 +102,7 @@ Requires Genesis 2.10.0+. * Changed: improve editor button block styling. * Changed: clarify wording of Customizer color labels. * Changed: remove matchHeight script and use CSS flex instead to match heights of WooCommerce product lists. -* Fixed: WooCommmerce shop pages now use the selected page layout instead of the default site layout on sites using object caching. +* Fixed: WooCommerce shop pages now use the selected page layout instead of the default site layout on sites using object caching. * Fixed: update the `npm run zip` script to prevent an issue with zip decompression for apps such as Path Finder. (npm scripts are available in the version of Genesis Sample on GitHub: https://github.com/studiopress/genesis-sample/). ## [2.9.1] - 2019-03-19 @@ -179,7 +194,7 @@ Requires Genesis 2.8.0+. * Update to normalize.css 4.1.1. ## [2.2.3] - 2016-05-18 -* Add accessibile mobile menu. +* Add accessible mobile menu. * Add accessibility support for the 404 Page. * Add the custom header option to upload your own logo. * Add customizer option for primary color. diff --git a/config/import/content/block-examples.php b/config/import/content/block-examples.php index 8953cf00..19cefdd3 100644 --- a/config/import/content/block-examples.php +++ b/config/import/content/block-examples.php @@ -80,13 +80,17 @@
All the resources, training, and support you need to run your dream online business!
- - - + + + @@ -81,9 +83,11 @@ -All the resources, training, and support you need to run your dream online business!
- - - + + + @@ -81,9 +83,11 @@ -