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/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
|
|
1880
|
-
if (
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
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
|
}
|