howone 0.0.5 → 0.0.7

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": "howone",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "private": false,
5
5
  "description": "HowOne command line tools for creating app templates.",
6
6
  "type": "module",
@@ -0,0 +1,11 @@
1
+ Use the project SDK from `lib/sdk.ts` for backend access.
2
+
3
+ For entity CRUD, prefer typed project bindings:
4
+
5
+ ```ts
6
+ import howone from "@/lib/sdk"
7
+
8
+ await howone.entities.Todo.create({ text, completed: false })
9
+ ```
10
+
11
+ Do not call `howone.entity("Todo")` directly in application code when a typed `howone.entities.Todo` binding exists. Add or update the binding in `lib/sdk.ts` first.
@@ -1,7 +1,16 @@
1
- import { createClient } from "@howone/sdk"
1
+ import { createClient, defineEntities, withEntities } from '@howone/sdk'
2
2
 
3
- const howone = createClient({
4
- projectId: "demo",
3
+ export const HOWONE_PROJECT_ID = 'demo'
4
+
5
+ const client = createClient({
6
+ projectId: HOWONE_PROJECT_ID,
7
+ })
8
+
9
+ export const entities = defineEntities({
10
+ // Add generated entity bindings here, for example:
11
+ // Todo: client.entity<Todo, TodoCreate, TodoUpdate>("Todo"),
5
12
  })
6
13
 
14
+ const howone = withEntities(client, entities)
15
+
7
16
  export default howone
@@ -0,0 +1,11 @@
1
+ Use the project SDK from `src/lib/sdk.ts` for backend access.
2
+
3
+ For entity CRUD, prefer typed project bindings:
4
+
5
+ ```ts
6
+ import howone from "@/lib/sdk"
7
+
8
+ await howone.entities.Todo.create({ text, completed: false })
9
+ ```
10
+
11
+ Do not call `howone.entity("Todo")` directly in application code when a typed `howone.entities.Todo` binding exists. Add or update the binding in `src/lib/sdk.ts` first.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "vite",
3
3
  "private": true,
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
- "build": "tsc -b && vite build",
8
+ "build": "vite build",
9
9
  "lint": "eslint .",
10
10
  "format": "prettier --write \"**/*.{ts,tsx}\"",
11
11
  "typecheck": "tsc --noEmit",
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "@base-ui/react": "^1.4.1",
16
16
  "@fontsource-variable/inter": "^5.2.8",
17
- "@howone/sdk": "2.0.0-beta.0",
17
+ "@howone/sdk": "2.0.0-beta.2",
18
18
  "@tailwindcss/vite": "^4.2.1",
19
19
  "class-variance-authority": "^0.7.1",
20
20
  "clsx": "^2.1.1",
@@ -1,7 +1,16 @@
1
- import { createClient } from "@howone/sdk"
1
+ import { createClient, defineEntities, withEntities } from '@howone/sdk'
2
2
 
3
- const howone = createClient({
4
- projectId: "demo",
3
+ export const HOWONE_PROJECT_ID = 'demo'
4
+
5
+ const client = createClient({
6
+ projectId: HOWONE_PROJECT_ID,
7
+ })
8
+
9
+ export const entities = defineEntities({
10
+ // Add generated entity bindings here, for example:
11
+ // Todo: client.entity<Todo, TodoCreate, TodoUpdate>("Todo"),
5
12
  })
6
13
 
14
+ const howone = withEntities(client, entities)
15
+
7
16
  export default howone