Kipper
Kipper copied to clipboard
[Feature] Add config file support for `@kipper/cli`
Is there an existing proposal for this?
- [X] I have searched the existing issues
This feature does not exist in the latest version
- [X] I am using the latest version
Proposal
Add support for a config file that can be read by the Kipper CLI and used to specify project-wide config options that define options such as compile target, warnings, optimisation level etc. (similar to the CLI command line flags & arguments).
The file would have a JSON format and be most likely named kip-config.json
or kipper-config.json
.
Exact behaviour / changes you want
- [ ] Implemented support for reading in config files both automatically and using a built-in API that can be also automatically called. Such a file should be wrapped using a class that can then generate the internal config object which then can passed as an object to a
KipperCompile.compile()
call. - [ ] Add support for resolving a config file in the current work directory.
- [ ] Add support for the basic configuration options also available in the CLI as command line flags & arguments.
- [ ] Add support for the following meta-tags:
-
"extends"
, which specifies a parent config file, where the child should inherit from. -
"compiler"["version"]
, which specifies the compiler version of Kipper that should be used for the current project. -
"resources"
, which specifies a list of files that are considered resources and should be copied to the build directory using the exact same dir-structure. That means if a file is present insrc/public/assets/
then it should be copied to the build directory with the exact same path to avoid path errors in testing/deployment.
-
- [ ] Add CLI flag
--config
which can be used to specify a config file not present in the working directory. - [ ] Add CLI flag
--ignore-config/--no-ignore-config
, where per default--no-ignore-config
is true meaning if a config exists it is loaded. This overwrites the--config
flag.