Skip to content

Commit

Permalink
chore: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Oct 27, 2023
1 parent 2031f7f commit 9c9a604
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/next-app-router/app/RefreshButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useRouter } from 'next/navigation'
import { useEffect, useTransition } from 'react'
import { experimental_useFormStatus as useFormStatus } from 'react-dom'
import { useFormStatus } from 'react-dom'
import { Button } from 'ui/react'
import { revalidate } from './actions'
import { useIsEnabled } from '@sanity/preview-kit'
Expand Down
5 changes: 1 addition & 4 deletions apps/next-app-router/app/sanity.fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ const DEFAULT_TAGS = [] as string[]
export async function sanityFetch<QueryResponse>({
query,
params = DEFAULT_PARAMS,
cache = 'force-cache',
tags = DEFAULT_TAGS,
}: {
query: string
params?: QueryParams
cache?: RequestCache
tags: string[]
}): Promise<QueryResponse> {
const isDraftMode = draftMode().isEnabled
Expand All @@ -28,13 +26,12 @@ export async function sanityFetch<QueryResponse>({
}

return client.fetch<QueryResponse>(query, params, {
cache,
...(isDraftMode && {
token,
perspective: 'previewDrafts',
}),
next: {
...(isDraftMode && { revalidate: 0 }),
revalidate: isDraftMode ? 0 : false,
tags,
},
})
Expand Down
7 changes: 3 additions & 4 deletions apps/next-app-router/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import withBundleAnalyzer from '@next/bundle-analyzer'

/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
logging: {
level: 'verbose',
logging: {
fetches: {
fullUrl: true,
},
serverActions: true,
},
serverActions: true,
productionBrowserSourceMaps: true,
}

Expand Down
1 change: 1 addition & 0 deletions apps/next-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@next/bundle-analyzer": "14.0.0",
"@types/node": "^18.18.6",
"@types/react": "^18.2.31",
"@types/react-dom": "^18.2.14",
"eslint-config-next": "14.0.0",
"typescript": "^5.2.2"
},
Expand Down
6 changes: 4 additions & 2 deletions apps/next-pages-router/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import withBundleAnalyzer from '@next/bundle-analyzer'

/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
logging: 'verbose',
logging: {
fetches: {
fullUrl: true,
}
},
productionBrowserSourceMaps: true,
}
Expand Down
1 change: 1 addition & 0 deletions apps/next-pages-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@next/bundle-analyzer": "14.0.0",
"@types/node": "^18.18.6",
"@types/react": "^18.2.31",
"@types/react-dom": "^18.2.14",
"eslint-config-next": "14.0.0",
"typescript": "^5.2.2"
},
Expand Down
1 change: 1 addition & 0 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@sanity/ui": "1.8.2",
"@sanity/vision": "3.18.1",
"@types/react": "^18.2.31",
"@types/react-dom": "^18.2.14",
"esbuild": "^0.19.5",
"esbuild-register": "^3.5.0",
"eslint": "^8.52.0",
Expand Down
1 change: 1 addition & 0 deletions packages/preview-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
"@types/lodash.isplainobject": "^4.0.8",
"@types/node": "^18.18.6",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@types/use-sync-external-store": "^0.0.5",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"devDependencies": {
"@sanity/pkg-utils": "^3.1.1",
"@types/react": "^18.2.31",
"@types/react-dom": "^18.2.14",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"eslint": "^8.52.0",
Expand Down
16 changes: 15 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 comments on commit 9c9a604

@vercel
Copy link

@vercel vercel bot commented on 9c9a604 Oct 27, 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 9c9a604 Oct 27, 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 9c9a604 Oct 27, 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 9c9a604 Oct 27, 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.sanity.build
preview-kit-next-app-router-git-main.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 9c9a604 Oct 27, 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 9c9a604 Oct 27, 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 9c9a604 Oct 27, 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.sanity.build
preview-kit-next-app-router-live-store-git-main.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 9c9a604 Oct 27, 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 9c9a604 Oct 27, 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

@vercel
Copy link

@vercel vercel bot commented on 9c9a604 Oct 27, 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

Please sign in to comment.