chore: Fix iframes for Library (#34438)

* Fix the installation urls in production.

* Enable SAMEORIGIN for iframes on supabase.com.

* Remove extra config.
This commit is contained in:
Ivan Vasilov
2025-03-26 18:04:07 +02:00
committed by GitHub
parent d7e8f6aced
commit 3c0cb1a4e7
5 changed files with 3 additions and 21 deletions

View File

@@ -6,7 +6,6 @@ import remarkGfm from 'remark-gfm'
import configureBundleAnalyzer from '@next/bundle-analyzer'
import withYaml from 'next-plugin-yaml'
import codeHikeTheme from 'config/code-hike.theme.json' with { type: 'json' }
import remotePatterns from './lib/remotePatterns.js'
const withBundleAnalyzer = configureBundleAnalyzer({
@@ -78,7 +77,7 @@ const nextConfig = {
},
{
key: 'X-Frame-Options',
value: 'DENY',
value: 'SAMEORIGIN',
},
],
has: [

View File

@@ -7,7 +7,7 @@ interface CommandCopyProps {
export function Command({ name }: CommandCopyProps) {
const command = `npx shadcn@latest add ${
process.env.VERCEL_TARGET_ENV === 'production'
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
? `https://supabase.com`
: process.env.VERCEL_TARGET_ENV === 'preview'
? `https://${process.env.VERCEL_PROJECT_PREVIEW_URL}`
: 'http://localhost:3004'

View File

@@ -15,7 +15,7 @@ export function OpenInV0Button({
asChild
>
<a
href={`https://v0.dev/chat/api/open?url=https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}${process.env.NEXT_PUBLIC_BASE_PATH ?? ''}/r/${name}.json`}
href={`https://v0.dev/chat/api/open?url=https://supabase.com${process.env.NEXT_PUBLIC_BASE_PATH ?? ''}/r/${name}.json`}
target="_blank"
rel="noreferrer"
>

View File

@@ -4,22 +4,6 @@ import { withContentlayer } from 'next-contentlayer2'
const nextConfig = {
transpilePackages: ['ui', 'common', 'shared-data', 'icons', 'tsconfig'],
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'avatars.githubusercontent.com',
},
{
protocol: 'https',
hostname: 'images.unsplash.com',
},
{
protocol: 'https',
hostname: 'pbs.twimg.com',
},
],
},
async redirects() {
return [
...(process.env.NEXT_PUBLIC_BASE_PATH?.length

View File

@@ -129,7 +129,6 @@
"NEXT_PUBLIC_BASE_PATH",
"NEXT_PUBLIC_APP_URL",
"VERCEL_TARGET_ENV",
"VERCEL_PROJECT_PRODUCTION_URL",
"VERCEL_PROJECT_PREVIEW_URL",
"NODE_ENV",
"HIDE_TAILWIND_INDICATOR",