feat: add basic webui
This commit is contained in:
23
packages/analytics/client.tsx
Normal file
23
packages/analytics/client.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
'use client';
|
||||
|
||||
import { Fragment, type ReactNode } from 'react';
|
||||
|
||||
export const analytics = {
|
||||
isFeatureEnabled: async (_key: string, _userId: string): Promise<boolean | null> => {
|
||||
return false;
|
||||
},
|
||||
capture: (_event: string, _properties: Record<string, unknown>): void => {
|
||||
|
||||
},
|
||||
identify(_userId: string, _properties: Record<string, unknown>): void {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
type AnalyticsImplProviderProps = {
|
||||
readonly children: ReactNode;
|
||||
};
|
||||
|
||||
export const AnalyticsImplProvider = (
|
||||
properties: Omit<AnalyticsImplProviderProps, 'client'>
|
||||
) => <Fragment {...properties} />;
|
||||
12
packages/analytics/index.tsx
Normal file
12
packages/analytics/index.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import { AnalyticsImplProvider } from './client';
|
||||
|
||||
type AnalyticsProviderProps = {
|
||||
readonly children: ReactNode;
|
||||
};
|
||||
|
||||
export const AnalyticsProvider = ({ children }: AnalyticsProviderProps) => (
|
||||
<AnalyticsImplProvider>
|
||||
{children}
|
||||
</AnalyticsImplProvider>
|
||||
);
|
||||
20
packages/analytics/package.json
Normal file
20
packages/analytics/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@konobangu/analytics",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
|
||||
},
|
||||
"dependencies": {
|
||||
"@konobangu/env": "workspace:*",
|
||||
"react": "^19.0.0",
|
||||
"server-only": "^0.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@konobangu/typescript-config": "workspace:*",
|
||||
"@types/node": "22.10.1",
|
||||
"@types/react": "19.0.1",
|
||||
"@types/react-dom": "^19.0.2"
|
||||
}
|
||||
}
|
||||
13
packages/analytics/server.ts
Normal file
13
packages/analytics/server.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'server-only';
|
||||
|
||||
export const analytics = {
|
||||
isFeatureEnabled: async (_key: string, _userId: string): Promise<boolean | null> => {
|
||||
return false;
|
||||
},
|
||||
capture: (_event: string, _properties: Record<string, unknown>): void => {
|
||||
|
||||
},
|
||||
identify(_userId: string, _properties: Record<string, unknown>): void {
|
||||
|
||||
}
|
||||
}
|
||||
8
packages/analytics/tsconfig.json
Normal file
8
packages/analytics/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@konobangu/typescript-config/react-library.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "."
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user