@nuxtify/core 0.1.10 → 0.2.0

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/dist/module.d.mts CHANGED
@@ -116,6 +116,48 @@ interface ModuleOptions {
116
116
  };
117
117
  }
118
118
 
119
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
119
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, {
120
+ verboseLogs: false;
121
+ brand: {
122
+ name: string;
123
+ domain: string;
124
+ tagline: string;
125
+ logo: {
126
+ lightUrl: string;
127
+ darkUrl: string;
128
+ width: number;
129
+ mobileWidth: number;
130
+ };
131
+ };
132
+ policies: {
133
+ privacyUrl: string;
134
+ termsUrl: string;
135
+ };
136
+ announcement: {
137
+ show: false;
138
+ message: string;
139
+ buttonText: string;
140
+ buttonUrl: string;
141
+ };
142
+ navigation: {
143
+ primary: never[];
144
+ secondary: never[];
145
+ altPrimary: never[];
146
+ altSecondary: never[];
147
+ };
148
+ credits: {
149
+ creator: {
150
+ name: string;
151
+ domain: string;
152
+ };
153
+ prependText: string;
154
+ appendText: string;
155
+ showPoweredBy: true;
156
+ };
157
+ email: {
158
+ general: string;
159
+ support: string;
160
+ };
161
+ }, true>;
120
162
 
121
163
  export { _default as default };
package/dist/module.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@nuxtify/core",
3
- "version": "0.1.10",
3
+ "version": "0.2.0",
4
4
  "configKey": "nuxtifyCore",
5
5
  "compatibility": {
6
- "nuxt": ">=3.16.0",
7
- "bridge": false
6
+ "nuxt": ">=4.0.0"
8
7
  },
9
8
  "builder": {
10
- "@nuxt/module-builder": "1.0.1",
11
- "unbuild": "3.5.0"
9
+ "@nuxt/module-builder": "1.0.2",
10
+ "unbuild": "unknown"
12
11
  }
13
12
  }
package/dist/module.mjs CHANGED
@@ -1,17 +1,51 @@
1
- import { defineNuxtModule, createResolver, useLogger, installModule, addComponentsDir, addImportsDir, addServerImportsDir, addRouteMiddleware } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, useLogger, addComponentsDir, addImportsDir, addServerImportsDir, addRouteMiddleware } from '@nuxt/kit';
2
2
  import { defu } from 'defu';
3
3
 
4
4
  const name = "@nuxtify/core";
5
- const version = "0.1.10";
5
+ const version = "0.2.0";
6
6
 
