Skip to content

Commit

Permalink
Merge pull request #1514 from sharetribe/update-libs
Browse files Browse the repository at this point in the history
Update libs
  • Loading branch information
Gnito authored May 18, 2022
2 parents 9477e59 + d5ba34c commit 29520a9
Show file tree
Hide file tree
Showing 7 changed files with 638 additions and 285 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
format:
docker:
- image: circleci/node:12.19
- image: circleci/node:12.20
steps:
- checkout
- restore_cache:
Expand All @@ -25,7 +25,7 @@ jobs:
command: yarn run format-ci
test:
docker:
- image: circleci/node:12.19
- image: circleci/node:12.20
steps:
- checkout
- restore_cache:
Expand All @@ -48,7 +48,7 @@ jobs:
command: yarn run test-ci
build:
docker:
- image: circleci/node:12.19
- image: circleci/node:12.20
steps:
- checkout
- restore_cache:
Expand All @@ -71,7 +71,7 @@ jobs:
command: yarn run build
audit:
docker:
- image: circleci/node:12.19
- image: circleci/node:12.20
steps:
- checkout
- restore_cache:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ way to update this template, but currently, we follow a pattern:

## Upcoming version 2022-XX-XX

- [change] Update some outdated dependencies.
[#1514](https://github.com/sharetribe/ftw-daily/pull/1514)

## [v8.5.0] 2022-05-16

- [add] Add support for hosted translations.
Expand Down
48 changes: 23 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,55 @@
"private": true,
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.16.3",
"@formatjs/intl-relativetimeformat": "^9.3.2",
"@babel/runtime": "^7.17.9",
"@loadable/component": "^5.14.1",
"@loadable/server": "^5.14.2",
"@mapbox/polyline": "^1.1.1",
"@sentry/browser": "^6.15.0",
"@sentry/node": "^6.15.0",
"array-includes": "^3.1.4",
"array.prototype.find": "^2.1.2",
"@sentry/browser": "^6.19.7",
"@sentry/node": "^6.19.7",
"array-includes": "^3.1.5",
"array.prototype.find": "^2.2.0",
"autosize": "^5.0.1",
"basic-auth": "^2.0.1",
"body-parser": "^1.18.3",
"body-parser": "^1.20.0",
"classnames": "^2.3.1",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
"core-js": "^3.19.2",
"core-js": "^3.22.5",
"cors": "^2.8.5",
"decimal.js": "^10.3.1",
"dotenv": "8.2.0",
"dotenv-expand": "5.1.0",
"express": "^4.16.4",
"express": "^4.18.1",
"express-enforces-ssl": "^1.1.0",
"express-sitemap": "^1.8.0",
"final-form": "^4.20.4",
"final-form": "^4.20.7",
"final-form-arrays": "^3.0.2",
"full-icu": "^1.4.0",
"helmet": "^4.6.0",
"intl-pluralrules": "^1.3.1",
"jose": "3.11.4",
"jose": "4.8.1",
"lodash": "^4.17.21",
"mapbox-gl-multitouch": "^1.0.3",
"moment": "^2.29.2",
"moment": "^2.29.3",
"object.entries": "^1.1.5",
"object.values": "^1.1.5",
"passport": "^0.5.0",
"passport": "^0.5.3",
"passport-facebook": "^3.0.0",
"passport-google-oauth": "^2.0.0",
"path-to-regexp": "^6.2.0",
"prop-types": "^15.7.2",
"query-string": "^7.0.1",
"path-to-regexp": "^6.2.1",
"prop-types": "^15.8.1",
"query-string": "^7.1.1",
"raf": "^3.4.0",
"react": "^16.13.1",
"react-dates": "^21.8.0",
"react-dom": "^16.13.1",
"react-final-form": "^6.5.7",
"react-final-form": "^6.5.9",
"react-final-form-arrays": "^3.1.3",
"react-helmet-async": "^1.1.2",
"react-intl": "^5.22.0",
"react-helmet-async": "^1.3.0",
"react-intl": "^5.25.1",
"react-moment-proptypes": "^1.8.1",
"react-redux": "^7.2.6",
"react-router-dom": "^5.2.0",
"react-redux": "^7.2.8",
"react-router-dom": "^5.3.2",
"react-with-direction": "^1.4.0",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
Expand All @@ -68,12 +66,12 @@
"devDependencies": {
"bfj": "^7.0.2",
"chalk": "^v4.1.2",
"concurrently": "^6.4.0",
"concurrently": "^7.2.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-to-json": "^3.6.2",
"inquirer": "^8.2.0",
"nodemon": "^2.0.15",
"inquirer": "^8.2.4",
"nodemon": "^2.0.16",
"prettier": "^1.18.2"
},
"resolutions": {
Expand Down
7 changes: 3 additions & 4 deletions server/api-util/idToken.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const crypto = require('crypto');
const { default: fromKeyLike } = require('jose/jwk/from_key_like');
const { default: SignJWT } = require('jose/jwt/sign');
const jose = require('jose');

const radix = 10;
const PORT = parseInt(process.env.REACT_APP_DEV_API_SERVER_PORT, radix);
Expand Down Expand Up @@ -50,7 +49,7 @@ exports.createIdToken = (idpClientId, user, options) => {

const { userId, firstName, lastName, email, emailVerified } = user;

const jwt = new SignJWT({
const jwt = new jose.SignJWT({
given_name: firstName,
family_name: lastName,
email: email,
Expand Down Expand Up @@ -89,7 +88,7 @@ exports.openIdConfiguration = (req, res) => {
*/
exports.jwksUri = keys => (req, res) => {
const jwkKeys = keys.map(key => {
return fromKeyLike(crypto.createPublicKey(key.rsaPublicKey)).then(res => {
return jose.exportJWK(crypto.createPublicKey(key.rsaPublicKey)).then(res => {
return { alg: key.alg, kid: key.keyId, ...res };
});
});
Expand Down
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import defaultMessages from './translations/en.json';
// 1) Change the language in the config.js file!
// 2) Import correct locale rules for Moment library
// 3) Use the `messagesInLocale` import to add the correct translation file.
// 4) To support older browsers we need add the correct locale for intl-relativetimeformat to `util/polyfills.js`
// 4) (optionally) To support older browsers you need add the intl-relativetimeformat npm packages
// and take it into use in `util/polyfills.js`

// Note that there is also translations in './translations/countryCodes.js' file
// This file contains ISO 3166-1 alpha-2 country codes, country names and their translations in our default languages
Expand Down
33 changes: 19 additions & 14 deletions src/util/polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,23 @@ if (typeof Number.isNaN === 'undefined') {
Number.isNaN = value => value !== value;
}

// To support browsers that do not have Intl.PluralRules (e.g IE11 & Safari 12-), include this polyfill in your build.

if (!Intl.PluralRules) {
require('intl-pluralrules');
}

// To support browsers that do not have Intl.RelativeTimeFormat (e.g IE11, Edge, Safari 12-), include this polyfill in your build along with individual CLDR data for each locale you support.
if (!Intl.RelativeTimeFormat) {
require('@formatjs/intl-relativetimeformat/polyfill');
require('@formatjs/intl-relativetimeformat/locale-data/en');
// To support browsers that do not have Intl.PluralRules (e.g IE11 & Safari 12-),
// - add npm packaged to package.json: "intl-pluralrules": "^1.3.1",
// - include this polyfill in your build:
//
// if (!Intl.PluralRules) {
// require('intl-pluralrules');
// }

// By default, this library comes with en data. To load additional locale, you need include them on demand.
// e.g.
// require('@formatjs/intl-relativetimeformat/dist/locale-data/fr');
}
// To support browsers that do not have Intl.RelativeTimeFormat (e.g IE11, Edge, Safari 12-),
// - add npm packaged to package.json: "@formatjs/intl-relativetimeformat": "^9.3.2",
// - include this polyfill in your build along with individual CLDR data for each locale you support:
//
// if (!Intl.RelativeTimeFormat) {
// require('@formatjs/intl-relativetimeformat/polyfill');
// require('@formatjs/intl-relativetimeformat/locale-data/en');

// // By default, this library comes with en data. To load additional locale, you need include them on demand.
// // e.g.
// // require('@formatjs/intl-relativetimeformat/dist/locale-data/fr');
// }
Loading

0 comments on commit 29520a9

Please sign in to comment.