Skip to content

Commit

Permalink
feat: don't downgrade engines if already higher
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Oct 9, 2023
1 parent 2252a55 commit 6758da0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/standardize-pjson.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
const { readFileSync } = require('fs');
const { join } = require('path');
const { resolveConfig } = require('./sf-config');
const { semverIsLessThan } = require('./semver');

const PackageJson = require('./package-json');

module.exports = (packageRoot = require('./package-path')) => {
Expand Down Expand Up @@ -55,7 +57,8 @@ module.exports = (packageRoot = require('./package-path')) => {
tsconfig.match(/"extends"\s*:\s*".*@salesforce\/dev-config/) &&
pjson.contents.engines &&
pjson.contents.engines.node &&
pjson.contents.engines.node !== engineVersion
pjson.contents.engines.node !== engineVersion &&
semverIsLessThan(pjson.contents.engines.node, engineVersion)
) {
pjson.actions.push('updating node engine');
pjson.contents.engines.node = engineVersion;
Expand Down

0 comments on commit 6758da0

Please sign in to comment.