-
Notifications
You must be signed in to change notification settings - Fork 18
Description
varlock version
0.0.15
Steps to reproduce
Import multiple .env.schema files which contain @generateTypes calls.
What is expected?
Only the primary file will have its types generated, including imported items. Type generation in the imported services will be skipped.
What is actually happening?
Each service has its types generated, but includes all items.
Any additional comments?
Currently the behaviour is that type generation is skipped if the file is imported partially (meaning specific keys are imported). The intention here is that you might just be breaking up a large schema, so we dont necessarily know in what cases you wanted to skip type generation in an imported file in all cases.
One possible solution is trying to infer if the file is the main schema, or doing some special handling of files named .env.schema.
I believe a better solution is to let the user trigger this partial import treatment, even when importing all items. You're letting the user say - "import this file fully as if it was part of this one" versus "import all items from this other file".
This could be implemented by adding wildcards to the import list. For example
@import(../other-file)- imports fully, a contained@generateTypescall would be executed@import(../other-file, *)- imports partially, all items included, but a contained@generateTypescall is skipped