apheleia icon indicating copy to clipboard operation
apheleia copied to clipboard

Fix `apheleia-npx` in Yarn PnP projects

Open zeorin opened this issue 1 year ago • 2 comments
trafficstars

  • apheleia-npx would use an incorrect path for the Yarn PnP ESM loader.
  • apheleia-npx did not correctly guard against word splitting.
  • apheleia-npx was sometimes not able to find formatters in a Yarn PnP project if there was also a node_modules folder at the root of the project. Unfortunately, many tools (including Prettier) will create a cache folder in node_modules even in Yarn PnP projects. The presence of any node_modules folders are irrelevant when a .pnp.cjs file is present.

zeorin avatar May 01 '24 22:05 zeorin

cc @edslocomb & @raxod502, as you were involved in https://github.com/radian-software/apheleia/pull/200.

zeorin avatar May 01 '24 23:05 zeorin

LGTM generally. Looks like upstream changes broke the tests. I'll fix, and also make sure we have test coverage that actually validates this change.

raxod502 avatar May 23 '24 22:05 raxod502

Apologies to @zeorin for taking so long to look at this, notifications got lost in the shuffle

Also my fault because I was in the middle of working on this and it was still in progress but I have been busy with other things in my life and not attending to any of my GitHub notifications for a while, there are several dozen threads that have been waiting. This is still very much on my list if Ed doesn't beat me to it.

raxod502 avatar Sep 01 '24 02:09 raxod502

Heyo, it turns out that I had got this pretty close to working already! The latest few changes seem to make things fully successful and now we have a proper test framework that supports ensuring that features like this will not break in the future.

raxod502 avatar Sep 03 '24 00:09 raxod502