Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 8 commits into from
Jul 19, 2024

Conversation

vaporwavie
Copy link
Contributor

@vaporwavie vaporwavie commented Jul 9, 2024

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?

  • Experiment it with npm
  • Experiment it with pnpm
  • Experiment it with yarn

References

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

@vaporwavie vaporwavie self-assigned this Jul 9, 2024
Copy link

vercel bot commented Jul 9, 2024

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

Copy link

codesandbox-ci bot commented Jul 9, 2024

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
Copy link
Contributor

gvc commented Jul 9, 2024

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
Copy link
Contributor Author

@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 vaporwavie changed the title feat(cli): remove yarn lock-in, adds ni feat(cli, core): remove yarn lock-in, adds ni Jul 10, 2024
@vaporwavie vaporwavie marked this pull request as ready for review July 10, 2024 15:07
@vaporwavie vaporwavie requested a review from a team as a code owner July 10, 2024 15:07
@vaporwavie vaporwavie requested review from eduardoformiga, renatamottam and lariciamota and removed request for a team July 10, 2024 15:07
Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it using the core project, and it looks like it worked as expected, although the sequence volta run yarn run before the commands looks uncommon to me
Screenshot 2024-07-10 at 19 53 40

In the starter, I've got this error:
Screenshot 2024-07-10 at 19 56 38

packages/cli/src/utils/commands.ts Show resolved Hide resolved
@vaporwavie
Copy link
Contributor Author

@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?

packages/cli/src/commands/generate-graphql.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/test.ts Outdated Show resolved Hide resolved
Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Now it worked as expected.

@eduardoformiga
Copy link
Member

@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 :)

@vaporwavie vaporwavie merged commit e25f887 into main Jul 19, 2024
7 checks passed
@vaporwavie vaporwavie deleted the feature/cli-remove-yarn-lock-in branch July 19, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants