davestewart / alias-hq

The end-to-end solution for configuring, refactoring, maintaining and using path aliases
https://davestewart.co.uk/projects/open-source/alias-hq/
MIT License
333 stars 12 forks source link

Fix jest plugin omitting `<rootDir>` for aliases involving parent directories #57

Closed bjoluc closed 1 year ago

bjoluc commented 2 years ago

This is a follow-up on #45 including the fix proposed by @chrissantamaria and adding tests for it. For the tests, I added an @alias-hq/* => ../../src alias to the demo project which resolves to the src directory of the alias-hq package. The core and all plugins work as expected with the new alias; only the jest plugin failed due to #45 before applying the fix.

EDIT: Needless to say, I checked that jest works with <rootDir>/../ paths.

Closes #45

davestewart commented 1 year ago

Hello!

And thanks for the PR.

Sorry I missed this. Managed to find some time to get some releases out, so let me take a look at this over Christmas.

Cheers, Dave

davestewart commented 1 year ago

Just to let you guys know, I finally have the time to check this out and review things!

My utmost apologies that it's taken this long. Shameful! 😬

bjoluc commented 1 year ago

Hey @davestewart, thanks for coming back to this again! No probs at all if it takes longer than expected, we can always directly install from forks on GitHub :slightly_smiling_face: Let me know if there's anything I can help with!

FranciscoKloganB commented 1 year ago

Hey, any ideia when this issue will be merged?

To avoid hacks, I am currently hacking the hq.get('jest', { format: 'array' })' with a map((x) => x.replace('<rootDir>')) to include the '../' after <rootDir>. So I have used --save-exact, but, hey this ain't the cleanest solution.

jbrilhante-yogi commented 1 year ago

Hey @davestewart ! I just noticed this bug. It prevents me from using relative paths in my monorepo if I want Jest to work with alias-hq. Is there anything I can do to help with this pull request?

davestewart commented 1 year ago

I think I'll just merge this. It sounds like there has been enough testing on it by people using it, and I'm just getting in the way.

Stand by.

bjoluc commented 1 year ago

@davestewart In the light of your review comment above, I'm fully confident of this PR, so no obligations from my end!

davestewart commented 1 year ago

I've merged everything locally, but have to head out now (on holiday in Malta! 🌞) so will complete when I get in later 👋

bjoluc commented 1 year ago

Great to hear, enjoy your holiday and don't forget to use sunscreen :zany_face:

davestewart commented 1 year ago

OK, published to NPM!

https://www.npmjs.com/package/alias-hq

Thanks again for the PR and sorry it took such a shockingly long time to attend to 🙏

bjoluc commented 1 year ago

Thanks for the merge @davestewart! :pray: