Expose interface file paths when reading the workspace #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Expose paths to interface files as part of the workspace.
polylith.clj.core.workspace-clj.interface/workspace-from-disk
return data will now include a:paths
field in the component interface data.polylith.clj.core.workspace.interface/enrich-workspace
will add the same:paths
field to the interface dataWhy?
It will be handy to be able to generate documentation for the interfaces of a given workspace. I looked into adding metadata, doc-strings and attr-map as part of the interface definitions.
However due to the way poly tool currently reads files (using
clojure.core/read
) any metadata literals (^{}
) defined does not get read and is not available for export. There are ways around this, but I doubt that it makes sense going through the effort to change how poly reads files.Instead, if the paths to interfaces files are available on workspace level, anyone can use these paths as they see fit and integration with existing documentation tools become easier.
The code change footprint is also much smaller
Finally the workspace file is less bloated than it would be if metadata is added (or alternatively if extra code has to be written to toggle metadata on and off).