@gluhar/app 2.0.0-dev.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/CHANGELOG.md +210 -0
- package/README.md +64 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +13 -0
- package/dist/module.d.ts +13 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +30 -0
- package/dist/runtime/composables/useSeo.d.ts +2 -0
- package/dist/runtime/composables/useSeo.js +34 -0
- package/dist/runtime/stores/useGStore.d.ts +80 -0
- package/dist/runtime/stores/useGStore.js +21 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/utils/seo.d.ts +3 -0
- package/dist/runtime/utils/seo.js +22 -0
- package/dist/types.d.mts +7 -0
- package/dist/types.d.ts +7 -0
- package/package.json +59 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [1.0.2](https://github.com/harryyaprakov/hui/compare/@pezak/hui@1.0.1...@pezak/hui@1.0.2) (2024-10-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### 🩹 Fixes
|
|
10
|
+
|
|
11
|
+
- Module loading bugs ([8d23ab2](https://github.com/harryyaprakov/hui/commit/8d23ab21ad659e40ab4666b8b3f79375adcbc08e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.0.1](https://github.com/harryyaprakov/hui/compare/@pezak/hui@1.0.0...@pezak/hui@1.0.1) (2024-10-02)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### 🩹 Fixes
|
|
21
|
+
|
|
22
|
+
- Add closeMobileMenu to huiStore ([b5ad52f](https://github.com/harryyaprakov/hui/commit/b5ad52f16830de7146a79f08de70ae820ab93fcf))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [1.0.0](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.4.2...@pezak/hui@1.0.0) (2024-10-01)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### 🚀 Enhancements
|
|
32
|
+
|
|
33
|
+
- Release v1 hui ([cc0c50c](https://github.com/harryyaprakov/hui/commit/cc0c50c4a98b18b99045a840a5c16123402dcba8))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [0.4.2](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.4.1...@pezak/hui@0.4.2) (2024-09-17)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### 🩹 Fixes
|
|
43
|
+
|
|
44
|
+
- Hui store fixes ([952c8a9](https://github.com/harryyaprakov/hui/commit/952c8a92998092f697a8e99475f7b0c96489cc6a))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## [0.4.1](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.4.0...@pezak/hui@0.4.1) (2024-09-12)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### 🩹 Fixes
|
|
54
|
+
|
|
55
|
+
- GetCanonicalUrl ([4b3f961](https://github.com/harryyaprakov/hui/commit/4b3f9618e4568547517a9d9589e9e2922569eacb))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# [0.4.0](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.3.4...@pezak/hui@0.4.0) (2024-09-12)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### 🚀 Enhancements
|
|
65
|
+
|
|
66
|
+
- UseBaseUrl ([cb32c71](https://github.com/harryyaprakov/hui/commit/cb32c714fde766e7394fac792b7d86acf84d17e8))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## [0.3.4](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.3.3...@pezak/hui@0.3.4) (2024-09-12)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### 🩹 Fixes
|
|
76
|
+
|
|
77
|
+
- GetCanonicalUrl to use baseUrl and devUrl ([91a57e1](https://github.com/harryyaprakov/hui/commit/91a57e14ddf075b3f2075dca65344d78e6edfdd1))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## [0.3.3](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.3.2...@pezak/hui@0.3.3) (2024-09-12)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### 🩹 Fixes
|
|
87
|
+
|
|
88
|
+
- Import useRuntimeConfig from '#imports' ([f5af895](https://github.com/harryyaprakov/hui/commit/f5af8951d7d76d1eb0b64e04d0bc6b55d73eb866))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## [0.3.2](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.3.1...@pezak/hui@0.3.2) (2024-09-12)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### 🩹 Fixes
|
|
98
|
+
|
|
99
|
+
- Import /utils in hui ([454a638](https://github.com/harryyaprakov/hui/commit/454a638c18d79a490da80eee8e631d35cbf6b135))
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## [0.3.1](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.3.0...@pezak/hui@0.3.1) (2024-09-12)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### 🩹 Fixes
|
|
109
|
+
|
|
110
|
+
- UseMessages to be relatively imported in useSeo ([dd664b5](https://github.com/harryyaprakov/hui/commit/dd664b567f5f367bc975cdd1e3764bdfd4168c9f))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# [0.3.0](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.2.4...@pezak/hui@0.3.0) (2024-09-12)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### 🚀 Enhancements
|
|
120
|
+
|
|
121
|
+
- Version bump ([32cd173](https://github.com/harryyaprakov/hui/commit/32cd173ed800a4d4ede5286e65b9c5728ce39950))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## [0.2.4](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.2.3...@pezak/hui@0.2.4) (2024-09-12)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### 🩹 Fixes
|
|
131
|
+
|
|
132
|
+
- UseSeo composable to work and have proper types ([166db01](https://github.com/harryyaprakov/hui/commit/166db01c3f4889b1ddfa2441904499a9fab9fe07))
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## [0.2.3](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.2.2...@pezak/hui@0.2.3) (2024-05-23)
|
|
139
|
+
|
|
140
|
+
**📝 Note:** Version bump only for package @pezak/hui
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## [0.2.2](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.2.1...@pezak/hui@0.2.2) (2024-05-10)
|
|
147
|
+
|
|
148
|
+
**📝 Note:** Version bump only for package @pezak/hui
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## [0.2.1](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.2.0...@pezak/hui@0.2.1) (2024-05-09)
|
|
155
|
+
|
|
156
|
+
**📝 Note:** Version bump only for package @pezak/hui
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
# [0.2.0](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.2.0-dev.1...@pezak/hui@0.2.0) (2024-04-10)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### 🩹 Fixes
|
|
166
|
+
|
|
167
|
+
- Type imports, core types export ([866186a](https://github.com/harryyaprakov/hui/commit/866186aca1ad1bab03b5b6b0d0621a29f67518f6))
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
## [0.1.4](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.1.3...@pezak/hui@0.1.4) (2024-04-01)
|
|
174
|
+
|
|
175
|
+
**📝 Note:** Version bump only for package @pezak/hui
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
## [0.1.3](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.1.1...@pezak/hui@0.1.3) (2024-04-01)
|
|
182
|
+
|
|
183
|
+
**📝 Note:** Version bump only for package @pezak/hui
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
## [0.1.2](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.1.1...@pezak/hui@0.1.2) (2024-04-01)
|
|
190
|
+
|
|
191
|
+
**📝 Note:** Version bump only for package @pezak/hui
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
## [0.1.1](https://github.com/harryyaprakov/hui/compare/@pezak/hui@0.1.0...@pezak/hui@0.1.1) (2024-04-01)
|
|
198
|
+
|
|
199
|
+
**📝 Note:** Version bump only for package @pezak/hui
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
# 0.1.0 (2024-04-01)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### 🚀 Enhancements
|
|
209
|
+
|
|
210
|
+
- Package Installs hui-core, hui-theme, hui-i18n, hui-sanity ([ae169b1](https://github.com/harryyaprakov/hui/commit/ae169b166d4da4257d2e6e61fe0fac9925476a5f))
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# `@gluhar/app`
|
|
2
|
+
|
|
3
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
|
+
[![License][license-src]][license-href]
|
|
6
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
|
+
|
|
8
|
+
Gluhar main package. This combines and configures @gluhar/theme, @gluhar/i18n, @gluhar/sanity and @gluhar/core into one main package. Provides numerous components, composables, utils and types.
|
|
9
|
+
|
|
10
|
+
[✨ Release Notes](/CHANGELOG.md)
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Install the module to your Nuxt application with one command:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx nuxi module add @gluhar/app
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
## Config
|
|
23
|
+
|
|
24
|
+
## Contribution
|
|
25
|
+
|
|
26
|
+
<details>
|
|
27
|
+
<summary>Local development</summary>
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Install dependencies
|
|
31
|
+
npm install
|
|
32
|
+
|
|
33
|
+
# Generate type stubs
|
|
34
|
+
npm run dev:prepare
|
|
35
|
+
|
|
36
|
+
# Develop with the playground
|
|
37
|
+
npm run dev
|
|
38
|
+
|
|
39
|
+
# Build the playground
|
|
40
|
+
npm run dev:build
|
|
41
|
+
|
|
42
|
+
# Run ESLint
|
|
43
|
+
npm run lint
|
|
44
|
+
|
|
45
|
+
# Run Vitest
|
|
46
|
+
npm run test
|
|
47
|
+
npm run test:watch
|
|
48
|
+
|
|
49
|
+
# Release new version
|
|
50
|
+
npm run release
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
</details>
|
|
54
|
+
|
|
55
|
+
<!-- Badges -->
|
|
56
|
+
|
|
57
|
+
[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
|
58
|
+
[npm-version-href]: https://npmjs.com/package/my-module
|
|
59
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
|
|
60
|
+
[npm-downloads-href]: https://npmjs.com/package/my-module
|
|
61
|
+
[license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
|
|
62
|
+
[license-href]: https://npmjs.com/package/my-module
|
|
63
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
|
|
64
|
+
[nuxt-href]: https://nuxt.com
|
package/dist/module.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { GluharI18nOptions } from '@gluhar/i18n';
|
|
3
|
+
import { GluharSanityOptions } from '@gluhar/sanity';
|
|
4
|
+
import { GluharThemeOptions } from '@gluhar/theme';
|
|
5
|
+
|
|
6
|
+
interface GluharAppOptions {
|
|
7
|
+
theme?: GluharThemeOptions | false;
|
|
8
|
+
i18n?: GluharI18nOptions | false;
|
|
9
|
+
sanity?: GluharSanityOptions | false;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: _nuxt_schema.NuxtModule<GluharAppOptions, GluharAppOptions, false>;
|
|
12
|
+
|
|
13
|
+
export { type GluharAppOptions, _default as default };
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { GluharI18nOptions } from '@gluhar/i18n';
|
|
3
|
+
import { GluharSanityOptions } from '@gluhar/sanity';
|
|
4
|
+
import { GluharThemeOptions } from '@gluhar/theme';
|
|
5
|
+
|
|
6
|
+
interface GluharAppOptions {
|
|
7
|
+
theme?: GluharThemeOptions | false;
|
|
8
|
+
i18n?: GluharI18nOptions | false;
|
|
9
|
+
sanity?: GluharSanityOptions | false;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: _nuxt_schema.NuxtModule<GluharAppOptions, GluharAppOptions, false>;
|
|
12
|
+
|
|
13
|
+
export { type GluharAppOptions, _default as default };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, installModule, addImportsDir } from '@nuxt/kit';
|
|
2
|
+
|
|
3
|
+
const module = defineNuxtModule({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "@gluhar/app",
|
|
6
|
+
configKey: "gluhar"
|
|
7
|
+
},
|
|
8
|
+
// Default configuration options of the Nuxt module
|
|
9
|
+
defaults: {},
|
|
10
|
+
async setup(options, nuxt) {
|
|
11
|
+
const { resolve } = createResolver(import.meta.url);
|
|
12
|
+
const { theme, i18n, sanity } = options;
|
|
13
|
+
await installModule("@gluhar/core");
|
|
14
|
+
await installModule("@pinia/nuxt");
|
|
15
|
+
if (theme !== false) {
|
|
16
|
+
await installModule("@gluhar/theme", theme);
|
|
17
|
+
}
|
|
18
|
+
if (i18n !== false) {
|
|
19
|
+
await installModule("@gluhar/i18n", i18n);
|
|
20
|
+
}
|
|
21
|
+
if (sanity !== false && i18n !== false) {
|
|
22
|
+
await installModule("@gluhar/sanity", sanity);
|
|
23
|
+
}
|
|
24
|
+
addImportsDir(resolve("runtime/composables"));
|
|
25
|
+
addImportsDir(resolve("runtime/utils"));
|
|
26
|
+
addImportsDir(resolve("runtime/stores"));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { module as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useGStore } from "../stores/useGStore.js";
|
|
2
|
+
import { useMessages } from "#imports";
|
|
3
|
+
import {
|
|
4
|
+
useSeoMeta,
|
|
5
|
+
useServerSeoMeta
|
|
6
|
+
} from "@unhead/vue";
|
|
7
|
+
export const useSeo = (seo) => {
|
|
8
|
+
const store = useGStore();
|
|
9
|
+
const { l } = useMessages();
|
|
10
|
+
const meta = {
|
|
11
|
+
title: l(store.defaultSeo?.title),
|
|
12
|
+
ogTitle: l(store.defaultSeo?.title),
|
|
13
|
+
description: l(store.defaultSeo?.description),
|
|
14
|
+
ogDescription: l(store.defaultSeo?.description),
|
|
15
|
+
ogImage: store.defaultSeo?.ogImage?.asset?.url,
|
|
16
|
+
twitterCard: "summary_large_image"
|
|
17
|
+
};
|
|
18
|
+
if (seo) {
|
|
19
|
+
const { title, description, ogImage } = seo;
|
|
20
|
+
if (title && l(title)) {
|
|
21
|
+
meta.title = l(title);
|
|
22
|
+
meta.ogTitle = l(title);
|
|
23
|
+
}
|
|
24
|
+
if (description && l(description)) {
|
|
25
|
+
meta.description = l(description);
|
|
26
|
+
meta.ogDescription = l(description);
|
|
27
|
+
}
|
|
28
|
+
if (ogImage && ogImage.asset?.url) {
|
|
29
|
+
meta.ogImage = ogImage.asset?.url;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
useServerSeoMeta(meta);
|
|
33
|
+
useSeoMeta(meta);
|
|
34
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Seo } from "@gluhar/sanity/types";
|
|
2
|
+
export declare const useGStore: import("pinia").StoreDefinition<"gluhar", Pick<{
|
|
3
|
+
defaultSeo: import("vue").Ref<{
|
|
4
|
+
title?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
5
|
+
description?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
6
|
+
ogImage?: {
|
|
7
|
+
asset?: {
|
|
8
|
+
url: string;
|
|
9
|
+
} | undefined;
|
|
10
|
+
caption?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
11
|
+
alt?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
12
|
+
} | undefined;
|
|
13
|
+
}, Seo | {
|
|
14
|
+
title?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
15
|
+
description?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
16
|
+
ogImage?: {
|
|
17
|
+
asset?: {
|
|
18
|
+
url: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
caption?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
21
|
+
alt?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
setDefaultSeo: (seo: Seo) => void;
|
|
25
|
+
mobileMenuActive: import("vue").Ref<boolean, boolean>;
|
|
26
|
+
toggleMobileMenu: () => void;
|
|
27
|
+
closeMobileMenu: () => void;
|
|
28
|
+
}, "defaultSeo" | "mobileMenuActive">, Pick<{
|
|
29
|
+
defaultSeo: import("vue").Ref<{
|
|
30
|
+
title?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
31
|
+
description?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
32
|
+
ogImage?: {
|
|
33
|
+
asset?: {
|
|
34
|
+
url: string;
|
|
35
|
+
} | undefined;
|
|
36
|
+
caption?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
37
|
+
alt?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
}, Seo | {
|
|
40
|
+
title?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
41
|
+
description?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
42
|
+
ogImage?: {
|
|
43
|
+
asset?: {
|
|
44
|
+
url: string;
|
|
45
|
+
} | undefined;
|
|
46
|
+
caption?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
47
|
+
alt?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
setDefaultSeo: (seo: Seo) => void;
|
|
51
|
+
mobileMenuActive: import("vue").Ref<boolean, boolean>;
|
|
52
|
+
toggleMobileMenu: () => void;
|
|
53
|
+
closeMobileMenu: () => void;
|
|
54
|
+
}, never>, Pick<{
|
|
55
|
+
defaultSeo: import("vue").Ref<{
|
|
56
|
+
title?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
57
|
+
description?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
58
|
+
ogImage?: {
|
|
59
|
+
asset?: {
|
|
60
|
+
url: string;
|
|
61
|
+
} | undefined;
|
|
62
|
+
caption?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
63
|
+
alt?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
64
|
+
} | undefined;
|
|
65
|
+
}, Seo | {
|
|
66
|
+
title?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
67
|
+
description?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
68
|
+
ogImage?: {
|
|
69
|
+
asset?: {
|
|
70
|
+
url: string;
|
|
71
|
+
} | undefined;
|
|
72
|
+
caption?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
73
|
+
alt?: import("@gluhar/i18n/types").LocaleString | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
setDefaultSeo: (seo: Seo) => void;
|
|
77
|
+
mobileMenuActive: import("vue").Ref<boolean, boolean>;
|
|
78
|
+
toggleMobileMenu: () => void;
|
|
79
|
+
closeMobileMenu: () => void;
|
|
80
|
+
}, "setDefaultSeo" | "toggleMobileMenu" | "closeMobileMenu">>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineStore, ref } from "#imports";
|
|
2
|
+
export const useGStore = defineStore("gluhar", () => {
|
|
3
|
+
const defaultSeo = ref({});
|
|
4
|
+
const setDefaultSeo = (seo) => {
|
|
5
|
+
defaultSeo.value = seo;
|
|
6
|
+
};
|
|
7
|
+
const mobileMenuActive = ref(false);
|
|
8
|
+
const toggleMobileMenu = () => {
|
|
9
|
+
mobileMenuActive.value = !mobileMenuActive.value;
|
|
10
|
+
};
|
|
11
|
+
const closeMobileMenu = () => {
|
|
12
|
+
mobileMenuActive.value = false;
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
defaultSeo,
|
|
16
|
+
setDefaultSeo,
|
|
17
|
+
mobileMenuActive,
|
|
18
|
+
toggleMobileMenu,
|
|
19
|
+
closeMobileMenu
|
|
20
|
+
};
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
|
+
import { envMode } from "@gluhar/core/utils/common";
|
|
3
|
+
export const getCanonicalUrl = (page) => {
|
|
4
|
+
const prod = envMode() === "prod";
|
|
5
|
+
const config = useRuntimeConfig().public;
|
|
6
|
+
const websiteUrl = (prod ? config.baseUrl?.toString() : config.devUrl?.toString()) || "http://localhost:3000";
|
|
7
|
+
if (!page?.slug) return websiteUrl;
|
|
8
|
+
const { _type } = page;
|
|
9
|
+
const slug = page.slug.current;
|
|
10
|
+
const path = _type === "page" ? slug : `${_type}s/${slug}`;
|
|
11
|
+
const url = new URL(path, websiteUrl);
|
|
12
|
+
return url.toString();
|
|
13
|
+
};
|
|
14
|
+
export const defaultSeoQuery = `
|
|
15
|
+
*[_id == "defaultSeo"]{
|
|
16
|
+
...,
|
|
17
|
+
ogImage{
|
|
18
|
+
...,
|
|
19
|
+
asset->
|
|
20
|
+
}
|
|
21
|
+
}[0]
|
|
22
|
+
`;
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
+
|
|
3
|
+
import type { default as Module } from './module.js'
|
|
4
|
+
|
|
5
|
+
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
+
|
|
7
|
+
export { type GluharAppOptions, default } from './module.js'
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
+
|
|
3
|
+
import type { default as Module } from './module'
|
|
4
|
+
|
|
5
|
+
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
+
|
|
7
|
+
export { type GluharAppOptions, default } from './module'
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gluhar/app",
|
|
3
|
+
"version": "2.0.0-dev.0",
|
|
4
|
+
"description": "Gluhar main package. This combines and configures @gluhar/theme, @gluhar/i18n, @gluhar/sanity and @gluhar/core into one main package. Provides numerous components, composables, utils and types.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/types.d.ts",
|
|
10
|
+
"import": "./dist/module.mjs",
|
|
11
|
+
"require": "./dist/module.cjs"
|
|
12
|
+
},
|
|
13
|
+
"./utils/*": {
|
|
14
|
+
"types": "./dist/runtime/utils/*.d.ts",
|
|
15
|
+
"import": "./dist/runtime/utils/*.js"
|
|
16
|
+
},
|
|
17
|
+
"./types": {
|
|
18
|
+
"types": "./dist/runtime/types/index.d.ts",
|
|
19
|
+
"import": "./dist/runtime/types/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/module.cjs",
|
|
23
|
+
"types": "./dist/types.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"CHANGELOG.md"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"gluhar": "npm run gluhar --prefix ../.. -- --cwd=$PWD",
|
|
30
|
+
"build": "npm run gluhar build -- -t module",
|
|
31
|
+
"dev": "nuxi dev playground",
|
|
32
|
+
"dev:build": "nuxi build playground",
|
|
33
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"test:watch": "vitest watch"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@nuxt/kit": "^3.13.1",
|
|
40
|
+
"@gluhar/core": "^2.0.0",
|
|
41
|
+
"@gluhar/i18n": "^2.0.0",
|
|
42
|
+
"@gluhar/sanity": "^2.0.0",
|
|
43
|
+
"@gluhar/theme": "^2.0.0",
|
|
44
|
+
"@pinia/nuxt": "^0.5.4",
|
|
45
|
+
"pinia": "^2.2.2"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@nuxt/devtools": "latest",
|
|
49
|
+
"@nuxt/eslint-config": "^0.5.6",
|
|
50
|
+
"@nuxt/module-builder": "^0.8.3",
|
|
51
|
+
"@nuxt/schema": "^3.13.1",
|
|
52
|
+
"@nuxt/test-utils": "^3.14.1",
|
|
53
|
+
"@types/node": "^20.16.5",
|
|
54
|
+
"changelogen": "^0.5.5",
|
|
55
|
+
"eslint": "^9.10.0",
|
|
56
|
+
"nuxt": "^3.13.1",
|
|
57
|
+
"vitest": "^2.0.5"
|
|
58
|
+
}
|
|
59
|
+
}
|