Compare commits

...

5 Commits

Author SHA1 Message Date
3906838dc1 fix: repair AVB parser to correctly detect ## headers and strip markdown artifacts
Some checks failed
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 4s
🚀 Build & Deploy / 🧪 QA (push) Successful in 2m8s
🚀 Build & Deploy / 🏗️ Build (push) Failing after 11m43s
🚀 Build & Deploy / 🚀 Deploy (push) Has been skipped
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
🚀 Build & Deploy / 🔔 Notify (push) Successful in 7s
2026-04-22 08:58:36 +02:00
785e36af08 fix: resolve TS2345 in pageerror handler by using unknown and type guard
Some checks failed
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 5s
🚀 Build & Deploy / 🧪 QA (push) Successful in 1m53s
🚀 Build & Deploy / 🏗️ Build (push) Successful in 11m58s
🚀 Build & Deploy / 🚀 Deploy (push) Successful in 11s
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 3m27s
🚀 Build & Deploy / 🔔 Notify (push) Successful in 2s
Nightly QA / call-qa-workflow (push) Failing after 26s
2026-04-21 19:32:07 +02:00
d4c32476d6 fix: remove unused urlObj to satisfy linter
Some checks failed
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 4s
🚀 Build & Deploy / 🧪 QA (push) Failing after 50s
🚀 Build & Deploy / 🚀 Deploy (push) Has been cancelled
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
🚀 Build & Deploy / 🔔 Notify (push) Has been cancelled
🚀 Build & Deploy / 🏗️ Build (push) Has been cancelled
2026-04-21 19:26:25 +02:00
9b9d4634dd fix: rename AGB to AVB in navigation and components for consistency
Some checks failed
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 6s
🚀 Build & Deploy / 🧪 QA (push) Failing after 1m5s
🚀 Build & Deploy / 🚀 Deploy (push) Has been cancelled
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
🚀 Build & Deploy / 🔔 Notify (push) Has been cancelled
🚀 Build & Deploy / 🏗️ Build (push) Has been cancelled
2026-04-21 19:21:47 +02:00
c9e48cd5a4 fix: resolve lint errors in CI scripts
Some checks failed
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 4s
🚀 Build & Deploy / 🧪 QA (push) Failing after 45s
🚀 Build & Deploy / 🏗️ Build (push) Failing after 11m9s
🚀 Build & Deploy / 🚀 Deploy (push) Has been skipped
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
🚀 Build & Deploy / 🔔 Notify (push) Successful in 2s
2026-04-21 19:05:24 +02:00
6 changed files with 78 additions and 67 deletions

View File

