feat: Next 16 + Payload 3 scaffold with Kaniko CI and Swarm deploy (#1)
Some checks failed
ci/woodpecker/push/web Pipeline failed

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #1.
This commit is contained in:
2026-04-14 03:21:17 +00:00
committed by jason.woltje
parent c800bef739
commit 8c5a25e976
51 changed files with 9353 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Metadata } from "next";
import config from "@payload-config";
import { NotFoundPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from "../importMap";
type Args = {
params: Promise<{ [key: string]: string | string[] | undefined }>;
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
};
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
generatePageMetadata({ config, params: params as any, searchParams: searchParams as any });
const NotFound = ({ params, searchParams }: Args) =>
NotFoundPage({ config, params: params as any, searchParams: searchParams as any, importMap });
export default NotFound;

View File

@@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Metadata } from "next";
import config from "@payload-config";
import { RootPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from "../importMap";
type Args = {
params: Promise<{ [key: string]: string | string[] | undefined }>;
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
};
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
generatePageMetadata({ config, params: params as any, searchParams: searchParams as any });
const Page = ({ params, searchParams }: Args) =>
RootPage({ config, params: params as any, searchParams: searchParams as any, importMap });
export default Page;

View File

@@ -0,0 +1,2 @@
// Auto-generated stub. Regenerate with `pnpm generate:importmap` after adding custom components.
export const importMap = {};

View File

@@ -0,0 +1,16 @@
import config from "@payload-config";
import {
REST_DELETE,
REST_GET,
REST_OPTIONS,
REST_PATCH,
REST_POST,
REST_PUT,
} from "@payloadcms/next/routes";
export const GET = REST_GET(config);
export const POST = REST_POST(config);
export const DELETE = REST_DELETE(config);
export const PATCH = REST_PATCH(config);
export const PUT = REST_PUT(config);
export const OPTIONS = REST_OPTIONS(config);

View File

@@ -0,0 +1,4 @@
import config from "@payload-config";
import { GRAPHQL_PLAYGROUND_GET } from "@payloadcms/next/routes";
export const GET = GRAPHQL_PLAYGROUND_GET(config);

View File

@@ -0,0 +1,5 @@
import config from "@payload-config";
import { GRAPHQL_POST, REST_OPTIONS } from "@payloadcms/next/routes";
export const POST = GRAPHQL_POST(config);
export const OPTIONS = REST_OPTIONS(config);

View File

@@ -0,0 +1,16 @@
import { NextResponse } from "next/server";
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
export function GET() {
return NextResponse.json(
{
status: "ok",
buildSha: process.env.NEXT_PUBLIC_BUILD_SHA ?? "dev",
buildRev: process.env.NEXT_PUBLIC_BUILD_REV ?? "local",
timestamp: new Date().toISOString(),
},
{ status: 200 },
);
}

View File

@@ -0,0 +1 @@
/* Payload admin UI customizations. Keep minimal for v0.0.x. */

View File

@@ -0,0 +1,22 @@
/* Payload admin layout — do not modify unless you understand the Payload 3 requirements. */
import type { ServerFunctionClient } from "payload";
import config from "@payload-config";
import { RootLayout, handleServerFunctions } from "@payloadcms/next/layouts";
import "@payloadcms/next/css";
import { importMap } from "./admin/importMap";
import "./custom.scss";
type Args = { children: React.ReactNode };
const serverFunction: ServerFunctionClient = async function (args) {
"use server";
return handleServerFunctions({ ...args, config, importMap });
};
const Layout = ({ children }: Args) => (
<RootLayout config={config} importMap={importMap} serverFunction={serverFunction}>
{children}
</RootLayout>
);
export default Layout;