From 40db7a7ca6c6614b15b8c0623b811d820187d949 Mon Sep 17 00:00:00 2001
From: "ecospark[bot]" <128108030+ecospark[bot]@users.noreply.github.com>
Date: Thu, 16 Nov 2023 02:11:34 +0100
Subject: [PATCH] =?UTF-8?q?chore(prettier):=20=F0=9F=A4=96=20=E2=9C=A8=20(?=
=?UTF-8?q?#673)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
---
.../variants/live-store/PreviewProvider.tsx | 10 ++++----
.../app/variants/live-store/VisualEditing.tsx | 5 ++--
apps/next-app-router/package.json | 2 +-
apps/next-pages-router/package.json | 2 +-
.../variants/live-store/PreviewProvider.tsx | 10 ++++----
.../src/variants/live-store/VisualEditing.tsx | 4 ++--
.../variants/live-store/PreviewProvider.tsx | 14 +++++------
.../app/variants/live-store/VisualEditing.tsx | 3 +--
apps/remix/app/variants/live-store/index.tsx | 4 +++-
apps/remix/package.json | 2 +-
apps/studio/package.json | 6 ++---
apps/studio/sanity.config.ts | 24 ++++++++++---------
packages/preview-kit/src/csm/transcode.ts | 4 ++--
13 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/apps/next-app-router/app/variants/live-store/PreviewProvider.tsx b/apps/next-app-router/app/variants/live-store/PreviewProvider.tsx
index 5087e5c6..41deced2 100644
--- a/apps/next-app-router/app/variants/live-store/PreviewProvider.tsx
+++ b/apps/next-app-router/app/variants/live-store/PreviewProvider.tsx
@@ -17,11 +17,11 @@ export default function PreviewProvider({
const { client } = suspend(() => import('./sanity.client'), [UniqueKey])
if (!token) throw new TypeError('Missing token')
return (
-<>
-
- {children}
-
-
+ <>
+
+ {children}
+
+
>
)
}
diff --git a/apps/next-app-router/app/variants/live-store/VisualEditing.tsx b/apps/next-app-router/app/variants/live-store/VisualEditing.tsx
index a1be4c6d..2f4197b2 100644
--- a/apps/next-app-router/app/variants/live-store/VisualEditing.tsx
+++ b/apps/next-app-router/app/variants/live-store/VisualEditing.tsx
@@ -14,7 +14,8 @@ export default function VisualEditing() {
}, [router])
useEffect(() => {
const disable = enableOverlays({
- allowStudioOrigin: process.env.NEXT_PUBLIC_STUDIO_URL || 'http://localhost:3333',
+ allowStudioOrigin:
+ process.env.NEXT_PUBLIC_STUDIO_URL || 'http://localhost:3333',
history: {
subscribe: (navigate) => {
setNavigate(() => navigate)
@@ -48,7 +49,5 @@ export default function VisualEditing() {
}
}, [navigate, pathname, searchParams])
-
-
return null
}
diff --git a/apps/next-app-router/package.json b/apps/next-app-router/package.json
index 7993e030..53f3ab1a 100644
--- a/apps/next-app-router/package.json
+++ b/apps/next-app-router/package.json
@@ -13,13 +13,13 @@
},
"dependencies": {
"@sanity/client": "6.8.6",
+ "@sanity/overlays": "2.0.0",
"@sanity/preview-kit": "workspace:*",
"bulma": "0.9.4",
"groq": "3.19.3",
"groqd": "0.15.10",
"next": "14.0.2",
"react": "18.2.0",
- "@sanity/overlays": "2.0.0",
"react-dom": "18.2.0",
"server-only": "^0.0.1",
"suspend-react": "^0.1.3",
diff --git a/apps/next-pages-router/package.json b/apps/next-pages-router/package.json
index 584251f8..01f86f9a 100644
--- a/apps/next-pages-router/package.json
+++ b/apps/next-pages-router/package.json
@@ -13,11 +13,11 @@
},
"dependencies": {
"@sanity/client": "6.8.6",
+ "@sanity/overlays": "2.0.0",
"@sanity/preview-kit": "workspace:*",
"bulma": "0.9.4",
"groq": "3.19.3",
"groqd": "0.15.10",
- "@sanity/overlays": "2.0.0",
"next": "14.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
diff --git a/apps/next-pages-router/src/variants/live-store/PreviewProvider.tsx b/apps/next-pages-router/src/variants/live-store/PreviewProvider.tsx
index fbe9deed..020aec06 100644
--- a/apps/next-pages-router/src/variants/live-store/PreviewProvider.tsx
+++ b/apps/next-pages-router/src/variants/live-store/PreviewProvider.tsx
@@ -11,11 +11,11 @@ export default function PreviewProvider({
}) {
if (!token) throw new TypeError('Missing token')
return (
-<>
-
- {children}
-
-
+ <>
+
+ {children}
+
+
>
)
}
diff --git a/apps/next-pages-router/src/variants/live-store/VisualEditing.tsx b/apps/next-pages-router/src/variants/live-store/VisualEditing.tsx
index 3204d0ec..52ad9019 100644
--- a/apps/next-pages-router/src/variants/live-store/VisualEditing.tsx
+++ b/apps/next-pages-router/src/variants/live-store/VisualEditing.tsx
@@ -2,7 +2,6 @@ import { HistoryAdapterNavigate, enableOverlays } from '@sanity/overlays'
import { useRouter } from 'next/router'
import { useEffect, useRef, useState } from 'react'
-
export default function VisualEditing() {
const router = useRouter()
const routerRef = useRef(router)
@@ -14,7 +13,8 @@ export default function VisualEditing() {
useEffect(() => {
if (!router.isReady) return
const disable = enableOverlays({
- allowStudioOrigin: process.env.NEXT_PUBLIC_STUDIO_URL || 'http://localhost:3333',
+ allowStudioOrigin:
+ process.env.NEXT_PUBLIC_STUDIO_URL || 'http://localhost:3333',
history: {
subscribe: (navigate) => {
setNavigate(() => navigate)
diff --git a/apps/remix/app/variants/live-store/PreviewProvider.tsx b/apps/remix/app/variants/live-store/PreviewProvider.tsx
index 5019e062..5895e2e7 100644
--- a/apps/remix/app/variants/live-store/PreviewProvider.tsx
+++ b/apps/remix/app/variants/live-store/PreviewProvider.tsx
@@ -15,7 +15,6 @@ export default function PreviewProvider({
if (!token) throw new TypeError('Missing token')
if (!studioUrl) throw new TypeError('Missing studioUrl')
const [client] = useState(() => {
-
const projectId = 'pv8y60vp'
const dataset = 'production'
const apiVersion = '2022-11-15'
@@ -30,14 +29,13 @@ export default function PreviewProvider({
encodeSourceMap: true,
perspective: 'published',
})
-
-
})
- return (<>
-
- {children}
-
-
+ return (
+ <>
+
+ {children}
+
+
>
)
}
diff --git a/apps/remix/app/variants/live-store/VisualEditing.tsx b/apps/remix/app/variants/live-store/VisualEditing.tsx
index cee2ebf6..63b3a61b 100644
--- a/apps/remix/app/variants/live-store/VisualEditing.tsx
+++ b/apps/remix/app/variants/live-store/VisualEditing.tsx
@@ -2,7 +2,7 @@ import { useLocation, useNavigate } from '@remix-run/react'
import { enableOverlays, type HistoryAdapterNavigate } from '@sanity/overlays'
import { useEffect, useRef, useState } from 'react'
-export default function VisualEditing({studioUrl}: {studioUrl: string}) {
+export default function VisualEditing({ studioUrl }: { studioUrl: string }) {
const navigateRemix = useNavigate()
const navigateRemixRef = useRef(navigateRemix)
const [navigate, setNavigate] = useState()
@@ -41,6 +41,5 @@ export default function VisualEditing({studioUrl}: {studioUrl: string}) {
}
}, [location.hash, location.pathname, location.search, navigate])
-
return null
}
diff --git a/apps/remix/app/variants/live-store/index.tsx b/apps/remix/app/variants/live-store/index.tsx
index 4017c1d3..26bb2fd3 100644
--- a/apps/remix/app/variants/live-store/index.tsx
+++ b/apps/remix/app/variants/live-store/index.tsx
@@ -12,7 +12,9 @@ export default function LiveStoreVariant({
studioUrl,
}: SerializeFrom & React.PropsWithChildren) {
return previewDrafts ? (
- {children}
+
+ {children}
+
) : (
children
)
diff --git a/apps/remix/package.json b/apps/remix/package.json
index 4bfe1f45..386515c4 100644
--- a/apps/remix/package.json
+++ b/apps/remix/package.json
@@ -13,6 +13,7 @@
"@remix-run/node": "1.19.3",
"@remix-run/react": "1.19.3",
"@sanity/client": "6.8.6",
+ "@sanity/overlays": "2.0.0",
"@sanity/preview-kit": "workspace:*",
"@vercel/remix": "1.19.3",
"groq": "3.19.3",
@@ -20,7 +21,6 @@
"isbot": "latest",
"react": "18.2.0",
"react-dom": "18.2.0",
- "@sanity/overlays": "2.0.0",
"ui": "workspace:*"
},
"devDependencies": {
diff --git a/apps/studio/package.json b/apps/studio/package.json
index 41894c2d..0514a7fb 100644
--- a/apps/studio/package.json
+++ b/apps/studio/package.json
@@ -3,8 +3,8 @@
"version": "1.0.0",
"private": true,
"scripts": {
- "dev": "sanity dev",
- "build": "sanity build"
+ "build": "sanity build",
+ "dev": "sanity dev"
},
"dependencies": {
"@faker-js/faker": "8.3.1",
@@ -14,8 +14,8 @@
"@sanity/preview-kit": "workspace:*",
"@sanity/ui": "1.9.3",
"@sanity/vision": "3.19.3",
- "@types/react-dom": "^18.2.15",
"@types/react": "^18.2.37",
+ "@types/react-dom": "^18.2.15",
"esbuild": "^0.19.5",
"esbuild-register": "^3.5.0",
"eslint": "^8.53.0",
diff --git a/apps/studio/sanity.config.ts b/apps/studio/sanity.config.ts
index 2154dcc1..cfe4392e 100644
--- a/apps/studio/sanity.config.ts
+++ b/apps/studio/sanity.config.ts
@@ -57,27 +57,29 @@ const config = defineConfig({
previewUrl: {
origin: process.env.SANITY_STUDIO_REMIX_URL || 'http://localhost:3002',
draftMode: {
- enable: '/api/draft'
- }
- }
+ enable: '/api/draft',
+ },
+ },
}),
presentationTool({
name: 'pages-router',
previewUrl: {
- origin: process.env.SANITY_STUDIO_PAGES_ROUTER_URL || 'http://localhost:3000',
+ origin:
+ process.env.SANITY_STUDIO_PAGES_ROUTER_URL || 'http://localhost:3000',
draftMode: {
- enable: '/api/draft'
- }
- }
+ enable: '/api/draft',
+ },
+ },
}),
presentationTool({
name: 'app-router',
previewUrl: {
- origin: process.env.SANITY_STUDIO_APP_ROUTER_URL || 'http://localhost:3001',
+ origin:
+ process.env.SANITY_STUDIO_APP_ROUTER_URL || 'http://localhost:3001',
draftMode: {
- enable: '/api/draft'
- }
- }
+ enable: '/api/draft',
+ },
+ },
}),
benchmarkTool(),
visionTool(),
diff --git a/packages/preview-kit/src/csm/transcode.ts b/packages/preview-kit/src/csm/transcode.ts
index d4c264d9..31377785 100644
--- a/packages/preview-kit/src/csm/transcode.ts
+++ b/packages/preview-kit/src/csm/transcode.ts
@@ -137,8 +137,8 @@ function prettyPathForLogging(path: PathSegment[]): string {
typeof segment === 'number'
? `[${segment}]`
: index > 0
- ? `.${segment}`
- : segment,
+ ? `.${segment}`
+ : segment,
)
.join('')
}