riju icon indicating copy to clipboard operation
riju copied to clipboard

Add ability to install packages

Open raxod502 opened this issue 3 years ago • 0 comments

I would like to add integration with language-specific package managers to the greatest extent possible. Riju already has a proposed interface for package manager configuration:

pkg?: {
  install: string;
  uninstall?: string;
  all?: string;
  search?: string;
};

Here is the sample code for Python:

pkg: {
  install: "pip3 install --user NAME",
  uninstall: "pip3 uninstall NAME",
  search: `python3 -c 'import json; from xmlrpc import client; print(json.dumps(client.ServerProxy("https://pypi.org/pypi").search({"name": "NAME"})))' | jq -r 'map(.name) | .[]'`,
},

We can add new websocket messages to control package management, and expose the package manager as a service similar to lsp and formatter. The frontend will need to gain several new user interface elements. I envision a new button similar to the "Prettify" button that will open a modal with package management controls. We will provide an input field for the package to install, with asynchronous autocompletion candidates. There should also be an embedded terminal in the modal so that output from the package manager can be seen by the user.

See also UPM, another attempt to put language-specific package managers behind a common interface. None of that work can be reused, however, because Riju has significantly different requirements from the common interface than Repl.it.

raxod502 avatar Jun 15 '21 05:06 raxod502