create-nuxt-base 0.2.5 → 0.2.7
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/CHANGELOG.md +14 -0
- package/nuxt-base-template/nuxt.config.ts +17 -0
- package/nuxt-base-template/package-lock.json +3600 -6459
- package/nuxt-base-template/package.json +29 -28
- package/nuxt-base-template/src/layouts/default.vue +2 -7
- package/nuxt-base-template/src/middleware/logged-in.global.ts +9 -0
- package/nuxt-base-template/src/plugins/auth.server.ts +1 -1
- package/package.json +2 -2
- package/nuxt-base-template/src/composables/use-auth-fetch.ts +0 -33
|
@@ -26,45 +26,46 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@egoist/tailwindcss-icons": "1.8.1",
|
|
29
|
-
"@iconify-json/bi": "1.
|
|
30
|
-
"@lenne.tech/nuxt-base": "3.
|
|
31
|
-
"@nuxt/image": "1.
|
|
32
|
-
"@vee-validate/yup": "4.13.
|
|
33
|
-
"@vueuse/core": "
|
|
34
|
-
"@vueuse/integrations": "
|
|
35
|
-
"@vueuse/nuxt": "
|
|
29
|
+
"@iconify-json/bi": "1.2.0",
|
|
30
|
+
"@lenne.tech/nuxt-base": "3.18.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.
|
|
38
|
-
"tailwind-merge": "2.
|
|
39
|
-
"vee-validate": "4.13.
|
|
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.
|
|
44
|
-
"@nuxt/test-utils": "3.
|
|
45
|
-
"@nuxtjs/color-mode": "3.4.
|
|
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.
|
|
48
|
-
"@nuxtjs/sitemap": "
|
|
49
|
-
"@nuxtjs/tailwindcss": "6.12.
|
|
50
|
-
"@playwright/test": "1.
|
|
51
|
-
"@tailwindcss/forms": "0.5.
|
|
52
|
-
"@tailwindcss/typography": "0.5.
|
|
53
|
-
"@types/node": "
|
|
54
|
-
"@vitejs/plugin-vue": "5.
|
|
47
|
+
"@nuxtjs/plausible": "1.0.2",
|
|
48
|
+
"@nuxtjs/sitemap": "6.0.1",
|
|
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.4",
|
|
54
|
+
"@vitejs/plugin-vue": "5.1.3",
|
|
55
55
|
"@vue/test-utils": "2.4.6",
|
|
56
|
-
"eslint": "9.
|
|
57
|
-
"jsdom": "24.1.
|
|
58
|
-
"nuxt": "3.
|
|
59
|
-
"nuxt-simple-robots": "4.0.
|
|
56
|
+
"eslint": "9.9.1",
|
|
57
|
+
"jsdom": "24.1.3",
|
|
58
|
+
"nuxt": "3.13.1",
|
|
59
|
+
"nuxt-simple-robots": "4.0.1",
|
|
60
60
|
"ts-loader": "9.5.1",
|
|
61
|
-
"typescript": "5.5.
|
|
62
|
-
"vitest": "
|
|
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"
|
|
@@ -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
|
|
5
|
+
<NuxtLoadingIndicator />
|
|
11
6
|
<slot></slot>
|
|
12
7
|
</div>
|
|
13
8
|
</template>
|
|
@@ -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
|
-
|
|
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.
|
|
3
|
+
"version": "0.2.7",
|
|
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.3.
|
|
23
|
+
"prettier": "3.3.3",
|
|
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
|
-
}
|