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.cjs +12 -11
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +12 -11
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/src/validate/validate-redirects.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -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
|
|
1548
|
-
if (
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
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
|
}
|