From 1eccc810f0db3ac84587d647ab33e99ee8bf82e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julien=20D=C3=A9ramond?= Date: Tue, 5 Aug 2025 20:55:52 +0200 Subject: [PATCH] Docs: unminify package example HTML files (#41637) --- build/zip-examples.mjs | 25 ++++++++++++++++--- .../examples/cheatsheet-rtl/index.astro | 5 ++-- .../assets/examples/cheatsheet/index.astro | 5 ++-- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/build/zip-examples.mjs b/build/zip-examples.mjs index 03995efd53..6b2e1e0dac 100644 --- a/build/zip-examples.mjs +++ b/build/zip-examples.mjs @@ -11,6 +11,7 @@ import fs from 'node:fs/promises' import path from 'node:path' import { fileURLToPath } from 'node:url' import sh from 'shelljs' +import { format } from 'prettier' const __dirname = path.dirname(fileURLToPath(import.meta.url)) @@ -83,7 +84,9 @@ for (const file of staticJsFiles) { sh.rm(`${distFolder}/index.html`) // get all examples' HTML files -for (const file of sh.find(`${distFolder}/**/*.html`)) { +const htmlFiles = sh.find(`${distFolder}/**/*.html`) + +const formatPromises = htmlFiles.map(async file => { const fileContents = sh.cat(file) .toString() .replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../') @@ -91,8 +94,24 @@ for (const file of sh.find(`${distFolder}/**/*.html`)) { .replace(/(]*) integrity="[^"]*"/g, '$1') .replace(/]*href="\.\.\/assets\/img\/favicons\/[^"]*"[^>]*>/g, '') .replace(/(