Skip to content

Commit

Permalink
chore: update more dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter committed Nov 3, 2024
1 parent a8a2e20 commit bd3c667
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 60 deletions.
Binary file modified bun.lockb
Binary file not shown.
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
"release-it": "release-it"
},
"dependencies": {
"@effect/schema": "0.75.4",
"@effect/platform": "0.68.4",
"effect": "3.9.2",
"@effect/schema": "0.75.5",
"@effect/platform": "0.69.13",
"effect": "3.10.8",
"fs-extra": "11.2.0",
"pkg-dir": "8.0.0",
"yargs": "17.7.2"
},
"devDependencies": {
"@release-it/keep-a-changelog": "5.0.0",
"@types/fs-extra": "11.0.4",
"@types/node": "22.7.5",
"@types/node": "22.8.7",
"@types/yargs": "17.0.33",
"release-it": "17.8.2",
"release-it": "17.10.0",
"typescript": "5.6.3"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/panda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"ts-pattern": "5.5.0"
},
"devDependencies": {
"@pandacss/dev": "0.46.1",
"@pandacss/dev": "0.47.0",
"@release-it/keep-a-changelog": "5.0.0",
"clean-package": "2.2.0",
"release-it": "17.8.2",
"tsup": "8.3.0"
"release-it": "17.10.0",
"tsup": "8.3.5"
},
"peerDependencies": {
"@pandacss/dev": ">0.22.0"
Expand Down
28 changes: 14 additions & 14 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,40 @@
},
"dependencies": {
"@ark-ui/react": "4.2.0",
"@auth/prisma-adapter": "2.7.0",
"@biomejs/biome": "1.9.3",
"@effect/platform": "0.61.1",
"@effect/schema": "0.70.0",
"@icons-pack/react-simple-icons": "10.0.0",
"@pandacss/dev": "0.46.1",
"@auth/prisma-adapter": "2.7.2",
"@biomejs/biome": "1.9.4",
"@effect/platform": "0.69.13",
"@effect/schema": "0.75.5",
"@icons-pack/react-simple-icons": "10.1.0",
"@pandacss/dev": "0.47.0",
"@park-ui/panda-preset": "workspace:*",
"@prisma/client": "5.20.0",
"@prisma/client": "5.21.1",
"@types/file-saver": "2.0.7",
"file-saver": "2.0.5",
"jszip": "3.10.1",
"@types/node": "22.7.5",
"@types/react": "18.3.11",
"@types/node": "22.8.7",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@uidotdev/usehooks": "2.4.1",
"effect": "3.6.0",
"effect": "3.10.8",
"globby": "14.0.2",
"lucide-react": "0.452.0",
"lucide-react": "0.454.0",
"next": "14.2.15",
"next-auth": "5.0.0-beta.19",
"next-themes": "0.3.0",
"pandacss-preset-typography": "0.1.6",
"prisma": "5.20.0",
"prisma": "5.21.1",
"re-resizable": "6.10.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-frame-component": "5.2.7",
"react-runner": "1.0.5",
"rehype-autolink-headings": "7.1.0",
"rehype-slug": "6.0.0",
"shiki": "1.22.0",
"shiki": "1.22.2",
"typescript": "5.6.3",
"usehooks-ts": "3.1.0",
"velite": "0.1.1",
"zustand": "5.0.0"
"zustand": "5.0.1"
}
}
63 changes: 26 additions & 37 deletions website/src/app/api/figma-kit/route.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,34 @@
import { HttpClient, HttpClientRequest, HttpClientResponse } from '@effect/platform'
import { Schema } from '@effect/schema'
import { Effect, Schedule, pipe } from 'effect'
import type { NextRequest } from 'next/server'

const Order = Schema.Struct({
data: Schema.optional(
Schema.Struct({
attributes: Schema.Struct({
refunded: Schema.Boolean,
}),
}),
),
})

const { FIGMA_KIT_URL, LEMON_SQUEEZY_API_KEY } = process.env

export const GET = async (req: NextRequest) => {
const { searchParams } = new URL(req.url)
const orderId = searchParams.get('order_id')

if (!orderId) {
return Response.redirect('https://park-ui.com')
}

try {
const response = await fetch(`https://api.lemonsqueezy.com/v1/orders/${orderId}`, {
headers: {
Accept: 'application/vnd.api+json',
'Content-Type': 'application/vnd.api+json',
Authorization: `Bearer ${LEMON_SQUEEZY_API_KEY}`,
},
})

if (!response.ok) {
throw new Error('Network response was not ok')
}

const data = await response.json()

const isValid = data.data?.attributes?.refunded === false

const isValid = await Effect.runPromise(
pipe(
Effect.fromNullable(searchParams.get('order_id')),
Effect.flatMap((orderId) =>
pipe(
HttpClientRequest.get(`https://api.lemonsqueezy.com/v1/orders/${orderId}`, {
headers: {
Accept: 'application/vnd.api+json',
'Content-Type': 'application/vnd.api+json',
Authorization: `Bearer ${LEMON_SQUEEZY_API_KEY}`,
},
}),
HttpClient.fetchOk,
HttpClientResponse.schemaBodyJsonScoped(Order),
Effect.timeout('1 seconds'),
Effect.retry(Schedule.exponential(200).pipe(Schedule.compose(Schedule.recurs(3)))),
),
),
Effect.map((data) => !data.data?.attributes.refunded),
Effect.catchAll(() => Effect.succeed(false)),
),
)

return Response.redirect(isValid ? FIGMA_KIT_URL : 'https://park-ui.com')
return Response.redirect(isValid ? FIGMA_KIT_URL : 'https://park-ui.com')
} catch (error) {
return Response.redirect('https://park-ui.com')
}
}
1 change: 0 additions & 1 deletion website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"allowJs": true,
"baseUrl": ".",
"esModuleInterop": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
Expand Down

0 comments on commit bd3c667

Please sign in to comment.