Skip to content

Make node-sass optional in peerDependencies#55

Open
StetsenkoBohdan2002 wants to merge 2 commits into
jgranstrom:masterfrom
StetsenkoBohdan2002:master
Open

Make node-sass optional in peerDependencies#55
StetsenkoBohdan2002 wants to merge 2 commits into
jgranstrom:masterfrom
StetsenkoBohdan2002:master

Conversation

@StetsenkoBohdan2002
Copy link
Copy Markdown

  • 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
Copy Markdown

@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.

Comment thread package.json
"node-sass": ">=3.8.0",
"sass": ">=1"
},
"peerDependenciesMeta": {
Copy link
Copy Markdown

@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".

Comment thread package.json
Copy link
Copy Markdown

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