From 759a604cb856e434d8b571982e18ea7e48197286 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Thu, 14 Sep 2023 16:38:41 +0530 Subject: [PATCH] fix: posthog integration (#2186) --- turbo.json | 2 ++ web/package.json | 2 +- web/pages/_app.tsx | 61 +++++++++++------------------------------ web/pages/_document.tsx | 50 +++++++++++++++++++++++---------- yarn.lock | 9 +++++- 5 files changed, 63 insertions(+), 61 deletions(-) diff --git a/turbo.json b/turbo.json index 7c02fdd7f..59bbe741f 100644 --- a/turbo.json +++ b/turbo.json @@ -21,6 +21,8 @@ "NEXT_PUBLIC_SESSION_RECORDER_KEY", "NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS", "NEXT_PUBLIC_DEPLOY_WITH_NGINX", + "NEXT_PUBLIC_POSTHOG_KEY", + "NEXT_PUBLIC_POSTHOG_HOST", "SLACK_OAUTH_URL", "SLACK_CLIENT_ID", "SLACK_CLIENT_SECRET", diff --git a/web/package.json b/web/package.json index 080a99bb8..3da1e3089 100644 --- a/web/package.json +++ b/web/package.json @@ -97,8 +97,8 @@ "eslint-config-custom": "*", "eslint-config-next": "12.2.2", "prettier": "^2.8.7", - "tsconfig": "*", "tailwind-config-custom": "*", + "tsconfig": "*", "typescript": "4.7.4" }, "resolutions": { diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx index 5ef047ca9..b94e52d6b 100644 --- a/web/pages/_app.tsx +++ b/web/pages/_app.tsx @@ -1,38 +1,22 @@ -// next imports import Head from "next/head"; import dynamic from "next/dynamic"; import Router from "next/router"; - -// themes import { ThemeProvider } from "next-themes"; - +import NProgress from "nprogress"; // styles import "styles/globals.css"; import "styles/editor.css"; import "styles/command-pallette.css"; import "styles/nprogress.css"; import "styles/react-datepicker.css"; - -// nprogress -import NProgress from "nprogress"; - // contexts -import { UserProvider } from "contexts/user.context"; import { ToastContextProvider } from "contexts/toast.context"; -import { ThemeContextProvider } from "contexts/theme.context"; // types import type { AppProps } from "next/app"; // constants import { THEMES } from "constants/themes"; // constants -import { - SITE_NAME, - SITE_DESCRIPTION, - SITE_URL, - TWITTER_USER_NAME, - SITE_KEYWORDS, - SITE_TITLE, -} from "constants/seo-variables"; +import { SITE_TITLE } from "constants/seo-variables"; // mobx store provider import { MobxStoreProvider } from "lib/mobx/store-provider"; import MobxStoreInit from "lib/mobx/store-init"; @@ -47,33 +31,20 @@ Router.events.on("routeChangeComplete", NProgress.done); function MyApp({ Component, pageProps }: AppProps) { return ( - // - // mobx root provider - - - - - - {SITE_TITLE} - - - - - - - - - - - - - - - - - - - // + <> + + {SITE_TITLE} + + + + + + + + + + + ); } diff --git a/web/pages/_document.tsx b/web/pages/_document.tsx index 5c5ca0250..7bb7480c0 100644 --- a/web/pages/_document.tsx +++ b/web/pages/_document.tsx @@ -1,4 +1,14 @@ import Document, { Html, Head, Main, NextScript } from "next/document"; +// constants +import { + SITE_NAME, + SITE_DESCRIPTION, + SITE_URL, + TWITTER_USER_NAME, + SITE_KEYWORDS, + SITE_TITLE, +} from "constants/seo-variables"; +import Script from "next/script"; class MyDocument extends Document { render() { @@ -9,9 +19,23 @@ class MyDocument extends Document { return ( - - + + + + + + + + + + + + + + +
+ {process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN && ( + )} + {process.env.NEXT_PUBLIC_POSTHOG_KEY && process.env.NEXT_PUBLIC_POSTHOG_HOST && ( + )} - - -
- ); diff --git a/yarn.lock b/yarn.lock index 1fe5a7009..a11b861ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6635,7 +6635,14 @@ prosemirror-menu@^1.2.1: prosemirror-history "^1.0.0" prosemirror-state "^1.0.0" -prosemirror-model@^1.0.0, prosemirror-model@^1.16.0, prosemirror-model@^1.18.1, prosemirror-model@^1.19.0, prosemirror-model@^1.8.1: +prosemirror-model@^1.0.0, prosemirror-model@^1.16.0, prosemirror-model@^1.18.1, prosemirror-model@^1.8.1: + version "1.18.1" + resolved "https://registry.yarnpkg.com/prosemirror-model/-/prosemirror-model-1.18.1.tgz#1d5d6b6de7b983ee67a479dc607165fdef3935bd" + integrity sha512-IxSVBKAEMjD7s3n8cgtwMlxAXZrC7Mlag7zYsAKDndAqnDScvSmp/UdnRTV/B33lTCVU3CCm7dyAn/rVVD0mcw== + dependencies: + orderedmap "^2.0.0" + +prosemirror-model@^1.19.0: version "1.19.3" resolved "https://registry.yarnpkg.com/prosemirror-model/-/prosemirror-model-1.19.3.tgz#f0d55285487fefd962d0ac695f716f4ec6705006" integrity sha512-tgSnwN7BS7/UM0sSARcW+IQryx2vODKX4MI7xpqY2X+iaepJdKBPc7I4aACIsDV/LTaTjt12Z56MhDr9LsyuZQ==