Skip to content

Commit 2e5af4e

Browse files
committed
chore: 🔨 remove .env.example file and update dependencies including Next.js, React, and Stripe
1 parent 405055a commit 2e5af4e

File tree

8 files changed

+1985
-1310
lines changed

8 files changed

+1985
-1310
lines changed
File renamed without changes.

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,39 +56,39 @@
5656
"embla-carousel-react": "^8.5.2",
5757
"input-otp": "^1.4.2",
5858
"lucide-react": "^0.471.1",
59-
"next": "15.1.4",
59+
"next": "15.3.2",
6060
"next-international": "^1.3.1",
6161
"next-safe-action": "^7.10.2",
6262
"next-themes": "^0.4.4",
6363
"postcss": "8.5.1",
64-
"react": "19.0.0",
64+
"react": "19.1.0",
6565
"react-day-picker": "8.10.1",
66-
"react-dom": "19.0.0",
66+
"react-dom": "19.1.0",
6767
"react-email": "3.0.6",
6868
"react-hook-form": "^7.54.2",
6969
"react-resizable-panels": "^2.1.7",
7070
"recharts": "^2.15.2",
7171
"resend": "^4.1.1",
7272
"sonner": "^2.0.3",
73-
"stripe": "^17.5.0",
73+
"stripe": "^18.0.0",
7474
"uploadthing": "^7.4.4",
7575
"vaul": "^1.1.2",
7676
"zod": "^3.24.1"
7777
},
7878
"devDependencies": {
7979
"@tailwindcss/line-clamp": "^0.4.4",
8080
"@tailwindcss/typography": "^0.5.16",
81-
"@types/node": "22.10.7",
82-
"@types/react": "19.0.7",
83-
"@types/react-dom": "19.0.3",
81+
"@types/node": "22.15.18",
82+
"@types/react": "19.1.4",
83+
"@types/react-dom": "19.1.5",
8484
"autoprefixer": "10.4.20",
8585
"class-variance-authority": "^0.7.1",
8686
"clsx": "^2.1.1",
87-
"eslint": "9.18.0",
88-
"eslint-config-next": "15.1.4",
89-
"eslint-config-prettier": "^10.0.1",
87+
"eslint": "9.24.0",
88+
"eslint-config-next": "15.3.2",
89+
"eslint-config-prettier": "^10.1.1",
9090
"lefthook": "^1.10.7",
91-
"prettier": "3.4.2",
91+
"prettier": "3.5.3",
9292
"prettier-plugin-tailwindcss": "^0.6.10",
9393
"prisma": "^6.2.1",
9494
"release-it": "^18.1.1",
@@ -100,5 +100,5 @@
100100
"typescript": "5.7.3",
101101
"velite": "0.2.2"
102102
},
103-
"packageManager": "pnpm@10.4.1"
103+
"packageManager": "pnpm@10.7.1+sha512.2d92c86b7928dc8284f53494fb4201f983da65f0fb4f0d40baafa5cf628fa31dae3e5968f12466f17df7e97310e30f343a648baea1b9b350685dafafffdf5808"
104104
}

pnpm-lock.yaml

Lines changed: 1952 additions & 1288 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
onlyBuiltDependencies:
2+
- '@prisma/client'
3+
- '@prisma/engines'
4+
- esbuild
5+
- lefthook
6+
- prisma
7+
- sharp
8+
- unrs-resolver

src/app/api/webhooks/stripe/route.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ export async function POST(req: NextRequest) {
2424
}
2525
}
2626

27-
const session = event?.data.object as Stripe.Checkout.Session;
27+
const eventData = event?.data.object as
28+
| Stripe.Checkout.Session
29+
| Stripe.Invoice;
30+
31+
console.log({ event, eventData });
2832

2933
if (event?.type === "checkout.session.completed") {
34+
const session = eventData as Stripe.Checkout.Session;
3035
// Retrieve the subscription details from Stripe.
3136
const subscription = await stripe.subscriptions.retrieve(
3237
session.subscription as string
@@ -43,17 +48,16 @@ export async function POST(req: NextRequest) {
4348
stripeSubscriptionId: subscription.id,
4449
stripeCustomerId: subscription.customer as string,
4550
stripePriceId: subscription.items.data[0].price.id,
46-
stripeCurrentPeriodEnd: new Date(
47-
subscription.current_period_end * 1000
48-
),
51+
stripeCurrentPeriodEnd: new Date(subscription.ended_at! * 1000),
4952
},
5053
});
5154
}
5255

5356
if (event?.type === "invoice.payment_succeeded") {
57+
const invoice = eventData as Stripe.Invoice;
5458
// Retrieve the subscription details from Stripe.
5559
const subscription = await stripe.subscriptions.retrieve(
56-
session.subscription as string
60+
invoice.parent?.subscription_details?.subscription as string
5761
);
5862

5963
// Update the price id and set the new period end.
@@ -63,9 +67,7 @@ export async function POST(req: NextRequest) {
6367
},
6468
data: {
6569
stripePriceId: subscription.items.data[0].price.id,
66-
stripeCurrentPeriodEnd: new Date(
67-
subscription.current_period_end * 1000
68-
),
70+
stripeCurrentPeriodEnd: new Date(subscription.ended_at! * 1000),
6971
},
7072
});
7173
}

src/components/billing-form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export function BillingForm({
2626
...props
2727
}: BillingFormProps) {
2828
const [isLoading, setIsLoading] = useState<boolean>(false);
29+
console.log(subscriptionPlan);
2930

3031
async function onSubmit(event: React.FormEvent<HTMLFormElement>) {
3132
event.preventDefault();

src/components/sections/pricing.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default async function Pricing() {
7575
{plans.map((plan) => {
7676
const isCurrentPlan = subscription
7777
? plan.isPro === subscription.isPro
78-
: plan.price === 0;
78+
: false;
7979

8080
return (
8181
<Card

src/lib/server/payment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prisma } from "~/lib/server/db";
44
import { type UserSubscriptionPlan } from "~/types";
55

66
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY as string, {
7-
apiVersion: "2024-12-18.acacia",
7+
apiVersion: "2025-03-31.basil",
88
typescript: true,
99
});
1010

0 commit comments

Comments
 (0)