Skip to content

Commit c10db2f

Browse files
committed
chore(scripts): fix node engines checker
1 parent 611b49c commit c10db2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/check-engines.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { readFileSync } from 'node:fs';
22
import { globbySync } from 'globby';
3-
import { satisfies } from 'semver';
3+
import intersects from 'semver/ranges/intersects.js';
44

55
const rootPath = new URL('../package.json', import.meta.url).pathname;
66
const root = JSON.parse(readFileSync(rootPath, 'utf8'));
7-
const syncpackEngine = root.engines.node.replace('>=', '');
7+
const syncpackEngine = root.engines.node;
88

99
const unsatisfiedDependencies = globbySync('node_modules/**/package.json')
1010
.map(filePath => readFileSync(filePath, 'utf8'))
@@ -14,7 +14,7 @@ const unsatisfiedDependencies = globbySync('node_modules/**/package.json')
1414
.map(file => {
1515
const name = file.name;
1616
const dependencyEngine = file.engines.node;
17-
const isSatisfied = satisfies(syncpackEngine, dependencyEngine);
17+
const isSatisfied = intersects(syncpackEngine, dependencyEngine);
1818
return {
1919
name,
2020
expected: syncpackEngine,

0 commit comments

Comments
 (0)