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.
package/dist/cli/index.js CHANGED
@@ -1435,7 +1435,7 @@ function validateTypeRedirects(project) {
1435
1435
  }
1436
1436
  for (const entry of loaded.entries) {
1437
1437
  for (const from of entry.fromSlugs) {
1438
- if (from === entry.toSlug) {
1438
+ if (entry.kind === "same-type" && from === entry.toSlug) {
1439
1439
  issues.push({
1440
1440
  level: "error",
1441
1441
  contentType: type.id,
@@ -1529,16 +1529,17 @@ function validateTypeRedirects(project) {
1529
1529
  if (!targetType?.path) continue;
1530
1530
  for (const from of entry.fromSlugs) {
1531
1531
  if (globalFrom.get(from)?.typeId !== file.contentTypeId) continue;
1532
- const chainTarget = globalFrom.get(entry.toSlug);
1533
- if (chainTarget) {
1534
- issues.push({
1535
- level: "error",
1536
- contentType: file.contentTypeId,
1537
- enSlug: from,
1538
- field: TYPE_REDIRECTS_FILENAME,
1539
- message: `Redirect chain detected: "${from}" \u2192 "${entry.toSlug}" \u2192 existing redirect source`
1540
- });
1541
- }
1532
+ const targetAsSource = globalFrom.get(entry.toSlug);
1533
+ if (!targetAsSource) continue;
1534
+ const sameSlugCrossType = entry.kind === "cross-type" && entry.fromSlugs.includes(entry.toSlug) && targetAsSource.typeId === file.contentTypeId;
1535
+ if (sameSlugCrossType) continue;
1536
+ issues.push({
1537
+ level: "error",
1538
+ contentType: file.contentTypeId,
1539
+ enSlug: from,
1540
+ field: TYPE_REDIRECTS_FILENAME,
1541
+ message: `Redirect chain detected: "${from}" \u2192 "${entry.toSlug}" \u2192 existing redirect source`
1542
+ });
1542
1543
  }
1543
1544
  }
1544
1545
  }