@kevisual/cli 0.1.37 → 0.1.38

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.
@@ -128341,6 +128341,20 @@ class MarkLocalManager {
128341
128341
  fs22.writeFileSync(path19.join(markDir, "data.json"), JSON.stringify(mark, null, 2), "utf-8");
128342
128342
  if (opts?.stat) {
128343
128343
  const statInfo = fs22.statSync(markPath);
128344
+ const resources = mark.data?.resources || [];
128345
+ let resourceSize = 0;
128346
+ for (let resource of resources) {
128347
+ if (resource?.name && resource?.type === "file") {
128348
+ const filePath = path19.resolve(markDir, resource.name);
128349
+ console.log(`Calculating size for resource: ${filePath}`);
128350
+ try {
128351
+ const resStat = fs22.statSync(filePath);
128352
+ resourceSize += resStat.size;
128353
+ } catch (error114) {
128354
+ console.error(`Failed to get stat for resource: ${resource.name}`, error114);
128355
+ }
128356
+ }
128357
+ }
128344
128358
  stat.push({
128345
128359
  name: config7.folder + "/" + mark.name,
128346
128360
  size: statInfo.size,
@@ -128348,7 +128362,7 @@ class MarkLocalManager {
128348
128362
  tags: mark.tags || [],
128349
128363
  summary: mark.summary || "",
128350
128364
  updatedAt: mark?.updatedAt || statInfo.mtimeMs,
128351
- data: mark.data?.resources || []
128365
+ data: { resources, resourceSize }
128352
128366
  });
128353
128367
  }
128354
128368
  }
@@ -153877,6 +153877,20 @@ class MarkLocalManager {
153877
153877
  fs25.writeFileSync(path22.join(markDir, "data.json"), JSON.stringify(mark, null, 2), "utf-8");
153878
153878
  if (opts?.stat) {
153879
153879
  const statInfo = fs25.statSync(markPath);
153880
+ const resources = mark.data?.resources || [];
153881
+ let resourceSize = 0;
153882
+ for (let resource of resources) {
153883
+ if (resource?.name && resource?.type === "file") {
153884
+ const filePath = path22.resolve(markDir, resource.name);
153885
+ console.log(`Calculating size for resource: ${filePath}`);
153886
+ try {
153887
+ const resStat = fs25.statSync(filePath);
153888
+ resourceSize += resStat.size;
153889
+ } catch (error54) {
153890
+ console.error(`Failed to get stat for resource: ${resource.name}`, error54);
153891
+ }
153892
+ }
153893
+ }
153880
153894
  stat.push({
153881
153895
  name: config6.folder + "/" + mark.name,
153882
153896
  size: statInfo.size,
@@ -153884,7 +153898,7 @@ class MarkLocalManager {
153884
153898
  tags: mark.tags || [],
153885
153899
  summary: mark.summary || "",
153886
153900
  updatedAt: mark?.updatedAt || statInfo.mtimeMs,
153887
- data: mark.data?.resources || []
153901
+ data: { resources, resourceSize }
153888
153902
  });
153889
153903
  }
153890
153904
  }