BrayanBot icon indicating copy to clipboard operation
BrayanBot copied to clipboard

Un-deprecate `setup.js`

Open NotAShelf opened this issue 2 years ago • 4 comments

I have recently noticed that the setup script (npm run setup) is now heavily outdated after the config changes and ultimately, too primitive to actively implement. Additionally, the prompt library introduces a minor vulnerability that we, naturally, do not want to have in BrayanBot.

Problem is, the prompt library may be deprecated (see #223 on their repo) and the alternatives do not include the regular expression checker that I need the setup.js to be opinionated to the necessary degree.

The alternatives are:

  • https://www.npmjs.com/package/inquirer
  • https://www.npmjs.com/package/prompts
  • https://www.npmjs.com/package/enquirer
  • https://www.npmjs.com/package/promptly
  • https://www.npmjs.com/package/prompt-sync

We can either contribute to one of the alternative libraries (would good publicity) or deprecate setup.js entirely.

NotAShelf avatar Apr 22 '22 15:04 NotAShelf

I think having a setup script is fine, if it's simple, updated and doesn't "force" the user to create anything that they don't want. Have a simple setup script that helps the user set up the configs and enable/disable functions they would like to use.

Resorted avatar Apr 22 '22 16:04 Resorted

I think having a setup script is fine, if it's simple, updated and doesn't "force" the user to create anything that they don't want. Have a simple setup script that helps the user set up the configs and enable/disable functions they would like to use.

You could say that it's simple, but it does ultimately force you to create your config.yml (which you need to create either way, so that doesn't really count as "forcing"). I'll see if I can simplify the script even further while also fixing the library vulnerability.

NotAShelf avatar Apr 22 '22 17:04 NotAShelf

You could say that it's simple, but it does ultimately force you to create your config.yml (which you need to create either way, so that doesn't really count as "forcing"). I'll see if I can simplify the script even further while also fixing the library vulnerability.

Yeah, when I said force user to create anything, I meant channels, roles etc.. like CB does. The creation of the config through a script is nothing but positive imo. I gave the script a read and it looked fine to me.

Resorted avatar Apr 22 '22 17:04 Resorted

The best solution to re-introduce the set-up script seems to be to update the prompt library ourselves. After updating dependencies and running the tests, it seems to work as intended therefore can be used once more.

NotAShelf avatar May 30 '22 09:05 NotAShelf

This has been practically auto-closed with the migration to V2. I will look into bringing back an install script in the future.

NotAShelf avatar Dec 25 '22 10:12 NotAShelf