Skip to content

Commit

Permalink
chore: squash everything
Browse files Browse the repository at this point in the history
chore(deps): update nextjs monorepo to v15.0.0-canary.191 (canary) (#1717)

Delete index.test.ts

fix(deps): update dependency @sanity/preview-kit to v5.1.4 (canary) (#1735)

chore: switch to canaries

chore: handle typo

chore(lockfile): 🤖 ✨ (#1722)

chore: bump deps

chore: add back preview-kit

chore(release): publish canary [skip ci]

chore: bump canaries

chore(release): publish canary [skip ci]

chore: bump canaries

chore(release): publish canary [skip ci]

chore: bump deps

chore(deps): update app dependencies (canary) (#1713)

chore(release): publish canary [skip ci]

chore: bump canaries

chore: fix build error

chore(deps): update nextjs monorepo to v15.0.0-canary.171 (canary) (#1711)

chore(release): publish canary [skip ci]

chore: bump canaries

chore(deps): update app dependencies (canary) (#1708)

chore: fix ts error

chore(deps): update linters (canary) (#1710)

chore: use new tokens

chore(release): publish canary [skip ci]

chore: bump canaries

fix: support next v15 async APIs

chore(deps): update nextjs monorepo to v15.0.0-canary.167 (canary) (#1705)

chore(release): publish canary [skip ci]

chore: prevent `removeChild` exception

chore(deps): update app dependencies (canary) (#1706)

chore(deps): update sanity monorepo to v3.58.0 (canary) (#1707)

chore(deps): update linters (canary) (#1704)

chore(deps): update dependency prettier-plugin-tailwindcss to v0.6.8 (canary) (#1703)

chore(deps): update dependency @types/react to ^18.3.9 (canary) (#1702)

chore(release): publish canary [skip ci]

chore: bump canaries

chore(release): publish canary [skip ci]

fix(visual-editing): render overlays in a portal

chore(release): publish canary [skip ci]

chore: bump canaries

chore(release): publish canary [skip ci]

chore: bump canaries

chore(deps): update dependency eslint-config-next to v15.0.0-canary.165 (canary) (#1700)

chore(deps): update nextjs monorepo to v15.0.0-canary.165 (canary) (#1701)

chore(deps): update app dependencies (canary) (#1699)

chore(release): publish canary [skip ci]

chore: bump canaries

chore(release): publish canary [skip ci]

chore(lockfile): 🤖 ✨ (#1698)

chore: bump canaries

chore(release): publish canary [skip ci]

chore: render overlays directly

chore(release): publish canary [skip ci]

chore: bump deps

chore(deps): update nextjs monorepo to v15.0.0-canary.162 (canary) (#1696)

chore(deps): update dependency @types/react to ^18.3.8 (canary) (#1694)

chore(deps): update dependency eslint-config-next to v15.0.0-canary.162 (canary) (#1695)

chore(deps): update app dependencies (canary) (#1693)

chore(deps): update pnpm to v9.11.0 (canary) (#1697)

chore(release): publish canary [skip ci]

chore: bump deps

chore(release): publish canary [skip ci]

chore: make it a tiny bit easier to use

chore(release): publish canary [skip ci]

chore: bump canary

chore(release): publish canary [skip ci]

chore: add hooks export

chore(release): publish canary [skip ci]

chore: bump deps

chore(release): publish canary [skip ci]

chore: bump deps

chore(release): publish canary [skip ci]

chore: bump deps and enable debug

chore(release): publish canary [skip ci]

chore: bye bye preview-kit

chore: use route groups to support live mode

chore: test live api

chore(release): publish canary [skip ci]

chore(deps): bump canaries

chore(deps): update dependency eslint-plugin-react-compiler to v0.0.0-experimental-92aaa43-20240919 (canary) (#1690)

chore(lockfile): update dependency next to v15.0.0-rc.0 (canary) (#1691)

chore(deps): update dependency next to v15.0.0-rc.0 (canary) (#1679)

chore(release): publish canary [skip ci]

fix(deps): update dependency @sanity/visual-editing to v2.1.11-canary.13

chore(deps): update app dependencies (canary) (#1684)

chore(release): publish canary [skip ci]

chore(deps): bump canaries

chore(deps): update linters (canary) (#1682)

chore: bump canaries

chore(deps): update dependency styled-components to ^6.1.13 (canary) (#1681)

chore(deps): update dependency @sanity/prettier-config to v1.0.3 (canary) (#1686)

chore(deps): update dependency @types/react to ^18.3.7 (canary) (#1687)

chore(deps): update dependency prettier-plugin-packagejson to v2.5.2 (canary) (#1680)

fix(deps): Update dependency @sanity/assist to v3.0.6 (canary) (#1683)

chore: fix linter

chore(deps): update vitest monorepo to ^2.1.1 (canary) (#1685)

chore(release): publish canary [skip ci]

feat: add `defineLive` API

chore(lockfile): 🤖 ✨ (#1678)

chore: test lockfile fix automation

chore(release): publish canary [skip ci]

chore(release): publish canary [skip ci]

chore(lockfile): update app dependencies

chore(release): publish canary [skip ci]

chore(release): publish canary [skip ci]

chore(deps): update dependency eslint-config-next to v15.0.0-canary.194 (canary) (#1756)

chore(deps): update app dependencies (canary) (#1745)

chore(deps): lock file maintenance (canary) (#1762)

chore(release): publish canary [skip ci]

chore(release): publish canary [skip ci]

chore(lockfile): update dependency next to v15.0.0-rc.1 (canary) (#1764)

Co-Authored-By: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
stipsan and renovate[bot] committed Oct 15, 2024
1 parent 6a4c03c commit a10ffd2
Show file tree
Hide file tree
Showing 29 changed files with 1,370 additions and 1,417 deletions.
13 changes: 13 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"matchPackageNames": [
"@sanity/client",
"@sanity/preview-kit",
"@sanity/preview-url-secret",
"@sanity/webhook",
"@portabletext/react",
"@portabletext/types",
Expand All @@ -49,6 +50,18 @@
{
"matchDepNames": ["babel-plugin-react-compiler", "eslint-plugin-react-compiler"],
"followTag": "experimental"
},
{
"matchDepNames": [
"@sanity/client",
"@sanity/presentation",
"@sanity/preview-kit",
"@sanity/preview-url-secret",
"@sanity/next-loader",
"@sanity/visual-editing"
],
"matchFileNames": ["package.json", "packages/next-sanity/package.json"],
"followTag": "canary"
}
],
"ignorePresets": [":ignoreModulesAndTests", "github>sanity-io/renovate-config:group-non-major"]
Expand Down
16 changes: 0 additions & 16 deletions apps/mvp/app/(website)/ConditionalPreviewProvider.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions apps/mvp/app/(website)/Posts.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions apps/mvp/app/(website)/PreviewPosts.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions apps/mvp/app/(website)/PreviewProvider.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions apps/mvp/app/(website)/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use server'

import {draftMode} from 'next/headers'

export async function disableDraftMode() {
'use server'
await Promise.allSettled([
(await draftMode()).disable(),
// Simulate a delay to show the loading state
new Promise((resolve) => setTimeout(resolve, 1000)),
])
}
7 changes: 0 additions & 7 deletions apps/mvp/app/(website)/api/disable-draft/route.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/mvp/app/(website)/api/draft/route.ts

This file was deleted.

3 changes: 3 additions & 0 deletions apps/mvp/app/(website)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import '../globals.css'
import {draftMode} from 'next/headers'
import {VisualEditing} from 'next-sanity'

import {SanityLive} from './live'

export default async function RootLayout({children}: {children: React.ReactNode}) {
return (
<html lang="en">
<head />
<body>
{children}
{(await draftMode()).isEnabled && <VisualEditing />}
<SanityLive />
</body>
</html>
)
Expand Down
11 changes: 11 additions & 0 deletions apps/mvp/app/(website)/live.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineLive} from 'next-sanity'

import {client} from '@/app/sanity.client'

const token = process.env.SANITY_API_READ_TOKEN!

export const {sanityFetch, SanityLive} = defineLive({
client,
serverToken: token,
browserToken: token,
})
25 changes: 9 additions & 16 deletions apps/mvp/app/(website)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/* eslint-disable @next/next/no-html-link-for-pages */
import {draftMode} from 'next/headers'
import Link from 'next/link'
import {unstable__adapter, unstable__environment} from 'next-sanity'
import {Suspense} from 'react'

import ConditionalPreviewProvider from './ConditionalPreviewProvider'
import Posts from './Posts'
import PostsLayout, {query} from '@/app/(website)/PostsLayout'

import {sanityFetch} from './live'

export default async function IndexPage() {
const {data} = await sanityFetch({query})

export default function IndexPage() {
return (
<>
<div
Expand All @@ -20,14 +23,10 @@ export default function IndexPage() {
<div className="relative mx-auto max-w-7xl">
<div className="text-center">
<h2 className="text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl">
Preview Kit
Posts {(await draftMode()).isEnabled && '(Draft Mode)'}
</h2>
</div>
<ConditionalPreviewProvider>
<Suspense>
<Posts />
</Suspense>
</ConditionalPreviewProvider>
<PostsLayout data={data} draftMode={(await draftMode()).isEnabled} />
</div>
</div>
<div className="flex text-center">
Expand All @@ -37,12 +36,6 @@ export default function IndexPage() {
>
Open Studio
</Link>
<Link
href="/visual-editing-only"
className="mx-2 my-4 inline-block rounded-full border border-gray-200 px-4 py-1 text-sm font-semibold text-gray-600 hover:border-transparent hover:bg-gray-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-gray-600 focus:ring-offset-2"
>
Visual Editing Only
</Link>
</div>
</>
)
Expand Down
36 changes: 0 additions & 36 deletions apps/mvp/app/(website)/sanity.fetch.ts

This file was deleted.

48 changes: 0 additions & 48 deletions apps/mvp/app/(website)/visual-editing-only/page.tsx

This file was deleted.

9 changes: 9 additions & 0 deletions apps/mvp/app/api/draft-mode/enable/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {defineEnableDraftMode} from 'next-sanity/draft-mode'

import {client} from '@/app/sanity.client'

export const {GET} = defineEnableDraftMode({
client: client.withConfig({
token: process.env.SANITY_API_READ_TOKEN,
}),
})
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {createClient} from 'next-sanity'
export const client = createClient({
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID!,
dataset: process.env.NEXT_PUBLIC_SANITY_DATASET!,
apiVersion: '2022-11-11',
apiVersion: 'X',
useCdn: false,
perspective: 'published',
resultSourceMap: 'withKeyArraySelector',
Expand Down
5 changes: 2 additions & 3 deletions apps/mvp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build": "next build --profile",
"dev": "next --turbo",
"dev": "next dev --turbo",
"format": "next lint --fix .",
"lint": "next lint --max-warnings 0 .",
"start": "next start",
Expand All @@ -14,7 +14,7 @@
"dependencies": {
"@repo/sanity-config": "workspace:*",
"@sanity/image-url": "^1.0.2",
"@sanity/preview-url-secret": "^1.6.21",
"@sanity/preview-url-secret": "1.6.22-canary.44",
"@sanity/vision": "3.61.0",
"babel-plugin-react-compiler": "0.0.0-experimental-fa06e2c-20241014",
"groqd": "^0.15.12",
Expand All @@ -37,7 +37,6 @@
"eslint-gitignore": "^0.1.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"postcss": "^8.4.47",
"server-only": "^0.0.1",
"tailwindcss": "^3.4.14",
"typescript": "5.6.3"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/mvp/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID!
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET!

const previewMode = {
enable: `${process.env.NEXT_PUBLIC_TEST_BASE_PATH || ''}/api/draft`,
enable: `${process.env.NEXT_PUBLIC_TEST_BASE_PATH || ''}/api/draft-mode/enable`,
} satisfies PreviewUrlResolverOptions['previewMode']

export default defineConfig({
Expand Down
2 changes: 0 additions & 2 deletions apps/static/app/sanity.fetch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'server-only'

import type {QueryParams} from '@sanity/client'

import {client} from './sanity.client'
Expand Down
1 change: 0 additions & 1 deletion apps/static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"eslint-gitignore": "^0.1.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"postcss": "^8.4.47",
"server-only": "^0.0.1",
"tailwindcss": "^3.4.14",
"typescript": "5.6.3"
}
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"predev": "pnpm build",
"dev": "turbo dev",
"format": "prettier --cache --write .",
"bump:canaries": "pnpm -r up @sanity/next-loader@canary @sanity/preview-url-secret@canary @sanity/presentation@canary @sanity/visual-editing@canary && pnpm dedupe",
"lint": "turbo lint",
"prestart": "turbo build",
"start": "turbo watch build start",
Expand All @@ -16,6 +17,7 @@
"devDependencies": {
"@next/bundle-analyzer": "15.0.0-canary.194",
"@next/env": "15.0.0-canary.194",
"@sanity/presentation": "1.16.6-canary.44",
"@sanity/prettier-config": "1.0.3",
"eslint-config-next": "15.0.0-canary.194",
"next": "15.0.0-canary.194",
Expand All @@ -36,6 +38,7 @@
"overrides": {
"@next/bundle-analyzer": "$@next/bundle-analyzer",
"@next/env": "$@next/env",
"@sanity/presentation": "$@sanity/presentation",
"eslint-config-next": "$eslint-config-next",
"next": "$next"
}
Expand Down
Loading

0 comments on commit a10ffd2

Please sign in to comment.