Commit graph

116 commits

Author SHA1 Message Date
Miodec
e8c0fc08d0 chore: temporairly allow null discordIds 2025-04-29 13:51:53 +02:00
Miodec
f0f27f0733 chore: upgrade octokit/rest 2025-04-29 12:53:49 +02:00
Christian Fehmer
c253d2fd18
refactor: make customLayoutfluid an array (@fehmer) (#6494)
merge after #6487
2025-04-29 12:46:24 +02:00
Christian Fehmer
212b8d38cb
refactor: make funbox settings an array (@fehmer) (#6487)
change funbox from "hash separated values" to array.

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-29 11:31:44 +02:00
Christian Fehmer
b36bc9f39e
refactor: move layout names to contracts (@fehmer) (#6495) 2025-04-28 11:29:52 +02:00
Jack
e06f7f41cf
refactor: add trycatch util (@miodec) (#6492)
Adds trycatch util to cleanup try catch code.
2025-04-26 21:24:39 +02:00
Miodec
f60dd0ac3c chore: remove false positive 2025-04-24 16:39:30 +02:00
Seif Soliman
86383cf9ef
refactor(backend): improve redis and json.parse type safety with zod (@byseif21, @miodec) (#6481)
### Description

refactored backend files to enhance type safety and reliability using
Zod validation and Redis instead of JSON.parse , I tried to avoid the
files that isn't necessary tho so I hope I don't miss any or included
unnecessary ones!! didn't fully test only verified code compilation and
partial tests without Redis!!.


Should Close #5881 
Related to #6207

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-24 16:25:43 +02:00
Miodec
a424f96480 chore: upgrade oxlint 2025-04-23 18:54:33 +02:00
Christian Fehmer
ac1d6f0847
feat(funbox): add ASL (@fehmer) (#6485) 2025-04-23 18:45:52 +02:00
Christian Fehmer
da671337c5
feat(funbox): add polyglot (@fehmer) (#6454)
Add polyglot funbox which let you practice on multiple languages at once
in a single test.

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-18 16:48:35 +02:00
megalodon2710
bf002c02ec
feat(funbox): add layout mirror (@megalodon2710) (#6463)
### Description

Added layout mirror item in the funbox with functionality.

Tweaked how active funbox items are detected in the commandline (names
included in other names no long appear as active if the item they're
included in is active).

### Checks

- [ ] Adding quotes?
- [ ] Make sure to include translations for the quotes in the
description (or another comment) so we can verify their content.
- [ ] Adding a language or a theme?
- [ ] If is a language, did you edit `_list.json`, `_groups.json` and
add `languages.json`?
  - [ ] If is a theme, did you add the theme.css?
- Also please add a screenshot of the theme, it would be extra awesome
if you do so!
- [X] Check if any open issues are related to this PR; if so, be sure to
tag them below.
- [X] Make sure the PR title follows the Conventional Commits standard.
(https://www.conventionalcommits.org for more info)
- [X] Make sure to include your GitHub username prefixed with @ inside
parentheses at the end of the PR title.

<!-- label(optional scope): pull request title (@your_github_username)
-->

<!-- I know I know they seem boring but please do them, they help us and
you will find out it also helps you.-->

Closes #5573

<!-- the issue(s) your PR resolves if any (delete if that is not the
case) -->
<!-- please also reference any issues and or PRs related to your pull
request -->
<!-- Also remove it if you are not following any issues. -->

<!-- pro tip: you can mention an issue, PR, or discussion on GitHub by
referencing its hash number e.g:
[#1234](https://github.com/monkeytypegame/monkeytype/pull/1234) -->

<!-- pro tip: you can press . (dot or period) in the code tab of any
GitHub repo to get access to GitHub's VS Code web editor Enjoy! :) -->

---------

Co-authored-by: jeffrey <jeffrey.tiger@telecom-paris.fr>
Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-17 16:10:19 +02:00
Miodec
bf0ce6607d fix: lint issues
!nuf
2025-04-16 19:39:07 +02:00
Miodec
0b05b3c2fd refactor: enable ban-ts-comment rule 2025-04-16 19:15:30 +02:00
Miodec
158226629d refactor: enable eqeqeq rule 2025-04-16 18:54:15 +02:00
Miodec
3207a20829 refactor: reduce indentation by extracting code to a function 2025-04-16 18:45:55 +02:00
Jack
cac8835c77
chore: add oxlint (@miodec) (#6455)
Use oxlint for general linting to provide much quicker feedback. Keep
eslint for type-aware rules. Fully switch to oxlint once it supports
type-aware.
2025-04-16 17:18:50 +02:00
Christian Fehmer
f6d9b7c3ef
impr: lazy load chartData on results (@fehmer) (#6428)
Optimize results endpoint by removing heavy or unused data. 

We load the whole result chart data for up to 1000 results each time,
but it is very unlikely the user will view the charts for all old
results. By removing the size in my tests went down from 1152kb to
276kb.

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-08 13:46:40 +02:00
Miodec
b9916b8b8d chore: trim branch string 2025-03-26 18:19:36 +01:00
Christian Fehmer
cef3ff57c7
impr(result page): clicking on daily leaderboard rank opens the leaderboards page the user is on (@fehmer) (#6380)
Co-authored-by: Miodec <jack@monkeytype.com>
2025-03-18 13:18:12 +01:00
Christian Fehmer
9e3f795380
fix: protect against stored xss in custom background url (@fehmer) (#6355)
!nuf

closes #6354
2025-03-12 16:52:57 +01:00
Nad Alaba
195b9d8402
chore(workflows): update deprecated action and remove duplicate workflow message (@NadAlaba) (#6344)
### Description

1. remove duplicate correct examples in semantic-pr-title error message,
and make the examples more diverse (show how to credit multiple
contributors).

![patternMessage](https://github.com/user-attachments/assets/cb6afe48-ed67-4894-ab4a-76894dd50e3b)

2. make the scope (quotes, languages, ...) consistently plural across
the repo docs (A subjective change I know, but in the changelog, the
scope looks better when it is plural i.e. **quotes:** add various
quotes).
3. update deprecated action `upload-artifact` from v3 to v4, because it
was making the `ci-failure-comment` workflow fail.
> Error: This request has been automatically failed because it uses a
deprecated version of `actions/upload-artifact: v3`. Learn more:
https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
4. use the same official action to download and upload artifacts across
the repo's workflows.
5. add 'waiting for update' and remove 'waiting for review' labels when
the Monkey CI workflow fails.
6. fix actions' major version only, to allow minor updates and patches.
2025-03-12 16:35:58 +01:00
Nad Alaba
932d0e166e
build: fix openapi spec path for docs & stats endpoints on dev (@NadAlaba) (#6343)
### Description

1. fix openapi specification path so that /docs endpoint would work on
dev.

> Error: ENOENT: no such file or directory, stat
'backend/src/static/api/public.html' Stack: Error: ENOENT: no such file
or directory

2. fix openapi specification path so that API Operation would work on
/stats endpoint on dev.

> Cannot read openApi specification from
backend/src/api/routes/../../static/api/openapi.json. Swagger stats will
not fully work.

![stats](https://github.com/user-attachments/assets/82f3e8b4-814c-4ede-ba67-8da53dacad87)

3. remove unneeded `files` & `ts-node` options from `tsconfig.json` in
various places.

> File 'backend/src/types/types.d.ts' not found.
  The file is in the program because:
    Part of 'files' list in tsconfig.json

4. add the missing `pnpm test` script to the funbox package.
2025-03-12 16:20:46 +01:00
Miodec
420d049a59 impr(server): better leaderboard request validation schema
stop mongo from trying to handle pointless queries

!nuf
2025-03-12 13:13:56 +01:00
Christian Fehmer
9e13f2452a
chore: add branch check in release script (@fehmer) (#6338) 2025-03-06 01:31:33 +01:00
Christian Fehmer
f80dde4c89
chore(self hosting): run selfhosted backend in prod mode (@fehmer) (#6326)
Co-authored-by: Miodec <jack@monkeytype.com>
2025-03-03 17:43:08 +01:00
Christian Fehmer
2b2d1a153e
build: use tsup instead of esbuild for packages (@fehmer) (#6309) 2025-03-03 13:48:50 +01:00
Christian Fehmer
8a41ccee97
fix: past leaderboard not fetching the users rank (@fehmer) (#6289)
Show the users ranking for the last day on the daily and for the last
week on the weekly leaderboard correctly.

- Fix request query schema for the [daily
rank](https://api.monkeytype.com/docs/internal#tag/leaderboards/operation/leaderboards.getDailyRank)
having pagination
- Fix request query schema for the [weekly
rank](https://api.monkeytype.com/docs/internal#tag/leaderboards/operation/leaderboards.getWeeklyXpRank)
missing the `weeksBefore` parameter
- Fix frontend to include the `daysBefore` or `weeksBefore` parameter on
`rank` calls

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-02-21 16:52:20 +01:00
Miodec
7b80bf80a9 chore: forward the exit code returned by the ssh command
also fix logging on error
2025-02-20 12:12:15 +01:00
Christian Fehmer
09eb1a2b0e
refactor: use validation on email update modal (@fehmer) (#6272) 2025-02-19 16:27:20 +01:00
Jack
01dee3fe15 feat: leaderboards remake, weekly xp leaderboards (@miodec) (#6250) 2025-02-12 16:34:03 +01:00
Christian Fehmer
e7685c5861
impr: add X-Compatibility-Check header to all responses (@fehmer) (#6262)
!nuf
2025-02-12 14:37:53 +01:00
dependabot[bot]
b734f71cd2
chore(deps-dev): bump esbuild from 0.23.0 to 0.25.0 in /packages/esbuild-config (#6256)
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.23.0 to 0.25.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/evanw/esbuild/releases">esbuild's
releases</a>.</em></p>
<blockquote>
<h2>v0.25.0</h2>
<p><strong>This release deliberately contains backwards-incompatible
changes.</strong> To avoid automatically picking up releases like this,
you should either be pinning the exact version of <code>esbuild</code>
in your <code>package.json</code> file (recommended) or be using a
version range syntax that only accepts patch upgrades such as
<code>^0.24.0</code> or <code>~0.24.0</code>. See npm's documentation
about <a
href="https://docs.npmjs.com/cli/v6/using-npm/semver/">semver</a> for
more information.</p>
<ul>
<li>
<p>Restrict access to esbuild's development server (<a
href="https://github.com/evanw/esbuild/security/advisories/GHSA-67mh-4wv8-2f99">GHSA-67mh-4wv8-2f99</a>)</p>
<p>This change addresses esbuild's first security vulnerability report.
Previously esbuild set the <code>Access-Control-Allow-Origin</code>
header to <code>*</code> to allow esbuild's development server to be
flexible in how it's used for development. However, this allows the
websites you visit to make HTTP requests to esbuild's local development
server, which gives read-only access to your source code if the website
were to fetch your source code's specific URL. You can read more
information in <a
href="https://github.com/evanw/esbuild/security/advisories/GHSA-67mh-4wv8-2f99">the
report</a>.</p>
<p>Starting with this release, <a
href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">CORS</a>
will now be disabled, and requests will now be denied if the host does
not match the one provided to <code>--serve=</code>. The default host is
<code>0.0.0.0</code>, which refers to all of the IP addresses that
represent the local machine (e.g. both <code>127.0.0.1</code> and
<code>192.168.0.1</code>). If you want to customize anything about
esbuild's development server, you can <a
href="https://esbuild.github.io/api/#serve-proxy">put a proxy in front
of esbuild</a> and modify the incoming and/or outgoing requests.</p>
<p>In addition, the <code>serve()</code> API call has been changed to
return an array of <code>hosts</code> instead of a single
<code>host</code> string. This makes it possible to determine all of the
hosts that esbuild's development server will accept.</p>
<p>Thanks to <a
href="https://github.com/sapphi-red"><code>@​sapphi-red</code></a> for
reporting this issue.</p>
</li>
<li>
<p>Delete output files when a build fails in watch mode (<a
href="https://redirect.github.com/evanw/esbuild/issues/3643">#3643</a>)</p>
<p>It has been requested for esbuild to delete files when a build fails
in watch mode. Previously esbuild left the old files in place, which
could cause people to not immediately realize that the most recent build
failed. With this release, esbuild will now delete all output files if a
rebuild fails. Fixing the build error and triggering another rebuild
will restore all output files again.</p>
</li>
<li>
<p>Fix correctness issues with the CSS nesting transform (<a
href="https://redirect.github.com/evanw/esbuild/issues/3620">#3620</a>,
<a
href="https://redirect.github.com/evanw/esbuild/issues/3877">#3877</a>,
<a
href="https://redirect.github.com/evanw/esbuild/issues/3933">#3933</a>,
<a
href="https://redirect.github.com/evanw/esbuild/issues/3997">#3997</a>,
<a
href="https://redirect.github.com/evanw/esbuild/issues/4005">#4005</a>,
<a href="https://redirect.github.com/evanw/esbuild/pull/4037">#4037</a>,
<a
href="https://redirect.github.com/evanw/esbuild/pull/4038">#4038</a>)</p>
<p>This release fixes the following problems:</p>
<ul>
<li>
<p>Naive expansion of CSS nesting can result in an exponential blow-up
of generated CSS if each nesting level has multiple selectors.
Previously esbuild sometimes collapsed individual nesting levels using
<code>:is()</code> to limit expansion. However, this collapsing wasn't
correct in some cases, so it has been removed to fix correctness
issues.</p>
<pre lang="css"><code>/* Original code */
.parent {
  &gt; .a,
  &gt; .b1 &gt; .b2 {
    color: red;
  }
}
<p>/* Old output (with --supported:nesting=false) */<br />
.parent &gt; :is(.a, .b1 &gt; .b2) {<br />
color: red;<br />
}</p>
<p>/* New output (with --supported:nesting=false) */<br />
.parent &gt; .a,<br />
.parent &gt; .b1 &gt; .b2 {<br />
color: red;<br />
}<br />
</code></pre></p>
<p>Thanks to <a
href="https://github.com/tim-we"><code>@​tim-we</code></a> for working
on a fix.</p>
</li>
<li>
<p>The <code>&amp;</code> CSS nesting selector can be repeated multiple
times to increase CSS specificity. Previously esbuild ignored this
possibility and incorrectly considered <code>&amp;&amp;</code> to have
the same specificity as <code>&amp;</code>. With this release, this
should now work correctly:</p>
<pre lang="css"><code>/* Original code (color should be red) */
</code></pre>
</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md">esbuild's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog: 2024</h1>
<p>This changelog documents all esbuild versions published in the year
2024 (versions 0.19.12 through 0.24.2).</p>
<h2>0.24.2</h2>
<ul>
<li>
<p>Fix regression with <code>--define</code> and
<code>import.meta</code> (<a
href="https://redirect.github.com/evanw/esbuild/issues/4010">#4010</a>,
<a
href="https://redirect.github.com/evanw/esbuild/issues/4012">#4012</a>,
<a
href="https://redirect.github.com/evanw/esbuild/pull/4013">#4013</a>)</p>
<p>The previous change in version 0.24.1 to use a more expression-like
parser for <code>define</code> values to allow quoted property names
introduced a regression that removed the ability to use
<code>--define:import.meta=...</code>. Even though <code>import</code>
is normally a keyword that can't be used as an identifier, ES modules
special-case the <code>import.meta</code> expression to behave like an
identifier anyway. This change fixes the regression.</p>
<p>This fix was contributed by <a
href="https://github.com/sapphi-red"><code>@​sapphi-red</code></a>.</p>
</li>
</ul>
<h2>0.24.1</h2>
<ul>
<li>
<p>Allow <code>es2024</code> as a target in <code>tsconfig.json</code>
(<a
href="https://redirect.github.com/evanw/esbuild/issues/4004">#4004</a>)</p>
<p>TypeScript recently <a
href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/#support-for---target-es2024-and---lib-es2024">added
<code>es2024</code></a> as a compilation target, so esbuild now supports
this in the <code>target</code> field of <code>tsconfig.json</code>
files, such as in the following configuration file:</p>
<pre lang="json"><code>{
  &quot;compilerOptions&quot;: {
    &quot;target&quot;: &quot;ES2024&quot;
  }
}
</code></pre>
<p>As a reminder, the only thing that esbuild uses this field for is
determining whether or not to use legacy TypeScript behavior for class
fields. You can read more in <a
href="https://esbuild.github.io/content-types/#tsconfig-json">the
documentation</a>.</p>
<p>This fix was contributed by <a
href="https://github.com/billyjanitsch"><code>@​billyjanitsch</code></a>.</p>
</li>
<li>
<p>Allow automatic semicolon insertion after
<code>get</code>/<code>set</code></p>
<p>This change fixes a grammar bug in the parser that incorrectly
treated the following code as a syntax error:</p>
<pre lang="ts"><code>class Foo {
  get
  *x() {}
  set
  *y() {}
}
</code></pre>
<p>The above code will be considered valid starting with this release.
This change to esbuild follows a <a
href="https://redirect.github.com/microsoft/TypeScript/pull/60225">similar
change to TypeScript</a> which will allow this syntax starting with
TypeScript 5.7.</p>
</li>
<li>
<p>Allow quoted property names in <code>--define</code> and
<code>--pure</code> (<a
href="https://redirect.github.com/evanw/esbuild/issues/4008">#4008</a>)</p>
<p>The <code>define</code> and <code>pure</code> API options now accept
identifier expressions containing quoted property names. Previously all
identifiers in the identifier expression had to be bare identifiers.
This change now makes <code>--define</code> and <code>--pure</code>
consistent with <code>--global-name</code>, which already supported
quoted property names. For example, the following is now possible:</p>
<pre lang="js"><code></code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e9174d671b"><code>e9174d6</code></a>
publish 0.25.0 to npm</li>
<li><a
href="c27dbebb9e"><code>c27dbeb</code></a>
fix <code>hosts</code> in <code>plugin-tests.js</code></li>
<li><a
href="6794f602a4"><code>6794f60</code></a>
fix <code>hosts</code> in <code>node-unref-tests.js</code></li>
<li><a
href="de85afd65e"><code>de85afd</code></a>
Merge commit from fork</li>
<li><a
href="da1de1bf77"><code>da1de1b</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/4065">#4065</a>:
bitwise operators can return bigints</li>
<li><a
href="f4e9d19fb2"><code>f4e9d19</code></a>
switch case liveness: <code>default</code> is always last</li>
<li><a
href="7aa47c3e77"><code>7aa47c3</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/4028">#4028</a>:
minify live/dead <code>switch</code> cases better</li>
<li><a
href="22ecd30619"><code>22ecd30</code></a>
minify: more constant folding for strict equality</li>
<li><a
href="4cdf03c036"><code>4cdf03c</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/4053">#4053</a>:
reordering of <code>.tsx</code> in <code>node_modules</code></li>
<li><a
href="dc719775b7"><code>dc71977</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3692">#3692</a>:
<code>0</code> now picks a random ephemeral port</li>
<li>Additional commits viewable in <a
href="https://github.com/evanw/esbuild/compare/v0.23.0...v0.25.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=esbuild&package-manager=npm_and_yarn&previous-version=0.23.0&new-version=0.25.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/monkeytypegame/monkeytype/network/alerts).

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Miodec <jack@monkeytype.com>
2025-02-12 13:29:39 +01:00
Miodec
a0c471a28e chore: add captcha to the forgot password modal 2025-02-12 12:12:48 +01:00
Christian Fehmer
a2d91f2a73
refactor: better detection of ZodError (@fehmer) (#6258) 2025-02-11 20:16:09 +01:00
dependabot[bot]
ae9c3ca003
chore(deps-dev): bump vitest from 2.0.5 to 2.1.9 (#6242)
Bumps
[vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)
from 2.0.5 to 2.1.9.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/vitest-dev/vitest/releases">vitest's
releases</a>.</em></p>
<blockquote>
<h2>v2.1.9</h2>
<p>This release includes security patches for:</p>
<ul>
<li><a
href="https://github.com/vitest-dev/vitest/security/advisories/GHSA-8gvc-j273-4wm5">Browser
mode serves arbitrary files | CVE-2025-24963</a></li>
<li><a
href="https://github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq">Remote
Code Execution when accessing a malicious website while Vitest API
server is listening | CVE-2025-24964</a></li>
</ul>
<h3>   🐞 Bug Fixes</h3>
<ul>
<li>backport <a
href="https://redirect.github.com/vitest-dev/vitest/issues/7317">vitest-dev/vitest#7317</a>
to v2 - by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/pull/7318">vitest-dev/vitest#7318</a></li>
<li>(backport <a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/7340">#7340</a>
to v2) restrict served files from <code>/__screenshot-error</code> - by
<a href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/pull/7343">vitest-dev/vitest#7343</a></li>
</ul>
<h5>    <a
href="https://github.com/vitest-dev/vitest/compare/v2.1.8...v2.1.9">View
changes on GitHub</a></h5>
<h2>v2.1.8</h2>
<h3>   🐞 Bug Fixes</h3>
<ul>
<li>Support Node 21  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> <a
href="https://github.com/vitest-dev/vitest/commit/92f7a2ad"><!-- raw
HTML omitted -->(92f7a)<!-- raw HTML omitted --></a></li>
</ul>
<h5>    <a
href="https://github.com/vitest-dev/vitest/compare/v2.1.7...v2.1.8">View
changes on GitHub</a></h5>
<h2>v2.1.7</h2>
<h3>   🐞 Bug Fixes</h3>
<ul>
<li>Revert support for Vite 6  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> <a
href="https://github.com/vitest-dev/vitest/commit/fbe5c39d"><!-- raw
HTML omitted -->(fbe5c)<!-- raw HTML omitted --></a>
<ul>
<li>This introduced some breaking changes (<a
href="https://redirect.github.com/vitest-dev/vitest/issues/6992">vitest-dev/vitest#6992</a>).
We will enable support for it later. In the meantime, you can still use
<code>pnpm.overrides</code> or yarn resolutions to override the
<code>vite</code> version in the <code>vitest</code> package - the APIs
are compatible.</li>
</ul>
</li>
</ul>
<h5>    <a
href="https://github.com/vitest-dev/vitest/compare/v2.1.6...v2.1.7">View
changes on GitHub</a></h5>
<h2>v2.1.6</h2>
<h2>🚀 Features</h2>
<ul>
<li>Support Vite 6</li>
</ul>
<h5>    <a
href="https://github.com/vitest-dev/vitest/compare/v2.1.5...v2.1.6">View
changes on GitHub</a></h5>
<h2>v2.1.5</h2>
<h3>   🐞 Bug Fixes</h3>
<ul>
<li><code>dangerouslyIgnoreUnhandledErrors</code> without base reporter
 -  by <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/6808">vitest-dev/vitest#6808</a>
<a href="https://github.com/vitest-dev/vitest/commit/0bf0ab00"><!-- raw
HTML omitted -->(0bf0a)<!-- raw HTML omitted --></a></li>
<li>Capture <code>unhandledRejection</code> even when base reporter is
not used  -  by <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/6812">vitest-dev/vitest#6812</a>
<a href="https://github.com/vitest-dev/vitest/commit/8878b04d"><!-- raw
HTML omitted -->(8878b)<!-- raw HTML omitted --></a></li>
<li>Don't change the working directory when loading workspace projects
 -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/6811">vitest-dev/vitest#6811</a>
<a href="https://github.com/vitest-dev/vitest/commit/f0aeaca8"><!-- raw
HTML omitted -->(f0aea)<!-- raw HTML omitted --></a></li>
<li>Remove <code>sequence.concurrent</code> from the
<code>RuntimeConfig</code> type  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/6880">vitest-dev/vitest#6880</a>
<a href="https://github.com/vitest-dev/vitest/commit/6af73d93"><!-- raw
HTML omitted -->(6af73)<!-- raw HTML omitted --></a></li>
<li>Stop the runner before restarting, restart on workspace config
change  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/6859">vitest-dev/vitest#6859</a>
<a href="https://github.com/vitest-dev/vitest/commit/b01df47d"><!-- raw
HTML omitted -->(b01df)<!-- raw HTML omitted --></a></li>
<li>Don't rerun on Esc or Ctrl-C during watch filter  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/6895">vitest-dev/vitest#6895</a>
<a href="https://github.com/vitest-dev/vitest/commit/98f76ea7"><!-- raw
HTML omitted -->(98f76)<!-- raw HTML omitted --></a></li>
<li>Print ssrTransform error  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/6885">vitest-dev/vitest#6885</a>
<a href="https://github.com/vitest-dev/vitest/commit/4c96cce7"><!-- raw
HTML omitted -->(4c96c)<!-- raw HTML omitted --></a></li>
<li>Throw an error and a warning if <code>.poll</code>,
<code>.element</code>, <code>.rejects</code>/<code>.resolves</code>, and
<code>locator.*</code> weren't awaited  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/6877">vitest-dev/vitest#6877</a>
<a href="https://github.com/vitest-dev/vitest/commit/93b67c24"><!-- raw
HTML omitted -->(93b67)<!-- raw HTML omitted --></a></li>
<li><strong>browser</strong>:
<ul>
<li>Don't process the default css styles  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/6861">vitest-dev/vitest#6861</a>
<a href="https://github.com/vitest-dev/vitest/commit/0d67f04b"><!-- raw
HTML omitted -->(0d67f)<!-- raw HTML omitted --></a></li>
<li>Support non US key input  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/6873">vitest-dev/vitest#6873</a>
<a href="https://github.com/vitest-dev/vitest/commit/5969d8da"><!-- raw
HTML omitted -->(5969d)<!-- raw HTML omitted --></a></li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c9e59a089d"><code>c9e59a0</code></a>
chore: release v2.1.9</li>
<li><a
href="e0fe1d81e2"><code>e0fe1d8</code></a>
fix: backport <a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/7317">#7317</a>
to v2 (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/7318">#7318</a>)</li>
<li><a
href="d69cc75698"><code>d69cc75</code></a>
bump: 2.1.8</li>
<li><a
href="92f7a2ad18"><code>92f7a2a</code></a>
fix: support Node 21</li>
<li><a
href="81ed45b3a4"><code>81ed45b</code></a>
chore: release v2.1.7</li>
<li><a
href="fbe5c39d88"><code>fbe5c39</code></a>
fix: revert support for Vite 6</li>
<li><a
href="b936702deb"><code>b936702</code></a>
bump: 2.1.6</li>
<li><a
href="32f23b98b4"><code>32f23b9</code></a>
chore: release v2.1.5</li>
<li><a
href="417bdb423d"><code>417bdb4</code></a>
fix(browser): init browsers eagerly when tests are running (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/6876">#6876</a>)</li>
<li><a
href="93b67c24b1"><code>93b67c2</code></a>
fix: throw an error and a warning if <code>.poll</code>,
<code>.element</code>, <code>.rejects</code>/`.resolv...</li>
<li>Additional commits viewable in <a
href="https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/vitest">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=vitest&package-manager=npm_and_yarn&previous-version=2.0.5&new-version=2.1.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/monkeytypegame/monkeytype/network/alerts).

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2025-02-08 13:53:20 +01:00
Tamion
a4b7c00ef9
impr: allow multiple funboxes with css (@notTamion, @miodec, @fehmer) (#6017)
### Description
Allows enabling multiple funboxes that have a stylesheet. Which funboxes
should be deemed compatible with each other will need some discussion

---------

Co-authored-by: Jack <jack@monkeytype.com>
Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2025-02-04 17:52:50 +01:00
Christian Fehmer
12e150072b
fix: fix error handling in parseWithSchema (@fehmer) (#6229)
`instanceof ZodError` is not working if the code is packaged as a module
for unknown reason. Found while adding tests for the url-handler in
#6207.
2025-02-04 11:08:46 +01:00
Mohit Paddhariya
3510ea9760
refactor: replace JSON.parse with parseJsonWithSchema (@dev-mohit06) (#6207)
## Description
Replaces raw JSON parsing with schema-based validation across frontend
TypeScript files to improve type safety and error handling.

### Scope of Changes
- Updated JSON parsing in:
  - `account.ts`
  - `import-export-settings.ts`
  - `analytics-controller.ts`
  - `local-storage-with-schema.ts`
  - `url-handler.ts`
  - `commandline/lists.ts`
  - `test/wikipedia.ts`

- Added schema in `test/custom-text.ts`:
  ```typescript
  export const customTextDataSchema = z.object({
    text: z.array(z.string()),
    mode: CustomTextModeSchema,
    limit: z.object({ 
      value: z.number(), 
      mode: CustomTextLimitModeSchema 
    }),
    pipeDelimiter: z.boolean(),
  });
  ```

### Benefits
- Enhanced runtime type safety
- More robust error handling
- Consistent JSON parsing approach

### Checks
- [x] Follows Conventional Commits
- [x] Includes GitHub username
- [ ] Adding quotes? (N/A)
- [ ] Adding language/theme? (N/A)

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-02-03 23:45:57 +01:00
Miodec
edd2903171 chore: bump eslint version 2025-01-21 11:50:09 +01:00
Miodec
c8fd68a601 refactor: config group definitions
- moved group definitionsg to the shared pacakge
 - made sure typescript will throw errors if a config is left without a group
 - removed the 'missing group' check because its not possible anymore
2025-01-15 00:04:22 +01:00
Miodec
c9789d6b1b feat: add tape margin 2025-01-06 18:02:52 +01:00
Christian Fehmer
9c0635ea68
fix: funbox plus x not working with custom text using pipe delimiter (@fehmer) (#6155)
Fixes #6151
2025-01-06 12:07:47 +01:00
Christian Fehmer
e2684c925c
fix: some funboxes not working if reduced motion is preferred (@fehmer) (#6104) 2025-01-06 11:34:08 +01:00
Christian Fehmer
353fc14b4e
refactor: move parseJsonWithSchema to utils package (@fehmer) (#6109) 2024-12-22 18:04:12 +01:00
Manish Kumar
2431ae3afa
chore: fix typo (@m4dd0c) (#6121) 2024-12-22 00:38:18 +01:00
Spurk
aa58a733a7
feat(funbox): add underscore_spaces funbox (@spurkus) (#6094) 2024-12-09 13:25:23 +01:00
Miodec
52fda9d8ed feat(funbox): add ALL CAPS 2024-12-09 13:10:02 +01:00
Jack
fdadb4ae83
refactor: move funboxes to a shared package (@miodec) (#6063) 2024-12-04 16:11:07 +01:00
Tamion
dea95a243c
feat(input): add 'code unindent on backspace' for code languages (@notTamion) (#5991) 2024-11-15 13:31:54 +01:00