gruntwork-io / boilerplate

A tool for generating files and folders ("boilerplate") from a set of templates
https://www.gruntwork.io
Mozilla Public License 2.0
157 stars 12 forks source link

Fix the usability of templateFolder and outputFolder #87

Closed yorinasub17 closed 2 years ago

yorinasub17 commented 2 years ago

Description

This updates the templateFolder and outputFolder helpers to return absolute paths instead of the raw, relative paths. Using relative paths breaks the intended usage of these functions, which is to create relative paths in templates. Specifically, these functions return garbage values when using relative path inputs to --template-url and --output-folder, as these get repeated in the boilerplate blueprints, leading to broken relative pathing.

Using absolute paths ensure that the relative paths constructed in the boilerplate templates always point to the intended locations.

TODOs

Please ensure all of these TODOs are completed before asking for a review.

Note on backward compatibility

I intend to release this as backward incompatible release given that the output of templateFolder and outputFolder changes, which will break anything that renders it in, say, docs, but for most use cases of those helpers, this should be functionally equivalent. E.g., I don't expect these changes to break our Reference Architecture.

All this is to say that there will be an explanation, but no migration guide will be provided given the functional equivalence.

yorinasub17 commented 2 years ago

Thanks for review! Merging this now.