0.1.12 • Published 1 year ago

whatwhywhenandwho-gestalt v0.1.12

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

gestalt

Environment variables

GESTALT_APPLICATION_PATH=string
GESTALT_ID=string

Configuration

gestalt is going to generate a path and read the configuration from:

GESTALT_APPLICATION_PATH
CONFIGURATIONS_DIRECTORY
GESTALT_ID.json

We can use different GESTALT_ID for different environments - development, staging, production, etc.

Environment variable injection

We can inject environment variables into any configuration via interpolation. For example:

{
	module: {
		setting: '${gestalt.environment.VARIABLE}'
	}
}

Project integration standard

  1. Link whatwhywhenandwho-gestalt.
  2. Create source/package-settings.ts with the following template:

    import { gestalt } from 'whatwhywhenandwho-gestalt';

    import { PACKAGE_NAME } from './definitions/base.definition';

    export interface IGestaltPackageSettings { // Define your settings. }

    export default gestalt.getPackageSettings( PACKAGE_NAME, { // Define your defaults, if any. } );

  3. Export the interface and the settings in main.ts as the last entry, so other packages can use them:

    ... import packageSettings, { IGestaltPackageSettings } from './package-settings';

    export { ..., IGestaltPackageSettings, packageSettings };

  4. Import packageSettings wherever you need them.

Have a nice day 😘