-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: exposes types and updates example apps for beforeSend (#154)
- Loading branch information
Showing
20 changed files
with
3,215 additions
and
8,866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"extends": "astro/tsconfigs/base", | ||
"compilerOptions": { | ||
"strictNullChecks": true | ||
"strictNullChecks": true, | ||
"plugins": [{ "name": "@astrojs/ts-plugin" }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { dev } from '$app/environment'; | ||
import { | ||
injectAnalytics, | ||
type BeforeSendEvent, | ||
} from '@vercel/analytics/sveltekit'; | ||
|
||
injectAnalytics({ | ||
mode: dev ? 'development' : 'production', | ||
beforeSend(event: BeforeSendEvent) { | ||
console.log('beforeSend', event); | ||
return event; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
// @ts-expect-error typescript doesn't handle ./index.astro properly, but it's needed to generate types | ||
// eslint-disable-next-line import/no-default-export, no-useless-rename -- Exporting everything doesn't yield the desired outcome | ||
export { default as default } from './index.astro'; | ||
export type { | ||
AnalyticsProps, | ||
BeforeSend, | ||
BeforeSendEvent, | ||
// @ts-expect-error this filed is copied to dist, so it's ok to reference the generated index.d.ts | ||
} from '../index.d.ts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import type { AnalyticsProps, BeforeSend, BeforeSendEvent } from '../types'; | ||
import { createComponent } from '../vue/create-component'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- vue's defineComponent return type is any | ||
export const Analytics = createComponent('nuxt'); | ||
export type { AnalyticsProps, BeforeSend, BeforeSendEvent }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import React from 'react'; | ||
import { Analytics as AnalyticsScript } from '../react'; | ||
import type { AnalyticsProps } from '../types'; | ||
import type { AnalyticsProps, BeforeSend, BeforeSendEvent } from '../types'; | ||
import { useRoute } from './utils'; | ||
|
||
export function Analytics(props: Omit<AnalyticsProps, 'route'>): JSX.Element { | ||
return <AnalyticsScript {...useRoute()} {...props} framework="remix" />; | ||
} | ||
export type { AnalyticsProps, BeforeSend, BeforeSendEvent }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import type { AnalyticsProps, BeforeSend, BeforeSendEvent } from '../types'; | ||
import { createComponent } from './create-component'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- vue's defineComponent return type is any | ||
export const Analytics = createComponent(); | ||
export type { AnalyticsProps, BeforeSend, BeforeSendEvent }; |
Oops, something went wrong.