Project #5
PascalSenn
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Project
Overview
A Confix project is essentially a folder that houses your configuration consumer. Within this folder, you will find configuration files that Confix utilizes to manage them. Confix auto-discovers the required structure of your configuration file by collecting all relevant components, and then generates a JSON schema that corresponds to your configuration.
At the heart of the Confix project is the
.confix.project
file, which provides the necessary configuration for your project.Components
You can adjust the configuration of components at the project level using the
components
property.Components found by the component providers are automatically incorporated into the project and don't need explicit declaration under the
components
property. However, if you want to modify a component's configuration, you can do so using this property.In contrast, components from repositories aren't automatically added to the project. You need to define these explicitly in the
components
property.The
components
property is an object where the key is either@providerName/componentName
or@repositoryName/componentName
. The value associated with each key can take several forms:version
: Specifies the version of the component (only relevant for components from repositories)include
: A boolean indicating if the component should be included in the project (useful for overriding discovery providers)mountingPoint
: Specifies a JSON path or a list of JSON paths defining where in the configuration the component should be inserted. If this property is not specified, the component will be added at the root of the configuration under the component's name.Override Configuration
Environments
By default, the environment config is taken from the
.confixrc
or the.confix.repository
.To override environments, on a project level, you'll need to use the
environments
property in the.confix.project
file. This property is an array of strings, with each string representing an environment.The environment that you specify in this list, will be enabled for this project. If you leave the property away, all environments are active.
Here's how it works:
Component Providers & Repositories
You can override the component providers and repositories on a project level. This is useful if you want to use different providers or repositories for a specific project.
See the
Component Providers
andComponent Repositories
sections for more information.Configuration Files
Your Confix project can have multiple
configurationFiles
as explained in theConfiguration Files
section. You can override these files on a project level. This is useful if you want to use different configuration files for a specific project.Read more about this in the
Configuration Files
section.Commands
Confix provides several commands to manage your project:
confix project init
: Initializes a new projectconfix project build
: Builds the final configuration files of the projectconfix project reload
: Reloads the configuration of the component providersconfix project validate
: Validates the configuration of the current projectHere is an example of a
.confix.project
file:Beta Was this translation helpful? Give feedback.
All reactions