forked from github/plane
fix: posthog integration (#2186)
This commit is contained in:
parent
6659cfc8b0
commit
759a604cb8
@ -21,6 +21,8 @@
|
|||||||
"NEXT_PUBLIC_SESSION_RECORDER_KEY",
|
"NEXT_PUBLIC_SESSION_RECORDER_KEY",
|
||||||
"NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS",
|
"NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS",
|
||||||
"NEXT_PUBLIC_DEPLOY_WITH_NGINX",
|
"NEXT_PUBLIC_DEPLOY_WITH_NGINX",
|
||||||
|
"NEXT_PUBLIC_POSTHOG_KEY",
|
||||||
|
"NEXT_PUBLIC_POSTHOG_HOST",
|
||||||
"SLACK_OAUTH_URL",
|
"SLACK_OAUTH_URL",
|
||||||
"SLACK_CLIENT_ID",
|
"SLACK_CLIENT_ID",
|
||||||
"SLACK_CLIENT_SECRET",
|
"SLACK_CLIENT_SECRET",
|
||||||
|
@ -97,8 +97,8 @@
|
|||||||
"eslint-config-custom": "*",
|
"eslint-config-custom": "*",
|
||||||
"eslint-config-next": "12.2.2",
|
"eslint-config-next": "12.2.2",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"tsconfig": "*",
|
|
||||||
"tailwind-config-custom": "*",
|
"tailwind-config-custom": "*",
|
||||||
|
"tsconfig": "*",
|
||||||
"typescript": "4.7.4"
|
"typescript": "4.7.4"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
@ -1,38 +1,22 @@
|
|||||||
// next imports
|
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
import Router from "next/router";
|
import Router from "next/router";
|
||||||
|
|
||||||
// themes
|
|
||||||
import { ThemeProvider } from "next-themes";
|
import { ThemeProvider } from "next-themes";
|
||||||
|
import NProgress from "nprogress";
|
||||||
// styles
|
// styles
|
||||||
import "styles/globals.css";
|
import "styles/globals.css";
|
||||||
import "styles/editor.css";
|
import "styles/editor.css";
|
||||||
import "styles/command-pallette.css";
|
import "styles/command-pallette.css";
|
||||||
import "styles/nprogress.css";
|
import "styles/nprogress.css";
|
||||||
import "styles/react-datepicker.css";
|
import "styles/react-datepicker.css";
|
||||||
|
|
||||||
// nprogress
|
|
||||||
import NProgress from "nprogress";
|
|
||||||
|
|
||||||
// contexts
|
// contexts
|
||||||
import { UserProvider } from "contexts/user.context";
|
|
||||||
import { ToastContextProvider } from "contexts/toast.context";
|
import { ToastContextProvider } from "contexts/toast.context";
|
||||||
import { ThemeContextProvider } from "contexts/theme.context";
|
|
||||||
// types
|
// types
|
||||||
import type { AppProps } from "next/app";
|
import type { AppProps } from "next/app";
|
||||||
// constants
|
// constants
|
||||||
import { THEMES } from "constants/themes";
|
import { THEMES } from "constants/themes";
|
||||||
// constants
|
// constants
|
||||||
import {
|
import { SITE_TITLE } from "constants/seo-variables";
|
||||||
SITE_NAME,
|
|
||||||
SITE_DESCRIPTION,
|
|
||||||
SITE_URL,
|
|
||||||
TWITTER_USER_NAME,
|
|
||||||
SITE_KEYWORDS,
|
|
||||||
SITE_TITLE,
|
|
||||||
} from "constants/seo-variables";
|
|
||||||
// mobx store provider
|
// mobx store provider
|
||||||
import { MobxStoreProvider } from "lib/mobx/store-provider";
|
import { MobxStoreProvider } from "lib/mobx/store-provider";
|
||||||
import MobxStoreInit from "lib/mobx/store-init";
|
import MobxStoreInit from "lib/mobx/store-init";
|
||||||
@ -47,33 +31,20 @@ Router.events.on("routeChangeComplete", NProgress.done);
|
|||||||
|
|
||||||
function MyApp({ Component, pageProps }: AppProps) {
|
function MyApp({ Component, pageProps }: AppProps) {
|
||||||
return (
|
return (
|
||||||
// <UserProvider>
|
<>
|
||||||
// mobx root provider
|
<Head>
|
||||||
<MobxStoreProvider {...pageProps}>
|
<title>{SITE_TITLE}</title>
|
||||||
<ThemeProvider themes={THEMES} defaultTheme="system">
|
</Head>
|
||||||
<ToastContextProvider>
|
<MobxStoreProvider {...pageProps}>
|
||||||
<CrispWithNoSSR />
|
<ThemeProvider themes={THEMES} defaultTheme="system">
|
||||||
<Head>
|
<ToastContextProvider>
|
||||||
<title>{SITE_TITLE}</title>
|
<CrispWithNoSSR />
|
||||||
<meta property="og:site_name" content={SITE_NAME} />
|
<MobxStoreInit />
|
||||||
<meta property="og:title" content={SITE_TITLE} />
|
<Component {...pageProps} />
|
||||||
<meta property="og:url" content={SITE_URL} />
|
</ToastContextProvider>
|
||||||
<meta name="description" content={SITE_DESCRIPTION} />
|
</ThemeProvider>
|
||||||
<meta property="og:description" content={SITE_DESCRIPTION} />
|
</MobxStoreProvider>
|
||||||
<meta name="keywords" content={SITE_KEYWORDS} />
|
</>
|
||||||
<meta name="twitter:site" content={`@${TWITTER_USER_NAME}`} />
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" />
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png" />
|
|
||||||
<link rel="manifest" href="/site.webmanifest.json" />
|
|
||||||
<link rel="shortcut icon" href="/favicon/favicon.ico" />
|
|
||||||
</Head>
|
|
||||||
<MobxStoreInit />
|
|
||||||
<Component {...pageProps} />
|
|
||||||
</ToastContextProvider>
|
|
||||||
</ThemeProvider>
|
|
||||||
</MobxStoreProvider>
|
|
||||||
// </UserProvider>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
import Document, { Html, Head, Main, NextScript } from "next/document";
|
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 {
|
class MyDocument extends Document {
|
||||||
render() {
|
render() {
|
||||||
@ -9,9 +19,23 @@ class MyDocument extends Document {
|
|||||||
return (
|
return (
|
||||||
<Html>
|
<Html>
|
||||||
<Head>
|
<Head>
|
||||||
<link rel="manifest" href="/manifest.json" />
|
<meta property="og:site_name" content={SITE_NAME} />
|
||||||
<link rel="apple-touch-icon" href="/icon.png" />
|
<meta property="og:title" content={SITE_TITLE} />
|
||||||
|
<meta property="og:url" content={SITE_URL} />
|
||||||
|
<meta name="description" content={SITE_DESCRIPTION} />
|
||||||
|
<meta property="og:description" content={SITE_DESCRIPTION} />
|
||||||
|
<meta name="keywords" content={SITE_KEYWORDS} />
|
||||||
|
<meta name="twitter:site" content={`@${TWITTER_USER_NAME}`} />
|
||||||
<meta name="theme-color" content="#fff" />
|
<meta name="theme-color" content="#fff" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" />
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png" />
|
||||||
|
<link rel="manifest" href="/site.webmanifest.json" />
|
||||||
|
<link rel="shortcut icon" href="/favicon/favicon.ico" />
|
||||||
|
</Head>
|
||||||
|
<body>
|
||||||
|
<Main />
|
||||||
|
<NextScript />
|
||||||
{process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN && (
|
{process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN && (
|
||||||
<script
|
<script
|
||||||
defer
|
defer
|
||||||
@ -19,23 +43,21 @@ class MyDocument extends Document {
|
|||||||
src="https://plausible.io/js/script.js"
|
src="https://plausible.io/js/script.js"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" />
|
|
||||||
{isSessionRecorderEnabled && process.env.NEXT_PUBLIC_SESSION_RECORDER_KEY && (
|
{isSessionRecorderEnabled && process.env.NEXT_PUBLIC_SESSION_RECORDER_KEY && (
|
||||||
<script
|
<Script id="clarity-tracking">
|
||||||
defer
|
{`(function(c,l,a,r,i,t,y){
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: `(function(c,l,a,r,i,t,y){
|
|
||||||
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
||||||
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
||||||
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
||||||
})(window, document, "clarity", "script", "${process.env.NEXT_PUBLIC_SESSION_RECORDER_KEY}");`,
|
})(window, document, "clarity", "script", "${process.env.NEXT_PUBLIC_SESSION_RECORDER_KEY}");`}
|
||||||
}}
|
</Script>
|
||||||
/>
|
)}
|
||||||
|
{process.env.NEXT_PUBLIC_POSTHOG_KEY && process.env.NEXT_PUBLIC_POSTHOG_HOST && (
|
||||||
|
<Script id="posthog-tracking">
|
||||||
|
{`!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
|
||||||
|
posthog.init('${process.env.NEXT_PUBLIC_POSTHOG_KEY}',{api_host:'${process.env.NEXT_PUBLIC_POSTHOG_HOST}'})`}
|
||||||
|
</Script>
|
||||||
)}
|
)}
|
||||||
</Head>
|
|
||||||
<body>
|
|
||||||
<Main />
|
|
||||||
<NextScript />
|
|
||||||
</body>
|
</body>
|
||||||
</Html>
|
</Html>
|
||||||
);
|
);
|
||||||
|
@ -6635,7 +6635,14 @@ prosemirror-menu@^1.2.1:
|
|||||||
prosemirror-history "^1.0.0"
|
prosemirror-history "^1.0.0"
|
||||||
prosemirror-state "^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"
|
version "1.19.3"
|
||||||
resolved "https://registry.yarnpkg.com/prosemirror-model/-/prosemirror-model-1.19.3.tgz#f0d55285487fefd962d0ac695f716f4ec6705006"
|
resolved "https://registry.yarnpkg.com/prosemirror-model/-/prosemirror-model-1.19.3.tgz#f0d55285487fefd962d0ac695f716f4ec6705006"
|
||||||
integrity sha512-tgSnwN7BS7/UM0sSARcW+IQryx2vODKX4MI7xpqY2X+iaepJdKBPc7I4aACIsDV/LTaTjt12Z56MhDr9LsyuZQ==
|
integrity sha512-tgSnwN7BS7/UM0sSARcW+IQryx2vODKX4MI7xpqY2X+iaepJdKBPc7I4aACIsDV/LTaTjt12Z56MhDr9LsyuZQ==
|
||||||
|
Loading…
Reference in New Issue
Block a user