Skip to content

Commit cf87090

Browse files
committed
added consistent order within versions
1 parent af9ba37 commit cf87090

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rollup/build_pyodide_graph.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const pyodideURL = (version = 'stable') => `https://pyodide.org/en/${version}/us
1414
const semver = value => value.split('.').map(i => parseInt(i, 10));
1515
const [bmaj, bmin] = semver(IGNORE_BELOW);
1616

17-
const json = existsSync(pyodideGraph) ? JSON.parse(readFileSync(pyodideGraph)) : {};
17+
let json = existsSync(pyodideGraph) ? JSON.parse(readFileSync(pyodideGraph)) : {};
1818

1919
(async () => {
2020
// prevent useless fetching of Pyodide site
@@ -24,6 +24,9 @@ const json = existsSync(pyodideGraph) ? JSON.parse(readFileSync(pyodideGraph)) :
2424
return;
2525
}
2626

27+
delete json.latest;
28+
delete json.stable;
29+
2730
const browser = await chromium.launch(); // Or 'firefox' or 'webkit'.
2831
const page = await browser.newPage();
2932
await page.goto(pyodideURL());
@@ -64,6 +67,13 @@ const json = existsSync(pyodideGraph) ? JSON.parse(readFileSync(pyodideGraph)) :
6467
}
6568
}
6669
await browser.close();
70+
71+
const ordered = {};
72+
for (const version of versions)
73+
ordered[version] = json[version];
74+
75+
json = ordered;
76+
6777
// save content as readable JSON and get out
6878
writeFileSync(join(__dirname, 'pyodide_graph.json'), JSON.stringify(json, null, '\t'));
6979
})();

0 commit comments

Comments
 (0)