Skip to content

Commit

Permalink
chore(prettier): 🤖 ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 18, 2024
1 parent aba05de commit 09eb91f
Show file tree
Hide file tree
Showing 24 changed files with 98 additions and 93 deletions.
6 changes: 3 additions & 3 deletions apps/common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"noFallthroughCasesInSwitch": true,
"paths": {
"@sanity/overlays": ["../../packages/overlays/src"],
"@sanity/react-loader": ["../../packages/react-loader/src"]
}
"@sanity/react-loader": ["../../packages/react-loader/src"],
},
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
41 changes: 21 additions & 20 deletions apps/next-server-only/src/app/(blog)/AuthorAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,34 @@ import Balancer from 'react-wrap-balancer'
const query = /* groq */ `*[_type == "author" && _id == $id][0]`

export async function AuthorAvatar(params: { id: string }) {
const [data,RevalidatePreviewQuery] = await loadQuery<any>({
const [data, RevalidatePreviewQuery] = await loadQuery<any>({
query,
params,
tags: [`author:${params.id}`],
})
const { name = 'Anonymous', image } = data
return (
<><div className="flex items-center">
<div className="relative mr-4 h-12 w-12">
<Image
src={
image?.asset?._ref
? urlForImage(image).height(96).width(96).fit('crop').url()
: 'https://source.unsplash.com/96x96/?face'
}
className="rounded-full"
height={96}
width={96}
alt={image?.alt || ''}
/>
<>
<div className="flex items-center">
<div className="relative mr-4 h-12 w-12">
<Image
src={
image?.asset?._ref
? urlForImage(image).height(96).width(96).fit('crop').url()
: 'https://source.unsplash.com/96x96/?face'
}
className="rounded-full"
height={96}
width={96}
alt={image?.alt || ''}
/>
</div>
<div className="text-xl font-bold">
<Balancer>{name}</Balancer>
</div>
</div>
<div className="text-xl font-bold">
<Balancer>{name}</Balancer>
</div>
</div>
{/* When Draft Mode is enabled this component lets the Sanity Presentation Tool revalidate queries as content changes */}
<RevalidatePreviewQuery />
{/* When Draft Mode is enabled this component lets the Sanity Presentation Tool revalidate queries as content changes */}
<RevalidatePreviewQuery />
</>
)
}
Expand Down
6 changes: 5 additions & 1 deletion apps/next-server-only/src/app/(blog)/MoreStories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export default async function MoreStories(params: {
skip: string
limit: number
}) {
const [data,RevalidatePreviewQuery] = await loadQuery<any>({ query, params, tags: ['post'] })
const [data, RevalidatePreviewQuery] = await loadQuery<any>({
query,
params,
tags: ['post'],
})

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ export function RevalidateQuery(props: RevalidateQueryProps) {
snapshot.perspective === perspective &&
snapshotRef.current.data &&
!isEqual(snapshotRef.current.data, snapshot.data)
) {
clearTimeout(revalidateRef.current)
revalidate({tags})
revalidateRef.current = window.setTimeout(() => {
revalidate({tags})
}, 1000)
}
snapshotRef.current = snapshot
}, [perspective, snapshot, tags])
) {
clearTimeout(revalidateRef.current)
revalidate({ tags })
revalidateRef.current = window.setTimeout(() => {
revalidate({ tags })
}, 1000)
}
snapshotRef.current = snapshot
}, [perspective, snapshot, tags])

/*
/*
const [shouldRevalidate, setShouldRevalidate] = useState(false)
const revalidating = useRef(false)
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { revalidateTag } from 'next/cache'
import { draftMode } from 'next/headers'

export async function revalidate({ tags }: { tags: string[] }) {
if(draftMode().isEnabled) {
if (draftMode().isEnabled) {
for (const tag of tags) {
await revalidateTag(tag)
}
Expand Down
10 changes: 5 additions & 5 deletions apps/next-server-only/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"incremental": true,
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"paths": {
"@/*": ["./src/*"]
}
"@/*": ["./src/*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
12 changes: 6 additions & 6 deletions apps/next/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
"incremental": true,
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"rootDir": "../..",
"paths": {
"@/*": ["./src/*"],
"@sanity/overlays": ["../../packages/overlays/src"],
"@sanity/preview-kit-compat": ["../../packages/preview-kit-compat/src"]
}
"@sanity/preview-kit-compat": ["../../packages/preview-kit-compat/src"],
},
},
"include": [
"../../packages/overlays/src",
"../../packages/preview-kit-compat/src",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
".next/types/**/*.ts",
],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
2 changes: 1 addition & 1 deletion apps/nuxt/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
"extends": "../.nuxt/tsconfig.server.json",
}
4 changes: 2 additions & 2 deletions apps/nuxt/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"moduleResolution": "bundler"
}
"moduleResolution": "bundler",
},
}
12 changes: 6 additions & 6 deletions apps/page-builder-demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"incremental": true,
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"rootDir": "../..",
"paths": {
"@/*": ["./src/*"],
"@sanity/overlays": ["../../packages/overlays/src"],
"@sanity/react-loader": ["../../packages/react-loader/src"]
}
"@sanity/react-loader": ["../../packages/react-loader/src"],
},
},
"include": [
"../../packages/csm/src",
Expand All @@ -32,7 +32,7 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
".next/types/**/*.ts",
],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
12 changes: 6 additions & 6 deletions apps/remix/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"**/*.tsx",
"../../packages/csm/src",
"../../packages/core-loader/src",
"../../packages/react-loader/src"
"../../packages/react-loader/src",
],
"compilerOptions": {
"skipLibCheck": true,
Expand All @@ -31,14 +31,14 @@
"@sanity/react-loader": ["../../packages/react-loader/src"],
"@sanity/react-loader/jsx": ["../../packages/react-loader/src/jsx"],
"@sanity/visual-editing-helpers": [
"../../packages/visual-editing-helpers/src"
"../../packages/visual-editing-helpers/src",
],
"@sanity/visual-editing-helpers/csm": [
"../../packages/visual-editing-helpers/src/csm"
]
"../../packages/visual-editing-helpers/src/csm",
],
},

