create-nuxt-base 0.2.4 → 0.2.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.
@@ -25,46 +25,47 @@
25
25
  "postbuild": "cd .output/server/node_modules/tslib; npm pkg set 'exports[.].import.node'='./tslib.es6.mjs'"
26
26
  },
27
27
  "dependencies": {
28
- "@egoist/tailwindcss-icons": "1.8.0",
29
- "@iconify-json/bi": "1.1.23",
30
- "@lenne.tech/nuxt-base": "3.9.0",
31
- "@nuxt/image": "1.7.0",
32
- "@vee-validate/yup": "4.12.8",
33
- "@vueuse/core": "10.10.0",
34
- "@vueuse/integrations": "10.10.0",
35
- "@vueuse/nuxt": "10.10.0",
28
+ "@egoist/tailwindcss-icons": "1.8.1",
29
+ "@iconify-json/bi": "1.2.0",
30
+ "@lenne.tech/nuxt-base": "3.13.0",
31
+ "@nuxt/image": "1.8.0",
32
+ "@vee-validate/yup": "4.13.2",
33
+ "@vueuse/core": "11.0.3",
34
+ "@vueuse/integrations": "11.0.3",
35
+ "@vueuse/nuxt": "11.0.3",
36
36
  "ios-pwa-splash": "1.0.0",
37
- "pinia": "2.1.7",
38
- "tailwind-merge": "2.3.0",
39
- "vee-validate": "4.12.8"
37
+ "pinia": "2.2.2",
38
+ "tailwind-merge": "2.5.2",
39
+ "vee-validate": "4.13.2"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@lenne.tech/eslint-config-vue": "0.0.16",
43
- "@nuxt/devtools": "1.3.2",
44
- "@nuxt/test-utils": "3.13.1",
45
- "@nuxtjs/color-mode": "3.4.1",
43
+ "@nuxt/devtools": "1.4.1",
44
+ "@nuxt/test-utils": "3.14.1",
45
+ "@nuxtjs/color-mode": "3.4.4",
46
46
  "@nuxtjs/google-fonts": "3.2.0",
47
- "@nuxtjs/plausible": "1.0.0",
48
- "@nuxtjs/sitemap": "5.2.0",
49
- "@nuxtjs/tailwindcss": "6.12.0",
50
- "@playwright/test": "1.44.1",
51
- "@tailwindcss/forms": "0.5.7",
52
- "@tailwindcss/typography": "0.5.13",
53
- "@types/node": "20.12.12",
54
- "@vitejs/plugin-vue": "5.0.4",
47
+ "@nuxtjs/plausible": "1.0.2",
48
+ "@nuxtjs/sitemap": "6.0.0",
49
+ "@nuxtjs/tailwindcss": "6.12.1",
50
+ "@playwright/test": "1.46.1",
51
+ "@tailwindcss/forms": "0.5.8",
52
+ "@tailwindcss/typography": "0.5.15",
53
+ "@types/node": "22.5.2",
54
+ "@vitejs/plugin-vue": "5.1.3",
55
55
  "@vue/test-utils": "2.4.6",
56
- "eslint": "9.3.0",
57
- "jsdom": "24.1.0",
58
- "nuxt": "3.11.2",
59
- "nuxt-simple-robots": "4.0.0-rc.17",
56
+ "eslint": "9.9.1",
57
+ "jsdom": "24.1.3",
58
+ "nuxt": "3.13.0",
59
+ "nuxt-simple-robots": "4.0.1",
60
60
  "ts-loader": "9.5.1",
61
- "typescript": "5.4.5",
62
- "vitest": "1.6.0"
61
+ "typescript": "5.5.4",
62
+ "vitest": "2.0.5"
63
63
  },
