@magmamath/frontend-config 1.0.12 → 1.0.13-rc.1
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/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -387,6 +387,7 @@ type ConfigOptions<P extends Platform> = {
|
|
|
387
387
|
};
|
|
388
388
|
type SetProps = {
|
|
389
389
|
locale?: Locale;
|
|
390
|
+
envsRegion?: Locale;
|
|
390
391
|
environment?: Environment;
|
|
391
392
|
};
|
|
392
393
|
declare class AppConfigManager<P extends Platform> {
|
|
@@ -394,6 +395,7 @@ declare class AppConfigManager<P extends Platform> {
|
|
|
394
395
|
private readonly platform;
|
|
395
396
|
environment: Environment;
|
|
396
397
|
locale: Locale;
|
|
398
|
+
envsRegion: Locale;
|
|
397
399
|
private readonly setEnvs;
|
|
398
400
|
private readonly setLocaleConfig;
|
|
399
401
|
readonly $envs: effector.StoreWritable<EnvironmentVars<P>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -387,6 +387,7 @@ type ConfigOptions<P extends Platform> = {
|
|
|
387
387
|
};
|
|
388
388
|
type SetProps = {
|
|
389
389
|
locale?: Locale;
|
|
390
|
+
envsRegion?: Locale;
|
|
390
391
|
environment?: Environment;
|
|
391
392
|
};
|
|
392
393
|
declare class AppConfigManager<P extends Platform> {
|
|
@@ -394,6 +395,7 @@ declare class AppConfigManager<P extends Platform> {
|
|
|
394
395
|
private readonly platform;
|
|
395
396
|
environment: Environment;
|
|
396
397
|
locale: Locale;
|
|
398
|
+
envsRegion: Locale;
|
|
397
399
|
private readonly setEnvs;
|
|
398
400
|
private readonly setLocaleConfig;
|
|
399
401
|
readonly $envs: effector.StoreWritable<EnvironmentVars<P>>;
|
package/dist/index.js
CHANGED
|
@@ -5502,6 +5502,7 @@ var AppConfigManager = class {
|
|
|
5502
5502
|
platform;
|
|
5503
5503
|
environment;
|
|
5504
5504
|
locale = "en-SE" /* US */;
|
|
5505
|
+
envsRegion = "en-SE" /* US */;
|
|
5505
5506
|
setEnvs = effector.createEvent();
|
|
5506
5507
|
setLocaleConfig = effector.createEvent();
|
|
5507
5508
|
$envs = effector.restore(this.setEnvs, {});
|
|
@@ -5513,8 +5514,8 @@ var AppConfigManager = class {
|
|
|
5513
5514
|
this.syncConfigsStores();
|
|
5514
5515
|
}
|
|
5515
5516
|
syncConfigsStores = () => {
|
|
5516
|
-
const envs = ENV_PRESET[this.platform][this.
|
|
5517
|
-
const _DEV_OVERRIDES_ = this._DEV_OVERRIDES_?.[this.
|
|
5517
|
+
const envs = ENV_PRESET[this.platform][this.envsRegion][this.environment];
|
|
5518
|
+
const _DEV_OVERRIDES_ = this._DEV_OVERRIDES_?.[this.envsRegion];
|
|
5518
5519
|
if (_DEV_OVERRIDES_) {
|
|
5519
5520
|
consoleLogOverridesMessage();
|
|
5520
5521
|
this.setEnvs({ ...envs, ..._DEV_OVERRIDES_ });
|
|
@@ -5527,6 +5528,7 @@ var AppConfigManager = class {
|
|
|
5527
5528
|
set = (props) => {
|
|
5528
5529
|
this.locale = props.locale ?? this.locale;
|
|
5529
5530
|
this.environment = props.environment ?? this.environment;
|
|
5531
|
+
this.envsRegion = props.envsRegion ?? this.envsRegion;
|
|
5530
5532
|
this.syncConfigsStores();
|
|
5531
5533
|
};
|
|
5532
5534
|
onEnvsChange = (cb) => {
|
|
@@ -5544,10 +5546,10 @@ var AppConfigManager = class {
|
|
|
5544
5546
|
getPresets = () => {
|
|
5545
5547
|
const envPreset = structuredClone(ENV_PRESET);
|
|
5546
5548
|
if (this._DEV_OVERRIDES_) {
|
|
5547
|
-
for (const [
|
|
5549
|
+
for (const [region, overrides] of Object.entries(this._DEV_OVERRIDES_)) {
|
|
5548
5550
|
if (!overrides) continue;
|
|
5549
|
-
const
|
|
5550
|
-
const envsForLocale = envPreset[this.platform][
|
|
5551
|
+
const envsRegion = region;
|
|
5552
|
+
const envsForLocale = envPreset[this.platform][envsRegion];
|
|
5551
5553
|
if (!envsForLocale) continue;
|
|
5552
5554
|
for (const envKey of Object.keys(envsForLocale)) {
|
|
5553
5555
|
Object.assign(envsForLocale[envKey], overrides);
|