@dargmuesli/nuxt-vio 9.0.0-beta.1 → 9.0.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/nuxt.config.ts +44 -18
- package/package.json +8 -9
- package/server/api/healthcheck.get.ts +0 -2
- package/server/middleware/headers.ts +0 -4
- package/server/utils/util.ts +2 -0
package/nuxt.config.ts
CHANGED
@@ -49,6 +49,7 @@ export default defineNuxtConfig(
|
|
49
49
|
'@nuxtjs/html-validator',
|
50
50
|
'@nuxtjs/i18n',
|
51
51
|
'@nuxtjs/tailwindcss',
|
52
|
+
'@nuxtseo/module',
|
52
53
|
'@pinia/nuxt',
|
53
54
|
// nuxt-security: remove invalid `'none'`s
|
54
55
|
(_options, nuxt) => {
|
@@ -74,16 +75,18 @@ export default defineNuxtConfig(
|
|
74
75
|
string,
|
75
76
|
any
|
76
77
|
>
|
77
|
-
)[key] = valueFiltered
|
78
|
+
)[key] = [...new Set(valueFiltered)]
|
78
79
|
}
|
79
80
|
}
|
80
81
|
}
|
81
82
|
},
|
82
83
|
'nuxt-security',
|
83
|
-
'@nuxtseo/module',
|
84
84
|
],
|
85
85
|
nitro: {
|
86
86
|
compressPublicAssets: true,
|
87
|
+
experimental: {
|
88
|
+
openAPI: process.env.NODE_ENV === 'development',
|
89
|
+
},
|
87
90
|
},
|
88
91
|
runtimeConfig: {
|
89
92
|
public: {
|
@@ -177,7 +180,7 @@ export default defineNuxtConfig(
|
|
177
180
|
// Cloudflare
|
178
181
|
...(process.env.NODE_ENV === 'production'
|
179
182
|
? {
|
180
|
-
'connect-src': [`${SITE_URL}/cdn-cgi/rum`
|
183
|
+
'connect-src': ["'self'"], // `${SITE_URL}/cdn-cgi/rum`
|
181
184
|
'script-src-elem': [
|
182
185
|
'https://static.cloudflareinsights.com',
|
183
186
|
],
|
@@ -199,6 +202,7 @@ export default defineNuxtConfig(
|
|
199
202
|
},
|
200
203
|
{
|
201
204
|
// vio
|
205
|
+
'connect-src': ["'self'"], // `${SITE_URL}/api/healthcheck`
|
202
206
|
'manifest-src': [`${SITE_URL}/site.webmanifest`],
|
203
207
|
'script-src-elem': [
|
204
208
|
'https://polyfill.io/v3/polyfill.min.js', // ESLint plugin compat
|
@@ -206,19 +210,21 @@ export default defineNuxtConfig(
|
|
206
210
|
},
|
207
211
|
{
|
208
212
|
// @nuxt/devtools
|
209
|
-
'
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
213
|
+
...(process.env.NODE_ENV === 'development'
|
214
|
+
? {
|
215
|
+
'frame-src': [
|
216
|
+
'http://localhost:3000/__nuxt_devtools__/client/',
|
217
|
+
],
|
218
|
+
}
|
219
|
+
: {}),
|
214
220
|
},
|
215
221
|
{
|
216
222
|
// nuxt-link-checker
|
217
|
-
'
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
223
|
+
...(process.env.NODE_ENV === 'development'
|
224
|
+
? {
|
225
|
+
'connect-src': ["'self'"], // 'http://localhost:3000/api/__link_checker__/inspect'
|
226
|
+
}
|
227
|
+
: {}),
|
222
228
|
},
|
223
229
|
{
|
224
230
|
// nuxt-og-image
|
@@ -244,12 +250,12 @@ export default defineNuxtConfig(
|
|
244
250
|
'connect-src': [
|
245
251
|
...(process.env.NODE_ENV === 'development'
|
246
252
|
? [
|
247
|
-
'http://localhost:3000/_nuxt/', //
|
248
|
-
'https://localhost:3000/_nuxt/', //
|
249
|
-
'ws://localhost:3000/_nuxt/', //
|
250
|
-
'wss://localhost:3000/_nuxt/', //
|
253
|
+
'http://localhost:3000/_nuxt/', // hot reload
|
254
|
+
'https://localhost:3000/_nuxt/', // hot reload
|
255
|
+
'ws://localhost:3000/_nuxt/', // hot reload
|
256
|
+
'wss://localhost:3000/_nuxt/', // hot reload
|
251
257
|
]
|
252
|
-
: ["'self'"]), //
|
258
|
+
: ["'self'"]), // build metadata and payloads
|
253
259
|
],
|
254
260
|
'img-src': [
|
255
261
|
"'self'", // TODO: replace with `"'nonce-{{nonce}}'",`
|
@@ -262,6 +268,18 @@ export default defineNuxtConfig(
|
|
262
268
|
"'unsafe-inline'", // TODO: replace with `"'nonce-{{nonce}}'",` (https://github.com/vitejs/vite/pull/11864)
|
263
269
|
],
|
264
270
|
},
|
271
|
+
{
|
272
|
+
// nitro
|
273
|
+
'connect-src': ["'self'"] /* swagger
|
274
|
+
'http://localhost:3000/_nitro/openapi.json',
|
275
|
+
'http://localhost:3000/_nitro/swagger', */,
|
276
|
+
'script-src-elem': [
|
277
|
+
'https://cdn.jsdelivr.net/npm/', // swagger // TODO: increase precision (https://github.com/unjs/nitro/issues/1757)
|
278
|
+
],
|
279
|
+
'style-src': [
|
280
|
+
'https://cdn.jsdelivr.net/npm/', // swagger // TODO: increase precision (https://github.com/unjs/nitro/issues/1757)
|
281
|
+
],
|
282
|
+
},
|
265
283
|
{
|
266
284
|
// base
|
267
285
|
'base-uri': ["'none'"], // does not fallback to `default-src`
|
@@ -325,6 +343,14 @@ export default defineNuxtConfig(
|
|
325
343
|
tailwindcss: {
|
326
344
|
cssPath: join(currentDir, './assets/css/tailwind.css'),
|
327
345
|
},
|
346
|
+
|
347
|
+
// environments
|
348
|
+
$development: {
|
349
|
+
// modules
|
350
|
+
security: {
|
351
|
+
rateLimiter: false, // TODO: enable when nuxt-link-checker bundles requests (https://github.com/harlan-zw/nuxt-link-checker/issues/21)
|
352
|
+
},
|
353
|
+
},
|
328
354
|
},
|
329
355
|
VIO_NUXT_BASE_CONFIG({
|
330
356
|
defaultLocale: 'en',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dargmuesli/nuxt-vio",
|
3
|
-
"version": "9.0.0-beta.
|
3
|
+
"version": "9.0.0-beta.3",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/dargmuesli/vio.git"
|
@@ -77,8 +77,8 @@
|
|
77
77
|
"@nuxtjs/color-mode": "3.3.0",
|
78
78
|
"@nuxtjs/eslint-config-typescript": "12.1.0",
|
79
79
|
"@nuxtjs/html-validator": "1.5.2",
|
80
|
-
"@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge@8.0.0-rc.5-
|
81
|
-
"@nuxtjs/tailwindcss": "6.8.
|
80
|
+
"@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge@8.0.0-rc.5-28305512.c5b00d5",
|
81
|
+
"@nuxtjs/tailwindcss": "6.8.1",
|
82
82
|
"@nuxtseo/module": "2.0.0-beta.39",
|
83
83
|
"@pinia/nuxt": "0.5.1",
|
84
84
|
"@playwright/test": "1.39.0",
|
@@ -97,7 +97,7 @@
|
|
97
97
|
"cookie-es": "1.0.0",
|
98
98
|
"cross-env": "7.0.3",
|
99
99
|
"dayjs": "2.0.0-alpha.4",
|
100
|
-
"defu": "6.1.
|
100
|
+
"defu": "6.1.3",
|
101
101
|
"eslint": "8.52.0",
|
102
102
|
"eslint-config-prettier": "9.0.0",
|
103
103
|
"eslint-plugin-compat": "4.2.0",
|
@@ -105,9 +105,8 @@
|
|
105
105
|
"eslint-plugin-prettier": "5.0.1",
|
106
106
|
"eslint-plugin-yml": "1.10.0",
|
107
107
|
"h3": "1.8.2",
|
108
|
-
"is-https": "4.0.0",
|
109
108
|
"jiti": "1.20.0",
|
110
|
-
"jose": "
|
109
|
+
"jose": "5.0.1",
|
111
110
|
"lint-staged": "15.0.2",
|
112
111
|
"lodash-es": "4.17.21",
|
113
112
|
"nuxt": "3.8.0",
|
@@ -122,13 +121,13 @@
|
|
122
121
|
"stylelint-config-standard": "34.0.0",
|
123
122
|
"stylelint-no-unsupported-browser-features": "7.0.0",
|
124
123
|
"sweetalert2": "11.7.32",
|
125
|
-
"tailwindcss": "3.3.
|
124
|
+
"tailwindcss": "3.3.5",
|
126
125
|
"ufo": "1.3.1",
|
127
126
|
"unhead": "1.7.4",
|
128
|
-
"vue": "3.3.
|
127
|
+
"vue": "3.3.7",
|
129
128
|
"vue-gtag": "2.0.1",
|
130
129
|
"vue-router": "4.2.5",
|
131
|
-
"vue-tsc": "1.8.
|
130
|
+
"vue-tsc": "1.8.22"
|
132
131
|
},
|
133
132
|
"peerDependencies": {
|
134
133
|
"playwright-core": "1.39.0"
|
@@ -1,10 +1,6 @@
|
|
1
|
-
import { appendHeader, defineEventHandler } from 'h3'
|
2
1
|
import type { H3Event } from 'h3'
|
3
2
|
import type { AppConfig } from 'nuxt/schema'
|
4
3
|
|
5
|
-
import { TIMEZONE_HEADER_KEY } from '../../utils/constants'
|
6
|
-
import { getTimezone } from '../../utils/networking'
|
7
|
-
|
8
4
|
export default defineEventHandler(async (event) => {
|
9
5
|
setRequestHeader(event, TIMEZONE_HEADER_KEY, await getTimezone(event))
|
10
6
|
setResponseHeaders(event)
|