@decocms/start 1.2.2 → 1.2.4
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/package.json +1 -1
- package/src/cms/resolve.ts +17 -0
package/package.json
CHANGED
package/src/cms/resolve.ts
CHANGED
|
@@ -504,12 +504,21 @@ async function internalResolve(value: unknown, rctx: ResolveContext): Promise<un
|
|
|
504
504
|
// Unknown type — resolve props but preserve __resolveType (it's a section)
|
|
505
505
|
const { __resolveType: _, ...rest } = obj;
|
|
506
506
|
|
|
507
|
+
if (resolveType.includes("eader")) {
|
|
508
|
+
console.log(`[HEADER-RESOLVE] resolveType="${resolveType}" restKeys=[${Object.keys(rest).join(",")}] depth=${rctx.depth}`);
|
|
509
|
+
}
|
|
510
|
+
|
|
507
511
|
// onBeforeResolveProps: let sections transform raw props before resolution.
|
|
508
512
|
// This runs with unresolved props (containing __resolveType refs) so sections
|
|
509
513
|
// can extract metadata that would be lost after resolution (e.g., collection IDs).
|
|
510
514
|
const propsToResolve = await applyOnBeforeResolveProps(resolveType, rest);
|
|
511
515
|
|
|
512
516
|
const resolvedRest = await resolveProps(propsToResolve, childCtx);
|
|
517
|
+
|
|
518
|
+
if (resolveType.includes("eader")) {
|
|
519
|
+
console.log(`[HEADER-RESOLVE] DONE resolvedKeys=[${Object.keys(resolvedRest).join(",")}]`);
|
|
520
|
+
}
|
|
521
|
+
|
|
513
522
|
return { __resolveType: resolveType, ...resolvedRest };
|
|
514
523
|
}
|
|
515
524
|
|
|
@@ -967,6 +976,11 @@ function resolveSectionShallow(
|
|
|
967
976
|
const rt = current.__resolveType as string | undefined;
|
|
968
977
|
if (!rt) return null;
|
|
969
978
|
|
|
979
|
+
// Debug: trace section resolution for Header
|
|
980
|
+
if (String(rt).includes("eader") || (depth > 0 && String(current.__resolveType).includes("eader"))) {
|
|
981
|
+
console.log(`[SECTION-RESOLVE] depth=${depth} rt="${rt}" currentKeys=${Object.keys(current).length} getSection=${!!getSection(rt)} inBlocks=${!!loadBlocks()[rt]}`);
|
|
982
|
+
}
|
|
983
|
+
|
|
970
984
|
if (SKIP_RESOLVE_TYPES.has(rt)) return null;
|
|
971
985
|
|
|
972
986
|
// Lazy wrapper — unwrap to the inner section
|
|
@@ -1020,6 +1034,9 @@ function resolveSectionShallow(
|
|
|
1020
1034
|
// Check if this is a registered section — we found it
|
|
1021
1035
|
if (getSection(rt)) {
|
|
1022
1036
|
const { __resolveType: _, ...rawProps } = current;
|
|
1037
|
+
if (rt.includes("eader")) {
|
|
1038
|
+
console.log(`[SECTION-RESOLVE] FOUND section "${rt}" rawProps keys: [${Object.keys(rawProps).join(", ")}]`);
|
|
1039
|
+
}
|
|
1023
1040
|
return {
|
|
1024
1041
|
component: rt,
|
|
1025
1042
|
key: rt,
|