Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tzhf committed Apr 8, 2024
1 parent 2481564 commit 08a24cc
Show file tree
Hide file tree
Showing 452 changed files with 18,571 additions and 19,357 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
11 changes: 5 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
CG_PUBLIC_URL=chatguessr.com
CG_API_URL=https://chatguessr.com/api
SOCKET_SERVER_URL=<SOCKET_SERVER_URL>
SUPABASE_URL=<SUPABASE_URL>
SUPABASE_ANON_KEY=<SUPABASE_ANON_KEY>
NODE_ENV=<development|production>
VITE_CG_PUBLIC_URL=chatguessr.com
VITE_CG_API_URL=https://chatguessr.com/api
VITE_SOCKET_SERVER_URL=<SOCKET_SERVER_URL>
VITE_SUPABASE_URL=<SUPABASE_URL>
VITE_SUPABASE_ANON_KEY=<SUPABASE_ANON_KEY>
26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"plugins": ["vue", "@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:vue/vue3-recommended",
"@vue/eslint-config-typescript/recommended",
"@vue/eslint-config-prettier"
],
"rules": {
"no-empty": ["error", { "allowEmptyCatch": true }],
"@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "warn",
"vue/multi-word-component-names": "off",
"vue/no-v-html": "off"
}
}
47 changes: 26 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@ name: CI

on: [push, pull_request]

env:
VITE_CG_PUBLIC_URL: ${{secrets.VITE_CG_PUBLIC_URL}}
VITE_CG_API_URL: ${{secrets.VITE_CG_API_URL}}
VITE_SOCKET_SERVER_URL: ${{secrets.VITE_SOCKET_SERVER_URL}}
VITE_SUPABASE_URL: ${{secrets.VITE_SUPABASE_URL}}
VITE_SUPABASE_ANON_KEY: ${{secrets.VITE_SUPABASE_ANON_KEY}}

jobs:
types:
name: Types
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Check types
Expand All @@ -22,45 +29,43 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
package:
name: Package
needs: [test, types]
needs: [types, test]
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{matrix.os}}
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Write .env
run: node create-env.js
env:
CG_PUBLIC_URL: ${{secrets.CG_PUBLIC_URL}}
CG_API_URL: ${{secrets.CG_API_URL}}
SOCKET_SERVER_URL: ${{secrets.SOCKET_SERVER_URL}}
SENTRY_DSN: ${{secrets.SENTRY_DSN}}
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
SUPABASE_ANON_KEY: ${{secrets.SUPABASE_ANON_KEY}}
TWITCH_CLIENT_ID: ${{secrets.TWITCH_CLIENT_ID}}
# - name: Write .env
# run: node create-env.js
# env:
# VITE_CG_PUBLIC_URL: ${{secrets.VITE_CG_PUBLIC_URL}}
# VITE_CG_API_URL: ${{secrets.VITE_CG_API_URL}}
# VITE_SOCKET_SERVER_URL: ${{secrets.VITE_SOCKET_SERVER_URL}}
# VITE_SUPABASE_URL: ${{secrets.VITE_SUPABASE_URL}}
# VITE_SUPABASE_ANON_KEY: ${{secrets.VITE_SUPABASE_ANON_KEY}}
- name: Package
run: npm run package
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Chatguessr-${{runner.os}}
path: out/*/
34 changes: 19 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
release:
types: [created]

env:
VITE_CG_PUBLIC_URL: ${{secrets.VITE_CG_PUBLIC_URL}}
VITE_CG_API_URL: ${{secrets.VITE_CG_API_URL}}
VITE_SOCKET_SERVER_URL: ${{secrets.VITE_SOCKET_SERVER_URL}}
VITE_SUPABASE_URL: ${{secrets.VITE_SUPABASE_URL}}
VITE_SUPABASE_ANON_KEY: ${{secrets.VITE_SUPABASE_ANON_KEY}}

jobs:
release:
name: Publish release
Expand All @@ -15,29 +22,26 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Write .env
run: node create-env.js
env:
CG_PUBLIC_URL: ${{secrets.CG_PUBLIC_URL}}
CG_API_URL: ${{secrets.CG_API_URL}}
SOCKET_SERVER_URL: ${{secrets.SOCKET_SERVER_URL}}
SENTRY_DSN: ${{secrets.SENTRY_DSN}}
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
SUPABASE_ANON_KEY: ${{secrets.SUPABASE_ANON_KEY}}
TWITCH_CLIENT_ID: ${{secrets.TWITCH_CLIENT_ID}}
# - name: Write .env
# run: node create-env.js
# env:
# VITE_CG_PUBLIC_URL: ${{secrets.VITE_CG_PUBLIC_URL}}
# VITE_CG_API_URL: ${{secrets.VITE_CG_API_URL}}
# VITE_SOCKET_SERVER_URL: ${{secrets.VITE_SOCKET_SERVER_URL}}
# VITE_SUPABASE_URL: ${{secrets.VITE_SUPABASE_URL}}
# VITE_SUPABASE_ANON_KEY: ${{secrets.VITE_SUPABASE_ANON_KEY}}
- name: Publish
run: npm run publish
env:
GITHUB_TOKEN: ${{github.token}}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Chatguessr-${{runner.os}}
path: out/*/

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.vite
out
dist
*.log*
.env
.parcel-cache
out/
5 changes: 5 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
singleQuote: true
semi: false
printWidth: 100
trailingComma: none
endOfLine: auto
44 changes: 32 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,56 @@
# ChatGuessr

