Closed Jay-Karia closed 2 months ago
@nebrelbug should I add tests before merging ?
@Jay-Karia Yeah tests would be great, thanks
@slorber, I'd love to hear your thoughts about this proposal since Docusaurus is one of the main users of npm-to-yarn.
Yes that looks like a useful feature to add that we could use on the Docusaurus website
@Jay-Karia I think for ease of use, it should detect whether or not it is an executor command (test for npx|pnpm dlx|...
) automatically rather than requiring an extra argument flag.
@nebrelbug Should we consider updating the version to: 2.3.0
or 3.0.0
after this feature?
@nebrelbug Removed extra argument
pnpm uses pnpmx
and Bun uses bunx
shorthands, which are both shorter and easier to remember, though there have been bugs with the shims not getting installed in the past. Don't know about yarn.
bunx
has bugs in windows.
pnpmx
does not exists, it's either pnpm exec
or pnpm dlx
. Same goes with yarn
bunx
has bugs in windows.
Ah, didn't know that. I only use it on macOS.
pnpmx
does not exists, it's eitherpnpm exec
orpnpm dlx
.
Sorry, typo. I meant pnpx
. Apparently they deprecated it though, so I guess it still still stands that you should use pnpm dlx
.
@Jay-Karia thanks for the great work! I think we should probably update to a major version. Do you think this is ready to merge?
Yes
I just merged this (with the CLI, not through the web client) and released in https://github.com/nebrelbug/npm-to-yarn/releases/tag/v3.0.0! Thanks for your help!
Note: that's a bit unfortunate but it looks like yarn dlx
is not supported by Yarn 1
For this reason the limits the adoption of this feature. I don't think it's a good idea to use it on the Docusaurus website because many users use Yarn 1 (including ourselves)
is yarn exec
supported in Yarn 1 ?
I don't see it listed here: https://classic.yarnpkg.com/en/docs/cli/
However yarn exec echo "Hello"
works but it doesn't seem to be a decent alternative to npx
This PR adds a new type of conversions (for
npx
).The command
npx create-next-app
is converted into:yarn dlx create-next-app
(yarn)pnpm dlx create-next-app
(pnpm)bun x create-next-app
(bun)Automatically detects executor commands and converts it
Here's a code example.
Closes #48