Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
"testcontainers": "11.11.0",
"tsx": "4.21.0",
"typescript": "6.0.0-beta",
"vitest": "4.1.0"
"vitest": "4.1.0",
"yaml": "2.8.2"
},
"engines": {
"node": ">=24.0.0 <25"
Expand Down
107 changes: 105 additions & 2 deletions frontend/src/404.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
<!doctype html>
<html lang="en">
<load src="html/head.html" />
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404 Not Found | Monkeytype</title>
<link rel="stylesheet" href="styles/standalone.scss" />
<link id="favicon" rel="shortcut icon" href="images/fav.png" />
<link rel="shortcut icon" href="images/fav.png" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<meta name="name" content="Monkeytype" />
<meta name="image" content="https://monkeytype.com/mtsocial.png" />
<meta
name="description"
content="The most customizable typing test website with a minimal design and a ton of features. Test yourself in various modes, track your progress and improve your speed."
/>
<meta
name="keywords"
content="typing, test, typing-test, typing test, monkey-type, monkeytype, monkey type, monkey-types, monkeytypes, monkey types, types, monkey, type, miodec, wpm, words per minute, typing website, minimalistic, custom typing test, customizable, customisable, themes, random words, smooth caret, smooth, new, new typing site, new typing website, minimalist typing website, minimalistic typing website, minimalist typing test"
/>
<meta name="author" content="Miodec" />
<meta property="og:title" content="404 Not Found | Monkeytype" />
<meta property="og:url" content="https://monkeytype.com/" />
<meta property="og:type" content="website" />
<meta
property="og:description"
content="The most customizable typing test website with a minimal design and a ton of features. Test yourself in various modes, track your progress and improve your speed."
/>
<meta property="og:image" content="https://monkeytype.com/mtsocial.png" />
<meta name="theme-color" content="#e2b714" id="metaThemeColor" />
<meta name="twitter:title" content="404 Not Found | Monkeytype" />
<meta name="twitter:image" content="https://monkeytype.com/mtsocial.png" />
<meta name="twitter:card" content="summary_large_image" />
</head>
<body>
<script type="module" async>
import { loadCSS } from "./ts/utils/misc";
Expand All @@ -11,8 +48,74 @@
document.title = "404 Not Found | Monkeytype";
</script>
<load src="html/warnings.html" />
<style>
h1 {
font-weight: unset;
font-size: 2rem;
margin-top: 3rem;
color: var(--sub-color);
}
header #logo .icon svg path {
fill: var(--sub-color);
}
a.button {
border-radius: var(--roundness);
text-decoration: none;
background: var(--sub-alt-color);
color: var(--text-color);
&:hover {
background: var(--text-color);
color: var(--bg-color);
}
}
.page404 {
display: grid;
justify-content: center;
height: 100%;
align-content: center;
.content {
display: grid;
grid-auto-flow: column;
gap: 4rem;
grid-template-columns: 300px 300px;

.image {
width: 100%;
align-self: center;
background-image: url("/images/monkeymeme.jpg");
aspect-ratio: 300/199;
background-size: contain;
border-radius: var(--roundness);
}

.title {
font-size: 5rem;
line-height: 4rem;
/* margin: -3rem; */
color: var(--main-color);
align-self: center;
}

.side {
justify-items: center;
display: grid;
gap: 1rem;
text-align: center;

.big {
font-size: 10rem;
line-height: 10rem;
color: var(--sub-color);
}
.button {
padding: 1rem 2rem;
width: max-content;
}
}
}
}
</style>
<div id="app" class="content-grid focus">
<div id="backgroundLoader" class="hidden"></div>
<header class="focus">
<a id="logo" href="/" router-link="">
<div class="icon">
Expand Down
57 changes: 57 additions & 0 deletions packages/release/src/buildContributors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const OWNER = "monkeytypegame";
const REPO = "monkeytype";

const EXCLUDED = new Set(["monkeytypegeorge", "miodec"]);

async function getContributors(page) {
console.log("Getting contributors from page " + page);
const res = await fetch(
`https://api.github.com/repos/${OWNER}/${REPO}/contributors?anon=1&per_page=100&page=${page}`,
{
method: "GET",
headers: {
"User-Agent": "monkeytypegame release script",
...(process.env.GITHUB_TOKEN && {
Authorization: `token ${process.env.GITHUB_TOKEN}`,
}),
},
},
);
return res.json();
}

async function main() {
let total = [];
let page = 1;
let lastCount = 1;

while (lastCount > 0) {
const data = await getContributors(page);
const contributors = data.map((c) => ({
name: c.login ?? c.name,
contributions: c.contributions,
}));
lastCount = contributors.length;
page++;
total.push(...contributors);
}

total = total
.filter(
(c) => !EXCLUDED.has(c.name?.toLowerCase()) && !c.name?.includes("[bot]"),
)
.sort((a, b) => b.contributions - a.contributions);

// dedupe
const seen = new Set();
total = total.filter((c) => {
if (seen.has(c.name)) return false;
seen.add(c.name);
return true;
});

const output = JSON.stringify(total, null, 2);
console.log(output);
}

main();
17 changes: 17 additions & 0 deletions packages/release/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,22 @@ const generateChangelog = async () => {
return changelog;
};

const generateContributors = () => {
console.log("Generating contributors list...");

const p = path.resolve(__dirname, "./buildContributors.js");

const contributors = runCommand(`node ${p}`, true);

fs.writeFileSync(
`${PROJECT_ROOT}/frontend/static/about/contributors.json`,
contributors,
"utf8",
);

console.log("Contributors list updated.");
};

const createCommitAndTag = (version) => {
console.log("Creating commit and tag... Pushing to Github...");
runCommand(`git add .`);
Expand Down Expand Up @@ -328,6 +344,7 @@ const main = async () => {

if (!noDeploy) purgeCache();
if (!hotfix) {
generateContributors();
updatePackage(newVersion);
createCommitAndTag(newVersion);
try {
Expand Down
Loading
Loading