basketry / basketry

https://basketry.io
MIT License
37 stars 0 forks source link

Fix bugs in the core Engine #67

Closed skonves closed 6 months ago

skonves commented 6 months ago

Context

Some generators return file.content values that are promises. This is due to a major version update to Prettier that returns a promise instead of a string. The internal comparison between previous and next files always flagged these files as modified because the existing string on the file system was never equal to a Promise.

Change

This change simply awaits the file contents. This is a no-op if the contents are a string, but correctly resolves Promises.

Consequences

All files created by generators that (incorrectly) return Promises will be correctly labeled as "no change" if the re-generated contents are the same.