@base44-preview/cli 0.2.6-pr.686.168cf90 → 0.2.6-pr.686.434aab7
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/cli/index.js +11 -3
- package/dist/cli/index.js.map +3 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -265213,7 +265213,7 @@ function lastCleanWrite(entries, path) {
|
|
|
265213
265213
|
var readRegularFile = (path) => stat4(path).then((info) => info.isFile() ? readFile5(path) : undefined, () => {
|
|
265214
265214
|
return;
|
|
265215
265215
|
});
|
|
265216
|
-
async function inlineImages(html, files) {
|
|
265216
|
+
async function inlineImages(html, files, missing) {
|
|
265217
265217
|
const text = html.toString("utf8");
|
|
265218
265218
|
const uris = new Map;
|
|
265219
265219
|
for (const [, , , src = ""] of text.matchAll(IMG_SRC)) {
|
|
@@ -265222,6 +265222,8 @@ async function inlineImages(html, files) {
|
|
|
265222
265222
|
const data = mediaType && await readRegularFile(local);
|
|
265223
265223
|
if (data)
|
|
265224
265224
|
uris.set(src, `data:${mediaType};base64,${data.toString("base64")}`);
|
|
265225
|
+
else if (local)
|
|
265226
|
+
missing.push(src);
|
|
265225
265227
|
}
|
|
265226
265228
|
if (!uris.size)
|
|
265227
265229
|
return html;
|
|
@@ -265262,7 +265264,13 @@ async function collectArtifacts2(session, budget = MAX_REQUEST_BYTES - session.l
|
|
|
265262
265264
|
continue;
|
|
265263
265265
|
}
|
|
265264
265266
|
if (found.files && /\.html?$/i.test(fileName)) {
|
|
265265
|
-
|
|
265267
|
+
const missing = [];
|
|
265268
|
+
data = await inlineImages(data, found.files, missing);
|
|
265269
|
+
for (const src of new Set(missing))
|
|
265270
|
+
skipped.push({
|
|
265271
|
+
fileName: src,
|
|
265272
|
+
reason: `this image in ${fileName} isn't on disk anymore`
|
|
265273
|
+
});
|
|
265266
265274
|
}
|
|
265267
265275
|
if (data.length > MAX_BYTES) {
|
|
265268
265276
|
skipped.push({ fileName, reason: "it's larger than 10 MB" });
|
|
@@ -274973,4 +274981,4 @@ export {
|
|
|
274973
274981
|
runCLI
|
|
274974
274982
|
};
|
|
274975
274983
|
|
|
274976
|
-
//# debugId=
|
|
274984
|
+
//# debugId=C068BFC2F2A8F3FB64756E2164756E21
|