@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/server",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Jx development server with live reload, server-side proxy, and studio integration",
5
5
  "license": "MIT",
6
6
  "repository": {
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
- for await (const match of glob.scan({ cwd: home, dot: false })) {
207
- if (match.includes("node_modules") || match.includes(".Trash")) continue;
208
- const abs = resolve(home, dirname(match));
209
- return Response.json({ path: abs });
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 });