robodev 0.17.0 → 0.18.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": "robodev",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "CLI for Robodev Starbase — create, auth, link, and deploy hosted apps",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -2,8 +2,8 @@ const authCustomJWT = {
2
2
  enableMagicLink: import.meta.env.VITE_PUBLIC_AUTH_CUSTOM_JWT_ENABLE_MAGIC_LINK === "true",
3
3
  };
4
4
 
5
- const apiUrl = import.meta.env.VITE_PUBLIC_API_URL ?? "http://localhost:4000";
6
- const apiOrigin = apiUrl.replace(/\/+$/, "") || "/";
5
+ const rawApiUrl = import.meta.env.VITE_PUBLIC_API_URL?.trim() ?? "";
6
+ const apiOrigin = /^https?:\/\//i.test(rawApiUrl) ? rawApiUrl.replace(/\/+$/, "") : "";
7
7
  const apiMode = import.meta.env.VITE_PUBLIC_API_MODE ?? "real";
8
8
  export const AppConfig = {
9
9
  isProduction: import.meta.env.NODE_ENV === "production",
@@ -11,7 +11,7 @@
11
11
  "@robodev-ai/sdk": "^0.6.0"
12
12
  },
13
13
  "devDependencies": {
14
- "robodev": "^0.17.0",
14
+ "robodev": "^0.18.0",
15
15
  "rulesync": "^8.18.0",
16
16
  "typescript": "^5.9.2"
17
17
  }
@@ -10,7 +10,7 @@
10
10
  "@robodev-ai/sdk": "^0.6.0"
11
11
  },
12
12
  "devDependencies": {
13
- "robodev": "^0.17.0",
13
+ "robodev": "^0.18.0",
14
14
  "typescript": "^5.9.2"
15
15
  }
16
16
  }
@@ -10,7 +10,7 @@
10
10
  "@robodev-ai/sdk": "^0.6.0"
11
11
  },
12
12
  "devDependencies": {
13
- "robodev": "^0.17.0",
13
+ "robodev": "^0.18.0",
14
14
  "typescript": "^5.9.2"
15
15
  }
16
16
  }
@@ -2,8 +2,8 @@ const authCustomJWT = {
2
2
  enableMagicLink: import.meta.env.VITE_PUBLIC_AUTH_CUSTOM_JWT_ENABLE_MAGIC_LINK === "true",
3
3
  };
4
4
 
5
- const apiUrl = import.meta.env.VITE_PUBLIC_API_URL ?? "http://localhost:4000";
6
- const apiOrigin = apiUrl.replace(/\/+$/, "") || "/";
5
+ const rawApiUrl = import.meta.env.VITE_PUBLIC_API_URL?.trim() ?? "";
6
+ const apiOrigin = /^https?:\/\//i.test(rawApiUrl) ? rawApiUrl.replace(/\/+$/, "") : "";
7
7
  const apiMode = import.meta.env.VITE_PUBLIC_API_MODE ?? "real";
8
8
  export const AppConfig = {
9
9
  isProduction: import.meta.env.NODE_ENV === "production",
@@ -40,9 +40,15 @@ export function useMediaUploadHandler({ resourceName, method, onUploaded }: UseM
40
40
  });
41
41
  formData.append("file", file);
42
42
 
43
- const uploadUrl = instructions.url.startsWith("http")
44
- ? instructions.url
45
- : `${AppConfig.api.url.replace(/\/+$/, "")}${instructions.url}`;
43
+ const origin = AppConfig.api.url.replace(/\/+$/, "");
44
+ const path = instructions.url;
45
+ const uploadUrl = /^https?:\/\//i.test(path)
46
+ ? path
47
+ : origin
48
+ ? `${origin}${path}`
49
+ : path.startsWith("/")
50
+ ? path
51
+ : `/${path}`;
46
52
 
47
53
  const response = await fetch(uploadUrl, {
48
54
  method: instructions.method.toUpperCase(),
@@ -11,7 +11,7 @@
11
11
  "@robodev-ai/sdk": "^0.6.0"
12
12
  },
13
13
  "devDependencies": {
14
- "robodev": "^0.17.0",
14
+ "robodev": "^0.18.0",
15
15
  "rulesync": "^8.18.0",
16
16
  "typescript": "^5.9.2"
17
17
  }