Merge pull request from ahmadk953/ai_generated-performance-enhancements

Optimize performance and reduce bundle sizes
This commit is contained in:
Ahmad 2024-12-18 21:45:09 -05:00 committed by GitHub
commit f64ec56481
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1201 additions and 2364 deletions
actions
copy-card
copy-list
create-card
create-list
delete-board
stripe-redirect
lib
next.config.tspackage.jsonyarn.lock

View file

@ -29,6 +29,13 @@ const handler = async (data: InputType): Promise<ReturnType> => {
},
},
},
select: {
id: true,
title: true,
description: true,
order: true,
listId: true,
},
});
if (!cardToCopy) return { error: 'Card not found' };

View file

@ -28,8 +28,18 @@ const handler = async (data: InputType): Promise<ReturnType> => {
orgId,
},
},
include: {
cards: true,
select: {
id: true,
title: true,
order: true,
boardId: true,
cards: {
select: {
title: true,
description: true,
order: true,
},
},
},
});

View file

@ -27,6 +27,9 @@ const handler = async (data: InputType): Promise<ReturnType> => {
orgId,
},
},
select: {
id: true,
},
});
if (!list) return { error: 'List not found' };

View file

@ -25,6 +25,9 @@ const handler = async (data: InputType): Promise<ReturnType> => {
id: boardId,
orgId,
},
select: {
id: true,
},
});
if (!board) return { error: 'Board not found' };

View file

@ -30,6 +30,10 @@ const handler = async (data: InputType): Promise<ReturnType> => {
id,
orgId,
},
select: {
id: true,
title: true,
},
});
if (!isPro) {

View file

@ -24,6 +24,9 @@ const handler = async (data: InputType): Promise<ReturnType> => {
try {
const orgSubscription = await db.orgSubscription.findUnique({
where: { orgId },
select: {
stripeCustomerId: true,
},
});
if (orgSubscription?.stripeCustomerId) {

View file

@ -1,6 +1,6 @@
import Stripe from 'stripe';
export const stripe = new Stripe(process.env.STRIPE_API_KEY!, {
apiVersion: '2024-11-20.acacia',
apiVersion: '2024-12-18.acacia',
typescript: true,
});

View file

@ -1,5 +1,6 @@
import { withSentryConfig } from '@sentry/nextjs';
import type { NextConfig } from 'next';
import compression from 'compression';
import { withContentCollections } from '@content-collections/next';
import createMDX from '@next/mdx';
@ -23,6 +24,8 @@ const nextConfig: NextConfig = {
],
},
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
compress: true,
serverMiddleware: [compression()],
};
const withMDX = createMDX({});

View file

@ -6,7 +6,7 @@
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "next lint && tsc --noemit",
"postinstall": "prisma generate --no-engine",
"format": "prettier --check --ignore-path .prettierignore .",
"format:fix": "prettier --write --ignore-path .prettierignore ."
@ -40,6 +40,7 @@
"@vercel/speed-insights": "^1.1.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"compression": "^1.7.5",
"date-fns": "^4.1.0",
"dompurify": "^3.2.3",
"lodash": "^4.17.21",
@ -67,6 +68,7 @@
"@microsoft/eslint-formatter-sarif": "^3.1.0",
"@next/eslint-plugin-next": "15.1.1",
"@tailwindcss/typography": "^0.5.15",
"@types/compression": "^1.7.5",
"@types/dompurify": "^3",
"@types/lodash": "^4.17.13",
"@types/node": "^22.10.2",

3522
yarn.lock

File diff suppressed because it is too large Load diff