feat: Preliminary work for shadcn add @supabase/...block... (#39322)

* Build the current registry.

* Export the blocks as JSON and import them into registry.json.

* Move the registry.json into public/r.

* Fix a prettier error.

* Clean up extra files in vue blocks.

* Bump shadcn.

* Readd shadcn to vue blocks.

* Fix the shadcn types.

* Remove extra package exclusions.
This commit is contained in:
Ivan Vasilov
2025-10-07 21:32:24 +03:00
committed by GitHub
parent 4870327a42
commit 191a291c2d
21 changed files with 1037 additions and 679 deletions

View File

@@ -8,6 +8,7 @@ apps/**/out
**/supabase/migrations/*.sql
apps/www/schema.sql
apps/www/public/images/*
apps/www/.generated/*
apps/docs/**/generated/*
apps/docs/examples/*
examples/slack-clone/nextjs-slack-clone/full-schema.sql

View File

@@ -7,7 +7,7 @@
"preinstall": "npx only-allow pnpm",
"dev": "next dev --port 3004",
"build": "pnpm run content:build && pnpm run build:registry && pnpm run build:llms && next build --turbopack",
"build:registry": "tsx --tsconfig ./tsconfig.scripts.json ./scripts/build-registry.mts && prettier --cache --write registry.json && rimraf -G public/r && shadcn build && cp node_modules/@supabase/vue-blocks/public/r/* public/r && tsx scripts/clean-registry.ts",
"build:registry": "rimraf -G public/r/* && tsx --tsconfig ./tsconfig.scripts.json ./scripts/build-registry.mts && shadcn build public/r/registry.json && tsx scripts/clean-registry.ts",
"build:llms": "tsx --tsconfig ./tsconfig.scripts.json ./scripts/build-llms-txt.ts",
"start": "next start",
"lint": "next lint",
@@ -105,7 +105,7 @@
"react-dropzone": "^14.3.8",
"react-router": "^7.5.2",
"rimraf": "^4.1.3",
"shadcn": "^2.10.0",
"shadcn": "^3.0.0",
"shiki": "^1.1.7",
"tailwindcss": "catalog:",
"tsconfig": "workspace:*",

File diff suppressed because one or more lines are too long

View File

@@ -8,8 +8,16 @@
"type": "registry:block",
"title": "Password Based Auth flow for Nextjs and Supabase",
"description": "Password Based Auth flow for Nextjs and Supabase",
"registryDependencies": ["button", "card", "input", "label"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"button",
"card",
"input",
"label"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/password-based-auth-nextjs/app/auth/login/page.tsx",
@@ -100,7 +108,12 @@
"type": "registry:block",
"title": "Password Based Auth flow for React and Supabase",
"description": "Password Based Auth flow for React and Supabase",
"registryDependencies": ["button", "card", "input", "label"],
"registryDependencies": [
"button",
"card",
"input",
"label"
],
"files": [
{
"path": "registry/default/blocks/password-based-auth-react/components/login-form.tsx",
@@ -123,7 +136,9 @@
"type": "registry:lib"
}
],
"dependencies": ["@supabase/supabase-js@latest"],
"dependencies": [
"@supabase/supabase-js@latest"
],
"docs": "You'll need to set the following environment variables in your project: `VITE_SUPABASE_URL` and `VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY`.",
"envVars": {
"VITE_SUPABASE_URL": "",
@@ -135,7 +150,12 @@
"type": "registry:block",
"title": "Password Based Auth flow for React Router and Supabase",
"description": "Password Based Auth flow for React Router and Supabase",
"registryDependencies": ["button", "card", "input", "label"],
"registryDependencies": [
"button",
"card",
"input",
"label"
],
"dependencies": [
"@supabase/ssr@latest",
"@react-router/dev@latest",
@@ -208,8 +228,16 @@
"type": "registry:block",
"title": "Password Based Auth flow for tanstack and Supabase",
"description": "Password Based Auth flow for tanstack and Supabase",
"registryDependencies": ["button", "card", "input", "label"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"button",
"card",
"input",
"label"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/password-based-auth-tanstack/routes/login.tsx",
@@ -296,8 +324,14 @@
"type": "registry:block",
"title": "Social Auth flow for Nextjs and Supabase",
"description": "Social Auth flow for Nextjs and Supabase",
"registryDependencies": ["button", "card"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"button",
"card"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/social-auth-nextjs/app/auth/login/page.tsx",
@@ -356,7 +390,10 @@
"type": "registry:block",
"title": "Social Auth flow for React and Supabase",
"description": "Social Auth flow for React and Supabase",
"registryDependencies": ["button", "card"],
"registryDependencies": [
"button",
"card"
],
"files": [
{
"path": "registry/default/blocks/social-auth-react/components/login-form.tsx",
@@ -367,7 +404,9 @@
"type": "registry:lib"
}
],
"dependencies": ["@supabase/supabase-js@latest"],
"dependencies": [
"@supabase/supabase-js@latest"
],
"docs": "You'll need to set the following environment variables in your project: `VITE_SUPABASE_URL` and `VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY`.",
"envVars": {
"VITE_SUPABASE_URL": "",
@@ -379,7 +418,10 @@
"type": "registry:block",
"title": "Social Auth flow for React Router and Supabase",
"description": "Social Auth flow for React Router and Supabase",
"registryDependencies": ["button", "card"],
"registryDependencies": [
"button",
"card"
],
"dependencies": [
"@supabase/ssr@latest",
"@react-router/dev@latest",
@@ -437,8 +479,14 @@
"type": "registry:block",
"title": "Social Auth flow for TanStack and Supabase",
"description": "Social Auth flow for TanStack and Supabase",
"registryDependencies": ["button", "card"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"button",
"card"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/social-auth-tanstack/components/login-form.tsx",
@@ -494,7 +542,9 @@
"type": "registry:component",
"title": "Dropzone (File Upload)",
"description": "Displays a control for easier uploading of files directly to Supabase Storage.",
"registryDependencies": ["button"],
"registryDependencies": [
"button"
],
"dependencies": [
"react-dropzone",
"lucide-react",
@@ -535,8 +585,14 @@
"type": "registry:component",
"title": "Dropzone (File Upload)",
"description": "Displays a control for easier uploading of files directly to Supabase Storage.",
"registryDependencies": ["button"],
"dependencies": ["react-dropzone", "lucide-react", "@supabase/supabase-js@latest"],
"registryDependencies": [
"button"
],
"dependencies": [
"react-dropzone",
"lucide-react",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/dropzone/components/dropzone.tsx",
@@ -563,7 +619,9 @@
"type": "registry:component",
"title": "Dropzone (File Upload)",
"description": "Displays a control for easier uploading of files directly to Supabase Storage.",
"registryDependencies": ["button"],
"registryDependencies": [
"button"
],
"dependencies": [
"react-dropzone",
"lucide-react",
@@ -600,7 +658,9 @@
"type": "registry:component",
"title": "Dropzone (File Upload)",
"description": "Displays a control for easier uploading of files directly to Supabase Storage.",
"registryDependencies": ["button"],
"registryDependencies": [
"button"
],
"dependencies": [
"react-dropzone",
"lucide-react",
@@ -638,7 +698,11 @@
"title": "Realtime Cursor",
"description": "Component which renders realtime cursors from other users in a room.",
"registryDependencies": [],
"dependencies": ["lucide-react", "@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"dependencies": [
"lucide-react",
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-cursor/components/cursor.tsx",
@@ -678,7 +742,10 @@
"title": "Realtime Cursor",
"description": "Component which renders realtime cursors from other users in a room.",
"registryDependencies": [],
"dependencies": ["lucide-react", "@supabase/supabase-js@latest"],
"dependencies": [
"lucide-react",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-cursor/components/cursor.tsx",
@@ -710,7 +777,11 @@
"title": "Realtime Cursor",
"description": "Component which renders realtime cursors from other users in a room.",
"registryDependencies": [],
"dependencies": ["lucide-react", "@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"dependencies": [
"lucide-react",
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-cursor/components/cursor.tsx",
@@ -746,7 +817,11 @@
"title": "Realtime Cursor",
"description": "Component which renders realtime cursors from other users in a room.",
"registryDependencies": [],
"dependencies": ["lucide-react", "@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"dependencies": [
"lucide-react",
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-cursor/components/cursor.tsx",
@@ -781,8 +856,13 @@
"type": "registry:component",
"title": "Current User Avatar",
"description": "Component which renders the current user's avatar.",
"registryDependencies": ["avatar"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"avatar"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/current-user-avatar/components/current-user-avatar.tsx",
@@ -821,8 +901,12 @@
"type": "registry:component",
"title": "Current User Avatar",
"description": "Component which renders the current user's avatar.",
"registryDependencies": ["avatar"],
"dependencies": ["@supabase/supabase-js@latest"],
"registryDependencies": [
"avatar"
],
"dependencies": [
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/current-user-avatar/components/current-user-avatar.tsx",
@@ -853,8 +937,13 @@
"type": "registry:component",
"title": "Current User Avatar",
"description": "Component which renders the current user's avatar.",
"registryDependencies": ["avatar"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"avatar"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/current-user-avatar/components/current-user-avatar.tsx",
@@ -889,8 +978,13 @@
"type": "registry:component",
"title": "Current User Avatar",
"description": "Component which renders the current user's avatar.",
"registryDependencies": ["avatar"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"avatar"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/current-user-avatar/components/current-user-avatar.tsx",
@@ -925,8 +1019,14 @@
"type": "registry:component",
"title": "Avatar Stack with Realtime Presence",
"description": "Component which stack of avatars, tracked by realtime presence.",
"registryDependencies": ["avatar", "tooltip"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"avatar",
"tooltip"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-avatar-stack/components/avatar-stack.tsx",
@@ -973,8 +1073,13 @@
"type": "registry:component",
"title": "Avatar Stack with Realtime Presence",
"description": "Component which stack of avatars, tracked by realtime presence.",
"registryDependencies": ["avatar", "tooltip"],
"dependencies": ["@supabase/supabase-js@latest"],
"registryDependencies": [
"avatar",
"tooltip"
],
"dependencies": [
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-avatar-stack/components/avatar-stack.tsx",
@@ -1013,8 +1118,14 @@
"type": "registry:component",
"title": "Avatar Stack with Realtime Presence",
"description": "Component which stack of avatars, tracked by realtime presence.",
"registryDependencies": ["avatar", "tooltip"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"avatar",
"tooltip"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-avatar-stack/components/avatar-stack.tsx",
@@ -1057,8 +1168,14 @@
"type": "registry:component",
"title": "Avatar Stack with Realtime Presence",
"description": "Component which stack of avatars, tracked by realtime presence.",
"registryDependencies": ["avatar", "tooltip"],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"avatar",
"tooltip"
],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-avatar-stack/components/avatar-stack.tsx",
@@ -1101,8 +1218,15 @@
"type": "registry:component",
"title": "Realtime Chat",
"description": "Component which renders realtime chat messages from other users in a room.",
"registryDependencies": ["input", "button"],
"dependencies": ["lucide-react", "@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"input",
"button"
],
"dependencies": [
"lucide-react",
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-chat/components/chat-message.tsx",
@@ -1145,8 +1269,14 @@
"type": "registry:component",
"title": "Realtime Chat",
"description": "Component which renders realtime chat messages from other users in a room.",
"registryDependencies": ["input", "button"],
"dependencies": ["lucide-react", "@supabase/supabase-js@latest"],
"registryDependencies": [
"input",
"button"
],
"dependencies": [
"lucide-react",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-chat/components/chat-message.tsx",
@@ -1181,8 +1311,15 @@
"type": "registry:component",
"title": "Realtime Chat",
"description": "Component which renders realtime chat messages from other users in a room.",
"registryDependencies": ["input", "button"],
"dependencies": ["lucide-react", "@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"input",
"button"
],
"dependencies": [
"lucide-react",
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-chat/components/chat-message.tsx",
@@ -1221,8 +1358,15 @@
"type": "registry:component",
"title": "Realtime Chat",
"description": "Component which renders realtime chat messages from other users in a room.",
"registryDependencies": ["input", "button"],
"dependencies": ["lucide-react", "@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"registryDependencies": [
"input",
"button"
],
"dependencies": [
"lucide-react",
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"files": [
{
"path": "registry/default/blocks/realtime-chat/components/chat-message.tsx",
@@ -1261,7 +1405,10 @@
"type": "registry:block",
"title": "Infinite Query Hook",
"description": "React hook for infinite lists, fetching data from Supabase.",
"dependencies": ["@supabase/supabase-js", "@supabase/postgrest-js@*"],
"dependencies": [
"@supabase/supabase-js",
"@supabase/postgrest-js@*"
],
"registryDependencies": [],
"files": [
{
@@ -1277,7 +1424,10 @@
"title": "Supabase Client for Next.js",
"description": "",
"registryDependencies": [],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"docs": "You'll need to set the following environment variables in your project: `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY`.",
"envVars": {
"NEXT_PUBLIC_SUPABASE_URL": "",
@@ -1305,7 +1455,9 @@
"title": "Supabase Client for React",
"description": "",
"registryDependencies": [],
"dependencies": ["@supabase/supabase-js@latest"],
"dependencies": [
"@supabase/supabase-js@latest"
],
"docs": "You'll need to set the following environment variables in your project: `VITE_SUPABASE_URL` and `VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY`.",
"envVars": {
"VITE_SUPABASE_URL": "",
@@ -1325,7 +1477,10 @@
"title": "Supabase Client for React Router",
"description": "",
"registryDependencies": [],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"docs": "You'll need to set the following environment variables in your project: `VITE_SUPABASE_URL` and `VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY`.",
"envVars": {
"VITE_SUPABASE_URL": "",
@@ -1349,7 +1504,10 @@
"title": "Supabase Client for TanStack Start",
"description": "",
"registryDependencies": [],
"dependencies": ["@supabase/ssr@latest", "@supabase/supabase-js@latest"],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"docs": "You'll need to set the following environment variables in your project: `VITE_SUPABASE_URL` and `VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY`.",
"envVars": {
"VITE_SUPABASE_URL": "",
@@ -1543,6 +1701,66 @@
}
]
},
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "supabase-client-nuxtjs",
"type": "registry:lib",
"title": "Supabase Client for Nuxt.js",
"description": "",
"registryDependencies": [],
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"docs": "You'll need to set the following environment variables in your project: `NUXT_PUBLIC_SUPABASE_URL` and `NUXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY`.",
"envVars": {
"NUXT_PUBLIC_SUPABASE_URL": "",
"NUXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY": ""
},
"files": [
{
"path": "registry/default/clients/nuxtjs/lib/supabase/client.ts",
"type": "registry:lib"
},
{
"path": "registry/default/clients/nuxtjs/server/middleware/is-authenticated.ts",
"type": "registry:file",
"target": "server/middleware/is-authenticated.ts"
},
{
"path": "registry/default/clients/nuxtjs/server/api/profile.get.ts",
"type": "registry:file",
"target": "server/api/profile.get.ts"
},
{
"path": "registry/default/clients/nuxtjs/server/supabase/client.ts",
"type": "registry:file",
"target": "server/supabase/client.ts"
}
]
},
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "supabase-client-vue",
"type": "registry:lib",
"title": "Supabase Client for Vue",
"description": "",
"registryDependencies": [],
"dependencies": [
"@supabase/supabase-js@latest"
],
"docs": "You'll need to set the following environment variables in your project: `VITE_SUPABASE_URL` and `VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY`.",
"envVars": {
"VITE_SUPABASE_URL": "",
"VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY": ""
},
"files": [
{
"path": "registry/default/clients/vue/lib/supabase/client.ts",
"type": "registry:lib"
}
]
},
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "ai-editor-rules",
@@ -1585,4 +1803,4 @@
]
}
]
}
}

View File

@@ -1,4 +1,4 @@
import { type Registry, type RegistryItem } from 'shadcn/registry'
import { type RegistryItem } from 'shadcn/schema'
import { clients } from './clients'
import { registryItemAppend } from './utils'
@@ -19,7 +19,7 @@ import socialAuthReactRouter from './default/blocks/social-auth-react-router/reg
import socialAuthReact from './default/blocks/social-auth-react/registry-item.json' with { type: 'json' }
import socialAuthTanstack from './default/blocks/social-auth-tanstack/registry-item.json' with { type: 'json' }
const combine = (component: Registry['items'][number]) => {
const combine = (component: RegistryItem) => {
return clients.flatMap((client) => {
return registryItemAppend(
{
@@ -54,4 +54,4 @@ export const blocks = [
...combine(realtimeChat as RegistryItem),
// infinite query hook is intentionally not combined with the clients since it depends on clients having database types.
infiniteQueryHook as RegistryItem,
] as Registry['items']
] as RegistryItem[]

View File

@@ -1,7 +1,7 @@
import { type Registry } from 'shadcn/registry'
import type { RegistryItem } from 'shadcn/schema'
import nextjs from './default/clients/nextjs/registry-item.json' with { type: 'json' }
import reactRouter from './default/clients/react-router/registry-item.json' with { type: 'json' }
import react from './default/clients/react/registry-item.json' with { type: 'json' }
import tanstack from './default/clients/tanstack/registry-item.json' with { type: 'json' }
export const clients = [nextjs, react, reactRouter, tanstack] as Registry['items']
export const clients = [nextjs, react, reactRouter, tanstack] as RegistryItem[]

View File

@@ -1,6 +1,6 @@
import { type Registry } from 'shadcn/registry'
import type { RegistryItem } from 'shadcn/schema'
export const examples: Registry['items'] = [
export const examples: RegistryItem[] = [
{
name: 'dropzone-demo',
type: 'registry:example',

View File

@@ -1,7 +1,7 @@
import { type Registry } from 'shadcn/registry'
import { type Registry, type RegistryItem } from 'shadcn/schema'
import { examples } from '@/registry/examples'
import type { RegistryItem } from 'shadcn/registry'
import { blocks as vueBlocks } from '@supabase/vue-blocks'
import { blocks } from './blocks'
import { clients } from './clients'
import aiEditorRules from './default/ai-editor-rules/registry-item.json' with { type: 'json' }
@@ -14,6 +14,7 @@ export const registry = {
...blocks,
...clients,
...platform,
...vueBlocks,
aiEditorRules as RegistryItem,
// Internal use only.

View File

@@ -1,5 +1,5 @@
import { type Registry, type RegistryItem } from 'shadcn/registry'
import { type RegistryItem } from 'shadcn/schema'
import embeddedDashboardNextjs from './default/platform/platform-kit-nextjs/registry-item.json' with { type: 'json' }
export const platform = [embeddedDashboardNextjs as RegistryItem] as Registry['items']
export const platform = [embeddedDashboardNextjs] as RegistryItem[]

View File

@@ -1,8 +1,8 @@
import lodash from 'lodash'
import { Registry } from 'shadcn/registry'
import type { RegistryItem } from 'shadcn/schema'
const { uniq, uniqBy } = lodash
const registryItemAppend = (item: Registry['items'][number], items: Registry['items']) => {
const registryItemAppend = (item: RegistryItem, items: RegistryItem[]) => {
const neededRegDependencies = [
...(item.registryDependencies || []),
...items.flatMap((i) => i.registryDependencies),

View File

@@ -6,7 +6,7 @@ import { fileURLToPath } from 'url'
import { registry } from '../registry/index'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const registryPath = path.join(__dirname, '..', 'registry.json')
const registryPath = path.join(__dirname, '..', 'public', 'r', 'registry.json')
const cleanedRegistry = {
$schema: 'https://ui.shadcn.com/schema/registry.json',

View File

@@ -18,6 +18,8 @@ function processJsonFile(filePath: string) {
"import { Link } from '@/registry/default/components/ui/link'",
"import Link from 'next/link'"
)
// Replace the file origin path to exclude the monorepo structure
.replaceAll('node_modules/@supabase/vue-blocks/', '')
// Write back to file
fs.writeFileSync(filePath, stringified)

14
blocks/vue/index.ts Normal file
View File

@@ -0,0 +1,14 @@
import { blocks as originBlocks } from './registry/index'
const blocks = originBlocks.map((item) => {
const newItem = { ...item }
newItem.files = newItem.files?.map((file) => {
if (file.path.startsWith('registry/')) {
return { ...file, path: `node_modules/@supabase/vue-blocks/${file.path}` }
}
return file
})
return newItem
})
export { blocks }

View File

@@ -3,9 +3,9 @@
"version": "0.1.0",
"private": true,
"type": "module",
"exports": "./index.ts",
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "prettier --cache --write registry.json && rimraf -G public/r && shadcn build && tsx scripts/clean-registry.ts",
"clean": "rimraf node_modules .next .turbo",
"typecheck": "tsc --noEmit -p tsconfig.json"
},
@@ -16,7 +16,7 @@
"@supabase/supabase-js": "^2.49.1"
},
"devDependencies": {
"shadcn": "^2.10.0",
"shadcn": "^3.0.0",
"tsconfig": "workspace:*",
"vite": "catalog:"
}

View File

@@ -1,42 +0,0 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "supabase-client-nuxtjs",
"type": "registry:lib",
"title": "Supabase Client for Nuxt.js",
"description": "",
"dependencies": [
"@supabase/ssr@latest",
"@supabase/supabase-js@latest"
],
"registryDependencies": [],
"files": [
{
"path": "registry/default/clients/nuxtjs/lib/supabase/client.ts",
"content": "import { createBrowserClient } from '@supabase/ssr'\n\nexport function createClient() {\n return createBrowserClient(\n process.env.NUXT_PUBLIC_SUPABASE_URL!,\n process.env.NUXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY!\n )\n}\n",
"type": "registry:lib"
},
{
"path": "registry/default/clients/nuxtjs/server/middleware/is-authenticated.ts",
"content": "import { defineNuxtRouteMiddleware, navigateTo, useRequestEvent } from 'nuxt/app'\nimport { createSupabaseServerClient } from '../supabase/client'\n\nexport default defineNuxtRouteMiddleware(async (to) => {\n const event = useRequestEvent()\n\n // create Supabase SSR client directly here\n const supabase = createSupabaseServerClient(event);\n\n // check current user\n const { data: { user } } = await supabase.auth.getUser()\n\n if (!user && to.path !== '/login') {\n return navigateTo('/login')\n }\n})\n",
"type": "registry:file",
"target": "server/middleware/is-authenticated.ts"
},
{
"path": "registry/default/clients/nuxtjs/server/api/profile.get.ts",
"content": "import { createError, defineEventHandler } from 'h3';\nimport { createSupabaseServerClient } from '../supabase/client';\n\nexport default defineEventHandler(async (event) => {\n // Create Supabase SSR client\n const supabase = createSupabaseServerClient(event)\n\n // Example: get user session\n const {\n data: { user },\n } = await supabase.auth.getUser();\n\n if (!user) {\n return { error: 'Not authenticated' };\n }\n\n // Fetch profile row\n const { data, error } = await supabase\n .from('profiles')\n .select('*')\n .eq('id', user.id)\n .single();\n\n if (error) {\n throw createError({ statusCode: 500, statusMessage: error.message });\n }\n\n return { profile: data };\n});\n",
"type": "registry:file",
"target": "server/api/profile.get.ts"
},
{
"path": "registry/default/clients/nuxtjs/server/supabase/client.ts",
"content": "import { createServerClient } from '@supabase/ssr'\nimport { getCookie, setCookie, deleteCookie, H3Event, EventHandlerRequest } from 'h3'\n\nexport const createSupabaseServerClient = (event: H3Event<EventHandlerRequest> | undefined) => {\n return createServerClient(\n process.env.NUXT_PUBLIC_SUPABASE_URL!,\n process.env.NUXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY!,\n {\n cookies: {\n get: (key) => getCookie(event!, key),\n set: (key, value, options) => setCookie(event!, key, value, options),\n remove: (key, options) => deleteCookie(event!, key, options),\n },\n }\n )\n}",
"type": "registry:file",
"target": "server/supabase/client.ts"
}
],
"envVars": {
"NUXT_PUBLIC_SUPABASE_URL": "",
"NUXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY": ""
},
"docs": "You'll need to set the following environment variables in your project: `NUXT_PUBLIC_SUPABASE_URL` and `NUXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY`."
}

View File

@@ -1,23 +0,0 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "supabase-client-vue",
"type": "registry:lib",
"title": "Supabase Client for Vue",
"description": "",
"dependencies": [
"@supabase/supabase-js@latest"
],
"registryDependencies": [],
"files": [
{
"path": "registry/default/clients/vue/lib/supabase/client.ts",
"content": "/// <reference types=\"vite/types/importMeta.d.ts\" />\nimport { createClient as createSupabaseClient } from '@supabase/supabase-js'\n\nexport function createClient() {\n return createSupabaseClient(\n import.meta.env.VITE_SUPABASE_URL!,\n import.meta.env.VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY!\n )\n}\n",
"type": "registry:lib"
}
],
"envVars": {
"VITE_SUPABASE_URL": "",
"VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY": ""
},
"docs": "You'll need to set the following environment variables in your project: `VITE_SUPABASE_URL` and `VITE_SUPABASE_PUBLISHABLE_OR_ANON_KEY`."
}

View File

@@ -1,5 +1,6 @@
import { type Registry } from 'shadcn/registry'
import { type RegistryItem } from 'shadcn/schema'
import nuxtjs from './default/clients/nuxtjs/registry-item.json' with { type: 'json' }
import vue from './default/clients/vue/registry-item.json' with { type: 'json' }
export const clients = [nuxtjs, vue] as Registry['items']
export const clients = [nuxtjs, vue] as RegistryItem[]

View File

@@ -1,9 +1,5 @@
import { type Registry } from 'shadcn/registry'
import { clients } from './clients'
export const registry = {
name: 'Supabase UI Library',
homepage: 'https://supabase.com/ui',
items: [...clients],
} satisfies Registry
const blocks = [...clients]
export { blocks }

View File

@@ -1,55 +0,0 @@
import * as fs from 'fs'
import * as path from 'path'
function processJsonFile(filePath: string) {
try {
// Read the file
const content = fs.readFileSync(filePath, 'utf8')
const json = JSON.parse(content)
// Convert to string to do replacement
let stringified = JSON.stringify(json, null, 2)
// Perform the replacement
stringified = stringified
.replace(/\/ui\/example\/password-based-auth/g, '')
.replace(/\/example\/password-based-auth/g, '')
.replaceAll(
"import { Link } from '@/registry/default/components/ui/link'",
"import Link from 'next/link'"
)
// Write back to file
fs.writeFileSync(filePath, stringified)
console.log(`✓ Updated ${filePath}`)
} catch (error) {
console.error(`Error processing ${filePath}:`, error)
}
}
function processDirectory(directoryPath: string) {
const files = fs.readdirSync(directoryPath)
files.forEach((file) => {
const fullPath = path.join(directoryPath, file)
const stat = fs.statSync(fullPath)
if (stat.isDirectory()) {
processDirectory(fullPath)
} else if (path.extname(file) === '.json') {
processJsonFile(fullPath)
}
})
}
// Start processing from the specified directory
const targetDir = path.join(process.cwd(), 'public/r')
if (!fs.existsSync(targetDir)) {
console.error('Target directory does not exist:', targetDir)
process.exit(1)
}
console.log('Starting JSON file processing...')
processDirectory(targetDir)
console.log('Processing complete!')

1195
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -38,8 +38,6 @@ minimumReleaseAge: 10080
minimumReleaseAgeExclude:
- ai
- '@ai-sdk/*'
- '@supabase/mcp-server-supabase'
- '@supabase/mcp-utils'
- '@supabase/*'
onlyBuiltDependencies: