From b4cfb02ed82f74e464495a9aa4a0c25a55737f9f Mon Sep 17 00:00:00 2001 From: Arti M Date: Wed, 4 Jan 2023 11:39:39 +0000 Subject: [PATCH 1/4] Publish v8.7.0-dev.c598ce1 and update preview app --- Gemfile.lock | 2 +- lib/ably_ui/version.rb | 2 +- package.json | 2 +- preview/Gemfile | 2 +- preview/Gemfile.lock | 4 +-- preview/package.json | 2 +- preview/yarn.lock | 68 +++++++++++++++++++++++++----------------- 7 files changed, 47 insertions(+), 35 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3df6f5359..955c112af 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ably-ui (8.7.0.dev.4de588d) + ably-ui (8.7.0.dev.c598ce1) view_component (>= 2.33, < 2.50) GEM diff --git a/lib/ably_ui/version.rb b/lib/ably_ui/version.rb index 255979368..5414575d6 100644 --- a/lib/ably_ui/version.rb +++ b/lib/ably_ui/version.rb @@ -1,3 +1,3 @@ module AblyUi - VERSION = '8.7.0.dev.4de588d' + VERSION = '8.7.0.dev.c598ce1' end diff --git a/package.json b/package.json index dd28a1f35..5b95c03c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ably/ui", - "version": "8.7.0-dev.4de588d", + "version": "8.7.0-dev.c598ce1", "description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.", "repository": { "type": "git", diff --git a/preview/Gemfile b/preview/Gemfile index d5c63e22d..e1b458f5f 100644 --- a/preview/Gemfile +++ b/preview/Gemfile @@ -37,7 +37,7 @@ gem 'view_component', '~> 2.33.0', require: 'view_component/engine' gem 'responders' -gem 'ably-ui', '8.7.0.dev.4de588d', require: 'ably_ui' +gem 'ably-ui', '8.7.0.dev.c598ce1', require: 'ably_ui' # https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias gem 'psych', '< 4' diff --git a/preview/Gemfile.lock b/preview/Gemfile.lock index db7695cf6..0eccaf012 100644 --- a/preview/Gemfile.lock +++ b/preview/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - ably-ui (8.7.0.dev.4de588d) + ably-ui (8.7.0.dev.c598ce1) view_component (>= 2.33, < 2.50) actioncable (6.0.5.1) actionpack (= 6.0.5.1) @@ -175,7 +175,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - ably-ui (= 8.7.0.dev.4de588d) + ably-ui (= 8.7.0.dev.c598ce1) bootsnap (>= 1.4.2) byebug dotenv-rails diff --git a/preview/package.json b/preview/package.json index 5fc48e3ca..f53ca6527 100644 --- a/preview/package.json +++ b/preview/package.json @@ -2,7 +2,7 @@ "name": "preview", "private": true, "dependencies": { - "@ably/ui": "8.7.0-dev.4de588d", + "@ably/ui": "8.7.0-dev.c598ce1", "@babel/preset-react": "^7.12.5", "@rails/ujs": "^6.0.0", "@rails/webpacker": "4.3.0", diff --git a/preview/yarn.lock b/preview/yarn.lock index 6479eb779..27b283a4b 100644 --- a/preview/yarn.lock +++ b/preview/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@ably/ui@8.7.0-dev.4de588d": - version "8.7.0-dev.4de588d" - resolved "https://registry.yarnpkg.com/@ably/ui/-/ui-8.7.0-dev.4de588d.tgz#7dfc2d48c10623e5aaf71b967dabbc80fbdb0e17" - integrity sha512-AJUmD3xnFs2b7bTkyd5c0zsNaMez+9a36XI4x1WtpN674EVAmxATnECp1iR+e8QLoSHJuzoCpP3LzPi/Ahmrsw== +"@ably/ui@8.7.0-dev.c598ce1": + version "8.7.0-dev.c598ce1" + resolved "https://registry.yarnpkg.com/@ably/ui/-/ui-8.7.0-dev.c598ce1.tgz#7c132df5d9cda6220b4524e46ab3900858e7b0ed" + integrity sha512-1c3L3vVcA6fjhIRFgyaPkzGFY/UiCRluMgHvstae0Q3RY9iIri5FS4AyMTPhYBy948M8tnEk+O+mQondyNJZNA== dependencies: addsearch-js-client "^0.7.0" array-flat-polyfill "^1.0.1" @@ -921,11 +921,11 @@ regenerator-runtime "^0.13.4" "@babel/runtime@^7.9.2": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" - integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.7.tgz#fcb41a5a70550e04a7b708037c7c32f7f356d8fd" + integrity sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ== dependencies: - regenerator-runtime "^0.13.4" + regenerator-runtime "^0.13.11" "@babel/template@^7.12.13": version "7.12.13" @@ -1320,9 +1320,9 @@ acorn@^7.0.0: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== addsearch-js-client@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/addsearch-js-client/-/addsearch-js-client-0.7.0.tgz#d5540ea174f847264349639619a03e56d9b14237" - integrity sha512-wptQbXBnO/8hE7sbi4EeooWXAyqFAND2K+3tByhKHcISYRtNHWNEhcbpQ3HfMpojM0vJ057630fT0dZkzMtvsA== + version "0.7.1" + resolved "https://registry.yarnpkg.com/addsearch-js-client/-/addsearch-js-client-0.7.1.tgz#ae7b5274ce73649b9ebb9fd19e7d42fb70a2ebdb" + integrity sha512-uts2VTm28cctQxl8CvTQZLrnHHUFhkZMg7lCzkcDplBt/Hi+T816ruvHr5XkUvqfsJ1sCqFp31c3nDij36NWMg== dependencies: axios "^0.27.2" es6-promise "^4.2.8" @@ -1576,7 +1576,7 @@ async@^2.6.2: asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== at-least-node@^1.0.0: version "1.0.0" @@ -2827,7 +2827,7 @@ del@^4.1.1: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== delegates@^1.0.0: version "1.0.0" @@ -2934,9 +2934,9 @@ domelementtype@^2.0.1: integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A== dompurify@^2.2.9: - version "2.3.10" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.10.tgz#901f7390ffe16a91a5a556b94043314cd4850385" - integrity sha512-o7Fg/AgC7p/XpKjf/+RC3Ok6k4St5F7Q6q6+Nnm3p2zGWioAY6dh0CbbuwOhH2UcSzKsdniE/YnE2/92JcsA+g== + version "2.4.1" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.1.tgz#f9cb1a275fde9af6f2d0a2644ef648dd6847b631" + integrity sha512-ewwFzHzrrneRjxzmK6oVz/rZn9VWspGFRDb4/rRtIsM1n36t9AKma/ye8syCpcw+XJ25kOK/hOG7t1j2I2yBqA== domutils@^1.7.0: version "1.7.0" @@ -3434,9 +3434,9 @@ follow-redirects@^1.0.0: integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== follow-redirects@^1.14.9: - version "1.15.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" - integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== for-in@^1.0.2: version "1.0.2" @@ -4483,9 +4483,9 @@ js-base64@^2.1.8: integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ== js-base64@^3.6.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.2.tgz#816d11d81a8aff241603d19ce5761e13e41d7745" - integrity sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ== + version "3.7.3" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.3.tgz#2e784bb0851636bf1e99ef12e4f3a8a8c9b7639f" + integrity sha512-PAr6Xg2jvd7MCR6Ld9Jg3BmTcjYsHEBx1VlwEwULb/qowPf5VD9kEMagj23Gm7JRnSvE/Da/57nChZjnvL8v6A== js-cookie@^2.2.1: version "2.2.1" @@ -4889,7 +4889,19 @@ mime-db@1.48.0, "mime-db@>= 1.43.0 < 2": resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" integrity sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== -mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: version "2.1.31" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b" integrity sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== @@ -6736,16 +6748,16 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== +regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.4: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + regenerator-runtime@^0.13.3: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== - regenerator-transform@^0.14.2: version "0.14.5" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4" From 470bfde1ddd7815abcf70af77194c273e64b6bd0 Mon Sep 17 00:00:00 2001 From: Arti M Date: Wed, 4 Jan 2023 15:24:58 +0000 Subject: [PATCH 2/4] chore: Splits prerelease script --- README.md | 10 +++-- scripts/pre-release.sh | 55 +++++++++++--------------- scripts/update-pre-release-versions.sh | 49 +++++++++++++++++++++++ 3 files changed, 80 insertions(+), 34 deletions(-) create mode 100755 scripts/update-pre-release-versions.sh diff --git a/README.md b/README.md index 0918fb4e4..259cb92c1 100644 --- a/README.md +++ b/README.md @@ -294,10 +294,14 @@ To deploy a review app with your in-progress code, you can use the `pre-release` scripts/pre-release.sh ``` -This will do a couple of things: +This script is a combination of two scripts: -— update your local dependencies for ably-ui and run a production build -— release a gem and a NPM package with the version built from your current SemVer but adding a pre-release tag based on a short SHA of your HEAD commit +1. Pre-Release: + +- update your local dependencies for ably-ui and run a production build +- release a gem and a NPM package with the version built from your current SemVer but adding a pre-release tag based on a short SHA of your HEAD commit + +2. Update Pre-Release Version: - update the preview app - commit all the above and push to origin diff --git a/scripts/pre-release.sh b/scripts/pre-release.sh index 061888b95..aae668594 100755 --- a/scripts/pre-release.sh +++ b/scripts/pre-release.sh @@ -63,35 +63,28 @@ rm ably-ui-$RUBY_VERSION.gem echo "> Publish the npm package to the registry" yarn publish --no-git-tag-version --new-version $VERSION -echo "Waiting to make sure packages are available in registries ;(" -sleep 180 - -echo "> Update Gemfile.lock" -bundle - -echo "> Update preview app version" -cd preview - -echo "> Update Gemfile" -# Using -i.bak is a cross-platform way of using sed -# https://stackoverflow.com/a/22084103 -sed -i.bak "s/gem 'ably-ui', '.*', require/gem 'ably-ui', '${RUBY_VERSION}', require/" Gemfile -rm Gemfile.bak - -echo "> Update ably-ui npm package in preview app" -yarn upgrade @ably/ui@$VERSION - -echo "> Update Gemfile.lock" -bundle lock # don't change contents gem dir as it might be using local paths - -echo "> Commit version publish and preview app update to $TAG" -cd .. -git add package.json lib/ably_ui/version.rb Gemfile.lock -git add preview/package.json preview/yarn.lock preview/Gemfile preview/Gemfile.lock -git commit -m "Publish $TAG and update preview app" - -echo "> Tag commit with $TAG" -git tag -a $TAG -m "$TAG" +echo "Waiting to make sure packages are available in registries ..." +tries=0 +while [ $tries -lt 20 ] +do + tries=$(( $tries + 1 )) + sleep 15 + versions=$( gem search ably-ui --exact --prerelease --remote) + count=$(echo ${versions} | grep --count ${RUBY_VERSION} || true) + # Break if we have a match + if [ $count -eq 1 ]; then + # Work around bundler not finding gems immediately after being published + gem install ably-ui --version ${RUBY_VERSION} + break + fi + echo -n $tries +done +echo + +if [ $tries -eq 20 ]; then + echo "! Failed to find version ${RUBY_VERSION} in list of releases on Rubygems" + exit 1 +fi -echo "> Push to repo" -git push origin HEAD +echo "Update Pre Release versions" +./scripts/update-pre-release-versions.sh $ABLY_UI_VERSION $PACKAGE_SUFFIX \ No newline at end of file diff --git a/scripts/update-pre-release-versions.sh b/scripts/update-pre-release-versions.sh new file mode 100755 index 000000000..5569a9880 --- /dev/null +++ b/scripts/update-pre-release-versions.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +ABLY_UI_VERSION="${1}" +PACKAGE_SUFFIX="${2}" + +# See https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail +set -euo pipefail + +if [ -z $ABLY_UI_VERSION ] || [ -z $PACKAGE_SUFFIX ]; then + echo $0: "Error: Missing Ably UI Version OR Package Suffix" + echo $0: "Usage: update-pre-release-versions.sh ABLY_UI_VERSION PACKAGE_SUFFIX" + exit 1 +fi + +# Note the . and - before "dev" - this is due to the differences between gems and npm in what they consider a pre-release version +VERSION=$ABLY_UI_VERSION-dev.$PACKAGE_SUFFIX +RUBY_VERSION=$ABLY_UI_VERSION.dev.$PACKAGE_SUFFIX +TAG=v$ABLY_UI_VERSION-dev.$PACKAGE_SUFFIX + +echo "> Update Gemfile.lock" +bundle + +echo "> Update preview app version" +cd preview + +echo "> Update Gemfile" +# Using -i.bak is a cross-platform way of using sed +# https://stackoverflow.com/a/22084103 +sed -i.bak "s/gem 'ably-ui', '.*', require/gem 'ably-ui', '${RUBY_VERSION}', require/" Gemfile +rm Gemfile.bak + +echo "> Update ably-ui npm package in preview app" +yarn upgrade @ably/ui@$VERSION + + +echo "> Update Gemfile.lock" +bundle lock # don't change contents gem dir as it might be using local paths + +echo "> Commit version publish and preview app update to $TAG" +cd .. +git add package.json lib/ably_ui/version.rb Gemfile.lock +git add preview/package.json preview/yarn.lock preview/Gemfile preview/Gemfile.lock +git commit -m "Publish $TAG and update preview app" + +echo "> Tag commit with $TAG" +git tag --annotate $TAG --message "$TAG" --force + +echo "> Push to repo" +git push origin HEAD --force-with-lease From c29ac146354e273a47e8da10e1594dd3f24d495f Mon Sep 17 00:00:00 2001 From: Arti M Date: Thu, 29 Dec 2022 16:53:57 +0000 Subject: [PATCH 3/4] chore: Fixes based on feedback --- .../core/flash/__snapshots__/snapshot.js.snap | 129 ------------ .../footer/__snapshots__/snapshots.js.snap | 184 ++++++++++-------- .../views/components/footer_react.html.erb | 3 + .../app/views/components/footer_vw.html.erb | 3 + src/core/Footer/component.css | 12 +- src/core/Footer/component.html.erb | 76 ++++---- src/core/Footer/component.jsx | 78 ++++---- 7 files changed, 198 insertions(+), 287 deletions(-) delete mode 100644 cypress/integration/core/flash/__snapshots__/snapshot.js.snap diff --git a/cypress/integration/core/flash/__snapshots__/snapshot.js.snap b/cypress/integration/core/flash/__snapshots__/snapshot.js.snap deleted file mode 100644 index 516bbd995..000000000 --- a/cypress/integration/core/flash/__snapshots__/snapshot.js.snap +++ /dev/null @@ -1,129 +0,0 @@ -exports[`Flash Snapshot Test > renders correcty #0`] = ` -
-
- - - -

- Congratulations! You've won the Oscar -

- -
-
-`; - -exports[`Flash Snapshot Test > renders correcty #1`] = ` -
-
- - - -

This is a notice

- -
-
-`; - -exports[`Flash Snapshot Test > renders correcty #2`] = ` -
-
- - - -

This is an error, very bad

- -
-
-`; - -exports[`Flash Snapshot Test > renders correcty #3`] = ` -
-
- - - -

This is an alert

- -
-
-`; - -exports[`Flash Snapshot Test > renders correcty #4`] = ` -
-
-

- Some useful information, you are welcome -

- -
-
-`; diff --git a/cypress/integration/core/footer/__snapshots__/snapshots.js.snap b/cypress/integration/core/footer/__snapshots__/snapshots.js.snap index 02cc055ae..2b26b2ae0 100644 --- a/cypress/integration/core/footer/__snapshots__/snapshots.js.snap +++ b/cypress/integration/core/footer/__snapshots__/snapshots.js.snap @@ -1,9 +1,9 @@ exports[`Footer Snapshot Test > react > test case common to both #0`] = `