@lenne.tech/nuxt-extensions 1.0.0 → 1.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.
Files changed (42) hide show
  1. package/LICENSE +1 -1
  2. package/dist/module.d.mts +4 -1
  3. package/dist/module.mjs +28 -9
  4. package/dist/runtime/components/transition/LtTransitionFade.vue +3 -1
  5. package/dist/runtime/components/transition/LtTransitionFadeScale.vue +3 -1
  6. package/dist/runtime/composables/auth/use-lt-auth.d.ts +1 -1
  7. package/dist/runtime/composables/auth/use-lt-auth.js +49 -13
  8. package/dist/runtime/composables/index.d.ts +6 -5
  9. package/dist/runtime/composables/index.js +1 -0
  10. package/dist/runtime/composables/use-lt-auth-client.d.ts +9 -1
  11. package/dist/runtime/composables/use-lt-auth-client.js +26 -2
  12. package/dist/runtime/composables/use-lt-error-translation.d.ts +33 -0
  13. package/dist/runtime/composables/use-lt-error-translation.js +133 -0
  14. package/dist/runtime/composables/use-lt-file.d.ts +1 -1
  15. package/dist/runtime/composables/use-lt-share.js +4 -1
  16. package/dist/runtime/composables/use-lt-tus-upload.d.ts +1 -1
  17. package/dist/runtime/composables/use-lt-tus-upload.js +7 -1
  18. package/dist/runtime/lib/auth-client.d.ts +1 -1
  19. package/dist/runtime/lib/auth-client.js +18 -6
  20. package/dist/runtime/lib/auth-state.d.ts +10 -1
  21. package/dist/runtime/lib/auth-state.js +17 -1
  22. package/dist/runtime/lib/index.d.ts +2 -2
  23. package/dist/runtime/locales/de.json +4 -0
  24. package/dist/runtime/locales/en.json +4 -0
  25. package/dist/runtime/plugins/auth-interceptor.client.d.ts +1 -1
  26. package/dist/runtime/plugins/auth-interceptor.client.js +12 -4
  27. package/dist/runtime/plugins/error-translation.client.d.ts +8 -0
  28. package/dist/runtime/plugins/error-translation.client.js +17 -0
  29. package/dist/runtime/server/tsconfig.json +1 -1
  30. package/dist/runtime/testing/index.d.ts +21 -0
  31. package/dist/runtime/testing/index.js +17 -0
  32. package/dist/runtime/testing/playwright-helpers.d.ts +296 -0
  33. package/dist/runtime/testing/playwright-helpers.js +127 -0
  34. package/dist/runtime/types/auth.d.ts +2 -2
  35. package/dist/runtime/types/error.d.ts +48 -0
  36. package/dist/runtime/types/error.js +0 -0
  37. package/dist/runtime/types/index.d.ts +4 -3
  38. package/dist/runtime/types/module.d.ts +17 -2
  39. package/dist/runtime/types/upload.d.ts +2 -2
  40. package/dist/runtime/utils/index.d.ts +2 -2
  41. package/dist/types.d.mts +7 -1
  42. package/package.json +18 -2
@@ -42,12 +42,23 @@ export interface LtI18nModuleOptions {
42
42
  /** Automatically merge locale files with @nuxtjs/i18n (default: true) */
43
43
  autoMerge?: boolean;
44
44
  }
45
+ /**
46
+ * Error translation module configuration options
47
+ */
48
+ export interface LtErrorTranslationModuleOptions {
49
+ /** Enable error translation feature (default: true) */
50
+ enabled?: boolean;
51
+ /** Default locale if not detected (default: 'de') */
52
+ defaultLocale?: string;
53
+ }
45
54
  /**
46
55
  * Main module options for @lenne.tech/nuxt-extensions
47
56
  */
48
57
  export interface LtExtensionsModuleOptions {
49
58
  /** Auth module configuration */
50
59
  auth?: LtAuthModuleOptions;
60
+ /** Error translation configuration */
61
+ errorTranslation?: LtErrorTranslationModuleOptions;
51
62
  /** i18n configuration */
52
63
  i18n?: LtI18nModuleOptions;
53
64
  /** TUS upload module configuration */
@@ -72,17 +83,21 @@ export interface LtExtensionsPublicRuntimeConfig {
72
83
  loginPath: string;
73
84
  twoFactorRedirectPath: string;
74
85
  };
86
+ errorTranslation: {
87
+ enabled: boolean;
88
+ defaultLocale: string;
89
+ };
75
90
  tus: {
76
91
  defaultChunkSize: number;
77
92
  defaultEndpoint: string;
78
93
  };
79
94
  };
80
95
  }
