@justanarthur/payload-www 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pages.js CHANGED
@@ -762,6 +762,7 @@ function createCollectionPageExports({
762
762
  const slugSegments = Array.isArray(rawSlugSegments) ? rawSlugSegments : [];
763
763
  const locale = typeof incomingLocale === "string" ? incomingLocale : defaultLocale;
764
764
  if (!locales.includes(locale)) {
765
+ console.error(`[WWW-DBG ${slug} notFound: invalid-locale] locale=${locale} segments=${JSON.stringify(slugSegments)}`);
765
766
  const { notFound } = await import("next/navigation");
766
767
  notFound();
767
768
  }
@@ -772,6 +773,7 @@ function createCollectionPageExports({
772
773
  const storedSlug = segmentsToStoredSlug(slugSegments, nested);
773
774
  const doc = await fetchDoc(locale, storedSlug, draft);
774
775
  if (!doc) {
776
+ console.error(`[WWW-DBG ${slug} notFound: no-doc] locale=${locale} storedSlug="${storedSlug}" segments=${JSON.stringify(slugSegments)} draft=${draft}`);
775
777
  const { notFound } = await import("next/navigation");
776
778
  notFound();
777
779
  }
@@ -646,6 +646,7 @@ function createCollectionPageExports({
646
646
  const slugSegments = Array.isArray(rawSlugSegments) ? rawSlugSegments : [];
647
647
  const locale = typeof incomingLocale === "string" ? incomingLocale : defaultLocale;
648
648
  if (!locales.includes(locale)) {
649
+ console.error(`[WWW-DBG ${slug} notFound: invalid-locale] locale=${locale} segments=${JSON.stringify(slugSegments)}`);
649
650
  const { notFound } = await import("next/navigation");
650
651
  notFound();
651
652
  }
@@ -656,6 +657,7 @@ function createCollectionPageExports({
656
657
  const storedSlug = segmentsToStoredSlug(slugSegments, nested);
657
658
  const doc = await fetchDoc(locale, storedSlug, draft);
658
659
  if (!doc) {
660
+ console.error(`[WWW-DBG ${slug} notFound: no-doc] locale=${locale} storedSlug="${storedSlug}" segments=${JSON.stringify(slugSegments)} draft=${draft}`);
659
661
  const { notFound } = await import("next/navigation");
660
662
  notFound();
661
663
  }
@@ -1228,9 +1230,26 @@ function createStaticPageExports({
1228
1230
  importMap: importMapArg
1229
1231
  }) {
1230
1232
  const importMap = importMapArg ?? {};
1233
+ let dbgRenderCount = 0;
1231
1234
  const default_ = async () => {
1232
1235
  const { getLocale } = await import("next-intl/server");
1233
1236
  const locale = await getLocale();
1237
+ dbgRenderCount++;
1238
+ {
1239
+ let reqUrl = "?";
1240
+ try {
1241
+ const { headers } = await import("next/headers");
1242
+ const h = await headers();
1243
+ reqUrl = h.get("x-invoke-path") || h.get("x-matched-path") || h.get("x-next-url") || h.get("next-url") || h.get("referer") || "?";
1244
+ } catch {}
1245
+ console.error(`[WWW-DBG static-render #${dbgRenderCount}] kind=${kind} locale=${locale} url=${reqUrl}`);
1246
+ if (dbgRenderCount <= 5) {
1247
+ console.error(`[WWW-DBG static-render #${dbgRenderCount}] stack:
1248
+ ` + (new Error("static-render").stack?.split(`
1249
+ `).slice(2, 12).join(`
1250
+ `) ?? ""));
1251
+ }
1252
+ }
1234
1253
  const doc = await queryDocBySlug({
1235
1254
  collectionSlug: STATIC_PAGES_SLUG,
1236
1255
  slug: kind,
package/dist/server.js CHANGED
@@ -1732,6 +1732,7 @@ function createCollectionPageExports({
1732
1732
  const slugSegments = Array.isArray(rawSlugSegments) ? rawSlugSegments : [];
1733
1733
  const locale = typeof incomingLocale === "string" ? incomingLocale : defaultLocale;
1734
1734
  if (!locales.includes(locale)) {
1735
+ console.error(`[WWW-DBG ${slug} notFound: invalid-locale] locale=${locale} segments=${JSON.stringify(slugSegments)}`);
1735
1736
  const { notFound } = await import("next/navigation");
1736
1737
  notFound();
1737
1738
  }
@@ -1742,6 +1743,7 @@ function createCollectionPageExports({
1742
1743
  const storedSlug = segmentsToStoredSlug(slugSegments, nested);
1743
1744
  const doc = await fetchDoc(locale, storedSlug, draft);
1744
1745
  if (!doc) {
1746
+ console.error(`[WWW-DBG ${slug} notFound: no-doc] locale=${locale} storedSlug="${storedSlug}" segments=${JSON.stringify(slugSegments)} draft=${draft}`);
1745
1747
  const { notFound } = await import("next/navigation");
1746
1748
  notFound();
1747
1749
  }
@@ -1989,9 +1991,26 @@ function createStaticPageExports({
1989
1991
  importMap: importMapArg
1990
1992
  }) {
1991
1993
  const importMap = importMapArg ?? {};
1994
+ let dbgRenderCount = 0;
1992
1995
  const default_ = async () => {
1993
1996
  const { getLocale } = await import("next-intl/server");
1994
1997
  const locale = await getLocale();
1998
+ dbgRenderCount++;
1999
+ {
2000
+ let reqUrl = "?";
2001
+ try {
2002
+ const { headers } = await import("next/headers");
2003
+ const h = await headers();
2004
+ reqUrl = h.get("x-invoke-path") || h.get("x-matched-path") || h.get("x-next-url") || h.get("next-url") || h.get("referer") || "?";
2005
+ } catch {}
2006
+ console.error(`[WWW-DBG static-render #${dbgRenderCount}] kind=${kind} locale=${locale} url=${reqUrl}`);
2007
+ if (dbgRenderCount <= 5) {
2008
+ console.error(`[WWW-DBG static-render #${dbgRenderCount}] stack:
2009
+ ` + (new Error("static-render").stack?.split(`
2010
+ `).slice(2, 12).join(`
2011
+ `) ?? ""));
2012
+ }
2013
+ }
1995
2014
  const doc = await queryDocBySlug({
1996
2015
  collectionSlug: STATIC_PAGES_SLUG,
1997
2016
  slug: kind,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justanarthur/payload-www",
3
3
  "description": "Reusable Payload CMS website template — config builder, collections, globals, blocks, fields, access, hooks, metadata (JSON-LD, hreflang), page renderers, and test helpers.",
4
- "version": "0.3.2",
4
+ "version": "0.3.3",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "module": "./dist/index.js",