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

Feature Request: add multiple commands conversion #56

Open
Jay-Karia opened this issue Aug 16, 2024 · 2 comments · May be fixed by #58
Open

Feature Request: add multiple commands conversion #56

Jay-Karia opened this issue Aug 16, 2024 · 2 comments · May be fixed by #58

Comments

@Jay-Karia
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Say I have to convert a npm command into pnpm, yarn and bun.
I have to call the convert function 3 times to accomplish the task.

There should be a convenient way to do this.

Describe the solution you'd like
I would like to introduce a new function convertMultiple to fulfill this task.

There could different use cases for it:

  1. One to many (convert one command into multiple package managers' equivalent)
convertMultiple("npm i next", ["pnpm", "bun"])
// ["pnpm add next", "bun add next"]
  1. Many to one (convert many commands into one 1 package manager's equivalent)
convertMultiple(["npm i eslint", "pnpm add react"], "yarn")
// ["yarn add eslint", "yarn add react"]
  1. Many to many (convert many commands into multiple package managers' equivalent)
convertMultiple(["bun add rollup", "npm i express"], ["yarn", "pnpm"])
/*
[
    ["yarn add rollup", "yarn add express"], 
    ["pnpm add rollup", "pnpm add express"]
]
*/
@Jay-Karia Jay-Karia linked a pull request Aug 17, 2024 that will close this issue
@nebrelbug
Copy link
Owner

I like the idea of this proposal, but I'm wary of adding too much complexity to this library. I feel like we'd want to rewrite it so that it first processed a string into an AST-like structure (e.g. type: "install", arg: "react nextjs tailwind", arguments: "save-dev") and then converted that to the desired format.

@Jay-Karia
Copy link
Contributor Author

Say there's a block with two commands that needs to be converted
Screenshot_20240827_053821_Chrome

the AST like structure might be inefficient.

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 a pull request may close this issue.

2 participants