diff --git a/.gitignore b/.gitignore index fce6773..baf2aa8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ node_modules dist mock.ts +mock.js build .vscode .idea diff --git a/README.md b/README.md index 6696ad6..70f737a 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ export default { ![](repos/vuejs-translations/docs-zh-cn.svg) -

:point_up: :point_up: :point_up: ↑↑↑↑↑↑ :point_up: :point_up: :point_up: :point_up:

+

:point_up: :point_up: :point_up: ↑↑↑↑↑↑ :point_up: :point_up: :point_up:

in `config.js`: diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 08908ed..a51b7a6 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -1,5 +1,5 @@ // Generated by 'unplugin-auto-import' export {} declare global { - + const ElNotification: typeof import('element-plus/es')['ElNotification'] } diff --git a/dev.md b/dev.md index 0b8bbad..886818d 100644 --- a/dev.md +++ b/dev.md @@ -6,3 +6,246 @@ - d - Number of deletions - c - Number of commits ``` + + +### 对 vuejs-translation/docs-zh-cn 数据处理 + +```js +const contributors = { + CONTRIBUTOR: { + jiacongluo: { + total: 2, + login: 'jiacongluo', + number: 477, + id: 43315267, + avatar_url: 'https://avatars.githubusercontent.com/u/43315267?v=4' + }, + chunjin666: { + total: 1, + login: 'chunjin666', + number: 476, + id: 4099685, + avatar_url: 'https://avatars.githubusercontent.com/u/4099685?v=4' + }, + sxzz: { + total: 1, + login: 'sxzz', + number: 472, + id: 6481596, + avatar_url: 'https://avatars.githubusercontent.com/u/6481596?v=4' + }, + Duanxs: { + total: 1, + login: 'Duanxs', + number: 471, + id: 10006810, + avatar_url: 'https://avatars.githubusercontent.com/u/10006810?v=4' + }, + awxiaoxian2020: { + total: 1, + login: 'awxiaoxian2020', + number: 470, + id: 69554233, + avatar_url: 'https://avatars.githubusercontent.com/u/69554233?v=4' + }, + KiritaniAyaka: { + total: 10, + login: 'KiritaniAyaka', + number: 469, + id: 26200808, + avatar_url: 'https://avatars.githubusercontent.com/u/26200808?v=4' + }, + HyattXt: { + total: 1, + login: 'HyattXt', + number: 468, + id: 89585280, + avatar_url: 'https://avatars.githubusercontent.com/u/89585280?v=4' + }, + BruceYuj: { + total: 1, + login: 'BruceYuj', + number: 467, + id: 19621739, + avatar_url: 'https://avatars.githubusercontent.com/u/19621739?v=4' + }, + inc904: { + total: 1, + login: 'inc904', + number: 462, + id: 40587817, + avatar_url: 'https://avatars.githubusercontent.com/u/40587817?v=4' + }, + // 这是一个 author_association: 'MEMBER', + wxsms: { + total: 8, + login: 'wxsms', + number: 460, + id: 5960988, + avatar_url: 'https://avatars.githubusercontent.com/u/5960988?v=4' + }, + itsyuxuan: { + total: 2, + login: 'itsyuxuan', + number: 458, + id: 62364938, + avatar_url: 'https://avatars.githubusercontent.com/u/62364938?v=4' + }, + ch1lam: { + total: 2, + login: 'ch1lam', + number: 455, + id: 39334548, + avatar_url: 'https://avatars.githubusercontent.com/u/39334548?v=4' + }, + KimYangOfCat: { + total: 1, + login: 'KimYangOfCat', + number: 453, + id: 32960305, + avatar_url: 'https://avatars.githubusercontent.com/u/32960305?v=4' + }, + bigyifeng: { + total: 1, + login: 'bigyifeng', + number: 451, + id: 66539215, + avatar_url: 'https://avatars.githubusercontent.com/u/66539215?v=4' + }, + linxiang07: { + total: 1, + login: 'linxiang07', + number: 447, + id: 40119767, + avatar_url: 'https://avatars.githubusercontent.com/u/40119767?v=4' + }, + xfq: { + total: 5, + login: 'xfq', + number: 445, + id: 2863444, + avatar_url: 'https://avatars.githubusercontent.com/u/2863444?v=4' + }, + iamxiyang: { + total: 1, + login: 'iamxiyang', + number: 442, + id: 40079272, + avatar_url: 'https://avatars.githubusercontent.com/u/40079272?v=4' + }, + btea: { + total: 1, + login: 'btea', + number: 437, + id: 24516654, + avatar_url: 'https://avatars.githubusercontent.com/u/24516654?v=4' + }, + earthaYan: { + total: 3, + login: 'earthaYan', + number: 406, + id: 25888900, + avatar_url: 'https://avatars.githubusercontent.com/u/25888900?v=4' + }, + Justineo: { + total: 1, + login: 'Justineo', + number: 387, + id: 1726061, + avatar_url: 'https://avatars.githubusercontent.com/u/1726061?v=4' + }, + pakchoily: { + total: 3, + login: 'pakchoily', + number: 385, + id: 59410698, + avatar_url: 'https://avatars.githubusercontent.com/u/59410698?v=4' + }, + SkyeYoung: { + total: 2, + login: 'SkyeYoung', + number: 383, + id: 48400568, + avatar_url: 'https://avatars.githubusercontent.com/u/48400568?v=4' + }, + 'Mister-Hope': { + total: 5, + login: 'Mister-Hope', + number: 382, + id: 33315834, + avatar_url: 'https://avatars.githubusercontent.com/u/33315834?v=4' + }, + 'donggua-nor': { + total: 1, + login: 'donggua-nor', + number: 367, + id: 37831399, + avatar_url: 'https://avatars.githubusercontent.com/u/37831399?v=4' + }, + byog: { + total: 6, + login: 'byog', + number: 365, + id: 7764115, + avatar_url: 'https://avatars.githubusercontent.com/u/7764115?v=4' + }, + ice2shell: { + total: 1, + login: 'ice2shell', + number: 357, + id: 43178043, + avatar_url: 'https://avatars.githubusercontent.com/u/43178043?v=4' + }, + lyking90: { + total: 1, + login: 'lyking90', + number: 354, + id: 56106787, + avatar_url: 'https://avatars.githubusercontent.com/u/56106787?v=4' + }, + watonyweng: { + total: 2, + login: 'watonyweng', + number: 348, + id: 2574065, + avatar_url: 'https://avatars.githubusercontent.com/u/2574065?v=4' + }, + Argun: { + total: 1, + login: 'Argun', + number: 347, + id: 1279340, + avatar_url: 'https://avatars.githubusercontent.com/u/1279340?v=4' + }, + hezhongfeng: { + total: 1, + login: 'hezhongfeng', + id: 40707695, + avatar_url: 'https://avatars.githubusercontent.com/u/40707695?v=4' + }, + baixiaoyu2997: { + total: 1, + login: 'baixiaoyu2997', + number: 338, + id: 9149999, + avatar_url: 'https://avatars.githubusercontent.com/u/9149999?v=4' + }, + dboooo: { + total: 1, + login: 'dboooo', + number: 335, + id: 72451061, + avatar_url: 'https://avatars.githubusercontent.com/u/72451061?v=4' + } + }, + MEMBER: { + Jinjiang: { + total: 26, + login: 'Jinjiang', + number: 450, + id: 206848, + avatar_url: 'https://avatars.githubusercontent.com/u/206848?v=4' + } + } +} +``` \ No newline at end of file diff --git a/public/home.png b/public/home.png index 202b94a..c99785f 100644 Binary files a/public/home.png and b/public/home.png differ diff --git a/src/components/DisplaySVG.vue b/src/components/DisplaySVG.vue index 3b16a2c..3cd72c6 100644 --- a/src/components/DisplaySVG.vue +++ b/src/components/DisplaySVG.vue @@ -43,6 +43,7 @@ const onSearch = () => { return } getGithubContributors(`${owner}/${repo}`) + // test(`${owner}/${repo}`) } // TODO 有些迟滞 @@ -71,6 +72,13 @@ const init = async () => { isNoFountSearchRepo.value = false isNoContributors.value = false } + +const test = async ( repoKey: string) => { + const cleanData = getTotalList(defaultSort, defaultRepoConfig.value) + await generate(searchRepo, defaultRepoConfig, cleanData) +} + +// for get contributors api const getGithubContributors = async (repoKey: string) => { // TODO test // await generate(searchRepo.value, defaultRepoConfig.value, sortList.slice(0, 60))// .slice(0,20) @@ -83,7 +91,7 @@ const getGithubContributors = async (repoKey: string) => { contributorList.value = resp const sortTotalList = sortBy(resp, (o) => -o.total); originData.value = sortTotalList - const cleanData = getTotalList(sortTotalList, defaultRepoConfig) + const cleanData = getTotalList(sortTotalList, defaultRepoConfig.value) await generate(searchRepo, defaultRepoConfig, cleanData) } else { @@ -106,6 +114,11 @@ const getGithubContributors = async (repoKey: string) => { } } +// TODO for has upstream repo, like vuejs-translations/docs-zh-cn +const getContributorsForPulls = async ()=>{ + +} + const generate = async (repo: string, userConfig: UserConfig, contributors: UserItem[]) => { console.time('generate time'); svgData.value = await generateUserListSVG(contributors, userConfig) diff --git a/src/pages/Home.vue b/src/pages/Home.vue index a4b9453..4aab097 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -18,7 +18,7 @@ provide('defaultRepo', {defaultRepo, defaultRepoConfig, setDefaultRepo}) @@ -61,4 +61,7 @@ provide('defaultRepo', {defaultRepo, defaultRepoConfig, setDefaultRepo}) background-image: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff); filter: var(--vp-home-hero-image-filter); } +.el-footer{ + background: #1e1e1e; +}