The previous import of the version number from package.json
looked like a named import, but was actually object destructuring
that was supported by the rollup json plugin.
This causes issues when importing patterns with webpack (as we
do with our new NextJS based frontend) so this commit switches
to importing JSON as the default export, which is also ok with webpack
This design was contributed by @starfetch (thanks for that) and while
integrating it into our monorepo, I noticed some small issues:
- Both the `headRatio` and `headRatio` options serve no purpose
- Under certain conditions (length set to upperleg and small
lengthBonus) the side of the garment would become longer than the
total length
- The seam was not one continious path
- Example files were left over from the tutorial
I've fixed those, and in addition made the following changes:
- Renamed `lengthBonus` to `lengthRatio` because bonus implies
adding, whereas this option actually allows more removing than
adding. I think `length` would be better here, but that was already
taken, so ratio it is
- Renamed `widthBonus` to `widthRatio` because consistency
- Removed unused keys in the config file
- Store intermediate values in the store so they are available to
developers looking to extend this design
- Smoothed out the curved hem
- Avoid a flurry of if statements when a single assignment will does
the trick