Skip to content
Open
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
22 changes: 11 additions & 11 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@
- [ ] Make sure to include translations for the quotes in the description (or another comment) so we can verify their content.
- [ ] Adding a language?
- Make sure to follow the [languages documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md)
- [ ] Add language to `packages/schemas/src/languages.ts`
- [ ] Add language to exactly one group in `frontend/src/ts/constants/languages.ts`
- [ ] Add language json file to `frontend/static/languages`
- [ ] Add language to [packages/schemas/src/languages.ts](https://github.com/monkeytypegame/monkeytype/blob/master/packages/schemas/src/languages.ts)
- [ ] Add language to exactly one group in [frontend/src/ts/constants/languages.ts](https://github.com/monkeytypegame/monkeytype/blob/master/frontend/src/ts/constants/languages.ts)
- [ ] Add language json file to [frontend/static/languages](https://github.com/monkeytypegame/monkeytype/blob/master/frontend/static/languages)
- [ ] Adding a theme?
- Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md)
- [ ] Add theme to `packages/schemas/src/themes.ts`
- [ ] Add theme to `frontend/src/ts/constants/themes.ts`
- [ ] (optional) Add theme css file to `frontend/static/themes`
- [ ] Add theme to [packages/schemas/src/themes.ts](https://github.com/monkeytypegame/monkeytype/blob/master/packages/schemas/src/themes.ts)
- [ ] Add theme to [frontend/src/ts/constants/themes.ts](https://github.com/monkeytypegame/monkeytype/blob/master/frontend/src/ts/constants/themes.ts)
- [ ] (optional) Add theme css file to [frontend/static/themes](https://github.com/monkeytypegame/monkeytype/blob/master/frontend/static/themes)
- [ ] Add some screenshots of the theme, especially with different test settings (colorful, flip colors) to your pull request
- [ ] Adding a layout?
- [ ] Make sure to follow the [layouts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md)
- [ ] Add layout to `packages/schemas/src/layouts.ts`
- [ ] Add layout json file to `frontend/static/layouts`
- [ ] Add layout to [packages/schemas/src/layouts.ts](https://github.com/monkeytypegame/monkeytype/blob/master/packages/schemas/src/layouts.ts)
- [ ] Add layout json file to [frontend/static/layouts](https://github.com/monkeytypegame/monkeytype/blob/master/frontend/static/layouts)
- [ ] Adding a font?
- Make sure to follow the [fonts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md)
- [ ] Add font file to `frontend/static/webfonts`
- [ ] Add font to `packages/schemas/src/fonts.ts`
- [ ] Add font to `frontend/src/ts/constants/fonts.ts`
- [ ] Add font file to [frontend/static/webfonts](https://github.com/monkeytypegame/monkeytype/blob/master/frontend/static/webfonts)
- [ ] Add font to [packages/schemas/src/fonts.ts](https://github.com/monkeytypegame/monkeytype/blob/master/packages/schemas/src/fonts.ts)
- [ ] Add font to [frontend/src/ts/constants/fonts.ts](https://github.com/monkeytypegame/monkeytype/blob/master/frontend/src/ts/constants/fonts.ts)
- [ ] Check if any open issues are related to this PR; if so, be sure to tag them below.
- [ ] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info)
- [ ] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title.
Expand Down
35 changes: 9 additions & 26 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ For types, we use the following:
- `perf`: A code change that improves performance
- `test`: Adding missing tests or correcting existing tests
- `build`: Changes that affect the build system or external dependencies (example scopes: vite, tsup-node, npm)
- `ci`: Changes to our CI configuration files and scripts (example scopes: GitHub Workflows)
- `ci`: Changes to our CI configuration files and scripts (e.g., GitHub Workflows)
- `revert`: Reverts a previous commit
- `chore`: Other changes that don't apply to any of the above

Expand All @@ -50,45 +50,28 @@ For types, we use the following:
- `impr(quotes): add english quotes (@username)`
- `fix(leaderboard): show user rank correctly (@user1, @user2, @user3)`

### Theme Guidelines
### Adding Themes

<!-- TODO: add screenshots to provide examples for dos and don'ts -->

Before submitting a theme make sure...

- your theme is unique and isn't visually similar to any we already have.
- the text color is either black or white (or very close to these colors)
- your theme has been added to the `_list` file and the `textColor` property is the theme's main color
- your theme is clear and readable with both `flip test colors` and `colorful mode` enabled and disabled

If you want to contribute themes but don't know how, check [THEMES.md](/docs/THEMES.md)

### Language Guidelines

- Do not include expletive words
- Ensure that your contribution meets JSON standards (no trailing comma at the end of a list)
- Be sure to add your language to the `_list` and `_groups` files
- Make sure the number of words in the file corresponds to the file name (for example: `languageName.json` is 200 words, `languageName_1k.json` is 1000 words, and so on)
### Adding Languages

If you want to contribute languages but don't know how, check [LANGUAGES.md](/docs/LANGUAGES.md)

### Quote Guidelines

- Do not include content that contains any libelous or otherwise unlawful, abusive, or obscene text.
- Ensure that your contribution meets JSON standards (no trailing comma at the end of a list)
- Verify quotes added aren't duplicates of any already present
- Verify the `length` property is correct (length of the text in characters)
- Verify the `id` property is incremented correctly
- Please do not add extremely short quotes (less than 60 characters)
- For quotes not in English, please include translations of quotes in the description of your pull request. This assists in the verification process to ensure the integrity of the quotes.
- Remember to name your pull request properly. For example, if you are adding new quotes for the language `French`, your pull request should be named `impr(quotes): add French quotes`.
### Adding Quotes

If you want to contribute quotes but don't know how, check [QUOTES.md](/docs/QUOTES.md)

### Layout Guidelines
### Adding Layouts

If you want to contribute layouts but don't know how, check [LAYOUTS.md](/docs/LAYOUTS.md)
Comment thread
Leonabcd123 marked this conversation as resolved.

### Adding Fonts

If you want to contribute fonts but don't know how, check [FONTS.md](/docs/FONTS.md)

## Questions

If you have any questions, comments, concerns, or problems let me know on [GitHub](https://github.com/Miodec), [Discord](https://discord.gg/monkeytype) in the `#development` channel, or ask a question on Monkeytype's [GitHub discussions](https://github.com/monkeytypegame/monkeytype/discussions) and a contributor will be happy to assist you.
8 changes: 4 additions & 4 deletions docs/CONTRIBUTING_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ The account system will not let you create an account without a Firebase project
1. Generate a Firebase Admin private key (optional, only needed if you want to work on the backend)
- In your Firebase console, go to Project Settings > Service Accounts
- Click "Generate New Private Key"
- Save as `serviceAccountKey.json` inside the `backend/src/credentials/` directory.
- Save as `serviceAccountKey.json` inside the [backend/src/credentials](/backend/src/credentials) directory.

1. Run `pnpm add -g firebase-tools` to install the Firebase Command Line Interface.
1. Run `firebase login` on your terminal to log in to the same Google account you just used to create the project.
1. Within the `frontend` directory, duplicate `.firebaserc_example`, rename the new file to `.firebaserc` and change the project name to the firebase project id you just created.
1. Within the [frontend](/frontend) directory, duplicate [.firebaserc_example](/frontend/.firebaserc_example), rename the new file to `.firebaserc` and change the project name to the firebase project id you just created.
- Run `firebase projects:list` to find your firebase project ID.
- If `.firebaserc_example` does not exist after cloning, create your own with:

Expand All @@ -79,7 +79,7 @@ The account system will not let you create an account without a Firebase project

### Config file

Within the `frontend/src/ts/constants` directory, duplicate `firebase-config-example.ts`, rename it to `firebase-config.ts`
Within the [frontend/src/ts/constants](/frontend/src/ts/constants) directory, duplicate `firebase-config-example.ts`, rename it to `firebase-config.ts`

- If you skipped the Firebase step, you can leave the fields blank
- Otherwise:
Expand Down Expand Up @@ -152,7 +152,7 @@ If you are on a UNIX system and you get a spawn error, run npm with `sudo`.

Code formatting and linting is enforced by [Oxc (Oxfmt and Oxlint)](https://github.com/oxc-project/oxc), which automatically runs every time you make a commit.

For guidelines on commit messages, adding themes, languages, or quotes, please refer to [CONTRIBUTING.md](./CONTRIBUTING.md). Following these guidelines will increase the chances of getting your change accepted.
For guidelines on commit messages, adding themes, languages, layouts, fonts or quotes, please refer to [CONTRIBUTING.md](./CONTRIBUTING.md). Following these guidelines will increase the chances of getting your change accepted.

## Questions

Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING_BASIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ There are two methods for making a change in the code.

#### Option 1 - Visual Studio Code Web Editor (Recommended)

If you are not a developer and wish to contribute themes, new languages, or quotes, having a text editor will make contributions _much_ easier. To make complex edits without installing anything, we recommend using GitHub's VS Code web editor. In your fork of Monkeytype (fork it first), go to the `Code` tab of the repo and press <kbd>.</kbd>(the period/dot key). This will open up the repo in an online VS Code instance you can use to edit files in the browser. Once you are done making your changes, go to the Source Control tab in the activity bar with <kbd>Ctrl/Cmd + Shift + G</kbd>, click the `+` next to the files you've changed to stage them, type a brief message summarizing the changes made in the commit, and press <kbd>Ctrl/Cmd + Enter</kbd> to commit your changes to your fork.
If you are not a developer and wish to contribute themes, new languages, or quotes, having a text editor will make contributions _much_ easier. To make complex edits without installing anything, we recommend using GitHub's VS Code web editor. In your fork of Monkeytype (fork it first), go to the `Code` tab of the repo and press <kbd>.</kbd> (the period/dot key). This will open up the repo in an online VS Code instance you can use to edit files in the browser. Once you are done making your changes, go to the Source Control tab in the activity bar with <kbd>Ctrl/Cmd + Shift + G</kbd>, click the `+` next to the files you've changed to stage them, type a brief message summarizing the changes made in the commit, and press <kbd>Ctrl/Cmd + Enter</kbd> to commit your changes to your fork.

Once done, move on to the [next section to create a pull request](#creating-a-pull-request).

Expand Down Expand Up @@ -89,4 +89,4 @@ Once your PR is approved, all that is left to do is merge it!

## Questions

If you have any questions, comments, concerns, or problems, don't hesitate to let us know via [email](mailto:jack@monkeytype.com)(to Miodec), on [GitHub](https://github.com/monkeytypegame/monkeytype/discussions) or on [Discord](https://discord.gg/monkeytype) in the [`#development`](https://discord.com/channels/713194177403420752/713196019206324306) channel and a contributor will be happy to assist you.
If you have any questions, comments, concerns, or problems, don't hesitate to let us know via [email](mailto:jack@monkeytype.com) (to Miodec), on [GitHub](https://github.com/monkeytypegame/monkeytype/discussions) or on [Discord](https://discord.gg/monkeytype) in the [`#development`](https://discord.com/channels/713194177403420752/713196019206324306) channel and a contributor will be happy to assist you.
14 changes: 7 additions & 7 deletions docs/FONTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ First, you will have to make a personal copy of the Monkeytype repository, also

## Adding Fonts

Once you have forked the repository you can now add your font. Place the font file in `./frontend/static/webfonts` e.g. `My-Font.woff2`.
Once you have forked the repository you can now add your font. Place the font file in [frontend/static/webfonts](/frontend/static/webfonts) e.g. `My-Font.woff2`.

> [!NOTE]
> Your font needs to be in the `.woff2` format. Your filename cannot include spaces or start with a number.

Open `./packages/schemas/src/fonts.ts` and add the new font at the _end_ of the `KnownFontNameSchema` list like this:
Open [packages/schemas/src/fonts.ts](/packages/schemas/src/fonts.ts) and add the new font at the _end_ of the `KnownFontNameSchema` list like this:

```typescript
const KnownFontNameSchema = z.enum(
Expand All @@ -31,7 +31,7 @@ const KnownFontNameSchema = z.enum(

Call it whatever you want but make sure you replace spaces with underscores and the font does not start with a number.

Then, go to `./frontend/src/ts/constants/fonts.ts` and add the following code to the _end_ of the `Fonts` object near to the very end of the file:
Then, go to [frontend/src/ts/constants/fonts.ts](/frontend/src/ts/constants/fonts.ts) and add the following code to the _end_ of the `Fonts` object near to the very end of the file:

```typescript
export const Fonts: Record<KnownFontName, FontConfig> = {
Expand All @@ -41,16 +41,16 @@ export const Fonts: Record<KnownFontName, FontConfig> = {
}
```

### Committing Languages
### Committing Fonts

Once you have created your language, you now need to create a pull request to the main Monkeytype repository. Go to the branch where you created your languages on GitHub. Then make sure your branch is up to date. Once it is up to date, click "contribute".
Once you have created your font(s), you now need to create a pull request to the main Monkeytype repository. Go to the branch where you created your fonts on GitHub. Then make sure your branch is up to date. Once it is up to date, click "contribute".

Update branch:
<img width="1552" alt="Screenshot showing how to update the fork to match the main Monkeytype repository" src="https://user-images.githubusercontent.com/83455454/149186547-5b9fe4fd-b944-4eed-a959-db43f96198bf.png">

Create a pull request:
<img width="1552" alt="Screenshot showing how to create a pull request to the main Monkeytype repository" src="https://user-images.githubusercontent.com/83455454/149186637-66dae488-05ae-45c4-9217-65bc36c4927b.png">

## Language Guidelines
## Font Guidelines

Make sure your language follows the [Language guidelines](./CONTRIBUTING.md#language-guidelines).
- Ensure that your font is distinct from existing fonts.
10 changes: 6 additions & 4 deletions docs/LANGUAGES.md
Comment thread
Leonabcd123 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ First, you will have to make a personal copy of the Monkeytype repository, also

## Creating Languages

Once you have forked the repository you can now add your language. Create a new JSON file in `./frontend/static/languages/`, named as the language name and the number of words, e.g. `language_1k.json`. If there are less than 1,000 words, simply name the file after the language (e.g. `language.json`). Note that a minimum of 200 words are required.
Once you have forked the repository you can now add your language. Create a new JSON file in [frontend/static/languages](/frontend/static/languages), named as the language name and the number of words, e.g. `language_1k.json`. If there are less than 1,000 words, simply name the file after the language (e.g. `language.json`). Note that a minimum of 200 words are required.

The contents of the file should be as follows:

Expand All @@ -31,7 +31,7 @@ The contents of the file should be as follows:
It is recommended that you familiarize yourselves with JSON before adding a language. For the `name` field, put the name of your language. `rightToLeft` indicates how the language is written. If it is written right to left then put `true`, otherwise put `false`.
`ligatures` A ligature occurs when multiple letters are joined together to form a character [more details](<https://en.wikipedia.org/wiki/Ligature_(writing)>). If there's joining in the words, which is the case in languages like (Arabic, Malayalam, Persian, Sanskrit, Central_Kurdish... etc.), then set the value to `true`, otherwise set it to `false`. For `bcp47` put your languages [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag). If the words you're adding are ordered by frequency (most common words at the top, least at the bottom) set the value of `orderedByFrequency` to `true`, otherwise `false`. Finally, add your list of words to the `words` field.

Then, go to `packages/schemas/src/languages.ts` and add your new language name at the _end_ of the `LanguageSchema` enum. Make sure to end the line with a comma. Make sure to add all your language names if you have created multiple word lists of differing lengths in the same language.
Then, go to [packages/schemas/src/languages.ts](/packages/schemas/src/languages.ts) and add your new language name at the _end_ of the `LanguageSchema` enum. Make sure to end the line with a comma. Make sure to add all your language names if you have created multiple word lists of differing lengths in the same language.

```typescript
export const LanguageSchema = z.enum([
Expand All @@ -42,7 +42,7 @@ export const LanguageSchema = z.enum([
]);
```

Then, go to `frontend/src/ts/constants/language.ts` and add your new language name to the `LanguageGroups` map. You can either add it to an existing group or add a new one. Make sure to add all your language names if you have created multiple word lists of differing lengths in the same language.
Then, go to [frontend/src/ts/constants/languages.ts](/frontend/src/ts/constants/languages.ts) and add your new language name to the `LanguageGroups` map. You can either add it to an existing group or add a new one. Make sure to add all your language names if you have created multiple word lists of differing lengths in the same language.

```typescript
export const LanguageGroups: Record<string, Language[]> = {
Expand All @@ -66,4 +66,6 @@ Create a pull request:

## Language Guidelines

Make sure your language follows the [Language guidelines](./CONTRIBUTING.md#language-guidelines).
- Do not include expletive words
- Ensure that your contribution meets JSON standards (no trailing comma at the end of a list)
- Make sure the number of words in the file corresponds to the file name (for example: `languageName.json` is 200 words, `languageName_1k.json` is 1000 words, and so on)
Loading
Loading