@dargmuesli/nuxt-vio 12.1.1 → 13.1.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/.config/certificates/mkcert.sh +30 -0
- package/nuxt.config.ts +7 -1
- package/package.json +37 -57
- package/utils/constants.ts +0 -37
- package/utils/nuxt.ts +39 -0
- package/README.md +0 -7
- package/playwright.config.ts +0 -99
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
THIS=$(dirname "$(readlink -f "$0")")
|
3
|
+
|
4
|
+
create() {
|
5
|
+
NAME="$1"
|
6
|
+
shift
|
7
|
+
CONTENT=$*
|
8
|
+
|
9
|
+
path="$THIS/$NAME"
|
10
|
+
certfile="$path.crt"
|
11
|
+
keyfile="$path.key"
|
12
|
+
|
13
|
+
if [ "$CONTENT" != "" ]; then
|
14
|
+
# shellcheck disable=SC2086
|
15
|
+
mkcert \
|
16
|
+
-cert-file "$certfile" \
|
17
|
+
-ecdsa \
|
18
|
+
-key-file "$keyfile" $CONTENT
|
19
|
+
fi
|
20
|
+
|
21
|
+
cat "$(mkcert -CAROOT)/rootCA.pem" >> "$certfile"
|
22
|
+
}
|
23
|
+
|
24
|
+
echo "key crt" | tr ' ' '\n' | while read -r glob; do
|
25
|
+
if test -n "$(find "$THIS" -maxdepth 1 -name "*.$glob" -print -quit)"; then
|
26
|
+
rm "$THIS"/*."$glob"
|
27
|
+
fi
|
28
|
+
done
|
29
|
+
|
30
|
+
create "ssl" "localhost" "127.0.0.1" "0.0.0.0"
|
package/nuxt.config.ts
CHANGED
@@ -8,9 +8,9 @@ import {
|
|
8
8
|
SITE_NAME,
|
9
9
|
TIMEZONE_COOKIE_NAME,
|
10
10
|
GTAG_COOKIE_ID,
|
11
|
-
VIO_NUXT_BASE_CONFIG,
|
12
11
|
GET_CSP,
|
13
12
|
} from './utils/constants'
|
13
|
+
import { VIO_NUXT_BASE_CONFIG } from './utils/nuxt'
|
14
14
|
|
15
15
|
const currentDir = dirname(fileURLToPath(import.meta.url))
|
16
16
|
|
@@ -29,6 +29,12 @@ export default defineNuxtConfig(
|
|
29
29
|
name: 'layout',
|
30
30
|
},
|
31
31
|
},
|
32
|
+
devServer: {
|
33
|
+
https: {
|
34
|
+
key: './.config/certificates/ssl.key',
|
35
|
+
cert: './.config/certificates/ssl.crt',
|
36
|
+
},
|
37
|
+
},
|
32
38
|
devtools: {
|
33
39
|
timeline: {
|
34
40
|
enabled: true,
|
package/package.json
CHANGED
@@ -1,39 +1,4 @@
|
|
1
1
|
{
|
2
|
-
"name": "@dargmuesli/nuxt-vio",
|
3
|
-
"version": "12.1.1",
|
4
|
-
"repository": {
|
5
|
-
"type": "git",
|
6
|
-
"url": "git+https://github.com/dargmuesli/vio.git"
|
7
|
-
},
|
8
|
-
"type": "module",
|
9
|
-
"publishConfig": {
|
10
|
-
"access": "public"
|
11
|
-
},
|
12
|
-
"engines": {
|
13
|
-
"node": "20"
|
14
|
-
},
|
15
|
-
"packageManager": "pnpm@9.3.0",
|
16
|
-
"files": [
|
17
|
-
".config",
|
18
|
-
"assets",
|
19
|
-
"components",
|
20
|
-
"composables",
|
21
|
-
"layouts",
|
22
|
-
"locales",
|
23
|
-
"pages",
|
24
|
-
"plugins",
|
25
|
-
"server",
|
26
|
-
"store",
|
27
|
-
"types",
|
28
|
-
"utils",
|
29
|
-
"app.config.ts",
|
30
|
-
"error.vue",
|
31
|
-
"i18n.config.ts",
|
32
|
-
"nuxt.config.ts",
|
33
|
-
"playwright.config.ts",
|
34
|
-
"tailwind.config.ts"
|
35
|
-
],
|
36
|
-
"main": "nuxt.config.ts",
|
37
2
|
"dependencies": {
|
38
3
|
"@dargmuesli/nuxt-cookie-control": "8.4.2",
|
39
4
|
"@eslint/compat": "1.1.0",
|
@@ -70,8 +35,6 @@
|
|
70
35
|
"vue-tsc": "2.0.21"
|
71
36
|
},
|
72
37
|
"devDependencies": {
|
73
|
-
"@axe-core/playwright": "4.9.1",
|
74
|
-
"@playwright/test": "1.44.1",
|
75
38
|
"@unhead/vue": "1.9.13",
|
76
39
|
"@urql/devtools": "2.0.3",
|
77
40
|
"@urql/exchange-graphcache": "7.1.1",
|
@@ -95,22 +58,51 @@
|
|
95
58
|
"stylelint-config-standard": "36.0.0",
|
96
59
|
"stylelint-no-unsupported-browser-features": "8.0.1",
|
97
60
|
"tailwindcss": "3.4.4",
|
98
|
-
"ufo": "1.5.3",
|
99
61
|
"unhead": "1.9.13",
|
100
62
|
"vue": "3.4.29",
|
101
63
|
"vue-router": "4.3.3"
|
102
64
|
},
|
65
|
+
"engines": {
|
66
|
+
"node": "20"
|
67
|
+
},
|
68
|
+
"files": [
|
69
|
+
".config",
|
70
|
+
"assets",
|
71
|
+
"components",
|
72
|
+
"composables",
|
73
|
+
"layouts",
|
74
|
+
"locales",
|
75
|
+
"pages",
|
76
|
+
"plugins",
|
77
|
+
"server",
|
78
|
+
"store",
|
79
|
+
"types",
|
80
|
+
"utils",
|
81
|
+
"app.config.ts",
|
82
|
+
"error.vue",
|
83
|
+
"i18n.config.ts",
|
84
|
+
"nuxt.config.ts",
|
85
|
+
"package.json",
|
86
|
+
"tailwind.config.ts"
|
87
|
+
],
|
88
|
+
"main": "nuxt.config.ts",
|
89
|
+
"name": "@dargmuesli/nuxt-vio",
|
103
90
|
"peerDependencies": {
|
104
91
|
"nuxt": "3.12.2",
|
105
|
-
"playwright-core": "1.44.1",
|
106
92
|
"vue": "3.4.29",
|
107
93
|
"vue-router": "4.3.3"
|
108
94
|
},
|
95
|
+
"publishConfig": {
|
96
|
+
"access": "public"
|
97
|
+
},
|
98
|
+
"repository": {
|
99
|
+
"type": "git",
|
100
|
+
"url": "git+https://github.com/dargmuesli/vio.git"
|
101
|
+
},
|
109
102
|
"scripts": {
|
110
103
|
"build": "pnpm run build:node",
|
111
104
|
"build:node": "nuxt build .playground",
|
112
105
|
"build:static": "nuxt generate .playground",
|
113
|
-
"build:static:test": "cross-env NODE_ENV=production SITE_URL=http://localhost:3002 pnpm run build:static",
|
114
106
|
"dev": "pnpm run start:dev",
|
115
107
|
"generate": "pnpm run build:static",
|
116
108
|
"lint:fix": "pnpm run lint:js --fix && pnpm run lint:ts --fix && pnpm run lint:style --fix",
|
@@ -119,24 +111,12 @@
|
|
119
111
|
"lint:style": "stylelint --cache \"**/*.{vue,css}\" --ignore-path .gitignore",
|
120
112
|
"lint:ts": "nuxt typecheck",
|
121
113
|
"lint": "pnpm run lint:js && pnpm run lint:ts && pnpm run lint:style",
|
122
|
-
"prepare": "nuxt prepare && nuxt prepare .playground",
|
114
|
+
"prepare": "nuxt prepare && nuxt prepare .playground && ./.config/certificates/mkcert.sh",
|
123
115
|
"preview": "nuxt preview .playground",
|
124
116
|
"start:dev": "nuxt dev .playground",
|
125
117
|
"start:node": "node .playground/.output/server/index.mjs",
|
126
|
-
"start:static": "serve .playground/.output/public"
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
"test:e2e:docker:run": "docker run --rm -v \"$PWD/..:/srv/app\" -v \"$(pnpm store path):/srv/.pnpm-store\" test-e2e_development",
|
131
|
-
"test:e2e:docker:server:dev:update": "pnpm run test:e2e:docker:server:dev --update-snapshots",
|
132
|
-
"test:e2e:docker:server:dev": "pnpm run test:e2e:docker:br pnpm --dir src run test:e2e:server:dev",
|
133
|
-
"test:e2e:docker:server:node:update": "pnpm run test:e2e:docker:server:node --update-snapshots",
|
134
|
-
"test:e2e:docker:server:node": "pnpm run test:e2e:docker:br pnpm --dir src run test:e2e:server:node",
|
135
|
-
"test:e2e:docker:server:static:update": "pnpm run test:e2e:docker:server:static --update-snapshots",
|
136
|
-
"test:e2e:docker:server:static": "pnpm run test:e2e:docker:br pnpm --dir src run test:e2e:server:static",
|
137
|
-
"test:e2e:server:dev": "cross-env PORT=3000 SITE_URL=http://localhost:3000 VIO_SERVER=dev pnpm run test:e2e",
|
138
|
-
"test:e2e:server:node": "cross-env NODE_ENV=production NUXT_PUBLIC_I18N_BASE_URL=http://localhost:3001 NUXT_PUBLIC_SITE_URL=http://localhost:3001 PORT=3001 VIO_SERVER=node pnpm run test:e2e",
|
139
|
-
"test:e2e:server:static": "cross-env NODE_ENV=production PORT=3002 SITE_URL=http://localhost:3002 VIO_SERVER=static pnpm run test:e2e",
|
140
|
-
"test:e2e": "playwright test"
|
141
|
-
}
|
118
|
+
"start:static": "serve .playground/.output/public --ssl-cert ./.config/certificates/ssl.crt --ssl-key ./.config/certificates/ssl.key"
|
119
|
+
},
|
120
|
+
"type": "module",
|
121
|
+
"version": "13.1.0"
|
142
122
|
}
|
package/utils/constants.ts
CHANGED
@@ -166,40 +166,3 @@ export const TITLE_TEMPLATE = ({
|
|
166
166
|
title?: string | null
|
167
167
|
}) => (title && title !== siteName ? `${title} · ${siteName}` : siteName)
|
168
168
|
export const VERIFICATION_FORMAT_UUID = helpers.regex(REGEX_UUID)
|
169
|
-
export const VIO_NUXT_BASE_CONFIG = ({
|
170
|
-
siteName,
|
171
|
-
stagingHost,
|
172
|
-
}: {
|
173
|
-
siteName: string
|
174
|
-
stagingHost?: string
|
175
|
-
}) =>
|
176
|
-
({
|
177
|
-
app: {
|
178
|
-
head: {
|
179
|
-
title: siteName, // fallback data to prevent invalid html at generation
|
180
|
-
},
|
181
|
-
},
|
182
|
-
runtimeConfig: {
|
183
|
-
public: {
|
184
|
-
vio: {
|
185
|
-
...(stagingHost
|
186
|
-
? {
|
187
|
-
stagingHost:
|
188
|
-
process.env.NODE_ENV !== 'production' &&
|
189
|
-
!process.env.NUXT_PUBLIC_SITE_URL
|
190
|
-
? stagingHost
|
191
|
-
: undefined,
|
192
|
-
}
|
193
|
-
: {}),
|
194
|
-
},
|
195
|
-
},
|
196
|
-
},
|
197
|
-
|
198
|
-
// modules
|
199
|
-
i18n: {
|
200
|
-
...I18N_MODULE_CONFIG, // `langDir`, `lazy` and `locales` must be configured to extend a layer having lazy-loaded translations (https://v8.i18n.nuxtjs.org/guide/layers#locales)
|
201
|
-
},
|
202
|
-
site: {
|
203
|
-
name: siteName,
|
204
|
-
},
|
205
|
-
}) as Parameters<typeof defineNuxtConfig>[0]
|
package/utils/nuxt.ts
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
import { I18N_MODULE_CONFIG } from './constants'
|
2
|
+
|
3
|
+
export const VIO_NUXT_BASE_CONFIG = ({
|
4
|
+
siteName,
|
5
|
+
stagingHost,
|
6
|
+
}: {
|
7
|
+
siteName: string
|
8
|
+
stagingHost?: string
|
9
|
+
}) =>
|
10
|
+
({
|
11
|
+
app: {
|
12
|
+
head: {
|
13
|
+
title: siteName, // fallback data to prevent invalid html at generation
|
14
|
+
},
|
15
|
+
},
|
16
|
+
runtimeConfig: {
|
17
|
+
public: {
|
18
|
+
vio: {
|
19
|
+
...(stagingHost
|
20
|
+
? {
|
21
|
+
stagingHost:
|
22
|
+
process.env.NODE_ENV !== 'production' &&
|
23
|
+
!process.env.NUXT_PUBLIC_SITE_URL
|
24
|
+
? stagingHost
|
25
|
+
: undefined,
|
26
|
+
}
|
27
|
+
: {}),
|
28
|
+
},
|
29
|
+
},
|
30
|
+
},
|
31
|
+
|
32
|
+
// modules
|
33
|
+
i18n: {
|
34
|
+
...I18N_MODULE_CONFIG, // `langDir`, `lazy` and `locales` must be configured to extend a layer having lazy-loaded translations (https://v8.i18n.nuxtjs.org/guide/layers#locales)
|
35
|
+
},
|
36
|
+
site: {
|
37
|
+
name: siteName,
|
38
|
+
},
|
39
|
+
}) as Parameters<typeof defineNuxtConfig>[0]
|
package/README.md
DELETED
package/playwright.config.ts
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
import { defineConfig, devices } from '@playwright/test'
|
2
|
-
import { SITE_URL } from './utils/constants'
|
3
|
-
|
4
|
-
/**
|
5
|
-
* Read environment variables from file.
|
6
|
-
* https://github.com/motdotla/dotenv
|
7
|
-
*/
|
8
|
-
// require('dotenv').config();
|
9
|
-
|
10
|
-
/**
|
11
|
-
* See https://playwright.dev/docs/test-configuration.
|
12
|
-
*/
|
13
|
-
export default defineConfig({
|
14
|
-
expect: {
|
15
|
-
toHaveScreenshot: {
|
16
|
-
maxDiffPixelRatio: 0.01,
|
17
|
-
},
|
18
|
-
},
|
19
|
-
|
20
|
-
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
21
|
-
forbidOnly: !!process.env.CI,
|
22
|
-
|
23
|
-
/* Run tests in files in parallel */
|
24
|
-
fullyParallel: true,
|
25
|
-
|
26
|
-
outputDir: 'tests/e2e/results',
|
27
|
-
|
28
|
-
/* Configure projects for major browsers */
|
29
|
-
projects: [
|
30
|
-
{
|
31
|
-
name: 'chromium',
|
32
|
-
use: { ...devices['Desktop Chrome'] },
|
33
|
-
},
|
34
|
-
|
35
|
-
{
|
36
|
-
name: 'firefox',
|
37
|
-
use: { ...devices['Desktop Firefox'] },
|
38
|
-
},
|
39
|
-
|
40
|
-
{
|
41
|
-
name: 'webkit',
|
42
|
-
use: { ...devices['Desktop Safari'] },
|
43
|
-
},
|
44
|
-
|
45
|
-
/* Test against mobile viewports. */
|
46
|
-
// {
|
47
|
-
// name: 'Mobile Chrome',
|
48
|
-
// use: { ...devices['Pixel 5'] },
|
49
|
-
// },
|
50
|
-
// {
|
51
|
-
// name: 'Mobile Safari',
|
52
|
-
// use: { ...devices['iPhone 12'] },
|
53
|
-
// },
|
54
|
-
|
55
|
-
/* Test against branded browsers. */
|
56
|
-
// {
|
57
|
-
// name: 'Microsoft Edge',
|
58
|
-
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
59
|
-
// },
|
60
|
-
// {
|
61
|
-
// name: 'Google Chrome',
|
62
|
-
// use: { ..devices['Desktop Chrome'], channel: 'chrome' },
|
63
|
-
// },
|
64
|
-
],
|
65
|
-
|
66
|
-
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
67
|
-
reporter: [['html', { outputFolder: 'tests/e2e/report' }]],
|
68
|
-
|
69
|
-
/* Retry on CI only */
|
70
|
-
retries: process.env.CI ? 1 : 0,
|
71
|
-
|
72
|
-
testDir: './tests/e2e/specs',
|
73
|
-
|
74
|
-
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
75
|
-
use: {
|
76
|
-
/* Base URL to use in actions like `await page.goto('/')`. */
|
77
|
-
baseURL: SITE_URL,
|
78
|
-
|
79
|
-
// TODO: remove once tests run without it
|
80
|
-
ignoreHTTPSErrors: true,
|
81
|
-
|
82
|
-
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
83
|
-
trace: 'on-first-retry',
|
84
|
-
},
|
85
|
-
|
86
|
-
/* Run your local dev server before starting the tests */
|
87
|
-
webServer: {
|
88
|
-
command: `pnpm run start:${process.env.VIO_SERVER || 'dev'}`,
|
89
|
-
env: {
|
90
|
-
NUXT_PUBLIC_VIO_IS_TESTING: 'true',
|
91
|
-
},
|
92
|
-
ignoreHTTPSErrors: true, // TODO: remove once tests run without it
|
93
|
-
timeout: process.env.NODE_ENV === 'production' ? 10000 : 100000,
|
94
|
-
url: SITE_URL,
|
95
|
-
reuseExistingServer: !process.env.CI,
|
96
|
-
},
|
97
|
-
|
98
|
-
workers: undefined,
|
99
|
-
})
|