@supawatch/target-valibot 0.1.2 → 0.2.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/README.md +38 -0
- package/package.json +13 -2
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @supawatch/target-valibot
|
|
2
|
+
|
|
3
|
+
The Valibot target for
|
|
4
|
+
[supawatch](https://github.com/omar-dulaimi/supawatch). Renders one Valibot
|
|
5
|
+
schema per table from what the driver actually returns at runtime, plus a
|
|
6
|
+
typed `.d.mts` companion.
|
|
7
|
+
|
|
8
|
+
Configure it in `supawatch.config.ts` (the CLI loads this package by name):
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
targets: [{ kind: "valibot", strict: true }]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install valibot # peer dependency, resolved from your project
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Emitted shape:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import * as v from "valibot";
|
|
22
|
+
|
|
23
|
+
export const tasksRow = v.strictObject({
|
|
24
|
+
"id": v.string(),
|
|
25
|
+
"status": v.picklist(["todo", "doing", "done", "archived"]),
|
|
26
|
+
"estimate_hours": v.nullable(v.string()),
|
|
27
|
+
"created_at": v.date(),
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`strict` (default) uses `v.strictObject`. `emit: { insert, update }` adds
|
|
32
|
+
variants with `v.optional` on server-fillable columns and identity or
|
|
33
|
+
generated columns excluded.
|
|
34
|
+
|
|
35
|
+
Type mappings and their measured basis:
|
|
36
|
+
[main README](https://github.com/omar-dulaimi/supawatch#driver-profiles).
|
|
37
|
+
|
|
38
|
+
MIT.
|
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supawatch/target-valibot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Valibot schemas generated from live Postgres by supawatch, mapped to what the driver actually returns.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"supabase",
|
|
7
|
+
"postgres",
|
|
8
|
+
"postgresql",
|
|
9
|
+
"codegen",
|
|
10
|
+
"schema",
|
|
11
|
+
"typescript",
|
|
12
|
+
"valibot",
|
|
13
|
+
"validation"
|
|
14
|
+
],
|
|
4
15
|
"license": "MIT",
|
|
5
16
|
"author": "Omar Dulaimi",
|
|
6
17
|
"repository": {
|
|
@@ -22,7 +33,7 @@
|
|
|
22
33
|
],
|
|
23
34
|
"dependencies": {
|
|
24
35
|
"valibot": "^1.1.0",
|
|
25
|
-
"@supawatch/core": "0.
|
|
36
|
+
"@supawatch/core": "0.2.0"
|
|
26
37
|
},
|
|
27
38
|
"peerDependencies": {
|
|
28
39
|
"valibot": "^1.0.0"
|