notform-nuxt 2.1.0 → 2.1.1
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 +84 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -6
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,15 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>notform-nuxt</h1>
|
|
3
|
+
<p><strong>NotForm, seamlessly integrated with Nuxt.</strong></p>
|
|
4
|
+
<p>
|
|
5
|
+
<a href="https://npmx.dev/package/notform-nuxt" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/npm/v/notform-nuxt.svg?style=plastic&label=NPM%20Version&color=blue" alt="NPM Version"></a>
|
|
6
|
+
<a href="https://npmx.dev/package/notform-nuxt" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/npm/dw/notform-nuxt.svg?style=plastic&label=NPM%20Downloads&color=blue" alt="NPM Downloads"></a>
|
|
7
|
+
<a href="https://npmx.dev/package/notform-nuxt" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/npm/unpacked-size/notform-nuxt?style=plastic&label=NPM%20Unpacked%20Size&color=blue" alt="NPM Unpacked Size"></a>
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
[](https://npmx.dev/package/notform)
|
|
5
|
-
[](https://npmx.dev/package/notform)
|
|
11
|
+
<br>
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
`notform-nuxt` is the official Nuxt module for [NotForm](../core). It provides auto-imports for NotForm composables and components, making form development in Nuxt applications seamless and type-safe.
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add notform
|
|
19
|
+
pnpm add -D notform-nuxt
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
Add `notform-nuxt` to the `modules` section of your `nuxt.config.ts`:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
export default defineNuxtConfig({
|
|
28
|
+
modules: [
|
|
29
|
+
'notform-nuxt'
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
That's it — all NotForm composables and components are now auto-imported in your Nuxt application.
|
|
35
|
+
|
|
36
|
+
## What the Module Does
|
|
37
|
+
|
|
38
|
+
1. **Auto-imports composables** — `useNotForm`, `NotForm`, `NotField`, `NotMessage`, `NotArrayField` are available everywhere without manual imports.
|
|
39
|
+
2. **Auto-imports components** — All NotForm components are globally available in your templates.
|
|
40
|
+
3. **Type-safe** — Full TypeScript support with auto-completion for all NotForm APIs.
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
After installing the module, you can use NotForm directly in your components:
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { z } from 'zod'
|
|
49
|
+
|
|
50
|
+
const schema = z.object({
|
|
51
|
+
name: z.string().min(1, 'Name is required'),
|
|
52
|
+
email: z.string().email('Invalid email'),
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const form = useNotForm({
|
|
56
|
+
schema,
|
|
57
|
+
onSubmit: (values) => {
|
|
58
|
+
console.log('Form submitted:', values)
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<NotForm :form="form" @submit="form.submit">
|
|
65
|
+
<NotField path="name">
|
|
66
|
+
<input v-model="form.values.name" type="text" />
|
|
67
|
+
<NotMessage path="name" />
|
|
68
|
+
</NotField>
|
|
69
|
+
<NotField path="email">
|
|
70
|
+
<input v-model="form.values.email" type="email" />
|
|
71
|
+
<NotMessage path="email" />
|
|
72
|
+
</NotField>
|
|
73
|
+
<button type="submit">Submit</button>
|
|
74
|
+
</NotForm>
|
|
75
|
+
</template>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
No imports needed — everything is auto-imported by the module.
|
|
79
|
+
|
|
80
|
+
## Prerequisites
|
|
81
|
+
|
|
82
|
+
- [Nuxt](https://nuxt.com/) v4 or later
|
|
83
|
+
- [NotForm](../core) core package
|
|
10
84
|
|
|
11
85
|
## Documentation
|
|
12
86
|
|
|
13
87
|
For detailed guides, API reference, and examples, visit:
|
|
14
88
|
**[notformdocs.vercel.app](https://notformdocs.vercel.app/getting-started/nuxt-module)**
|
|
15
89
|
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
[MIT](../../LICENSE) © [Favour Emeka](https://github.com/favorodera)
|
|
93
|
+
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -18,15 +18,10 @@ const module$1 = defineNuxtModule({
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
// Module factory
|
|
21
|
-
setup(
|
|
21
|
+
setup() {
|
|
22
22
|
const { resolve } = createResolver(import.meta.url);
|
|
23
23
|
const componentsRuntime = resolve("./runtime/components");
|
|
24
24
|
const composablesRuntime = resolve("./runtime/composables");
|
|
25
|
-
nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps ||= {};
|
|
26
|
-
nuxt.options.vite.optimizeDeps.exclude = nuxt.options.vite.optimizeDeps.exclude ||= [];
|
|
27
|
-
if (!nuxt.options.vite.optimizeDeps.exclude.includes("notform")) {
|
|
28
|
-
nuxt.options.vite.optimizeDeps.exclude.push("notform");
|
|
29
|
-
}
|
|
30
25
|
components.forEach((name) => {
|
|
31
26
|
addComponent({
|
|
32
27
|
name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notform-nuxt",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -36,16 +36,20 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@nuxt/kit": "^4.4.2",
|
|
39
|
-
"notform": "2.1.
|
|
39
|
+
"notform": "2.1.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@nuxt/module-builder": "^1.0.2",
|
|
43
43
|
"@nuxt/schema": "^4.4.2",
|
|
44
|
-
"nuxt": "^4.4.
|
|
44
|
+
"nuxt": "^4.4.6",
|
|
45
45
|
"vue-tsc": "^3.2.6"
|
|
46
46
|
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"nuxt": "^4.0.0"
|
|
49
|
+
},
|
|
47
50
|
"engines": {
|
|
48
|
-
"node": ">=22.0.0"
|
|
51
|
+
"node": ">=22.0.0",
|
|
52
|
+
"pnpm": ">=11.0.0"
|
|
49
53
|
},
|
|
50
54
|
"keywords": [
|
|
51
55
|
"notform-nuxt",
|