debian-mirror-gitlab/scripts/frontend/block_dependencies.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
779 B
JavaScript
Raw Normal View History

2021-04-17 20:07:23 +05:30
const packageJson = require('../../package.json');
2020-04-08 14:13:33 +05:30
const blockedDependencies = packageJson.blockedDependencies || {};
2021-04-17 20:07:23 +05:30
const { dependencies } = packageJson;
const { devDependencies } = packageJson;
2020-04-08 14:13:33 +05:30
const blockedDependenciesNames = Object.keys(blockedDependencies);
const blockedDependenciesFound = blockedDependenciesNames.filter(
2021-03-08 18:12:59 +05:30
(blockedDependency) => dependencies[blockedDependency] || devDependencies[blockedDependency],
2020-04-08 14:13:33 +05:30
);
if (blockedDependenciesFound.length) {
console.log('The following package.json dependencies are not allowed:');
2021-03-08 18:12:59 +05:30
blockedDependenciesFound.forEach((blockedDependency) => {
2020-04-08 14:13:33 +05:30
const infoLink = blockedDependencies[blockedDependency];
console.log(`- ${blockedDependency}: See ${infoLink} for more information.`);
});
process.exit(-1);
}