update deps

This commit is contained in:
Vlad Morozov
2025-04-22 21:08:28 +03:00
parent a3cdf46210
commit e8688bac2b
10 changed files with 754 additions and 5151 deletions

View File

@@ -1,20 +0,0 @@
.now/*
*.css
.changeset
dist
esm/*
public/*
tests/*
scripts/*
*.config.js
.DS_Store
node_modules
coverage
.next
build
!.commitlintrc.cjs
!.lintstagedrc.cjs
!jest.config.js
!plopfile.js
!react-shim.js
!tsup.config.ts

View File

@@ -1,93 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"env": {
"browser": false,
"es2021": true,
"node": true
},
"extends": [
"plugin:react/recommended",
"plugin:prettier/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended"
],
"plugins": ["react", "unused-imports", "import", "@typescript-eslint", "jsx-a11y", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"no-console": "warn",
"react/prop-types": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/interactive-supports-focus": "warn",
"prettier/prettier": "warn",
"no-unused-vars": "off",
"unused-imports/no-unused-vars": "off",
"unused-imports/no-unused-imports": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "after-used",
"ignoreRestSiblings": false,
"argsIgnorePattern": "^_.*?$"
}
],
"import/order": [
"warn",
{
"groups": [
"type",
"builtin",
"object",
"external",
"internal",
"parent",
"sibling",
"index"
],
"pathGroups": [
{
"pattern": "~/**",
"group": "external",
"position": "after"
}
],
"newlines-between": "always"
}
],
"react/self-closing-comp": "warn",
"react/jsx-sort-props": [
"warn",
{
"callbacksLast": true,
"shorthandFirst": true,
"noSortAlphabetically": false,
"reservedFirst": true
}
],
"padding-line-between-statements": [
"warn",
{"blankLine": "always", "prev": "*", "next": "return"},
{"blankLine": "always", "prev": ["const", "let", "var"], "next": "*"},
{
"blankLine": "any",
"prev": ["const", "let", "var"],
"next": ["const", "let", "var"]
}
]
}
}

View File

@@ -11,7 +11,7 @@ export default function Error({
}) { }) {
useEffect(() => { useEffect(() => {
// Log the error to an error reporting service // Log the error to an error reporting service
/* eslint-disable no-console */
console.error(error); console.error(error);
}, [error]); }, [error]);

View File

