create-nuxt-base 0.2.10 → 0.3.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.
@@ -4,7 +4,7 @@
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "init": "npm install",
7
- "reinit": "rm -rf node_modules && rm -rf package-lock.json && yes | npx nuxt cleanup && npm cache clean --force && npm i",
7
+ "reinit": "npx rimraf package-lock.json && npx nuxt cleanup && npx rimraf node_modules && npm cache clean --force && npm i",
8
8
  "build": "nuxt build",
9
9
  "app:build": "npm run build",
10
10
  "build:develop": "nuxt build",
@@ -14,17 +14,17 @@
14
14
  "start:test": "node .output/server/index.mjs",
15
15
  "start:prod": "node .output/server/index.mjs",
16
16
  "start:tunnel": "nuxt dev --tunnel",
17
- "start:extern": "HOST=0.0.0.0 nuxt dev",
18
- "generate-types": "rm -rf ./src/base && GENERATE_TYPES=1 nuxt dev",
17
+ "start:extern": "npx cross-env HOST=0.0.0.0 nuxt dev",
18
+ "generate-types": "npx rimraf ./src/base && npx cross-env GENERATE_TYPES=1 nuxt dev",
19
19
  "dev": "nuxt dev",
20
20
  "generate": "nuxt generate",
21
21
  "preview": "nuxt preview",
22
22
  "postinstall": "nuxt prepare",
23
23
  "app:e2e": "playwright test",
24
24
  "test": "echo 'No test specified' && exit 0",
25
- "lint": "eslint --ext .ts,.js,.vue .",
26
- "lint:fix": "eslint --ext .ts,.js,.vue . --fix",
27
- "postbuild": "cd .output/server/node_modules/tslib; npm pkg set 'exports[.].import.node'='./tslib.es6.mjs'"
25
+ "lint": "eslint '**/*.{ts,js,vue}'",
26
+ "lint:fix": "eslint '**/*.{ts,js,vue}' --fix",
27
+ "postbuild": "node postbuild.js"
28
28
  },
29
29
  "dependencies": {
30
30
  "@egoist/tailwindcss-icons": "1.8.1",
@@ -37,11 +37,12 @@
37
37
  "@vueuse/nuxt": "11.1.0",
38
38
  "ios-pwa-splash": "1.0.0",
39
39
  "pinia": "2.2.4",
40
+ "rimraf": "6.0.1",
40
41
  "tailwind-merge": "2.5.4",
41
42
  "vee-validate": "4.14.3"
42
43
  },
43
44
  "devDependencies": {
44
- "@lenne.tech/eslint-config-vue": "0.0.16",
45
+ "@lenne.tech/eslint-config-vue": "1.0.3",
45
46
  "@nuxt/devtools": "1.6.0",
46
47
  "@nuxt/test-utils": "3.14.4",
47
48
  "@nuxtjs/color-mode": "3.5.1",
@@ -56,7 +57,7 @@
56
57
  "@types/node": "22.7.8",
57
58
  "@vitejs/plugin-vue": "5.1.4",
58
59
  "@vue/test-utils": "2.4.6",
59
- "eslint": "8.57.1",
60
+ "eslint": "9.17.0",
60
61
  "jsdom": "24.1.3",
61
62
  "nuxt": "3.13.2",
62
63
  "ts-loader": "9.5.1",
@@ -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
+ }
@@ -4,4 +4,4 @@
4
4
  <NuxtPage />
5
5
  </NuxtLayout>
6
6
  </div>
7
- </template>
7
+ </template>
@@ -1,13 +1,13 @@
1
1
  <script setup lang="ts">
2
2
  const props = withDefaults(
3
3
  defineProps<{
4
- startDuration?: number | `${number}`;
5
- leaveDuration?: number | `${number}`;
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
- startDuration?: number | `${number}`;
5
- leaveDuration?: number | `${number}`;
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
 
@@ -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?: 'sm' | 'md' | 'lg' | 'auto';
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, size: 'md', data: { link: url ?? window.location.origin, name: window.name } });
15
+ useModal().open({ component: ModalShare, data: { link: url ?? window.location.origin, name: window.name }, size: 'md' });
16
16
  }
17
17
  }
18
18
 
@@ -22,7 +22,7 @@ watch(
22
22
  if (current.values().next().value && !debugWord.value.includes(current.values().next().value)) {
23
23
  debugWord.value += current.values().next().value;
24
24
  }
25
- }
25
+ },
26
26
  );
27
27
 
28
28
  const handleError = () => clearError({ redirect: '/' });
@@ -4,9 +4,9 @@ export default defineNuxtPlugin(async (_nuxtApp) => {
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,12 +1,32 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
2
3
  const defaultTheme = require('tailwindcss/defaultTheme');
3
- const { iconsPlugin, getIconCollections } = require('@egoist/tailwindcss-icons');
4
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
5
+ const { getIconCollections, iconsPlugin } = require('@egoist/tailwindcss-icons');
6
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
4
7
  const typography = require('@tailwindcss/typography');
8
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
5
9
  const forms = require('@tailwindcss/forms');
10
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
6
11
  const plugin = require('tailwindcss/plugin');
7
12
 
8
13
  module.exports = {
9
14
  darkMode: 'class',
15
+ plugins: [
16
+ typography,
17
+ forms,
18
+ iconsPlugin({
19
+ // Select the icon collections you want to use
20
+ collections: getIconCollections(['bi']),
21
+ }),
22
+ plugin(({ addVariant, e }) => {
23
+ addVariant('pwa', ({ modifySelectors, separator }) => {
24
+ modifySelectors(({ className }) => {
25
+ return `.pwa .${e(`pwa${separator}${className}`)}`;
26
+ });
27
+ });
28
+ }),
29
+ ],
10
30
  theme: {
11
31
  // fontFamily: {
12
32
  // montserrat: ['Montserrat'],
@@ -15,8 +35,12 @@ module.exports = {
15
35
  // },
16
36
  extend: {
17
37
  colors: {
38
+ active: 'hsl(0 0% 100% / 0.2)',
39
+ background: '#FFFFFF',
40
+ border: 'hsl(0 0% 0% / 0.5)',
41
+ foreground: '#000000',
42
+ hover: 'hsl(0 0% 100% / 0.2)',
18
43
  primary: {
19
- DEFAULT: '#57B39A',
20
44
  50: '#f3faf7',
21
45
  100: '#d6f1e7',
22
46
  200: '#ade2d0',
@@ -28,31 +52,12 @@ module.exports = {
28
52
  800: '#224d45',
29
53
  900: '#20413a',
30
54
  950: '#0d2621',
55
+ DEFAULT: '#57B39A',
31
56
  },
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
57
  },
38
58
  screens: {
39
59
  '3xl': '2400px',
40
60
  },
41
61
  },
42
62
  },
43
- plugins: [
44
- typography,
45
- forms,
46
- iconsPlugin({
47
- // Select the icon collections you want to use
48
- collections: getIconCollections(['bi']),
49
- }),
50
- plugin(({ addVariant, e }) => {
51
- addVariant('pwa', ({ modifySelectors, separator }) => {
52
- modifySelectors(({ className }) => {
53
- return `.pwa .${e(`pwa${separator}${className}`)}`;
54
- });
55
- });
56
- }),
57
- ],
58
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nuxt-base",
3
- "version": "0.2.10",
3
+ "version": "0.3.0",
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": {
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@lenne.tech/vue"
3
- }