build icon indicating copy to clipboard operation
build copied to clipboard

Move `npm install` and `yarn` logic from the buildbot to Netlify Build

Open ehmicky opened this issue 5 years ago • 3 comments

Build plugins are installed using npm install or yarn.

We already install dependencies using npm install or yarn in the buildbot. The buildbot logic includes several features: caching, YARN_VERSION, NPM_VERSION, YARN_FLAGS, NPM_FLAGS. Due to having two separate logic, those are not supported when installing Build plugins. For example, NPM_FLAGS support for plugins installation was requested in #1175.

We should move the buildbot logic to Netlify Build instead. This is rather delicate operation since any difference of behavior would result in build failures.

Note: thanks to Netlify Build version pinning, we can now release a buildbot PR + Netlify Build PR together atomically, which should help.

ehmicky avatar Apr 22 '20 11:04 ehmicky

@ehmicky, I have a request here. If we do this can there also please be a stage before the stage in the build cycle?

Customers have long been asking for a way to run code/commands before dependency install. If we do move dependency install into Netlify Build having a stage before this would solve a long-standing problem for our customers.

The mostly want to edit their dependencies manually (for example using sed or other tools to edit package.json) to prevent certain dependencies from being installed for the Netlify build.

overlordofmu avatar Apr 23 '20 00:04 overlordofmu

Yes absolutely! We have discussed adding a onPreInstall event in Build plugins. This could run before npm install and yarn.

However until we move the other installations command for other languages/frameworks, this would still be run after those. So we could (should?) also wait after those have been moved to.

ehmicky avatar Apr 23 '20 12:04 ehmicky

onPreInstall tracked separately at #1149.

ehmicky avatar May 25 '20 17:05 ehmicky

This issue has been automatically marked as stale because it has not had activity in 1 year. It will be closed in 14 days if no further activity occurs. Thanks!

github-actions[bot] avatar Oct 11 '22 14:10 github-actions[bot]

This issue was closed because it had no activity for over 1 year.

github-actions[bot] avatar Oct 25 '22 14:10 github-actions[bot]