@monkeyplus/flow 6.0.34 → 6.0.36

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.
@@ -3,6 +3,7 @@ import { existsSync } from "node:fs";
3
3
  import { copyFile, mkdir, readdir, readFile, rm, stat, writeFile } from "node:fs/promises";
4
4
  import { dirname, join, resolve } from "node:path";
5
5
  import process from "node:process";
6
+ import { consola } from "consola";
6
7
  import { createIPX, ipxFSStorage, ipxHttpStorage } from "ipx";
7
8
  const DEFAULT_BUILD_BATCH_SIZE = 8;
8
9
  function getGeneratedImageKey(entry) {
@@ -135,6 +136,8 @@ export async function materializeGeneratedImages(config) {
135
136
  originalSourcesToDelete.add(image.src);
136
137
  }
137
138
  }
139
+ const totalImages = images.length;
140
+ let processedCount = 0;
138
141
  for (const batch of createBatches(images, batchSize)) {
139
142
  const results = await Promise.all(batch.map(async (image) => {
140
143
  const signature = await createSignature(image, config.publicDir);
@@ -170,6 +173,8 @@ export async function materializeGeneratedImages(config) {
170
173
  cacheHits += result.cacheHit;
171
174
  generated += result.generated;
172
175
  }
176
+ processedCount += batch.length;
177
+ consola.info(`[flow:images] Progreso: procesadas ${processedCount} de ${totalImages} im\xE1genes...`);
173
178
  }
174
179
  if (config.netlifyCache && config.generatedCacheDir && config.generatedCacheManifestPath) {
175
180
  await mkdir(config.generatedCacheDir, { recursive: true });
@@ -168,8 +168,8 @@ export function createImageResolver(imagesOptions, stateImages, runtime = {}) {
168
168
  baseDir = getBaseDir(replacedPath, imagesOptions.dirImages);
169
169
  }
170
170
  const modifierSegment = getModifierSegment(image.modifiers);
171
- const relativePath = getRelativePath(replacedPath, baseDir);
172
- image.generate = joinURL(`/${baseDir}`, modifierSegment === "_" ? "" : modifierSegment, relativePath);
171
+ const baseURL = imagesOptions.baseURL || "/_ipx";
172
+ image.generate = joinURL(baseURL, modifierSegment === "_" ? "" : modifierSegment, replacedPath);
173
173
  if (originalExt) {
174
174
  image.generate = image.generate.replace(originalExt, image.ext);
175
175
  } else if (!image.generate.includes(".") && image.ext) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkeyplus/flow",
3
- "version": "6.0.34",
3
+ "version": "6.0.36",
4
4
  "description": "@monkeyplus/flow package-first runtime with Vite, Nitro, Vue and a workspace playground.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "bin": {
11
- "flow-images": "./dist/modules/images/cli-pregenerate.mjs"
11
+ "flow-images": "./modules/images/cli-pregenerate.mjs"
12
12
  },
13
13
  "exports": {
14
14
  ".": {