> Play GeoGuessr on Stream with Twitch Chat.
This is the source code for the ChatGuessr application. Are you a streamers or player? Check [the website](https://chatguessr.com) instead.
<div align="center">
<img src="./build/icon.png" style="width:40px">
<h1>ChatGuessr</h1>
</div>

<p align="center">
<a href="https://github.com/tzhf/chatguessr/releases">
<img alt="releases url" src="https://img.shields.io/github/v/release/tzhf/chatguessr?style=for-the-badge&labelColor=1C1E26&color=61ffca"/>
</a>
<a href="https://github.com/tzhf/chatguessr/blob/main/LICENSE">
<img alt="license url" src="https://img.shields.io/badge/license%20-MIT-1C1E26?style=for-the-badge&labelColor=1C1E26&color=61ffca"/>
</a>
<a href="https://paypal.me/chatguessr">
<img alt="paypal url" src="https://img.shields.io/badge/support%20on-paypal-1C1E26?style=for-the-badge&labelColor=1C1E26&color=B181F1"/>
</a>
</p>

<p align=center>This is the source code for the ChatGuessr application. Are you a streamer or a player ? Check <a href="https://chatguessr.com">the website</a> instead.</span></p>

## Build

Run the application in development mode:

```
npm start
npm run dev
```

Run unit tests:

```
npm test
```

Typecheck JSDoc:
Typecheck

```
npm run typecheck
```

Build the application for the current platform:
Lint

```
npm run package
npm run lint
```

Build an installer for the current platform:
Format

```
npm run make
npm run format
```

## License

The ChatGuessr source is available under the [MIT License](./LICENSE).

The Montserrat and Comfortaa fonts are used under the [Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL).
The Montserrat font is used under the [Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL).
37 changes: 0 additions & 37 deletions assets/extenssr-styles.css

This file was deleted.

1 change: 0 additions & 1 deletion assets/flags/USME.svg

This file was deleted.

1 change: 0 additions & 1 deletion assets/flags/USMT.svg

This file was deleted.

1 change: 0 additions & 1 deletion assets/flags/USVT.svg

This file was deleted.

Binary file removed assets/fonts/Comfortaa-Bold.ttf
Binary file not shown.
Binary file removed assets/fonts/Comfortaa-Regular.ttf
Binary file not shown.
Binary file removed assets/fonts/montserrat-regular-webfont.woff
Binary file not shown.
1 change: 0 additions & 1 deletion assets/icons/gear.svg

This file was deleted.

18 changes: 0 additions & 18 deletions assets/icons/scoreboard_hidden.svg

This file was deleted.

3 changes: 0 additions & 3 deletions assets/icons/scoreboard_visible.svg

This file was deleted.

1 change: 0 additions & 1 deletion assets/icons/start_flag.svg

This file was deleted.

18 changes: 0 additions & 18 deletions assets/icons/timer_hidden.svg

This file was deleted.

3 changes: 0 additions & 3 deletions assets/icons/timer_visible.svg

This file was deleted.

Loading

0 comments on commit 08a24cc

Please sign in to comment.