BrayanBot icon indicating copy to clipboard operation
BrayanBot copied to clipboard

Migrate to pnpm, or Yarn

Open NotAShelf opened this issue 2 years ago • 6 comments

BrayanBot is currently using npm (which, ironically does not stand for node package manager) and as much as it is simple to use, it is is slow, inefficient and insecure by default. Yarn mitigates some of it's issues (and it's comparatively faster than npm) but the security concern remains. pnpm on the other hand, is fast, efficient and secure; which is why I will recommend switching to it by default in our package.json and documentation

Naturally, further testing remains to be done; but since pnpm stands for performant npm; compatibility should be superb.

Alternative reads:

  • https://blog.logrocket.com/javascript-package-managers-compared/
  • https://medium.com/pnpm/why-should-we-use-pnpm-75ca4bfe7d93
  • https://blog.bitsrc.io/pnpm-javascript-package-manager-4b5abd59dc9?gi=9a0f7e5e092d
  • Benchmarks

NotAShelf avatar May 22 '22 05:05 NotAShelf

This would limit users to find hosting that gives pnpm or will give to the user for this specific use

NotZorino avatar May 22 '22 05:05 NotZorino

It is not really "this specific use", it's a significant change regarding security and efficiency which I think should be the default

and no, it would not limit users to finding specific hosting that provides pnpm because you can always change your package.json back to npm

NotAShelf avatar May 22 '22 05:05 NotAShelf

This is how easy it is to change it:

	"scripts": {
		"dev": "nodemon index.js --show-errors --no-install -e js",
		"start": "node index.js",
-		"install:start": "pnpm i && node index.js --no-install",
-		"install:dev": "pnpm i && nodemon index.js --show-errors --no-install -e js"
	}
	"scripts": {
		"dev": "nodemon index.js --show-errors --no-install -e js",
		"start": "node index.js",
+		"install:start": "npm i && node index.js --no-install",
+		"install:dev": "npm i && nodemon index.js --show-errors --no-install -e js"
	}

NotAShelf avatar May 22 '22 05:05 NotAShelf

This is how easy it is to change it:

	"scripts": {
		"dev": "nodemon index.js --show-errors --no-install -e js",
		"start": "node index.js",
-		"install:start": "pnpm i && node index.js --no-install",
-		"install:dev": "pnpm i && nodemon index.js --show-errors --no-install -e js"
	}
	"scripts": {
		"dev": "nodemon index.js --show-errors --no-install -e js",
		"start": "node index.js",
+		"install:start": "npm i && node index.js --no-install",
+		"install:dev": "npm i && nodemon index.js --show-errors --no-install -e js"
	}

Remember about AddonHandler which handles Module Installer

SimonB50 avatar May 22 '22 05:05 SimonB50

This is how easy it is to change it:

	"scripts": {
		"dev": "nodemon index.js --show-errors --no-install -e js",
		"start": "node index.js",
-		"install:start": "pnpm i && node index.js --no-install",
-		"install:dev": "pnpm i && nodemon index.js --show-errors --no-install -e js"
	}
	"scripts": {
		"dev": "nodemon index.js --show-errors --no-install -e js",
		"start": "node index.js",
+		"install:start": "npm i && node index.js --no-install",
+		"install:dev": "npm i && nodemon index.js --show-errors --no-install -e js"
	}

Remember about AddonHandler which handles Module Installer

Right. In that case we can either provide an alternative download or instructions on how to migrate inbetween.

NotAShelf avatar May 22 '22 05:05 NotAShelf

As a side note, pnpm is (just like yarn), or rather; can be, installed as a npm package; so that should not be an issue.

NotAShelf avatar May 22 '22 05:05 NotAShelf

Closing this, as pnpm is added in V2

XCraftMan52 avatar Jan 10 '23 14:01 XCraftMan52