config.resolveConfig
The config file exported, for environment: what it declares is
untrusted until here. Every environment is checked, so a mistake in one
fails every build, not only that environment's.
Usage
Validate a configuration in an app-development tool.
// Validate a configuration in an app-development tool.
import { resolveConfig, SETTING_DEFAULTS, IOS_BACKGROUND_MODES } from 'kuito/config';
const config = resolveConfig(
{
name: 'Notes',
ios: { bundleIdentifier: 'com.example.notes' },
android: { applicationId: 'com.example.notes' },
environments: { staging: { idSuffix: '.staging' } },
},
'/project/kuito.config.ts',
'staging',
);
console.log(config.ios.bundleIdentifier, config.splash, config.icon);
console.log(SETTING_DEFAULTS.minSdk, IOS_BACKGROUND_MODES);Signatures
(value: unknown, file: string, environment: string): AppConfigParameters
| Name | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | — |
file | string | Yes | — |
environment | string | Yes | — |
Returns
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.