diff --git a/index.html b/index.html index bea2c7b5..7672fb65 100644 --- a/index.html +++ b/index.html @@ -359,6 +359,8 @@

seed. zap. subscribe.

+ +
diff --git a/scripts/build-dist.mjs b/scripts/build-dist.mjs index 6e5d84ac..dcdd9f51 100644 --- a/scripts/build-dist.mjs +++ b/scripts/build-dist.mjs @@ -178,6 +178,7 @@ function injectVersionInfo() { fs.writeFileSync(indexHtmlPath, content); console.log(`Injected version: ${hash.slice(0, 8)} • ${date}`); } else { + console.warn('Warning: placeholder not found. Attempting regex fallback...'); // Fallback search if placeholder is missing (legacy behavior) const taglineRegex = /(seed\. zap\. subscribe\.\s*<\/h2>)/; if (taglineRegex.test(content)) { @@ -244,6 +245,12 @@ function main() { copyDir(dir, path.join(DIST, dir)); } + // Verify components were copied (critical for client-side injection) + const componentsDist = path.join(DIST, 'components'); + if (!fs.existsSync(componentsDist) || fs.readdirSync(componentsDist).length === 0) { + throw new Error('Critical Error: dist/components directory is missing or empty.'); + } + console.log('Generating hashed asset manifest...'); const manifest = generateHashedAssetManifest(); diff --git a/scripts/verify-dist-deploy-artifact.mjs b/scripts/verify-dist-deploy-artifact.mjs index fb1e3c39..c048face 100644 --- a/scripts/verify-dist-deploy-artifact.mjs +++ b/scripts/verify-dist-deploy-artifact.mjs @@ -5,7 +5,7 @@ import path from 'node:path'; const DIST_DIR = 'dist'; const INDEX_PATH = path.join(DIST_DIR, 'index.html'); const MANIFEST_PATH = path.join(DIST_DIR, 'asset-manifest.json'); -const VERSION_MARKUP_PATTERN = /seed\.\s*zap\.\s*subscribe\.\s*<\/h2>\s*]*>\s*v:\s*[a-f0-9]{8}\s*•\s*\d{4}-\d{2}-\d{2}\s*<\/div>/i; +const VERSION_MARKUP_PATTERN = /seed\.\s*zap\.\s*subscribe\.\s*<\/h2>[\s\S]*?v:\s*[a-f0-9]{8}\s*•\s*\d{4}-\d{2}-\d{2}/i; function readUtf8(filePath) { if (!fs.existsSync(filePath)) { diff --git a/verification.png b/verification.png index d22ea829..fc94bbe7 100644 Binary files a/verification.png and b/verification.png differ diff --git a/verify_version.py b/verify_version.py deleted file mode 100644 index 1b4c5318..00000000 --- a/verify_version.py +++ /dev/null @@ -1,33 +0,0 @@ -from playwright.sync_api import sync_playwright -import re - -def run(): - with sync_playwright() as p: - browser = p.chromium.launch() - page = browser.new_page() - try: - page.goto("http://localhost:8080") - - # Pattern for version string - pattern = re.compile(r"v:\s+[a-f0-9]{8}\s+•\s+\d{4}-\d{2}-\d{2}") - - locator = page.get_by_text(pattern) - locator.wait_for() - - # Scroll to element - locator.scroll_into_view_if_needed() - - # Take a screenshot of the element specifically, plus some context - # Or just the page after scrolling - page.screenshot(path="verification.png") - - content = locator.text_content() - print(f"Found version string: '{content.strip()}'") - - except Exception as e: - print(f"Error: {e}") - finally: - browser.close() - -if __name__ == "__main__": - run()