Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Dec 20, 2024
1 parent f002e74 commit 11c80cf
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 40 deletions.
6 changes: 3 additions & 3 deletions examples/cms-sanity/app/(blog)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as demo from "@/sanity/lib/demo";
import { sanityFetch, SanityLive } from "@/sanity/lib/live";
import { settingsQuery } from "@/sanity/lib/queries";
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { AnimatePresence } from "framer-motion";
import type { Metadata } from "next";
Expand Down Expand Up @@ -55,16 +56,14 @@ const inter = Inter({
display: "swap",
});

export const runtime = "edge";

export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const { isEnabled: isDraftMode } = await draftMode();
const { data } = await sanityFetch({ query: settingsQuery });
const footer = data?.footer || [];
const { isEnabled: isDraftMode } = await draftMode();

return (
<html lang="en" className={`${inter.variable} bg-white text-black`}>
Expand All @@ -91,6 +90,7 @@ export default async function RootLayout({
)}
<SanityLive onError={handleError} />
<SpeedInsights />
<Analytics />
</body>
</html>
);
Expand Down
2 changes: 0 additions & 2 deletions examples/cms-sanity/app/(blog)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import MoreStories from "./more-stories";
import Onboarding from "./onboarding";
import PortableText from "./portable-text";

export const runtime = "edge";

export default async function Page() {
const [{ data: settings }, { data: heroPost }] = await Promise.all([
sanityFetch({
Expand Down
18 changes: 8 additions & 10 deletions examples/cms-sanity/app/(blog)/posts/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ const postSlugs = defineQuery(
`*[_type == "post" && defined(slug.current)]{"slug": slug.current}`,
);

export const runtime = "edge";

// export async function generateStaticParams() {
// const { data } = await sanityFetch({
// query: postSlugs,
// perspective: "published",
// stega: false,
// });
// return data;
// }
export async function generateStaticParams() {
const { data } = await sanityFetch({
query: postSlugs,
perspective: "published",
stega: false,
});
return data;
}

export async function generateMetadata(
{ params }: Props,
Expand Down
51 changes: 26 additions & 25 deletions examples/cms-sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"scripts": {
"build": "next build",
"predev": "npm run typegen",
"dev": "next --turbo",
"dev": "next --turbopack",
"format": "prettier --cache --write .",
"lint": "next lint",
"presetup": "echo 'about to setup env variables, follow the guide here: https://github.com/vercel/next.js/tree/canary/examples/cms-sanity#using-the-sanity-cli'",
Expand All @@ -20,38 +20,39 @@
]
},
"dependencies": {
"@sanity/assist": "^3.0.8",
"@sanity/client": "^6.22.3",
"@sanity/icons": "^3.4.0",
"@sanity/assist": "^3.0.9",
"@sanity/client": "^6.24.1",
"@sanity/icons": "^3.5.5",
"@sanity/image-url": "^1.1.0",
"@sanity/vision": "^3.63.0",
"@sanity/vision": "^3.68.2",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^22.7.8",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vercel/speed-insights": "^1.0.14",
"@types/node": "^22.10.2",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@vercel/analytics": "^1.4.1",
"@vercel/speed-insights": "^1.1.0",
"autoprefixer": "^10.4.20",
"date-fns": "^4.1.0",
"framer-motion": "12.0.0-alpha.1",
"next": "^15.0.2",
"next-sanity": "^9.8.10",
"postcss": "^8.4.47",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"framer-motion": "^11.15.0",
"next": "^15.1.2",
"next-sanity": "^9.8.29",
"postcss": "^8.4.49",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-fast-compare": "^3.2.2",
"sanity": "^3.63.0",
"sanity-plugin-asset-source-unsplash": "^3.0.1",
"sonner": "^1.7.0",
"sanity": "^3.68.2",
"sanity-plugin-asset-source-unsplash": "^3.0.2",
"sonner": "^1.7.1",
"styled-components": "^6.1.13",
"tailwindcss": "^3.4.14",
"typescript": "5.6.3"
"tailwindcss": "^3.4.17",
"typescript": "5.7.2"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
"eslint": "^9.14.0",
"eslint-config-next": "^15.0.2",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"prettier-plugin-tailwindcss": "^0.6.8"
"eslint": "^9.17.0",
"eslint-config-next": "^15.1.2",
"prettier": "^3.4.2",
"prettier-plugin-packagejson": "^2.5.6",
"prettier-plugin-tailwindcss": "^0.6.9"
}
}

0 comments on commit 11c80cf

Please sign in to comment.