Skip to content

Commit 930cfed

Browse files
authored
deps: upgrade mocha and standard (#28)
* deps: upgrade mocha and standard * deps: remove serve
1 parent 22418fc commit 930cfed

File tree

9 files changed

+65
-42
lines changed

9 files changed

+65
-42
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,43 @@ on:
99
- main
1010

1111
concurrency:
12-
group: "test"
12+
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
1313
cancel-in-progress: false
1414

1515
jobs:
16+
lint:
17+
name: Lint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 'lts/*'
25+
26+
- name: Install dependencies
27+
run: npm install --ignore-scripts --only=dev
28+
29+
- name: Run lint
30+
run: npm run lint
31+
1632
test:
1733
runs-on: ubuntu-latest
1834
strategy:
1935
matrix:
2036
node-version: [18, 19, 20, 21, 22, 23]
2137
steps:
2238
- uses: actions/checkout@v4
39+
2340
- name: Use Node.js ${{ matrix.node-version }}
2441
uses: actions/setup-node@v4
2542
with:
2643
node-version: ${{ matrix.node-version }}
27-
- name: npm install and test
44+
45+
- name: Install dependencies
46+
run: npm install
47+
48+
- name: Run tests
2849
env:
2950
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
run: npm it
51+
run: npm test

lib/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const DEFAULTS = {
1616
baseUrl: '',
1717
port: 5005,
1818
template: builder,
19-
indicies: indicies,
19+
indicies,
2020
title: 'StatusBoard',
2121
description: 'Project StatusBoard',
2222
issueLabels: ['top priority', 'good first issue', 'help wanted', 'discussion', 'meeting']

lib/db/build-index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const { Project } = require('../project')
66

77
module.exports = async function buildIndex (config, db) {
88
// Loop projects
9-
for await (let evt of iterateProjects(config)) {
10-
let { type, project, detail } = evt
9+
for await (const evt of iterateProjects(config)) {
10+
const { type, project, detail } = evt
1111
let key = `${project.repoOwner}:${project.repoName}:${type}`
1212
switch (type) {
1313
case 'ISSUE':
@@ -32,21 +32,21 @@ async function * iterateProjects (config) {
3232
const [octokit, graphQL] = await github(config.github)
3333

3434
// Load projects
35-
for (let proj of config.projects) {
36-
for await (let evt of loadProject(octokit, graphQL, proj, config)) {
35+
for (const proj of config.projects) {
36+
for await (const evt of loadProject(octokit, graphQL, proj, config)) {
3737
yield evt
3838
}
3939
}
4040

4141
// Load projects for org
42-
for (let org of config.orgs) {
42+
for (const org of config.orgs) {
4343
try {
44-
for await (let repo of github.getOrgRepos(graphQL, org.name)) {
44+
for await (const repo of github.getOrgRepos(graphQL, org.name)) {
4545
const proj = new Project({
4646
repoOwner: repo.owner,
4747
repoName: repo.name
4848
})
49-
for await (let evt of loadProject(octokit, graphQL, proj, config, repo)) {
49+
for await (const evt of loadProject(octokit, graphQL, proj, config, repo)) {
5050
yield evt
5151
}
5252
}
@@ -130,23 +130,23 @@ async function * loadProject (octokit, graphQL, project, config, _repo) {
130130
}
131131

132132
try {
133-
for await (let issue of github.getRepoIssues(graphQL, project.repoOwner, project.repoName)) {
133+
for await (const issue of github.getRepoIssues(graphQL, project.repoOwner, project.repoName)) {
134134
yield projectDetail('ISSUE', project, issue)
135135
}
136136
} catch (e) {
137137
yield projectDetail('ERROR', project, e)
138138
}
139139

140140
try {
141-
for await (let activity of github.getRepoActivity(octokit, project.repoOwner, project.repoName)) {
141+
for await (const activity of github.getRepoActivity(octokit, project.repoOwner, project.repoName)) {
142142
yield projectDetail('ACTIVITY', project, activity)
143143
}
144144
} catch (e) {
145145
yield projectDetail('ERROR', project, e)
146146
}
147147

148148
try {
149-
for await (let commit of github.getRepoCommits(graphQL, project.repoOwner, project.repoName)) {
149+
for await (const commit of github.getRepoCommits(graphQL, project.repoOwner, project.repoName)) {
150150
yield projectDetail('COMMIT', project, commit)
151151
}
152152
} catch (e) {

lib/github.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ module.exports.getRepo =
148148
${repoQuerySnip}
149149
}`,
150150
org: owner,
151-
repo: repo
151+
repo
152152
})
153153
return new Repo(owner, resp.repository)
154154
} catch (error) {
@@ -206,8 +206,8 @@ async function getRemainingPullRequests (graphQL, owner, repo, cursor) {
206206
}
207207
`,
208208
org: owner,
209-
repo: repo,
210-
cursor: cursor
209+
repo,
210+
cursor
211211
})
212212
const { pageInfo, edges } = resp.organization.repository.pullRequests
213213
const pullRequests = !pageInfo.hasNextPage ? edges : edges.concat(await getRemainingPullRequests(graphQL, owner, repo, pageInfo.endCursor))
@@ -232,7 +232,7 @@ async function getPullRequests (graphQL, owner, repo) {
232232
}
233233
}`,
234234
org: owner,
235-
repo: repo
235+
repo
236236
})
237237
const { pageInfo, edges } = resp.organization.repository.pullRequests
238238
const pullRequests = !pageInfo.hasNextPage ? edges : edges.concat(await getRemainingPullRequests(graphQL, owner, repo, pageInfo.endCursor))
@@ -258,8 +258,8 @@ async function getRemainingIssues (graphQL, owner, repo, cursor) {
258258
}
259259
`,
260260
org: owner,
261-
repo: repo,
262-
cursor: cursor
261+
repo,
262+
cursor
263263
})
264264
const { pageInfo, edges } = resp.organization.repository.issues
265265
const issues = !pageInfo.hasNextPage ? edges : edges.concat(await getRemainingIssues(graphQL, owner, repo, pageInfo.endCursor))
@@ -274,7 +274,7 @@ async function getRemainingIssues (graphQL, owner, repo, cursor) {
274274
module.exports.getRepoIssues =
275275
async function * getRepoIssues (graphQL, owner, repo) {
276276
try {
277-
let resp = await graphQL({
277+
const resp = await graphQL({
278278
query: `query ($org: String!, $repo: String!) {
279279
organization(login: $org) {
280280
repository(name: $repo) {
@@ -285,14 +285,14 @@ module.exports.getRepoIssues =
285285
}
286286
}`,
287287
org: owner,
288-
repo: repo
288+
repo
289289
})
290290
const { pageInfo, edges } = resp.organization.repository.issues
291291
const issues = !pageInfo.hasNextPage ? edges : edges.concat(await getRemainingIssues(graphQL, owner, repo, pageInfo.endCursor))
292292

293293
issues.push.apply(issues, await getPullRequests(graphQL, owner, repo))
294294

295-
for (let i of issues) {
295+
for (const i of issues) {
296296
yield new Issue(owner, repo, i.node)
297297
}
298298
} catch (error) {
@@ -333,7 +333,7 @@ async function * getRepoActivity (octokit, owner, repo) {
333333
throw e
334334
}
335335

336-
for (let a of resp.data) {
336+
for (const a of resp.data) {
337337
yield new Activity(owner, repo, a)
338338
}
339339
}
@@ -364,7 +364,7 @@ module.exports.getReadme =
364364
}
365365
`,
366366
org: owner,
367-
repo: repo
367+
repo
368368
})
369369
let readmeText
370370
Object.values(resp.repository).forEach(element => {
@@ -396,8 +396,8 @@ async function getRemainingRepos (graphQL, org, cursor) {
396396
}
397397
}
398398
}`,
399-
org: org,
400-
cursor: cursor
399+
org,
400+
cursor
401401
})
402402

403403
const { pageInfo, nodes } = resp.organization.repositories
@@ -414,7 +414,7 @@ async function getRemainingRepos (graphQL, org, cursor) {
414414
module.exports.getOrgRepos =
415415
async function * getOrgRepos (graphQL, org) {
416416
try {
417-
let resp = await graphQL({
417+
const resp = await graphQL({
418418
query: `query($org: String!)
419419
{
420420
organization(login: $org) {
@@ -428,13 +428,13 @@ module.exports.getOrgRepos =
428428
}
429429
}
430430
}`,
431-
org: org
431+
org
432432
})
433433

434434
const { pageInfo, nodes } = resp.organization.repositories
435435
const repos = !pageInfo.hasNextPage ? nodes : nodes.concat(await getRemainingRepos(graphQL, org, pageInfo.endCursor))
436436

437-
for (let r of repos) {
437+
for (const r of repos) {
438438
yield new Repo(org, r)
439439
}
440440
} catch (error) {
@@ -467,7 +467,7 @@ class Commit {
467467

468468
async function getRemainingCommits (graphQL, owner, repo, cursor) {
469469
try {
470-
let resp = await graphQL({
470+
const resp = await graphQL({
471471
query: `query ($org: String!, $repo: String!, $cursor: String!) {
472472
repository(name: $repo, owner: $org) {
473473
object(expression: "master") {
@@ -501,8 +501,8 @@ async function getRemainingCommits (graphQL, owner, repo, cursor) {
501501
}
502502
`,
503503
org: owner,
504-
repo: repo,
505-
cursor: cursor
504+
repo,
505+
cursor
506506
})
507507
const { pageInfo, nodes } = resp.repository.object.history
508508
const commits = !pageInfo.hasNextPage ? nodes : nodes.concat(await getRemainingCommits(graphQL, owner, repo, pageInfo.endCursor))
@@ -517,7 +517,7 @@ async function getRemainingCommits (graphQL, owner, repo, cursor) {
517517
module.exports.getRepoCommits =
518518
async function * getRepoCommits (graphQL, owner, repo) {
519519
try {
520-
let resp = await graphQL({
520+
const resp = await graphQL({
521521
query: `query ($org: String!, $repo: String!) {
522522
repository(name: $repo, owner: $org) {
523523
object(expression: "master") {
@@ -551,12 +551,12 @@ async function * getRepoCommits (graphQL, owner, repo) {
551551
}
552552
`,
553553
org: owner,
554-
repo: repo
554+
repo
555555
})
556556
const { pageInfo, nodes } = resp.repository.object.history
557557
const commits = !pageInfo.hasNextPage ? nodes : nodes.concat(await getRemainingCommits(graphQL, owner, repo, pageInfo.endCursor))
558558

559-
for (let c of commits) {
559+
for (const c of commits) {
560560
yield new Commit(owner, repo, c)
561561
}
562562
} catch (error) {

lib/template/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = async function (config, db) {
66
const accumulator = {}
77

88
// Read full index
9-
for await (let { key, value } of readFullIndex(db)) {
9+
for await (const { key, value } of readFullIndex(db)) {
1010
await Promise.all(Object.keys(indicies).map(async (index) => {
1111
accumulator[index] = await indicies[index](accumulator[index], config, key, value)
1212
}))

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"statusboard": "./bin/statusboard"
2020
},
2121
"scripts": {
22-
"test": "standard && mocha",
22+
"lint": "standard",
23+
"test": "mocha",
2324
"prepublushOnly": "npm t",
2425
"postpublish": "git push origin && git push origin --tags",
2526
"clean": "./bin/statusboard clean -C ./test/fixtures/config -d ./gh-pages/data.db",
@@ -29,9 +30,8 @@
2930
"serve": "./bin/statusboard serve -o ./gh-pages -C ./test/fixtures/config -d ./gh-pages/data.db"
3031
},
3132
"devDependencies": {
32-
"mocha": "^6.1.4",
33-
"serve": "^11.1.0",
34-
"standard": "^12.0.1"
33+
"mocha": "^10.8.2",
34+
"standard": "^17.1.2"
3535
},
3636
"dependencies": {
3737
"@octokit/graphql": "^7.1.0",

template/indicies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ module.exports = {
9393

9494
labels[label.name] = labels[label.name] || []
9595
const d = {
96-
label: label,
96+
label,
9797
issue: detail,
9898
project
9999
}

template/js/page.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Page extends LitElement {
88
config: { type: Object }
99
}
1010
}
11+
1112
render () {
1213
return html`
1314
<link rel="stylesheet" href="${this.config.files.css.page}" />

template/js/project-list.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class ProjectList extends LitElement {
99
projects: { type: Object }
1010
}
1111
}
12+
1213
render () {
1314
return html`
1415
<link rel="stylesheet" href="${this.config.files.css.projectList}" />

0 commit comments

Comments
 (0)