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

Switch to yarn and use scripts for easy installation/use #2

Closed
wants to merge 2 commits into from

Conversation

pfgithub
Copy link

@pfgithub pfgithub commented Mar 11, 2018

npm i -g yarn
yarn install -- installs all the right versions of things
yarn run config -- set up the config file
yarn start -- run pm2 file.js

@AshesOfEther
Copy link
Contributor

  • NPM comes with Node.js. I don't want to install a seperate package manager just for projects that want it, since most use, or support NPM anyway.
  • Installation and use can be made much easier than this by simply adding a few scripts like install.sh, run.sh, update.sh, etc.
  • NPM is more verbose. When I install something, I want to see everything that's going on, when it's going on. I don't want to have some install fail, then look up some command I don't know, and run it to figure out what happened.
  • The speed difference is quite minimal, with a few seconds per 100~ packages.

@pfgithub
Copy link
Author

pfgithub commented Mar 12, 2018

@TobiasSN

  • Every project you download using npm can be installed with yarn, instead of yarn being a seperate package manager it would be a main package manager with npm being secondary for projects that you push to
  • NPM exists so you don't need install.sh, that's what npm install is supposed to do, but this project requires request@2.81.0 which npm can't install the correct version and a global package install which should be done as a dev dependency but wasn't
  • [WIP] Add verbose flag - fixes #763 yarnpkg/yarn#1994 yarn install --verbose is implemented
  • The speed difference only different if you install two projects. When you install request, yarn will save request@version to a packages folder and then copy it into your node modules. This means next time you install request@version, you can install it offline or really quickly without downloading anything

If you really don't want yarn the things you want from this pull are

  • npm i pm2 --save-dev
  • npm install # will not install request@2.81.0 but instead the latest version but will install pm2 if you --save-dev
  • Ungitignore the npm lock file
  • The config file generator or config.example.json

And maybe even just

  • Why does the project require pm2, just have npm start in the readme and use pm2 for actual deployment
  • Why does the readme tell you to install 3 packages rather than just npm install
  • Why do you need request@2.81.0

@AshesOfEther
Copy link
Contributor

  • Yarn is still a different package manager, it's just NPM-compatible.
  • I know, that was just an example.
  • Still, verbosity should be the default in case somebody doesn't know that command.
  • That's quite space-inefficient.

Those other changes are quite useful I must say.

  • That's a good point. I think that npm test should be used for developing, and npm start for actual deployment.
  • Michael probably just didn't know that.
  • Idk.

@pfgithub
Copy link
Author

@TobiasSN one thing, npm test is typically used for running automated tests to make sure everything works right. You might want to use something else

@AshesOfEther
Copy link
Contributor

It’s what I use. I don’t think it really matters anyway

@pfgithub pfgithub closed this Feb 12, 2019
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.

2 participants