inpsyde / composer-asset-compiler

Composer plugin that installs dependencies and compiles assets based on configuration.
https://inpsyde.github.io/composer-asset-compiler/
MIT License
25 stars 1 forks source link

Sort files used for hash building to make hash system-independent #15

Closed shvlv closed 1 year ago

shvlv commented 1 year ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) Bugfix.

What is the current behavior? (You can also link to an open issue here) Symfony file findes uses RecursiveDirectoryIterator under the hood. It has not to default file order. It's important because different files order causes different calculated hash - https://github.com/inpsyde/composer-asset-compiler/blob/878fee76f16ee02b89c1fa1de5951eaeefc594df/src/Asset/HashBuilder.php#L86-L94

What is the new behavior (if this is a feature change)? The suggested fix is to stick file order with the file name (order doesn't matter in fact). This way locally or on every CI system hash will be the same.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?) No.

Other information: