mirror of
https://github.com/twentyhq/twenty.git
synced 2024-10-04 12:57:10 +03:00
fixed twenty website build (#5174)
Made code compile during build even when then environment variable is not yet available Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
This commit is contained in:
parent
d23e02adca
commit
6e8c6c8e58
@ -9,6 +9,8 @@ import { savePRsToDB } from '@/github-sync/contributors/save-prs-to-db';
|
||||
import { searchIssuesPRs } from '@/github-sync/contributors/search-issues-prs';
|
||||
import { IssueNode, PullRequestNode } from '@/github-sync/contributors/types';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET() {
|
||||
if (!global.process.env.GITHUB_TOKEN) {
|
||||
return new Response('No GitHub token provided', { status: 500 });
|
||||
|
@ -8,6 +8,8 @@ import EmotionRootStyleRegistry from './emotion-root-style-registry';
|
||||
|
||||
import './layout.css';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Twenty.com',
|
||||
description: 'Open Source CRM',
|
||||
|
@ -11,6 +11,8 @@ export const metadata = {
|
||||
icons: '/images/core/logo.svg',
|
||||
};
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export default async function OssFriends() {
|
||||
const ossList = await fetch('https://formbricks.com/api/oss-friends');
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { ContentContainer } from './_components/ui/layout/ContentContainer';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<ContentContainer>
|
||||
|
@ -9,6 +9,8 @@ export interface ReleaseNote {
|
||||
content: string;
|
||||
}
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
const host = request.nextUrl.hostname;
|
||||
const protocol = request.nextUrl.protocol;
|
||||
|
@ -16,6 +16,8 @@ export const metadata: Metadata = {
|
||||
'Discover the newest features and improvements in Twenty, the #1 open-source CRM.',
|
||||
};
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
const Home = async () => {
|
||||
const releases = await getReleases();
|
||||
const mdxReleasesContent = await getMdxReleasesContent(releases);
|
||||
|
@ -4,6 +4,8 @@ import UserGuideContent from '@/app/_components/user-guide/UserGuideContent';
|
||||
import { fetchArticleFromSlug } from '@/shared-utils/fetchArticleFromSlug';
|
||||
import { formatSlug } from '@/shared-utils/formatSlug';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
|
@ -7,6 +7,8 @@ export const metadata = {
|
||||
icons: '/images/core/logo.svg',
|
||||
};
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export default async function UserGuideHome() {
|
||||
return <UserGuideMain />;
|
||||
}
|
||||
|
@ -1,12 +1,16 @@
|
||||
import { global } from '@apollo/client/utilities/globals';
|
||||
import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import { drizzle, PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
||||
import { migrate as postgresMigrate } from 'drizzle-orm/postgres-js/migrator';
|
||||
import postgres from 'postgres';
|
||||
|
||||
import 'dotenv/config';
|
||||
|
||||
const pgClient = postgres(`${global.process.env.DATABASE_PG_URL}`);
|
||||
const pgDb = drizzle(pgClient, { logger: false });
|
||||
let pgDb: PostgresJsDatabase;
|
||||
|
||||
if (global.process.env.DATABASE_PG_URL) {
|
||||
const pgClient = postgres(`${global.process.env.DATABASE_PG_URL}`);
|
||||
pgDb = drizzle(pgClient, { logger: false });
|
||||
}
|
||||
|
||||
const migrate = async () => {
|
||||
await postgresMigrate(pgDb, {
|
||||
|
Loading…
Reference in New Issue
Block a user