help wanted
Repository metrics
- Stars
- (4,347 個のスター)
- PR merge metrics
- (PR metrics pending)
説明
Right now there's a layer of configurations (order of priority, former will override latter):
- CLI (clap)
- Environment variables (mapped to serde with envy)
Trunk.tomlconfig (serde)
The result is then passed on internally to structs for processing.
There are some areas of improvement:
- It doesn't always make sense to have the same behavior between CLI and config.
- CLI options sometimes influence how the configuration will be read
- environment variables get pushed into serde model, but actually are closer to the CLI model
- there are some inconsistencies (proxies, boolean flags not overriding
false)
There are also some pending feature requests which seem to have an impact on the configuration:
- Profiles: It would be great if trunk would support build profiles. However, I would not really make sense to map those profiles to the CLI/env-vars. Only the selection should go there. However the profile selection should not be part of the serde configuration (also see: https://github.com/trunk-rs/trunk/issues/605).
- There was a discussion about adding the configuration to the
Cargo.toml(personally I am not a fan of this, bet maybe we can have it both ways) - Some parts of the build might want to have additional configuration (like minification level for CSS)
- There's the idea of plugins (has not manifested yet) But how could a plugin have its own configuration?
Bonus points:
- Allow other formats, beside TOML (I am looking at YAML). I would not force YAML on anyone, but with YAML it would be possible to leverage JSON schemas to enable IDE editor support.