@dargmuesli/nuxt-vio 23.0.0-beta.5 → 23.0.0-beta.6
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/.config/certificates/.gitignore +2 -0
- package/.config/certificates/mkcert.sh +0 -0
- package/app/app.config.ts +0 -60
- package/app/components/vio/button/VioButtonHome.vue +1 -1
- package/app/components/vio/layout/VioLayoutBreadcrumbs.vue +1 -1
- package/nuxt.config.ts +18 -11
- package/package.json +29 -30
- package/server/api/healthcheck.get.ts +4 -3
- package/server/middleware/dateTime.ts +3 -0
- package/server/middleware/headers.ts +4 -2
- package/server/plugins/nodemailer.ts +1 -0
- package/server/utils/dateTime.ts +4 -8
- package/shared/types/app-config.d.ts +62 -0
- package/shared/types/request-event-context.d.ts +13 -0
|
File without changes
|
package/app/app.config.ts
CHANGED
|
@@ -4,63 +4,3 @@ export default defineAppConfig({
|
|
|
4
4
|
themeColor: undefined,
|
|
5
5
|
},
|
|
6
6
|
})
|
|
7
|
-
|
|
8
|
-
declare module 'nuxt/schema' {
|
|
9
|
-
interface AppConfig {
|
|
10
|
-
vio: {
|
|
11
|
-
seo?: {
|
|
12
|
-
ogImage?: {
|
|
13
|
-
defaultComponent: string // TODO: keyof OgImageComponents
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
pages?: {
|
|
17
|
-
legalNotice?: {
|
|
18
|
-
contact: {
|
|
19
|
-
email: string
|
|
20
|
-
}
|
|
21
|
-
responsibility: {
|
|
22
|
-
address: {
|
|
23
|
-
city: string
|
|
24
|
-
name: string
|
|
25
|
-
street: string
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
tmg: {
|
|
29
|
-
address: {
|
|
30
|
-
city: string
|
|
31
|
-
name: string
|
|
32
|
-
street: string
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
privacyPolicy?: {
|
|
37
|
-
hostingCdn?: {
|
|
38
|
-
external: {
|
|
39
|
-
address: {
|
|
40
|
-
city: string
|
|
41
|
-
name: string
|
|
42
|
-
street: string
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
mandatoryInfo?: {
|
|
47
|
-
responsible: {
|
|
48
|
-
address: {
|
|
49
|
-
city: string
|
|
50
|
-
email: string
|
|
51
|
-
name: string
|
|
52
|
-
street: string
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
server?: {
|
|
59
|
-
middleware: {
|
|
60
|
-
headers: Record<string, string>
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
themeColor?: string
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
package/nuxt.config.ts
CHANGED
|
@@ -52,6 +52,14 @@ export default defineNuxtConfig(
|
|
|
52
52
|
enabled: true,
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
|
+
experimental: {
|
|
56
|
+
early404: true,
|
|
57
|
+
inlineErrorRendering: true,
|
|
58
|
+
prerenderErrorPages: true,
|
|
59
|
+
routeTypedFetch: true,
|
|
60
|
+
strictRouteTypes: true,
|
|
61
|
+
typedPages: true,
|
|
62
|
+
},
|
|
55
63
|
modules: [
|
|
56
64
|
'@dargmuesli/nuxt-cookie-control',
|
|
57
65
|
'@nuxt/devtools',
|
|
@@ -118,7 +126,6 @@ export default defineNuxtConfig(
|
|
|
118
126
|
compressPublicAssets: true,
|
|
119
127
|
experimental: {
|
|
120
128
|
asyncContext: true,
|
|
121
|
-
typedPages: true,
|
|
122
129
|
},
|
|
123
130
|
},
|
|
124
131
|
runtimeConfig: {
|
|
@@ -173,20 +180,19 @@ export default defineNuxtConfig(
|
|
|
173
180
|
},
|
|
174
181
|
},
|
|
175
182
|
typescript: {
|
|
176
|
-
|
|
177
|
-
include: [resolve('./node')],
|
|
178
|
-
},
|
|
179
|
-
tsConfig: {
|
|
180
|
-
nodeTsConfig: {
|
|
181
|
-
include: [resolve('../.config'), resolve('../node')],
|
|
182
|
-
},
|
|
183
|
+
appTsConfig: {
|
|
183
184
|
vueCompilerOptions: {
|
|
184
185
|
htmlAttributes: [], // https://github.com/johnsoncodehk/volar/issues/1970#issuecomment-1276994634
|
|
185
186
|
},
|
|
186
|
-
// compilerOptions: {
|
|
187
|
-
// noErrorTruncation: true,
|
|
188
|
-
// },
|
|
189
187
|
},
|
|
188
|
+
nodeTsConfig: {
|
|
189
|
+
include: [resolve('./node')],
|
|
190
|
+
},
|
|
191
|
+
// tsConfig: {
|
|
192
|
+
// compilerOptions: {
|
|
193
|
+
// noErrorTruncation: true,
|
|
194
|
+
// },
|
|
195
|
+
// },
|
|
190
196
|
},
|
|
191
197
|
vite: {
|
|
192
198
|
plugins: [
|
|
@@ -349,6 +355,7 @@ export default defineNuxtConfig(
|
|
|
349
355
|
},
|
|
350
356
|
seo: {
|
|
351
357
|
minify: false, // TODO: enable (https://github.com/harlan-zw/nuxt-seo-utils/issues/103)
|
|
358
|
+
validateAppHead: false, // `app.head.htmlAttrs.lang` is only a fallback for the routeless SPA pages, as i18n sets the correct language per locale everywhere else.
|
|
352
359
|
},
|
|
353
360
|
shadcn: {
|
|
354
361
|
prefix: '',
|
package/package.json
CHANGED
|
@@ -1,81 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@dargmuesli/nuxt-cookie-control": "9.3.
|
|
4
|
-
"@eslint/compat": "2.1.
|
|
3
|
+
"@dargmuesli/nuxt-cookie-control": "9.3.8",
|
|
4
|
+
"@eslint/compat": "2.1.1",
|
|
5
5
|
"@heroicons/vue": "2.2.0",
|
|
6
|
-
"@http-util/status-i18n": "0.9.
|
|
6
|
+
"@http-util/status-i18n": "0.9.1",
|
|
7
7
|
"@intlify/eslint-plugin-vue-i18n": "4.5.1",
|
|
8
|
-
"@lucide/vue": "1.
|
|
9
|
-
"@nuxt/devtools": "3.4.
|
|
8
|
+
"@lucide/vue": "1.53.0",
|
|
9
|
+
"@nuxt/devtools": "3.4.2",
|
|
10
10
|
"@nuxt/eslint": "1.17.0",
|
|
11
11
|
"@nuxt/image": "2.1.0",
|
|
12
12
|
"@nuxtjs/color-mode": "4.0.1",
|
|
13
13
|
"@nuxtjs/html-validator": "2.1.0",
|
|
14
14
|
"@nuxtjs/i18n": "10.6.0",
|
|
15
|
-
"@nuxtjs/seo": "5.3.
|
|
15
|
+
"@nuxtjs/seo": "5.3.16",
|
|
16
16
|
"@nuxtjs/turnstile": "1.1.3",
|
|
17
17
|
"@pinia/nuxt": "1.0.2",
|
|
18
18
|
"@sentry/nuxt": "10.71.0",
|
|
19
19
|
"@tailwindcss/forms": "0.5.11",
|
|
20
20
|
"@tailwindcss/typography": "0.5.20",
|
|
21
21
|
"@tailwindcss/vite": "4.3.3",
|
|
22
|
-
"@takumi-rs/core": "2.
|
|
22
|
+
"@takumi-rs/core": "2.14.0",
|
|
23
23
|
"@types/lodash-es": "4.17.12",
|
|
24
|
-
"@types/nodemailer": "8.0.
|
|
24
|
+
"@types/nodemailer": "8.0.2",
|
|
25
25
|
"@urql/core": "6.0.3",
|
|
26
26
|
"@urql/vue": "2.1.1",
|
|
27
27
|
"@vuelidate/core": "2.0.3",
|
|
28
28
|
"@vuelidate/validators": "2.0.4",
|
|
29
|
-
"@vueuse/core": "
|
|
29
|
+
"@vueuse/core": "15.0.0",
|
|
30
30
|
"class-variance-authority": "0.7.1",
|
|
31
31
|
"clsx": "2.1.1",
|
|
32
|
-
"eslint": "10.
|
|
32
|
+
"eslint": "10.12.0",
|
|
33
33
|
"eslint-config-prettier": "10.1.8",
|
|
34
34
|
"eslint-plugin-compat": "7.0.2",
|
|
35
35
|
"eslint-plugin-prettier": "5.5.6",
|
|
36
36
|
"eslint-plugin-yml": "3.8.1",
|
|
37
|
-
"globals": "17.
|
|
37
|
+
"globals": "17.13.0",
|
|
38
38
|
"jiti": "2.7.0",
|
|
39
|
-
"jose": "6.2.
|
|
40
|
-
"nodemailer": "
|
|
39
|
+
"jose": "6.2.12",
|
|
40
|
+
"nodemailer": "10.0.16",
|
|
41
41
|
"nuxt-gtag": "5.0.0",
|
|
42
42
|
"nuxt-security": "2.6.0",
|
|
43
|
-
"reka-ui": "2.
|
|
43
|
+
"reka-ui": "2.11.0",
|
|
44
44
|
"shadcn-nuxt": "2.8.2",
|
|
45
|
-
"tailwind-merge": "3.
|
|
45
|
+
"tailwind-merge": "3.7.0",
|
|
46
46
|
"tw-animate-css": "1.4.0",
|
|
47
47
|
"typescript": "6.0.3",
|
|
48
48
|
"vue-sonner": "2.0.9",
|
|
49
|
-
"vue-tsc": "3.3.
|
|
49
|
+
"vue-tsc": "3.3.11"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/node": "24.
|
|
52
|
+
"@types/node": "24.19.1",
|
|
53
53
|
"@urql/devtools": "2.0.3",
|
|
54
|
-
"@urql/exchange-graphcache": "9.0.
|
|
55
|
-
"@vueuse/core": "
|
|
54
|
+
"@urql/exchange-graphcache": "9.0.2",
|
|
55
|
+
"@vueuse/core": "15.0.0",
|
|
56
56
|
"consola": "3.4.2",
|
|
57
57
|
"defu": "6.1.7",
|
|
58
|
-
"h3": "1.15.11",
|
|
59
58
|
"lodash-es": "4.18.1",
|
|
60
|
-
"nuxt": "4.
|
|
59
|
+
"nuxt": "4.6.1",
|
|
61
60
|
"pinia": "4.0.3",
|
|
62
61
|
"postcss-html": "2.0.0",
|
|
63
|
-
"prettier": "3.9.
|
|
62
|
+
"prettier": "3.9.9",
|
|
64
63
|
"prettier-plugin-tailwindcss": "0.8.1",
|
|
65
64
|
"serve": "14.2.6",
|
|
66
|
-
"sharp": "0.35.
|
|
67
|
-
"stylelint": "17.
|
|
65
|
+
"sharp": "0.35.5",
|
|
66
|
+
"stylelint": "17.16.0",
|
|
68
67
|
"stylelint-config-html": "2.0.0",
|
|
69
68
|
"stylelint-config-recommended": "18.0.0",
|
|
70
69
|
"stylelint-config-recommended-vue": "2.0.0",
|
|
71
70
|
"stylelint-config-standard": "40.0.0",
|
|
72
|
-
"stylelint-no-unsupported-browser-features": "8.1.
|
|
71
|
+
"stylelint-no-unsupported-browser-features": "8.1.2",
|
|
73
72
|
"tailwindcss": "4.3.3",
|
|
74
|
-
"vue": "3.5.
|
|
75
|
-
"vue-router": "5.
|
|
73
|
+
"vue": "3.5.43",
|
|
74
|
+
"vue-router": "5.4.0"
|
|
76
75
|
},
|
|
77
76
|
"engines": {
|
|
78
|
-
"node": "24"
|
|
77
|
+
"node": "^24.15.0"
|
|
79
78
|
},
|
|
80
79
|
"files": [
|
|
81
80
|
".config",
|
|
@@ -92,7 +91,7 @@
|
|
|
92
91
|
"main": "nuxt.config.ts",
|
|
93
92
|
"name": "@dargmuesli/nuxt-vio",
|
|
94
93
|
"peerDependencies": {
|
|
95
|
-
"nuxt": "^4.
|
|
94
|
+
"nuxt": "^4.6.0",
|
|
96
95
|
"vue": "^3.5.21",
|
|
97
96
|
"vue-router": "^4.5.1 || ^5.0.0"
|
|
98
97
|
},
|
|
@@ -104,7 +103,7 @@
|
|
|
104
103
|
"url": "git+https://github.com/dargmuesli/vio.git"
|
|
105
104
|
},
|
|
106
105
|
"type": "module",
|
|
107
|
-
"version": "23.0.0-beta.
|
|
106
|
+
"version": "23.0.0-beta.6",
|
|
108
107
|
"scripts": {
|
|
109
108
|
"build": "pnpm run build:node",
|
|
110
109
|
"build:node": "NUXT_PUBLIC_I18N_BASE_URL=https://app.localhost:3001 nuxt build playground",
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { defineEventHandler } from 'nuxt/server'
|
|
2
|
+
|
|
1
3
|
export default defineEventHandler(async (event) => {
|
|
2
4
|
const isTesting = useIsTesting()
|
|
3
5
|
event.context.$timeZone = await getTimeZone({ event, isTesting })
|
|
4
6
|
})
|
|
5
7
|
|
|
8
|
+
// h3 handlers, `useEvent()` and the app's `ssrContext.event` still see h3's context
|
|
6
9
|
declare module 'h3' {
|
|
7
10
|
interface H3EventContext {
|
|
8
11
|
$timeZone?: string
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineEventHandler, useAppConfig } from 'nuxt/server'
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler((event) => {
|
|
2
4
|
const config = useAppConfig(event)
|
|
3
5
|
|
|
4
6
|
if (!config.vio.server) return
|
|
5
7
|
|
|
6
8
|
for (const entry of Object.entries(config.vio.server.middleware.headers)) {
|
|
7
|
-
|
|
9
|
+
event.res.headers.append(entry[0], entry[1])
|
|
8
10
|
}
|
|
9
11
|
})
|
package/server/utils/dateTime.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { getCookie, getRequestIP, type RequestEvent } from 'nuxt/server'
|
|
2
2
|
|
|
3
3
|
export const getTimeZone = async ({
|
|
4
4
|
event,
|
|
5
5
|
isTesting,
|
|
6
6
|
}: {
|
|
7
|
-
event:
|
|
7
|
+
event: RequestEvent
|
|
8
8
|
isTesting?: boolean
|
|
9
9
|
}) => {
|
|
10
10
|
const timeZoneBySsr = event.context.$timeZone
|
|
@@ -26,12 +26,8 @@ export const getTimeZone = async ({
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const isTesting = useIsTesting()
|
|
32
|
-
|
|
33
|
-
return await getTimeZone({ event, isTesting })
|
|
34
|
-
}
|
|
29
|
+
// the `dateTime` middleware has already resolved the time zone for every request
|
|
30
|
+
export const useTimeZone = async () => useEvent().context.$timeZone
|
|
35
31
|
|
|
36
32
|
export const getTimeZoneByIpApi = async ({ ip }: { ip: string }) => {
|
|
37
33
|
const ipApiResult = await $fetch<{ timezone: string }>(
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// in `shared/` so that both the app's and the server's `useAppConfig` are typed
|
|
2
|
+
declare module '@nuxt/schema' {
|
|
3
|
+
interface CustomAppConfig {
|
|
4
|
+
vio: {
|
|
5
|
+
seo?: {
|
|
6
|
+
ogImage?: {
|
|
7
|
+
defaultComponent: string // TODO: keyof OgImageComponents
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
pages?: {
|
|
11
|
+
legalNotice?: {
|
|
12
|
+
contact: {
|
|
13
|
+
email: string
|
|
14
|
+
}
|
|
15
|
+
responsibility: {
|
|
16
|
+
address: {
|
|
17
|
+
city: string
|
|
18
|
+
name: string
|
|
19
|
+
street: string
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
tmg: {
|
|
23
|
+
address: {
|
|
24
|
+
city: string
|
|
25
|
+
name: string
|
|
26
|
+
street: string
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
privacyPolicy?: {
|
|
31
|
+
hostingCdn?: {
|
|
32
|
+
external: {
|
|
33
|
+
address: {
|
|
34
|
+
city: string
|
|
35
|
+
name: string
|
|
36
|
+
street: string
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
mandatoryInfo?: {
|
|
41
|
+
responsible: {
|
|
42
|
+
address: {
|
|
43
|
+
city: string
|
|
44
|
+
email: string
|
|
45
|
+
name: string
|
|
46
|
+
street: string
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
server?: {
|
|
53
|
+
middleware: {
|
|
54
|
+
headers: Record<string, string>
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
themeColor?: string
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Transporter } from 'nodemailer'
|
|
2
|
+
|
|
3
|
+
// in `shared/` because typed `$fetch` also type-checks server handlers in the app context
|
|
4
|
+
declare module '@nuxt/schema' {
|
|
5
|
+
interface RequestEventContext {
|
|
6
|
+
$email?: {
|
|
7
|
+
nodemailer: {
|
|
8
|
+
transporter: Transporter
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
$timeZone?: string
|
|
12
|
+
}
|
|
13
|
+
}
|