@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.
- package/dist/config/i18n.d.ts.map +1 -1
- package/dist/config/i18n.js +4 -12
- package/dist/types/theme.types.d.ts.map +1 -1
- package/dist/types/theme.types.js +2 -4
- package/dist/utils/config.d.ts +1 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +13 -15
- package/package.json +1 -1
|
@@ -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;
|
|
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"}
|
package/dist/config/i18n.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
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
|
-
|
|
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
|
/**
|
package/dist/utils/config.d.ts
CHANGED
|
@@ -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
|
|
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;
|
|
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"}
|
package/dist/utils/config.js
CHANGED
|
@@ -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
|
|
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:
|
|
15
|
-
url:
|
|
16
|
-
env:
|
|
17
|
-
debug:
|
|
18
|
-
timezone:
|
|
19
|
-
locale:
|
|
20
|
-
fallback_locale:
|
|
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:
|
|
24
|
-
custom_scheme:
|
|
21
|
+
url: getEnv('VITE_APP_URL', ''),
|
|
22
|
+
custom_scheme: getEnv('VITE_CUSTOM_SCHEME'),
|
|
25
23
|
},
|
|
26
24
|
session: {
|
|
27
|
-
xsrf_cookie:
|
|
25
|
+
xsrf_cookie: getEnv('XSRF_COOKIE_NAME'),
|
|
28
26
|
},
|
|
29
|
-
i18nCookie:
|
|
27
|
+
i18nCookie: getEnv('VITE_I18N_COOKIE'),
|
|
30
28
|
};
|
|
31
29
|
return config;
|
|
32
30
|
}
|