feat: add basic webui

This commit is contained in:
2024-12-30 06:39:09 +08:00
parent 608a7fb9c6
commit a4c549e7c3
462 changed files with 35900 additions and 2491 deletions

View 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} />;

View 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>
);

View 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"
}
}

View 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 {
}
}

View File

@@ -0,0 +1,8 @@
{
"extends": "@konobangu/typescript-config/react-library.json",
"compilerOptions": {
"baseUrl": "."
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}