From 0d38c5ea802ed0b38cb994a5bb54386c36c83709 Mon Sep 17 00:00:00 2001 From: Dhenain Ambroise Date: Sat, 5 Sep 2020 14:04:42 +0200 Subject: [PATCH] Add uuid package and related types + change import from "import uuid from 'uuid/v1';" to "import { v1 as uuid } from 'uuid'" to avoid TS issue --- package.json | 2 ++ .../examples/built-in-features/static-i18n.tsx | 2 +- src/pages/_app.tsx | 2 +- src/utils/cookies/UniversalCookiesManager.ts | 2 +- yarn.lock | 10 ++++++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 17bdbd6a4..39551fb51 100644 --- a/package.json +++ b/package.json @@ -111,6 +111,7 @@ "react-i18next": "11.4.0", "reactstrap": "8.4.1", "recompose": "0.30.0", + "uuid": "8.3.0", "webfontloader": "1.6.28", "winston": "3.2.1" }, @@ -142,6 +143,7 @@ "@types/react": "16.9.35", "@types/react-test-renderer": "16.9.3", "@types/reactstrap": "8.4.2", + "@types/uuid": "8.3.0", "@types/webfontloader": "1.6.30", "@types/webpack-env": "1.15.2", "@typescript-eslint/eslint-plugin": "2.33.0", diff --git a/src/pages/[locale]/examples/built-in-features/static-i18n.tsx b/src/pages/[locale]/examples/built-in-features/static-i18n.tsx index 5d625835c..abd9c4172 100644 --- a/src/pages/[locale]/examples/built-in-features/static-i18n.tsx +++ b/src/pages/[locale]/examples/built-in-features/static-i18n.tsx @@ -6,7 +6,7 @@ import { GetStaticPaths, GetStaticProps, NextPage } from 'next'; import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Alert, Container } from 'reactstrap'; -import uuid from 'uuid/v1'; +import { v1 as uuid } from 'uuid'; import BuiltInFeaturesSidebar from '../../../../components/doc/BuiltInFeaturesSidebar'; import DocPage from '../../../../components/doc/DocPage'; import DefaultLayout from '../../../../components/pageLayouts/DefaultLayout'; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 4d8474ecc..64c30e0fb 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -8,7 +8,7 @@ import 'bootstrap/dist/css/bootstrap.min.css'; // Loads bootstrap CSS file. See import 'cookieconsent/build/cookieconsent.min.css'; // Loads CookieConsent CSS file. See https://github.com/osano/cookieconsent import 'rc-tooltip/assets/bootstrap.css'; import React from 'react'; -import uuid from 'uuid/v1'; // XXX Use v1 for uniqueness - See https://www.sohamkamani.com/blog/2016/10/05/uuid1-vs-uuid4/ +import { v1 as uuid } from 'uuid'; // XXX Use v1 for uniqueness - See https://www.sohamkamani.com/blog/2016/10/05/uuid1-vs-uuid4/ import MultiversalAppBootstrap from '../components/appBootstrap/MultiversalAppBootstrap'; import { MultiversalAppBootstrapProps } from '../types/nextjs/MultiversalAppBootstrapProps'; import { NextWebVitalsMetrics } from '../types/nextjs/NextWebVitalsMetrics'; diff --git a/src/utils/cookies/UniversalCookiesManager.ts b/src/utils/cookies/UniversalCookiesManager.ts index 0ed3656d4..d03d67265 100644 --- a/src/utils/cookies/UniversalCookiesManager.ts +++ b/src/utils/cookies/UniversalCookiesManager.ts @@ -4,7 +4,7 @@ import { isBrowser } from '@unly/utils'; import ServerCookies, { GetOption, SetOption } from 'cookies'; import { IncomingMessage, ServerResponse } from 'http'; import BrowserCookies, { CookieAttributes } from 'js-cookie'; -import uuid from 'uuid/v1'; // XXX Use v1 for uniqueness - See https://www.sohamkamani.com/blog/2016/10/05/uuid1-vs-uuid4/ +import { v1 as uuid } from 'uuid'; // XXX Use v1 for uniqueness - See https://www.sohamkamani.com/blog/2016/10/05/uuid1-vs-uuid4/ import { Cookies } from '../../types/Cookies'; import { PatchedUserSemiPersistentSession, UserSemiPersistentSession } from '../../types/UserSemiPersistentSession'; diff --git a/yarn.lock b/yarn.lock index 0b8419d2a..bdff8813e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2239,6 +2239,11 @@ resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.0.tgz#fef1904e4668b6e5ecee60c52cc6a078ffa6697d" integrity sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A== +"@types/uuid@8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.0.tgz#215c231dff736d5ba92410e6d602050cce7e273f" + integrity sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ== + "@types/webfontloader@1.6.30": version "1.6.30" resolved "https://registry.yarnpkg.com/@types/webfontloader/-/webfontloader-1.6.30.tgz#c4fbb1177ef0aa9c8284de237c06fca3291f6c20" @@ -11823,6 +11828,11 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= +uuid@8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea" + integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ== + uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"