@lacspace/form 1.0.1 โ 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 +20 -6
- package/package.json +2 -2
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,16 +96,22 @@ 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)** โ
|
|
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)**.
|
|
100
|
+
|
|
101
|
+
<!-- LACSPACE-DEV-PLATFORM -->
|
|
92
102
|
|
|
93
103
|
---
|
|
94
104
|
|
|
95
|
-
|
|
105
|
+
## The Lacspace Developer Platform
|
|
96
106
|
|
|
97
|
-
|
|
107
|
+
`@lacspace/form` is part of **80+ zero-dependency, isomorphic TypeScript packages** โ one standard library for the modern web. Explore the ecosystem:
|
|
98
108
|
|
|
99
|
-
|
|
109
|
+
- ๐ฆ **This package, documented** โ https://developer.lacspace.com/packages/form
|
|
110
|
+
- ๐๏ธ **All 80+ packages** โ https://developer.lacspace.com/packages
|
|
111
|
+
- ๐งญ **Developer handbook** โ guides & runnable recipes โ https://developer.lacspace.com/handbook
|
|
112
|
+
- ๐งช **Live playground** โ run any package in your browser โ https://developer.lacspace.com/playground
|
|
113
|
+
- ๐ฅ๏ธ **Finished app templates** โ https://templates.lacspace.com
|
|
114
|
+
- ๐ **Scaffold a full app** โ `npm create lacspace-app@latest`
|
|
100
115
|
|
|
101
|
-
|
|
116
|
+
Free under the **[Lacspace Free Licence](https://developer.lacspace.com/licenses/lacspace-free-1.0)** โ a permissive, free-to-use licence.
|
|
102
117
|
|
|
103
|
-
<div align="center"><sub>Built with care by <a href="https://lacspace.com">Lacspace</a> ยท Lacspace Free Licence ยท <a href="https://github.com/lacspace/npm-packages">source</a></sub></div>
|
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",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
],
|
|
46
46
|
"author": "Lacspace <contact@lacspace.com>",
|
|
47
47
|
"license": "SEE LICENSE IN LICENSE",
|
|
48
|
-
"homepage": "https://lacspace.com/packages",
|
|
48
|
+
"homepage": "https://developer.lacspace.com/packages/form",
|
|
49
49
|
"repository": {
|
|
50
50
|
"type": "git",
|
|
51
51
|
"url": "git+https://github.com/lacspace/npm-packages.git",
|