vtex / faststore

Digital commerce toolkit for frontend developers
https://faststore.dev
MIT License
182 stars 57 forks source link

feat(cli, core): remove yarn lock-in, adds `ni` #2376

Closed vaporwavie closed 1 week ago

vaporwavie commented 2 weeks ago

What's the purpose of this pull request?

Solves the yarn lock-in issue by predicting which package manager is preferred by the developer.

How it works?

It uses a ni wrapper created by us, that aims to predict which package manager is being used by the developer.

How to test it?

References

ni: https://github.com/antfu-collective/ni

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2024 1:53pm
codesandbox-ci[bot] commented 2 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

gvc commented 2 weeks ago

An overall question is: does this mean that people should use ni instead of yarn when developing for FastStore? (Think VTEX developers and not people creating stores)

vaporwavie commented 2 weeks ago

@gvc actually, ni is not a package manager itself, but rather a toolset to identify which package manager the developer is attempting to use. That said, if VTEX developers are using yarn, then ni will read the package manager as yarn. Same goes for bun, pnpm, npm. In this implementation, we're specifically integrating around the na command from it: https://github.com/antfu-collective/ni?tab=readme-ov-file#na---agent-alias

vaporwavie commented 1 week ago

@eduardoformiga re. yarn running through volta, which part of that behavior felt uncommon to you? Talking to @gvc, running volta for yarn and node are still commands that can be expected, even if we're removing the explicit lock-in from yarn. Was there something uneven that you saw during the command execution?

eduardoformiga commented 1 week ago

@eduardoformiga re. yarn running through volta, which part of that behavior felt uncommon to you? Talking to @gvc, running volta for yarn and node are still commands that can be expected, even if we're removing the explicit lock-in from yarn. Was there something uneven that you saw during the command execution?

Yes, that should be expected. I'm not used to seeing these two commands together before. But it's not a problem. Let's go ahead :)