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

Implements transparent commands #19

Merged
merged 4 commits into from
Sep 30, 2020
Merged

Implements transparent commands #19

merged 4 commits into from
Sep 30, 2020

Conversation

arcanis
Copy link
Contributor

@arcanis arcanis commented Sep 30, 2020

It's currently fairly annoying to run the init commands, because they go through the jumper, which detects that there is no local project, asks if it should create one, spawns the init command, and fails because there's already a package.json. Additionally, running yarn dlx or pnpx isn't possible at the moment from (respectively) non-Yarn or non-pnpm projects.

This diff fixes that by defining a set of "transparent commands". The jumpers will allow those commands to be used regardless of the general environment - making it possible to run pnpx within Yarn projects, and running yarn init without prompts.

Fixes #1, fixes #2

@arcanis
Copy link
Contributor Author

arcanis commented Sep 30, 2020

I've also removed Enquirer. While it's a good idea in theory, it's very impractical as it:

  • causes spurious prompts to appear when running in the wrong directories
  • causes package.json to appear on the filesystem - problematic if you're for example in the home folder

Instead, Corepack will silently accept any package manager and use their LKG releases (similar to what already happens when you're inside a non-configured project). It doesn't change much, the only downside being that the packageManager field adoption will be lower, but it's worth it if it means less disruption for the users. Additionally, the init commands (such as yarn init) still have the ability to set the packageManager field themselves if they wish to.

@arcanis arcanis merged commit b8c9ec0 into main Sep 30, 2020
@arcanis arcanis deleted the mael/init-exec branch September 30, 2020 10:22
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.

Init workflow Global packages
1 participant