Next.js Supabase V3 (#463)
Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
This commit is contained in:
committed by
GitHub
parent
4912e402a3
commit
7ebff31475
@@ -1,3 +0,0 @@
|
||||
import eslintConfigBase from '@kit/eslint-config/base.js';
|
||||
|
||||
export default eslintConfigBase;
|
||||
@@ -1,25 +1,27 @@
|
||||
{
|
||||
"name": "@kit/lemon-squeezy",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .turbo node_modules",
|
||||
"format": "prettier --check \"**/*.{ts,tsx}\"",
|
||||
"lint": "eslint .",
|
||||
"typecheck": "tsc --noEmit"
|
||||
"private": true,
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"src/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"prettier": "@kit/prettier-config",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./components": "./src/components/index.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .turbo node_modules",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lemonsqueezy/lemonsqueezy.js": "4.0.0"
|
||||
"@lemonsqueezy/lemonsqueezy.js": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kit/billing": "workspace:*",
|
||||
"@kit/eslint-config": "workspace:*",
|
||||
"@kit/prettier-config": "workspace:*",
|
||||
"@kit/shared": "workspace:*",
|
||||
"@kit/supabase": "workspace:*",
|
||||
"@kit/tsconfig": "workspace:*",
|
||||
@@ -28,12 +30,5 @@
|
||||
"next": "catalog:",
|
||||
"react": "catalog:",
|
||||
"zod": "catalog:"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"src/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { z } from 'zod';
|
||||
import * as z from 'zod';
|
||||
|
||||
/**
|
||||
* @name getLemonSqueezyEnv
|
||||
@@ -10,18 +10,18 @@ export const getLemonSqueezyEnv = () =>
|
||||
.object({
|
||||
secretKey: z
|
||||
.string({
|
||||
description: `The secret key you created for your store. Please use the variable LEMON_SQUEEZY_SECRET_KEY to set it.`,
|
||||
error: `The secret key you created for your store. Please use the variable LEMON_SQUEEZY_SECRET_KEY to set it.`,
|
||||
})
|
||||
.min(1),
|
||||
webhooksSecret: z
|
||||
.string({
|
||||
description: `The shared secret you created for your webhook. Please use the variable LEMON_SQUEEZY_SIGNING_SECRET to set it.`,
|
||||
error: `The shared secret you created for your webhook. Please use the variable LEMON_SQUEEZY_SIGNING_SECRET to set it.`,
|
||||
})
|
||||
.min(1)
|
||||
.max(40),
|
||||
storeId: z
|
||||
.string({
|
||||
description: `The ID of your store. Please use the variable LEMON_SQUEEZY_STORE_ID to set it.`,
|
||||
error: `The ID of your store. Please use the variable LEMON_SQUEEZY_STORE_ID to set it.`,
|
||||
})
|
||||
.min(1),
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getCustomer } from '@lemonsqueezy/lemonsqueezy.js';
|
||||
import { z } from 'zod';
|
||||
import * as z from 'zod';
|
||||
|
||||
import type { CreateBillingPortalSessionSchema } from '@kit/billing/schema';
|
||||
|
||||
@@ -11,7 +11,7 @@ import { initializeLemonSqueezyClient } from './lemon-squeezy-sdk';
|
||||
* @param {object} params - The parameters required to create the billing portal session.
|
||||
*/
|
||||
export async function createLemonSqueezyBillingPortalSession(
|
||||
params: z.infer<typeof CreateBillingPortalSessionSchema>,
|
||||
params: z.output<typeof CreateBillingPortalSessionSchema>,
|
||||
) {
|
||||
await initializeLemonSqueezyClient();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
createCheckout,
|
||||
getCustomer,
|
||||
} from '@lemonsqueezy/lemonsqueezy.js';
|
||||
import { z } from 'zod';
|
||||
import * as z from 'zod';
|
||||
|
||||
import type { CreateBillingCheckoutSchema } from '@kit/billing/schema';
|
||||
|
||||
@@ -14,7 +14,7 @@ import { initializeLemonSqueezyClient } from './lemon-squeezy-sdk';
|
||||
* Creates a checkout for a Lemon Squeezy product.
|
||||
*/
|
||||
export async function createLemonSqueezyCheckout(
|
||||
params: z.infer<typeof CreateBillingCheckoutSchema>,
|
||||
params: z.output<typeof CreateBillingCheckoutSchema>,
|
||||
) {
|
||||
await initializeLemonSqueezyClient();
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'server-only';
|
||||
|
||||
import {
|
||||
cancelSubscription,
|
||||
createUsageRecord,
|
||||
@@ -9,7 +8,7 @@ import {
|
||||
listUsageRecords,
|
||||
updateSubscriptionItem,
|
||||
} from '@lemonsqueezy/lemonsqueezy.js';
|
||||
import { z } from 'zod';
|
||||
import * as z from 'zod';
|
||||
|
||||
import { BillingStrategyProviderService } from '@kit/billing';
|
||||
import type {
|
||||
@@ -40,7 +39,7 @@ export class LemonSqueezyBillingStrategyService implements BillingStrategyProvid
|
||||
* @param params
|
||||
*/
|
||||
async createCheckoutSession(
|
||||
params: z.infer<typeof CreateBillingCheckoutSchema>,
|
||||
params: z.output<typeof CreateBillingCheckoutSchema>,
|
||||
) {
|
||||
const logger = await getLogger();
|
||||
|
||||
@@ -78,7 +77,7 @@ export class LemonSqueezyBillingStrategyService implements BillingStrategyProvid
|
||||
* @param params
|
||||
*/
|
||||
async createBillingPortalSession(
|
||||
params: z.infer<typeof CreateBillingPortalSessionSchema>,
|
||||
params: z.output<typeof CreateBillingPortalSessionSchema>,
|
||||
) {
|
||||
const logger = await getLogger();
|
||||
|
||||
@@ -117,7 +116,7 @@ export class LemonSqueezyBillingStrategyService implements BillingStrategyProvid
|
||||
* @param params
|
||||
*/
|
||||
async cancelSubscription(
|
||||
params: z.infer<typeof CancelSubscriptionParamsSchema>,
|
||||
params: z.output<typeof CancelSubscriptionParamsSchema>,
|
||||
) {
|
||||
const logger = await getLogger();
|
||||
|
||||
@@ -165,7 +164,7 @@ export class LemonSqueezyBillingStrategyService implements BillingStrategyProvid
|
||||
* @param params
|
||||
*/
|
||||
async retrieveCheckoutSession(
|
||||
params: z.infer<typeof RetrieveCheckoutSessionSchema>,
|
||||
params: z.output<typeof RetrieveCheckoutSessionSchema>,
|
||||
) {
|
||||
const logger = await getLogger();
|
||||
|
||||
@@ -209,7 +208,7 @@ export class LemonSqueezyBillingStrategyService implements BillingStrategyProvid
|
||||
* @description Reports the usage of the billing
|
||||
* @param params
|
||||
*/
|
||||
async reportUsage(params: z.infer<typeof ReportBillingUsageSchema>) {
|
||||
async reportUsage(params: z.output<typeof ReportBillingUsageSchema>) {
|
||||
const logger = await getLogger();
|
||||
|
||||
const ctx = {
|
||||
@@ -248,7 +247,7 @@ export class LemonSqueezyBillingStrategyService implements BillingStrategyProvid
|
||||
* @param params
|
||||
*/
|
||||
async queryUsage(
|
||||
params: z.infer<typeof QueryBillingUsageSchema>,
|
||||
params: z.output<typeof QueryBillingUsageSchema>,
|
||||
): Promise<{ value: number }> {
|
||||
const logger = await getLogger();
|
||||
|
||||
@@ -312,7 +311,7 @@ export class LemonSqueezyBillingStrategyService implements BillingStrategyProvid
|
||||
* @param params
|
||||
*/
|
||||
async updateSubscriptionItem(
|
||||
params: z.infer<typeof UpdateSubscriptionParamsSchema>,
|
||||
params: z.output<typeof UpdateSubscriptionParamsSchema>,
|
||||
) {
|
||||
const logger = await getLogger();
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'server-only';
|
||||
|
||||
import { getLogger } from '@kit/shared/logger';
|
||||
|
||||
import { getLemonSqueezyEnv } from '../schema/lemon-squeezy-server-env.schema';
|
||||
|
||||
Reference in New Issue
Block a user