Skip to content

Commit e52a34c

Browse files
chore: fix comparison table and bump to v0.4.1 (#12)
* chore(seo): improve discoverability across npm, GitHub, and search engines - Point homepage to docs site for npm canonical link - Add 10 keywords to package.json (nuxt3, nuxt4, vue3, typescript, etc.) - Add 8 GitHub topics for search visibility - Add "Why nuxt-safe-action?" section and comparison table to README - Add TypeScript badge to README - Expand Open Graph and Twitter Card meta on docs landing page - Add site.url for proper sitemap and canonical tag generation - Add robots.txt with sitemap reference - Enrich all docs page descriptions for better meta tags * chore: fix comparison table accuracy and bump to v0.4.1 Acknowledge useFetch, file-based server routes, and output type inference in the $fetch column. Reframe the "Why" section around genuine differentiators: input type safety, per-action middleware, and field-level validation errors.
1 parent 51c9411 commit e52a34c

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@ const { execute, data, status, validationErrors } = useAction(createPost)
5050

5151
## Why nuxt-safe-action?
5252

53-
Calling server endpoints with raw `$fetch` is untyped, error-prone, and forces you to manually handle validation, error formatting, and loading states. `nuxt-safe-action` gives you a declarative builder that validates input with Zod, chains middleware for auth and logging, and returns reactive state on the client, all with full end-to-end type inference. It works with Nuxt 3 and Nuxt 4, supports both Zod v3 and v4, and adds minimal bundle overhead.
53+
Nuxt already provides `useFetch`/`$fetch` with typed responses and file-based server routes. But input types, validation, and error handling are still left to you in every route handler. `nuxt-safe-action` adds a declarative builder that validates input with Zod, chains per-action middleware for auth and logging, and returns field-level validation errors to the client. It works with Nuxt 3 and Nuxt 4, supports both Zod v3 and v4, and adds minimal bundle overhead.
5454

5555
### Comparison
5656

57-
| | `$fetch` | tRPC-nuxt | **nuxt-safe-action** |
57+
| | `$fetch` / `useFetch` | tRPC-nuxt | **nuxt-safe-action** |
5858
|---|---|---|---|
59-
| Type safety | manual | full | full |
60-
| Input validation | manual | via zod | built-in zod |
61-
| Middleware | manual | via context | composable chain |
62-
| File-based routing | N/A | no | auto-generated |
63-
| Vue composable | no | no | `useAction` |
59+
| End-to-end type safety | output only | full | full |
60+
| Input validation | manual per route | via zod | built-in zod |
61+
| Per-action middleware | no | yes | composable chain |
62+
| Field-level validation errors | no | no | built-in |
63+
| File-based routing | `server/api/` | procedure-based | `server/actions/` |
64+
| Reactive composable | `useFetch` | `useQuery` | `useAction` |
6465
| Bundle overhead | none | heavy | minimal |
6566

6667
## Quick Setup

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuxt-safe-action",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Type-safe and validated server actions for Nuxt",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)