From 584f9e1a780a5b5de01fa28a4a4c7f2cb46eb5a2 Mon Sep 17 00:00:00 2001 From: Elanis Date: Sun, 5 May 2024 15:01:11 +0200 Subject: [PATCH] #712 - Generate GRAPHS.md --- .github/workflows/stars.yaml | 5 +- GRAPHS.md | 86 +++++++++++++++++++++++++++++++++ README.md | 6 ++- runner/README.template.begin.md | 2 + runner/stats.js | 1 + runner/stats.json | 2 +- runner/write_graphsdotmd.js | 56 +++++++++++++++++++++ 7 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 GRAPHS.md create mode 100644 runner/write_graphsdotmd.js diff --git a/.github/workflows/stars.yaml b/.github/workflows/stars.yaml index 37c74ccc..aaab041c 100644 --- a/.github/workflows/stars.yaml +++ b/.github/workflows/stars.yaml @@ -31,13 +31,14 @@ jobs: node stats.js shell: bash - - name: Update README + - name: Update README/GRAPHS run: | cd runner/ node write_readme.js + node write_graphsdotmd.js - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "Update stars & Fork" - file_pattern: runner/stats.json README.md \ No newline at end of file + file_pattern: runner/stats.json README.md GRAPHS.md \ No newline at end of file diff --git a/GRAPHS.md b/GRAPHS.md new file mode 100644 index 00000000..cd9cb278 --- /dev/null +++ b/GRAPHS.md @@ -0,0 +1,86 @@ + +# Graphs + +## Stars +```mermaid +gantt + title Github stars + dateFormat X + axisFormat %s + + + section electron + 112057 : 0, 112057 + + + section nw.js + 40120 : 0, 40120 + + + section tauri + 77602 : 0, 77602 + + + section nodegui + 8747 : 0, 8747 + + + section neutralinojs + 7250 : 0, 7250 + + + section wails + 22303 : 0, 22303 + + + section flutter + 161974 : 0, 161974 + + + section maui + 21580 : 0, 21580 + + +``` + +## Forks +```mermaid +gantt + title Github forks + dateFormat X + axisFormat %s + + + section electron + 14940 : 0, 14940 + + + section nw.js + 3880 : 0, 3880 + + + section tauri + 2281 : 0, 2281 + + + section nodegui + 287 : 0, 287 + + + section neutralinojs + 356 : 0, 356 + + + section wails + 1057 : 0, 1057 + + + section flutter + 26591 : 0, 26591 + + + section maui + 1613 : 0, 1613 + + +``` diff --git a/README.md b/README.md index c375f1a7..6b17128a 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ This repository has been made to create an objective comparison of multiple fram | | [Electron](https://github.com/electron/electron) | [NW.JS](https://github.com/nwjs/nw.js) | [Tauri](https://github.com/tauri-apps/tauri) | [NodeGui](https://github.com/nodegui/nodegui) | [Neutralino](https://github.com/neutralinojs/neutralinojs) | [Wails](https://github.com/wailsapp/wails) | [Flutter](https://github.com/flutter/flutter) | [.Net MAUI](https://github.com/dotnet/maui) | |:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| **Github stars** | 112k | 40.1k | 77.4k | 8.7k | 7.2k | 22.2k | 161.8k | 21.6k | 21.6k | +| **Github stars** | 112.1k | 40.1k | 77.6k | 8.7k | 7.3k | 22.3k | 162k | 21.6k | 21.6k | | **Forks** | 14.9k | 3.9k | 2.3k | 0.3k | 0.4k | 1.1k | 26.6k | 1.6k | 1.6k | | **Creation date** | 2013 | 2011 | 2019 | 2019 | 2018 | 2019 | 2018 | 2020 | -| **Last Update** | 4/2024 | 4/2024 | 4/2024 | 3/2024 | 4/2024 | 4/2024 | 4/2024 | 4/2024 | 4/2024 | +| **Last Update** | 5/2024 | 5/2024 | 5/2024 | 3/2024 | 5/2024 | 5/2024 | 5/2024 | 5/2024 | 5/2024 | | **Framework Language** | C++, JS, Objective-C, Python | C++ | Rust | C++ | C++ | Go | C, C++, Dart | C# | | **Usage Language - Back** | JS, C++ | JS, C++ | Rust | JS, C++ | JS, C++ | Go | Dart | C# | | **Usage Language - Front** | HTML, CSS, JS | HTML, CSS, JS | HTML, CSS, JS | HTML, CSS, JS | HTML, CSS, JS | HTML, CSS, JS | Dart | C# | @@ -26,6 +26,8 @@ This repository has been made to create an objective comparison of multiple fram | **Dependencies / modules support** | npm & node.js native addons | npm & node.js native addons | cargo (back), npm (front) | npm & node.js native addons | ❌ | Gomod (back), npm (front) | pub.dev | NuGet | | **Engine** | Chromium | Webkit, Chromium | WRY (WebKitGTK for Linux, WebKit for MacOS, Webview2 for Windows) | Qt | WebkitGTK+ | [WebKit2gtk on Linux, Webview2 on Windows and WkWebview on Mac](https://github.com/Elanis/web-to-desktop-framework-comparison/issues/611#issuecomment-1817605354) | Flutter engine | .NET MAUI | +See [GRAPHS.md](https://github.com/Elanis/web-to-desktop-framework-comparison/blob/main/GRAPHS.md) for stars/forks visualization. + ## Features | | [Electron](https://github.com/electron/electron) | [NW.JS](https://github.com/nwjs/nw.js) | [Tauri](https://github.com/tauri-apps/tauri) | [NodeGui](https://github.com/nodegui/nodegui) | [Neutralino](https://github.com/neutralinojs/neutralinojs) | [Wails](https://github.com/wailsapp/wails) | [Flutter](https://github.com/flutter/flutter) | [.Net MAUI](https://github.com/dotnet/maui) | diff --git a/runner/README.template.begin.md b/runner/README.template.begin.md index e5371438..3f27520f 100644 --- a/runner/README.template.begin.md +++ b/runner/README.template.begin.md @@ -26,6 +26,8 @@ This repository has been made to create an objective comparison of multiple fram | **Dependencies / modules support** | npm & node.js native addons | npm & node.js native addons | cargo (back), npm (front) | npm & node.js native addons | ❌ | Gomod (back), npm (front) | pub.dev | NuGet | | **Engine** | Chromium | Webkit, Chromium | WRY (WebKitGTK for Linux, WebKit for MacOS, Webview2 for Windows) | Qt | WebkitGTK+ | [WebKit2gtk on Linux, Webview2 on Windows and WkWebview on Mac](https://github.com/Elanis/web-to-desktop-framework-comparison/issues/611#issuecomment-1817605354) | Flutter engine | .NET MAUI | +See [GRAPHS.md](https://github.com/Elanis/web-to-desktop-framework-comparison/blob/main/GRAPHS.md) for stars/forks visualization. + ## Features | | [Electron](https://github.com/electron/electron) | [NW.JS](https://github.com/nwjs/nw.js) | [Tauri](https://github.com/tauri-apps/tauri) | [NodeGui](https://github.com/nodegui/nodegui) | [Neutralino](https://github.com/neutralinojs/neutralinojs) | [Wails](https://github.com/wailsapp/wails) | [Flutter](https://github.com/flutter/flutter) | [.Net MAUI](https://github.com/dotnet/maui) | diff --git a/runner/stats.js b/runner/stats.js index 3f464edb..d6f53315 100644 --- a/runner/stats.js +++ b/runner/stats.js @@ -13,6 +13,7 @@ for(const libraryName in libraries) { const updateDate = new Date(json.pushed_at); data[libraryName] = { + repo, stars: json.stargazers_count, forks: json.forks_count, lastUpdate: (updateDate.getMonth() + 1) + '/' + updateDate.getFullYear() diff --git a/runner/stats.json b/runner/stats.json index f36cd0e6..ab1e3e05 100644 --- a/runner/stats.json +++ b/runner/stats.json @@ -1 +1 @@ -{"electron":{"stars":112057,"forks":14940,"lastUpdate":"5/2024"},"nw.js":{"stars":40120,"forks":3880,"lastUpdate":"5/2024"},"tauri":{"stars":77602,"forks":2281,"lastUpdate":"5/2024"},"nodegui":{"stars":8747,"forks":287,"lastUpdate":"3/2024"},"neutralinojs":{"stars":7250,"forks":356,"lastUpdate":"5/2024"},"wails":{"stars":22303,"forks":1057,"lastUpdate":"5/2024"},"flutter":{"stars":161972,"forks":26590,"lastUpdate":"5/2024"},"DotnetMaui":{"stars":21580,"forks":1613,"lastUpdate":"5/2024"},"DotnetMauiVue":{"stars":21580,"forks":1613,"lastUpdate":"5/2024"}} \ No newline at end of file +{"electron":{"repo":"electron/electron","stars":112057,"forks":14940,"lastUpdate":"5/2024"},"nw.js":{"repo":"nwjs/nw.js","stars":40120,"forks":3880,"lastUpdate":"5/2024"},"tauri":{"repo":"tauri-apps/tauri","stars":77602,"forks":2281,"lastUpdate":"5/2024"},"nodegui":{"repo":"nodegui/nodegui","stars":8747,"forks":287,"lastUpdate":"3/2024"},"neutralinojs":{"repo":"neutralinojs/neutralinojs","stars":7250,"forks":356,"lastUpdate":"5/2024"},"wails":{"repo":"wailsapp/wails","stars":22303,"forks":1057,"lastUpdate":"5/2024"},"flutter":{"repo":"flutter/flutter","stars":161974,"forks":26591,"lastUpdate":"5/2024"},"DotnetMaui":{"repo":"dotnet/maui","stars":21580,"forks":1613,"lastUpdate":"5/2024"},"DotnetMauiVue":{"repo":"dotnet/maui","stars":21580,"forks":1613,"lastUpdate":"5/2024"}} \ No newline at end of file diff --git a/runner/write_graphsdotmd.js b/runner/write_graphsdotmd.js new file mode 100644 index 00000000..5f125f57 --- /dev/null +++ b/runner/write_graphsdotmd.js @@ -0,0 +1,56 @@ +import fs from 'fs'; + +let stars_text = ''; +let forks_text = ''; +const stats = JSON.parse(fs.readFileSync('stats.json', 'utf8')); + +const doneLibs = []; +for(const exampleId in stats) { + const example = stats[exampleId]; + if(doneLibs.includes(example.repo)) { + continue; + } + + const repoParts = example.repo.split('/'); + + stars_text += ` + section ${repoParts[1]} + ${example.stars} : 0, ${example.stars} + + `; + + forks_text += ` + section ${repoParts[1]} + ${example.forks} : 0, ${example.forks} + + `; + + doneLibs.push(example.repo); +} + + +let graphsdotmd_text = ` +# Graphs + +## Stars +\`\`\`mermaid +gantt + title Github stars + dateFormat X + axisFormat %s + +${stars_text} +\`\`\` + +## Forks +\`\`\`mermaid +gantt + title Github forks + dateFormat X + axisFormat %s + +${forks_text} +\`\`\` +`; + +fs.writeFileSync('../GRAPHS.md', graphsdotmd_text);