@@ -2,65 +2,45 @@ import { Download } from "lucide-react";
import fs from "fs";
import path from "path";
export default function AGB() {
export default function AVB() {
const filePath = path.join(process.cwd(), "context/avbs.md");
const fileContent = fs.readFileSync(filePath, "utf8");
// Split by double newlines to get major blocks (headers + their first paragraphs, or subsequent paragraphs)
const blocks = fileContent
// Split by double newlines to get major blocks
const rawBlocks = fileContent
.split(/\n\s*\n/)
.map((b) => b.trim())
.filter((b) => b !== "");
const title = blocks[0] || "Liefer- und Zahlungsbedingungen";
const stand = blocks[1] || "Stand Januar 2026";
const title = rawBlocks[0]?.replace(/^#\s+/, "") || "Allgemeine Verkaufsbedingungen";
const stand = rawBlocks[1] || "Stand: April 2026";
const sections: { title: string; content: string[] }[] = [];
let currentSection: { title: string; content: string[] } | null = null;
// Skip title and stand
blocks.slice(2).forEach((block) => {
const lines = block
.split("\n")
.map((l) => l.trim())
.filter((l) => l !== "");
if (lines.length === 0) return;
const firstLine = lines[0];
if (/^\d+\./.test(firstLine)) {
// New section
rawBlocks.slice(2).forEach((block) => {
if (block.startsWith("##")) {
// New section header: e.g. "## 1. Geltungsbereich"
if (currentSection) sections.push(currentSection);
currentSection = { title: firstLine, content: [] };
// If there are more lines in this block, they form the first paragraph(s)
if (lines.length > 1) {
// Join subsequent lines as they might be part of the same paragraph
// In this MD, we'll assume lines in the same block belong together
// unless they are clearly separate paragraphs (but we already split by double newline)
const remainingText = lines.slice(1).join(" ");
if (remainingText) currentSection.content.push(remainingText);
}
currentSection = {
title: block.replace(/^##\s+/, "").trim(),
content: []
};
} else if (currentSection) {
// Continuation of current section
const blockText = lines.join(" ");
if (blockText) currentSection.content.push(blockText);
// Content block: might be multiple paragraphs if not split by double newline,
// but here each block is one "paragraph" due to our split logic.
// We clean up bold markers for better display if they are just numbering.
const cleanedBlock = block.replace(/\*\*(.*?)\*\*/g, "$1");
currentSection.content.push(cleanedBlock);
}
});
if (currentSection) sections.push(currentSection);
// The last block is the footer
const footer = blocks[blocks.length - 1];
if (sections.length > 0) {
const lastSection = sections[sections.length - 1];
if (lastSection.content.includes(footer) || lastSection.title === footer) {
lastSection.content = lastSection.content.filter((c) => c !== footer);
if (sections[sections.length - 1].title === footer) {
sections.pop();
}
}
}
// The very last block might be a footer/schlussbestimmung if it's not in a section
// In our MD, everything is in a section, so we just use the last block of the last section as potential footer if we want,
// but the current UI expects a separate 'footer' variable.
const footer = "MB Grid Solutions & Services";
return (
<div className="bg-slate-50 min-h-screen pt-40 pb-20">

View File

@@ -246,7 +246,7 @@ const Layout = ({ children }: { children: React.ReactNode }) => {
href="/agb"
className="hover:text-accent transition-colors"
>
{t("footer.agb")}
{t("footer.avb")}
</Link>
</nav>
</div>

View File

@@ -81,7 +81,7 @@
"legal": "Rechtliches",
"impressum": "Impressum",
"datenschutz": "Datenschutz",
"agb": "AVB",
"avb": "AVB",
"rights": "Alle Rechte vorbehalten.",
"madeWith": "Entwickelt mit",
"precision": "Präzision",

View File

@@ -47,8 +47,9 @@ async function main() {
const others = urls.filter((u) => !homeEN.includes(u) && !homeDE.includes(u));
urls = [...homeDE, ...homeEN, ...others.slice(0, limit - (homeEN.length + homeDE.length))];
}
} catch (err: any) {
console.error(`❌ Failed to fetch sitemap: ${err.message}`);
} catch (err: unknown) {
const errorBody = err instanceof Error ? err.message : String(err);
console.error(`❌ Failed to fetch sitemap: ${errorBody}`);
process.exit(1);
}
@@ -78,10 +79,11 @@ async function main() {
const consoleErrorsList: Array<{ type: string; error: string; page: string }> = [];
// Listen for unhandled exceptions natively in the page
page.on('pageerror', (err: any) => {
page.on('pageerror', (err: unknown) => {
const errorMessage = err instanceof Error ? err.message : String(err);
consoleErrorsList.push({
type: 'PAGE_ERROR',
error: err.message,
error: errorMessage,
page: page.url(),
});
hasConsoleErrors = true;
@@ -163,8 +165,9 @@ async function main() {
// Wait a tiny bit more for final lazy loads
await new Promise((r) => setTimeout(r, 1000));
} catch (err: any) {
console.error(`⚠️ Timeout or navigation error on ${u}: ${err.message}`);
} catch (err: unknown) {
const errorBody = err instanceof Error ? err.message : String(err);
console.error(`⚠️ Timeout or navigation error on ${u}: ${errorBody}`);
// Don't fail the whole script just because one page timed out, but flag it
hasBrokenAssets = true;
}

View File

@@ -57,9 +57,10 @@ async function main() {
const filename = `${safePath || 'index'}.html`;
fs.writeFileSync(path.join(outputDir, filename), res.data);
} catch (err: any) {
console.error(`❌ HTTP Error fetching ${u}: ${err.message}`);
throw new Error(`Failed to fetch page: ${u} - ${err.message}`);
} catch (err: unknown) {
const errorBody = err instanceof Error ? err.message : String(err);
console.error(`❌ HTTP Error fetching ${u}: ${errorBody}`);
throw new Error(`Failed to fetch page: ${u} - ${errorBody}`);
}
}
@@ -67,12 +68,13 @@ async function main() {
try {
execSync(`npx html-validate .htmlvalidate-tmp/*.html`, { stdio: 'inherit' });
console.log(`✅ HTML Validation passed perfectly!`);
} catch (e) {
} catch {
console.error(`❌ HTML Validation found issues.`);
process.exit(1);
}
} catch (error: any) {
console.error(`\n❌ Error during HTML Validation:`, error.message);
} catch (error: unknown) {
const errorBody = error instanceof Error ? error.message : String(error);
console.error(`\n❌ Error during HTML Validation:`, errorBody);
process.exit(1);
} finally {
const outputDir = path.join(process.cwd(), '.htmlvalidate-tmp');

View File

@@ -3,6 +3,30 @@ import * as cheerio from 'cheerio';
import { execSync } from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
import { AxiosError } from 'axios';
interface Pa11yConfig {
defaults: {
threshold?: number;
runners?: string[];
ignore?: string[];
chromeLaunchConfig?: {
executablePath?: string;
args?: string[];
};
headers?: Record<string, string>;
timeout?: number;
};
urls?: string[];
}
interface Pa11yResult {
type?: string;
message?: string;
code?: string;
context?: string;
selector?: string;
}
/**
* WCAG Audit Script
@@ -65,14 +89,15 @@ async function main() {
// 2. Prepare pa11y-ci config
const baseConfigPath = path.join(process.cwd(), '.pa11yci.json');
let baseConfig: any = { defaults: {} };
let baseConfig: Pa11yConfig = { defaults: {} };
if (fs.existsSync(baseConfigPath)) {
baseConfig = JSON.parse(fs.readFileSync(baseConfigPath, 'utf8'));
}
// Extract domain for cookie
const urlObj = new URL(targetUrl);
const domain = urlObj.hostname;
// Extract domain for cookie (not currently used)
// const urlObj = new URL(targetUrl);
// domain is not used, so remove or keep if needed later? Linter says unused.
// const domain = urlObj.hostname;
// Update config with discovered URLs and gatekeeper cookie
const tempConfig = {
@@ -118,7 +143,7 @@ async function main() {
encoding: 'utf8',
stdio: 'inherit',
});
} catch (err: any) {
} catch {
// pa11y-ci exits with non-zero if issues are found, which is expected
}
@@ -136,10 +161,10 @@ async function main() {
if (Array.isArray(results)) {
// pa11y action execution errors come as objects with a message but no type
const actionErrors = results.filter((r: any) => !r.type && r.message).length;
errors = results.filter((r: any) => r.type === 'error').length + actionErrors;
warnings = results.filter((r: any) => r.type === 'warning').length;
notices = results.filter((r: any) => r.type === 'notice').length;
const actionErrors = results.filter((r: Pa11yResult) => !r.type && r.message).length;
errors = results.filter((r: Pa11yResult) => r.type === 'error').length + actionErrors;
warnings = results.filter((r: Pa11yResult) => r.type === 'warning').length;
notices = results.filter((r: Pa11yResult) => r.type === 'notice').length;
}
// Clean URL for display
@@ -168,13 +193,14 @@ async function main() {
}
console.log(`\n✨ WCAG Audit completed!`);
} catch (error: any) {
} catch (error: unknown) {
console.error(`\n❌ Error during WCAG Audit:`);
if (axios.isAxiosError(error)) {
if (error instanceof AxiosError) {
console.error(`Status: ${error.response?.status}`);
console.error(`URL: ${error.config?.url}`);
} else {
console.error(error.message);
const errorBody = error instanceof Error ? error.message : String(error);
console.error(errorBody);
}
process.exit(1);
} finally {