@@ -7,7 +7,8 @@ import { writeFile, copyFile } from "fs/promises";
77import { resolve } from "path" ;
88import { blacklistJSONstringify } from "../../data/blacklist" ;
99import { changelogJSONstringify } from "../../data/changelog" ;
10-
10+ import repositories from "../../../meta/repositories.json" ;
11+ import { time } from "console" ;
1112
1213export const shared = defineConfig ( {
1314 vite : {
@@ -54,7 +55,21 @@ export const shared = defineConfig({
5455 const publicBlackList = resolve ( publicApi , "blacklist.json" ) ;
5556 const publicChangelogList = resolve ( publicApi , "changelog.json" ) ;
5657
57- await copyFile ( resolve ( __dirname , "../../../meta/repositories.json" ) , publicRepoList ) ;
58+ const newRepositories = repositories . map ( async ( repo ) => {
59+ const response = await ( await fetch ( `${ repo . url } json/modules.json` ) ) . json ( ) ;
60+ const modulesCount = response . modules . length ;
61+
62+ return {
63+ ...repo ,
64+ modules_count : modulesCount ,
65+ submission : response . submission ,
66+ cover : response . cover ,
67+ timestamp : response . metadata . timestamp ,
68+ description : response . description ,
69+ } ;
70+ } ) ;
71+
72+ await writeFile ( publicRepoList , JSON . stringify ( await Promise . all ( newRepositories ) , null , 4 ) ) ;
5873 await writeFile ( publicBlackList , blacklistJSONstringify ) ;
5974 await writeFile ( publicChangelogList , changelogJSONstringify ) ;
6075 } ,
0 commit comments