diff --git a/.gitignore b/.gitignore index 9e6e804..701c4f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,24 @@ +# Dependencies (DO NOT PUSH - thousands of files) +node_modules/ +# Next.js build output (DO NOT PUSH - compiled files) +.next/ +out/ +build/ + +# Local SQLite Database +*.db +*.db-journal + +# Environment variables .env +.env*.local + +# Agent configuration, learning resources & local data .agents/ .gemini/ resources/ +# OS metadata +.DS_Store +Thumbs.db diff --git a/to_do_app/README.md b/README.md similarity index 100% rename from to_do_app/README.md rename to README.md diff --git a/to_do_app/app/favicon.ico b/app/favicon.ico similarity index 100% rename from to_do_app/app/favicon.ico rename to app/favicon.ico diff --git a/to_do_app/app/globals.css b/app/globals.css similarity index 100% rename from to_do_app/app/globals.css rename to app/globals.css diff --git a/to_do_app/app/layout.tsx b/app/layout.tsx similarity index 100% rename from to_do_app/app/layout.tsx rename to app/layout.tsx diff --git a/to_do_app/app/page.tsx b/app/page.tsx similarity index 100% rename from to_do_app/app/page.tsx rename to app/page.tsx diff --git a/to_do_app/eslint.config.mjs b/eslint.config.mjs similarity index 100% rename from to_do_app/eslint.config.mjs rename to eslint.config.mjs diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 0000000..9edff1c --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,6 @@ +/// +/// +import "./.next/types/routes.d.ts"; + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/to_do_app/next.config.ts b/next.config.ts similarity index 100% rename from to_do_app/next.config.ts rename to next.config.ts diff --git a/to_do_app/package-lock.json b/package-lock.json similarity index 100% rename from to_do_app/package-lock.json rename to package-lock.json diff --git a/to_do_app/package.json b/package.json similarity index 100% rename from to_do_app/package.json rename to package.json diff --git a/to_do_app/postcss.config.mjs b/postcss.config.mjs similarity index 100% rename from to_do_app/postcss.config.mjs rename to postcss.config.mjs diff --git a/to_do_app/public/file.svg b/public/file.svg similarity index 100% rename from to_do_app/public/file.svg rename to public/file.svg diff --git a/to_do_app/public/globe.svg b/public/globe.svg similarity index 100% rename from to_do_app/public/globe.svg rename to public/globe.svg diff --git a/to_do_app/public/next.svg b/public/next.svg similarity index 100% rename from to_do_app/public/next.svg rename to public/next.svg diff --git a/to_do_app/public/vercel.svg b/public/vercel.svg similarity index 100% rename from to_do_app/public/vercel.svg rename to public/vercel.svg diff --git a/to_do_app/public/window.svg b/public/window.svg similarity index 100% rename from to_do_app/public/window.svg rename to public/window.svg diff --git a/to_do_app/.gitignore b/to_do_app/.gitignore deleted file mode 100644 index 5ef6a52..0000000 --- a/to_do_app/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.* -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/versions - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# env files (can opt-in for committing if needed) -.env* - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts diff --git a/to_do_app/AGENTS.md b/to_do_app/AGENTS.md deleted file mode 100644 index 8bd0e39..0000000 --- a/to_do_app/AGENTS.md +++ /dev/null @@ -1,5 +0,0 @@ - -# This is NOT the Next.js you know - -This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices. - diff --git a/to_do_app/CLAUDE.md b/to_do_app/CLAUDE.md deleted file mode 100644 index 43c994c..0000000 --- a/to_do_app/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -@AGENTS.md diff --git a/to_do_app/tsconfig.json b/tsconfig.json similarity index 100% rename from to_do_app/tsconfig.json rename to tsconfig.json diff --git a/types/cache-life.d.ts b/types/cache-life.d.ts new file mode 100644 index 0000000..a8c6997 --- /dev/null +++ b/types/cache-life.d.ts @@ -0,0 +1,145 @@ +// Type definitions for Next.js cacheLife configs + +declare module 'next/cache' { + export { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache' + export { + updateTag, + revalidateTag, + revalidatePath, + refresh, + } from 'next/dist/server/web/spec-extension/revalidate' + export { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store' + + + /** + * Cache this `"use cache"` for a timespan defined by the `"default"` profile. + * ``` + * stale: 300 seconds (5 minutes) + * revalidate: 900 seconds (15 minutes) + * expire: never + * ``` + * + * This cache may be stale on clients for 5 minutes before checking with the server. + * If the server receives a new request after 15 minutes, start revalidating new values in the background. + * It lives for the maximum age of the server cache. If this entry has no traffic for a while, it may serve an old value the next request. + */ + export function cacheLife(profile: "default"): void + + /** + * Cache this `"use cache"` for a timespan defined by the `"seconds"` profile. + * ``` + * stale: 30 seconds + * revalidate: 1 seconds + * expire: 60 seconds (1 minute) + * ``` + * + * This cache may be stale on clients for 30 seconds before checking with the server. + * If the server receives a new request after 1 seconds, start revalidating new values in the background. + * If this entry has no traffic for 1 minute it will expire. The next request will recompute it. + */ + export function cacheLife(profile: "seconds"): void + + /** + * Cache this `"use cache"` for a timespan defined by the `"minutes"` profile. + * ``` + * stale: 300 seconds (5 minutes) + * revalidate: 60 seconds (1 minute) + * expire: 3600 seconds (1 hour) + * ``` + * + * This cache may be stale on clients for 5 minutes before checking with the server. + * If the server receives a new request after 1 minute, start revalidating new values in the background. + * If this entry has no traffic for 1 hour it will expire. The next request will recompute it. + */ + export function cacheLife(profile: "minutes"): void + + /** + * Cache this `"use cache"` for a timespan defined by the `"hours"` profile. + * ``` + * stale: 300 seconds (5 minutes) + * revalidate: 3600 seconds (1 hour) + * expire: 86400 seconds (1 day) + * ``` + * + * This cache may be stale on clients for 5 minutes before checking with the server. + * If the server receives a new request after 1 hour, start revalidating new values in the background. + * If this entry has no traffic for 1 day it will expire. The next request will recompute it. + */ + export function cacheLife(profile: "hours"): void + + /** + * Cache this `"use cache"` for a timespan defined by the `"days"` profile. + * ``` + * stale: 300 seconds (5 minutes) + * revalidate: 86400 seconds (1 day) + * expire: 604800 seconds (1 week) + * ``` + * + * This cache may be stale on clients for 5 minutes before checking with the server. + * If the server receives a new request after 1 day, start revalidating new values in the background. + * If this entry has no traffic for 1 week it will expire. The next request will recompute it. + */ + export function cacheLife(profile: "days"): void + + /** + * Cache this `"use cache"` for a timespan defined by the `"weeks"` profile. + * ``` + * stale: 300 seconds (5 minutes) + * revalidate: 604800 seconds (1 week) + * expire: 2592000 seconds (1 month) + * ``` + * + * This cache may be stale on clients for 5 minutes before checking with the server. + * If the server receives a new request after 1 week, start revalidating new values in the background. + * If this entry has no traffic for 1 month it will expire. The next request will recompute it. + */ + export function cacheLife(profile: "weeks"): void + + /** + * Cache this `"use cache"` for a timespan defined by the `"max"` profile. + * ``` + * stale: 300 seconds (5 minutes) + * revalidate: 2592000 seconds (1 month) + * expire: 31536000 seconds (365 days) + * ``` + * + * This cache may be stale on clients for 5 minutes before checking with the server. + * If the server receives a new request after 1 month, start revalidating new values in the background. + * If this entry has no traffic for 365 days it will expire. The next request will recompute it. + */ + export function cacheLife(profile: "max"): void + + /** + * Cache this `"use cache"` using a custom timespan. + * ``` + * stale: ... // seconds + * revalidate: ... // seconds + * expire: ... // seconds + * ``` + * + * This is similar to Cache-Control: max-age=`stale`,s-max-age=`revalidate`,stale-while-revalidate=`expire-revalidate` + * + * If a value is left out, the lowest of other cacheLife() calls or the default, is used instead. + */ + export function cacheLife(profile: { + /** + * This cache may be stale on clients for ... seconds before checking with the server. + */ + stale?: number, + /** + * If the server receives a new request after ... seconds, start revalidating new values in the background. + */ + revalidate?: number, + /** + * If this entry has no traffic for ... seconds it will expire. The next request will recompute it. + */ + expire?: number + }): void + + + import { cacheTag } from 'next/dist/server/use-cache/cache-tag' + export { cacheTag } + + export const unstable_cacheTag: typeof cacheTag + export const unstable_cacheLife: typeof cacheLife +} diff --git a/types/routes.d.ts b/types/routes.d.ts new file mode 100644 index 0000000..1c6c34d --- /dev/null +++ b/types/routes.d.ts @@ -0,0 +1,57 @@ +// This file is generated automatically by Next.js +// Do not edit this file manually + +type AppRoutes = "/" +type PageRoutes = never +type LayoutRoutes = "/" +type RedirectRoutes = never +type RewriteRoutes = never +type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes + + +interface ParamMap { + "/": {} +} + + +export type ParamsOf = ParamMap[Route] + +interface LayoutSlotMap { + "/": never +} + + +export type { AppRoutes, PageRoutes, LayoutRoutes, RedirectRoutes, RewriteRoutes, ParamMap } + +declare global { + /** + * Props for Next.js App Router page components + * @example + * ```tsx + * export default function Page(props: PageProps<'/blog/[slug]'>) { + * const { slug } = await props.params + * return
Blog post: {slug}
+ * } + * ``` + */ + interface PageProps { + params: Promise + searchParams: Promise> + } + + /** + * Props for Next.js App Router layout components + * @example + * ```tsx + * export default function Layout(props: LayoutProps<'/dashboard'>) { + * return
{props.children}
+ * } + * ``` + */ + type LayoutProps = { + params: Promise + children: React.ReactNode + } & { + [K in LayoutSlotMap[LayoutRoute]]: React.ReactNode + } +} diff --git a/types/validator.ts b/types/validator.ts new file mode 100644 index 0000000..c20dd70 --- /dev/null +++ b/types/validator.ts @@ -0,0 +1,61 @@ +// This file is generated automatically by Next.js +// Do not edit this file manually +// This file validates that all pages and layouts export the correct types + +import type { AppRoutes, LayoutRoutes, ParamMap } from "./routes.js" +import type { ResolvingMetadata, ResolvingViewport } from "next/types.js" + +type AppPageConfig = { + default: React.ComponentType<{ params: Promise } & any> | ((props: { params: Promise } & any) => React.ReactNode | Promise | never | void | Promise) + generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise | any[] + generateMetadata?: ( + props: { params: Promise } & any, + parent: ResolvingMetadata + ) => Promise | any + generateViewport?: ( + props: { params: Promise } & any, + parent: ResolvingViewport + ) => Promise | any + metadata?: any + viewport?: any +} + +type LayoutConfig = { + default: React.ComponentType> | ((props: LayoutProps) => React.ReactNode | Promise | never | void | Promise) + generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise | any[] + generateMetadata?: ( + props: { params: Promise } & any, + parent: ResolvingMetadata + ) => Promise | any + generateViewport?: ( + props: { params: Promise } & any, + parent: ResolvingViewport + ) => Promise | any + metadata?: any + viewport?: any +} + + +// Validate ../../app/page.tsx +{ + type __IsExpected> = Specific + const handler = {} as typeof import("../../app/page.js") + type __Check = __IsExpected + // @ts-ignore + type __Unused = __Check +} + + + + + + + +// Validate ../../app/layout.tsx +{ + type __IsExpected> = Specific + const handler = {} as typeof import("../../app/layout.js") + type __Check = __IsExpected + // @ts-ignore + type __Unused = __Check +}