Skip to content

Make node-sass optional in peerDependencies #55

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

StetsenkoBohdan2002
Copy link

  • Added peerDependenciesMeta section in package.json to mark node-sass as optional.
  • This change allows users to install either node-sass or sass without warnings if node-sass is not present.
  • Ensures greater flexibility for users who prefer using Dart Sass or other implementations.

Copy link

@cduivis cduivis left a comment

Choose a reason for hiding this comment

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

I saw 2 small improvements:

  1. increase the patch version of the package.
  2. increase the Node version to one that supports NPM with peerDependenciesMeta.

See the pull request remarks for more details.

@@ -32,6 +32,11 @@
"node-sass": ">=3.8.0",
"sass": ">=1"
},
"peerDependenciesMeta": {
Copy link

@cduivis cduivis Jan 8, 2025

Choose a reason for hiding this comment

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

Hey I'm not the maintainer of this package, but I was also looking at creating a PR when I found yours.

TLDR: My suggestion is to also update the engine node version to at least 10.

Reasoning:

peerDependenciesMeta is a feature introduced in NPM 7, which was released with Node version 15.
If I take a look at the release notes from that time. NPM 7 only works with Node versions 10 and up:
image
https://docs.npmjs.com/cli/v7/using-npm/changelog#some-high-level-changes-and-improvements

So on line 29 I would also upgrade node "node": ">=4" towards at least "node": ">=10".

Copy link

Choose a reason for hiding this comment

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

The patch version of the package should also be increased by 1:
line 3 : 3.0.0 -> 3.0.1

As 3.0.0 already exists as a NPM package:
https://www.npmjs.com/package/sass-extract?activeTab=versions

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