From e6aa0cb7cf2e4ef948a720eb9bcfc46beef4e3bd Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 13:39:35 +0300 Subject: [PATCH 01/21] Move MenuContainer outside of viewport on initial rendering --- src/components/Menu/Menu.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Menu/Menu.js b/src/components/Menu/Menu.js index 5162e57fd..bc73f7061 100644 --- a/src/components/Menu/Menu.js +++ b/src/components/Menu/Menu.js @@ -129,7 +129,11 @@ class Menu extends Component { ? { right: contentPlacementOffset, minWidth: menuWidth } : { left: contentPlacementOffset, minWidth: menuWidth }; } - return {}; + + // When the MenuContent is rendered for the first time + // (for the sake of width calculation), + // move it outside of viewport to prevent possible overflow. + return this.state.isOpen ? {} : { left: '-10000px' }; } positionStyleForArrow(isPositionedRight) { From 1cca614450dca7dcf4352d186683dca47345a978 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 14:29:27 +0300 Subject: [PATCH 02/21] Update tests --- src/components/Menu/__snapshots__/Menu.test.js.snap | 6 +++++- .../TopbarDesktop/__snapshots__/TopbarDesktop.test.js.snap | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/Menu/__snapshots__/Menu.test.js.snap b/src/components/Menu/__snapshots__/Menu.test.js.snap index 3c79dbcb1..69bb7b568 100644 --- a/src/components/Menu/__snapshots__/Menu.test.js.snap +++ b/src/components/Menu/__snapshots__/Menu.test.js.snap @@ -16,7 +16,11 @@ exports[`Menu matches snapshot 1`] = `
      Date: Thu, 14 May 2020 13:49:09 +0300 Subject: [PATCH 03/21] Update Changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc7312a15..0cce6f75e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ way to update this template, but currently, we follow a pattern: ## Upcoming version 2020-XX-XX +- [fix] In some situations, ProfileMenu has began to overflow on TopbarDesktop. + [#1290](https://github.com/sharetribe/ftw-daily/pull/1290) + ## [v4.4.3] 2020-05-13 - [fix] Allow white space on Japanese bank account info. Japan collects bank name and account owner From b24c38654bbd1fb8af7c788235dac095c21405ae Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 20:51:34 +0300 Subject: [PATCH 04/21] Update array.prototype.find --- package.json | 2 +- yarn.lock | 119 ++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 96 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index b8584f056..513147b44 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@sentry/browser": "5.7.1", "@sentry/node": "5.7.1", "array-includes": "^3.0.3", - "array.prototype.find": "^2.0.4", + "array.prototype.find": "^2.1.1", "autosize": "^4.0.0", "basic-auth": "^2.0.1", "body-parser": "^1.18.3", diff --git a/yarn.lock b/yarn.lock index 4aa6f68b4..d28dc6982 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1853,7 +1853,15 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.find@^2.0.4, array.prototype.find@^2.1.0: +array.prototype.find@^2.0.4, array.prototype.find@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.1.tgz#3baca26108ca7affb08db06bf0be6cb3115a969c" + integrity sha512-mi+MYNJYLTx2eNYy+Yh6raoQacCsNeeMUaspFPh9Y141lFSsWxxB8V9mM2ye+eqiRs917J6/pJ4M9ZPzenWckA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.4" + +array.prototype.find@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.0.tgz#630f2eaf70a39e608ac3573e45cf8ccd0ede9ad7" integrity sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg== @@ -3957,7 +3965,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13.0, es-abstract@^1.5.1, es-abstract@^1.7.0: +es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: version "1.13.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== @@ -3969,10 +3977,27 @@ es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13 is-regex "^1.0.4" object-keys "^1.0.12" -es-to-primitive@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== +es-abstract@^1.13.0, es-abstract@^1.17.4, es-abstract@^1.17.5: + version "1.17.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9" + integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.1.5" + is-regex "^1.0.5" + object-inspect "^1.7.0" + object-keys "^1.1.1" + object.assign "^4.1.0" + string.prototype.trimleft "^2.1.1" + string.prototype.trimright "^2.1.1" + +es-to-primitive@^1.2.0, es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" @@ -5066,10 +5091,10 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= +has-symbols@^1.0.0, has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== has-unicode@^2.0.0: version "2.0.1" @@ -5737,10 +5762,10 @@ is-buffer@^2.0.2: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== -is-callable@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== +is-callable@^1.1.4, is-callable@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" + integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== is-ci@^1.0.10: version "1.2.1" @@ -5783,9 +5808,9 @@ is-data-descriptor@^1.0.0: kind-of "^6.0.0" is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" + integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== is-descriptor@^0.1.0: version "0.1.6" @@ -5934,12 +5959,12 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= +is-regex@^1.0.4, is-regex@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" + integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== dependencies: - has "^1.0.1" + has "^1.0.3" is-regexp@^1.0.0: version "1.0.0" @@ -5983,13 +6008,20 @@ is-svg@^3.0.0: dependencies: html-comment-regex "^1.1.0" -is-symbol@^1.0.1, is-symbol@^1.0.2: +is-symbol@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== dependencies: has-symbols "^1.0.0" +is-symbol@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== + dependencies: + has-symbols "^1.0.1" + is-touch-device@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-touch-device/-/is-touch-device-1.0.1.tgz#9a2fd59f689e9a9bf6ae9a86924c4ba805a42eab" @@ -7636,12 +7668,17 @@ object-inspect@^1.6.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== +object-inspect@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== + object-is@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" integrity sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY= -object-keys@^1.0.11, object-keys@^1.0.12: +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -10562,6 +10599,40 @@ string.prototype.trim@^1.1.2: es-abstract "^1.13.0" function-bind "^1.1.1" +string.prototype.trimend@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" + integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + +string.prototype.trimleft@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz#4408aa2e5d6ddd0c9a80739b087fbc067c03b3cc" + integrity sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + string.prototype.trimstart "^1.0.0" + +string.prototype.trimright@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz#c76f1cef30f21bbad8afeb8db1511496cfb0f2a3" + integrity sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + string.prototype.trimend "^1.0.0" + +string.prototype.trimstart@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" + integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" From 470b6d8d62e5f282691da205e33aae8f60017d4f Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 20:53:23 +0300 Subject: [PATCH 05/21] Update bfj --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 513147b44..58da057f0 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "devDependencies": { "babel-jest": "24.9.0", - "bfj": "^7.0.1", + "bfj": "^7.0.2", "chalk": "^2.4.1", "enzyme": "^3.9.0", "enzyme-adapter-react-16": "^1.12.0", diff --git a/yarn.lock b/yarn.lock index d28dc6982..8a46f3119 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2199,13 +2199,13 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bfj@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/bfj/-/bfj-7.0.1.tgz#da7d3da7adb59124809675c984727a5a673feef9" - integrity sha512-Zsy7GRuwXTxxTUUMAJ2mnKKkzuwMx0/byIxZHAUiw5QlVzrlX274f4P4V0e2BAhYwgqH5qVi2bVKPfwtUayw5Q== +bfj@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/bfj/-/bfj-7.0.2.tgz#1988ce76f3add9ac2913fd8ba47aad9e651bfbb2" + integrity sha512-+e/UqUzwmzJamNF50tBV6tZPTORow7gQ96iFow+8b562OdMpEK0BcJEq2OSPEDmAbSMBQ7PKZ87ubFkgxpYWgw== dependencies: bluebird "^3.5.5" - check-types "^8.0.3" + check-types "^11.1.1" hoopy "^0.1.4" tryer "^1.0.1" @@ -2614,10 +2614,10 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -check-types@^8.0.3: - version "8.0.3" - resolved "https://registry.yarnpkg.com/check-types/-/check-types-8.0.3.tgz#3356cca19c889544f2d7a95ed49ce508a0ecf552" - integrity sha512-YpeKZngUmG65rLudJ4taU7VLkOCTMhNl/u4ctNC56LQS/zJTyNH0Lrtwm1tfTsbLlwvlfsA2d1c8vCf/Kh2KwQ== +check-types@^11.1.1: + version "11.1.2" + resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.1.2.tgz#86a7c12bf5539f6324eb0e70ca8896c0e38f3e2f" + integrity sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ== cheerio@^1.0.0-rc.2: version "1.0.0-rc.3" From 84e2976c41f10b008a1a794ac3d8c576c506d4af Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 20:55:26 +0300 Subject: [PATCH 06/21] Update cookie-parser --- package.json | 2 +- yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 58da057f0..f397cd646 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "body-parser": "^1.18.3", "classnames": "^2.2.6", "compression": "^1.7.4", - "cookie-parser": "^1.4.4", + "cookie-parser": "^1.4.5", "core-js": "^3.1.4", "decimal.js": "10.2.0", "dotenv": "6.2.0", diff --git a/yarn.lock b/yarn.lock index 8a46f3119..d2dd1b886 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2981,12 +2981,12 @@ convert-source-map@^0.3.3: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-0.3.5.tgz#f1d802950af7dd2631a1febe0596550c86ab3190" integrity sha1-8dgClQr33SYxof6+BZZVDIarMZA= -cookie-parser@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/cookie-parser/-/cookie-parser-1.4.4.tgz#e6363de4ea98c3def9697b93421c09f30cf5d188" - integrity sha512-lo13tqF3JEtFO7FyA49CqbhaFkskRJ0u/UAiINgrIXeRCY41c88/zxtrECl8AKH3B0hj9q10+h3Kt8I7KlW4tw== +cookie-parser@^1.4.5: + version "1.4.5" + resolved "https://registry.yarnpkg.com/cookie-parser/-/cookie-parser-1.4.5.tgz#3e572d4b7c0c80f9c61daf604e4336831b5d1d49" + integrity sha512-f13bPUj/gG/5mDr+xLmSxxDsB9DQiTIfhJS/sqjrmfAWiAN+x2O4i/XguTL9yDZ+/IFDanJ+5x7hC4CXT9Tdzw== dependencies: - cookie "0.3.1" + cookie "0.4.0" cookie-signature "1.0.6" cookie-signature@1.0.6: @@ -2994,16 +2994,16 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.3.1, cookie@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - cookie@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== +cookie@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= + copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" From 1f32ad48be96913bfe7b394a19f776d41982fed7 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 20:58:16 +0300 Subject: [PATCH 07/21] Update enzyme-to-json --- package.json | 2 +- yarn.lock | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f397cd646..69d74d8b4 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "chalk": "^2.4.1", "enzyme": "^3.9.0", "enzyme-adapter-react-16": "^1.12.0", - "enzyme-to-json": "^3.3.5", + "enzyme-to-json": "^3.4.4", "inquirer": "^7.0.0", "nodemon": "^1.17.2", "prettier": "^1.18.2" diff --git a/yarn.lock b/yarn.lock index d2dd1b886..61a92f958 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3917,12 +3917,13 @@ enzyme-shallow-equal@^1.0.0: has "^1.0.3" object-is "^1.0.1" -enzyme-to-json@^3.3.5: - version "3.4.0" - resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.4.0.tgz#2b6330a784a57ba68298e3c0d6cef17ee4fedc0e" - integrity sha512-gbu8P8PMAtb+qtKuGVRdZIYxWHC03q1dGS3EKRmUzmTDIracu3o6cQ0d4xI2YWojbelbxjYOsmqM5EgAL0WgIA== +enzyme-to-json@^3.4.4: + version "3.4.4" + resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.4.4.tgz#b30726c59091d273521b6568c859e8831e94d00e" + integrity sha512-50LELP/SCPJJGic5rAARvU7pgE3m1YaNj7JLM+Qkhl5t7PAs6fiyc8xzc50RnkKPFQCv0EeFVjEWdIFRGPWMsA== dependencies: - lodash "^4.17.12" + lodash "^4.17.15" + react-is "^16.12.0" enzyme@^3.9.0: version "3.10.0" @@ -9316,6 +9317,11 @@ react-intl@^3.1.13: invariant "^2.1.1" shallow-equal "^1.1.0" +react-is@^16.12.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + react-is@^16.6.0, react-is@^16.7.0: version "16.8.6" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" From 1b95a6e1e38144554fc059e08d6c6379ca341b4c Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 21:03:41 +0300 Subject: [PATCH 08/21] Update final-form-arrays --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 69d74d8b4..90e3ceb91 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express-enforces-ssl": "^1.1.0", "express-sitemap": "^1.8.0", "final-form": "^4.18.5", - "final-form-arrays": "^3.0.0", + "final-form-arrays": "^3.0.2", "full-icu": "^1.3.0", "helmet": "^3.21.2", "intl-pluralrules": "^1.0.3", diff --git a/yarn.lock b/yarn.lock index 61a92f958..a5b047f81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4592,10 +4592,10 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" -final-form-arrays@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/final-form-arrays/-/final-form-arrays-3.0.1.tgz#862e5e946d391039ebcdfadbe55fc3a63849e559" - integrity sha512-GKXecufCNCjDcz1+3peL21LuuTlApoxCcnpOnmfeJfC3xAlFKGdytYMfifP7W1IEWTGC8twTv3zItESkej8qpg== +final-form-arrays@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/final-form-arrays/-/final-form-arrays-3.0.2.tgz#9f3bef778dec61432357744eb6f3abef7e7f3847" + integrity sha512-TfO8aZNz3RrsZCDx8GHMQcyztDNpGxSSi9w4wpSNKlmv2PfFWVVM8P7Yj5tj4n0OWax+x5YwTLhT5BnqSlCi+w== final-form@^4.18.5: version "4.18.5" From f9d912de991aa10130935c7992881dfe970ab660 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 21:06:27 +0300 Subject: [PATCH 09/21] Update full-icu --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 90e3ceb91..1e3d82588 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "express-sitemap": "^1.8.0", "final-form": "^4.18.5", "final-form-arrays": "^3.0.2", - "full-icu": "^1.3.0", + "full-icu": "^1.3.1", "helmet": "^3.21.2", "intl-pluralrules": "^1.0.3", "lodash": "^4.17.14", diff --git a/yarn.lock b/yarn.lock index a5b047f81..707225a74 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4826,10 +4826,10 @@ fsevents@^1.2.7: nan "^2.12.1" node-pre-gyp "^0.12.0" -full-icu@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/full-icu/-/full-icu-1.3.0.tgz#1fb4d60050103ad9dcf53735c000e4a03d80c574" - integrity sha512-LGLpSsbkHUT0T+EKrIJltYoejYzUqg1eW+n6wm/FTte1pDiYjeKTxO0uJvrE3jgv6V9eBzMAjF6A8jH16C0+eQ== +full-icu@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/full-icu/-/full-icu-1.3.1.tgz#e67fdf58523f1d1e0d9143b1542fe2024c1c8997" + integrity sha512-VMtK//85QJomhk3cXOCksNwOYaw1KWnYTS37GYGgyf7A3ajdBoPGhaJuJWAH2S2kq8GZeXkdKn+3Mfmgy11cVw== function-bind@^1.1.1: version "1.1.1" From acc792293de6feed3544c44c9bd2397dfbfe3c21 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 21:10:42 +0300 Subject: [PATCH 10/21] Update object.entries --- package.json | 2 +- yarn.lock | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1e3d82588..4ea812ead 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "lodash": "^4.17.14", "mapbox-gl-multitouch": "^1.0.3", "moment": "^2.22.2", - "object.entries": "^1.0.4", + "object.entries": "^1.1.1", "object.values": "^1.0.4", "path-to-regexp": "^3.0.0", "prop-types": "^15.7.2", diff --git a/yarn.lock b/yarn.lock index 707225a74..6d5582080 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3978,7 +3978,7 @@ es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5. is-regex "^1.0.4" object-keys "^1.0.12" -es-abstract@^1.13.0, es-abstract@^1.17.4, es-abstract@^1.17.5: +es-abstract@^1.13.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.4, es-abstract@^1.17.5: version "1.17.5" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9" integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg== @@ -7716,6 +7716,16 @@ object.entries@^1.0.4, object.entries@^1.1.0: function-bind "^1.1.1" has "^1.0.3" +object.entries@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.1.tgz#ee1cf04153de02bb093fec33683900f57ce5399b" + integrity sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + object.fromentries@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" From b67557c015f19d721f371079e761b783b109ff99 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 21:12:24 +0300 Subject: [PATCH 11/21] Update object.values --- package.json | 2 +- yarn.lock | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ea812ead..d5820e336 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "mapbox-gl-multitouch": "^1.0.3", "moment": "^2.22.2", "object.entries": "^1.1.1", - "object.values": "^1.0.4", + "object.values": "^1.1.1", "path-to-regexp": "^3.0.0", "prop-types": "^15.7.2", "query-string": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index 6d5582080..0c4c7991b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7761,6 +7761,16 @@ object.values@^1.0.4, object.values@^1.1.0: function-bind "^1.1.1" has "^1.0.3" +object.values@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e" + integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" From a31bfdc649cae14cf4f9187106b277ae8ae46e5e Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 21:16:01 +0300 Subject: [PATCH 12/21] Update react-helmet-async --- package.json | 2 +- yarn.lock | 54 ++++++++++++++++++++++++++-------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index d5820e336..d2a999253 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "react-final-form": "^6.3.0", "react-final-form-arrays": "^3.1.1", "react-google-maps": "^9.4.5", - "react-helmet-async": "^1.0.2", + "react-helmet-async": "^1.0.6", "react-intl": "^3.1.13", "react-moment-proptypes": "^1.6.0", "react-redux": "^7.1.1", diff --git a/yarn.lock b/yarn.lock index 0c4c7991b..aa1d39cab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -756,13 +756,6 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-typescript" "^7.3.2" -"@babel/runtime@7.3.4": - version "7.3.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.4.tgz#73d12ba819e365fcf7fd152aed56d6df97d21c83" - integrity sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g== - dependencies: - regenerator-runtime "^0.12.0" - "@babel/runtime@7.5.5", "@babel/runtime@^7.0.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" @@ -784,6 +777,13 @@ dependencies: regenerator-runtime "^0.13.2" +"@babel/runtime@^7.9.2": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.6.tgz#a9102eb5cadedf3f31d08a9ecf294af7827ea29f" + integrity sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" @@ -5680,7 +5680,7 @@ intl-pluralrules@^1.0.3: dependencies: make-plural "^4.3.0" -invariant@2.2.4, invariant@^2.1.1, invariant@^2.2.1, invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.1.1, invariant@^2.2.1, invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -9001,7 +9001,7 @@ prop-types-exact@^1.2.0: object.assign "^4.1.0" reflect.ownkeys "^0.2.0" -prop-types@15.7.2, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -9273,10 +9273,10 @@ react-error-overlay@^6.0.1: resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.1.tgz#b8d3cf9bb991c02883225c48044cb3ee20413e0f" integrity sha512-V9yoTr6MeZXPPd4nV/05eCBvGH9cGzc52FN8fs0O0TVQ3HYYf1n7EgZVtHbldRq5xU9zEzoXIITjYNIfxDDdUw== -react-fast-compare@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" - integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw== +react-fast-compare@^3.0.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.1.1.tgz#0becf31e3812fa70dc231e259f40d892d4767900" + integrity sha512-SCsAORWK59BvauR2L1BTdjQbJcSGJJz03U0awektk2hshLKrITDDFTlgGCqIZpTDlPC/NFlZee6xTMzXPVLiHw== react-final-form-arrays@^3.1.1: version "3.1.1" @@ -9310,16 +9310,16 @@ react-google-maps@^9.4.5: scriptjs "^2.5.8" warning "^3.0.0" -react-helmet-async@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.0.2.tgz#bb55dd8268f7b15aac69c6b22e2f950abda8cc44" - integrity sha512-qzzchrM/ibHuPS/60ief8jaibPunuRdeta4iBDQV+ri2SFKwOV+X2NlEpvevZOauhmHrH/I6dI4E90EPVfJBBg== +react-helmet-async@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.0.6.tgz#11c15c74e79b3f66670c73779bef3e0e352b1d4e" + integrity sha512-t+bhAI4NgxfEv8ez4r77cLfR4O4Z55E/FH2DT+uiE4U7yfWgAk7OAOi7IxHxuYEVLI26bqjZvlVCkpC5/5AoNA== dependencies: - "@babel/runtime" "7.3.4" - invariant "2.2.4" - prop-types "15.7.2" - react-fast-compare "2.0.4" - shallowequal "1.1.0" + "@babel/runtime" "^7.9.2" + invariant "^2.2.4" + prop-types "^15.7.2" + react-fast-compare "^3.0.1" + shallowequal "^1.1.0" react-intl@^3.1.13: version "3.1.13" @@ -9627,10 +9627,10 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.12.0: - version "0.12.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" - integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== +regenerator-runtime@^0.13.4: + version "0.13.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" + integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== regenerator-transform@^0.14.0: version "0.14.1" @@ -10190,7 +10190,7 @@ shallow-equal@^1.1.0: resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.0.tgz#fd828d2029ff4e19569db7e19e535e94e2d1f5cc" integrity sha512-Z21pVxR4cXsfwpMKMhCEIO1PCi5sp7KEp+CmOpBQ+E8GpHwKOw2sEzk7sgblM3d/j4z4gakoWEoPcjK0VJQogA== -shallowequal@1.1.0: +shallowequal@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== From cd431a8d50a09672de08b13b450365a8b504dd7d Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 21:18:27 +0300 Subject: [PATCH 13/21] Update redux --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d2a999253..de2cf3ee4 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "react-moment-proptypes": "^1.6.0", "react-redux": "^7.1.1", "react-router-dom": "^5.0.1", - "redux": "^4.0.1", + "redux": "^4.0.5", "redux-thunk": "^2.3.0", "seedrandom": "^3.0.3", "sharetribe-flex-sdk": "^1.9.1", diff --git a/yarn.lock b/yarn.lock index aa1d39cab..51b7f1e27 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9587,10 +9587,10 @@ redux-thunk@^2.3.0: resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622" integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw== -redux@^4.0.1: - version "4.0.4" - resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796" - integrity sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q== +redux@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f" + integrity sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w== dependencies: loose-envify "^1.4.0" symbol-observable "^1.2.0" From 0e563a5db6b772a3ff809e8013c2970173e88a6d Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 21:21:43 +0300 Subject: [PATCH 14/21] Update seedrandom --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index de2cf3ee4..e630a6fa6 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "react-router-dom": "^5.0.1", "redux": "^4.0.5", "redux-thunk": "^2.3.0", - "seedrandom": "^3.0.3", + "seedrandom": "^3.0.5", "sharetribe-flex-sdk": "^1.9.1", "sharetribe-scripts": "3.1.1", "smoothscroll-polyfill": "^0.4.0", diff --git a/yarn.lock b/yarn.lock index 51b7f1e27..a29a35598 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10039,10 +10039,10 @@ scriptjs@^2.5.8: resolved "https://registry.yarnpkg.com/scriptjs/-/scriptjs-2.5.9.tgz#343915cd2ec2ed9bfdde2b9875cd28f59394b35f" integrity sha512-qGVDoreyYiP1pkQnbnFAUIS5AjenNwwQBdl7zeos9etl+hYKWahjRTfzAZZYBv5xNHx7vNKCmaLDQZ6Fr2AEXg== -seedrandom@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.3.tgz#74efcc324533b417b8f3e2cf2a70797aa4a94441" - integrity sha512-PJLhhxIMjlMJaiIRtqiVW061EZn3cS+waZkbFe7eCa2R3g88HbNdWmw4NTFG1w5unxd0GeNaUUxZJP7gPAzSDQ== +seedrandom@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.5.tgz#54edc85c95222525b0c7a6f6b3543d8e0b3aa0a7" + integrity sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg== select-hose@^2.0.0: version "2.0.0" From d0a8106e87d0a94e54142a88815a2a10e85b1786 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 14 May 2020 21:30:29 +0300 Subject: [PATCH 15/21] Update Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cce6f75e..c69bd2577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ way to update this template, but currently, we follow a pattern: - [fix] In some situations, ProfileMenu has began to overflow on TopbarDesktop. [#1290](https://github.com/sharetribe/ftw-daily/pull/1290) +- [change] Update dependencies (patch updates only) + [#1291](https://github.com/sharetribe/ftw-daily/pull/1291) ## [v4.4.3] 2020-05-13 From 6c72976d1539c5836fd0d5ed7b2d664cc36e8633 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Mon, 18 May 2020 17:51:38 +0300 Subject: [PATCH 16/21] Move API router handlers into their own files --- server/api/initiate-login-as.js | 74 ++++++++++++++++ server/api/login-as.js | 93 ++++++++++++++++++++ server/apiRouter.js | 145 +------------------------------- 3 files changed, 171 insertions(+), 141 deletions(-) create mode 100644 server/api/initiate-login-as.js create mode 100644 server/api/login-as.js diff --git a/server/api/initiate-login-as.js b/server/api/initiate-login-as.js new file mode 100644 index 000000000..c7c7b4d35 --- /dev/null +++ b/server/api/initiate-login-as.js @@ -0,0 +1,74 @@ +const crypto = require('crypto'); + +const CLIENT_ID = process.env.REACT_APP_SHARETRIBE_SDK_CLIENT_ID; +const ROOT_URL = process.env.REACT_APP_CANONICAL_ROOT_URL; +const CONSOLE_URL = + process.env.SERVER_SHARETRIBE_CONSOLE_URL || 'https://flex-console.sharetribe.com'; +const USING_SSL = process.env.REACT_APP_SHARETRIBE_USING_SSL === 'true'; + +// redirect_uri param used when initiating a login as authentication flow and +// when requesting a token using an authorization code +const loginAsRedirectUri = `${ROOT_URL.replace(/\/$/, '')}/api/login-as`; + +// Cookies used for authorization code authentication. +const stateKey = `st-${CLIENT_ID}-oauth2State`; +const codeVerifierKey = `st-${CLIENT_ID}-pkceCodeVerifier`; + +/** + * Makes a base64 string URL friendly by + * replacing unaccepted characters. + */ +const urlifyBase64 = base64Str => + base64Str + .replace(/\+/g, '-') + .replace(/\//g, '_') + .replace(/=/g, ''); + +// Initiates an authorization code authentication flow. This authentication flow +// enables marketplace operators that have an ongoing Console session to log +// into their marketplace as a user of the marketplace. +// +// The authorization code is requested from Console and it is used to request a +// token from the Flex Auth API. +// +// This endpoint will return a 302 to Console which requests the authorization +// code. Console returns a 302 with the code to the `redirect_uri` that is +// passed in this response. The request to the redirect URI is handled with the +// `/login-as` endpoint. +module.exports = (req, res) => { + const userId = req.query.user_id; + + if (!userId) { + return res.status(400).send('Missing query parameter: user_id.'); + } + if (!ROOT_URL) { + return res.status(409).send('Marketplace canonical root URL is missing.'); + } + + const state = urlifyBase64(crypto.randomBytes(32).toString('base64')); + const codeVerifier = urlifyBase64(crypto.randomBytes(32).toString('base64')); + const hash = crypto + .createHash('sha256') + .update(codeVerifier) + .digest('base64'); + const codeChallenge = urlifyBase64(hash); + const authorizeServerUrl = `${CONSOLE_URL}/api/authorize-as`; + + const location = `${authorizeServerUrl}?\ +response_type=code&\ +client_id=${CLIENT_ID}&\ +redirect_uri=${loginAsRedirectUri}&\ +user_id=${userId}&\ +state=${state}&\ +code_challenge=${codeChallenge}&\ +code_challenge_method=S256`; + + const cookieOpts = { + maxAge: 1000 * 30, // 30 seconds + secure: USING_SSL, + }; + + res.cookie(stateKey, state, cookieOpts); + res.cookie(codeVerifierKey, codeVerifier, cookieOpts); + return res.redirect(location); +}; diff --git a/server/api/login-as.js b/server/api/login-as.js new file mode 100644 index 000000000..b8c40b79b --- /dev/null +++ b/server/api/login-as.js @@ -0,0 +1,93 @@ +const http = require('http'); +const https = require('https'); +const sharetribeSdk = require('sharetribe-flex-sdk'); +const Decimal = require('decimal.js'); + +const CLIENT_ID = process.env.REACT_APP_SHARETRIBE_SDK_CLIENT_ID; +const ROOT_URL = process.env.REACT_APP_CANONICAL_ROOT_URL; +const BASE_URL = process.env.REACT_APP_SHARETRIBE_SDK_BASE_URL; +const TRANSIT_VERBOSE = process.env.REACT_APP_SHARETRIBE_SDK_TRANSIT_VERBOSE === 'true'; +const USING_SSL = process.env.REACT_APP_SHARETRIBE_USING_SSL === 'true'; + +// redirect_uri param used when initiating a login as authentication flow and +// when requesting a token using an authorization code +const loginAsRedirectUri = `${ROOT_URL.replace(/\/$/, '')}/api/login-as`; + +// Instantiate HTTP(S) Agents with keepAlive set to true. +// This will reduce the request time for consecutive requests by +// reusing the existing TCP connection, thus eliminating the time used +// for setting up new TCP connections. +const httpAgent = new http.Agent({ keepAlive: true }); +const httpsAgent = new https.Agent({ keepAlive: true }); + +// Cookies used for authorization code authentication. +const stateKey = `st-${CLIENT_ID}-oauth2State`; +const codeVerifierKey = `st-${CLIENT_ID}-pkceCodeVerifier`; + +/** + * Makes a base64 string URL friendly by + * replacing unaccepted characters. + */ +const urlifyBase64 = base64Str => + base64Str + .replace(/\+/g, '-') + .replace(/\//g, '_') + .replace(/=/g, ''); + +// Works as the redirect_uri passed in an authorization code request. Receives +// an authorization code and uses that to log in and redirect to the landing +// page. +module.exports = (req, res) => { + const { code, state, error } = req.query; + const storedState = req.cookies[stateKey]; + + if (state !== storedState) { + res.status(401).send('Invalid state parameter.'); + return; + } + + if (error) { + res.status(401).send(`Failed to authorize as a user, error: ${error}.`); + return; + } + + const codeVerifier = req.cookies[codeVerifierKey]; + + // clear state and code verifier cookies + res.clearCookie(stateKey, { secure: USING_SSL }); + res.clearCookie(codeVerifierKey, { secure: USING_SSL }); + + const baseUrl = BASE_URL ? { baseUrl: BASE_URL } : {}; + const tokenStore = sharetribeSdk.tokenStore.expressCookieStore({ + clientId: CLIENT_ID, + req, + res, + secure: USING_SSL, + }); + + const sdk = sharetribeSdk.createInstance({ + transitVerbose: TRANSIT_VERBOSE, + clientId: CLIENT_ID, + httpAgent: httpAgent, + httpsAgent: httpsAgent, + tokenStore, + typeHandlers: [ + { + type: sharetribeSdk.types.BigDecimal, + customType: Decimal, + writer: v => new sharetribeSdk.types.BigDecimal(v.toString()), + reader: v => new Decimal(v.value), + }, + ], + ...baseUrl, + }); + + sdk + .login({ + code, + redirect_uri: loginAsRedirectUri, + code_verifier: codeVerifier, + }) + .then(() => res.redirect('/')) + .catch(() => res.status(401).send('Unable to authenticate as a user')); +}; diff --git a/server/apiRouter.js b/server/apiRouter.js index 8e3c6d571..60c2b9e3a 100644 --- a/server/apiRouter.js +++ b/server/apiRouter.js @@ -6,151 +6,14 @@ * endpoints are prefixed in the main server where this file is used. */ -const http = require('http'); -const https = require('https'); const express = require('express'); -const crypto = require('crypto'); -const sharetribeSdk = require('sharetribe-flex-sdk'); -const Decimal = require('decimal.js'); -const CLIENT_ID = process.env.REACT_APP_SHARETRIBE_SDK_CLIENT_ID; -const ROOT_URL = process.env.REACT_APP_CANONICAL_ROOT_URL; -const CONSOLE_URL = - process.env.SERVER_SHARETRIBE_CONSOLE_URL || 'https://flex-console.sharetribe.com'; -const BASE_URL = process.env.REACT_APP_SHARETRIBE_SDK_BASE_URL; -const TRANSIT_VERBOSE = process.env.REACT_APP_SHARETRIBE_SDK_TRANSIT_VERBOSE === 'true'; -const USING_SSL = process.env.REACT_APP_SHARETRIBE_USING_SSL === 'true'; +const initiateLoginAs = require('./api/initiate-login-as'); +const loginAs = require('./api/login-as'); const router = express.Router(); -// redirect_uri param used when initiating a login as authentication flow and -// when requesting a token using an authorization code -const loginAsRedirectUri = `${ROOT_URL.replace(/\/$/, '')}/api/login-as`; - -// Instantiate HTTP(S) Agents with keepAlive set to true. -// This will reduce the request time for consecutive requests by -// reusing the existing TCP connection, thus eliminating the time used -// for setting up new TCP connections. -const httpAgent = new http.Agent({ keepAlive: true }); -const httpsAgent = new https.Agent({ keepAlive: true }); - -// Cookies used for authorization code authentication. -const stateKey = `st-${CLIENT_ID}-oauth2State`; -const codeVerifierKey = `st-${CLIENT_ID}-pkceCodeVerifier`; - -/** - * Makes a base64 string URL friendly by - * replacing unaccepted characters. - */ -const urlifyBase64 = base64Str => - base64Str - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=/g, ''); - -// Initiates an authorization code authentication flow. This authentication flow -// enables marketplace operators that have an ongoing Console session to log -// into their marketplace as a user of the marketplace. -// -// The authorization code is requested from Console and it is used to request a -// token from the Flex Auth API. -// -// This endpoint will return a 302 to Console which requests the authorization -// code. Console returns a 302 with the code to the `redirect_uri` that is -// passed in this response. The request to the redirect URI is handled with the -// `/login-as` endpoint. -router.get('/initiate-login-as', (req, res) => { - const userId = req.query.user_id; - - if (!userId) { - return res.status(400).send('Missing query parameter: user_id.'); - } - if (!ROOT_URL) { - return res.status(409).send('Marketplace canonical root URL is missing.'); - } - - const state = urlifyBase64(crypto.randomBytes(32).toString('base64')); - const codeVerifier = urlifyBase64(crypto.randomBytes(32).toString('base64')); - const hash = crypto - .createHash('sha256') - .update(codeVerifier) - .digest('base64'); - const codeChallenge = urlifyBase64(hash); - const authorizeServerUrl = `${CONSOLE_URL}/api/authorize-as`; - - const location = `${authorizeServerUrl}?\ -response_type=code&\ -client_id=${CLIENT_ID}&\ -redirect_uri=${loginAsRedirectUri}&\ -user_id=${userId}&\ -state=${state}&\ -code_challenge=${codeChallenge}&\ -code_challenge_method=S256`; - - const cookieOpts = { - maxAge: 1000 * 30, // 30 seconds - secure: USING_SSL, - }; - - res.cookie(stateKey, state, cookieOpts); - res.cookie(codeVerifierKey, codeVerifier, cookieOpts); - return res.redirect(location); -}); - -// Works as the redirect_uri passed in an authorization code request. Receives -// an authorization code and uses that to log in and redirect to the landing -// page. -router.get('/login-as', (req, res) => { - const { code, state, error } = req.query; - const storedState = req.cookies[stateKey]; - - if (state !== storedState) { - return res.status(401).send('Invalid state parameter.'); - } - - if (error) { - return res.status(401).send(`Failed to authorize as a user, error: ${error}.`); - } - - const codeVerifier = req.cookies[codeVerifierKey]; - - // clear state and code verifier cookies - res.clearCookie(stateKey, { secure: USING_SSL }); - res.clearCookie(codeVerifierKey, { secure: USING_SSL }); - - const baseUrl = BASE_URL ? { baseUrl: BASE_URL } : {}; - const tokenStore = sharetribeSdk.tokenStore.expressCookieStore({ - clientId: CLIENT_ID, - req, - res, - secure: USING_SSL, - }); - - const sdk = sharetribeSdk.createInstance({ - transitVerbose: TRANSIT_VERBOSE, - clientId: CLIENT_ID, - httpAgent: httpAgent, - httpsAgent: httpsAgent, - tokenStore, - typeHandlers: [ - { - type: sharetribeSdk.types.BigDecimal, - customType: Decimal, - writer: v => new sharetribeSdk.types.BigDecimal(v.toString()), - reader: v => new Decimal(v.value), - }, - ], - ...baseUrl, - }); - - sdk - .login({ - code, - redirect_uri: loginAsRedirectUri, - code_verifier: codeVerifier, - }) - .then(() => res.redirect('/')) - .catch(() => res.status(401).send('Unable to authenticate as a user')); -}); +router.get('/initiate-login-as', initiateLoginAs); +router.get('/login-as', loginAs); module.exports = router; From fe46e95a1cf3a7434ba8208d115c4f6be96c1698 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Mon, 1 Jun 2020 15:07:05 +0300 Subject: [PATCH 17/21] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c69bd2577..36dc5b167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ way to update this template, but currently, we follow a pattern: [#1290](https://github.com/sharetribe/ftw-daily/pull/1290) - [change] Update dependencies (patch updates only) [#1291](https://github.com/sharetribe/ftw-daily/pull/1291) +- [change] Refactor server API routes into separate files. + [#1294](https://github.com/sharetribe/ftw-daily/pull/1294) ## [v4.4.3] 2020-05-13 From 0362659be8eeb9acf45744894d64a66e44ca7276 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Wed, 20 May 2020 15:19:45 +0300 Subject: [PATCH 18/21] Add concurrently package --- package.json | 1 + yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/package.json b/package.json index e630a6fa6..8bbac997a 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "babel-jest": "24.9.0", "bfj": "^7.0.2", "chalk": "^2.4.1", + "concurrently": "^5.2.0", "enzyme": "^3.9.0", "enzyme-adapter-react-16": "^1.12.0", "enzyme-to-json": "^3.4.4", diff --git a/yarn.lock b/yarn.lock index a29a35598..24cef0acb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2903,6 +2903,21 @@ concat-stream@^1.5.0: readable-stream "^2.2.2" typedarray "^0.0.6" +concurrently@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-5.2.0.tgz#ead55121d08a0fc817085584c123cedec2e08975" + integrity sha512-XxcDbQ4/43d6CxR7+iV8IZXhur4KbmEJk1CetVMUqCy34z9l0DkszbY+/9wvmSnToTej0SYomc2WSRH+L0zVJw== + dependencies: + chalk "^2.4.2" + date-fns "^2.0.1" + lodash "^4.17.15" + read-pkg "^4.0.1" + rxjs "^6.5.2" + spawn-command "^0.0.2-1" + supports-color "^6.1.0" + tree-kill "^1.2.2" + yargs "^13.3.0" + configstore@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" @@ -3415,6 +3430,11 @@ date-fns@^2.0.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.0.1.tgz#c5f30e31d3294918e6b6a82753a4e719120e203d" integrity sha512-C14oTzTZy8DH1Eq8N78owrCWvf3+cnJw88BTK/N3DYWVxDJuJzPaNdplzYxDYuuXXGvqBcO4Vy5SOrwAooXSWw== +date-fns@^2.0.1: + version "2.14.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.14.0.tgz#359a87a265bb34ef2e38f93ecf63ac453f9bc7ba" + integrity sha512-1zD+68jhFgDIM0rF05rcwYO8cExdNqxjq4xP1QKM60Q45mnO6zaMWB4tOzrIr4M4GSLntsKeE4c9Bdl2jhL/yw== + date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" @@ -9519,6 +9539,15 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" +read-pkg@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" + integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc= + dependencies: + normalize-package-data "^2.3.2" + parse-json "^4.0.0" + pify "^3.0.0" + "readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -9949,6 +9978,13 @@ rxjs@^6.4.0: dependencies: tslib "^1.9.0" +rxjs@^6.5.2: + version "6.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" + integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -10425,6 +10461,11 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= +spawn-command@^0.0.2-1: + version "0.0.2-1" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" + integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= + spdx-correct@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" @@ -11027,6 +11068,11 @@ transit-js@^0.8.861: resolved "https://registry.yarnpkg.com/transit-js/-/transit-js-0.8.861.tgz#829e516b80349a41fff5d59f5e6993b5473f72c9" integrity sha512-4O9OrYPZw6C0M5gMTvaeOp+xYz6EF79JsyxIvqXHlt+pisSrioJWFOE80N8aCPoJLcNaXF442RZrVtdmd4wkDQ== +tree-kill@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== + trim-newlines@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" From 542927ca0f0c9a86bff664c6ccc766dcdee30852 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Fri, 22 May 2020 12:47:35 +0300 Subject: [PATCH 19/21] Add a simple API server for the local API routes in dev time --- package.json | 5 ++++- server/apiServer.js | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 server/apiServer.js diff --git a/package.json b/package.json index 8bbac997a..3bb8205dd 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,10 @@ "audit": "yarn audit --json | node scripts/audit.js", "clean": "rm -rf build/*", "config": "node scripts/config.js", - "dev": "node scripts/config.js --check && sharetribe-scripts start", + "config-check": "node scripts/config.js --check", + "dev-frontend": "sharetribe-scripts start", + "dev-backend": "DEV_API_SERVER_PORT=3500 nodemon server/apiServer.js", + "dev": "yarn run config-check&&concurrently --kill-others \"yarn run dev-frontend\" \"yarn run dev-backend\"", "build": "sharetribe-scripts build", "format": "prettier --write '**/*.{js,css}'", "format-ci": "prettier --list-different '**/*.{js,css}'", diff --git a/server/apiServer.js b/server/apiServer.js new file mode 100644 index 000000000..6488a115d --- /dev/null +++ b/server/apiServer.js @@ -0,0 +1,20 @@ +// NOTE: this server is purely a dev-mode server. In production, the +// server/index.js server also serves the API routes. + +// Configure process.env with .env.* files +require('./env').configureEnv(); + +const express = require('express'); +const cookieParser = require('cookie-parser'); +const apiRouter = require('./apiRouter'); + +const radix = 10; +const PORT = parseInt(process.env.DEV_API_SERVER_PORT, radix); +const app = express(); +app.use(cookieParser()); + +app.use('/api', apiRouter); + +app.listen(PORT, () => { + console.log(`API server listening on ${PORT}`); +}); From b9422efc7dfaecef41cd7ce0c243336b41b3b71a Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Mon, 1 Jun 2020 15:13:07 +0300 Subject: [PATCH 20/21] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36dc5b167..c1f136d1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ way to update this template, but currently, we follow a pattern: [#1291](https://github.com/sharetribe/ftw-daily/pull/1291) - [change] Refactor server API routes into separate files. [#1294](https://github.com/sharetribe/ftw-daily/pull/1294) +- [change] Start the backend API router in dev mode with a dev server. + [#1297](https://github.com/sharetribe/ftw-daily/pull/1297) ## [v4.4.3] 2020-05-13 From 6241104835276bbbd20a0ce6c91ead5658eda9ab Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Mon, 1 Jun 2020 17:19:58 +0300 Subject: [PATCH 21/21] Release v4.5.0 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1f136d1f..dd595e0b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ way to update this template, but currently, we follow a pattern: ## Upcoming version 2020-XX-XX +## [v4.5.0] 2020-06-01 + - [fix] In some situations, ProfileMenu has began to overflow on TopbarDesktop. [#1290](https://github.com/sharetribe/ftw-daily/pull/1290) - [change] Update dependencies (patch updates only) @@ -23,6 +25,8 @@ way to update this template, but currently, we follow a pattern: - [change] Start the backend API router in dev mode with a dev server. [#1297](https://github.com/sharetribe/ftw-daily/pull/1297) +[v4.5.0]: https://github.com/sharetribe/flex-template-web/compare/v4.4.3...v4.5.0 + ## [v4.4.3] 2020-05-13 - [fix] Allow white space on Japanese bank account info. Japan collects bank name and account owner diff --git a/package.json b/package.json index 3bb8205dd..fda31de1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "4.4.3", + "version": "4.5.0", "private": true, "license": "Apache-2.0", "dependencies": {