@dargmuesli/nuxt-vio 1.11.7 → 1.13.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/app.config.ts +0 -4
- package/components/VioApp.vue +9 -3
- package/components/VioError.vue +12 -3
- package/error.vue +9 -7
- package/nuxt.config.ts +23 -8
- package/package.json +9 -4
- package/utils/constants.ts +0 -17
package/app.config.ts
CHANGED
@@ -1,19 +1,15 @@
|
|
1
1
|
import { useSeoMeta } from '@unhead/vue'
|
2
2
|
|
3
|
-
import { SITE_NAME } from './utils/constants'
|
4
|
-
|
5
3
|
export default defineAppConfig({
|
6
4
|
seoMeta: {
|
7
5
|
twitterSite: '@dargmuesli',
|
8
6
|
},
|
9
|
-
siteName: SITE_NAME,
|
10
7
|
themeColor: '#202020',
|
11
8
|
})
|
12
9
|
|
13
10
|
declare module '@nuxt/schema' {
|
14
11
|
interface AppConfigInput {
|
15
12
|
seoMeta?: Parameters<typeof useSeoMeta>[0]
|
16
|
-
siteName: string
|
17
13
|
themeColor?: string
|
18
14
|
}
|
19
15
|
}
|
package/components/VioApp.vue
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
<NuxtLayout>
|
4
4
|
<!-- `NuxtLayout` can't have mulitple child nodes (https://github.com/nuxt/nuxt/issues/21759) -->
|
5
5
|
<div>
|
6
|
-
<SeoKit :site-description="siteDescription" :language="locale" />
|
7
|
-
<OgImageStatic :alt="ogImageAlt" component="OgImage" />
|
8
6
|
<NuxtPage />
|
9
7
|
<CookieControl :locale="locale" />
|
10
8
|
</div>
|
@@ -17,7 +15,7 @@ export interface Props {
|
|
17
15
|
siteDescription: string
|
18
16
|
ogImageAlt: string
|
19
17
|
}
|
20
|
-
withDefaults(defineProps<Props>(), {})
|
18
|
+
const props = withDefaults(defineProps<Props>(), {})
|
21
19
|
|
22
20
|
const { locale } = useI18n()
|
23
21
|
const cookieControl = useCookieControl()
|
@@ -41,7 +39,15 @@ watch(
|
|
41
39
|
},
|
42
40
|
{ deep: true },
|
43
41
|
)
|
42
|
+
|
44
43
|
// initialization
|
44
|
+
updateSiteConfig({
|
45
|
+
description: props.siteDescription,
|
46
|
+
})
|
47
|
+
defineOgImage({
|
48
|
+
alt: props.ogImageAlt,
|
49
|
+
description: props.siteDescription,
|
50
|
+
})
|
45
51
|
useAppLayout()
|
46
52
|
useFavicons()
|
47
53
|
</script>
|
package/components/VioError.vue
CHANGED
@@ -1,17 +1,26 @@
|
|
1
1
|
<template>
|
2
|
-
<h1>{{
|
2
|
+
<h1>{{ `${statusCode} - ${statusReason}` }}</h1>
|
3
|
+
<div>
|
4
|
+
{{ description }}
|
5
|
+
</div>
|
6
|
+
<div v-if="stack && !runtimeConfig.public.isInProduction" v-html="stack" />
|
3
7
|
</template>
|
4
8
|
|
5
9
|
<script setup lang="ts">
|
6
10
|
import { status } from '@http-util/status-i18n'
|
7
11
|
|
8
12
|
export interface Props {
|
9
|
-
statusCode
|
13
|
+
statusCode: number
|
14
|
+
statusMessage?: string
|
15
|
+
description: string
|
16
|
+
stack?: string
|
10
17
|
}
|
11
18
|
const props = withDefaults(defineProps<Props>(), {
|
12
|
-
|
19
|
+
statusMessage: undefined,
|
20
|
+
stack: undefined,
|
13
21
|
})
|
14
22
|
|
23
|
+
const runtimeConfig = useRuntimeConfig()
|
15
24
|
const { locale, t } = useI18n()
|
16
25
|
|
17
26
|
// computations
|
package/error.vue
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
<template>
|
2
2
|
<NuxtLayout>
|
3
3
|
<VioError
|
4
|
-
:status-code="error
|
4
|
+
:status-code="error.statusCode"
|
5
|
+
:status-message="error.statusMessage"
|
6
|
+
:description="error.message"
|
7
|
+
:stack="error.stack"
|
5
8
|
/>
|
6
9
|
</NuxtLayout>
|
7
10
|
</template>
|
8
11
|
|
9
12
|
<script setup lang="ts">
|
10
|
-
|
13
|
+
import { NuxtError } from 'nuxt/app'
|
14
|
+
|
11
15
|
export interface Props {
|
12
|
-
error
|
16
|
+
error: NuxtError
|
13
17
|
}
|
14
|
-
const props = withDefaults(defineProps<Props>(), {
|
15
|
-
error: undefined,
|
16
|
-
})
|
18
|
+
const props = withDefaults(defineProps<Props>(), {})
|
17
19
|
|
18
20
|
useHead({
|
19
|
-
title: props.error
|
21
|
+
title: `${props.error.statusCode} - ${props.error.message}`,
|
20
22
|
})
|
21
23
|
</script>
|
package/nuxt.config.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { dirname, join } from 'node:path'
|
2
2
|
import { fileURLToPath } from 'node:url'
|
3
3
|
|
4
|
-
import {
|
4
|
+
import { SITE_NAME } from './utils/constants'
|
5
5
|
|
6
6
|
const currentDir = dirname(fileURLToPath(import.meta.url))
|
7
7
|
|
@@ -28,12 +28,12 @@ export default defineNuxtConfig({
|
|
28
28
|
title: SITE_NAME, // fallback data to prevent invalid html at generation
|
29
29
|
},
|
30
30
|
},
|
31
|
-
extends: ['nuxt-seo-kit'],
|
32
31
|
modules: [
|
33
32
|
'@dargmuesli/nuxt-cookie-control',
|
34
33
|
'@nuxtjs/html-validator',
|
35
34
|
'@nuxtjs/i18n',
|
36
35
|
'@nuxtjs/tailwindcss',
|
36
|
+
'nuxt-seo-kit-module',
|
37
37
|
],
|
38
38
|
nitro: {
|
39
39
|
compressPublicAssets: true,
|
@@ -41,11 +41,8 @@ export default defineNuxtConfig({
|
|
41
41
|
runtimeConfig: {
|
42
42
|
public: {
|
43
43
|
googleAnalyticsId: '', // set via environment variable `NUXT_PUBLIC_GOOGLE_ANALYTICS_ID` only
|
44
|
+
isInProduction: process.env.NODE_ENV === 'production',
|
44
45
|
isTesting: false,
|
45
|
-
...{
|
46
|
-
siteName: SITE_NAME,
|
47
|
-
siteUrl: BASE_URL,
|
48
|
-
},
|
49
46
|
},
|
50
47
|
},
|
51
48
|
typescript: {
|
@@ -110,7 +107,20 @@ export default defineNuxtConfig({
|
|
110
107
|
detectBrowserLanguage: false, // Enabling browser language detection does not generate (!) other languages than the default one.
|
111
108
|
langDir: 'locales',
|
112
109
|
lazy: true,
|
113
|
-
locales:
|
110
|
+
locales: [
|
111
|
+
{
|
112
|
+
code: 'en',
|
113
|
+
file: 'en.json',
|
114
|
+
name: 'English',
|
115
|
+
iso: 'en', // Will be used as catchall locale by default.
|
116
|
+
},
|
117
|
+
{
|
118
|
+
code: 'de',
|
119
|
+
file: 'de.json',
|
120
|
+
name: 'Deutsch',
|
121
|
+
iso: 'de',
|
122
|
+
},
|
123
|
+
],
|
114
124
|
vueI18n: {
|
115
125
|
fallbackWarn: false, // TODO: don't show incorrect warnings (https://github.com/intlify/vue-i18n-next/issues/776)
|
116
126
|
},
|
@@ -118,9 +128,14 @@ export default defineNuxtConfig({
|
|
118
128
|
linkChecker: {
|
119
129
|
failOn404: false, // TODO: enable (https://github.com/harlan-zw/nuxt-seo-kit/issues/4#issuecomment-1434522124)
|
120
130
|
},
|
121
|
-
|
131
|
+
seoKit: {
|
122
132
|
splash: false,
|
123
133
|
},
|
134
|
+
site: {
|
135
|
+
debug: process.env.NODE_ENV === 'development',
|
136
|
+
name: SITE_NAME,
|
137
|
+
url: BASE_URL,
|
138
|
+
},
|
124
139
|
tailwindcss: {
|
125
140
|
cssPath: join(currentDir, './assets/css/tailwind.css'),
|
126
141
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dargmuesli/nuxt-vio",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.13.0",
|
4
4
|
"type": "module",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -44,14 +44,14 @@
|
|
44
44
|
"@nuxtjs/i18n": "8.0.0-beta.10",
|
45
45
|
"@nuxtjs/tailwindcss": "6.8.0",
|
46
46
|
"@tailwindcss/typography": "0.5.9",
|
47
|
-
"nuxt-seo-kit": "
|
47
|
+
"nuxt-seo-kit-module": "2.0.0-beta.5",
|
48
48
|
"sweetalert2": "11.7.20",
|
49
49
|
"vue-gtag": "2.0.1"
|
50
50
|
},
|
51
51
|
"devDependencies": {
|
52
52
|
"@commitlint/cli": "17.6.7",
|
53
53
|
"@commitlint/config-conventional": "17.6.7",
|
54
|
-
"@intlify/eslint-plugin-vue-i18n": "3.0.0-next.
|
54
|
+
"@intlify/eslint-plugin-vue-i18n": "3.0.0-next.3",
|
55
55
|
"@nuxtjs/eslint-config-typescript": "12.0.0",
|
56
56
|
"eslint": "8.45.0",
|
57
57
|
"eslint-config-prettier": "8.8.0",
|
@@ -67,6 +67,11 @@
|
|
67
67
|
"stylelint-config-standard": "34.0.0",
|
68
68
|
"stylelint-no-unsupported-browser-features": "7.0.0",
|
69
69
|
"typescript": "5.1.6",
|
70
|
-
"vue-tsc": "1.8.
|
70
|
+
"vue-tsc": "1.8.8"
|
71
|
+
},
|
72
|
+
"pnpm": {
|
73
|
+
"overrides": {
|
74
|
+
"nuxt-og-image": "2.0.11"
|
75
|
+
}
|
71
76
|
}
|
72
77
|
}
|
package/utils/constants.ts
CHANGED
@@ -1,18 +1 @@
|
|
1
|
-
import { LocaleObject } from '@nuxtjs/i18n/dist/runtime/composables'
|
2
|
-
|
3
|
-
export const CYPRESS_BASE_URL = 'http://localhost:3000'
|
4
|
-
export const LOCALES: LocaleObject[] = [
|
5
|
-
{
|
6
|
-
code: 'en',
|
7
|
-
file: 'en.json',
|
8
|
-
name: 'English',
|
9
|
-
iso: 'en', // Will be used as catchall locale by default.
|
10
|
-
},
|
11
|
-
{
|
12
|
-
code: 'de',
|
13
|
-
file: 'de.json',
|
14
|
-
name: 'Deutsch',
|
15
|
-
iso: 'de',
|
16
|
-
},
|
17
|
-
]
|
18
1
|
export const SITE_NAME = 'Vio'
|