Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions scripts/merging-show-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ const validateTimestamps = (content) => {
return invalidTimestamps;
};

// Function to check frontmatter for invalid whitespace characters
const validateFrontmatter = (content) => {
const frontMatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
if (!frontMatterMatch) return [];

const errors = [];
const frontMatter = frontMatterMatch[1];
if (frontMatter.includes('\u00A0')) {
errors.push('non-breaking space (U+00A0) found in frontmatter — use regular spaces for indentation');
}
return errors;
};

// Function to process a single markdown file for broken links
const processFile = async (filePath) => {
const content = await fs.readFile(filePath, 'utf8');
Expand All @@ -115,10 +128,12 @@ const processFile = async (filePath) => {
const brokenLinks = urlsToCheck.filter((_, index) => !results[index]);

const invalidTimestamps = validateTimestamps(content);
const frontmatterErrors = validateFrontmatter(content);

return {
brokenLinks,
invalidTimestamps
invalidTimestamps,
frontmatterErrors
};
};

Expand Down Expand Up @@ -149,13 +164,14 @@ const main = async () => {
console.log('No new markdown files to check in ./shows.');
} else {
for (const file of mdFiles) {
const { brokenLinks, invalidTimestamps } = await processFile(file);
if (brokenLinks.length > 0 || invalidTimestamps.length > 0) {
const { brokenLinks, invalidTimestamps, frontmatterErrors } = await processFile(file);
if (brokenLinks.length > 0 || invalidTimestamps.length > 0 || frontmatterErrors.length > 0) {
errorMessages.push(`Issues found in ${file}:`);
brokenLinks.forEach((link) => errorMessages.push(`- Broken link: ${link}`));
invalidTimestamps.forEach((timestamp) =>
errorMessages.push(`- Invalid timestamp: ${timestamp}`)
);
frontmatterErrors.forEach((err) => errorMessages.push(`- Invalid frontmatter: ${err}`));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions shows/991 - Vites bet on Cloudflare VOID Framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ date: 1774868400000
url: https://traffic.megaphone.fm/FSI5967497459.mp3
youtube_url: https://www.youtube.com/watch?v=wtkZUdkUHhc
hosts:
  - stolinski
  - wesbos
  - w3cj
- stolinski
- wesbos
- w3cj
---

Vite just launched Void, a fullstack JavaScript framework and cloud platform that bundles together routing, SSR, auth, an ORM, and nearly everything you'd expect from a modern meta-framework — all built on top of Cloudflare's infrastructure. Scott, Wes, and CJ dig into whether Void is the Rails moment JavaScript has been waiting for, or just shiny Cloudflare lock-in with a bow on it.
Expand Down
Loading