From 99710169355fd6012fa83d5ab31e6a4767e151c3 Mon Sep 17 00:00:00 2001 From: Brad Garropy Date: Fri, 4 Feb 2022 14:35:35 -0600 Subject: [PATCH] switch to next-google-analytics package. (#275) Co-authored-by: Brad Garropy --- package-lock.json | 23 +++++++++++++-- package.json | 3 +- .../GoogleAnalytics/GoogleAnalytics.test.tsx | 6 ---- .../GoogleAnalytics/GoogleAnalytics.tsx | 28 ------------------- src/components/GoogleAnalytics/index.ts | 1 - src/pages/_app.tsx | 2 +- 6 files changed, 24 insertions(+), 39 deletions(-) delete mode 100644 src/components/GoogleAnalytics/GoogleAnalytics.test.tsx delete mode 100644 src/components/GoogleAnalytics/GoogleAnalytics.tsx delete mode 100644 src/components/GoogleAnalytics/index.ts diff --git a/package-lock.json b/package-lock.json index 7ccf62f3..db96da77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,17 @@ { "name": "bradgarropy.com", - "version": "5.0.3", + "version": "5.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bradgarropy.com", - "version": "5.0.3", + "version": "5.1.0", "license": "MIT", "dependencies": { "@bradgarropy/captivate-sdk": "^0.4.0", "@bradgarropy/http": "^1.1.0", + "@bradgarropy/next-google-analytics": "^1.0.0", "@bradgarropy/next-link": "^1.0.2", "@bradgarropy/next-seo": "^1.2.0", "@fortawesome/fontawesome-svg-core": "^1.2.36", @@ -1885,6 +1886,18 @@ "node": ">=10" } }, + "node_modules/@bradgarropy/next-google-analytics": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bradgarropy/next-google-analytics/-/next-google-analytics-1.0.1.tgz", + "integrity": "sha512-YNdkzXDA7a6MAcYLnx3SxtteZtM+nf2dcpi97rsCEXPH2sWYr0YVtOH8cRNEDYmeAY/TmTUxWsmUz1tHOZeRdg==", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "next": ">=12", + "react": ">=16" + } + }, "node_modules/@bradgarropy/next-link": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@bradgarropy/next-link/-/next-link-1.0.2.tgz", @@ -19309,6 +19322,12 @@ "tslib": "^2.3.0" } }, + "@bradgarropy/next-google-analytics": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bradgarropy/next-google-analytics/-/next-google-analytics-1.0.1.tgz", + "integrity": "sha512-YNdkzXDA7a6MAcYLnx3SxtteZtM+nf2dcpi97rsCEXPH2sWYr0YVtOH8cRNEDYmeAY/TmTUxWsmUz1tHOZeRdg==", + "requires": {} + }, "@bradgarropy/next-link": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@bradgarropy/next-link/-/next-link-1.0.2.tgz", diff --git a/package.json b/package.json index d4dae7e0..e90b7fc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bradgarropy.com", - "version": "5.0.3", + "version": "5.1.0", "description": "🏠 my home on the web", "keywords": [ "javascript", @@ -42,6 +42,7 @@ "dependencies": { "@bradgarropy/captivate-sdk": "^0.4.0", "@bradgarropy/http": "^1.1.0", + "@bradgarropy/next-google-analytics": "^1.0.0", "@bradgarropy/next-link": "^1.0.2", "@bradgarropy/next-seo": "^1.2.0", "@fortawesome/fontawesome-svg-core": "^1.2.36", diff --git a/src/components/GoogleAnalytics/GoogleAnalytics.test.tsx b/src/components/GoogleAnalytics/GoogleAnalytics.test.tsx deleted file mode 100644 index 45d74842..00000000 --- a/src/components/GoogleAnalytics/GoogleAnalytics.test.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import {render} from "@testing-library/react" -import GoogleAnalytics from "components/GoogleAnalytics" - -test("initializes google analytics", () => { - render() -}) diff --git a/src/components/GoogleAnalytics/GoogleAnalytics.tsx b/src/components/GoogleAnalytics/GoogleAnalytics.tsx deleted file mode 100644 index 04d5d914..00000000 --- a/src/components/GoogleAnalytics/GoogleAnalytics.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import Script from "next/script" -import {FC} from "react" - -type GoogleAnalyticsProps = { - measurementId: string -} - -const GoogleAnalytics: FC = ({measurementId}) => { - return ( - <> - - - ) -} - -export default GoogleAnalytics diff --git a/src/components/GoogleAnalytics/index.ts b/src/components/GoogleAnalytics/index.ts deleted file mode 100644 index 5084cdc2..00000000 --- a/src/components/GoogleAnalytics/index.ts +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./GoogleAnalytics" diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 98a3a12f..4ea3bc09 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,6 +1,6 @@ import "styles/global.css" -import GoogleAnalytics from "components/GoogleAnalytics" +import GoogleAnalytics from "@bradgarropy/next-google-analytics" import type {AppProps} from "next/app" const App = ({Component, pageProps}: AppProps) => {