@@ -1,10 +1,7 @@
import "@/styles/globals.css"; import "@/styles/globals.css";
import clsx from "clsx"; import { Metadata } from "next";
import { Metadata, Viewport } from "next";
import { Fira_Code as FontMono, Inter as FontSans } from "next/font/google"; import { Fira_Code as FontMono, Inter as FontSans } from "next/font/google";
import { Providers } from "./providers";
import NavBar from "@/components/NavBar"; import NavBar from "@/components/NavBar";
const fontSans = FontSans({ const fontSans = FontSans({
@@ -27,13 +24,6 @@ export const metadata: Metadata = {
}, },
}; };
export const viewport: Viewport = {
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "white" },
{ media: "(prefers-color-scheme: dark)", color: "black" },
],
};
export default function RootLayout({ export default function RootLayout({
children, children,
}: { }: {
@@ -46,13 +36,11 @@ export default function RootLayout({
lang="en" lang="en"
> >
<head /> <head />
<body className={clsx("min-h-screen bg-background antialiased")}> <body className="min-h-screen bg-black text-white">
<Providers themeProps={{ attribute: "class", defaultTheme: "dark" }}> <main className="relative flex flex-col gap-6 h-screen w-screen">
<main className="relative flex flex-col h-screen w-screen"> <NavBar />
<NavBar /> {children}
{children} </main>
</main>
</Providers>
</body> </body>
</html> </html>
); );

View File

@@ -1,22 +0,0 @@
"use client";
import * as React from "react";
import { NextUIProvider } from "@nextui-org/system";
import { useRouter } from "next/navigation";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { ThemeProviderProps } from "next-themes/dist/types";
export interface ProvidersProps {
children: React.ReactNode;
themeProps?: ThemeProviderProps;
}
export function Providers({ children, themeProps }: ProvidersProps) {
const router = useRouter();
return (
<NextUIProvider navigate={router.push}>
<NextThemesProvider {...themeProps}>{children}</NextThemesProvider>
</NextUIProvider>
);
}

View File

@@ -20,9 +20,11 @@ import { StreamingAvatarProvider, StreamingAvatarSessionState } from "./logic";
import { LoadingIcon } from "./Icons"; import { LoadingIcon } from "./Icons";
import { MessageHistory } from "./AvatarSession/MessageHistory"; import { MessageHistory } from "./AvatarSession/MessageHistory";
import { AVATARS } from "@/app/lib/constants";
const DEFAULT_CONFIG: StartAvatarRequest = { const DEFAULT_CONFIG: StartAvatarRequest = {
quality: AvatarQuality.Low, quality: AvatarQuality.Low,
avatarName: "Wayne_20240711_v3", avatarName: AVATARS[0].avatar_id,
knowledgeId: undefined, knowledgeId: undefined,
voice: { voice: {
rate: 1.5, rate: 1.5,
@@ -151,10 +153,6 @@ function InteractiveAvatar() {
{sessionState === StreamingAvatarSessionState.CONNECTED && ( {sessionState === StreamingAvatarSessionState.CONNECTED && (
<MessageHistory /> <MessageHistory />
)} )}
<p className="font-mono text-right">
<span className="font-bold">Console:</span>
<br />
</p>
</div> </div>
); );
} }

112
eslint.config.mjs Normal file
View File

@@ -0,0 +1,112 @@
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import unusedImports from 'eslint-plugin-unused-imports';
import prettierPlugin from 'eslint-plugin-prettier';
import importPlugin from 'eslint-plugin-import';
import nextPlugin from '@next/eslint-plugin-next';
export default [
{
ignores: ['.next', 'node_modules']
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
ignores: [
'build/**/*',
'public/**/*',
'dist/**/*',
'coverage/**/*',
'*.config.js',
'*.config.ts',
'postcss.config.js',
'tailwind.config.js',
],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'@typescript-eslint': tseslint,
'react': reactPlugin,
'react-hooks': reactHooksPlugin,
'unused-imports': unusedImports,
'prettier': prettierPlugin,
'import': importPlugin,
'next': nextPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/self-closing-comp': 'warn',
'react/jsx-sort-props': [
'warn',
{
callbacksLast: true,
shorthandFirst: true,
noSortAlphabetically: false,
reservedFirst: true,
},
],
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
args: 'after-used',
ignoreRestSiblings: false,
argsIgnorePattern: '^_.*?$',
},
],
'unused-imports/no-unused-imports': 'warn',
'import/order': [
'warn',
{
groups: [
'type',
'builtin',
'object',
'external',
'internal',
'parent',
'sibling',
'index',
],
pathGroups: [
{
pattern: '~/**',
group: 'external',
position: 'after',
},
],
'newlines-between': 'always',
},
],
'prettier/prettier': 'warn',
'padding-line-between-statements': [
'warn',
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var'],
},
],
},
},
];

View File

@@ -6,51 +6,35 @@
"dev": "node_modules/next/dist/bin/next dev", "dev": "node_modules/next/dist/bin/next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "eslint . --ext .ts,.tsx -c .eslintrc.json --fix" "lint": "eslint . --ext .ts,.tsx,.js,.jsx"
}, },
"dependencies": { "dependencies": {
"@ai-sdk/openai": "^0.0.34",
"@heygen/streaming-avatar": "^2.0.13", "@heygen/streaming-avatar": "^2.0.13",
"@nextui-org/link": "2.0.32",
"@nextui-org/listbox": "2.1.21",
"@nextui-org/navbar": "2.0.33",
"@nextui-org/react": "^2.4.2",
"@nextui-org/snippet": "2.0.38",
"@nextui-org/switch": "2.0.31",
"@nextui-org/system": "2.2.1",
"@nextui-org/theme": "2.2.5",
"@phosphor-icons/react": "^2.1.5",
"@radix-ui/react-select": "^2.1.7", "@radix-ui/react-select": "^2.1.7",
"@radix-ui/react-switch": "^1.1.4", "@radix-ui/react-switch": "^1.1.4",
"@radix-ui/react-toggle-group": "^1.1.3", "@radix-ui/react-toggle-group": "^1.1.3",
"@react-aria/ssr": "3.9.4", "ahooks": "^3.8.4",
"@react-aria/visually-hidden": "3.8.12",
"ahooks": "^3.8.1",
"ai": "^3.2.15",
"clsx": "2.1.1",
"next": "^15.3.0", "next": "^15.3.0",
"next-themes": "^0.2.1",
"openai": "^4.52.1", "openai": "^4.52.1",
"react": "^19.1.0", "react": "^19.1.0",
"react-dom": "^19.1.0" "react-dom": "^19.1.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "20.5.7", "@types/node": "20.5.7",
"@types/react": "18.3.3", "@types/react": "^19.0.1",
"@types/react-dom": "18.3.0", "@types/react-dom": "^19.1.2",
"@typescript-eslint/eslint-plugin": "7.2.0", "@typescript-eslint/eslint-plugin": "^8.31.0",
"@typescript-eslint/parser": "7.2.0", "@typescript-eslint/parser": "^8.31.0",
"@next/eslint-plugin-next": "^15.3.1",
"autoprefixer": "10.4.19", "autoprefixer": "10.4.19",
"eslint": "^8.57.0", "eslint": "^9.25.1",
"eslint-config-next": "14.2.1", "eslint-config-prettier": "^10.1.2",
"eslint-config-prettier": "^8.2.0", "eslint-plugin-import": "^2.31.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.2.6",
"eslint-plugin-react": "^7.23.2", "eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-unused-imports": "^3.2.0", "eslint-plugin-unused-imports": "^4.1.4",
"postcss": "8.4.38", "postcss": "8.4.38",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"typescript": "5.0.4" "typescript": "5.0.4"

5576
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,8 @@
import {nextui} from '@nextui-org/theme'
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
module.exports = { module.exports = {
content: [ content: [
'./components/**/*.{js,ts,jsx,tsx,mdx}', './components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}', './app/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}'
], ],
theme: { theme: {
extend: { extend: {
@@ -16,5 +13,4 @@ module.exports = {
}, },
}, },
darkMode: "class", darkMode: "class",
plugins: [nextui()],
} }