Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

updated packages; replaced classnames in favour of clsx

Blue Mouse5dcc162d7f90
diff --git a/package.json b/package.json
index 84a6b9b13..a247821f9 100644
--- a/package.json
+++ b/package.json
@@ -1,38 +1,35 @@
{
- "name": "analytics_pwa",
+ "name": "swetrix-fe",
"version": "0.1.0",
"private": true,
"dependencies": {
"@craco/craco": "^6.4.3",
- "@headlessui/react": "^1.4.2",
+ "@headlessui/react": "^1.4.3",
"@heroicons/react": "^1.0.5",
"@sentry/react": "^6.16.1",
"@sentry/tracing": "^6.16.1",
- "@tailwindcss/forms": "^0.3.4",
- "@testing-library/jest-dom": "^5.16.1",
- "@testing-library/react": "^12.1.2",
- "@testing-library/user-event": "^13.5.0",
- "axios": "^0.22.0",
- "billboard.js": "^3.2.2",
- "classnames": "^2.3.1",
- "d3": "^7.2.1",
+ "@tailwindcss/forms": "^0.4.0",
+ "axios": "^0.25.0",
+ "billboard.js": "^3.3.0",
+ "clsx": "^1.1.1",
+ "d3": "^7.3.0",
"dayjs": "^1.10.7",
"debug": "^4.3.3",
"dom-to-image": "^2.6.0",
"file-saver": "^2.0.5",
- "i18n-iso-countries": "^6.8.0",
- "i18next": "^21.6.4",
+ "i18n-iso-countries": "^7.2.0",
+ "i18next": "^21.6.6",
"i18next-browser-languagedetector": "^6.1.2",
"lodash": "^4.17.21",
- "nanoid": "^3.1.30",
- "prismjs": "^1.25.0",
- "prop-types": "^15.8.0",
+ "nanoid": "^3.2.0",
+ "prismjs": "^1.26.0",
+ "prop-types": "^15.8.1",
"react": "^17.0.2",
"react-alert": "^7.0.3",
"react-dom": "^17.0.2",
"react-flagkit": "^2.0.4",
"react-helmet": "^6.1.0",
- "react-i18next": "^11.15.2",
+ "react-i18next": "^11.15.3",
"react-redux": "^7.2.6",
"react-router-dom": "^5.3.0",
"react-router-hash-link": "^2.4.3",
@@ -46,7 +43,8 @@
"start": "craco start",
"build": "craco build",
"test": "craco test",
- "eject": "react-scripts eject"
+ "eject": "react-scripts eject",
+ "analyse": "source-map-explorer 'build/static/js/*.js'"
},
"eslintConfig": {
"extends": [
@@ -71,6 +69,10 @@
"autoprefixer": "^9.8.8",
"cross-env": "^7.0.3",
"postcss": "^7.0.39",
+ "source-map-explorer": "^2.5.2",
+ "@testing-library/jest-dom": "^5.16.1",
+ "@testing-library/react": "^12.1.2",
+ "@testing-library/user-event": "^13.5.0",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.17"
}
}
diff --git a/src/App.js b/src/App.js
index 57dcbc572..4b152e46a 100644
--- a/src/App.js
+++ b/src/App.js
@@ -3,7 +3,7 @@ import { Switch, Route, Redirect, useLocation } from 'react-router-dom'
import routes from 'routes'
import { useDispatch, useSelector } from 'react-redux'
import { useAlert } from 'react-alert'
-import cx from 'classnames'
+import cx from 'clsx'
import _some from 'lodash/some'
import _includes from 'lodash/includes'
import 'dayjs/locale/ru'
diff --git a/src/pages/Dashboard/Dashboard.jsx b/src/pages/Dashboard/Dashboard.jsx
index 63879e0f2..7c3bb0ce6 100644
--- a/src/pages/Dashboard/Dashboard.jsx
+++ b/src/pages/Dashboard/Dashboard.jsx
@@ -1,6 +1,6 @@
import React, { memo, useState } from 'react'
import { Link, useHistory } from 'react-router-dom'
-import cx from 'classnames'
+import cx from 'clsx'
import dayjs from 'dayjs'
import PropTypes from 'prop-types'
import _isEmpty from 'lodash/isEmpty'
diff --git a/src/pages/MainPage/Pricing.jsx b/src/pages/MainPage/Pricing.jsx
index 9007530c7..83afb46f6 100644
--- a/src/pages/MainPage/Pricing.jsx
+++ b/src/pages/MainPage/Pricing.jsx
@@ -7,7 +7,7 @@ import _isNil from 'lodash/isNil'
import _isString from 'lodash/isString'
import _isEmpty from 'lodash/isEmpty'
import _findIndex from 'lodash/findIndex'
-import cx from 'classnames'
+import cx from 'clsx'
import Spin from '../../ui/icons/Spin'
import { errorsActions } from 'redux/actions/errors'
diff --git a/src/pages/Project/View/Panels.jsx b/src/pages/Project/View/Panels.jsx
index dbc5a20d4..f5a764c95 100644
--- a/src/pages/Project/View/Panels.jsx
+++ b/src/pages/Project/View/Panels.jsx
@@ -1,7 +1,7 @@
import React, { memo, useState, useMemo, Fragment } from 'react'
import { ArrowSmUpIcon } from '@heroicons/react/solid'
import { ArrowSmDownIcon } from '@heroicons/react/solid'
-import cx from 'classnames'
+import cx from 'clsx'
import PropTypes from 'prop-types'
import _keys from 'lodash/keys'
import _map from 'lodash/map'
diff --git a/src/pages/Project/View/ViewProject.jsx b/src/pages/Project/View/ViewProject.jsx
index 1d3188121..5f61ac48a 100644
--- a/src/pages/Project/View/ViewProject.jsx
+++ b/src/pages/Project/View/ViewProject.jsx
@@ -11,7 +11,7 @@ import countriesHi from 'i18n-iso-countries/langs/hi.json'
import countriesUk from 'i18n-iso-countries/langs/uk.json'
import countriesZh from 'i18n-iso-countries/langs/zh.json'
import countriesRu from 'i18n-iso-countries/langs/ru.json'
-import cx from 'classnames'
+import cx from 'clsx'
import * as d3 from 'd3'
import dayjs from 'dayjs'
import { useTranslation, Trans } from 'react-i18next'
diff --git a/src/ui/Alert.jsx b/src/ui/Alert.jsx
index 22a98aa09..b71c9599b 100644
--- a/src/ui/Alert.jsx
+++ b/src/ui/Alert.jsx
@@ -1,6 +1,6 @@
// Custom Alert template for react-alert
import React, { memo } from 'react'
-import cx from 'classnames'
+import cx from 'clsx'
import PropTypes from 'prop-types'
import { CheckCircleIcon } from '@heroicons/react/solid'
import { InformationCircleIcon } from '@heroicons/react/solid'
diff --git a/src/ui/Button.jsx b/src/ui/Button.jsx
index 566e3b85c..d29606dfd 100644
--- a/src/ui/Button.jsx
+++ b/src/ui/Button.jsx
@@ -1,5 +1,5 @@
import React, { memo } from 'react'
-import cx from 'classnames'
+import cx from 'clsx'
import PropTypes from 'prop-types'
import Spin from './icons/Spin'
diff --git a/src/ui/Checkbox.jsx b/src/ui/Checkbox.jsx
index b666959fc..438c09151 100644
--- a/src/ui/Checkbox.jsx
+++ b/src/ui/Checkbox.jsx
@@ -1,5 +1,5 @@
import React, { memo } from 'react'
-import cx from 'classnames'
+import cx from 'clsx'
import PropTypes from 'prop-types'
const Checkbox = ({
diff --git a/src/ui/Code.jsx b/src/ui/Code.jsx
index 5541447ea..0936355d6 100644
--- a/src/ui/Code.jsx
+++ b/src/ui/Code.jsx
@@ -1,6 +1,6 @@
import React, { memo } from 'react'
import PropTypes from 'prop-types'
-import cx from 'classnames'
+import cx from 'clsx'
const Code = ({ text, className, language }) => (
<pre className={cx('w-full rounded-md bg-gray-800 dark:bg-gray-750', className)}>
diff --git a/src/ui/Dropdown.jsx b/src/ui/Dropdown.jsx
index 5e51bcc10..29a6b074f 100644
--- a/src/ui/Dropdown.jsx
+++ b/src/ui/Dropdown.jsx
@@ -1,7 +1,7 @@
import React, { memo, Fragment } from 'react'
import { Menu, Transition } from '@headlessui/react'
import { ChevronDownIcon } from '@heroicons/react/solid'
-import cx from 'classnames'
+import cx from 'clsx'
import _map from 'lodash/map'
import _isEmpty from 'lodash/isEmpty'
import PropTypes from 'prop-types'
diff --git a/src/ui/Input.jsx b/src/ui/Input.jsx
index 2f03b376d..e039c9640 100644
--- a/src/ui/Input.jsx
+++ b/src/ui/Input.jsx
@@ -1,5 +1,5 @@
import React, { memo } from 'react'
-import cx from 'classnames'
+import cx from 'clsx'
import _isEmpty from 'lodash/isEmpty'
import PropTypes from 'prop-types'
import { ExclamationCircleIcon } from '@heroicons/react/solid'
diff --git a/src/ui/Modal.jsx b/src/ui/Modal.jsx
index 0a43a06f5..af7bf2a91 100644
--- a/src/ui/Modal.jsx
+++ b/src/ui/Modal.jsx
@@ -1,6 +1,6 @@
import React, { Fragment, memo } from 'react'
import PropTypes from 'prop-types'
-import cx from 'classnames'
+import cx from 'clsx'
import { Dialog, Transition } from '@headlessui/react'
import { CheckIcon } from '@heroicons/react/outline'
import { ExclamationIcon } from '@heroicons/react/outline'
diff --git a/src/ui/Pin.jsx b/src/ui/Pin.jsx
index 131ee9469..9e31139b4 100644
--- a/src/ui/Pin.jsx
+++ b/src/ui/Pin.jsx
@@ -1,5 +1,5 @@
import React from 'react'
-import cx from 'classnames'
+import cx from 'clsx'
import PropTypes from 'prop-types'
const propTypes = {
diff --git a/src/ui/Select.jsx b/src/ui/Select.jsx
index 788e7adfc..2812bc37b 100644
--- a/src/ui/Select.jsx
+++ b/src/ui/Select.jsx
@@ -1,5 +1,5 @@
import { Fragment, memo } from 'react'
-import cx from 'classnames'
+import cx from 'clsx'
import PropTypes from 'prop-types'
import { Listbox, Transition } from '@headlessui/react'
import { CheckIcon, SelectorIcon } from '@heroicons/react/solid'
diff --git a/src/ui/icons/PulsatingCircle.jsx b/src/ui/icons/PulsatingCircle.jsx
index 040e2e65b..b7a2c8498 100644
--- a/src/ui/icons/PulsatingCircle.jsx
+++ b/src/ui/icons/PulsatingCircle.jsx
@@ -1,5 +1,5 @@
import React from 'react'
-import cx from 'classnames'
+import cx from 'clsx'
import PropTypes from 'prop-types'
const types = {
diff --git a/src/ui/icons/Spin.jsx b/src/ui/icons/Spin.jsx
index ed72bea17..eed71168d 100644
--- a/src/ui/icons/Spin.jsx
+++ b/src/ui/icons/Spin.jsx
@@ -1,5 +1,5 @@
import React from 'react'
-import cx from 'classnames'
+import cx from 'clsx'
import PropTypes from 'prop-types'
const Spin = ({ className }) => (