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/index.cjs CHANGED
@@ -1782,7 +1782,7 @@ function validateTypeRedirects(project) {
1782
1782
  }
1783
1783
  for (const entry of loaded.entries) {
1784
1784
  for (const from of entry.fromSlugs) {
1785
- if (from === entry.toSlug) {
1785
+ if (entry.kind === "same-type" && from === entry.toSlug) {
1786
1786
  issues.push({
1787
1787
  level: "error",
1788
1788
  contentType: type.id,
@@ -1876,16 +1876,17 @@ function validateTypeRedirects(project) {
1876
1876
  if (!targetType?.path) continue;
1877
1877
  for (const from of entry.fromSlugs) {
1878
1878
  if (globalFrom.get(from)?.typeId !== file.contentTypeId) continue;
1879
- const chainTarget = globalFrom.get(entry.toSlug);
1880
- if (chainTarget) {
1881
- issues.push({
1882
- level: "error",
1883
- contentType: file.contentTypeId,
1884
- enSlug: from,
1885
- field: TYPE_REDIRECTS_FILENAME,
1886
- message: `Redirect chain detected: "${from}" \u2192 "${entry.toSlug}" \u2192 existing redirect source`
1887
- });
1888
- }
1879
+ const targetAsSource = globalFrom.get(entry.toSlug);
1880
+ if (!targetAsSource) continue;
1881
+ const sameSlugCrossType = entry.kind === "cross-type" && entry.fromSlugs.includes(entry.toSlug) && targetAsSource.typeId === file.contentTypeId;
1882
+ if (sameSlugCrossType) continue;
1883
+ issues.push({
1884
+ level: "error",
1885
+ contentType: file.contentTypeId,
1886
+ enSlug: from,
1887
+ field: TYPE_REDIRECTS_FILENAME,
1888
+ message: `Redirect chain detected: "${from}" \u2192 "${entry.toSlug}" \u2192 existing redirect source`
1889
+ });
1889
1890
  }
1890
1891
  }
1891
1892
  }