@nuxtify/core 0.1.0 → 0.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 +7 -3
- package/dist/module.d.mts +5 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +9 -2
- package/dist/runtime/server/utils/api.d.ts +6 -0
- package/dist/runtime/server/utils/api.js +34 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
# Nuxtify Core
|
|
6
6
|
|
|
7
|
-
<!--
|
|
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
|
-
|
|
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
|
|
7
|
+
* @default "@nuxtify/core"
|
|
8
8
|
*/
|
|
9
9
|
name?: string;
|
|
10
10
|
/**
|
|
@@ -54,6 +54,10 @@ interface PoliciesOptions {
|
|
|
54
54
|
termsUrl: string;
|
|
55
55
|
}
|
|
56
56
|
interface ModuleOptions {
|
|
57
|
+
/**
|
|
58
|
+
* Verbose logging
|
|
59
|
+
*/
|
|
60
|
+
verboseLogs?: boolean;
|
|
57
61
|
/**
|
|
58
62
|
* Brand options
|
|
59
63
|
*/
|
package/dist/module.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "nuxtify
|
|
2
|
+
"name": "@nuxtify/core",
|
|
3
|
+
"version": "0.1.2",
|
|
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.2";
|
|
6
|
+
|
|
4
7
|
const module = defineNuxtModule({
|
|
5
8
|
meta: {
|
|
6
|
-
name
|
|
9
|
+
name,
|
|
10
|
+
version,
|
|
7
11
|
configKey: "nuxtifyCore",
|
|
8
12
|
compatibility: {
|
|
9
13
|
nuxt: ">=3.16.0",
|
|
@@ -11,9 +15,11 @@ const module = defineNuxtModule({
|
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
defaults: {
|
|
18
|
+
// Logs
|
|
19
|
+
verboseLogs: false,
|
|
14
20
|
// Brand
|
|
15
21
|
brand: {
|
|
16
|
-
name: "nuxtify
|
|
22
|
+
name: "@nuxtify/core",
|
|
17
23
|
domain: "",
|
|
18
24
|
tagline: "",
|
|
19
25
|
logo: {
|
|
@@ -53,6 +59,7 @@ const module = defineNuxtModule({
|
|
|
53
59
|
},
|
|
54
60
|
async setup(_options, _nuxt) {
|
|
55
61
|
const resolver = createResolver(import.meta.url);
|
|
62
|
+
if (_options.verboseLogs) console.log("[nuxtify-core] Verbose logging enabled.");
|
|
56
63
|
await installModule("vuetify-nuxt-module", {
|
|
57
64
|
vuetifyOptions: {
|
|
58
65
|
icons: {
|
|
@@ -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.
|
|
3
|
+
"version": "0.1.2",
|
|
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": {
|