summaryrefslogtreecommitdiff
path: root/scripts/frontend
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-02 18:07:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-02 18:07:42 +0000
commit7b52c7cb634ef7047d30b0337fe477bcdcedf41d (patch)
tree374ca9e908204488422046f10e340d1500780362 /scripts/frontend
parentb375c6c05fbd03aea33a9ee9f82e678bdaa8c3cc (diff)
downloadgitlab-ce-7b52c7cb634ef7047d30b0337fe477bcdcedf41d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/frontend')
-rw-r--r--scripts/frontend/block_dependencies.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/frontend/block_dependencies.js b/scripts/frontend/block_dependencies.js
new file mode 100644
index 00000000000..c9257c9f72b
--- /dev/null
+++ b/scripts/frontend/block_dependencies.js
@@ -0,0 +1,21 @@
+const path = require('path');
+const packageJson = require(path.join(process.cwd(), 'package.json'));
+const blockedDependencies = packageJson.blockedDependencies || {};
+const dependencies = packageJson.dependencies;
+const devDependencies = packageJson.devDependencies;
+const blockedDependenciesNames = Object.keys(blockedDependencies);
+const blockedDependenciesFound = blockedDependenciesNames.filter(
+ blockedDependency => dependencies[blockedDependency] || devDependencies[blockedDependency],
+);
+
+if (blockedDependenciesFound.length) {
+ console.log('The following package.json dependencies are not allowed:');
+
+ blockedDependenciesFound.forEach(blockedDependency => {
+ const infoLink = blockedDependencies[blockedDependency];
+
+ console.log(`- ${blockedDependency}: See ${infoLink} for more information.`);
+ });
+
+ process.exit(-1);
+}