Commit Graph

45 Commits

Author SHA1 Message Date
icslucas 9eb17ad93e Merge branch 'main' into Sound&Music 2025-08-20 16:17:01 +02:00
Scott Anderson 0a40bcebf0 Enable the sort-imports eslint rule (#1849)
## Description:

Enable the `sort-imports` eslint rule.

Fixes #1784

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
2025-08-17 20:53:44 -04:00
Scott Anderson a9e5aa0187 Enable eslint rule @stylistic/ts/indent (#1779)
## Description:

Enable eslint rule `@stylistic/ts/indent`. Fixes #1778

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
2025-08-11 22:26:48 -04:00
Aleksey Orekhovsky ee459b7410 Reduce Docker image size by refactoring map loading (#1621)
## Description:

This PR implements a major refactoring of how map data is stored and
loaded, as described in #1242. Previously, map data (`.bin` files) was
bundled directly into the client-side JavaScript by Webpack using
`binary-loader`. This approach led to data duplication and increased
bundle/image sizes.

This refactoring changes the strategy entirely:
- `GameMapLoader` interface has been introduced to decouple the map
loading mechanism from the components that use it.
- New `FetchGameMapLoader` implementation loads map data by fetching it
from static server endpoint.
- Webpack configuration and `Dockerfile` have been updated to serve the
map files as static assets and to remove the source `resources/maps`
directory from the final image, thus eliminating data duplication.

This leads to several key improvements:
- Docker image size is reduced from ~750 MB to ~600 MB.
- Build time is decreased. On my local machine, the docker image build
time went from 48s to 43s.
Most of this speed-up comes from faster Webpack builds (reduced from 16s
to 11s), as it no longer needs to process large binary files. This
performance gain will be noticeable for all developers during local
development, not just in the CI workflow.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aaa4xu
2025-08-01 04:49:07 +00:00
icslucas c312a6bc23 initial commit 2025-07-26 14:42:54 +02:00
Aleksey Orekhovsky 97eb48a650 Reduce docker image size with multi-stage build and dependency pruning (#1581)
## Description:
This PR focuses on trimming down docker image size while keeping runtime
behaviour intact.
This partially addresses #1242 by slimming the production Docker image
by ~33%.
```
$ docker image ls | grep openfront
openfrontio  latest   992fb420f131   1 minute ago   1.05GB   # new
evanpelle/openfront-prod <none> 216c629def78 6 hours ago 1.58GB   # current prod
```

The savings come from three areas:
- Refactor `Dockerfile` into a three‑stage build (dependencies / build /
runtime).
- Installs dev‑only node packages in a throw‑away layer and copies only
production modules to the final image.
- Updated `webpack.config.js` to skip copying `resources/maps/**/*`
which never referenced by the client.

Because the current codebase does not cleanly separate dev/prod
requirements, extensive regression testing is necessary; some latent
prod usage of dev‑only modules might surface.

## Please complete the following:
- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aaa4xu

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-07-26 02:36:13 -04:00
evanpelle adb0d07074 Make patterns puchasable with stripe (#1313)
## Description:
Patterns now show how much each skin costs and can be purchased

* Refactored logic out of TerritoryPatternsModal and into Cosmetics.ts
* Role gated cosmetics are not shown if you don't have the role. This is
to prevent people trying to get roles just for the cosmetics.
* Added purchasable cosmetics.
* On purchase the backend adds the flare to the player account

<img width="1197" alt="Screenshot 2025-07-01 at 11 45 52 AM"
src="https://github.com/user-attachments/assets/b4b4b7ea-f5f4-4c61-9ced-b608f75aa9d7"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-07-02 20:03:58 -07:00
Vivacious Box c5c04a8d83 Show structure levels (#1305)
## Description:

Show structure levels on the structureIconsLayer
Add new bitmap font (modified from this font:
https://frostyfreeze.itch.io/pixel-bitmap-fonts-png-xml CC0 license)

![image](https://github.com/user-attachments/assets/8c077ec9-00bb-4f36-a9e7-6d81aec3a90f)

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Vivacious Box
2025-07-01 17:09:18 -07:00
Scott Anderson b9a379e21c cache busting: Import version, changelog (#1201)
## Description:

Import version, changelog statically using webpack for cache busting
purposes.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-06-17 00:25:18 -04:00
Scott Anderson a1a4b22351 Set singleplayer gitCommit in the client (#945)
## Description:

Set singleplayer gitCommit in the client

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-05-29 16:47:28 -07:00
evan c5152f035f add endpoint to kick players from a game given admin token, game id & client id 2025-05-09 13:00:39 -07:00
Scott Anderson 9a3983d014 ESLint improvements (#388)
## Description

Adds various features to improve the DX with eslint:

### Webpack

- Use `eslint-webpack-plugin` for better observability of lint errors
during development.

### Ignored files

- Enable `.gitignore` support for eslint.

### Commit hook

- Add `eslint --fix` to pre-commit hook.

### Github actions
- Add eslint check to a new github action workflow.
- Use `eslint-formatter-gha` to annotate PR files with lint failures
(see the Files changed tab,
[example](https://github.com/openfrontio/OpenFrontIO/pull/388/commits/73862230be5aad7b18e122b1cd4ab05fc9570b2c)).


![image](https://github.com/user-attachments/assets/b399b92e-8eb0-48e1-92b7-ce630ccf12e1)

## Testing

These changes have been validated through local testing and through
Github workflows.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

fake.neo

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-02 09:09:38 -07:00
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
evanpelle 099dc74a36 fix webpack: always copy over static contents (#360)
The problem with the file check, was it only checked if a file was
missing and not if it changed.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-03-27 17:52:10 -07:00
Mittanicz 6678d6e36e Image optimalization (#343)
I have minify images and convert them to webp format that reduce size
and keep quality.
Reduce size of bg image since its already blured by css so no need to
have it that big.

Reduce size of thumbs and helper images in helper modals should be fine
since they will not exceed the container size. Even that make them
larger than containter just to be safe
2025-03-26 10:05:45 -07:00
Mittanicz 166ef92970 Create base components button, modal .. (#331)
Create base components with shared styles, as start of make ui better.
For now shoul look same but underhood new copoments are used.

This should be first PR that handle this and many more comes. I am in
rush due conflict with other ppl, but should work as i tested.

Testing again and look at structure

Main goal i have global css not scope in component die loading times and
size of elements. (Modal due nature of lit and shadow dom is exception,
maybe later find better way).

Documenting the components will happen later as base components
establish their usage.
2025-03-24 10:34:27 -07:00
Evan d936a3aca6 fix put path 2025-03-06 09:41:28 -08:00
Evan dacd9607e4 update ttl, use file based hashing to prevent stale data. 2025-03-05 20:14:49 -08:00
Evan 3a0bc594ae use api prefix 2025-03-05 18:04:22 -08:00
Evan 2b26cfbbc9 update aws deployment, have client get env from server 2025-03-05 12:37:37 -08:00
Evan be5157a25c have nginx cache static assets 2025-03-05 08:04:12 -08:00
Evan 3494c54906 use node cluster to shard server 2025-02-27 10:45:30 -08:00
Evan 19794e4c65 add express rate limiting 2025-02-23 19:38:17 -08:00
Evan 969886331c create discord login button & flow 2025-02-16 12:18:50 -08:00
NewHappyRabbit e0aa6b5d9c Ran prettier 2025-02-12 21:30:43 +02:00
NewHappyRabbit e1a6c5f7bd Merge branch 'main' of https://github.com/openfrontio/OpenFrontIO into SPA 2025-02-12 20:03:26 +02:00
Evan 2df3db7292 format root dir 2025-02-12 08:38:56 -08:00
NewHappyRabbit 1e1942ab1c TODO: Keep working 2025-02-12 02:08:29 +02:00
NewHappyRabbit c1732f4704 Added clean up of /out before building in webpack 2025-02-12 01:15:15 +02:00
NewHappyRabbit 6677936f97 All files from resources directory are now copied to build folder so they can be used directly without importing them in files.
Added flag selection.
2025-02-11 20:51:40 +02:00
Evan 348a4a611a add tailwind 2025-02-01 12:05:11 -08:00
Mittani aa01ea7694 + add random bot names 2024-12-31 13:05:22 -08:00
Evan 7669105a1b record games in gcs 2024-12-07 18:30:04 -08:00
evanpelle 3885b39442 now get message if join sucessful 2024-10-15 17:51:46 -07:00
evanpelle 42a6a2fcef can creater & join lobby 2024-10-14 20:45:31 -07:00
evanpelle 3a2cd4e326 rename Client.ts -> Main.ts 2024-10-12 18:57:52 -07:00
evanpelle 534d97abb3 create basic win popup 2024-09-16 11:51:24 -07:00
evanpelle a7ad8790aa fakehumans send boats, improved map 2024-09-08 20:21:39 -07:00
evanpelle ac556ee073 preprocess map into binary data 2024-08-22 21:01:40 -07:00
evanpelle 8bd86d0384 trying to build protos 2024-08-20 08:11:41 -07:00
evanpelle f1bddc7eef use overpass font 2024-08-18 20:38:25 -07:00
evanpelle 19c826d944 improve front page 2024-08-17 20:56:11 -07:00
evanpelle 0ea670d975 better game join logic, create dev and prod configs 2024-08-17 12:42:18 -07:00
evanpelle 001722bd59 added deployment 2024-08-13 20:07:20 -07:00
evanpelle 05f55c490f First Commit 2024-08-04 19:51:23 -07:00