@quvel-kit/core 1.3.3 → 1.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.
@@ -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":"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.4",
4
4
  "description": "Core utilities for Quvel UI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",