harmony icon indicating copy to clipboard operation
harmony copied to clipboard

Fix package.json to enable importmap pin

Open swombat opened this issue 9 months ago • 1 comments

Hey there!

I love harmony. I love Rails 8! Rails 8 loves importmap. importmap does not love @evilmartians/harmony, because the package.json doesn't include a root

But DHH and others at this comment thread were helpful enough to point me to how to solve this problem. So, here's a pull request that fixes the issue, at least as far as Sonnet 3.7 is telling me (I'm not an importmap or npm expert).

Hope this helps! In the meantime, I will do importmap pin @evilmartians/harmony/base, but it'd be nice to fix this for everyone going forwards :-)

Warm Regards,

Daniel

swombat avatar Mar 10 '25 18:03 swombat

Hey, thanks for putting this together!

Before moving forward, I want to make sure I fully understand the issue you're hitting. From my side, it looks like using @evilmartians/harmony/base should already work fine with importmap, and I’m not seeing any errors related to the lack of a package root.

Also, /base isn’t really meant to be the main export of the package, so making it the default could be a bit misleading. It's because we have other export targets as well, such as Tailwind 3 and 4 versions, and vanilla CSS.

If there’s a specific setup or error that breaks without this change, could you share more details?

psd-coder avatar May 20 '25 21:05 psd-coder