forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ncurc.js
34 lines (30 loc) · 1.06 KB
/
.ncurc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// doc: https://github.com/raineorshine/npm-check-updates/tree/v16.14.6#readme
const path = require('path');
const rcOrg = ['@rc-component/', 'rc-'];
const check = ['@ant-design/', ...rcOrg];
// rules: https://github.com/ant-design/ant-design/pull/45593#issuecomment-1784891887
module.exports = {
packageFile: path.resolve(__dirname, './package.json'),
upgrade: false, // use `npx npm-check-updates -u` to upgrade
packageManager: 'npm',
dep: ['prod'], // check only prod dependencies
// https://github.com/raineorshine/npm-check-updates#filter
filter: (name) => {
if (name === '@ant-design/cssinjs') {
return false;
}
return check.some((prefix) => name.startsWith(prefix));
},
// https://github.com/raineorshine/npm-check-updates#target
target: (name, semver) => {
const { operator } = semver[0] ?? {};
// rc-component
if (rcOrg.some((prefix) => name.startsWith(prefix))) {
// `^` always upgrade latest, otherwise follow semver.
if (operator === '^') {
return 'latest';
}
}
return 'semver';
},
};