robodev 0.2.1 → 0.3.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.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "CLI for Robodev Starbase — create, auth, link, and deploy file-based APIs",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -185,7 +185,7 @@ async function runLink(projectId?: string): Promise<void> {
185
185
  console.log(`Frontend API ${project.apiUrl}`);
186
186
  }
187
187
 
188
- /** Collects `database.ts` plus every `api/**/*.ts` file for a deploy upload. */
188
+ /** Collects `database.ts` plus every TypeScript file under `api/` for a deploy upload. */
189
189
  async function collectFiles(root: string): Promise<{ path: string; content: string }[]> {
190
190
  const files: { path: string; content: string }[] = [];
191
191
  const database = join(root, "database.ts");
@@ -12,6 +12,8 @@ It reads `VITE_API_URL` from `.env` (written by `robodev create` / `robodev link
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
16
+
15
17
  Add tables in `database.ts` and routes as `api/<name>.ts`, then:
16
18
 
17
19
  ```bash
@@ -0,0 +1,14 @@
1
+ /** GET /me — current project user (Robodev Auth required). */
2
+ import { defineApi, z } from "@robodev-ai/sdk";
3
+
4
+ export const get = defineApi({
5
+ auth: "required",
6
+ response: z.object({
7
+ user: z.object({
8
+ id: z.string(),
9
+ email: z.string(),
10
+ name: z.string().nullable().optional(),
11
+ }),
12
+ }),
13
+ handler: async ({ user }) => ({ user }),
14
+ });
@@ -10,13 +10,14 @@
10
10
  "dependencies": {
11
11
  "react": "^18.3.1",
12
12
  "react-dom": "^18.3.1",
13
- "@robodev-ai/sdk": "^0.2.0"
13
+ "@robodev-ai/sdk": "^0.3.0",
14
+ "@robodev-ai/client": "^0.1.0"
14
15
  },
15
16
  "devDependencies": {
16
17
  "@types/react": "^18.3.24",
17
18
  "@types/react-dom": "^18.3.7",
18
19
  "@vitejs/plugin-react": "^4.7.0",
19
- "robodev": "^0.2.0",
20
+ "robodev": "^0.3.0",
20
21
  "typescript": "^5.9.2",
21
22
  "vite": "^6.3.5"
22
23
  }