Skip to content

Commit

Permalink
Fix library.json and add extra error message suring validation
Browse files Browse the repository at this point in the history
  • Loading branch information
peti2001 committed Apr 3, 2024
1 parent 847c108 commit 483a3d5
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 55 deletions.
121 changes: 68 additions & 53 deletions libraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,53 +94,6 @@
"description": "The Visualization Toolkit (VTK) is an open-source, freely available software system for 3D computer graphics, modeling, image processing, volume rendering, scientific visualization, and 2D plotting."
}
},
"D": {
"DCompute": {
"imports": ["dcompute"],
"technologies": ["Machine Learning", "Deep Learning", "D Libraries"],
"description": "DCompute is Native execution of D on GPUs and other Accelerators."
},
"dcv": {
"imports": ["dcv"],
"technologies": ["Image Processing", "Computer Vision", "D Libraries"],
"description": "Computer Vision Library for D Programming Language."
},
"libmir": {
"imports": ["mir"],
"technologies": [
"Scientific Computing",
"Data Processing",
"Data Science",
"D Libraries"
],
"description": "Mir Algorithm in Dlang."
},
"libdparse": {
"imports": ["dparse"],
"technologies": ["D Libraries"],
"description": "Library for lexing and parsing D source code."
},
"arsd": {
"imports": ["arsd"],
"technologies": ["D Libraries", "Desktop Applications", "Frameworks", "XML", "Databases", "Web Development"],
"description": "This is a collection of modules written on D."
},
"vibed": {
"imports": ["vibe"],
"technologies": ["D Libraries", "Frameworks", "Databases", "Web Development"],
"description": "high-performance asynchronous I/O, concurrency and web application toolkit written in D."
},
"dlangui": {
"imports": ["dlangui"],
"technologies": ["D Libraries", "Desktop Applications"],
"description": "Cross Platform GUI for D programming language (not binding)."
},
"gtkd": {
"imports": ["gtk", "gtkc", "gio", "glib", "gstreamer", "gobject"],
"technologies": ["D Libraries", "Frameworks", "Desktop Applications"],
"description": "GtkD is a D binding and OO wrapper of GTK+."
},
},
"CSS": {
"AdminLTE": {
"imports": ["AdminLTE.css", "AdminLTE.min.css"],
Expand Down Expand Up @@ -203,7 +156,60 @@
"image": "https://refactoringui.nyc3.cdn.digitaloceanspaces.com/tailwind-logo.svg"
}
},
"D": {
"arsd": {
"imports": ["arsd"],
"technologies": ["D Libraries", "Desktop Applications", "Frameworks", "XML", "Databases", "Web Development"],
"description": "This is a collection of modules written on D."
},
"DCompute": {
"imports": ["dcompute"],
"technologies": ["Machine Learning", "Deep Learning", "D Libraries"],
"description": "DCompute is Native execution of D on GPUs and other Accelerators."
},
"dcv": {
"imports": ["dcv"],
"technologies": ["Image Processing", "Computer Vision", "D Libraries"],
"description": "Computer Vision Library for D Programming Language."
},
"dlangui": {
"imports": ["dlangui"],
"technologies": ["D Libraries", "Desktop Applications"],
"description": "Cross Platform GUI for D programming language (not binding)."
},
"gtkd": {
"imports": ["gtk", "gtkc", "gio", "glib", "gstreamer", "gobject"],
"technologies": ["D Libraries", "Frameworks", "Desktop Applications"],
"description": "GtkD is a D binding and OO wrapper of GTK+."
},
"libdparse": {
"imports": ["dparse"],
"technologies": ["D Libraries"],
"description": "Library for lexing and parsing D source code."
},
"libmir": {
"imports": ["mir"],
"technologies": [
"Scientific Computing",
"Data Processing",
"Data Science",
"D Libraries"
],
"description": "Mir Algorithm in Dlang."
},
"vibed": {
"imports": ["vibe"],
"technologies": ["D Libraries", "Frameworks", "Databases", "Web Development"],
"description": "high-performance asynchronous I/O, concurrency and web application toolkit written in D."
}
},
"Dart": {
"Dask": {
"imports": ["dask"],
"technologies": ["Big Data", "Scientific Computing", "Data Processing", "Data Science"],
"description": "Dask is a flexible library for parallel computing in Python.",
"image": "https://docs.dask.org/en/stable/_static/images/dask-horizontal-white.svg"
},
"fl_chart": {
"imports": [
"package:fl_chart/fl_chart.dart",
Expand All @@ -216,12 +222,6 @@
"technologies": ["Data Visualization"],
"description": "A powerful Flutter chart library, currently supporting Line Chart, Bar Chart and Pie Chart."
},
"Dask": {
"imports": ["dask"],
"technologies": ["Big Data", "Scientific Computing", "Data Processing", "Data Science"],
"description": "Dask is a flexible library for parallel computing in Python.",
"image": "https://docs.dask.org/en/stable/_static/images/dask-horizontal-white.svg"
},
"Flutter": {
"imports": ["package:flutter"],
"technologies": ["Mobile Development"],
Expand Down Expand Up @@ -1096,6 +1096,15 @@
"imports": ["webpack"],
"technologies": ["Build tools"],
"description": "Webpack is an open-source JavaScript module bundler. It is a module bundler primarily for JavaScript, but it can transform front-end assets like HTML, CSS, and images if the corresponding loaders are included."
},
"Xarray": {
"imports": ["xarray"],
"technologies": [
"Scientific Computing",
"Data Processing",
"Data Science"
],
"description": "Xarray: N-D labeled arrays and datasets in Python. Xarray is an open source project and Python package that introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, which allows for more intuitive, more concise, and less error-prone user experience."
}
},
"OpenEdge ABL": {
Expand Down Expand Up @@ -1858,6 +1867,12 @@
"description": "Herbs is an library for backend applications, allowing you to build your microservices in Node.js faster and future-proof.",
"image": "https://herbsjs.org/img/logo-herbsjs.svg"
},
"Holoviews": {
"imports": ["holoviews"],
"technologies": ["Scientific Computing", "Data Science", "Data Visualization"],
"description": "HoloViews is an open-source Python library for data analysis and visualization.",
"image": "https://holoviews.org/_static/logo_horizontal.png"
},
"Impress": {
"imports": ["impress"],
"technologies": ["Backend", "Private Cloud", "Application Server"],
Expand Down
34 changes: 33 additions & 1 deletion tools/ci-checks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
let fs = require('fs')

function compareJSON(obj1, obj2, path = '') {
let diff = {};

// Check keys in obj1
for (let key in obj1) {
if (obj1.hasOwnProperty(key)) {
const fullPath = (path ? path + '.' : '') + key;
if (!obj2.hasOwnProperty(key)) {
diff[fullPath] = { oldValue: obj1[key], newValue: undefined };
} else if (typeof obj1[key] === 'object' && typeof obj2[key] === 'object') {
const nestedDiff = compareJSON(obj1[key], obj2[key], fullPath);
if (Object.keys(nestedDiff).length > 0) {
diff[fullPath] = nestedDiff;
}
} else if (obj1[key] !== obj2[key]) {
diff[fullPath] = { oldValue: obj1[key], newValue: obj2[key] };
}
}
}

// Check keys in obj2 to find any additional keys
for (let key in obj2) {
if (obj2.hasOwnProperty(key) && !obj1.hasOwnProperty(key)) {
const fullPath = (path ? path + '.' : '') + key;
diff[fullPath] = { oldValue: undefined, newValue: obj2[key] };
}
}

return diff;
}

fs.readFile( __dirname + '/../libraries.json', function (err, data) {
if (err) {
throw err;
Expand All @@ -15,7 +46,8 @@ fs.readFile( __dirname + '/../libraries.json', function (err, data) {

// javaScript and TypeScript must be the same
if (JSON.stringify(data["JavaScript"]) !== JSON.stringify(data["TypeScript"])) {
error.push('ERROR: JavaScript and TypeScript must have the same libraries and same values.');
const diff = compareJSON(data["JavaScript"], data["TypeScript"]);
error.push('ERROR: JavaScript and TypeScript must have the same libraries and same values. Diff: ' + JSON.stringify(diff));

for (let i of Object.keys(data["JavaScript"])) {
if (!data["TypeScript"][i]) {
Expand Down
30 changes: 29 additions & 1 deletion tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 483a3d5

Please sign in to comment.