scribe-cms 0.0.9 → 0.0.10

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.
@@ -1450,7 +1450,7 @@ function validateTypeRedirects(project) {
1450
1450
  }
1451
1451
  for (const entry of loaded.entries) {
1452
1452
  for (const from of entry.fromSlugs) {
1453
- if (from === entry.toSlug) {
1453
+ if (entry.kind === "same-type" && from === entry.toSlug) {
1454
1454
  issues.push({
1455
1455
  level: "error",
1456
1456
  contentType: type.id,
@@ -1544,16 +1544,17 @@ function validateTypeRedirects(project) {
1544
1544
  if (!targetType?.path) continue;
1545
1545
  for (const from of entry.fromSlugs) {
1546
1546
  if (globalFrom.get(from)?.typeId !== file.contentTypeId) continue;
1547
- const chainTarget = globalFrom.get(entry.toSlug);
1548
- if (chainTarget) {
1549
- issues.push({
1550
- level: "error",
1551
- contentType: file.contentTypeId,
1552
- enSlug: from,
1553
- field: TYPE_REDIRECTS_FILENAME,
1554
- message: `Redirect chain detected: "${from}" \u2192 "${entry.toSlug}" \u2192 existing redirect source`
1555
- });
1556
- }
1547
+ const targetAsSource = globalFrom.get(entry.toSlug);
1548
+ if (!targetAsSource) continue;
1549
+ const sameSlugCrossType = entry.kind === "cross-type" && entry.fromSlugs.includes(entry.toSlug) && targetAsSource.typeId === file.contentTypeId;
1550
+ if (sameSlugCrossType) continue;
1551
+ issues.push({
1552
+ level: "error",
1553
+ contentType: file.contentTypeId,
1554
+ enSlug: from,
1555
+ field: TYPE_REDIRECTS_FILENAME,
1556
+ message: `Redirect chain detected: "${from}" \u2192 "${entry.toSlug}" \u2192 existing redirect source`
1557
+ });
1557
1558
  }
1558
1559
  }
1559
1560
  }