Bauke/tildes-issue-log
Bauke
/
tildes-issue-log
Archived
1
Fork 0

Update the dependencies and fix all the new linting issues.

This commit is contained in:
Bauke 2020-06-30 00:26:01 +02:00
parent 19cd2a2f0c
commit 35f9319012
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
9 changed files with 1549 additions and 1044 deletions

View File

@ -21,30 +21,30 @@
"modern-normalize": "^0.6.0" "modern-normalize": "^0.6.0"
}, },
"devDependencies": { "devDependencies": {
"@types/cheerio": "^0.22.16", "@types/cheerio": "^0.22.18",
"@types/got": "^9.6.9", "@types/got": "^9.6.11",
"@types/marked": "^0.7.2", "@types/marked": "^1.1.0",
"@types/nunjucks": "^3.1.3", "@types/nunjucks": "^3.1.3",
"@types/tar": "^4.0.3", "@types/tar": "^4.0.3",
"@types/wordwrap": "^1.0.0", "@types/wordwrap": "^1.0.0",
"cheerio": "^1.0.0-rc.3", "cheerio": "^1.0.0-rc.3",
"cpy-cli": "^3.1.0", "cpy-cli": "^3.1.1",
"fecha": "^4.1.0", "fecha": "^4.2.0",
"feed": "^4.1.0", "feed": "^4.2.0",
"gitlab": "^14.2.2", "gitlab": "^14.2.2",
"got": "^10.6.0", "got": "^11.3.0",
"htmlclean": "^3.0.8", "htmlclean": "^3.0.8",
"marked": "^0.8.0", "marked": "^1.1.0",
"nunjucks": "^3.2.0", "nunjucks": "^3.2.1",
"sass": "^1.26.1", "sass": "^1.26.9",
"stylelint": "^13.2.0", "stylelint": "^13.6.1",
"stylelint-config-xo-scss": "^0.12.0", "stylelint-config-xo-scss": "^0.12.0",
"stylelint-config-xo-space": "^0.14.0", "stylelint-config-xo-space": "^0.14.0",
"tar": "^6.0.1", "tar": "^6.0.2",
"ts-node": "^8.6.2", "ts-node": "^8.10.2",
"typescript": "^3.8.2", "typescript": "^3.9.5",
"wordwrap": "^1.0.0", "wordwrap": "^1.0.0",
"xo": "^0.27.2" "xo": "^0.32.0"
}, },
"stylelint": { "stylelint": {
"extends": [ "extends": [

View File

@ -8,7 +8,7 @@ window.addEventListener('load', () => {
} }
// When the theme button is clicked, switch the theme to the other one. // When the theme button is clicked, switch the theme to the other one.
themeToggleButton.addEventListener('click', event => { themeToggleButton.addEventListener('click', (event) => {
event.preventDefault(); event.preventDefault();
if (document.body.getAttribute('id') === 'dark-theme') { if (document.body.getAttribute('id') === 'dark-theme') {

View File

@ -17,5 +17,5 @@ async function entry(): Promise<void> {
} }
if (require.main === module) { if (require.main === module) {
entry(); void entry();
} }

View File

@ -19,10 +19,10 @@ async function setupGitLabAPI(): Promise<GitLab> {
return api; return api;
} }
async function setupTempDirectory(): Promise<string> { async function setupTemporaryDirectory(): Promise<string> {
const tempDirectory: string = join(__dirname, '../../temp/'); const temporaryDirectory: string = join(__dirname, '../../temp/');
await fsp.mkdir(tempDirectory + 'data/', {recursive: true}); await fsp.mkdir(temporaryDirectory + 'data/', {recursive: true});
return tempDirectory; return temporaryDirectory;
} }
async function getConfig(): Promise<Config> { async function getConfig(): Promise<Config> {
@ -33,13 +33,13 @@ async function getConfig(): Promise<Config> {
} }
export async function getCommits(): Promise<any[]> { export async function getCommits(): Promise<any[]> {
const tempDirectory: string = await setupTempDirectory(); const temporaryDirectory: string = await setupTemporaryDirectory();
const api: GitLab = await setupGitLabAPI(); const api: GitLab = await setupGitLabAPI();
const project: gitlab.ProjectSchema = await api.Projects.show( const project: gitlab.ProjectSchema = await api.Projects.show(
'tildes/tildes' 'tildes/tildes'
); );
const commitsPath: string = join( const commitsPath: string = join(
tempDirectory, temporaryDirectory,
`data/commits (${fecha.format(new Date(), 'YYYY-MM-DD')}).json` `data/commits (${fecha.format(new Date(), 'YYYY-MM-DD')}).json`
); );
let commits: any[]; let commits: any[];
@ -59,13 +59,13 @@ export async function getCommits(): Promise<any[]> {
} }
export async function getIssues(): Promise<any[]> { export async function getIssues(): Promise<any[]> {
const tempDirectory: string = await setupTempDirectory(); const temporaryDirectory: string = await setupTemporaryDirectory();
const api: GitLab = await setupGitLabAPI(); const api: GitLab = await setupGitLabAPI();
const project: gitlab.ProjectSchema = await api.Projects.show( const project: gitlab.ProjectSchema = await api.Projects.show(
'tildes/tildes' 'tildes/tildes'
); );
const issuesPath: string = join( const issuesPath: string = join(
tempDirectory, temporaryDirectory,
`data/issues (${fecha.format(new Date(), 'YYYY-MM-DD')}).json` `data/issues (${fecha.format(new Date(), 'YYYY-MM-DD')}).json`
); );
let issues: any[]; let issues: any[];
@ -83,13 +83,13 @@ export async function getIssues(): Promise<any[]> {
} }
export async function getMergeRequests(): Promise<any[]> { export async function getMergeRequests(): Promise<any[]> {
const tempDirectory: string = await setupTempDirectory(); const temporaryDirectory: string = await setupTemporaryDirectory();
const api: GitLab = await setupGitLabAPI(); const api: GitLab = await setupGitLabAPI();
const project: gitlab.ProjectSchema = await api.Projects.show( const project: gitlab.ProjectSchema = await api.Projects.show(
'tildes/tildes' 'tildes/tildes'
); );
const mergeRequestsPath: string = join( const mergeRequestsPath: string = join(
tempDirectory, temporaryDirectory,
`data/merge requests (${fecha.format(new Date(), 'YYYY-MM-DD')}).json` `data/merge requests (${fecha.format(new Date(), 'YYYY-MM-DD')}).json`
); );
let mergeRequests: any[]; let mergeRequests: any[];
@ -114,5 +114,5 @@ export async function getMergeRequests(): Promise<any[]> {
} }
if (require.main === module) { if (require.main === module) {
entry(); void entry();
} }

View File

@ -1,7 +1,7 @@
import {promises as fsp} from 'fs'; import {promises as fsp} from 'fs';
import {basename, join} from 'path'; import {basename, join} from 'path';
import fecha from 'fecha'; import fecha from 'fecha';
// @ts-ignore // @ts-expect-error
import htmlclean from 'htmlclean'; import htmlclean from 'htmlclean';
import marked from 'marked'; import marked from 'marked';
import nunjucks from 'nunjucks'; import nunjucks from 'nunjucks';
@ -99,7 +99,7 @@ async function entry(): Promise<void> {
// Get the statistics for that month. // Get the statistics for that month.
const statistic: Statistics = statistics.find( const statistic: Statistics = statistics.find(
val => val.year === Number(year) && val.month === monthNumber (value) => value.year === Number(year) && value.month === monthNumber
)!; )!;
const topics: OfficialTopic[] = await getTopicsFromMonth( const topics: OfficialTopic[] = await getTopicsFromMonth(
@ -184,7 +184,7 @@ async function entry(): Promise<void> {
export async function renderTemplate( export async function renderTemplate(
template: string, template: string,
location: string, location: string,
context: object = {} context: Record<string, unknown> = {}
): Promise<void> { ): Promise<void> {
const html: string = htmlclean(nunjucks.render(template, context)); const html: string = htmlclean(nunjucks.render(template, context));
await fsp.writeFile(location, html); await fsp.writeFile(location, html);
@ -211,5 +211,5 @@ export function pluralize(
} }
if (require.main === module) { if (require.main === module) {
entry(); void entry();
} }

View File

@ -58,8 +58,8 @@ async function entry(): Promise<void> {
// If all pagination buttons are "previous" buttons, stop the loop. // If all pagination buttons are "previous" buttons, stop the loop.
if ( if (
paginationButtons.every(val => paginationButtons.every((value) =>
val.firstChild.data?.toLowerCase().includes('prev') value.firstChild.data?.toLowerCase().includes('prev')
) )
) { ) {
hasNextButton = false; hasNextButton = false;
@ -76,7 +76,7 @@ async function entry(): Promise<void> {
} }
export async function wait(timeout: number): Promise<void> { export async function wait(timeout: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, timeout)); return new Promise((resolve) => setTimeout(resolve, timeout));
} }
export async function getTopicsFromMonth( export async function getTopicsFromMonth(
@ -100,5 +100,5 @@ export async function getTopicsFromMonth(
} }
if (require.main === module) { if (require.main === module) {
entry(); void entry();
} }

View File

@ -33,5 +33,5 @@ async function entry(): Promise<void> {
} }
if (require.main === module) { if (require.main === module) {
entry(); void entry();
} }

View File

@ -288,7 +288,7 @@ export async function findData<T extends Result>(
} }
// Find the monthly that applies to this datapoint. // Find the monthly that applies to this datapoint.
const monthly: T | undefined = monthlies.find(result => const monthly: T | undefined = monthlies.find((result) =>
findFn(result, point) findFn(result, point)
); );
@ -311,11 +311,11 @@ async function getResultCount(
month: number month: number
): Promise<number> { ): Promise<number> {
const result: MonthlyResult | undefined = results.find( const result: MonthlyResult | undefined = results.find(
val => val.year === year && val.month === month (value) => value.year === year && value.month === month
); );
return result === undefined ? 0 : result.count; return result === undefined ? 0 : result.count;
} }
if (require.main === module) { if (require.main === module) {
entry(); void entry();
} }

2513
yarn.lock

File diff suppressed because it is too large Load Diff