@nuxtify/core 0.1.0 → 0.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 CHANGED
@@ -4,11 +4,13 @@
4
4
 
5
5
  # Nuxtify Core
6
6
 
7
- <!-- [![npm version][npm-version-src]][npm-version-href]
7
+ <!--
8
8
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
9
- [![License][license-src]][license-href]
10
9
  [![Nuxtify Docs][nuxtify-src]][nuxtify-href] -->
11
- <!-- [🏀 Online playground](https://stackblitz.com/github/nuxtify-dev/core?file=playground%2Fapp.vue) -->
10
+
11
+ [![npm version][npm-version-src]][npm-version-href]
12
+ [![License][license-src]][license-href]
13
+ [![🏀 Playground][playground-src]][playground-href]
12
14
 
13
15
  > [!NOTE]
14
16
  >
@@ -214,3 +216,5 @@ Learn about [authoring Nuxt modules](https://nuxt.com/docs/guide/going-further/m
214
216
  [license-href]: https://npmjs.com/package/@nuxtify/core
215
217
  [nuxtify-src]: https://img.shields.io/badge/Nuxtify_Docs-00DC82
216
218
  [nuxtify-href]: https://nuxtify.dev/docs
219
+ [playground-src]: https://img.shields.io/badge/%F0%9F%8F%80_Playground-Demo-00DC82?labelColor=020420
220
+ [playground-href]: https://stackblitz.com/github/nuxtify-dev/core?file=playground%2Fapp.vue
package/dist/module.d.mts CHANGED
@@ -4,7 +4,7 @@ interface BrandOptions {
4
4
  /**
5
5
  * The name of the brand.
6
6
  *
7
- * @default "nuxtify-core"
7
+ * @default "@nuxtify/core"
8
8
  */
9
9
  name?: string;
10
10
  /**
package/dist/module.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
- "name": "nuxtify-core",
2
+ "name": "@nuxtify/core",
3
+ "version": "0.1.1",
3
4
  "configKey": "nuxtifyCore",
4
5
  "compatibility": {
5
6
  "nuxt": ">=3.16.0",
6
7
  "bridge": false
7
8
  },
8
- "version": "0.1.0",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.1",
11
11
  "unbuild": "3.5.0"
package/dist/module.mjs CHANGED
@@ -1,9 +1,13 @@
1
1
  import { defineNuxtModule, createResolver, installModule, addComponentsDir, addImportsDir, addServerImportsDir } from '@nuxt/kit';
2
2
  import { defu } from 'defu';
3
3
 
4
+ const name = "@nuxtify/core";
5
+ const version = "0.1.1";
6
+
4
7
  const module = defineNuxtModule({
5
8
  meta: {
6
- name: "nuxtify-core",
9
+ name,
10
+ version,
7
11
  configKey: "nuxtifyCore",
8
12
  compatibility: {
9
13
  nuxt: ">=3.16.0",
@@ -13,7 +17,7 @@ const module = defineNuxtModule({
13
17
  defaults: {
14
18
  // Brand
15
19
  brand: {
16
- name: "nuxtify-core",
20
+ name: "@nuxtify/core",
17
21
  domain: "",
18
22
  tagline: "",
19
23
  logo: {
@@ -1,2 +1 @@
1
- import type { ModuleOptions } from '../../types.js';
2
- export declare const useNuxtifyConfig: () => ModuleOptions;
1
+ export declare const useNuxtifyConfig: () => unknown;
@@ -0,0 +1,6 @@
1
+ export declare const submitToAPI: (apiKey: string, submitUrl: string, body: BodyInit | null | undefined) => Promise<{
2
+ res: Response | null;
3
+ isSubmitted: boolean;
4
+ isError: boolean;
5
+ errorMessage: string;
6
+ }>;
@@ -0,0 +1,34 @@
1
+ export const submitToAPI = async (apiKey, submitUrl, body) => {
2
+ let res = null;
3
+ let isSubmitted = false;
4
+ let isError = false;
5
+ let errorMessage = "";
6
+ const headers = {
7
+ "Content-Type": "application/json",
8
+ "Accept": "application/json",
9
+ "Authorization": `Bearer ${apiKey}`
10
+ };
11
+ try {
12
+ res = await fetch(submitUrl, {
13
+ method: "POST",
14
+ headers,
15
+ body
16
+ });
17
+ if (res.ok) {
18
+ isSubmitted = true;
19
+ } else {
20
+ throw new Error(`${res.status} Error`);
21
+ }
22
+ } catch (error) {
23
+ isError = true;
24
+ if (error instanceof Error) {
25
+ errorMessage = error.message;
26
+ }
27
+ }
28
+ return {
29
+ res,
30
+ isSubmitted,
31
+ isError,
32
+ errorMessage
33
+ };
34
+ };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nuxtify/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Nuxtify core module powered by Nuxt and Vuetify.",
5
- "homepage": "https://nuxtify.dev/",
5
+ "homepage": "https://nuxtify.dev",
6
6
  "author": "Nuxtify.dev <hello@nuxtify.dev>",
7
7
  "funding": "https://github.com/sponsors/davidstackio",
8
8
  "repository": {