@jxsuite/server 0.13.0 → 0.15.0
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/package.json +1 -1
- package/src/resolve.js +1 -1
- package/src/studio-api.js +7 -5
package/package.json
CHANGED
package/src/resolve.js
CHANGED
|
@@ -40,7 +40,7 @@ export async function handleResolve(req, root) {
|
|
|
40
40
|
const docAbsDir = resolve(root, "." + docDir);
|
|
41
41
|
for (const [k, v] of Object.entries(config)) {
|
|
42
42
|
if (typeof v === "string" && (v.startsWith("./") || v.startsWith("../"))) {
|
|
43
|
-
config[k] = "./" + relative(process.cwd(), resolve(docAbsDir, v));
|
|
43
|
+
config[k] = "./" + relative(process.cwd(), resolve(docAbsDir, v)).split("\\").join("/");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
package/src/studio-api.js
CHANGED
|
@@ -203,11 +203,13 @@ export async function handleStudioApi(req, url, root, activeProjectRoot = null)
|
|
|
203
203
|
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
204
204
|
if (!home) return Response.json({ path: null });
|
|
205
205
|
const glob = new Bun.Glob(`**/${name}/project.json`);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
try {
|
|
207
|
+
for await (const match of glob.scan({ cwd: home, dot: false })) {
|
|
208
|
+
if (match.includes("node_modules") || match.includes(".Trash")) continue;
|
|
209
|
+
const abs = resolve(home, dirname(match));
|
|
210
|
+
return Response.json({ path: abs });
|
|
211
|
+
}
|
|
212
|
+
} catch {}
|
|
211
213
|
return Response.json({ path: null });
|
|
212
214
|
} catch (/** @type {any} */ e) {
|
|
213
215
|
return Response.json({ error: e.message }, { status: 500 });
|