-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add blog post demonstrating using file position in template definitions #39
Conversation
4ce1310
to
d841edb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I miss having a simple example with 1 app, 1 env, 1 cluster, to get get a better feeling of what such config would look like.
It only introduces one "new" concept and that is the concept of a "root" node. | ||
For `AppEnvCluster.pkl`, the root node is the one _amending the `AppEnvCluster.pkl` module from the `appEnvCluster` package_. | ||
The function `findRootModule` finds this, by taking the reflection of `module`, and following the amends-chain, until it finds a module, whose `supermodule` does not `amends` anything. | ||
When it finds that, it reflects back (`mod.reflectee`) to return the `Module` object. | ||
In `pkl:base`, `Module` is defined with a method `relativePath`, which returns the path of `module` relative to `this` module. | ||
The path is represented as a `List`, with one `String` per _directory_ -- no file name at the end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's necessary to go that deep in the how AppEnvCluster finds all the pertinent modules, down to the algorithm. A more generic explanation should suffice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! (Apart from the feed Dan mentioned)
Co-authored-by: Daniel Chao <[email protected]>
No description provided.