@quvel-kit/core 1.3.3 → 1.3.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/config/i18n.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,EAAE,CAWjE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAK3D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAK7D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAGzE"}
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/config/i18n.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,EAAE,CAQjE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAE7D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAGzE"}
@@ -3,14 +3,12 @@
3
3
  *
4
4
  * Centralized i18n configuration that reads from AppConfig
5
5
  */
6
+ import { getEnv } from '../utils/env.js';
6
7
  /**
7
8
  * Get supported locales
8
9
  */
9
10
  export function getSupportedLocales(_config) {
10
- const env = (typeof import.meta !== 'undefined' && import.meta.env)
11
- ? import.meta.env
12
- : (typeof process !== 'undefined' ? process.env : {});
13
- const locales = env.VITE_ALLOWED_LOCALES;
11
+ const locales = getEnv('VITE_ALLOWED_LOCALES');
14
12
  if (locales && typeof locales === 'string') {
15
13
  return locales.split(',').map((l) => l.trim()).filter(Boolean);
16
14
  }
@@ -20,19 +18,13 @@ export function getSupportedLocales(_config) {
20
18
  * Get the default locale from config or use default
21
19
  */
22
20
  export function getDefaultLocale(config) {
23
- const env = (typeof import.meta !== 'undefined' && import.meta.env)
24
- ? import.meta.env
25
- : (typeof process !== 'undefined' ? process.env : {});
26
- return config?.app?.locale || config?.app?.fallback_locale || env.VITE_LOCALE || 'en-US';
21
+ return config?.app?.locale || config?.app?.fallback_locale || getEnv('VITE_LOCALE', 'en-US');
27
22
  }
28
23
  /**
29
24
  * Get the locale cookie key
30
25
  */
31
26
  export function getLocaleCookieKey(config) {
32
- const env = (typeof import.meta !== 'undefined' && import.meta.env)
33
- ? import.meta.env
34
- : (typeof process !== 'undefined' ? process.env : {});
35
- return config?.i18nCookie || env.VITE_I18N_COOKIE || 'user-locale';
27
+ return config?.i18nCookie || getEnv('VITE_I18N_COOKIE', 'user-locale');
36
28
  }
37
29
  /**
38
30
  * Validate if a locale is supported
@@ -1 +1 @@
1
- {"version":3,"file":"quvel.d.ts","sourceRoot":"","sources":["../../src/config/quvel.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAItE,OAAO,EAAqB,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAI7F;;GAEG;AACH,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,WAAW,CAmCvE"}
1
+ {"version":3,"file":"quvel.d.ts","sourceRoot":"","sources":["../../src/config/quvel.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAItE,OAAO,EAAqB,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAI7F;;GAEG;AACH,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,WAAW,CA4CvE"}
@@ -6,7 +6,7 @@
6
6
  import { defineQuvelModule } from '../module.js';
7
7
  import { I18nService } from '../services/I18nService.js';
8
8
  import { ValidationService, DEFAULT_LOCALE_MAPPING } from '../services/ValidationService.js';
9
- import { getTranslations } from '../modules/index.js';
9
+ import { getTranslations, getRoutes, getServices } from '../modules/helpers.js';
10
10
  import { getSupportedLocales } from './i18n.js';
11
11
  /**
12
12
  * Re-export DEFAULT_LOCALE_MAPPING for convenience
@@ -55,5 +55,14 @@ export function defineQuvelConfig(config) {
55
55
  modules: allModules,
56
56
  messages,
57
57
  localeMapping: resolvedLocaleMapping,
58
+ getRoutes() {
59
+ return getRoutes(allModules);
60
+ },
61
+ getServices() {
62
+ return getServices(allModules);
63
+ },
64
+ getTranslations(locale) {
65
+ return getTranslations(allModules, locale);
66
+ },
58
67
  };
59
68
  }
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Type definitions for the Quvel configuration system
5
5
  */
6
- import type { Module } from '../modules/types.js';
6
+ import type { RouteRecordRaw } from 'vue-router';
7
+ import type { Module, ServiceRegistry } from '../modules/types.js';
7
8
  /**
8
9
  * Locale mapping configuration for validation
9
10
  * Maps i18n locale codes to Zod locale codes
@@ -44,7 +45,7 @@ export interface QuvelConfigInput {
44
45
  */
45
46
  export interface QuvelConfig {
46
47
  /**
47
- * All modules (use with getServices, getRoutes, getTranslations helpers)
48
+ * All modules
48
49
  */
49
50
  modules: Module[];
50
51
  /**
@@ -55,5 +56,17 @@ export interface QuvelConfig {
55
56
  * Locale mapping for validation
56
57
  */
57
58
  localeMapping: LocaleMapping;
59
+ /**
60
+ * Get all routes from modules
61
+ */
62
+ getRoutes(): RouteRecordRaw[];
63
+ /**
64
+ * Get all services from modules
65
+ */
66
+ getServices(): ServiceRegistry;
67
+ /**
68
+ * Get translations for a specific locale from all modules
69
+ */
70
+ getTranslations(locale: string): Record<string, unknown>;
58
71
  }
59
72
  //# sourceMappingURL=quvel.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quvel.types.d.ts","sourceRoot":"","sources":["../../src/config/quvel.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG;QACf;;;WAGG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAElD;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;CAC9B"}
1
+ {"version":3,"file":"quvel.types.d.ts","sourceRoot":"","sources":["../../src/config/quvel.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG;QACf;;;WAGG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAElD;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,SAAS,IAAI,cAAc,EAAE,CAAC;IAE9B;;OAEG;IACH,WAAW,IAAI,eAAe,CAAC;IAE/B;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1D"}
@@ -44,7 +44,7 @@ export declare class ServiceContainer {
44
44
  /**
45
45
  * Retrieves a service by its class
46
46
  */
47
- get<T extends Service>(ServiceClass: ServiceClass<T>): T;
47
+ get: <T extends Service>(ServiceClass: ServiceClass<T>) => T;
48
48
  /**
49
49
  * Get a service by name
50
50
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceContainer.d.ts","sourceRoot":"","sources":["../../src/container/ServiceContainer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,YAAY,EAGb,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAGzD;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAMzB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAL/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IACpE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwC;IAC1E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;gBAGjB,WAAW,CAAC,GAAE,WAAW,GAAG,IAAI,aAAA,EACjD,cAAc,GAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAa;IAQvD;;OAEG;IACH,IAAI,MAAM,IAAI,SAAS,CAEtB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS,CAE/C;IAED;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;OAEG;IACH,GAAG,CAAC,CAAC,SAAS,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AO,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO;IAIrE;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAUpC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,WAAW;IAUnB;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,OAAO;IASf;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IAEH,IAAI,GAAG,IAAI,UAAU,CAEpB;IAED,IAAI,GAAG,IAAI,UAAU,CAEpB;IAED,IAAI,IAAI,IAAI,WAAW,CAEtB;IAED,IAAI,UAAU,IAAI,iBAAiB,CAElC;IAED,IAAI,IAAI;;2BA1LP,CAAF;;;;;;MA8LE;IAED,IAAI,EAAE,IAAI,gBAAgB,CAEzB;IAED,IAAI,KAAK,IAAI,YAAY,CAExB;CACF"}
@@ -67,7 +67,7 @@ export class ServiceContainer {
67
67
  /**
68
68
  * Retrieves a service by its class
69
69
  */
70
- get(ServiceClass) {
70
+ get = (ServiceClass) => {
71
71
  const key = this.serviceClassToKey.get(ServiceClass);
72
72
  if (key && this.services.has(key)) {
73
73
  return this.services.get(key);
@@ -81,7 +81,7 @@ export class ServiceContainer {
81
81
  this.registerService(name, instance);
82
82
  this.bootService(name, instance);
83
83
  return instance;
84
- }
84
+ };
85
85
  /**
86
86
  * Get a service by name
87
87
  */
@@ -2,29 +2,17 @@ import type { RouteRecordRaw } from 'vue-router';
2
2
  import type { Module, ServiceRegistry } from './types.js';
3
3
  /**
4
4
  * Get all routes from modules
5
- *
6
- * @example
7
- * ```ts
8
- * const routes = getRoutes(modules);
9
- * ```
5
+ * @internal - Use config.getRoutes() instead
10
6
  */
11
7
  export declare function getRoutes(modules: Module[]): RouteRecordRaw[];
12
8
  /**
13
9
  * Get all services from modules
14
- *
15
- * @example
16
- * ```ts
17
- * const services = getServices(modules);
18
- * ```
10
+ * @internal - Use config.getServices() instead
19
11
  */
20
12
  export declare function getServices(modules: Module[]): ServiceRegistry;
21
13
  /**
22
14
  * Get translations for a specific locale from all modules
23
- *
24
- * @example
25
- * ```ts
26
- * const translations = getTranslations(modules, 'en-US');
27
- * ```
15
+ * @internal - Use config.getTranslations(locale) instead
28
16
  */
29
17
  export declare function getTranslations(modules: Module[], locale: string): Record<string, unknown>;
30
18
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/modules/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EACV,MAAM,EACN,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAE7D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,eAAe,CAU9D;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EAAE,EACjB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/modules/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EACV,MAAM,EACN,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAE7D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,eAAe,CAU9D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EAAE,EACjB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB"}
@@ -1,21 +1,13 @@
1
1
  /**
2
2
  * Get all routes from modules
3
- *
4
- * @example
5
- * ```ts
6
- * const routes = getRoutes(modules);
7
- * ```
3
+ * @internal - Use config.getRoutes() instead
8
4
  */
9
5
  export function getRoutes(modules) {
10
6
  return modules.flatMap((module) => module.routes || []);
11
7
  }
12
8
  /**
13
9
  * Get all services from modules
14
- *
15
- * @example
16
- * ```ts
17
- * const services = getServices(modules);
18
- * ```
10
+ * @internal - Use config.getServices() instead
19
11
  */
20
12
  export function getServices(modules) {
21
13
  const merged = {};
@@ -28,11 +20,7 @@ export function getServices(modules) {
28
20
  }
29
21
  /**
30
22
  * Get translations for a specific locale from all modules
31
- *
32
- * @example
33
- * ```ts
34
- * const translations = getTranslations(modules, 'en-US');
35
- * ```
23
+ * @internal - Use config.getTranslations(locale) instead
36
24
  */
37
25
  export function getTranslations(modules, locale) {
38
26
  const merged = {};
@@ -3,6 +3,5 @@
3
3
  *
4
4
  * Helpers for defining and aggregating module resources.
5
5
  */
6
- export { getRoutes, getServices, getTranslations, } from './helpers.js';
7
6
  export type { Module, ModuleLoader, ServiceRegistry, TranslationRegistry, ModuleBuildConfig, BootFileConfig, ServiceClass, QuasarContext, } from './types.js';
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,WAAW,EACX,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,MAAM,EACN,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,MAAM,EACN,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,YAAY,CAAC"}
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * Helpers for defining and aggregating module resources.
5
5
  */
6
- export { getRoutes, getServices, getTranslations, } from './helpers.js';
6
+ export {};
@@ -40,7 +40,7 @@ export class ThemeService extends Service {
40
40
  if (userTheme && themeOptions.includes(userTheme)) {
41
41
  return userTheme;
42
42
  }
43
- return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
43
+ return 'light';
44
44
  }
45
45
  return 'light';
46
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../src/types/theme.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,iBAAiB,QAAuB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,YAAY,4BAA6B,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../src/types/theme.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,eAAO,MAAM,iBAAiB,QAAuB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,YAAY,4BAA6B,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -1,14 +1,12 @@
1
1
  /**
2
2
  * Theme Types and Constants
3
3
  */
4
+ import { getEnv } from '../utils/env.js';
4
5
  /**
5
6
  * Get the theme cookie name from env or use default
6
7
  */
7
8
  function getThemeCookieName() {
8
- const env = (typeof import.meta !== 'undefined' && import.meta.env)
9
- ? import.meta.env
10
- : (typeof process !== 'undefined' ? process.env : {});
11
- return env.VITE_THEME_COOKIE || 'user-theme';
9
+ return getEnv('VITE_THEME_COOKIE', 'user-theme');
12
10
  }
13
11
  export const THEME_COOKIE_NAME = getThemeCookieName();
14
12
  /**
@@ -5,7 +5,7 @@ import type { QSsrContext } from '@quasar/app-vite';
5
5
  import type { AppConfig } from '../types/app.types.js';
6
6
  /**
7
7
  * Create app config from environment variables
8
- * Works in both client (import.meta.env) and server (process.env) contexts
8
+ * Works in both client and server (SSR) contexts
9
9
  */
10
10
  export declare function createConfigFromEnv(): AppConfig;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,CA0B/C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAUvE"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,CAsB/C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAUvE"}
@@ -1,32 +1,30 @@
1
1
  /**
2
2
  * Config utility functions
3
3
  */
4
+ import { getEnv } from './env.js';
4
5
  /**
5
6
  * Create app config from environment variables
6
- * Works in both client (import.meta.env) and server (process.env) contexts
7
+ * Works in both client and server (SSR) contexts
7
8
  */
8
9
  export function createConfigFromEnv() {
9
- const env = (typeof import.meta !== 'undefined' && import.meta.env)
10
- ? import.meta.env
11
- : (typeof process !== 'undefined' ? process.env : {});
12
10
  const config = {
13
11
  app: {
14
- name: env.VITE_APP_NAME || 'Quasar App',
15
- url: env.VITE_API_URL || '',
16
- env: env.VITE_APP_ENV || undefined,
17
- debug: env.VITE_DEBUG === 'true' ? true : undefined,
18
- timezone: env.VITE_TIMEZONE || undefined,
19
- locale: env.VITE_LOCALE || undefined,
20
- fallback_locale: env.VITE_FALLBACK_LOCALE || undefined,
12
+ name: getEnv('VITE_APP_NAME', 'Quasar App'),
13
+ url: getEnv('VITE_API_URL', ''),
14
+ env: getEnv('VITE_APP_ENV'),
15
+ debug: getEnv('VITE_DEBUG') === 'true' ? true : undefined,
16
+ timezone: getEnv('VITE_TIMEZONE'),
17
+ locale: getEnv('VITE_LOCALE'),
18
+ fallback_locale: getEnv('VITE_FALLBACK_LOCALE'),
21
19
  },
22
20
  frontend: {
23
- url: env.VITE_APP_URL || '',
24
- custom_scheme: env.VITE_CUSTOM_SCHEME || undefined,
21
+ url: getEnv('VITE_APP_URL', ''),
22
+ custom_scheme: getEnv('VITE_CUSTOM_SCHEME'),
25
23
  },
26
24
  session: {
27
- xsrf_cookie: env.XSRF_COOKIE_NAME || undefined,
25
+ xsrf_cookie: getEnv('XSRF_COOKIE_NAME'),
28
26
  },
29
- i18nCookie: env.VITE_I18N_COOKIE || undefined,
27
+ i18nCookie: getEnv('VITE_I18N_COOKIE'),
30
28
  };
31
29
  return config;
32
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quvel-kit/core",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "Core utilities for Quvel UI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",