diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index 9d04287..98f3b00 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -14,12 +14,14 @@ env: GITHUB_ACTION_RUN_NUMBER: ${{ github.run_number }} jobs: - test: + collect-data: strategy: fail-fast: false matrix: os: - macos-latest + - ubuntu-latest + - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -54,13 +56,19 @@ jobs: run: | git config --local user.name "github-actions[bot]" git config --local user.email "github-actions[bot]@users.noreply.github.com" - git add ./webapp/public/*.gz + git add ./webapp/public/* git add ./repos.txt - git commit -m "Update data" || echo "No changes to commit" + git commit -m "Update data for ${{ matrix.os }}" || echo "No changes to commit" - name: Push changes run: git push + deploy: + needs: collect-data + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js 22 uses: actions/setup-node@v4 with: @@ -77,7 +85,9 @@ jobs: run: | pnpm run build sed -i '' 's|="/assets|="/moon-build-dashboard/assets|g' ./dist/index.html - sed -i '' 's|"/latest_data.jsonl.gz"|"/moon-build-dashboard/latest_data.jsonl.gz"|g' ./dist/assets/*.js + sed -i '' 's|"/linux/latest_data.jsonl.gz"|"/moon-build-dashboard/linux/latest_data.jsonl.gz"|g' ./dist/assets/*.js + sed -i '' 's|"/windows/latest_data.jsonl.gz"|"/moon-build-dashboard/windows/latest_data.jsonl.gz"|g' ./dist/assets/*.js + sed -i '' 's|"/mac/latest_data.jsonl.gz"|"/moon-build-dashboard/mac/latest_data.jsonl.gz"|g' ./dist/assets/*.js working-directory: ./webapp - name: Deploy to GitHub Pages diff --git a/repos.txt b/repos.txt index ed501d8..40089b4 100644 --- a/repos.txt +++ b/repos.txt @@ -1,151 +1,2 @@ https://github.com/moonbitlang/core main https://github.com/moonbitlang/x main -https://github.com/gmlewis/moonbit-fonts master -https://github.com/trancee/wasmSID main -https://github.com/moonbitlang/minimoonbit-public main - -# generated list to test mooncakes on mooncakes.io -A-23187/encoding 0.1.0 -CAIMEOX/feat-moon 0.2.0 -CAIMEOX/list 0.1.0 -CAIMEOX/quickcheck 0.6.9 -CAIMEOX/state 0.1.0 -CAIMEOX/t 0.1.0 -CMoonBack/Binary-Exponentiation 0.1.0 -CMoonBack/computational-geometry 0.1.0 -CMoonBack/string-Algorithm 0.1.0 -Guest0x0/HAMT 0.2.1 -Guest0x0/dregex 0.2.5 -Howardzhangdqs/md5 0.9.3 -Kaida-Amethyst/math 0.1.2 -Lampese/moonbit-chalk 0.3.2 -PerfectPan/base64 0.1.1 -SyoujyoujiNaiki/chungshan 0.2.0 -Yoorkin/ArgParser 0.1.7 -Yoorkin/example/list 0.1.4 -Yoorkin/format 0.1.5 -Yoorkin/hello 0.1.3 -Yoorkin/prettyprinter 0.4.0 -Yoorkin/rabbit-tea 0.2.8 -Yoorkin/stack 0.1.4 -Yoorkin/trie 0.2.2 -Yu-zh/either 0.1.0 -YumeCross/schema 0.4.3 -bob/aegis 0.1.0 -bobzhang/sexp 0.1.1 -bobzhang/testa 0.1.0 -bobzhang/testb 0.1.0 -bzy-debug/cowsay 0.1.0 -bzy-debug/cowsay_lib 0.1.0 -bzy-debug/hello 0.1.20240510+81e045f4e -chawyehsu/punycode 0.0.3 -eczn/eczn-utils 0.2.0 -enjoecn/easy 0.1.0 -enjoecn/gb 0.1.1 -extism/moonbit-pdk 0.36.0 -fantix/mmhttp 0.3.0 -fantix/muts 0.5.4 -five-nuts/coreutils 0.1.3 -gmlewis/b2 0.27.0 -gmlewis/base64 0.11.0 -gmlewis/crc32 0.6.0 -gmlewis/flate 0.31.0 -gmlewis/fonts 0.2.0 -gmlewis/fonts-a 0.2.0 -gmlewis/fonts-b 0.2.0 -gmlewis/fonts-c 0.2.0 -gmlewis/fonts-d 0.2.0 -gmlewis/fonts-e 0.2.0 -gmlewis/fonts-f 0.2.0 -gmlewis/fonts-g 0.2.0 -gmlewis/fonts-h 0.2.0 -gmlewis/fonts-i 0.2.0 -gmlewis/fonts-j 0.2.0 -gmlewis/fonts-k 0.2.0 -gmlewis/fonts-l 0.2.0 -gmlewis/fonts-m 0.2.0 -gmlewis/fonts-o 0.2.0 -gmlewis/fonts-p 0.2.0 -gmlewis/fonts-q 0.2.0 -gmlewis/fonts-r 0.2.0 -gmlewis/fonts-s 0.2.0 -gmlewis/fonts-t 0.2.0 -gmlewis/fonts-u 0.2.0 -gmlewis/fonts-v 0.2.0 -gmlewis/fonts-w 0.2.0 -gmlewis/fonts-y 0.2.0 -gmlewis/fonts-z 0.2.0 -gmlewis/gzip 0.25.0 -gmlewis/hash 0.14.0 -gmlewis/image 0.12.0 -gmlewis/io 0.16.0 -gmlewis/json 0.15.0 -gmlewis/jsonutil 0.24.0 -gmlewis/md5 0.15.0 -gmlewis/moonbit-pdk 0.44.0 -gmlewis/sha1 0.6.0 -gmlewis/sha256 0.13.0 -gmlewis/spin-moonbit-sdk 0.45.0 -gmlewis/zlib 0.14.0 -hackwaly/common 0.1.24 -hackwaly/moonyacc 0.1.11 -jankin_li/Learn_Test1 0.1.0 -jankin_li/new_lib 0.1.0 -jedisct1/aegis 0.2.1 -jumpping/baby 0.2.0 -kinoamyfx/moon-axe-tools 0.0.1-SNAPSHOT -lijunchen/unstable_io 0.1.3 -loneoutpost/core-extra 0.0.6 -lucifer1004/mooncake 0.1.0 -mizchi/js_io 0.1.1 -mizchi/js_regexp 0.0.4 -mizchi/json 0.4.0 -mizchi/protocol 0.0.5 -moonbit-courses/minimoonbit-courses 0.1.0 -moonbit-js-ffi/js 0.2.0 -moonbitlang/arduino 0.0.1 -moonbitlang/core 0.1.20241204+f941da9e9 -moonbitlang/quickcheck 0.6.9 -moonbitlang/std 0.1.0 -moonbitlang/wasm4 0.2.4 -moonbitlang/x 0.4.13 -myfreess/myers-diff 0.1.0 -oboard/mimetype 0.1.4 -oboard/mocket 0.2.0 -oboard/moonbit-eval 0.1.5 -oboard/mooncrypto 0.1.8 -oboard/moonetx 0.1.5 -oboard/numoon 0.3.2 -peter-jerry-ye/advent_of_code 0.3.1-fix -peter-jerry-ye/assertion 0.2.1 -peter-jerry-ye/canvas 0.4.0 -peter-jerry-ye/json 0.4.0 -peter-jerry-ye/memory 0.8.4 -peter-jerry-ye/parser-combinator 0.9.1 -peter-jerry-ye/utils 0.1.0 -peter-jerry-ye/wasi 0.18.0 -rami3l/cmark 0.1.5 -suiyunonghen/datetime 0.1.2 -suiyunonghen/linklist 0.1.7 -suiyunonghen/moonvalue 0.1.8 -suiyunonghen/wasmMemManager 0.1.2 -summer-boythink/moonorm 0.1.0 -tiye/cirru-edn 0.0.3 -tiye/cirru-parser 0.0.9 -tiye/dom-ffi 0.0.6 -tiye/lexicon-fractional-index 0.0.2 -tiye/respo 0.0.18 -tmkx/hello 0.0.0 -tonyfettes/memory 0.1.5 -tonyfettes/narray 0.1.0 -tonyfettes/torch 0.2.5 -wangziling/hello 0.0.1 -wstreet/moontest 0.1.0 -xunyoyo/linalg 0.2.4 -xunyoyo/permutation 0.1.3 -yamajik/dapr 0.1.5 -yamajik/wasi 0.1.22 -yamajik/wasi-bindings 0.2.1 -yangqing/hello 0.2.2 -yj-qin/regexp 0.3.2 -zxch3n/expect 0.3.1 diff --git a/src/main.rs b/src/main.rs index d085c75..b2667c4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -435,10 +435,16 @@ fn main0() -> anyhow::Result<()> { let res = match cli.subcommand { cli::MoonBuildDashBoardSubcommands::Stat(cmd) => stat(cmd), }; + #[cfg(target_os = "windows")] + let os = "windows"; + #[cfg(target_os = "linux")] + let os = "linux"; + #[cfg(target_os = "macos")] + let os = "macos"; match res { Ok(dashboard) => { let date = Local::now().format("%Y-%m-%d"); - let filename = format!("webapp/public/{}_data.jsonl.gz", date); + let filename = format!("webapp/public/{}/{}_data.jsonl.gz", os, date); let fp = std::fs::OpenOptions::new() .create(true) @@ -451,7 +457,7 @@ fn main0() -> anyhow::Result<()> { writer.flush()?; writer.into_inner()?.finish()?; - let latest_filename = "webapp/public/latest_data.jsonl.gz"; + let latest_filename = format!("webapp/public/{}/latest_data.jsonl.gz", os); std::fs::copy(&filename, latest_filename)?; Ok(()) @@ -463,10 +469,3 @@ fn main0() -> anyhow::Result<()> { fn main() -> anyhow::Result<()> { main0() } - -#[test] -fn test_main() { - use chrono::Local; - let date = Local::now().format("%Y-%m-%d"); - println!("{}", date); -} diff --git a/webapp/package.json b/webapp/package.json index b106943..4007bff 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -11,7 +11,8 @@ }, "dependencies": { "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "react-router-dom": "^7.0.2" }, "devDependencies": { "@eslint/js": "^9.9.0", diff --git a/webapp/pnpm-lock.yaml b/webapp/pnpm-lock.yaml index a49046e..35edb0b 100644 --- a/webapp/pnpm-lock.yaml +++ b/webapp/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) + react-router-dom: + specifier: ^7.0.2 + version: 7.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@eslint/js': specifier: ^9.9.0 @@ -457,6 +460,9 @@ packages: '@types/babel__traverse@7.20.6': resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} + '@types/cookie@0.6.0': + resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} + '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -653,6 +659,10 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + cookie@1.0.2: + resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==} + engines: {node: '>=18'} + cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -1131,6 +1141,23 @@ packages: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} + react-router-dom@7.0.2: + resolution: {integrity: sha512-VJOQ+CDWFDGaWdrG12Nl+d7yHtLaurNgAQZVgaIy7/Xd+DojgmYLosFfZdGz1wpxmjJIAkAMVTKWcvkx1oggAw==} + engines: {node: '>=20.0.0'} + peerDependencies: + react: '>=18' + react-dom: '>=18' + + react-router@7.0.2: + resolution: {integrity: sha512-m5AcPfTRUcjwmhBzOJGEl6Y7+Crqyju0+TgTQxoS4SO+BkWbhOrcfZNq6wSWdl2BBbJbsAoBUb8ZacOFT+/JlA==} + engines: {node: '>=20.0.0'} + peerDependencies: + react: '>=18' + react-dom: '>=18' + peerDependenciesMeta: + react-dom: + optional: true + react@18.3.1: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} @@ -1174,6 +1201,9 @@ packages: engines: {node: '>=10'} hasBin: true + set-cookie-parser@2.7.1: + resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} + shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -1259,6 +1289,9 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + turbo-stream@2.4.0: + resolution: {integrity: sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==} + type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -1698,6 +1731,8 @@ snapshots: dependencies: '@babel/types': 7.25.4 + '@types/cookie@0.6.0': {} + '@types/estree@1.0.5': {} '@types/prop-types@15.7.12': {} @@ -1922,6 +1957,8 @@ snapshots: convert-source-map@2.0.0: {} + cookie@1.0.2: {} + cross-spawn@7.0.3: dependencies: path-key: 3.1.1 @@ -2361,6 +2398,22 @@ snapshots: react-refresh@0.14.2: {} + react-router-dom@7.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-router: 7.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + + react-router@7.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + '@types/cookie': 0.6.0 + cookie: 1.0.2 + react: 18.3.1 + set-cookie-parser: 2.7.1 + turbo-stream: 2.4.0 + optionalDependencies: + react-dom: 18.3.1(react@18.3.1) + react@18.3.1: dependencies: loose-envify: 1.4.0 @@ -2417,6 +2470,8 @@ snapshots: semver@7.6.3: {} + set-cookie-parser@2.7.1: {} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 @@ -2518,6 +2573,8 @@ snapshots: ts-interface-checker@0.1.13: {} + turbo-stream@2.4.0: {} + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 diff --git a/webapp/public/2024-11-29_data.jsonl.gz b/webapp/public/linux/2024-11-29_data.jsonl.gz similarity index 100% rename from webapp/public/2024-11-29_data.jsonl.gz rename to webapp/public/linux/2024-11-29_data.jsonl.gz diff --git a/webapp/public/latest_data.jsonl.gz b/webapp/public/linux/latest_data.jsonl.gz similarity index 100% rename from webapp/public/latest_data.jsonl.gz rename to webapp/public/linux/latest_data.jsonl.gz diff --git a/webapp/public/mac/2024-11-29_data.jsonl.gz b/webapp/public/mac/2024-11-29_data.jsonl.gz new file mode 100644 index 0000000..d7ad643 Binary files /dev/null and b/webapp/public/mac/2024-11-29_data.jsonl.gz differ diff --git a/webapp/public/2024-11-30_data.jsonl.gz b/webapp/public/mac/2024-11-30_data.jsonl.gz similarity index 100% rename from webapp/public/2024-11-30_data.jsonl.gz rename to webapp/public/mac/2024-11-30_data.jsonl.gz diff --git a/webapp/public/2024-12-01_data.jsonl.gz b/webapp/public/mac/2024-12-01_data.jsonl.gz similarity index 100% rename from webapp/public/2024-12-01_data.jsonl.gz rename to webapp/public/mac/2024-12-01_data.jsonl.gz diff --git a/webapp/public/2024-12-02_data.jsonl.gz b/webapp/public/mac/2024-12-02_data.jsonl.gz similarity index 100% rename from webapp/public/2024-12-02_data.jsonl.gz rename to webapp/public/mac/2024-12-02_data.jsonl.gz diff --git a/webapp/public/2024-12-03_data.jsonl.gz b/webapp/public/mac/2024-12-03_data.jsonl.gz similarity index 100% rename from webapp/public/2024-12-03_data.jsonl.gz rename to webapp/public/mac/2024-12-03_data.jsonl.gz diff --git a/webapp/public/2024-12-04_data.jsonl.gz b/webapp/public/mac/2024-12-04_data.jsonl.gz similarity index 100% rename from webapp/public/2024-12-04_data.jsonl.gz rename to webapp/public/mac/2024-12-04_data.jsonl.gz diff --git a/webapp/public/2024-12-05_data.jsonl.gz b/webapp/public/mac/2024-12-05_data.jsonl.gz similarity index 100% rename from webapp/public/2024-12-05_data.jsonl.gz rename to webapp/public/mac/2024-12-05_data.jsonl.gz diff --git a/webapp/public/data.jsonl b/webapp/public/mac/data.jsonl similarity index 100% rename from webapp/public/data.jsonl rename to webapp/public/mac/data.jsonl diff --git a/webapp/public/mac/latest_data.jsonl.gz b/webapp/public/mac/latest_data.jsonl.gz new file mode 100644 index 0000000..b64cef1 Binary files /dev/null and b/webapp/public/mac/latest_data.jsonl.gz differ diff --git a/webapp/public/windows/2024-11-29_data.jsonl.gz b/webapp/public/windows/2024-11-29_data.jsonl.gz new file mode 100644 index 0000000..d7ad643 Binary files /dev/null and b/webapp/public/windows/2024-11-29_data.jsonl.gz differ diff --git a/webapp/public/windows/latest_data.jsonl.gz b/webapp/public/windows/latest_data.jsonl.gz new file mode 100644 index 0000000..b64cef1 Binary files /dev/null and b/webapp/public/windows/latest_data.jsonl.gz differ diff --git a/webapp/src/App.tsx b/webapp/src/App.tsx index 1ec4647..73ba92a 100644 --- a/webapp/src/App.tsx +++ b/webapp/src/App.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useEffect, useState, Fragment } from "react"; type MooncakeSource = | { MooncakesIO: { name: string; version: string[]; index: number } } @@ -50,8 +50,16 @@ interface BuildState { cbts: (CBT | null)[]; } -async function get_data(): Promise { - const response = await fetch('/latest_data.jsonl.gz', { +type Platform = "mac" | "windows" | "linux"; + +interface PlatformData { + mac: MoonBuildDashboard | null; + windows: MoonBuildDashboard | null; + linux: MoonBuildDashboard | null; +} + +async function get_data(platform: Platform): Promise { + const response = await fetch(`/${platform}/latest_data.jsonl.gz`, { headers: { 'Accept-Encoding': 'gzip' } @@ -140,16 +148,29 @@ const DetailModal: React.FC = ({ isOpen, onClose, data, title }) => }; const App = () => { - const [data, setData] = useState(null); + const [platformData, setPlatformData] = useState({ + mac: null, + windows: null, + linux: null + }); const [error, setError] = useState(null); const [selectedData, setSelectedData] = useState(null); const [modalTitle, setModalTitle] = useState(""); const [isModalOpen, setIsModalOpen] = useState(false); + const [expandedItems, setExpandedItems] = useState>(new Set()); const fetchData = async () => { try { - const parsedData = await get_data(); - setData(parsedData); + const [macData, windowsData, linuxData] = await Promise.all([ + get_data("mac"), + get_data("windows"), + get_data("linux") + ]); + setPlatformData({ + mac: macData, + windows: windowsData, + linux: linuxData + }); } catch (err) { if (err instanceof Error) { setError(err.message); @@ -169,6 +190,22 @@ const App = () => { setIsModalOpen(true); }; + const handleExpandToggle = (index: number) => { + const newExpandedItems = new Set(expandedItems); + if (expandedItems.has(index)) { + newExpandedItems.delete(index); + } else { + newExpandedItems.add(index); + } + setExpandedItems(newExpandedItems); + }; + + const handleExpandAll = () => { + if (!platformData.mac) return; + const allIndices = new Set(platformData.mac.stable_release_data.map((_, index) => index)); + setExpandedItems(expandedItems.size === allIndices.size ? new Set() : allIndices); + }; + const renderBackendState = ( backendState: BackendState, phase: string, @@ -215,131 +252,163 @@ const App = () => { ); }; - const renderTableRows = ( - stableData: BuildState[], - bleedingData: BuildState[], - sources: MooncakeSource[] - ) => { - return stableData.map((stableEntry, index) => { - const source = sources[stableEntry.source]; - const isGit = "Git" in source; - const versions = isGit ? source.Git.rev : source.MooncakesIO.version; - const rowSpan = versions.length; // Number of versions determines the row span - - return versions.map((_, versionIndex) => { - const bleedingEntry = bleedingData[index]; - const stableCBT = stableEntry.cbts[versionIndex]; - const bleedingCBT = bleedingEntry?.cbts[versionIndex]; - - return ( - - {/* Only display the source name in the first row */} - {versionIndex === 0 && ( - - {isGit ? ( - <> - - - {source.Git.url.replace("https://github.com/", "")} - - - ) : ( - - {source.MooncakesIO.name} - - )} + const renderAllPlatformsData = () => { + if (!platformData.mac || !platformData.windows || !platformData.linux) { + return null; + } + + return platformData.mac.stable_release_data.map((_, index) => { + const platforms: Platform[] = ["mac", "windows", "linux"]; + + return platforms.map(platform => { + const data = platformData[platform]; + if (!data) return null; + + if (platform !== "mac" && !expandedItems.has(index)) { + return null; + } + + const stableEntry = data.stable_release_data[index]; + const bleedingEntry = data.bleeding_release_data[index]; + if (!stableEntry) return null; + + const source = data.sources[stableEntry.source]; + const isGit = "Git" in source; + const versions = isGit ? source.Git.rev : source.MooncakesIO.version; + + return versions.map((version, versionIndex) => { + const stableCBT = stableEntry.cbts[versionIndex]; + const bleedingCBT = bleedingEntry?.cbts[versionIndex]; + + const rowSpan = expandedItems.has(index) ? versions.length * 3 : versions.length; + + return ( + + {versionIndex === 0 && platform === "mac" && ( + + +
+ + {isGit ? ( + + + + {source.Git.url.replace("https://github.com/", "")} + + + ) : ( + + {source.MooncakesIO.name} + + )} +
+ + + {isGit ? ( + + {version} + + ) : ( + version + )} + +
+ )} + +
+ {platform.charAt(0).toUpperCase() + platform.slice(1)} +
- )} - {/* Display the version without a link if it is MooncakesIO */} - - {isGit ? ( - - {versions[versionIndex]} - + + {stableCBT ? ( + + {renderBackendState(stableCBT.check, "Check", 'stable')} + {renderBackendState(stableCBT.build, "Build", 'stable')} + {renderBackendState(stableCBT.test, "Test", 'stable')} + ) : ( - versions[versionIndex] + + No stable data available + )} - - - {/* Stable Data */} - {stableCBT ? ( - <> - {renderBackendState(stableCBT.check, "Check", 'stable')} - {renderBackendState(stableCBT.build, "Build", 'stable')} - {renderBackendState(stableCBT.test, "Test", 'stable')} - - ) : ( - - No stable data available - - )} - - {/* Bleeding Data */} - {bleedingCBT ? ( - <> - {renderBackendState(bleedingCBT.check, "Check", 'bleeding', stableCBT)} - {renderBackendState(bleedingCBT.build, "Build", 'bleeding', stableCBT)} - {renderBackendState(bleedingCBT.test, "Test", 'bleeding', stableCBT)} - - ) : ( - - No bleeding data available - - )} - - ); + + {bleedingCBT ? ( + + {renderBackendState(bleedingCBT.check, "Check", 'bleeding', stableCBT)} + {renderBackendState(bleedingCBT.build, "Build", 'bleeding', stableCBT)} + {renderBackendState(bleedingCBT.test, "Test", 'bleeding', stableCBT)} + + ) : ( + + No bleeding data available + + )} + + ); + }); }); - }); + }).flat(3).filter(Boolean); }; - + return (
-

Moon Build Dashboard

- +
+

Moon Build Dashboard

+ +
{error ? (

{error}

- ) : data ? ( + ) : platformData.mac ? (
+ - @@ -373,7 +442,7 @@ const App = () => { - {renderTableRows(data.stable_release_data, data.bleeding_release_data, data.sources)} + {renderAllPlatformsData()}
Repository VersionPlatform Stable Release
- {data.stable_toolchain_version.moon_version} / moonc {data.stable_toolchain_version.moonc_version} + {platformData.mac.stable_toolchain_version.moon_version} / moonc {platformData.mac.stable_toolchain_version.moonc_version}
- - ⚡️ - + + ⚡️ Bleeding Edge Release
- {data.bleeding_toolchain_version.moon_version} / moonc {data.bleeding_toolchain_version.moonc_version} + {platformData.mac.bleeding_toolchain_version.moon_version} / moonc {platformData.mac.bleeding_toolchain_version.moonc_version}
diff --git a/webapp/vite.config.ts b/webapp/vite.config.ts index 5a33944..5aec41d 100644 --- a/webapp/vite.config.ts +++ b/webapp/vite.config.ts @@ -1,7 +1,28 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' -// https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + base: '/', + publicDir: 'public', + server: { + proxy: { + '/mac/latest_data.jsonl.gz': { + target: 'http://localhost:8080', + changeOrigin: true, + }, + '/windows/latest_data.jsonl.gz': { + target: 'http://localhost:8080', + changeOrigin: true, + }, + '/linux/latest_data.jsonl.gz': { + target: 'http://localhost:8080', + changeOrigin: true, + } + } + }, + build: { + outDir: 'dist', + assetsDir: 'assets', + } })