7
- const module = defineNuxtModule({
7
+ const module$1 = defineNuxtModule().with({
8
8
  meta: {
9
9
  name,
10
10
  version,
11
11
  configKey: "nuxtifyCore",
12
12
  compatibility: {
13
- nuxt: ">=3.16.0",
14
- bridge: false
13
+ nuxt: ">=4.0.0"
14
+ }
15
+ },
16
+ moduleDependencies: {
17
+ "vuetify-nuxt-module": {
18
+ version: ">=0.19.2",
19
+ defaults: {
20
+ vuetifyOptions: {
21
+ icons: {
22
+ defaultSet: "mdi-svg"
23
+ },
24
+ theme: {
25
+ themes: {
26
+ light: {
27
+ colors: {
28
+ primary: "#020420",
29
+ secondary: "#00DC82",
30
+ background: "#fff"
31
+ }
32
+ }
33
+ }
34
+ },
35
+ defaults: {
36
+ VBtn: { color: "secondary", variant: "flat", class: "text-none" },
37
+ VAlert: {
38
+ VBtn: { color: "inherit" }
39
+ },
40
+ VFooter: {
41
+ VBtn: { color: "inherit" }
42
+ },
43
+ VNumberInput: {
44
+ VBtn: { color: "inherit", variant: "inherit" }
45
+ }
46
+ }
47
+ }
48
+ }
15
49
  }
16
50
  },
17
51
  defaults: {
@@ -64,55 +98,26 @@ const module = defineNuxtModule({
64
98
  support: ""
65
99
  }
66
100
  },
67
- async setup(_options, _nuxt) {
68
- const resolver = createResolver(import.meta.url);
69
- if (_options.verboseLogs) useLogger("[nuxtify-core] Verbose logging enabled.");
70
- await installModule("vuetify-nuxt-module", {
71
- vuetifyOptions: {
72
- icons: {
73
- defaultSet: "mdi-svg"
74
- },
75
- theme: {
76
- themes: {
77
- light: {
78
- colors: {
79
- primary: "#020420",
80
- secondary: "#00DC82",
81
- background: "#fff"
82
- }
83
- }
84
- }
85
- },
86
- defaults: {
87
- VBtn: { color: "secondary", variant: "flat", class: "text-none" },
88
- VAlert: {
89
- VBtn: { color: "inherit" }
90
- },
91
- VFooter: {
92
- VBtn: { color: "inherit" }
93
- },
94
- VNumberInput: {
95
- VBtn: { color: "inherit", variant: "inherit" }
96
- }
97
- }
98
- }
99
- });
100
- _nuxt.options.appConfig.nuxtify = defu(_nuxt.options.appConfig.nuxtify, {
101
- ..._options
101
+ async setup(resolvedOptions, nuxt) {
102
+ const { resolve } = createResolver(import.meta.url);
103
+ const logger = useLogger("nuxtify-core");
104
+ if (resolvedOptions.verboseLogs) logger.info("Verbose logging enabled.");
105
+ nuxt.options.appConfig.nuxtify = defu(nuxt.options.appConfig.nuxtify || {}, {
106
+ ...resolvedOptions
102
107
  });
103
108
  addComponentsDir({
104
- path: resolver.resolve("./runtime/components")
109
+ path: resolve("./runtime/components")
105
110
  });
106
- addImportsDir(resolver.resolve("./runtime/composables"));
107
- addServerImportsDir(resolver.resolve("./runtime/server/composables"));
108
- addImportsDir(resolver.resolve("./runtime/utils"));
109
- addServerImportsDir(resolver.resolve("./runtime/server/utils"));
111
+ addImportsDir(resolve("./runtime/composables"));
112
+ addServerImportsDir(resolve("./runtime/server/composables"));
113
+ addImportsDir(resolve("./runtime/utils"));
114
+ addServerImportsDir(resolve("./runtime/server/utils"));
110
115
  addRouteMiddleware({
111
116
  name: "setup",
112
- path: resolver.resolve("./runtime/middleware/setup"),
117
+ path: resolve("./runtime/middleware/setup"),
113
118
  global: true
114
119
  });
115
120
  }
116
121
  });
117
122
 
118
- export { module as default };
123
+ export { module$1 as default };
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
1
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  dark: {
3
3
  type: BooleanConstructor;
4
4
  default: boolean;
@@ -20,4 +20,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
20
20
  width: number;
21
21
  dark: boolean;
22
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
23
+ declare const _default: typeof __VLS_export;
23
24
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -1,5 +1,4 @@
1
- import { useHead } from "@unhead/vue";
2
- import { useAppConfig } from "#imports";
1
+ import { useAppConfig, useHead } from "#imports";
3
2
  export const useNuxtifyConfig = () => useAppConfig().nuxtify;
4
3
  export const useNuxtifySiteTitle = ({
5
4
  separator = "|",
@@ -0,0 +1 @@
1
+ export declare const useCopyText: (text: string, label?: string) => Promise<void>;
@@ -0,0 +1,12 @@
1
+ import { useToast } from "#imports";
2
+ export const useCopyText = async (text, label = "Text") => {
3
+ const toast = useToast();
4
+ if (!navigator.clipboard) {
5
+ toast.value.message = "Error: Clipboard access is not available.";
6
+ toast.value.show = true;
7
+ return;
8
+ }
9
+ await navigator.clipboard.writeText(text);
10
+ toast.value.message = `${label} copied!`;
11
+ toast.value.show = true;
12
+ };
@@ -3,14 +3,18 @@ export const titleCase = (text, skipShortWords = true) => {
3
3
  const words = text.split(" ");
4
4
  const titleWords = [];
5
5
  for (const [i] of words.entries()) {
6
- if (skipShortWords && shortWords.includes(words[i])) {
6
+ const word = words[i];
7
+ if (!word) {
8
+ continue;
9
+ }
10
+ if (skipShortWords && shortWords.includes(word)) {
7
11
  if (i === 0) {
8
- titleWords.push(words[i].charAt(0).toUpperCase() + words[i].slice(1));
12
+ titleWords.push(word.charAt(0).toUpperCase() + word.slice(1));
9
13
  } else {
10
- titleWords.push(words[i]);
14
+ titleWords.push(word);
11
15
  }
12
16
  } else {
13
- titleWords.push(words[i].charAt(0).toUpperCase() + words[i].slice(1));
17
+ titleWords.push(word.charAt(0).toUpperCase() + word.slice(1));
14
18
  }
15
19
  }
16
20
  return titleWords.join(" ");
@@ -37,7 +41,7 @@ export function parseFullName(fullName2) {
37
41
  let lastName = "";
38
42
  if (fullName2) {
39
43
  const nameSplit = fullName2.split(" ");
40
- firstName = nameSplit[0];
44
+ firstName = nameSplit[0] ?? "";
41
45
  if (nameSplit.length > 1) {
42
46
  lastName = nameSplit.slice(1).join(" ");
43
47
  }
@@ -175,7 +179,7 @@ export const getLanguageName = (languageCode, displayLanguage = "en") => {
175
179
  };
176
180
  export function addArticle(text, includeText = true) {
177
181
  if (!text) return "";
178
- const firstLetter = text[0].toLowerCase();
182
+ const firstLetter = text[0]?.toLowerCase() ?? "";
179
183
  const vowels = ["a", "e", "i", "o", "u"];
180
184
  let article;
181
185
  if (vowels.includes(firstLetter)) {
@@ -1,7 +1,7 @@
1
1
  function youTubeId(url) {
2
2
  const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
3
3
  const match = url.match(regExp);
4
- return match && match[2].length === 11 ? match[2] : null;
4
+ return match && match[2]?.length === 11 ? match[2] : null;
5
5
  }
6
6
  export function youTubeUrl(url) {
7
7
  const videoId = youTubeId(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtify/core",
3
- "version": "0.1.10",
3
+ "version": "0.2.0",
4
4
  "description": "Nuxtify core module powered by Nuxt and Vuetify.",
5
5
  "homepage": "https://nuxtify.dev",
6
6
  "author": "Nuxtify.dev <hello@nuxtify.dev>",
@@ -38,6 +38,7 @@
38
38
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
39
39
  "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
40
40
  "lint": "eslint .",
41
+ "lint:fix": "eslint . --fix",
41
42
  "test": "vitest run",
42
43
  "test:watch": "vitest watch",
43
44
  "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
@@ -45,22 +46,22 @@
45
46
  "dependencies": {
46
47
  "@mdi/js": "^7.4.47",
47
48
  "defu": "^6.1.4",
48
- "vuetify-nuxt-module": "^0.18.7"
49
+ "vuetify-nuxt-module": "^0.19.2"
49
50
  },
50
51
  "devDependencies": {
51
- "@nuxt/devtools": "^2.5.0",
52
- "@nuxt/eslint": "^1.4.1",
52
+ "@nuxt/devtools": "^3.1.1",
53
+ "@nuxt/eslint": "^1.12.1",
53
54
  "@nuxt/eslint-config": "^1.3.1",
54
- "@nuxt/kit": "^3.17.5",
55
- "@nuxt/module-builder": "^1.0.1",
56
- "@nuxt/schema": "^3.17.5",
57
- "@nuxt/test-utils": "^3.19.1",
58
- "@types/node": "^22.15.32",
59
- "changelogen": "^0.6.1",
60
- "eslint": "^9.29.0",
61
- "nuxt": "^3.17.5",
62
- "typescript": "~5.8.3",
63
- "vitest": "^3.2.3",
64
- "vue-tsc": "^2.2.10"
55
+ "@nuxt/kit": "^4.2.2",
56
+ "@nuxt/module-builder": "^1.0.2",
57
+ "@nuxt/schema": "^4.2.2",
58
+ "@nuxt/test-utils": "^3.23.0",
59
+ "@types/node": "^22.19.7",
60
+ "changelogen": "^0.6.2",
61
+ "eslint": "^9.39.2",
62
+ "nuxt": "^4.2.2",
63
+ "typescript": "^5.9.3",
64
+ "vitest": "^4.0.17",
65
+ "vue-tsc": "^3.2.2"
65
66
  }
66
67
  }