Add new Repositories plugin (#431) [skip ci]

This commit is contained in:
Simon Lecoq
2021-07-30 23:05:27 +02:00
committed by GitHub
parent 88f9e1a41f
commit 012748529f
9 changed files with 251 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
/**Mocked data */
export default function({faker, query, login = faker.internet.userName()}) {
console.debug("metrics/compute/mocks > mocking graphql api result > stars/default")
return ({
repository:{
createdAt: faker.date.past(),
description:"📊 An image generator with 20+ metrics about your GitHub account such as activity, community, repositories, coding habits, website performances, music played, starred topics, etc. that you can put on your profile or elsewhere !",
forkCount:faker.datatype.number(100),
isFork:false,
issues:{
totalCount:faker.datatype.number(100),
},
nameWithOwner:"lowlighter/metrics",
openGraphImageUrl:"https://repository-images.githubusercontent.com/293860197/7fd72080-496d-11eb-8fe0-238b38a0746a",
pullRequests:{
totalCount:faker.datatype.number(100),
},
stargazerCount:faker.datatype.number(10000),
licenseInfo:{
nickname:null,
name:"MIT License",
},
primaryLanguage:{
color:"#f1e05a",
name:"JavaScript",
},
},
})
}

View File

@@ -678,7 +678,31 @@
},
})
: null),
//Stars
//Repositories
...(set.plugins.enabled.repositories
? ({
repositories: {
list: new Array(Number(options["repositories.featured"].split(",").length) - 1).fill(null).map((_, i) => ({
created: faker.date.past(),
description: faker.lorem.sentence(),
forkCount: faker.datatype.number(100),
isFork: faker.datatype.boolean(),
issues: {
totalCount: faker.datatype.number(100),
},
nameWithOwner: `${faker.random.word()}/${faker.random.word()}`,
openGraphImageUrl: faker.internet.url(),
pullRequests: {
totalCount: faker.datatype.number(100),
},
stargazerCount: faker.datatype.number(10000),
licenseInfo: { nickname: null, name: "License" },
primaryLanguage: { color: faker.internet.color(), name: faker.lorem.word() },
})),
},
})
: null),
//Stargazers
...(set.plugins.enabled.stargazers
? ({
get stargazers() {