Skip to content

Commit 966ea28

Browse files
Improve technology schema validation and remove deprecated entries (#277)
* Improve icon validation in the technology schema * Remove deprecated entries for AbhiCMS and Transmart from technology schemas * lint
1 parent 23377aa commit 966ea28

3 files changed

Lines changed: 12 additions & 30 deletions

File tree

scripts/validate.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,18 @@ Object.keys(technologies).forEach((name) => {
126126
});
127127

128128
// Validate icons
129-
if (technology.icon && !fs.existsSync(`${iconPath}/${technology.icon}`)) {
130-
throw new Error(`No such icon: ${technology.icon} (${name})`);
129+
if (!technology.icon) {
130+
console.warn(`Missing icon attribute (${name})`);
131+
} else {
132+
if (!/\.(png|svg)$/i.test(technology.icon)) {
133+
throw new Error(
134+
`Icon must be a PNG or SVG file: ${technology.icon} (${name})`
135+
);
136+
}
137+
138+
if (!fs.existsSync(`${iconPath}/${technology.icon}`)) {
139+
throw new Error(`No such icon: ${technology.icon} (${name})`);
140+
}
131141
}
132142

133143
// Validate website URLs

src/technologies/a.json

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -361,23 +361,6 @@
361361
},
362362
"website": "https://awstats.sourceforge.net"
363363
},
364-
"AbhiCMS": {
365-
"cats": [
366-
1
367-
],
368-
"description": "AbhiCMS is a lesser-known content management system that may not have a significant user base or active development community.",
369-
"implies": [
370-
"PHP",
371-
"MySQL"
372-
],
373-
"meta": {
374-
"generator": "AbhiCMS\\s([\\d\\.]+)\\;version:\\1"
375-
},
376-
"pricing": [
377-
"poa"
378-
],
379-
"website": "https://website999.org"
380-
},
381364
"Abicart": {
382365
"cats": [
383366
6

src/technologies/t.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,17 +2608,6 @@
26082608
"scriptSrc": "/wp-content/plugins/google-language-translator/.+scripts\\.js(?:\\?ver=(\\d+(?:\\.\\d+)+))?\\;version:\\1",
26092609
"website": "https://gtranslate.io"
26102610
},
2611-
"Transmart": {
2612-
"cats": [
2613-
99
2614-
],
2615-
"description": "Transmart is a shipping company in Turkey.",
2616-
"requiresCategory": 6,
2617-
"text": [
2618-
"\\bTransmart\\b"
2619-
],
2620-
"website": "https://transmartshipping.com"
2621-
},
26222611
"Tray": {
26232612
"cats": [
26242613
6

0 commit comments

Comments
 (0)