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.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
|
|
1533
|
-
if (
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
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
|
}
|