From acf410f440e3a4b6537ad39d196efad1cb2fe022 Mon Sep 17 00:00:00 2001 From: vijayakrishnans Date: Thu, 3 Dec 2026 18:29:04 +0700 Subject: [PATCH] Draw the site's own frame, not @vercel/examples-ui's Vercel nav and footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - **Layout:** `@vercel/examples-ui`'s `Layout` drew a nav with the Vercel logo, a "Vercel Examples / solutions / cron" trail and a "More Examples →" link, and a footer reading "Created by ▲ Vercel". `components/layout.tsx` replaces it with the same frame and classes: the site's name linking to its repository, the "Clone & Deploy" button (to `SOURCE_URL`), and a footer naming Cloudflare Workers and Orunbase. The package still supplies the styles and the text, code, link and button components. The eslint override that existed only for `getLayout` is dropped. The design, risks and status docs follow. **Checked locally:** `pnpm typecheck`, `pnpm lint`, `next build`, and `testing/e2e.test.sh` (passes: the page's two repository links are the product's, title and heading the product's name). Co-Authored-By: Claude Opus 5.5 --- apps/web/components/layout.tsx | 54 +++++++++++++++++++ apps/web/eslint.config.mjs | 5 -- apps/web/lib/site.ts | 4 +- apps/web/pages/_app.tsx | 22 +++----- apps/web/pages/index.tsx | 3 +- .../cron-starter/IMPLEMENTATION-STATUS.md | 12 +++-- specs/epics/cron-starter/design.md | 2 +- .../cron-starter/risks-and-open-questions.md | 5 +- 8 files changed, 75 insertions(+), 32 deletions(-) create mode 100644 apps/web/components/layout.tsx diff --git a/apps/web/components/layout.tsx b/apps/web/components/layout.tsx new file mode 100644 index 0000000..3b6ebbf --- /dev/null +++ b/apps/web/components/layout.tsx @@ -0,0 +1,54 @@ +import type { ReactNode } from 'react' +import { Button, Link } from '@vercel/examples-ui' +import { SITE_NAME, SOURCE_URL } from '@/lib/site' + +// The site's frame: a nav and a footer around every page. It replaces +// @vercel/examples-ui's Layout, whose nav carried the Vercel logo and a +// "Vercel Examples / …" trail and whose footer read "Created by ▲ Vercel". +// The shape and classes are that layout's, so the page looks the same; the +// repository link and the "Clone & Deploy" button both go to SOURCE_URL, +// which instantiating the site rewrites to the product's repository. +export default function Layout({ children }: { children: ReactNode }) { + return ( +
+ +
{children}
+
+ + Runs on Cloudflare Workers · built with{' '} + + Orunbase + + +
+
+ ) +} diff --git a/apps/web/eslint.config.mjs b/apps/web/eslint.config.mjs index 08f3baa..ba678bb 100644 --- a/apps/web/eslint.config.mjs +++ b/apps/web/eslint.config.mjs @@ -7,11 +7,6 @@ export default defineConfig([ ...nextTs, { rules: { - // Rules eslint-config-next 16 brings that the template was not written - // against, turned off by name rather than rewriting upstream code: - // - `getLayout(Component)` in pages/_app.tsx builds the layout during - // render (the @vercel/examples-ui pattern). - "react-hooks/static-components": "off", // worker.ts imports the generated `.open-next/worker.js` the way the // OpenNext custom-worker howto does: `@ts-ignore` with a reason, because // the file does not exist before the build and an `@ts-expect-error` diff --git a/apps/web/lib/site.ts b/apps/web/lib/site.ts index 8b678ff..99fedc5 100644 --- a/apps/web/lib/site.ts +++ b/apps/web/lib/site.ts @@ -1,6 +1,6 @@ // The site's identity, written once. The page heading and its read -// SITE_NAME; the layout's repository link and "Clone & Deploy" button go to -// SOURCE_URL. Instantiating the site under a new name rewrites both to that +// SITE_NAME; the layout's (components/layout.tsx) repository link and +// "Clone & Deploy" button go to SOURCE_URL. Instantiating the site under a new name rewrites both to that // name and its repository, so keep them literal and on one line each. export const SITE_NAME = "Cron Triggers on Cloudflare" export const SOURCE_URL = "https://github.com/sourceplane/cron-starter" diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx index e80aa99..c052219 100644 --- a/apps/web/pages/_app.tsx +++ b/apps/web/pages/_app.tsx @@ -1,27 +1,17 @@ import type { AppProps } from 'next/app' -import type { LayoutProps } from '@vercel/examples-ui/layout' import Head from 'next/head' import { CloudflareWebAnalytics } from '@/components/analytics' -import { SITE_NAME, SOURCE_URL } from '@/lib/site' +import Layout from '@/components/layout' +import { SITE_NAME } from '@/lib/site' -import { getLayout } from '@vercel/examples-ui' import '@vercel/examples-ui/globals.css' function App({ Component, pageProps }: AppProps) { - const Layout = getLayout<LayoutProps>(Component) - - // The <title> is the site's name (lib/site.ts), and it and the description - // are rendered here rather than through the layout's `title`/`description` - // props: the layout's own <Head> does not reach the server-rendered page, - // and it would suffix the title with " - Vercel Examples". + // The <title> is the site's name (lib/site.ts). The frame is the site's + // own (components/layout.tsx): @vercel/examples-ui still supplies the + // styles and the text, code and link components, not the Vercel chrome. return ( - <Layout - deployButton={{ - repositoryUrl: SOURCE_URL, - customDeployUrl: SOURCE_URL, - }} - path="solutions/cron" - > + <Layout> <Head> <title>{SITE_NAME}