OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
web: fix typecheck
Carl-Gerhard Lindesvärdd8c587ef9040
diff --git a/apps/web/package.json b/apps/web/package.jsonindex d928b143e..8d8fb493b 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -8,11 +8,12 @@"dev": "next dev","postinstall": "prisma generate","lint": "next lint",+ "typecheck": "tsc --noEmit","start": "next start"},"dependencies": {"@hookform/resolvers": "^3.3.2",- "@mixan/types": "^0.0.2-alpha",+ "@mixan/types": "workspace:*","@next-auth/prisma-adapter": "^1.0.7","@prisma/client": "^5.1.1","@radix-ui/react-alert-dialog": "^1.0.5",diff --git a/apps/web/src/components/ui/button.tsx b/apps/web/src/components/ui/button.tsxindex 39932cc09..ad9de739d 100644--- a/apps/web/src/components/ui/button.tsx+++ b/apps/web/src/components/ui/button.tsx@@ -1,8 +1,8 @@-import * as React from "react"-import { Slot } from "@radix-ui/react-slot"-import { cva, type VariantProps } from "class-variance-authority"+import * as React from "react";+import { Slot } from "@radix-ui/react-slot";+import { cva, type VariantProps } from "class-variance-authority";-import { cn } from "@/utils/cn"+import { cn } from "@/utils/cn";const buttonVariants = cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",@@ -30,30 +30,31 @@ const buttonVariants = cva(variant: "default",size: "default",},- }-)+ },+);-export interface ButtonProps+interface ButtonPropsextends React.ButtonHTMLAttributes<HTMLButtonElement>,VariantProps<typeof buttonVariants> {- asChild?: boolean+ asChild?: boolean;}const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(({ className, variant, size, asChild = false, ...props }, ref) => {- const Comp = asChild ? Slot : "button"+ const Comp = asChild ? Slot : "button";return (+ // @ts-expect-error<CompclassName={cn(buttonVariants({ variant, size, className }))}ref={ref}{...props}/>- )- }-)-Button.displayName = "Button"+ );+ },+);+Button.displayName = "Button";Button.defaultProps = {- type: 'button'-}+ type: "button",+};-export { Button, buttonVariants }+export { Button, buttonVariants };diff --git a/apps/web/src/pages/index.tsx b/apps/web/src/pages/index.tsxindex 275eb8d2f..ce489d110 100644--- a/apps/web/src/pages/index.tsx+++ b/apps/web/src/pages/index.tsx@@ -8,7 +8,7 @@ export const getServerSideProps = createServerSideProps()export default function Home() {const router = useRouter()- const query = api.organization.current.useQuery();+ const query = api.organization.first.useQuery();const organization = query.data ?? null;useEffect(() => {diff --git a/apps/web/src/server/auth.ts b/apps/web/src/server/auth.tsindex 3324d23e3..3d79b981c 100644--- a/apps/web/src/server/auth.ts+++ b/apps/web/src/server/auth.ts@@ -20,8 +20,6 @@ declare module "next-auth" {interface Session extends DefaultSession {user: DefaultSession["user"] & {id: string;- // ...other properties- // role: UserRole;};}diff --git a/apps/web/src/utils/theme.ts b/apps/web/src/utils/theme.tsindex 83907e18d..348f7e733 100644--- a/apps/web/src/utils/theme.ts+++ b/apps/web/src/utils/theme.ts@@ -1,5 +1,6 @@import resolveConfig from "tailwindcss/resolveConfig";import tailwinConfig from "../../tailwind.config";+// @ts-expect-errorconst config = resolveConfig(tailwinConfig);export const theme = config.theme as any;diff --git a/bun.lockb b/bun.lockbindex 104b8443e..4a11c745c 100755Binary files a/bun.lockb and b/bun.lockb differdiff --git a/packages/types/index.ts b/packages/types/index.tsindex 3aa2ab48b..37357e5da 100644--- a/packages/types/index.ts+++ b/packages/types/index.ts@@ -30,29 +30,32 @@ export type ProfileDecrementPayload = {// Batchingexport type BatchEvent = {- type: 'event',+ type: 'event'payload: EventPayload}export type BatchProfile = {- type: 'profile',+ type: 'profile'payload: ProfilePayload}export type BatchProfileIncrement = {- type: 'profile_increment',+ type: 'profile_increment'payload: ProfileIncrementPayload}export type BatchProfileDecrement = {- type: 'profile_decrement',+ type: 'profile_decrement'payload: ProfileDecrementPayload}-export type BatchItem = BatchEvent | BatchProfile | BatchProfileIncrement | BatchProfileDecrement+export type BatchItem =+ | BatchEvent+ | BatchProfile+ | BatchProfileIncrement+ | BatchProfileDecrementexport type BatchPayload = Array<BatchItem>-export type MixanIssue = {field: stringmessage: string@@ -63,11 +66,11 @@ export type MixanErrorResponse = {status: 'error'code: numbermessage: string- issues?: Array<MixanIssue>- stack?: string+ issues?: Array<MixanIssue> | undefined+ stack?: string | undefined}export type MixanResponse<T> = {result: Tstatus: 'ok'-}\ No newline at end of file+}