mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-11 23:00:20 +08:00
bcd8a7823e
* # This is a combination of 2 commits. # This is the 1st commit message: chore: add npm-check-updates # The commit message #2 will be skipped: # fixup! chore: add npm-check-updates (cherry picked from commit f62e034897b7398ba304738433ddbe022147e6c0) * ci: add upgrade-deps workflow (cherry picked from commit 0a4a2827b59155757809f80450acfb7e5f63f4b3) * chore: update rule * chore: update * chore: rename * chore: update
30 lines
999 B
JavaScript
30 lines
999 B
JavaScript
// 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) => 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';
|
|
},
|
|
};
|