robodev 0.9.0 → 0.11.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/templates/auth-chat/README.md +1 -1
- package/templates/auth-chat/api/health.ts +1 -1
- package/templates/auth-chat/api/me.ts +1 -1
- package/templates/auth-chat/api/messages.ts +1 -1
- package/templates/auth-chat/package.json +2 -2
- package/templates/auth-chat/src/main.tsx +13 -11
- package/templates/backend/README.md +1 -1
- package/templates/backend/api/health.ts +1 -1
- package/templates/backend/api/launch.ts +1 -1
- package/templates/backend/api/me.ts +1 -1
- package/templates/backend/api/motto.ts +1 -1
- package/templates/backend/api/planets/[id].ts +1 -1
- package/templates/backend/api/planets.ts +1 -1
- package/templates/backend/api/rockets.ts +1 -1
- package/templates/backend/package.json +1 -1
- package/templates/catalog.json +1 -1
- package/templates/empty/README.md +1 -1
- package/templates/empty/api/health.ts +1 -1
- package/templates/empty/package.json +1 -1
- package/templates/space/README.md +1 -1
- package/templates/space/api/health.ts +1 -1
- package/templates/space/api/launch.ts +1 -1
- package/templates/space/api/me.ts +1 -1
- package/templates/space/api/motto.ts +1 -1
- package/templates/space/api/planets/[id].ts +1 -1
- package/templates/space/api/planets.ts +1 -1
- package/templates/space/api/rockets.ts +1 -1
- package/templates/space/package.json +2 -2
- package/templates/space/src/main.tsx +5 -5
package/package.json
CHANGED
|
@@ -12,6 +12,6 @@ Local Vite reads `VITE_API_URL` from `.env` (written by `robodev create` / `robo
|
|
|
12
12
|
|
|
13
13
|
Docs: https://robodev.povio.dev/docs/starter
|
|
14
14
|
|
|
15
|
-
`GET /me` and `GET/POST /messages` (`api/me.ts`, `api/messages.ts`) require a Robodev Auth Bearer token. `GET /health` stays public. Email auth works without Google. If Google is not configured on Starbase, the button shows a 503 message. Google OAuth may not complete inside the dashboard preview iframe — use Open app.
|
|
15
|
+
`GET /api/me` and `GET/POST /api/messages` (`api/me.ts`, `api/messages.ts`) require a Robodev Auth Bearer token. `GET /api/health` stays public. Email auth works without Google. If Google is not configured on Starbase, the button shows a 503 message. Google OAuth may not complete inside the dashboard preview iframe — use Open app.
|
|
16
16
|
|
|
17
17
|
Edit files in the dashboard Code page, or here, then Save / `npx robodev deploy`.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"react": "^18.3.1",
|
|
13
13
|
"react-dom": "^18.3.1",
|
|
14
14
|
"@robodev-ai/sdk": "^0.6.0",
|
|
15
|
-
"@robodev-ai/client": "^0.
|
|
15
|
+
"@robodev-ai/client": "^0.3.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "^18.3.24",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"@vitejs/plugin-react": "^4.7.0",
|
|
21
21
|
"typescript": "^5.9.2",
|
|
22
22
|
"vite": "^6.3.5",
|
|
23
|
-
"robodev": "^0.
|
|
23
|
+
"robodev": "^0.11.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -40,7 +40,7 @@ function App() {
|
|
|
40
40
|
const listRef = useRef<HTMLDivElement>(null);
|
|
41
41
|
|
|
42
42
|
async function refreshMessages() {
|
|
43
|
-
const res = await api.fetch("/messages");
|
|
43
|
+
const res = await api.fetch("/api/messages");
|
|
44
44
|
if (!res.ok) throw new Error(await res.text());
|
|
45
45
|
setMessages((await res.json()) as Message[]);
|
|
46
46
|
}
|
|
@@ -74,7 +74,7 @@ function App() {
|
|
|
74
74
|
}, [messages]);
|
|
75
75
|
|
|
76
76
|
useEffect(() => {
|
|
77
|
-
void fetch(`${apiUrl}/messages`).then((res) => {
|
|
77
|
+
void fetch(`${apiUrl}/api/messages`).then((res) => {
|
|
78
78
|
setUnauthStatus(
|
|
79
79
|
`${res.status} ${res.status === 401 ? "unauthorized (expected)" : res.statusText}`,
|
|
80
80
|
);
|
|
@@ -86,11 +86,13 @@ function App() {
|
|
|
86
86
|
setPending(true);
|
|
87
87
|
setError(null);
|
|
88
88
|
try {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
if (mode === "signup") {
|
|
90
|
+
await api.auth.signUp({ email, password, name: name.trim() || undefined });
|
|
91
|
+
} else {
|
|
92
|
+
await api.auth.signIn.email({ email, password });
|
|
93
|
+
}
|
|
94
|
+
const { user: next } = await api.auth.getUser();
|
|
95
|
+
setUser(next);
|
|
94
96
|
setPassword("");
|
|
95
97
|
} catch (err) {
|
|
96
98
|
setError(err instanceof Error ? err.message : "Auth failed");
|
|
@@ -103,7 +105,7 @@ function App() {
|
|
|
103
105
|
setPending(true);
|
|
104
106
|
setError(null);
|
|
105
107
|
try {
|
|
106
|
-
const start = new URL(`${api.url}/auth/google
|
|
108
|
+
const start = new URL(`${api.url}/api/user/auth/google`);
|
|
107
109
|
start.searchParams.set("redirect_uri", window.location.href);
|
|
108
110
|
const probe = await fetch(start.toString(), { redirect: "manual" });
|
|
109
111
|
if (probe.status === 503) {
|
|
@@ -132,7 +134,7 @@ function App() {
|
|
|
132
134
|
setPending(true);
|
|
133
135
|
setError(null);
|
|
134
136
|
try {
|
|
135
|
-
const res = await api.fetch("/messages", {
|
|
137
|
+
const res = await api.fetch("/api/messages", {
|
|
136
138
|
method: "POST",
|
|
137
139
|
body: JSON.stringify({ body: draft.trim() }),
|
|
138
140
|
});
|
|
@@ -161,7 +163,7 @@ function App() {
|
|
|
161
163
|
<h1>{{NAME}}</h1>
|
|
162
164
|
<p className="lede">
|
|
163
165
|
Sign in with email or Google. Protected APIs live at {apiUrl}. Unauthenticated GET
|
|
164
|
-
/messages: {unauthStatus ?? "checking…"}.
|
|
166
|
+
/api/messages: {unauthStatus ?? "checking…"}.
|
|
165
167
|
</p>
|
|
166
168
|
{error ? <p className="error">{error}</p> : null}
|
|
167
169
|
|
|
@@ -208,7 +210,7 @@ function App() {
|
|
|
208
210
|
<input
|
|
209
211
|
type="password"
|
|
210
212
|
required
|
|
211
|
-
minLength={
|
|
213
|
+
minLength={12}
|
|
212
214
|
autoComplete={mode === "signup" ? "new-password" : "current-password"}
|
|
213
215
|
value={password}
|
|
214
216
|
onChange={(event) => setPassword(event.target.value)}
|
|
@@ -14,4 +14,4 @@ Do not run `npm run dev` or `npm run build` in this folder. Do not run `robodev`
|
|
|
14
14
|
|
|
15
15
|
Frontend how-to: https://robodev.povio.dev/docs/frontend
|
|
16
16
|
|
|
17
|
-
`GET /me` (`api/me.ts`) requires a Robodev Auth Bearer token. Planet and rocket routes stay public.
|
|
17
|
+
`GET /api/me` (`api/me.ts`) requires a Robodev Auth Bearer token. Planet and rocket routes stay public.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** GET/POST /planets — list (seeds sample rows on first GET) and create planets. */
|
|
1
|
+
/** GET/POST /api/planets — list (seeds sample rows on first GET) and create planets. */
|
|
2
2
|
import { planets, rockets } from "../database";
|
|
3
3
|
import { defineApi, z } from "@robodev-ai/sdk";
|
|
4
4
|
|
package/templates/catalog.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
{
|
|
20
20
|
"id": "empty",
|
|
21
21
|
"title": "Empty",
|
|
22
|
-
"description": "Blank database.ts and GET /health — no sample schema or UI. For Lovable, Bolt, or v0",
|
|
22
|
+
"description": "Blank database.ts and GET /api/health — no sample schema or UI. For Lovable, Bolt, or v0",
|
|
23
23
|
"kind": "backend"
|
|
24
24
|
}
|
|
25
25
|
]
|
|
@@ -12,6 +12,6 @@ Local Vite reads `VITE_API_URL` from `.env` (written by `robodev create` / `robo
|
|
|
12
12
|
|
|
13
13
|
Docs: https://robodev.povio.dev/docs
|
|
14
14
|
|
|
15
|
-
`GET /me` (`api/me.ts`) requires a Robodev Auth Bearer token. Planet and rocket routes stay public. Optional browser helper: `@robodev-ai/client`. Auth how-to: https://robodev.povio.dev/docs/auth
|
|
15
|
+
`GET /api/me` (`api/me.ts`) requires a Robodev Auth Bearer token. Planet and rocket routes stay public. Optional browser helper: `@robodev-ai/client`. Auth how-to: https://robodev.povio.dev/docs/auth
|
|
16
16
|
|
|
17
17
|
Edit files in the dashboard Code page, or here, then Save / `npx robodev deploy`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** GET/POST /planets — list (seeds sample rows on first GET) and create planets. */
|
|
1
|
+
/** GET/POST /api/planets — list (seeds sample rows on first GET) and create planets. */
|
|
2
2
|
import { planets, rockets } from "../database";
|
|
3
3
|
import { defineApi, z } from "@robodev-ai/sdk";
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"react": "^18.3.1",
|
|
13
13
|
"react-dom": "^18.3.1",
|
|
14
14
|
"@robodev-ai/sdk": "^0.6.0",
|
|
15
|
-
"@robodev-ai/client": "^0.
|
|
15
|
+
"@robodev-ai/client": "^0.3.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "^18.3.24",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"@vitejs/plugin-react": "^4.7.0",
|
|
21
21
|
"typescript": "^5.9.2",
|
|
22
22
|
"vite": "^6.3.5",
|
|
23
|
-
"robodev": "^0.
|
|
23
|
+
"robodev": "^0.11.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -33,8 +33,8 @@ function App() {
|
|
|
33
33
|
const [rocketForm, setRocketForm] = useState({ name: "", destinationId: "" });
|
|
34
34
|
|
|
35
35
|
async function refresh() {
|
|
36
|
-
const nextPlanets = await request<Planet[]>("/planets");
|
|
37
|
-
const nextRockets = await request<Rocket[]>("/rockets");
|
|
36
|
+
const nextPlanets = await request<Planet[]>("/api/planets");
|
|
37
|
+
const nextRockets = await request<Rocket[]>("/api/rockets");
|
|
38
38
|
setPlanets(nextPlanets);
|
|
39
39
|
setRockets(nextRockets);
|
|
40
40
|
setRocketForm((form) => ({
|
|
@@ -54,7 +54,7 @@ function App() {
|
|
|
54
54
|
setPending(true);
|
|
55
55
|
setError(null);
|
|
56
56
|
try {
|
|
57
|
-
await request("/planets", {
|
|
57
|
+
await request("/api/planets", {
|
|
58
58
|
method: "POST",
|
|
59
59
|
body: JSON.stringify({
|
|
60
60
|
name: planetForm.name,
|
|
@@ -76,7 +76,7 @@ function App() {
|
|
|
76
76
|
setPending(true);
|
|
77
77
|
setError(null);
|
|
78
78
|
try {
|
|
79
|
-
await request("/rockets", {
|
|
79
|
+
await request("/api/rockets", {
|
|
80
80
|
method: "POST",
|
|
81
81
|
body: JSON.stringify({
|
|
82
82
|
name: rocketForm.name,
|
|
@@ -96,7 +96,7 @@ function App() {
|
|
|
96
96
|
setPending(true);
|
|
97
97
|
setError(null);
|
|
98
98
|
try {
|
|
99
|
-
await request("/launch", {
|
|
99
|
+
await request("/api/launch", {
|
|
100
100
|
method: "POST",
|
|
101
101
|
body: JSON.stringify({ id }),
|
|
102
102
|
});
|