Skip to content

Commit 8a27206

Browse files
authored
remove README and Travis config request (#45)
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
1 parent 166c666 commit 8a27206

6 files changed

Lines changed: 1 addition & 86 deletions

File tree

lib/db/build-index.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -112,26 +112,6 @@ async function * loadProject (octokit, graphQL, project, config, _repo) {
112112
}
113113
}
114114

115-
try {
116-
yield projectDetail(
117-
'README',
118-
project,
119-
await github.getReadme(graphQL, project.repoOwner, project.repoName, project.primaryBranch)
120-
)
121-
} catch (e) {
122-
yield projectDetail('ERROR', project, e)
123-
}
124-
125-
try {
126-
yield projectDetail(
127-
'TRAVIS',
128-
project,
129-
await files.getTravisConfig(project)
130-
)
131-
} catch (e) {
132-
yield projectDetail('ERROR', project, e)
133-
}
134-
135115
try {
136116
for await (const issue of github.getRepoIssues(graphQL, project.repoOwner, project.repoName)) {
137117
yield projectDetail('ISSUE', project, issue)

lib/files.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
const yaml = require('js-yaml')
32
const GHRAW = 'https://raw.githubusercontent.com/'
43

54
module.exports.getPackageJson = async function getPackageJson (project) {
@@ -12,15 +11,3 @@ module.exports.getPackageJson = async function getPackageJson (project) {
1211
}
1312
return resp.json()
1413
}
15-
16-
module.exports.getTravisConfig = async function getTravisConfig (project) {
17-
const resp = await fetch(`${GHRAW}${project.repoOwner}/${project.repoName}/${project.repoBranch}${project.repoDirectory}.travis.yml`)
18-
if (resp.status !== 200) {
19-
const e = new Error(`Non-200 Response: ${resp.status}`)
20-
e.status = resp.status
21-
e.body = await resp.text()
22-
throw e
23-
}
24-
const travisTxt = await resp.text()
25-
return yaml.safeLoad(travisTxt)
26-
}

lib/github.js

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -343,47 +343,6 @@ async function * getRepoActivity (octokit, owner, repo) {
343343
}
344344
}
345345

346-
module.exports.getReadme =
347-
async function getReadme (graphQL, owner, repo) {
348-
try {
349-
const resp = await graphQL({
350-
query: ` query($org: String!, $repo: String!) {
351-
repository(name: $repo, owner: $org) {
352-
object(expression: "master:README.md") {
353-
... on Blob {
354-
text
355-
}
356-
}
357-
altLower: object(expression: "master:readme.md") {
358-
... on Blob {
359-
text
360-
}
361-
}
362-
altUpper: object(expression: "master:Readme.md") {
363-
... on Blob {
364-
text
365-
}
366-
}
367-
}
368-
}
369-
`,
370-
org: owner,
371-
repo
372-
})
373-
let readmeText
374-
Object.values(resp.repository).forEach(element => {
375-
if (element !== null) {
376-
readmeText = element.text
377-
}
378-
})
379-
return readmeText
380-
} catch (error) {
381-
error.code = 'GET_README_FAILED'
382-
Error.captureStackTrace(error, module.exports.getReadme)
383-
throw error
384-
}
385-
}
386-
387346
async function getRemainingRepos (graphQL, org, cursor) {
388347
try {
389348
const resp = await graphQL({

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"fs-extra": "^8.1.0",
5151
"inquirer": "^12.4.2",
5252
"install": "^0.13.0",
53-
"js-yaml": "^3.13.1",
5453
"level": "^5.0.1",
5554
"lit-element": "^2.2.1",
5655
"nighthawk": "^2.3.0-1",

template/indicies.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
module.exports = {
44
projects: async (data, config, key, { type, project, detail }) => {
5-
if (!['REPO', 'PACKAGE_JSON', 'PACKUMENT', 'TRAVIS'].includes(type)) {
5+
if (!['REPO', 'PACKAGE_JSON', 'PACKUMENT'].includes(type)) {
66
return data
77
}
88

99
data = data || []
1010
const existing = data.find((p) => p.repo === project.repo)
1111
const proj = existing || { ...project }
1212
switch (type) {
13-
case 'TRAVIS':
14-
proj.travis = detail
15-
break
1613
case 'PACKAGE_JSON':
1714
proj.packageJson = detail
1815
break

template/js/project-list.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ class ProjectList extends LitElement {
7171
</a>
7272
`)}
7373
</td>
74-
<td>
75-
${project.travis && (html`
76-
<a href="https://travis-ci.org/${project.repo}">
77-
<img src="https://badgen.net/travis/${project.repo}" />
78-
</a>
79-
`)}
80-
</td>
8174
</tr>
8275
`)}
8376
</table>

0 commit comments

Comments
 (0)