forked from enricoros/big-AGI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/enricoros/big-agi
- Loading branch information
Showing
57 changed files
with
528 additions
and
292 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 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,36 @@ | ||
/** @type {import('next').NextConfig} */ | ||
let nextConfig = { | ||
reactStrictMode: true, | ||
|
||
// Note: disabled to chech whether the project becomes slower with this | ||
// modularizeImports: { | ||
// '@mui/icons-material': { | ||
// transform: '@mui/icons-material/{{member}}', | ||
// }, | ||
// }, | ||
|
||
webpack: (config, _options) => { | ||
// @mui/joy: anything material gets redirected to Joy | ||
config.resolve.alias['@mui/material'] = '@mui/joy'; | ||
|
||
// @dqbd/tiktoken: enable asynchronous WebAssembly | ||
config.experiments = { | ||
asyncWebAssembly: true, | ||
layers: true, | ||
}; | ||
|
||
return config; | ||
}, | ||
}; | ||
|
||
// Validate environment variables, if set at build time. Will be actually read and used at runtime. | ||
// This is the reason both this file and the servr/env.mjs files have this extension. | ||
await import('./src/server/env.mjs'); | ||
|
||
// conditionally enable the nextjs bundle analyzer | ||
if (process.env.ANALYZE_BUNDLE) { | ||
const { default: withBundleAnalyzer } = await import('@next/bundle-analyzer'); | ||
nextConfig = withBundleAnalyzer({ openAnalyzer: true })(nextConfig); | ||
} | ||
|
||
export default nextConfig; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,56 +1,39 @@ | ||
import * as React from 'react'; | ||
import Head from 'next/head'; | ||
import { MyAppProps } from 'next/app'; | ||
import { Analytics as VercelAnalytics } from '@vercel/analytics/react'; | ||
import { AppProps } from 'next/app'; | ||
import { CacheProvider, EmotionCache } from '@emotion/react'; | ||
import { CssBaseline, CssVarsProvider } from '@mui/joy'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
|
||
import { Brand } from '~/common/app.config'; | ||
import { apiQuery } from '~/common/util/trpc.client'; | ||
import { appTheme, createEmotionCache } from '~/common/app.theme'; | ||
|
||
import 'katex/dist/katex.min.css'; | ||
import '~/common/styles/CodePrism.css'; | ||
import '~/common/styles/GithubMarkdown.css'; | ||
|
||
import { ProviderBackend } from '~/common/state/ProviderBackend'; | ||
import { ProviderTRPCQueryClient } from '~/common/state/ProviderTRPCQueryClient'; | ||
import { ProviderTheming } from '~/common/state/ProviderTheming'; | ||
|
||
// Client-side cache, shared for the whole session of the user in the browser. | ||
const clientSideEmotionCache = createEmotionCache(); | ||
|
||
export interface MyAppProps extends AppProps { | ||
emotionCache?: EmotionCache; | ||
} | ||
|
||
function MyApp({ Component, emotionCache = clientSideEmotionCache, pageProps }: MyAppProps) { | ||
const [queryClient] = React.useState(() => new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
retry: false, | ||
}, | ||
mutations: { | ||
retry: false, | ||
}, | ||
}, | ||
})); | ||
return <> | ||
<CacheProvider value={emotionCache}> | ||
<Head> | ||
<title>{Brand.Title.Common}</title> | ||
<meta name='viewport' content='minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no' /> | ||
</Head> | ||
{/* Rect-query provider */} | ||
<QueryClientProvider client={queryClient}> | ||
<CssVarsProvider defaultMode='light' theme={appTheme}> | ||
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */} | ||
<CssBaseline /> | ||
|
||
const MyApp = ({ Component, emotionCache, pageProps }: MyAppProps) => | ||
<> | ||
|
||
<Head> | ||
<title>{Brand.Title.Common}</title> | ||
<meta name='viewport' content='minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no' /> | ||
</Head> | ||
|
||
<ProviderTheming emotionCache={emotionCache}> | ||
<ProviderTRPCQueryClient> | ||
<ProviderBackend> | ||
<Component {...pageProps} /> | ||
</CssVarsProvider> | ||
</QueryClientProvider> | ||
</CacheProvider> | ||
</ProviderBackend> | ||
</ProviderTRPCQueryClient> | ||
</ProviderTheming> | ||
|
||
<VercelAnalytics debug={false} /> | ||
|
||
</>; | ||
} | ||
|
||
// enables the react-query api invocation | ||
// enables the React Query API invocation | ||
export default apiQuery.withTRPC(MyApp); |
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
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
Oops, something went wrong.