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
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@
"@vitest/coverage-v8": "4.1.5",
"concurrently": "8.2.2",
"openapi3-ts": "2.0.2",
"oxlint": "1.73.0",
"oxlint": "1.74.0",
"oxlint-tsgolint": "0.24.0",
"readline-sync": "1.4.10",
"supertest": "7.1.4",
"testcontainers": "11.11.0",
"tsx": "4.21.0",
"typescript": "6.0.2",
"typescript": "7.0.2",
"vitest": "4.1.0",
"yaml": "2.8.2"
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"madge": "8.0.0",
"magic-string": "0.30.17",
"normalize.css": "8.0.1",
"oxlint": "1.73.0",
"oxlint": "1.74.0",
"oxlint-tsgolint": "0.24.0",
"postcss": "8.5.15",
"sass": "1.70.0",
Expand All @@ -119,7 +119,7 @@
"subset-font": "2.3.0",
"tailwindcss": "4.3.2",
"tsx": "4.21.0",
"typescript": "6.0.2",
"typescript": "7.0.2",
"unplugin-inject-preload": "3.0.0",
"vite": "8.0.5",
"vite-bundle-visualizer": "1.2.1",
Expand Down
29 changes: 6 additions & 23 deletions frontend/scripts/import-tree.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from "node:fs";
import path from "node:path";
import ts from "typescript";

const ROOT = path.resolve(import.meta.dirname, "..");

Expand Down Expand Up @@ -50,35 +49,19 @@ if (entryPoints.length === 0) {
process.exit(1);
}

// --- Import extraction (type-aware) ---

const tsConfig: ts.CompilerOptions = {
module: ts.ModuleKind.ESNext,
target: ts.ScriptTarget.ESNext,
jsx: ts.JsxEmit.Preserve,
sourceMap: false,
declaration: false,
isolatedModules: true,
};
// --- Import extraction ---

// Matches value `import`/`export ... from` statements and side-effect imports.
// `import type ...` / `export type ...` don't match (the `type` keyword sits
// where the specifier list or quote is expected), so type-only imports are
// excluded — which is what we want for a runtime dependency graph.
const JS_IMPORT_RE =
/(?:import|export)\s+(?:(?:\{[^}]*\}|[\w*]+(?:\s*,\s*\{[^}]*\})?)\s+from\s+)?["']([^"']+)["']/g;

function extractImports(filePath: string): string[] {
const content = fs.readFileSync(filePath, "utf-8");
let outputText: string;
try {
({ outputText } = ts.transpileModule(content, {
compilerOptions: tsConfig,
fileName: filePath,
}));
} catch {
// Some files (e.g. declaration files) can't be transpiled — fall back to
// regex on the original source, which still strips type-only imports.
outputText = content;
}
const specifiers: string[] = [];
for (const match of outputText.matchAll(JS_IMPORT_RE)) {
for (const match of content.matchAll(JS_IMPORT_RE)) {
const spec = match[1];
if (spec !== undefined) specifiers.push(spec);
}
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/html/pages/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
</div>
</div>
<div id="typingTest" class="content-grid full-width-padding">
<div id="capsWarning" class="hidden">
<i class="fas fa-lock"></i>
Caps Lock
</div>
<mount data-component="capswarning"></mount>
<div id="memoryTimer">Time left to memorise all words: 0s</div>
<div id="layoutfluidTimer">Time left to memorise all words: 0s</div>
<mount data-component="testmodesnotice"></mount>
Expand Down
29 changes: 0 additions & 29 deletions frontend/src/html/popups.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,6 @@
</div>
</div>

<dialog id="pbTablesModal" class="modalWrapper hidden">
<div class="modal">
<table>
<thead>
<tr>
<td width="1%">words</td>
<td>
<span class="unit">wpm</span>
<br />
<span class="sub">accuracy</span>
</td>
<td>
raw
<br />
<span class="sub">consistency</span>
</td>
<td>difficulty</td>
<td>language</td>
<td>punctuation</td>
<td>numbers</td>
<td>lazy mode</td>
<td>date</td>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</dialog>

<dialog id="practiseWordsModal" class="modalWrapper hidden">
<div class="modal" actions="">
<div class="title">Practice words</div>
Expand Down
68 changes: 0 additions & 68 deletions frontend/src/styles/popups.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,71 +136,3 @@ body.darkMode {
}
}
}

#pbTablesModal {
.modal {
max-width: 100%;
overflow-y: scroll;
table {
border-spacing: 0;
border-collapse: collapse;
color: var(--text-color);

tbody {
clip-path: inset(0);
}

td {
padding: 0.5rem 0.5rem;
}

.modesticky {
position: sticky;
top: calc(1rem - 2px);
z-index: 2;
}

thead {
color: var(--sub-color);
font-size: 0.75rem;
position: sticky;
top: -2rem;
background-color: var(--bg-color) !important;
z-index: 3;
}

tbody tr.odd {
background: var(--sub-alt-color);
}

tbody tr.even {
background: var(--bg-color);
}

td.infoIcons span {
margin: 0 0.1rem;
}
.miniResultChartButton {
opacity: 0.25;
transition: 0.25s;
cursor: pointer;
&:hover {
opacity: 1;
}
}
.sub {
opacity: 0.5;
}
td {
text-align: right;
}
td:nth-child(6),
td:nth-child(7) {
text-align: center;
}
tbody td:nth-child(1) {
font-size: 1.5rem;
}
}
}
}
22 changes: 0 additions & 22 deletions frontend/src/styles/test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -694,28 +694,6 @@
contain: strict;
}

#capsWarning {
font-size: 1rem;
background: var(--main-color);
color: var(--bg-color);
display: table;
position: absolute;
left: 50%;
// top: 66vh;
transform: translateX(-50%) translateY(-50%);
padding: 1rem;
border-radius: var(--roundness);
/* margin-top: 1rem; */
transition: 0.125s;
z-index: 999;
pointer-events: none;
top: -2.5rem;

i {
margin-right: 0.5rem;
}
}

.pageTest > .loading {
text-align: center;
& > i {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ts/components/modals/ContactModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function ContactModal(): JSXElement {
<br />
Please <span class="text-error">do not send</span> requests to delete
account, update email, update name or clear personal bests - you can do
that in the settings page.
that in the <a href="/account-settings">account settings</a> page.
</div>
<div class="mt-4 grid gap-4 md:grid-cols-2">
<Button
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/ts/components/modals/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ForgotPasswordModal } from "./ForgotPasswordModal";
import { GoogleSignupModal } from "./GoogleSignUpModal";
import { LastSignedOutResultModal } from "./LastSignedOutResultModal";
import { MobileTestConfigModal } from "./MobileTestConfigModal";
import { PbTablesModal } from "./PbTablesModal";
import { AddPresetModal } from "./preset/AddPresetModal";
import { EditPresetModal } from "./preset/EditPresetModal";
import { QuoteRateModal } from "./QuoteRateModal";
Expand Down Expand Up @@ -38,6 +39,7 @@ export function Modals(): JSXElement {
<QuoteSearchModal />
<CustomTestDurationModal />
<CustomWordAmountModal />
<PbTablesModal />
<ShareTestSettings />
<MobileTestConfigModal />
<CookiesModal />
Expand Down
Loading
Loading