notform-nuxt 2.1.0 → 2.1.2

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 CHANGED
@@ -1,15 +1,106 @@
1
- # notform-nuxt
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
- [![npm version](https://img.shields.io/npm/v/notform-nuxt.svg?style=plastic)](https://npmx.dev/package/notform-nuxt)
4
- [![npm downloads](https://img.shields.io/npm/dm/notform-nuxt.svg?style=plastic)](https://npmx.dev/package/notform)
5
- [![NPM Unpacked Size](https://img.shields.io/npm/unpacked-size/notform-nuxt?style=plastic)](https://npmx.dev/package/notform)
11
+ <br>
6
12
 
7
- **Official Nuxt module for NotForm**
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
- `notform-nuxt` provides seamless integration for NotForm in Nuxt applications, including auto-imports and Nuxt-specific optimizations.
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: ['notform-nuxt'],
29
+ })
30
+ ```
31
+
32
+ That's it — all NotForm composables and components are now auto-imported in your Nuxt application.
33
+
34
+ ## What the Module Does
35
+
36
+ 1. **Auto-imports composables** — `useNotForm`, `NotForm`, `NotField`, `NotMessage`, `NotArrayField` are available everywhere without manual imports.
37
+ 2. **Auto-imports components** — All NotForm components are globally available in your templates.
38
+ 3. **Type-safe** — Full TypeScript support with auto-completion for all NotForm APIs.
39
+
40
+ ## Usage
41
+
42
+ After installing the module, you can use NotForm directly in your components:
43
+
44
+ ```vue
45
+ <script setup lang="ts">
46
+ import { z } from 'zod'
47
+
48
+ const schema = z.object({
49
+ email: z.string().email('Invalid email'),
50
+ name: z.string().min(1, 'Name is required'),
51
+ })
52
+
53
+ const form = useNotForm({
54
+ onSubmit: (values) => {
55
+ console.log('Form submitted:', values)
56
+ },
57
+ schema,
58
+ })
59
+ </script>
60
+
61
+ <template>
62
+ <NotForm
63
+ :form="form"
64
+ @submit="form.submit"
65
+ >
66
+ <NotField path="name">
67
+ <input
68
+ v-model="form.values.name"
69
+ type="text"
70
+ >
71
+
72
+ <NotMessage path="name" />
73
+ </NotField>
74
+
75
+ <NotField path="email">
76
+ <input
77
+ v-model="form.values.email"
78
+ type="email"
79
+ >
80
+
81
+ <NotMessage path="email" />
82
+ </NotField>
83
+
84
+ <button type="submit">
85
+ Submit
86
+ </button>
87
+ </NotForm>
88
+ </template>
89
+ ```
90
+
91
+ No imports needed — everything is auto-imported by the module.
92
+
93
+ ## Prerequisites
94
+
95
+ - [Nuxt](https://nuxt.com/) v4 or later
96
+ - [NotForm](../core) core package
10
97
 
11
98
  ## Documentation
12
99
 
13
100
  For detailed guides, API reference, and examples, visit:
14
101
  **[notformdocs.vercel.app](https://notformdocs.vercel.app/getting-started/nuxt-module)**
15
102
 
103
+ ## License
104
+
105
+ [MIT](../../LICENSE) &copy; [Favour Emeka](https://github.com/favorodera)
106
+
package/dist/module.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
- "name": "notform-nuxt",
3
- "configKey": "notform",
4
2
  "compatibility": {
5
3
  "nuxt": ">=4.0.0"
6
4
  },
7
- "version": "2.1.0",
5
+ "configKey": "notform",
6
+ "name": "notform-nuxt",
7
+ "version": "2.1.2",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, addComponent, addImports } from '@nuxt/kit';
1
+ import { defineNuxtModule, addComponent, addImports } from '@nuxt/kit';
2
2
 
3
3
  const components = [
4
4
  "NotForm",
@@ -6,40 +6,26 @@ const components = [
6
6
  "NotArrayField",
7
7
  "NotMessage"
8
8
  ];
9
- const composables = [
10
- "useNotForm"
11
- ];
12
9
  const module$1 = defineNuxtModule({
13
10
  meta: {
14
- name: "notform-nuxt",
15
- configKey: "notform",
16
11
  compatibility: {
17
12
  nuxt: ">=4.0.0"
18
- }
13
+ },
14
+ configKey: "notform",
15
+ name: "notform-nuxt"
19
16
  },
20
- // Module factory
21
- setup(_options, nuxt) {
22
- const { resolve } = createResolver(import.meta.url);
23
- const componentsRuntime = resolve("./runtime/components");
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
- components.forEach((name) => {
17
+ setup() {
18
+ for (const name of components) {
31
19
  addComponent({
32
- name,
33
20
  export: name,
34
- filePath: componentsRuntime
35
- });
36
- });
37
- composables.forEach((composable) => {
38
- addImports({
39
- name: composable,
40
- as: composable,
41
- from: composablesRuntime
21
+ filePath: "notform",
22
+ name
42
23
  });
24
+ }
25
+ addImports({
26
+ as: "useNotForm",
27
+ from: "notform",
28
+ name: "useNotForm"
43
29
  });
44
30
  }
45
31
  });
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "notform-nuxt",
3
- "version": "2.1.0",
3
+ "type": "module",
4
+ "version": "2.1.2",
4
5
  "private": false,
5
6
  "publishConfig": {
6
7
  "access": "public"
7
8
  },
8
- "type": "module",
9
9
  "description": "Official notform nuxt module - Vue Forms Without the Friction",
10
10
  "author": "Favour Emeka <favorodera@gmail.com>",
11
11
  "license": "MIT",
12
+ "funding": "https://github.com/sponsors/favorodera",
12
13
  "homepage": "https://notformdocs.vercel.app/",
13
14
  "repository": {
14
15
  "type": "git",
@@ -17,6 +18,14 @@
17
18
  "bugs": {
18
19
  "url": "https://github.com/favorodera/notform/issues"
19
20
  },
21
+ "keywords": [
22
+ "notform-nuxt",
23
+ "nuxt",
24
+ "form",
25
+ "nuxt form",
26
+ "validator",
27
+ "nuxt form validator"
28
+ ],
20
29
  "exports": {
21
30
  ".": {
22
31
  "types": "./dist/types.d.mts",
@@ -34,31 +43,29 @@
34
43
  "files": [
35
44
  "dist"
36
45
  ],
46
+ "engines": {
47
+ "node": ">=22.0.0",
48
+ "pnpm": ">=11.0.0"
49
+ },
50
+ "peerDependencies": {
51
+ "notform": "^2.1.0",
52
+ "nuxt": "^4.0.0"
53
+ },
37
54
  "dependencies": {
38
- "@nuxt/kit": "^4.4.2",
39
- "notform": "2.1.0"
55
+ "@nuxt/kit": "4.4.8",
56
+ "notform": "2.1.2"
40
57
  },
41
58
  "devDependencies": {
59
+ "@favorodera/eslint-config": "^0.1.4",
42
60
  "@nuxt/module-builder": "^1.0.2",
43
- "@nuxt/schema": "^4.4.2",
44
- "nuxt": "^4.4.2",
45
- "vue-tsc": "^3.2.6"
46
- },
47
- "engines": {
48
- "node": ">=22.0.0"
61
+ "@nuxt/schema": "^4.4.8",
62
+ "nuxt": "4.4.8",
63
+ "vue-tsc": "^3.3.5"
49
64
  },
50
- "keywords": [
51
- "notform-nuxt",
52
- "nuxt",
53
- "form",
54
- "nuxt form",
55
- "validator",
56
- "nuxt form validator"
57
- ],
58
65
  "scripts": {
59
66
  "dev": "nuxt prepare && nuxt-module-build build --stub",
60
67
  "build": "nuxt prepare && nuxt-module-build build",
61
- "typecheck": "nuxt prepare && vue-tsc --noEmit",
62
- "lint": "eslint . --fix"
68
+ "typecheck": "nuxt prepare && nuxt typecheck",
69
+ "lint": "nuxt prepare && eslint . --fix"
63
70
  }
64
71
  }
@@ -1 +0,0 @@
1
- export { NotForm, NotField, NotArrayField, NotMessage } from 'notform';
@@ -1 +0,0 @@
1
- export { NotForm, NotField, NotArrayField, NotMessage } from "notform";
@@ -1 +0,0 @@
1
- export { useNotForm } from 'notform';
@@ -1 +0,0 @@
1
- export { useNotForm } from "notform";