@getcoherent/cli 0.3.9 → 0.3.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.js +21 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6633,6 +6633,27 @@ ${fixed}`;
|
|
|
6633
6633
|
const cleaned = inner.replace(/\s{2,}/g, " ").trim();
|
|
6634
6634
|
return `className="${cleaned}"`;
|
|
6635
6635
|
});
|
|
6636
|
+
let imgCounter = 1;
|
|
6637
|
+
const beforeImgFix = fixed;
|
|
6638
|
+
fixed = fixed.replace(/["']\/api\/placeholder\/(\d+)\/(\d+)["']/g, (_m, w, h) => {
|
|
6639
|
+
return `"https://picsum.photos/${w}/${h}?random=${imgCounter++}"`;
|
|
6640
|
+
});
|
|
6641
|
+
fixed = fixed.replace(/["']\/placeholder-avatar[^"']*["']/g, () => {
|
|
6642
|
+
return `"https://i.pravatar.cc/150?u=user${imgCounter++}"`;
|
|
6643
|
+
});
|
|
6644
|
+
fixed = fixed.replace(/["']https?:\/\/via\.placeholder\.com\/(\d+)x?(\d*)(?:\/[^"']*)?\/?["']/g, (_m, w, h) => {
|
|
6645
|
+
const height = h || w;
|
|
6646
|
+
return `"https://picsum.photos/${w}/${height}?random=${imgCounter++}"`;
|
|
6647
|
+
});
|
|
6648
|
+
fixed = fixed.replace(/["']\/images\/[^"']+\.(?:jpg|jpeg|png|webp|gif)["']/g, () => {
|
|
6649
|
+
return `"https://picsum.photos/800/400?random=${imgCounter++}"`;
|
|
6650
|
+
});
|
|
6651
|
+
fixed = fixed.replace(/["']\/placeholder[^"']*\.(?:jpg|jpeg|png|webp)["']/g, () => {
|
|
6652
|
+
return `"https://picsum.photos/800/400?random=${imgCounter++}"`;
|
|
6653
|
+
});
|
|
6654
|
+
if (fixed !== beforeImgFix) {
|
|
6655
|
+
fixes.push("placeholder images \u2192 working URLs (picsum/pravatar)");
|
|
6656
|
+
}
|
|
6636
6657
|
return { code: fixed, fixes };
|
|
6637
6658
|
}
|
|
6638
6659
|
function formatIssues(issues) {
|