Fixed notfound headers, r2storage
This commit is contained in:
+5
-2
@@ -150,8 +150,11 @@ Bez skrótów (`HeroSection`, nie `HeroSec`). Nie twórz `lib/pages.ts`,
|
||||
dynamiczna → metadata w body.
|
||||
5. **`htmlLimitedBots`** w `next.config.ts` (seo.md).
|
||||
6. **Nie czytaj `searchParams`** w stronie bez paginacji — deoptymalizuje
|
||||
ISR/SSG. Nie czytaj `headers()` w komponentach bloków (to samo). Locale do
|
||||
bloków wstrzykuj przez `enhanceProps`.
|
||||
ISR/SSG. **Nie czytaj `headers()` / `cookies()`** nigdzie w drzewie stron
|
||||
statycznych — w blokach, komponentach, layoucie `[locale]` ani w
|
||||
`not-found.tsx` (Next 16: `Page changed from static to dynamic at runtime`).
|
||||
Locale do bloków → `enhanceProps`; w `not-found.tsx` (brak `params`) →
|
||||
wersja na każdy język + `<LocaleView>` (pages.md).
|
||||
7. **`export const dynamic = 'force-dynamic'`** na trasach czytających bazę:
|
||||
`manifest.ts`, `sitemap.ts`/`sitemap.xml`, `llms.txt`, `api/health`. Handlery
|
||||
pluginu mają try/catch, ale `dynamic` musi być w pliku trasy.
|
||||
|
||||
@@ -69,9 +69,12 @@ for r in src/app/sitemap.ts src/app/manifest.ts src/app/llms.txt/route.ts src/ap
|
||||
report ERROR "DB route without force-dynamic" "§4.7 build without DB will crash" "$r"
|
||||
done
|
||||
|
||||
report ERROR "headers() in blocks/components" "§4.6 forces dynamic rendering — pass locale via enhanceProps" \
|
||||
report ERROR "headers()/cookies() in blocks/components" "§4.6 forces dynamic rendering — pass locale via enhanceProps" \
|
||||
"$( [ -n "$UI" ] && g "from 'next/headers'" $UI)"
|
||||
|
||||
report ERROR "headers()/cookies() in static page tree" "§4.6 SSG/ISR → 'Page changed from static to dynamic' — not-found: LocaleView (pages.md)" \
|
||||
"$(g "from 'next/headers'" src/app --include=page.tsx --include=layout.tsx --include=not-found.tsx --include=template.tsx | grep -v '/api/\|(payload)')"
|
||||
|
||||
# --- Hardcoding & types (§2, §8) ---
|
||||
report ERROR "hardcoded locale map / any / ts-ignore" "§2, §8" \
|
||||
"$(g 'localizedRoutes|as any\b|@ts-ignore|: any\b' src --include=*.ts --include=*.tsx | grep -v '/payload-types.ts:')"
|
||||
|
||||
@@ -27,7 +27,7 @@ poniżej i doczytaj po `pnpm add`). Reguły: `docs/agent/AGENT.md`.
|
||||
Impeccable albo załóż neutralne tokeny), `@source` na plugin (AGENT.md §6.11).
|
||||
6. **Routing** — `proxy.ts` (`createProxy`), `lib/content.ts`, layout bez
|
||||
`<head>`, catch-all z ISR + `generateStaticParams` + `resolveRedirect`,
|
||||
`not-found.tsx` (PROGRAMISTA §2.6–2.8).
|
||||
`not-found.tsx` z `LocaleView` — bez `headers()`, wersja na każdy język (PROGRAMISTA §2.6–2.8, pages.md).
|
||||
7. **SEO i bezpieczeństwo** — sitemap, robots, manifest, llms.txt, health
|
||||
(wszystkie z `force-dynamic`), `htmlLimitedBots`, `buildSecurityHeaders`,
|
||||
`instrumentation.ts` z `assertEnv` (PROGRAMISTA §2.8–2.9).
|
||||
|
||||
Reference in New Issue
Block a user