@dargmuesli/nuxt-vio 20.5.0 → 20.5.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/app/components/vio/_/VioError.vue +6 -2
- package/app/composables/loading.ts +3 -3
- package/app/error.vue +5 -7
- package/package.json +17 -17
- package/server/utils/dependencies/turnstile.ts +4 -4
- package/shared/utils/constants.ts +3 -1
- package/shared/utils/nuxt.ts +2 -10
- package/server/utils/constants.ts +0 -3
|
@@ -13,14 +13,18 @@
|
|
|
13
13
|
|
|
14
14
|
<script setup lang="ts">
|
|
15
15
|
interface Props {
|
|
16
|
+
status?: number
|
|
16
17
|
statusCode?: number
|
|
17
18
|
statusMessage?: string
|
|
19
|
+
statusText?: string
|
|
18
20
|
description: string
|
|
19
21
|
stack?: string
|
|
20
22
|
}
|
|
21
23
|
const props = withDefaults(defineProps<Props>(), {
|
|
24
|
+
status: undefined,
|
|
22
25
|
statusCode: undefined,
|
|
23
26
|
statusMessage: undefined,
|
|
27
|
+
statusText: undefined,
|
|
24
28
|
stack: undefined,
|
|
25
29
|
})
|
|
26
30
|
|
|
@@ -28,9 +32,9 @@ const runtimeConfig = useRuntimeConfig()
|
|
|
28
32
|
const { locale, t } = useI18n()
|
|
29
33
|
|
|
30
34
|
// data
|
|
31
|
-
const title = `${props.statusCode ? `${props.statusCode} - ` : ''}${
|
|
35
|
+
const title = `${props.status || props.statusCode ? `${props.status || props.statusCode} - ` : ''}${
|
|
32
36
|
(await import('@http-util/status-i18n')).status(
|
|
33
|
-
props.statusCode,
|
|
37
|
+
props.status || props.statusCode,
|
|
34
38
|
locale.value,
|
|
35
39
|
) || t('error')
|
|
36
40
|
}`
|
|
@@ -3,14 +3,14 @@ export const useLoadingDoneIndicator = (id?: string) => {
|
|
|
3
3
|
const loadingId = id || useId()
|
|
4
4
|
|
|
5
5
|
if (!loadingId)
|
|
6
|
-
throw createError({
|
|
6
|
+
throw createError({ status: 500, statusText: 'Loading id missing!' })
|
|
7
7
|
|
|
8
8
|
const loadingIdToAdd = `${import.meta.server ? 'ssr' : 'csr'}_${loadingId}`
|
|
9
9
|
|
|
10
10
|
if (loadingIds.value.includes(loadingIdToAdd)) {
|
|
11
11
|
throw createError({
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
status: 500,
|
|
13
|
+
statusText: 'Loading id already exists!',
|
|
14
14
|
})
|
|
15
15
|
}
|
|
16
16
|
|
package/app/error.vue
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<!-- `NuxtLayout` can't be the root element (https://github.com/nuxt/nuxt/issues/25214) -->
|
|
4
4
|
<NuxtLayout>
|
|
5
5
|
<VioError
|
|
6
|
-
:status
|
|
7
|
-
:status-
|
|
6
|
+
:status="error.status"
|
|
7
|
+
:status-text="error.statusText"
|
|
8
8
|
:description="error.message"
|
|
9
9
|
:stack="error.stack"
|
|
10
10
|
/>
|
|
@@ -15,17 +15,15 @@
|
|
|
15
15
|
<script setup lang="ts">
|
|
16
16
|
import type { NuxtError } from 'nuxt/app'
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const { error } = defineProps<{
|
|
19
19
|
error: NuxtError
|
|
20
|
-
}
|
|
21
|
-
const props = withDefaults(defineProps<Props>(), {})
|
|
22
|
-
const errorProp = toRef(() => props.error)
|
|
20
|
+
}>()
|
|
23
21
|
|
|
24
22
|
// initialization
|
|
25
23
|
useAppLayout()
|
|
26
24
|
|
|
27
25
|
useHeadDefault({
|
|
28
|
-
title: `${
|
|
26
|
+
title: `${error.status} - ${error.statusText}`,
|
|
29
27
|
})
|
|
30
28
|
defineOgImageComponent('NuxtSeo', {}, {})
|
|
31
29
|
</script>
|
package/package.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@dargmuesli/nuxt-cookie-control": "9.1.
|
|
4
|
-
"@eslint/compat": "2.0.
|
|
3
|
+
"@dargmuesli/nuxt-cookie-control": "9.1.14",
|
|
4
|
+
"@eslint/compat": "2.0.2",
|
|
5
5
|
"@heroicons/vue": "2.2.0",
|
|
6
6
|
"@nuxtjs/turnstile": "1.1.1",
|
|
7
7
|
"@http-util/status-i18n": "0.9.0",
|
|
8
8
|
"@intlify/eslint-plugin-vue-i18n": "4.1.1",
|
|
9
9
|
"@nuxt/devtools": "3.1.1",
|
|
10
|
-
"@nuxt/eslint": "1.
|
|
10
|
+
"@nuxt/eslint": "1.13.0",
|
|
11
11
|
"@nuxt/image": "2.0.0",
|
|
12
12
|
"@nuxtjs/color-mode": "4.0.0",
|
|
13
13
|
"@nuxtjs/html-validator": "2.1.0",
|
|
14
14
|
"@nuxtjs/i18n": "10.2.1",
|
|
15
|
-
"@nuxtjs/seo": "3.
|
|
15
|
+
"@nuxtjs/seo": "3.4.0",
|
|
16
16
|
"@pinia/nuxt": "0.11.3",
|
|
17
17
|
"@tailwindcss/forms": "0.5.11",
|
|
18
18
|
"@tailwindcss/typography": "0.5.19",
|
|
19
19
|
"@tailwindcss/vite": "4.1.18",
|
|
20
20
|
"@types/lodash-es": "4.17.12",
|
|
21
|
+
"@types/nodemailer": "7.0.9",
|
|
21
22
|
"@urql/core": "6.0.1",
|
|
22
23
|
"@urql/vue": "2.0.0",
|
|
23
24
|
"@vuelidate/core": "2.0.3",
|
|
24
25
|
"@vuelidate/validators": "2.0.4",
|
|
25
|
-
"@vueuse/core": "14.
|
|
26
|
+
"@vueuse/core": "14.2.0",
|
|
26
27
|
"class-variance-authority": "0.7.1",
|
|
27
|
-
"clipboardy": "5.0
|
|
28
|
+
"clipboardy": "5.2.0",
|
|
28
29
|
"clsx": "2.1.1",
|
|
29
30
|
"eslint": "9.39.2",
|
|
30
31
|
"eslint-config-prettier": "10.1.8",
|
|
31
|
-
"eslint-plugin-compat": "6.0
|
|
32
|
+
"eslint-plugin-compat": "6.1.0",
|
|
32
33
|
"eslint-plugin-prettier": "5.5.5",
|
|
33
34
|
"eslint-plugin-yml": "3.0.0",
|
|
34
|
-
"globals": "17.
|
|
35
|
+
"globals": "17.3.0",
|
|
35
36
|
"jiti": "2.6.1",
|
|
36
37
|
"jose": "6.1.3",
|
|
37
|
-
"lucide-vue-next": "0.
|
|
38
|
+
"lucide-vue-next": "0.563.0",
|
|
38
39
|
"nodemailer": "7.0.13",
|
|
39
40
|
"nuxt-gtag": "4.1.0",
|
|
40
41
|
"nuxt-security": "2.5.1",
|
|
41
|
-
"reka-ui": "2.
|
|
42
|
+
"reka-ui": "2.8.0",
|
|
42
43
|
"shadcn-nuxt": "2.4.3",
|
|
43
44
|
"tailwind-merge": "3.4.0",
|
|
44
45
|
"tw-animate-css": "1.4.0",
|
|
45
46
|
"vue-sonner": "2.0.9",
|
|
46
|
-
"vue-tsc": "3.2.
|
|
47
|
+
"vue-tsc": "3.2.4"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@types/nodemailer": "7.0.9",
|
|
50
50
|
"@types/node": "24.10.9",
|
|
51
51
|
"@urql/devtools": "2.0.3",
|
|
52
52
|
"@urql/exchange-graphcache": "9.0.0",
|
|
53
|
-
"@vueuse/core": "14.
|
|
53
|
+
"@vueuse/core": "14.2.0",
|
|
54
54
|
"consola": "3.4.2",
|
|
55
55
|
"defu": "6.1.4",
|
|
56
56
|
"h3": "1.15.5",
|
|
57
57
|
"lodash-es": "4.17.23",
|
|
58
|
-
"nuxt": "
|
|
58
|
+
"nuxt": "https://pkg.pr.new/nuxt@34210",
|
|
59
59
|
"pinia": "3.0.4",
|
|
60
60
|
"prettier": "3.8.1",
|
|
61
61
|
"prettier-plugin-tailwindcss": "0.7.2",
|
|
62
62
|
"serve": "14.2.5",
|
|
63
63
|
"sharp": "0.34.5",
|
|
64
|
-
"stylelint": "17.
|
|
64
|
+
"stylelint": "17.1.0",
|
|
65
65
|
"stylelint-config-recommended-vue": "1.6.1",
|
|
66
66
|
"stylelint-config-standard": "40.0.0",
|
|
67
67
|
"stylelint-no-unsupported-browser-features": "8.0.5",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"build": "pnpm run build:node",
|
|
101
101
|
"build:node": "nuxt build playground",
|
|
102
102
|
"build:static": "nuxt generate playground",
|
|
103
|
-
"build:static:test": "
|
|
103
|
+
"build:static:test": "NUXT_PUBLIC_SITE_URL=https://localhost:3002 pnpm run build:static",
|
|
104
104
|
"dev": "pnpm run start:dev",
|
|
105
105
|
"generate": "pnpm run build:static",
|
|
106
106
|
"lint": "pnpm run lint:js && pnpm run lint:ts && pnpm run lint:style",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"start:static": "serve playground/.output/public --ssl-cert ./.config/certificates/ssl.crt --ssl-key ./.config/certificates/ssl.key"
|
|
118
118
|
},
|
|
119
119
|
"type": "module",
|
|
120
|
-
"version": "20.5.
|
|
120
|
+
"version": "20.5.2"
|
|
121
121
|
}
|
|
@@ -7,8 +7,8 @@ import { consola } from 'consola'
|
|
|
7
7
|
export const assertTurnstileValid = async ({ token }: { token?: string }) => {
|
|
8
8
|
if (!token) {
|
|
9
9
|
throw createError({
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
status: 422,
|
|
11
|
+
statusText: 'Turnstile token not provided.',
|
|
12
12
|
})
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -16,8 +16,8 @@ export const assertTurnstileValid = async ({ token }: { token?: string }) => {
|
|
|
16
16
|
|
|
17
17
|
if (!result.success) {
|
|
18
18
|
throw createError({
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
status: 403,
|
|
20
|
+
statusText: `Turnstile verification unsuccessful: ${result['error-codes'].join(', ')}`,
|
|
21
21
|
})
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -2,10 +2,12 @@ import { DEFAULTS } from '@dargmuesli/nuxt-cookie-control/runtime/types.js'
|
|
|
2
2
|
import { helpers } from '@vuelidate/validators'
|
|
3
3
|
import { defu } from 'defu'
|
|
4
4
|
|
|
5
|
+
import { IS_IN_PRODUCTION, IS_IN_STACK } from '../../node'
|
|
6
|
+
|
|
5
7
|
export const VIO_SITE_NAME = 'Vio'
|
|
6
8
|
|
|
9
|
+
export const IS_IN_FRONTEND_DEVELOPMENT = !IS_IN_PRODUCTION && !IS_IN_STACK
|
|
7
10
|
export const SITE_URL =
|
|
8
|
-
process.env.SITE_URL ||
|
|
9
11
|
process.env.NUXT_PUBLIC_SITE_URL ||
|
|
10
12
|
`https://${process.env.HOST || 'localhost'}:${process.env.PORT || '3000'}`
|
|
11
13
|
export const CACHE_VERSION = 'zeMtipb6C9'
|
package/shared/utils/nuxt.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { defineNuxtConfig } from 'nuxt/config'
|
|
2
2
|
|
|
3
|
-
import { I18N_MODULE_CONFIG } from './constants'
|
|
3
|
+
import { I18N_MODULE_CONFIG, IS_IN_FRONTEND_DEVELOPMENT } from './constants'
|
|
4
4
|
|
|
5
5
|
export const VIO_NUXT_BASE_CONFIG = ({
|
|
6
6
|
siteName,
|
|
@@ -18,15 +18,7 @@ export const VIO_NUXT_BASE_CONFIG = ({
|
|
|
18
18
|
runtimeConfig: {
|
|
19
19
|
public: {
|
|
20
20
|
vio: {
|
|
21
|
-
|
|
22
|
-
? {
|
|
23
|
-
stagingHost:
|
|
24
|
-
process.env.NODE_ENV !== 'production' &&
|
|
25
|
-
!process.env.NUXT_PUBLIC_SITE_URL
|
|
26
|
-
? stagingHost
|
|
27
|
-
: undefined,
|
|
28
|
-
}
|
|
29
|
-
: {}),
|
|
21
|
+
stagingHost: IS_IN_FRONTEND_DEVELOPMENT ? stagingHost : undefined,
|
|
30
22
|
},
|
|
31
23
|
},
|
|
32
24
|
},
|