Skip to content

Conversation

@FoxxMD
Copy link

@FoxxMD FoxxMD commented Apr 5, 2023

This PR addresses OS dependency issues and some QoL updates for users trying to install this project locally

Specify Node/NPM Version

Use the engines property in package.json to hint to developers what the minimum (or preferred) node/npm versions to use should be. I set the versions to minimum major version but they should preferably be set to LTS versions (16.20.0)

Also added an .nvmrc for convenience to set the node/npm version, if nvm is used.

Reduce Install Complexity/Dependency Issues

gulp-sass depends on node-sass which depends on building node-gyp which is notoriously error-prone if you don't have the exactly specific requirements for OS to use their prebuilt binaries. This can result in having to build node-gyp (takes forever, error prone) and building node-sass from source.

Instead, use the drop-in replacement gulp-dart-sass which does not have these dependencies.

Fix Gulp 3 errors on on older Node versions

Gulp 3 depends on a package, graceful-fs that patches native node.js fs module but that only works for node <11. To fix this update npm to >8 (node >16.14) in order to use overrides property in package.json in order to force graceful-fs to a major version that does not do the patch.

* Replace gulp-sass with gulp-dart-sass to remove python2 and node-gyp dependencies
* Override graceful-fs to fix gulp error https://stackoverflow.com/a/58394828
  * Update(?) to npm>=8 in order to use overrides field
* Add node/npm version to package engine property
* Include nvmrc for convenience
Copy link

@codeCraft-Ritik codeCraft-Ritik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice implementation

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