Closed garrettjstevens closed 2 weeks ago
@dariober I looked at a couple of the things we talked about at our pairing today regarding conf
.
cwd
and fileExtension
. Did you perhaps somehow accidentally create a directory called config.yaml
?It looks like conf
doesn't allow us to add top-level properties to the schema (see https://github.com/sindresorhus/conf/issues/80
), but since the schema is optional, I think we can continue with using conf
without a schema and add in our own validation (we can probably keep the existing joi
validation). If we subclass Conf
, we can add our own validation like this:
class ApolloConf extends Conf {
constructor(...options: ConstructorParameters<typeof Conf>) {
super(...options)
// validate this.store
}
get store() {
const superStore = super.store
// validate superStore
return superStore
}
set store(newStore) {
// validate newStore
super.store = newStore
}
}
Did you perhaps somehow accidentally create a directory called config.yaml
Yes! It must have happened while playing with Conf
In branch use-conf I replaced the old implementation with the Conf package.
Done in 3cfca9f60837aa9d601cb10efb6a246890d9c5b8
I'd like for us to investigate the possibility of using the
conf
package to manage our CLI's config file. It's a widely-used package, and it provides some potentially useful features we may want in the future, such as config file version migrations (in case we need to change something about the config file in the future after a public release).