@gallop.software/studio 1.0.3 → 1.0.5
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/handlers/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import path5 from "path";
|
|
|
15
15
|
import { promises as fs } from "fs";
|
|
16
16
|
import path from "path";
|
|
17
17
|
async function loadMeta() {
|
|
18
|
-
const metaPath = path.join(process.cwd(), "_data", "
|
|
18
|
+
const metaPath = path.join(process.cwd(), "_data", "studio.json");
|
|
19
19
|
try {
|
|
20
20
|
const content = await fs.readFile(metaPath, "utf-8");
|
|
21
21
|
return JSON.parse(content);
|
|
@@ -26,7 +26,7 @@ async function loadMeta() {
|
|
|
26
26
|
async function saveMeta(meta) {
|
|
27
27
|
const dataDir = path.join(process.cwd(), "_data");
|
|
28
28
|
await fs.mkdir(dataDir, { recursive: true });
|
|
29
|
-
const metaPath = path.join(dataDir, "
|
|
29
|
+
const metaPath = path.join(dataDir, "studio.json");
|
|
30
30
|
const ordered = {};
|
|
31
31
|
if (meta._cdns) {
|
|
32
32
|
ordered._cdns = meta._cdns;
|
|
@@ -1105,7 +1105,10 @@ async function handleSync(request) {
|
|
|
1105
1105
|
const pushed = [];
|
|
1106
1106
|
const errors = [];
|
|
1107
1107
|
const urlsToPurge = [];
|
|
1108
|
-
for (
|
|
1108
|
+
for (let imageKey of imageKeys) {
|
|
1109
|
+
if (!imageKey.startsWith("/")) {
|
|
1110
|
+
imageKey = `/${imageKey}`;
|
|
1111
|
+
}
|
|
1109
1112
|
const entry = getMetaEntry(meta, imageKey);
|
|
1110
1113
|
if (!entry) {
|
|
1111
1114
|
errors.push(`Image not found in meta: ${imageKey}. Run Scan first.`);
|
|
@@ -1206,7 +1209,10 @@ async function handleReprocess(request) {
|
|
|
1206
1209
|
const processed = [];
|
|
1207
1210
|
const errors = [];
|
|
1208
1211
|
const urlsToPurge = [];
|
|
1209
|
-
for (
|
|
1212
|
+
for (let imageKey of imageKeys) {
|
|
1213
|
+
if (!imageKey.startsWith("/")) {
|
|
1214
|
+
imageKey = `/${imageKey}`;
|
|
1215
|
+
}
|
|
1210
1216
|
try {
|
|
1211
1217
|
let buffer;
|
|
1212
1218
|
const entry = getMetaEntry(meta, imageKey);
|