create-nuxt-base 0.2.10 → 0.3.4
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/.github/workflows/publish.yml +18 -8
- package/.github/workflows/release.yml +3 -1
- package/CHANGELOG.md +40 -0
- package/index.js +1 -1
- package/nuxt-base-template/eslint.config.mjs +3 -0
- package/nuxt-base-template/nuxt.config.ts +8 -1
- package/nuxt-base-template/package.json +42 -44
- package/nuxt-base-template/pnpm-lock.yaml +14502 -0
- package/nuxt-base-template/postbuild.js +12 -0
- package/nuxt-base-template/src/app.vue +1 -1
- package/nuxt-base-template/src/assets/css/tailwind.css +49 -4
- package/nuxt-base-template/src/components/Transition/TransitionFade.vue +4 -4
- package/nuxt-base-template/src/components/Transition/TransitionFadeScale.vue +4 -4
- package/nuxt-base-template/src/composables/use-context-menu.ts +3 -3
- package/nuxt-base-template/src/composables/use-form-helper.ts +1 -3
- package/nuxt-base-template/src/composables/use-modal.ts +7 -7
- package/nuxt-base-template/src/composables/use-notification.ts +4 -4
- package/nuxt-base-template/src/composables/use-share.ts +4 -4
- package/nuxt-base-template/src/composables/use-tw.ts +1 -0
- package/nuxt-base-template/src/error.vue +1 -1
- package/nuxt-base-template/src/middleware/admin.global.ts +1 -1
- package/nuxt-base-template/src/middleware/auth.global.ts +1 -1
- package/nuxt-base-template/src/middleware/logged-in.global.ts +1 -1
- package/nuxt-base-template/src/plugins/form.plugin.ts +2 -2
- package/nuxt-base-template/src/plugins/pwa.plugin.ts +9 -5
- package/nuxt-base-template/tailwind.config.js +2 -39
- package/package.json +16 -12
- package/nuxt-base-template/.eslintrc +0 -3
- package/nuxt-base-template/package-lock.json +0 -20721
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
const tslibPath = path.resolve('.output', 'server', 'node_modules', 'tslib');
|
|
4
|
+
process.chdir(tslibPath);
|
|
5
|
+
const command = 'npm pkg set "exports[.].import.node"="./tslib.es6.mjs"';
|
|
6
|
+
try {
|
|
7
|
+
execSync(command, { stdio: 'inherit' });
|
|
8
|
+
console.debug('✅ Successfully ran postinstall script');
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error('❌ Error executing postinstall script: ', error);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
@@ -1,4 +1,52 @@
|
|
|
1
|
-
@
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
@config "../../../tailwind.config.js";
|
|
4
|
+
|
|
5
|
+
@plugin '@tailwindcss/typography';
|
|
6
|
+
@plugin '@tailwindcss/forms';
|
|
7
|
+
|
|
8
|
+
@custom-variant dark (&:is(.dark *));
|
|
9
|
+
|
|
10
|
+
@theme {
|
|
11
|
+
--color-primary-50: #f3faf7;
|
|
12
|
+
--color-primary-100: #d6f1e7;
|
|
13
|
+
--color-primary-200: #ade2d0;
|
|
14
|
+
--color-primary-300: #7cccb3;
|
|
15
|
+
--color-primary-400: #57b39a;
|
|
16
|
+
--color-primary-500: #37957d;
|
|
17
|
+
--color-primary-600: #2a7765;
|
|
18
|
+
--color-primary-700: #256052;
|
|
19
|
+
--color-primary-800: #224d45;
|
|
20
|
+
--color-primary-900: #20413a;
|
|
21
|
+
--color-primary-950: #0d2621;
|
|
22
|
+
--color-primary: #57b39a;
|
|
23
|
+
|
|
24
|
+
--color-background: #ffffff;
|
|
25
|
+
--color-foreground: #000000;
|
|
26
|
+
--color-border: hsl(0 0% 0% / 0.5);
|
|
27
|
+
--color-hover: hsl(0 0% 100% / 0.2);
|
|
28
|
+
--color-active: hsl(0 0% 100% / 0.2);
|
|
29
|
+
|
|
30
|
+
--breakpoint-3xl: 2400px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
The default border color has changed to `currentColor` in Tailwind CSS v4,
|
|
35
|
+
so we've added these compatibility styles to make sure everything still
|
|
36
|
+
looks the same as it did with Tailwind CSS v3.
|
|
37
|
+
|
|
38
|
+
If we ever want to remove these styles, we need to add an explicit border
|
|
39
|
+
color utility to any element that depends on these defaults.
|
|
40
|
+
*/
|
|
41
|
+
@layer base {
|
|
42
|
+
*,
|
|
43
|
+
::after,
|
|
44
|
+
::before,
|
|
45
|
+
::backdrop,
|
|
46
|
+
::file-selector-button {
|
|
47
|
+
border-color: var(--color-gray-200, currentColor);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
2
50
|
|
|
3
51
|
@layer base {
|
|
4
52
|
body {
|
|
@@ -36,9 +84,6 @@
|
|
|
36
84
|
}
|
|
37
85
|
}
|
|
38
86
|
|
|
39
|
-
@tailwind components;
|
|
40
|
-
@tailwind utilities;
|
|
41
|
-
|
|
42
87
|
html,
|
|
43
88
|
body {
|
|
44
89
|
height: 100%;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
const props = withDefaults(
|
|
3
3
|
defineProps<{
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
leaveDuration?: `${number}` | number;
|
|
5
|
+
startDuration?: `${number}` | number;
|
|
6
6
|
}>(),
|
|
7
7
|
{
|
|
8
|
-
startDuration: 100,
|
|
9
8
|
leaveDuration: 100,
|
|
10
|
-
|
|
9
|
+
startDuration: 100,
|
|
10
|
+
},
|
|
11
11
|
);
|
|
12
12
|
</script>
|
|
13
13
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
const props = withDefaults(
|
|
3
3
|
defineProps<{
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
leaveDuration?: `${number}` | number;
|
|
5
|
+
startDuration?: `${number}` | number;
|
|
6
6
|
}>(),
|
|
7
7
|
{
|
|
8
|
-
startDuration: 100,
|
|
9
8
|
leaveDuration: 100,
|
|
10
|
-
|
|
9
|
+
startDuration: 100,
|
|
10
|
+
},
|
|
11
11
|
);
|
|
12
12
|
</script>
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const contextMenuState =
|
|
1
|
+
const contextMenuState = () => useState<any | null>(() => null);
|
|
2
2
|
|
|
3
|
-
export function useContextMenu
|
|
4
|
-
const menu = contextMenuState
|
|
3
|
+
export function useContextMenu() {
|
|
4
|
+
const menu = contextMenuState();
|
|
5
5
|
|
|
6
6
|
const open = (config: { items: any[] }) => {
|
|
7
7
|
menu.value = Object.assign(config, { show: true });
|
|
@@ -27,9 +27,7 @@ export function useFormHelper() {
|
|
|
27
27
|
close();
|
|
28
28
|
},
|
|
29
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.',
|
|
30
|
+
text: 'Sind Sie sich sicher, dass Sie den Vorgang abbrechen möchten?\n' + 'Es befinden sich ungesicherte Daten auf dieser Seite.',
|
|
33
31
|
title: 'Vorsicht, ungesicherte Daten!',
|
|
34
32
|
},
|
|
35
33
|
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
interface Modal<T> {
|
|
2
|
-
component: any;
|
|
3
|
-
data?: T;
|
|
4
|
-
size?: 'sm' | 'md' | 'lg' | 'auto';
|
|
5
2
|
closable?: boolean;
|
|
3
|
+
component: any;
|
|
6
4
|
confirm?: (confirmed: boolean) => void;
|
|
5
|
+
data?: T;
|
|
6
|
+
size?: 'auto' | 'lg' | 'md' | 'sm';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export interface ModalContext<T = object> {
|
|
10
|
+
closable?: boolean;
|
|
10
11
|
component: any;
|
|
12
|
+
confirm?: (confirmed: boolean) => void;
|
|
11
13
|
data?: T;
|
|
12
14
|
show: boolean;
|
|
13
15
|
showInner: boolean;
|
|
14
|
-
size?: '
|
|
15
|
-
closable?: boolean;
|
|
16
|
-
confirm?: (confirmed: boolean) => void;
|
|
16
|
+
size?: 'auto' | 'lg' | 'md' | 'sm';
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const modalState = <T>() => useState<ModalContext<T> | null>(() => null);
|
|
@@ -78,7 +78,7 @@ export function useModal<T = object>() {
|
|
|
78
78
|
|
|
79
79
|
return {
|
|
80
80
|
activeModal: modal,
|
|
81
|
-
open,
|
|
82
81
|
close,
|
|
82
|
+
open,
|
|
83
83
|
};
|
|
84
84
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { randomUUID } from 'uncrypto';
|
|
2
2
|
|
|
3
3
|
interface Notification {
|
|
4
|
-
title: string;
|
|
5
|
-
text?: string;
|
|
6
|
-
type: 'success' | 'error' | 'warning' | 'info';
|
|
7
4
|
duration?: number;
|
|
5
|
+
text?: string;
|
|
6
|
+
title: string;
|
|
7
|
+
type: 'error' | 'info' | 'success' | 'warning';
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const notificationState = () => useState<Array<Notification & { uuid: string }>>(() => []);
|
|
@@ -22,8 +22,8 @@ export function useNotification() {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
return {
|
|
25
|
+
notifications,
|
|
25
26
|
notify,
|
|
26
27
|
remove,
|
|
27
|
-
notifications,
|
|
28
28
|
};
|
|
29
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useModal } from '~/composables/use-modal';
|
|
2
1
|
import ModalShare from '~/components/ModalShare.vue';
|
|
2
|
+
import { useModal } from '~/composables/use-modal';
|
|
3
3
|
|
|
4
4
|
export function useShare() {
|
|
5
5
|
const route = useRoute();
|
|
@@ -7,12 +7,12 @@ export function useShare() {
|
|
|
7
7
|
function share(title?: string, text?: string, url?: string) {
|
|
8
8
|
if (window?.navigator?.share) {
|
|
9
9
|
window.navigator.share({
|
|
10
|
-
url: url ?? route.fullPath,
|
|
11
|
-
title: title,
|
|
12
10
|
text: text ?? window.location.origin,
|
|
11
|
+
title: title,
|
|
12
|
+
url: url ?? route.fullPath,
|
|
13
13
|
});
|
|
14
14
|
} else {
|
|
15
|
-
useModal().open({ component: ModalShare,
|
|
15
|
+
useModal().open({ component: ModalShare, data: { link: url ?? window.location.origin, name: window.name }, size: 'md' });
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const tw = <T extends TemplateStringsArray | string>(tailwindClasses: T) => tailwindClasses;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { setLocale } from 'yup';
|
|
2
2
|
|
|
3
|
-
export default defineNuxtPlugin(async (
|
|
3
|
+
export default defineNuxtPlugin(async () => {
|
|
4
4
|
setLocale({
|
|
5
5
|
// use constant translation keys for messages without values
|
|
6
6
|
mixed: {
|
|
7
|
-
required: 'Dieses Feld ist erforderlich.',
|
|
8
7
|
default: 'Dieses Feld ist ungültig.',
|
|
9
8
|
notType: 'Dieses Feld ist ungültig.',
|
|
9
|
+
required: 'Dieses Feld ist erforderlich.',
|
|
10
10
|
},
|
|
11
11
|
string: {
|
|
12
12
|
email: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default defineNuxtPlugin(async (
|
|
1
|
+
export default defineNuxtPlugin(async () => {
|
|
2
2
|
const applicationServerKey = useRuntimeConfig().public.webPushKey as string;
|
|
3
3
|
const permissionState = ref<PermissionState>('prompt');
|
|
4
4
|
const subscription = ref<PushSubscription | null>(null);
|
|
@@ -25,7 +25,9 @@ export default defineNuxtPlugin(async (_nuxtApp) => {
|
|
|
25
25
|
body,
|
|
26
26
|
method: 'POST',
|
|
27
27
|
});
|
|
28
|
-
} catch (
|
|
28
|
+
} catch (e) {
|
|
29
|
+
console.error(e);
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
async function refreshPermissionState() {
|
|
@@ -35,8 +37,8 @@ export default defineNuxtPlugin(async (_nuxtApp) => {
|
|
|
35
37
|
applicationServerKey,
|
|
36
38
|
userVisibleOnly: true,
|
|
37
39
|
});
|
|
38
|
-
} catch (
|
|
39
|
-
console.error(
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.error(e);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -62,7 +64,9 @@ export default defineNuxtPlugin(async (_nuxtApp) => {
|
|
|
62
64
|
body,
|
|
63
65
|
method: 'DELETE',
|
|
64
66
|
});
|
|
65
|
-
} catch (
|
|
67
|
+
} catch (e) {
|
|
68
|
+
console.error(e);
|
|
69
|
+
}
|
|
66
70
|
subscription.value = null;
|
|
67
71
|
}
|
|
68
72
|
}
|
|
@@ -1,48 +1,11 @@
|
|
|
1
1
|
/** @type {import('tailwindcss').Config} */
|
|
2
|
-
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
3
3
|
const { iconsPlugin, getIconCollections } = require('@egoist/tailwindcss-icons');
|
|
4
|
-
|
|
5
|
-
const forms = require('@tailwindcss/forms');
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
6
5
|
const plugin = require('tailwindcss/plugin');
|
|
7
6
|
|
|
8
7
|
module.exports = {
|
|
9
|
-
darkMode: 'class',
|
|
10
|
-
theme: {
|
|
11
|
-
// fontFamily: {
|
|
12
|
-
// montserrat: ['Montserrat'],
|
|
13
|
-
// sans: ['Work Sans', 'Montserrat', ...defaultTheme.fontFamily.sans],
|
|
14
|
-
// serif: ['Work Sans', 'Montserrat', ...defaultTheme.fontFamily.serif],
|
|
15
|
-
// },
|
|
16
|
-
extend: {
|
|
17
|
-
colors: {
|
|
18
|
-
primary: {
|
|
19
|
-
DEFAULT: '#57B39A',
|
|
20
|
-
50: '#f3faf7',
|
|
21
|
-
100: '#d6f1e7',
|
|
22
|
-
200: '#ade2d0',
|
|
23
|
-
300: '#7cccb3',
|
|
24
|
-
400: '#57b39a',
|
|
25
|
-
500: '#37957d',
|
|
26
|
-
600: '#2a7765',
|
|
27
|
-
700: '#256052',
|
|
28
|
-
800: '#224d45',
|
|
29
|
-
900: '#20413a',
|
|
30
|
-
950: '#0d2621',
|
|
31
|
-
},
|
|
32
|
-
background: '#FFFFFF',
|
|
33
|
-
foreground: '#000000',
|
|
34
|
-
border: 'hsl(0 0% 0% / 0.5)',
|
|
35
|
-
hover: 'hsl(0 0% 100% / 0.2)',
|
|
36
|
-
active: 'hsl(0 0% 100% / 0.2)',
|
|
37
|
-
},
|
|
38
|
-
screens: {
|
|
39
|
-
'3xl': '2400px',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
8
|
plugins: [
|
|
44
|
-
typography,
|
|
45
|
-
forms,
|
|
46
9
|
iconsPlugin({
|
|
47
10
|
// Select the icon collections you want to use
|
|
48
11
|
collections: getIconCollections(['bi']),
|
package/package.json
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nuxt-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.4",
|
|
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
|
+
"engines": {
|
|
7
|
+
"node": ">=20",
|
|
8
|
+
"pnpm": ">=9"
|
|
9
|
+
},
|
|
6
10
|
"bin": {
|
|
7
11
|
"create-nuxt-base": "./index.js"
|
|
8
12
|
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"prettier": "prettier \"*.{js,json,yml,md,html,ts}\" .",
|
|
11
|
-
"format": "npm run prettier -- --write",
|
|
12
|
-
"release": "standard-version && git push --follow-tags origin main",
|
|
13
|
-
"release:minor": "standard-version --release-as minor && git push --follow-tags origin main",
|
|
14
|
-
"release:major": "standard-version --release-as major && git push --follow-tags origin main"
|
|
15
|
-
},
|
|
16
13
|
"author": "lenne.Tech GmbH",
|
|
17
14
|
"license": "MIT",
|
|
18
15
|
"dependencies": {
|
|
19
|
-
"cross-spawn": "7.0.
|
|
20
|
-
"fs-extra": "11.
|
|
16
|
+
"cross-spawn": "7.0.6",
|
|
17
|
+
"fs-extra": "11.3.0"
|
|
21
18
|
},
|
|
22
19
|
"devDependencies": {
|
|
23
|
-
"prettier": "3.
|
|
20
|
+
"prettier": "3.4.2",
|
|
24
21
|
"standard-version": "9.5.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prettier": "prettier \"*.{js,json,yml,md,html,ts}\" .",
|
|
25
|
+
"format": "pnpm prettier -- --write",
|
|
26
|
+
"release": "standard-version && git push --follow-tags origin main",
|
|
27
|
+
"release:minor": "standard-version --release-as minor && git push --follow-tags origin main",
|
|
28
|
+
"release:major": "standard-version --release-as major && git push --follow-tags origin main"
|
|
25
29
|
}
|
|
26
|
-
}
|
|
30
|
+
}
|