@lacspace/form 1.0.2 โ 1.0.3
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 +12 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
**Typed, validated, spam-protected form handling โ built for Next.js Server Actions.**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@lacspace/form)
|
|
8
|
+
[](https://bundlephobia.com/package/@lacspace/form)
|
|
9
|
+
[](https://www.npmjs.com/package/@lacspace/form)
|
|
8
10
|
[](https://github.com/lacspace/npm-packages/blob/main/LICENSE)
|
|
9
11
|
|
|
10
12
|
</div>
|
|
11
13
|
|
|
12
14
|
> Take a `FormData`, validate it against a schema, block bots with a honeypot + timing check, and get back **either your typed data or per-field errors ready to re-render**. Framework-agnostic, zero dependencies.
|
|
13
15
|
|
|
16
|
+
- ๐ฅ `formDataToObject(fd)` โ `FormData` โ plain object (repeated keys โ arrays, files passed through)
|
|
17
|
+
- โ
`createForm({ schema })` โ `{ handle, action }` โ `action` drops straight into React's `useActionState`
|
|
18
|
+
- ๐ฏ Spam guard โ a `honeypot` field + `minSubmitMs` timing check, internal fields stripped before validation
|
|
19
|
+
- ๐ฏ Typed result โ `{ ok: true, data }` or `{ ok: false, errors, values, spam? }` to re-render with input intact
|
|
20
|
+
- ๐ Zero dependencies ยท isomorphic ยท fully typed
|
|
21
|
+
|
|
14
22
|
## Install
|
|
15
23
|
|
|
16
24
|
```bash
|
|
@@ -88,7 +96,7 @@ Pairs with [`@lacspace/validate`](https://www.npmjs.com/package/@lacspace/valida
|
|
|
88
96
|
|
|
89
97
|
## Licensing
|
|
90
98
|
|
|
91
|
-
Free under the **[Lacspace Free Licence](https://lacspace.com/licenses/lacspace-free-1.0)** โ permissive freedoms. Use it in personal and commercial projects at no cost; just keep the notice. See the **[Lacspace Licence Centre](https://lacspace.com/licenses)**.
|
|
99
|
+
Free under the **[Lacspace Free Licence](https://developer.lacspace.com/licenses/lacspace-free-1.0)** โ permissive freedoms. Use it in personal and commercial projects at no cost; just keep the notice. See the **[Lacspace Licence Centre](https://lacspace.com/licenses)**.
|
|
92
100
|
|
|
93
101
|
<!-- LACSPACE-DEV-PLATFORM -->
|
|
94
102
|
|
|
@@ -96,14 +104,14 @@ Free under the **[Lacspace Free Licence](https://lacspace.com/licenses/lacspace-
|
|
|
96
104
|
|
|
97
105
|
## The Lacspace Developer Platform
|
|
98
106
|
|
|
99
|
-
`@lacspace/form` is part of **
|
|
107
|
+
`@lacspace/form` is part of **80+ zero-dependency, isomorphic TypeScript packages** โ one standard library for the modern web. Explore the ecosystem:
|
|
100
108
|
|
|
101
109
|
- ๐ฆ **This package, documented** โ https://developer.lacspace.com/packages/form
|
|
102
|
-
- ๐๏ธ **All
|
|
110
|
+
- ๐๏ธ **All 80+ packages** โ https://developer.lacspace.com/packages
|
|
103
111
|
- ๐งญ **Developer handbook** โ guides & runnable recipes โ https://developer.lacspace.com/handbook
|
|
104
112
|
- ๐งช **Live playground** โ run any package in your browser โ https://developer.lacspace.com/playground
|
|
105
113
|
- ๐ฅ๏ธ **Finished app templates** โ https://templates.lacspace.com
|
|
106
114
|
- ๐ **Scaffold a full app** โ `npm create lacspace-app@latest`
|
|
107
115
|
|
|
108
|
-
Free under the **[Lacspace Free Licence](https://lacspace.com/licenses/lacspace-free-1.0)** โ a permissive, free-to-use licence.
|
|
116
|
+
Free under the **[Lacspace Free Licence](https://developer.lacspace.com/licenses/lacspace-free-1.0)** โ a permissive, free-to-use licence.
|
|
109
117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lacspace/form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "End-to-end form handling for the server โ turn FormData into typed, validated data with a honeypot + timing spam guard, and get back your data or per-field errors ready to re-render. Shaped for Next.js Server Actions. Zero-dependency, isomorphic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|