Skip to content

Commit 8803499

Browse files
committed
(plugins) Filter common npm keywords
1 parent 1ebf2a6 commit 8803499

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

_scripts/build-plugin-tags.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
var fs = require('fs');
22
var files = fs.readdirSync('_data/plugins');
3+
var hiddenKeywords = [
4+
'chai',
5+
'chai-plugin',
6+
'browser',
7+
'browser-only',
8+
'browser-only',
9+
'test',
10+
'tests',
11+
'testing',
12+
'plugin',
13+
'assert',
14+
'assertion',
15+
'assertions',
16+
'unit',
17+
'acceptance',
18+
'mocha',
19+
'jasmine',
20+
'integration-tests',
21+
'id',
22+
];
323
var keywords = files.filter(function (file) {
424
return file.slice(-5) === '.json';
525
}).map(function (file) {
@@ -13,11 +33,9 @@ var keywords = files.filter(function (file) {
1333
}).reduce(function (total, current) {
1434
return total.concat(current);
1535
}, []).filter(function(value, index, total) {
16-
return value !== 'chai' &&
17-
value !== 'chai-plugin' &&
18-
total.indexOf(value) === index;
36+
return hiddenKeywords.indexOf(value) === -1 && total.indexOf(value) === index;
1937
});
2038

2139
console.log(keywords);
2240

23-
fs.writeFileSync('_data/plugin_keywords.json', JSON.stringify(keywords), 'utf8');
41+
fs.writeFileSync('_data/plugin_keywords.json', JSON.stringify(keywords, null, 2), 'utf8');

0 commit comments

Comments
 (0)