81
- declare module 'nuxt/schema' {
96
+ declare module "nuxt/schema" {
82
97
  interface PublicRuntimeConfig extends LtExtensionsPublicRuntimeConfig {
83
98
  }
84
99
  }
85
- declare module '@nuxt/schema' {
100
+ declare module "@nuxt/schema" {
86
101
  interface PublicRuntimeConfig extends LtExtensionsPublicRuntimeConfig {
87
102
  }
88
103
  }
@@ -1,8 +1,8 @@
1
- import type { ComputedRef } from 'vue';
1
+ import type { ComputedRef } from "vue";
2
2
  /**
3
3
  * Status of an upload item
4
4
  */
5
- export type LtUploadStatus = 'completed' | 'error' | 'idle' | 'paused' | 'uploading';
5
+ export type LtUploadStatus = "completed" | "error" | "idle" | "paused" | "uploading";
6
6
  /**
7
7
  * Progress information for an upload
8
8
  */
@@ -1,2 +1,2 @@
1
- export { ltArrayBufferToBase64Url, ltBase64UrlToUint8Array, ltSha256 } from './crypto.js';
2
- export { tw } from './tw.js';
1
+ export { ltArrayBufferToBase64Url, ltBase64UrlToUint8Array, ltSha256 } from "./crypto.js";
2
+ export { tw } from "./tw.js";
package/dist/types.d.mts CHANGED
@@ -4,6 +4,12 @@ import type { default as Module } from './module.mjs'
4
4
 
5
5
  export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
6
 
7
- export { type LtExtensionsModuleOptions } from '../dist/runtime/types/index.js'
7
+ export { type LtAuthClientConfig, type LtAuthMode, type LtAuthResponse, type LtAuthState, type LtPasskeyAuthResult, type LtPasskeyRegisterResult, type LtUser, type UseLtAuthReturn } from '../dist/runtime/types/auth.js'
8
+
9
+ export { type LtFileInfo, type LtUploadItem, type LtUploadOptions, type LtUploadProgress, type LtUploadStatus, type UseLtFileReturn, type UseLtTusUploadReturn } from '../dist/runtime/types/upload.js'
10
+
11
+ export { type LtAuthModuleOptions, type LtErrorTranslationModuleOptions, type LtExtensionsModuleOptions, type LtExtensionsPublicRuntimeConfig, type LtI18nModuleOptions, type LtTusModuleOptions } from '../dist/runtime/types/module.js'
12
+
13
+ export { type LtErrorTranslationResponse, type LtParsedError, type UseLtErrorTranslationReturn } from '../dist/runtime/types/error.js'
8
14
 
9
15
  export { type configKey, default, type name, type version } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/nuxt-extensions",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Reusable Nuxt 4 composables, components, and Better-Auth integration for lenne.tech projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,6 +17,10 @@
17
17
  ".": {
18
18
  "types": "./dist/types.d.mts",
19
19
  "import": "./dist/module.mjs"
20
+ },
21
+ "./testing": {
22
+ "types": "./dist/runtime/testing/index.d.ts",
23
+ "import": "./dist/runtime/testing/index.js"
20
24
  }
21
25
  },
22
26
  "main": "./dist/module.mjs",
@@ -24,6 +28,9 @@
24
28
  "*": {
25
29
  ".": [
26
30
  "./dist/types.d.mts"
31
+ ],
32
+ "testing": [
33
+ "./dist/runtime/testing/index.d.ts"
27
34
  ]
28
35
  }
29
36
  },
@@ -33,23 +40,27 @@
33
40
  "scripts": {
34
41
  "prepare": "git config core.hooksPath .githooks",
35
42
  "prepack": "nuxt-module-build build",
43
+ "check": "npm run format && npm run lint:fix && npm run test:types && npm run test",
36
44
  "dev": "npm run dev:prepare && nuxt dev playground",
37
45
  "dev:build": "nuxt build playground",
38
46
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
39
47
  "build": "nuxt-module-build build",
40
48
  "lint": "oxlint src/",
41
49
  "lint:fix": "oxlint --fix src/",
50
+ "format": "oxfmt --write src/",
51
+ "format:check": "oxfmt --check src/",
42
52
  "test": "vitest run",
43
53
  "test:watch": "vitest watch",
44
54
  "test:coverage": "vitest run --coverage",
45
55
  "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
46
- "release": "npm run lint && npm run test && npm run prepack"
56
+ "release": "npm run format:check && npm run lint && npm run test:types && npm run test && npm run prepack"
47
57
  },
48
58
  "dependencies": {
49
59
  "@nuxt/kit": "4.2.2"
50
60
  },
51
61
  "peerDependencies": {
52
62
  "@better-auth/passkey": ">=1.0.0",
63
+ "@playwright/test": ">=1.0.0",
53
64
  "better-auth": ">=1.0.0",
54
65
  "nuxt": ">=3.0.0",
55
66
  "tus-js-client": ">=4.0.0"
@@ -61,6 +72,9 @@
61
72
  "@better-auth/passkey": {
62
73
  "optional": true
63
74
  },
75
+ "@playwright/test": {
76
+ "optional": true
77
+ },
64
78
  "tus-js-client": {
65
79
  "optional": true
66
80
  }
@@ -68,6 +82,7 @@
68
82
  "devDependencies": {
69
83
  "@better-auth/passkey": "1.4.10",
70
84
  "@nuxt/devtools": "3.1.1",
85
+ "@playwright/test": "1.57.0",
71
86
  "@nuxt/module-builder": "1.0.2",
72
87
  "@nuxt/schema": "4.2.2",
73
88
  "@nuxt/test-utils": "3.23.0",
@@ -77,6 +92,7 @@
77
92
  "better-auth": "1.4.10",
78
93
  "happy-dom": "20.3.7",
79
94
  "nuxt": "4.2.2",
95
+ "oxfmt": "0.26.0",
80
96
  "oxlint": "0.17.0",
81
97
  "tus-js-client": "4.3.1",
82
98
  "typescript": "5.9.3",