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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robodev",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "CLI for Robodev Starbase — create, auth, link, and deploy hosted apps",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -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`.
@@ -1,4 +1,4 @@
1
- /** GET /health — liveness check for the deployed project host. */
1
+ /** GET /api/health — liveness check for the deployed project host. */
2
2
  import { defineApi, z } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -1,4 +1,4 @@
1
- /** GET /me — current project user (Robodev Auth required). */
1
+ /** GET /api/me — current project user (Robodev Auth required). */
2
2
  import { defineApi, z } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -1,4 +1,4 @@
1
- /** GET/POST /messages — signed-in users read and post in the shared room. */
1
+ /** GET/POST /api/messages — signed-in users read and post in the shared room. */
2
2
  import { messages } from "../database";
3
3
  import { defineApi, desc, 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.2.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.9.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
- const session =
90
- mode === "signup"
91
- ? await api.auth.signUp({ email, password, name: name.trim() || undefined })
92
- : await api.auth.signIn.email({ email, password });
93
- setUser(session.user);
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/start`);
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={8}
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 /health — liveness check for the deployed project host. */
1
+ /** GET /api/health — liveness check for the deployed project host. */
2
2
  import { defineApi, z } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -1,4 +1,4 @@
1
- /** POST /launch — marks a rocket as launched. */
1
+ /** POST /api/launch — marks a rocket as launched. */
2
2
  import { rockets } from "../database";
3
3
  import { defineApi, eq, z } from "@robodev-ai/sdk";
4
4
 
@@ -1,4 +1,4 @@
1
- /** GET /me — current project user (Robodev Auth required). */
1
+ /** GET /api/me — current project user (Robodev Auth required). */
2
2
  import { defineApi, z } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -1,4 +1,4 @@
1
- /** GET /motto — plain-text envelope response. */
1
+ /** GET /api/motto — plain-text envelope response. */
2
2
  import { defineApi } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -1,4 +1,4 @@
1
- /** GET /planets/:id — one planet by path param. */
1
+ /** GET /api/planets/:id — one planet by path param. */
2
2
  import { defineApi, eq, z } from "@robodev-ai/sdk";
3
3
  import { planets } from "../../database";
4
4
 
@@ -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
 
@@ -1,4 +1,4 @@
1
- /** GET/POST /rockets — list (optional `?destinationId=`) and create rockets. */
1
+ /** GET/POST /api/rockets — list (optional `?destinationId=`) and create rockets. */
2
2
  import { rockets } from "../database";
3
3
  import { defineApi, eq, z } from "@robodev-ai/sdk";
4
4
 
@@ -10,7 +10,7 @@
10
10
  "@robodev-ai/sdk": "^0.6.0"
11
11
  },
12
12
  "devDependencies": {
13
- "robodev": "^0.9.0",
13
+ "robodev": "^0.11.0",
14
14
  "typescript": "^5.9.2"
15
15
  }
16
16
  }
@@ -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
  ]
@@ -1,6 +1,6 @@
1
1
  # {{NAME}}
2
2
 
3
- Blank `database.ts` and `GET /health` — no sample schema or UI. For Lovable, Bolt, or v0.
3
+ Blank `database.ts` and `GET /api/health` — no sample schema or UI. For Lovable, Bolt, or v0.
4
4
 
5
5
  Deploy `database.ts` and `api/` from a real terminal:
6
6
 
@@ -1,4 +1,4 @@
1
- /** GET /health — liveness check for the deployed project host. */
1
+ /** GET /api/health — liveness check for the deployed project host. */
2
2
  import { defineApi, z } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -10,7 +10,7 @@
10
10
  "@robodev-ai/sdk": "^0.6.0"
11
11
  },
12
12
  "devDependencies": {
13
- "robodev": "^0.9.0",
13
+ "robodev": "^0.11.0",
14
14
  "typescript": "^5.9.2"
15
15
  }
16
16
  }
@@ -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 /health — liveness check for the deployed project host. */
1
+ /** GET /api/health — liveness check for the deployed project host. */
2
2
  import { defineApi, z } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -1,4 +1,4 @@
1
- /** POST /launch — marks a rocket as launched. */
1
+ /** POST /api/launch — marks a rocket as launched. */
2
2
  import { rockets } from "../database";
3
3
  import { defineApi, eq, z } from "@robodev-ai/sdk";
4
4
 
@@ -1,4 +1,4 @@
1
- /** GET /me — current project user (Robodev Auth required). */
1
+ /** GET /api/me — current project user (Robodev Auth required). */
2
2
  import { defineApi, z } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -1,4 +1,4 @@
1
- /** GET /motto — plain-text envelope response. */
1
+ /** GET /api/motto — plain-text envelope response. */
2
2
  import { defineApi } from "@robodev-ai/sdk";
3
3
 
4
4
  export const get = defineApi({
@@ -1,4 +1,4 @@
1
- /** GET /planets/:id — one planet by path param. */
1
+ /** GET /api/planets/:id — one planet by path param. */
2
2
  import { defineApi, eq, z } from "@robodev-ai/sdk";
3
3
  import { planets } from "../../database";
4
4
 
@@ -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
 
@@ -1,4 +1,4 @@
1
- /** GET/POST /rockets — list (optional `?destinationId=`) and create rockets. */
1
+ /** GET/POST /api/rockets — list (optional `?destinationId=`) and create rockets. */
2
2
  import { rockets } from "../database";
3
3
  import { defineApi, eq, 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.2.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.9.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
  });