notform-nuxt 2.0.0-alpha.6 → 2.0.0-alpha.8

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,84 +1,16 @@
1
- <!--
2
- Get your module up and running quickly.
1
+ # notform-nuxt
3
2
 
4
- Find and replace all on all files (CMD+SHIFT+F):
5
- - Name: My Module
6
- - Package name: my-module
7
- - Description: My new Nuxt module
8
- -->
3
+ [![npm version](https://img.shields.io/npm/v/notform-nuxt.svg?style=flat-square)](https://www.npmjs.com/package/notform-nuxt)
4
+ [![npm downloads](https://img.shields.io/npm/dm/notform-nuxt.svg?style=flat-square)](https://www.npmjs.com/package/notform-nuxt)
5
+ [![license](https://img.shields.io/github/license/favorodera/notform.svg?style=flat-square)](https://github.com/favorodera/notform/blob/main/LICENSE)
6
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/notform-nuxt.svg?style=flat-square)](https://bundlephobia.com/package/notform-nuxt)
9
7
 
10
- # My Module
8
+ **Official Nuxt module for NotForm - Vue Forms Without the Friction.**
11
9
 
12
- [![npm version][npm-version-src]][npm-version-href]
13
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
- [![License][license-src]][license-href]
15
- [![Nuxt][nuxt-src]][nuxt-href]
10
+ `notform-nuxt` provides seamless integration for NotForm in Nuxt applications, including auto-imports and Nuxt-specific optimizations.
16
11
 
17
- My new Nuxt module for doing amazing things.
12
+ ## Documentation
18
13
 
19
- - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
- <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
21
- <!-- - [📖 &nbsp;Documentation](https://example.com) -->
14
+ For detailed guides, API reference, and examples, visit:
15
+ **[notform-docs.vercel.app](https://notformdocs.vercel.app/getting-started/nuxt-module)**
22
16
 
23
- ## Features
24
-
25
- <!-- Highlight some of the features your module provide here -->
26
- - ⛰ &nbsp;Foo
27
- - 🚠 &nbsp;Bar
28
- - 🌲 &nbsp;Baz
29
-
30
- ## Quick Setup
31
-
32
- Install the module to your Nuxt application with one command:
33
-
34
- ```bash
35
- npx nuxt module add my-module
36
- ```
37
-
38
- That's it! You can now use My Module in your Nuxt app ✨
39
-
40
-
41
- ## Contribution
42
-
43
- <details>
44
- <summary>Local development</summary>
45
-
46
- ```bash
47
- # Install dependencies
48
- npm install
49
-
50
- # Generate type stubs
51
- npm run dev:prepare
52
-
53
- # Develop with the playground
54
- npm run dev
55
-
56
- # Build the playground
57
- npm run dev:build
58
-
59
- # Run ESLint
60
- npm run lint
61
-
62
- # Run Vitest
63
- npm run test
64
- npm run test:watch
65
-
66
- # Release new version
67
- npm run release
68
- ```
69
-
70
- </details>
71
-
72
-
73
- <!-- Badges -->
74
- [npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
75
- [npm-version-href]: https://npmjs.com/package/my-module
76
-
77
- [npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
78
- [npm-downloads-href]: https://npm.chart.dev/my-module
79
-
80
- [license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
81
- [license-href]: https://npmjs.com/package/my-module
82
-
83
- [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt
84
- [nuxt-href]: https://nuxt.com
package/dist/module.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "notform-nuxt",
3
3
  "configKey": "notform",
4
- "version": "2.0.0-alpha.6",
4
+ "compatibility": {
5
+ "nuxt": ">=4.0.0"
6
+ },
7
+ "version": "2.0.0-alpha.8",
5
8
  "builder": {
6
9
  "@nuxt/module-builder": "1.0.2",
7
10
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -1,15 +1,60 @@
1
- import { defineNuxtModule, createResolver, addPlugin } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addComponent, addImports, addTemplate, addTypeTemplate } from '@nuxt/kit';
2
2
 
3
+ const components = [
4
+ "NotForm",
5
+ "NotField",
6
+ "NotArrayField",
7
+ "NotMessage"
8
+ ];
9
+ const composables = [
10
+ "useNotForm"
11
+ ];
3
12
  const module$1 = defineNuxtModule({
4
13
  meta: {
5
14
  name: "notform-nuxt",
6
- configKey: "notform"
15
+ configKey: "notform",
16
+ compatibility: {
17
+ nuxt: ">=4.0.0"
18
+ }
7
19
  },
8
- // Default configuration options of the Nuxt module
9
- defaults: {},
10
- setup() {
11
- const resolver = createResolver(import.meta.url);
12
- addPlugin(resolver.resolve("./runtime/plugin"));
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) => {
31
+ addComponent({
32
+ name,
33
+ export: name,
34
+ filePath: componentsRuntime
35
+ });
36
+ });
37
+ composables.forEach((composable) => {
38
+ addImports({
39
+ name: composable,
40
+ as: composable,
41
+ from: composablesRuntime
42
+ });
43
+ });
44
+ const template = addTemplate({
45
+ filename: "notform.mjs",
46
+ getContents: () => "export * from 'notform'",
47
+ write: true
48
+ });
49
+ nuxt.options.alias["#notform"] = template.dst;
50
+ addTypeTemplate({
51
+ filename: "types/notform.d.ts",
52
+ getContents: () => `
53
+ declare module '#notform' {
54
+ export type * from 'notform'
55
+ }
56
+ `
57
+ });
13
58
  }
14
59
  });
15
60
 
@@ -0,0 +1 @@
1
+ export { NotForm, NotField, NotArrayField, NotMessage } from 'notform';
@@ -0,0 +1 @@
1
+ export { NotForm, NotField, NotArrayField, NotMessage } from "notform";
@@ -0,0 +1 @@
1
+ export { useNotForm } from 'notform';
@@ -0,0 +1 @@
1
+ export { useNotForm } from "notform";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notform-nuxt",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.8",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,7 +9,7 @@
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
- "homepage": "https://notform-docs.vercel.app/",
12
+ "homepage": "https://notformdocs.vercel.app/",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git+https://github.com/favorodera/notform.git"
@@ -35,7 +35,8 @@
35
35
  "dist"
36
36
  ],
37
37
  "dependencies": {
38
- "@nuxt/kit": "^4.4.2"
38
+ "@nuxt/kit": "^4.4.2",
39
+ "notform": "2.0.0-alpha.8"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@nuxt/module-builder": "^1.0.2",
@@ -44,7 +45,7 @@
44
45
  "vue-tsc": "^3.2.6"
45
46
  },
46
47
  "engines": {
47
- "node": ">=24.13.0"
48
+ "node": ">=22.0.0"
48
49
  },
49
50
  "keywords": [
50
51
  "notform-nuxt",
@@ -57,7 +58,7 @@
57
58
  "scripts": {
58
59
  "dev": "nuxt prepare && nuxt-module-build build --stub",
59
60
  "build": "nuxt prepare && nuxt-module-build build",
60
- "typecheck": "vue-tsc --noEmit",
61
+ "typecheck": "nuxt prepare && vue-tsc --noEmit",
61
62
  "lint": "eslint . --fix"
62
63
  }
63
64
  }
@@ -1,2 +0,0 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- import { defineNuxtPlugin } from "#app";
2
- export default defineNuxtPlugin(() => {
3
- console.log("Plugin injected by notform-nuxt!");
4
- });
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "../../../.nuxt/tsconfig.server.json",
3
- }