64
64
  "overrides": {
65
65
  "vue": "latest",
66
66
  "@nuxt/test-utils": {
67
- "vitest": "$vitest"
67
+ "vitest": "$vitest",
68
+ "happy-dom": "13.0.0"
68
69
  },
69
70
  "@lenne.tech/eslint-config-vue": {
70
71
  "eslint": "$eslint"
@@ -0,0 +1,43 @@
1
+ export function useFormHelper() {
2
+ const { close, open } = useModal();
3
+
4
+ function onReload(dirty: boolean, event: BeforeUnloadEvent) {
5
+ if (dirty) {
6
+ event.preventDefault();
7
+ event.returnValue = '';
8
+ }
9
+ }
10
+
11
+ async function onNavigate(dirty: boolean) {
12
+ if (dirty) {
13
+ const answer = await openConfirmModal();
14
+ if (!answer) {
15
+ return false;
16
+ }
17
+ }
18
+ return true;
19
+ }
20
+
21
+ function openConfirmModal() {
22
+ return new Promise((resolve) => {
23
+ open({
24
+ component: 'ModalConfirm', // TODO: Replace with correct component
25
+ confirm: (confirmed) => {
26
+ resolve(confirmed);
27
+ close();
28
+ },
29
+ data: {
30
+ text:
31
+ 'Sind Sie sich sicher, dass Sie den Vorgang abbrechen möchten?\n' +
32
+ 'Es befinden sich ungesicherte Daten auf dieser Seite.',
33
+ title: 'Vorsicht, ungesicherte Daten!',
34
+ },
35
+ });
36
+ });
37
+ }
38
+
39
+ return {
40
+ onNavigate,
41
+ onReload,
42
+ };
43
+ }
@@ -1,13 +1,8 @@
1
- <script setup lang="ts">
2
- import { useGlobalMutationLoading, useGlobalQueryLoading } from '@vue/apollo-composable';
3
-
4
- const queryLoading = useGlobalQueryLoading();
5
- const mutationLoading = useGlobalMutationLoading();
6
- </script>
1
+ <script setup lang="ts"></script>
7
2
 
8
3
  <template>
9
4
  <div>
10
- <NuxtLoadingIndicator :loading="queryLoading || mutationLoading" />
5
+ <NuxtLoadingIndicator />
11
6
  <slot></slot>
12
7
  </div>
13
8
  </template>
@@ -0,0 +1,9 @@
1
+ export default defineNuxtRouteMiddleware((to, from) => {
2
+ const { accessTokenState } = useAuthState();
3
+
4
+ if (to.fullPath === '/auth' || to.fullPath === '/auth/register') {
5
+ if (accessTokenState?.value) {
6
+ return navigateTo('/cms');
7
+ }
8
+ }
9
+ });
@@ -2,7 +2,7 @@ import { callWithNuxt, defineNuxtPlugin, useNuxtApp, useRuntimeConfig } from 'nu
2
2
  import { ofetch } from 'ofetch';
3
3
 
4
4
  export default defineNuxtPlugin({
5
- enforce: 'post',
5
+ dependsOn: ['cookies', 'graphql-meta'], // from nuxt-base
6
6
  name: 'auth-server',
7
7
  async setup() {
8
8
  const _nuxt = useNuxtApp();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nuxt-base",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Starter to generate a configured environment with VueJS, Nuxt, Tailwind, Eslint, @lenne.tech/nuxt-base, Unit Tests, Cypress etc.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -20,7 +20,7 @@
20
20
  "fs-extra": "11.2.0"
21
21
  },
22
22
  "devDependencies": {
23
- "prettier": "3.2.5",
23
+ "prettier": "3.3.2",
24
24
  "standard-version": "9.5.0"
25
25
  }
26
26
  }
@@ -1,33 +0,0 @@
1
- import type { ExtractedRouteMethod, NitroFetchOptions, NitroFetchRequest, TypedInternalResponse } from 'nitropack';
2
-
3
- export function useAuthFetch<
4
- DefaultT = unknown,
5
- DefaultR extends NitroFetchRequest = NitroFetchRequest,
6
- T = DefaultT,
7
- R extends NitroFetchRequest = DefaultR,
8
- O extends NitroFetchOptions<R> = NitroFetchOptions<R>
9
- >(request: R, opts?: O): Promise<TypedInternalResponse<R, T, ExtractedRouteMethod<R, O>>> {
10
- const { requestNewToken } = useAuth();
11
- const { accessTokenState } = useAuthState();
12
- const config = useRuntimeConfig();
13
-
14
- // @ts-expect-error - because of nice types from ofetch <3
15
- return $fetch(request, {
16
- ...opts,
17
- baseURL: config.public.apiUrl,
18
- async onRequest(data: any) {
19
- if (accessTokenState.value) {
20
- data.options.headers = {
21
- ...data.options.headers,
22
- Authorization: `Bearer ${accessTokenState.value}`,
23
- };
24
- }
25
- },
26
- onResponseError: async () => {
27
- await requestNewToken();
28
- },
29
- retry: 3,
30
- retryDelay: 500,
31
- retryStatusCodes: [401],
32
- });
33
- }