From fc467742e98aa6820afc4e890edc797839682622 Mon Sep 17 00:00:00 2001 From: Ben Moore <7051219+BMO-tech@users.noreply.github.com> Date: Tue, 26 May 2020 15:17:27 -0500 Subject: [PATCH 01/13] ci: deploy to S3 bucket on merge to master and tag (#338) Co-authored-by: Jen Baumann Co-authored-by: Ben Moore --- .circleci/config.yml | 151 +++++++++++++++++++++++++++++-------------- 1 file changed, 104 insertions(+), 47 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 75f122ab..f5390a9e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,100 +76,157 @@ jobs: 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 + deploy_studiopress: + executor: base + parameters: + sp_install: + type: string + default: myspressstg 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} + echo "export ARTIFACT_FILE=$(find /tmp/artifacts -type f -name *.zip -printf '%f\n')" >> ${BASH_ENV} + echo "export DEST_PATH=home/wpe-user/sites/<< parameters.sp_install >>/wp-content/uploads/member-access" >> ${BASH_ENV} + echo "export DEST_HOST=<< parameters.sp_install >>@<< parameters.sp_install >>.ssh.wpengine.net" >> ${BASH_ENV} + echo "${SP_DEPLOY_KEY}" | base64 -d > ./sp_deploy_key + chmod 600 ./sp_deploy_key + - run: scp -i ./sp_deploy_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /tmp/artifacts/${ARTIFACT_FILE} ${DEST_HOST}:/${DEST_PATH} - deploy_sp_prod: + deploy_s3: executor: python + parameters: + environment: + type: string + default: themes 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: + name: "Set S3_PATH env variable" 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} + echo "export S3_PATH=$(grep 'textdomain' /tmp/theme/package.json | awk -F: '{print $2}' | sed 's/^\s//' | sed 's/\"//g')" >> ${BASH_ENV} + - aws-s3/sync: + from: "/tmp/artifacts/" + to: "s3://update.atomicblocks.com/<< parameters.environment >>/${S3_PATH}/" workflows: version: 2 - check-standards: + checks: jobs: - checkout: filters: - tags: - only: /.*/ + branches: + ignore: + - master - standards: + requires: + - checkout filters: - tags: - only: /.*/ + branches: + ignore: + - master + + branch_deploy: + jobs: + - checkout: + filters: + branches: + only: + - master + - standards: requires: - checkout + filters: + branches: + only: + - master - bundle: requires: - standards filters: - tags: - only: /.*/ branches: - only: master + only: + - master - create_data_file: requires: - bundle filters: - tags: - only: /.*/ branches: - only: master + only: + - master + - deploy_studiopress: + context: studiopress-deploy + sp_install: myspressstg + requires: + - bundle + filters: + branches: + only: + - master - deploy_s3: + context: wpe-product-info-aws + environment: staging/themes requires: - create_data_file + - deploy_studiopress + filters: + branches: + only: + - master + + tag_deploy: + jobs: + - checkout: filters: tags: - only: /.*/ + only: /^\d+\.\d+\.\d+$/ branches: - only: master - - deploy_sp_staging: + ignore: /.*/ + - standards: requires: - - create_data_file + - checkout filters: tags: - only: /.*/ + only: /^\d+\.\d+\.\d+$/ branches: - only: master - - deploy_sp_prod: + ignore: /.*/ + - bundle: + requires: + - standards + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + - create_data_file: + requires: + - bundle + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + - deploy_studiopress: + sp_install: myspress + requires: + - bundle + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + - deploy_s3: + context: wpe-product-info-aws requires: - create_data_file - - deploy_sp_staging + - deploy_studiopress filters: tags: - only: /.*/ + only: /^\d+\.\d+\.\d+$/ branches: - only: master + ignore: /.*/ orbs: aws-s3: circleci/aws-s3@1.0.0 From 32f8d56307acdc0790eecdfa73ea70cb21833672 Mon Sep 17 00:00:00 2001 From: Ben Moore <7051219+BMO-tech@users.noreply.github.com> Date: Thu, 28 May 2020 09:31:28 -0500 Subject: [PATCH 02/13] ci: CircleCI Configuration updates (#348) * ci: test yml comments * wip(ci/cd): create latest artifact * ci: update config and scripts to match new env var names * ci: try env var first Co-authored-by: Ben Moore --- .circleci/config.yml | 40 +++++++++++++++++++++++++++-------- .scripts/makePIServiceData.js | 13 ++++++------ .scripts/makezip.js | 13 ++++++------ 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f5390a9e..cd57e9fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,27 @@ commands: - run: command: | [ ! -d "/tmp/artifacts" ] && mkdir /tmp/artifacts &>/dev/null + set_env_vars: + description: "Set commonly used environment variables" + steps: + - run: + name: "Set Theme Slug" + command: | + echo "export THEME_SLUG=$(grep 'textdomain' /tmp/theme/package.json | awk -F: '{print $2}' | sed -e 's/\s//g' -e 's/[\"\,]//g')" >> ${BASH_ENV} + - run: + name: "Set Theme Version" + command: | + echo "export THEME_VERSION=$(grep 'version' /tmp/theme/package.json | awk -F: '{print $2}' | sed -e 's/\s//g' -e 's/[\"\,]//g')" >> ${BASH_ENV} + - run: + name: "Set Artifact Name" + command: | + echo "export VERSION_ARTIFACT_FILE=${THEME_SLUG}.${THEME_VERSION}.zip" >> ${BASH_ENV} + echo "export VERSION_DATA_FILE=${THEME_SLUG}.${THEME_VERSION}.json" >> ${BASH_ENV} + - run: + name: "Set Latest Artifact Name" + command: | + echo "export LATEST_ARTIFACT_FILE=${THEME_SLUG}.latest.zip" >> ${BASH_ENV} + echo "export LATEST_DATA_FILE=${THEME_SLUG}.latest.json" >> ${BASH_ENV} executors: base: @@ -33,6 +54,7 @@ jobs: steps: - checkout: path: theme + - set_env_vars - persist_to_workspace: root: /tmp paths: @@ -56,7 +78,7 @@ jobs: - run: npm ci - run: npm run zip - mkdir_artifacts - - run: mv ./*.zip /tmp/artifacts/. + - run: mv ./${VERSION_ARTIFACT_FILE} /tmp/artifacts/. - persist_to_workspace: root: /tmp paths: @@ -87,12 +109,11 @@ jobs: at: /tmp - run: command: | - echo "export ARTIFACT_FILE=$(find /tmp/artifacts -type f -name *.zip -printf '%f\n')" >> ${BASH_ENV} - echo "export DEST_PATH=home/wpe-user/sites/<< parameters.sp_install >>/wp-content/uploads/member-access" >> ${BASH_ENV} - echo "export DEST_HOST=<< parameters.sp_install >>@<< parameters.sp_install >>.ssh.wpengine.net" >> ${BASH_ENV} + DEST_PATH=home/wpe-user/sites/<< parameters.sp_install >>/wp-content/uploads/member-access + DEST_HOST=<< parameters.sp_install >>@<< parameters.sp_install >>.ssh.wpengine.net echo "${SP_DEPLOY_KEY}" | base64 -d > ./sp_deploy_key chmod 600 ./sp_deploy_key - - run: scp -i ./sp_deploy_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /tmp/artifacts/${ARTIFACT_FILE} ${DEST_HOST}:/${DEST_PATH} + - run: scp -i ./sp_deploy_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /tmp/artifacts/${VERSION_ARTIFACT_FILE} ${DEST_HOST}:/${DEST_PATH} deploy_s3: executor: python @@ -104,12 +125,13 @@ jobs: - attach_workspace: at: /tmp - run: - name: "Set S3_PATH env variable" + name: "Copy Version to Latest" command: | - echo "export S3_PATH=$(grep 'textdomain' /tmp/theme/package.json | awk -F: '{print $2}' | sed 's/^\s//' | sed 's/\"//g')" >> ${BASH_ENV} + cp /tmp/artifacts/${VERSION_ARTIFACT_FILE} /tmp/artifacts/${LATEST_ARTIFACT_FILE} + cp /tmp/artifacts/${VERSION_DATA_FILE} /tmp/artifacts/${LATEST_DATA_FILE} - aws-s3/sync: from: "/tmp/artifacts/" - to: "s3://update.atomicblocks.com/<< parameters.environment >>/${S3_PATH}/" + to: "s3://update.atomicblocks.com/<< parameters.environment >>/${THEME_SLUG}/" workflows: version: 2 @@ -167,7 +189,7 @@ workflows: - master - deploy_s3: context: wpe-product-info-aws - environment: staging/themes + # environment: staging/themes requires: - create_data_file - deploy_studiopress diff --git a/.scripts/makePIServiceData.js b/.scripts/makePIServiceData.js index a318116d..d67c89fa 100644 --- a/.scripts/makePIServiceData.js +++ b/.scripts/makePIServiceData.js @@ -2,7 +2,6 @@ /** * 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'); @@ -11,8 +10,8 @@ const fs = require('fs'); * Run the script */ const runScript = function() { - // Set the destination path - const destPath = getDestPath(process.argv[2]); + // Sanitize the destination path + const destPath = sanitizeDestPath(process.argv[2]); // Declare empty data object let data = {}; @@ -28,18 +27,20 @@ const runScript = function() { }); // Write data object to a JSON file - const filePath = `${destPath}/${data.textdomain}.${data.version}.json`; + const themeName = process.env.THEME_SLUG || data.textdomain; + const themeVersion = process.env.THEME_VERSION || data.version; + const filePath = `${destPath}/${process.env.VERSION_DATA_FILE}` || `${destPath}/${themeName}.${themeVersion}.json`; fs.writeFileSync(filePath, JSON.stringify(data)); } /** - * Get destination path + * Sanitize destination path * * @param {string} path * * @return {string} */ -const getDestPath = function(path) { +const sanitizeDestPath = function(path) { const defaultPath = process.cwd(); // Return default if a path wasn't provided diff --git a/.scripts/makezip.js b/.scripts/makezip.js index 38acd9e4..c00e6d07 100644 --- a/.scripts/makezip.js +++ b/.scripts/makezip.js @@ -39,12 +39,13 @@ const excludes = [ // Creates a file to stream archive data to. // Uses the name in package.json, such as 'child-theme.1.1.0.zip'. -let fileName = `${process.env.npm_package_name}.${ - process.env.npm_package_theme_version -}.zip`; -let output = fs.createWriteStream(fileName); +const slug = process.env.THEME_SLUG || process.env.npm_package_theme_textdomain; +const version = process.env.THEME_VERSION || process.env.npm_package_theme_version; +const fileName = process.env.VERSION_ARTIFACT_FILE || `${slug}.${version}.zip`; -let archive = archiver("zip", { +const output = fs.createWriteStream(fileName); + +const archive = archiver("zip", { zlib: { level: 9 } // Best compression. }); @@ -55,7 +56,7 @@ const setupZipArchive = function() { // Listens for all archive data to be written. // Report the zip name and size, and rename *.txt files back to *.md again. output.on("close", function() { - let fileSize = prettyBytes(archive.pointer()); + const fileSize = prettyBytes(archive.pointer()); console.log(chalk`{cyan Created ${fileName}, ${fileSize}}`); renameTxtFilesToMarkdown(); From cef19a3799ce6faef3f6a25efd784a632cd0fd90 Mon Sep 17 00:00:00 2001 From: Ben Moore <7051219+BMO-tech@users.noreply.github.com> Date: Thu, 28 May 2020 16:06:08 -0500 Subject: [PATCH 03/13] ci: CircleCI Configuration updates (#349) ci: update config and scripts to match new env var names ci: try env var first ci: run set_env_vars on all jobs that need it ci: remove set_env_vars command from setup job ci: CircleCI Configuration updates (#348) * ci: test yml comments * wip(ci/cd): create latest artifact * ci: update config and scripts to match new env var names * ci: try env var first Co-authored-by: Ben Moore Co-authored-by: Ben Moore --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd57e9fd..5be3389a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,6 +75,7 @@ jobs: steps: - attach_workspace: at: /tmp + - set_env_vars - run: npm ci - run: npm run zip - mkdir_artifacts @@ -92,6 +93,7 @@ jobs: steps: - attach_workspace: at: /tmp + - set_env_vars - run: npm run prep:piservice /tmp/artifacts - persist_to_workspace: root: /tmp @@ -107,6 +109,7 @@ jobs: steps: - attach_workspace: at: /tmp + - set_env_vars - run: command: | DEST_PATH=home/wpe-user/sites/<< parameters.sp_install >>/wp-content/uploads/member-access @@ -124,6 +127,7 @@ jobs: steps: - attach_workspace: at: /tmp + - set_env_vars - run: name: "Copy Version to Latest" command: | From a0847e5c2908bdd5ff17172c3daebaff6c71c28a Mon Sep 17 00:00:00 2001 From: Ben Moore <7051219+BMO-tech@users.noreply.github.com> Date: Sat, 30 May 2020 00:03:04 -0500 Subject: [PATCH 04/13] ci: Working CircleCI Config (#350) * ci: CircleCI Configuration updates ci: update config and scripts to match new env var names ci: try env var first ci: run set_env_vars on all jobs that need it ci: remove set_env_vars command from setup job ci: CircleCI Configuration updates (#348) * ci: test yml comments * wip(ci/cd): create latest artifact * ci: update config and scripts to match new env var names * ci: try env var first Co-authored-by: Ben Moore * ci: working config ci: test deploy on circle branch ci: fix sp deploy ci: working config Co-authored-by: Ben Moore --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5be3389a..4fec9455 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,11 +18,11 @@ commands: - run: name: "Set Theme Slug" command: | - echo "export THEME_SLUG=$(grep 'textdomain' /tmp/theme/package.json | awk -F: '{print $2}' | sed -e 's/\s//g' -e 's/[\"\,]//g')" >> ${BASH_ENV} + echo "export THEME_SLUG=$(grep 'textdomain":' /tmp/theme/package.json | awk -F: '{print $2}' | sed -e 's/\s//g' -e 's/[\"\,]//g')" >> ${BASH_ENV} - run: name: "Set Theme Version" command: | - echo "export THEME_VERSION=$(grep 'version' /tmp/theme/package.json | awk -F: '{print $2}' | sed -e 's/\s//g' -e 's/[\"\,]//g')" >> ${BASH_ENV} + echo "export THEME_VERSION=$(grep 'version":' /tmp/theme/package.json | awk -F: '{print $2}' | sed -e 's/\s//g' -e 's/[\"\,]//g')" >> ${BASH_ENV} - run: name: "Set Artifact Name" command: | @@ -111,12 +111,13 @@ jobs: at: /tmp - set_env_vars - run: + name: Deploy To StudioPress command: | DEST_PATH=home/wpe-user/sites/<< parameters.sp_install >>/wp-content/uploads/member-access DEST_HOST=<< parameters.sp_install >>@<< parameters.sp_install >>.ssh.wpengine.net echo "${SP_DEPLOY_KEY}" | base64 -d > ./sp_deploy_key chmod 600 ./sp_deploy_key - - run: scp -i ./sp_deploy_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /tmp/artifacts/${VERSION_ARTIFACT_FILE} ${DEST_HOST}:/${DEST_PATH} + scp -i ./sp_deploy_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /tmp/artifacts/${VERSION_ARTIFACT_FILE} ${DEST_HOST}:/${DEST_PATH} deploy_s3: executor: python From 173530d3cf5470f3850a658b1a6dbd1432510126 Mon Sep 17 00:00:00 2001 From: Ben Moore <7051219+BMO-tech@users.noreply.github.com> Date: Tue, 2 Jun 2020 10:29:21 -0500 Subject: [PATCH 05/13] ci: quick adjustments to CircleCI Config (#351) * ci: CircleCI Configuration updates ci: update config and scripts to match new env var names ci: try env var first ci: run set_env_vars on all jobs that need it ci: remove set_env_vars command from setup job ci: CircleCI Configuration updates (#348) * ci: test yml comments * wip(ci/cd): create latest artifact * ci: update config and scripts to match new env var names * ci: try env var first Co-authored-by: Ben Moore * ci: working config ci: test deploy on circle branch ci: fix sp deploy ci: working config * ci: update to makePIService.js script * ci: only deploy to staging on branch jobs Co-authored-by: Ben Moore --- .circleci/config.yml | 2 +- .scripts/makePIServiceData.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4fec9455..6ecf5391 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -194,7 +194,7 @@ workflows: - master - deploy_s3: context: wpe-product-info-aws - # environment: staging/themes + environment: staging/themes requires: - create_data_file - deploy_studiopress diff --git a/.scripts/makePIServiceData.js b/.scripts/makePIServiceData.js index d67c89fa..c4fbd184 100644 --- a/.scripts/makePIServiceData.js +++ b/.scripts/makePIServiceData.js @@ -29,9 +29,10 @@ const runScript = function() { // Write data object to a JSON file const themeName = process.env.THEME_SLUG || data.textdomain; const themeVersion = process.env.THEME_VERSION || data.version; - const filePath = `${destPath}/${process.env.VERSION_DATA_FILE}` || `${destPath}/${themeName}.${themeVersion}.json`; + const fileName = process.env.VERSION_DATA_FILE || `${themeName}.${themeVersion}.json`; + const filePath = `${destPath}/${fileName}`; + fs.writeFileSync(filePath, JSON.stringify(data)); -} /** * Sanitize destination path From 0ee894f8c3d532deafde8bc20d7e499d7b88cd02 Mon Sep 17 00:00:00 2001 From: Ben Moore <7051219+BMO-tech@users.noreply.github.com> Date: Wed, 3 Jun 2020 09:11:19 -0500 Subject: [PATCH 06/13] ci: fix bug in makePIServiceData.js (#352) Co-authored-by: Ben Moore --- .scripts/makePIServiceData.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.scripts/makePIServiceData.js b/.scripts/makePIServiceData.js index c4fbd184..350226bf 100644 --- a/.scripts/makePIServiceData.js +++ b/.scripts/makePIServiceData.js @@ -33,6 +33,7 @@ const runScript = function() { const filePath = `${destPath}/${fileName}`; fs.writeFileSync(filePath, JSON.stringify(data)); +} /** * Sanitize destination path From f7ffcedd72a0a5cd74cd4a8e5f90131440e261cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2020 15:12:01 +0200 Subject: [PATCH 07/13] Bump lodash from 4.17.14 to 4.17.19 (#353) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.14 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.14...4.17.19) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 06609f87..423c18dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3195,9 +3195,9 @@ } }, "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, "lodash.defaults": { From b3081083a932ea1069ed6de6f115c46555f9ae08 Mon Sep 17 00:00:00 2001 From: Jen Baumann Date: Wed, 5 Aug 2020 18:27:50 -0400 Subject: [PATCH 08/13] Run `npm audit fix` (#355) --- package-lock.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 423c18dc..91cbcfae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1258,12 +1258,12 @@ } }, "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", + "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", "dev": true, "requires": { - "is-obj": "^1.0.0" + "is-obj": "^2.0.0" } }, "electron-to-chromium": { @@ -2939,9 +2939,9 @@ } }, "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true }, "is-plain-obj": { @@ -3996,12 +3996,12 @@ } }, "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", "dev": true, "requires": { - "dot-prop": "^4.1.1", + "dot-prop": "^5.2.0", "indexes-of": "^1.0.1", "uniq": "^1.0.1" } From 13491e4b77b4b35629f7bbe9b4baa42467561dd3 Mon Sep 17 00:00:00 2001 From: Jen Baumann Date: Wed, 12 Aug 2020 06:55:50 -0400 Subject: [PATCH 09/13] Add `navigation-widgets` HTML5 theme support (#357) --- config/theme-supports.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/theme-supports.php b/config/theme-supports.php index d48bcb63..e8353788 100644 --- a/config/theme-supports.php +++ b/config/theme-supports.php @@ -22,6 +22,7 @@ 'comment-form', 'comment-list', 'gallery', + 'navigation-widgets', 'search-form', 'script', 'style', From 0e98494fdebb64b7a7fd0e103ea3c5ba7b2eb7fa Mon Sep 17 00:00:00 2001 From: Jen Baumann Date: Wed, 12 Aug 2020 06:56:14 -0400 Subject: [PATCH 10/13] Remove genesis-lazy-load-images support (#356) --- config/theme-supports.php | 1 - 1 file changed, 1 deletion(-) diff --git a/config/theme-supports.php b/config/theme-supports.php index e8353788..b1344e53 100644 --- a/config/theme-supports.php +++ b/config/theme-supports.php @@ -33,7 +33,6 @@ 'search-form', 'skip-links', ], - 'genesis-lazy-load-images' => '', 'genesis-after-entry-widget-area' => '', 'genesis-footer-widgets' => 3, 'genesis-menus' => [ From cbf243d4d9e1f4abb0500cba08fddf80a07be408 Mon Sep 17 00:00:00 2001 From: Jen Baumann Date: Fri, 14 Aug 2020 07:16:58 -0400 Subject: [PATCH 11/13] Update/wp5.5 (#359) * Match widths to front end * Match p margin to editor * Add support for custom-line-height * Add support for custom-units --- lib/gutenberg/init.php | 6 ++++++ lib/gutenberg/style-editor.css | 6 ++---- style.css | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/gutenberg/init.php b/lib/gutenberg/init.php index e1755e2e..192b5405 100644 --- a/lib/gutenberg/init.php +++ b/lib/gutenberg/init.php @@ -95,6 +95,12 @@ function genesis_sample_blocks_body_classes( $classes ) { // Make media embeds responsive. add_theme_support( 'responsive-embeds' ); +// Add support for custom line heights. +add_theme_support( 'custom-line-height' ); + +// Add support for custom units. +add_theme_support( 'custom-units' ); + $genesis_sample_appearance = genesis_get_config( 'appearance' ); // Adds support for editor font sizes. diff --git a/lib/gutenberg/style-editor.css b/lib/gutenberg/style-editor.css index d0472141..0caa8923 100755 --- a/lib/gutenberg/style-editor.css +++ b/lib/gutenberg/style-editor.css @@ -15,22 +15,20 @@ dl { } /* Regular content width. -/* 702px + 27px to match paragraph width on front-end and editor. ---------------------------------------------------------------------------- */ .wp-block { - max-width: 732px; + max-width: 702px; } /* Width of "wide" blocks -/* 1062px + 30px so wide images match width in front-end and editor. /* 1062px = default column width of 702px + .alignwide negative margin of 360px ---------------------------------------------------------------------------- */ .wp-block[data-align="full"] .wp-block[data-align="wide"], .wp-block[data-align="wide"] .wp-block[data-align="wide"], .wp-block[data-align="wide"] { - max-width: 1092px; + max-width: 1062px; } .wp-block[data-align="full"], diff --git a/style.css b/style.css index 4666bca4..c98b1a30 100755 --- a/style.css +++ b/style.css @@ -189,7 +189,7 @@ a:hover { } p { - margin: 0 0 30px; + margin: 0 0 28px; padding: 0; } From 133f2973826cb339b18a7cce9abee2368598e8cc Mon Sep 17 00:00:00 2001 From: Jen Baumann Date: Fri, 14 Aug 2020 07:17:17 -0400 Subject: [PATCH 12/13] Fix .menu-toggle transition (#358) --- style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/style.css b/style.css index c98b1a30..1afb4958 100755 --- a/style.css +++ b/style.css @@ -1169,6 +1169,10 @@ figcaption, content: "\f335"; } +.site-header .dashicons-before::before { + transition: none; +} + .site-header .menu-toggle::before { float: left; margin-right: 5px; From 00f84dcb4c028651e7e1f33080e4cbf0ef64e23a Mon Sep 17 00:00:00 2001 From: Jen Baumann Date: Mon, 17 Aug 2020 09:51:31 -0400 Subject: [PATCH 13/13] Release/3.3.1 (#361) * Bump version * Update language file * Add 3.3.1 changelog * Update wording * Add `context: studiopress-deploy` to circle ci config `tag_deploy` --- .circleci/config.yml | 1 + CHANGELOG.md | 17 +++++++++++++++++ languages/genesis-sample.pot | 4 ++-- package.json | 2 +- style.css | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ecf5391..9a3940ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -236,6 +236,7 @@ workflows: branches: ignore: /.*/ - deploy_studiopress: + context: studiopress-deploy sp_install: myspress requires: - bundle diff --git a/CHANGELOG.md b/CHANGELOG.md index f33cc77a..55df0f38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Genesis Sample Theme Changelog +## [3.3.1] - 2020-08-17 + +### Added +* WordPress 5.5 block editor theme support for `custom-line-height`. +* WordPress 5.5 block editor theme support for `custom-units`. +* WordPress 5.5 HTML5 theme support for `navigation-widgets`. + +### Changed +* Ensure front end paragraph margin matches the editor. +* Ensure block width in the editor matches the front end. + +### Fixed +* Ensure the hamburger menu button icon and text CSS transitions match. + +### Removed +* `genesis-lazy-load-images` theme support in favor of the WordPress 5.5 lazy loading feature. + ## [3.3.0] - 2020-04-07 Requires WordPress 5.4 or higher. diff --git a/languages/genesis-sample.pot b/languages/genesis-sample.pot index 62ad97d4..be1c7cd5 100644 --- a/languages/genesis-sample.pot +++ b/languages/genesis-sample.pot @@ -2,9 +2,9 @@ # This file is distributed under the GPL-2.0-or-later.=!> msgid "" msgstr "" -"Project-Id-Version: Genesis Sample 3.3.0\n" +"Project-Id-Version: Genesis Sample 3.3.1\n" "Report-Msgid-Bugs-To: StudioPress \n" -"POT-Creation-Date: 2020-04-01 20:59:05+00:00\n" +"POT-Creation-Date: 2020-08-14 15:48:27+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/package.json b/package.json index dc962f27..77051462 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "description": "The sample child theme for the Genesis Framework.", "author": "StudioPress", "authoruri": "https://www.studiopress.com/", - "version": "3.3.0", + "version": "3.3.1", "tags": "one-column, two-columns, left-sidebar, right-sidebar, accessibility-ready, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready", "license": "GPL-2.0-or-later", "licenseuri": "https://www.gnu.org/licenses/gpl-2.0.html", diff --git a/style.css b/style.css index 1afb4958..17209e52 100755 --- a/style.css +++ b/style.css @@ -5,7 +5,7 @@ Description: This is the sample theme created for the Genesis Framework. Author: StudioPress Author URI: https://www.studiopress.com/ -Version: 3.3.0 +Version: 3.3.1 Tags: accessibility-ready, block-styles, custom-colors, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, left-sidebar, one-column, right-sidebar, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, two-columns, wide-blocks