Skip to content

Commit

Permalink
chore(prettier): πŸ€– ✨ (#673)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ecospark[bot] and github-actions[bot] committed Nov 16, 2023
1 parent ef08bf6 commit 40db7a7
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 45 deletions.
10 changes: 5 additions & 5 deletions apps/next-app-router/app/variants/live-store/PreviewProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export default function PreviewProvider({
const { client } = suspend(() => import('./sanity.client'), [UniqueKey])
if (!token) throw new TypeError('Missing token')
return (
<>
<LiveQueryProvider client={client} token={token} logger={console}>
{children}
</LiveQueryProvider>
<VisualEditing />
<>
<LiveQueryProvider client={client} token={token} logger={console}>
{children}
</LiveQueryProvider>
<VisualEditing />
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -48,7 +49,5 @@ export default function VisualEditing() {
}
}, [navigate, pathname, searchParams])



return null
}
2 changes: 1 addition & 1 deletion apps/next-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion apps/next-pages-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default function PreviewProvider({
}) {
if (!token) throw new TypeError('Missing token')
return (
<>
<LiveQueryProvider client={client} token={token} logger={console}>
{children}
</LiveQueryProvider>
<VisualEditing />
<>
<LiveQueryProvider client={client} token={token} logger={console}>
{children}
</LiveQueryProvider>
<VisualEditing />
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
14 changes: 6 additions & 8 deletions apps/remix/app/variants/live-store/PreviewProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -30,14 +29,13 @@ export default function PreviewProvider({
encodeSourceMap: true,
perspective: 'published',
})


})
return (<>
<LiveQueryProvider client={client} token={token} logger={console}>
{children}
</LiveQueryProvider>
<VisualEditing studioUrl={studioUrl} />
return (
<>
<LiveQueryProvider client={client} token={token} logger={console}>
{children}
</LiveQueryProvider>
<VisualEditing studioUrl={studioUrl} />
</>
)
}
3 changes: 1 addition & 2 deletions apps/remix/app/variants/live-store/VisualEditing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HistoryAdapterNavigate | undefined>()
Expand Down Expand Up @@ -41,6 +41,5 @@ export default function VisualEditing({studioUrl}: {studioUrl: string}) {
}
}, [location.hash, location.pathname, location.search, navigate])


return null
}
4 changes: 3 additions & 1 deletion apps/remix/app/variants/live-store/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export default function LiveStoreVariant({
studioUrl,
}: SerializeFrom<typeof loader> & React.PropsWithChildren) {
return previewDrafts ? (
<PreviewProvider token={token!} studioUrl={studioUrl}>{children}</PreviewProvider>
<PreviewProvider token={token!} studioUrl={studioUrl}>
{children}
</PreviewProvider>
) : (
children
)
Expand Down
2 changes: 1 addition & 1 deletion apps/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"@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",
"groqd": "0.15.10",
"isbot": "latest",
"react": "18.2.0",
"react-dom": "18.2.0",
"@sanity/overlays": "2.0.0",
"ui": "workspace:*"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
24 changes: 13 additions & 11 deletions apps/studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions packages/preview-kit/src/csm/transcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ function prettyPathForLogging(path: PathSegment[]): string {
typeof segment === 'number'
? `[${segment}]`
: index > 0
? `.${segment}`
: segment,
? `.${segment}`
: segment,
)
.join('')
}

10 comments on commit 40db7a7

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-next-app-router-groq-store – ./apps/next-app-router

preview-kit-next-app-router-groq-store.sanity.build
preview-kit-next-app-router-groq-store-git-main.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-remix-groq-store – ./apps/remix

preview-kit-remix-groq-store-git-main.sanity.build
preview-kit-remix-groq-store.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-next-app-router – ./apps/next-app-router

preview-kit-next-app-router-git-main.sanity.build
preview-kit-next-app-router.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-next-pages-router-groq-store – ./apps/next-pages-router

preview-kit-next-pages-router-groq-store-git-main.sanity.build
preview-kit-next-pages-router-groq-store.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-test-studio – ./apps/studio

preview-kit-test-studio-git-main.sanity.build
preview-kit-test-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-next-app-router-live-store – ./apps/next-app-router

preview-kit-next-app-router-live-store-git-main.sanity.build
preview-kit-next-app-router-live-store.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-remix – ./apps/remix

preview-kit-remix.sanity.build
preview-kit-remix-git-main.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-next-pages-router-live-store – ./apps/next-pages-router

preview-kit-next-pages-router-live-store.sanity.build
preview-kit-next-pages-router-live-store-git-main.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-next-pages-router – ./apps/next-pages-router

preview-kit-next-pages-router.sanity.build
preview-kit-next-pages-router-git-main.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 40db7a7 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

preview-kit-remix-live-store – ./apps/remix

preview-kit-remix-live-store.sanity.build
preview-kit-remix-live-store-git-main.sanity.build

Please sign in to comment.