// Remix takes care of building everything in `remix build`.
"noEmit": true
}
"noEmit": true,
},
}
6 changes: 3 additions & 3 deletions apps/studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"incremental": true,
"paths": {
"@sanity/presentation": ["../../packages/presentation/src"],
"@sanity/preview-url-secret": ["../../packages/preview-url-secret/src"]
}
"@sanity/preview-url-secret": ["../../packages/preview-url-secret/src"],
},
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions apps/svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
}
"moduleResolution": "bundler",
},
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"format": "prettier --cache --write .",
"lint": "turbo run lint",
"lint:fix": "pnpm lint -- --fix",
"page-builder-demo:dev": "turbo run dev --filter=./apps/page-builder-demo --filter=./apps/studio",
"next-server-only:dev": "turbo run dev --filter=./apps/next-server-only",
"page-builder-demo:dev": "turbo run dev --filter=./apps/page-builder-demo --filter=./apps/studio",
"preview": "turbo run preview",
"test": "turbo run test",
"watch": "turbo run watch"
Expand Down
4 changes: 2 additions & 2 deletions packages/channels/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"noUnusedLocals": false,
"noUnusedParameters": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
4 changes: 2 additions & 2 deletions packages/core-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"incremental": true,
"noEmit": true,
"strictNullChecks": true
"strictNullChecks": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
8 changes: 4 additions & 4 deletions packages/nuxt-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"paths": {
"@sanity/core-loader": ["../core-loader/src"],
"@sanity/visual-editing-helpers": ["../visual-editing-helpers/src"],
"@sanity/visual-editing-helpers/*": ["../visual-editing-helpers/src/*"]
}
"@sanity/visual-editing-helpers/*": ["../visual-editing-helpers/src/*"],
},
},
"include": [
"**/*.ts",
"**/*.tsx",
"../core-loader/src",
"../visual-editing-helpers/src"
"../visual-editing-helpers/src",
],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
4 changes: 2 additions & 2 deletions packages/overlays/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"incremental": true,
"noEmit": true,
"strictNullChecks": true
"strictNullChecks": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
8 changes: 4 additions & 4 deletions packages/presentation/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"paths": {
"@sanity/preview-url-secret": ["../preview-url-secret/src"],
"@sanity/channels": ["../channels/src"],
"@sanity/visual-editing-helpers": ["../visual-editing-helpers/src"]
}
"@sanity/visual-editing-helpers": ["../visual-editing-helpers/src"],
},
},
"include": [
"**/*.ts",
"**/*.tsx",
"../channels/src",
"../preview-url-secret/src",
"../preview-url-secret/legacy",
"../visual-editing-helpers/src"
"../visual-editing-helpers/src",
],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
4 changes: 2 additions & 2 deletions packages/preview-kit-compat/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"incremental": true,
"noEmit": true,
"strictNullChecks": true
"strictNullChecks": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
4 changes: 2 additions & 2 deletions packages/preview-url-secret/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"incremental": true,
"noEmit": true,
"strictNullChecks": true
"strictNullChecks": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
8 changes: 4 additions & 4 deletions packages/react-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"paths": {
"@sanity/core-loader": ["../core-loader/src"],
"@sanity/visual-editing-helpers": ["../visual-editing-helpers/src"],
"@sanity/visual-editing-helpers/*": ["../visual-editing-helpers/src/*"]
}
"@sanity/visual-editing-helpers/*": ["../visual-editing-helpers/src/*"],
},
},
"include": [
"**/*.ts",
"**/*.tsx",
"../core-loader/src",
"../visual-editing-helpers/src"
"../visual-editing-helpers/src",
],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
4 changes: 2 additions & 2 deletions packages/svelte-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"incremental": true,
"noEmit": true,
"strictNullChecks": true
"strictNullChecks": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "node_modules"]
"exclude": ["dist", "node_modules"],
}
Loading

0 comments on commit 09eb91f

Please sign in to comment.