All properties are optional. Providing some options require other options. For example, if models.fetchFromRepository is true, then repositoryName and customTypesApiToken are required.
The config object will be validated when the CLI is called.
Checklist:
[ ] My change requires an update to the official documentation.
[ ] All TSDoc comments are up-to-date and new ones have been added where necessary.
Types of changes
Description
This PR adds the ability to configure the CLI with a configuration file.
Configuration is loaded from the following locations:
prismicCodegen.config.ts
prismicCodegen.config.js
Note: The name of the file is up for debate as it feels a bit clunky.
With the new configuration options, the CLI is now able to do the following:
The fully filled out configuration file could look like the following:
All properties are optional. Providing some options require other options. For example, if
models.fetchFromRepository
istrue
, thenrepositoryName
andcustomTypesApiToken
are required.The config object will be validated when the CLI is called.
Checklist:
🐕